From 44bfad0e3aaf8ad8225508f0463b3b89d998029f Mon Sep 17 00:00:00 2001 From: Volodymyr Vygovskyi Date: Wed, 3 Apr 2019 12:22:45 +0300 Subject: [PATCH 001/586] #631 Convert CreateCmsPageEntityTest to MFTF --- .../AssertCMSPageContentActionGroup.xml | 12 ++ .../FillOutCMSPageContentActionGroup.xml | 17 ++ .../CmsNewPagePageBasicFieldsSection.xml | 1 + .../Mftf/Section/CmsNewPagePiwSection.xml | 1 + .../Test/AdminCreateCmsPageEntityTest.xml | 146 ++++++++++++++++++ 5 files changed, 177 insertions(+) create mode 100644 app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsPageEntityTest.xml diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageContentActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageContentActionGroup.xml index dde6237390257..e8861ff089faa 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageContentActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageContentActionGroup.xml @@ -23,6 +23,18 @@ + + + + + + + + + {{storeId}} + grabValueFromStoreView + + diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/FillOutCMSPageContentActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/FillOutCMSPageContentActionGroup.xml index e47ff472ccdcb..b1f66f166472e 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/FillOutCMSPageContentActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/FillOutCMSPageContentActionGroup.xml @@ -11,7 +11,24 @@ + + + + + + + + + + + + + + + + + diff --git a/app/code/Magento/Cms/Test/Mftf/Section/CmsNewPagePageBasicFieldsSection.xml b/app/code/Magento/Cms/Test/Mftf/Section/CmsNewPagePageBasicFieldsSection.xml index 7288e5d455d52..92170c447fa11 100644 --- a/app/code/Magento/Cms/Test/Mftf/Section/CmsNewPagePageBasicFieldsSection.xml +++ b/app/code/Magento/Cms/Test/Mftf/Section/CmsNewPagePageBasicFieldsSection.xml @@ -12,6 +12,7 @@ + diff --git a/app/code/Magento/Cms/Test/Mftf/Section/CmsNewPagePiwSection.xml b/app/code/Magento/Cms/Test/Mftf/Section/CmsNewPagePiwSection.xml index bd487e3b2c03c..b22cbbe6b0843 100644 --- a/app/code/Magento/Cms/Test/Mftf/Section/CmsNewPagePiwSection.xml +++ b/app/code/Magento/Cms/Test/Mftf/Section/CmsNewPagePiwSection.xml @@ -11,5 +11,6 @@
+
\ No newline at end of file diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsPageEntityTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsPageEntityTest.xml new file mode 100644 index 0000000000000..253f5e5fb4c67 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsPageEntityTest.xml @@ -0,0 +1,146 @@ + + + + + + + + <description value="Admin should be able to create a CMS Page"/> + <group value="backend"/> + <group value="cMSContent"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + </before> + <after> + <!--Disable single store mode--> + <magentoCLI command="config:set general/single_store_mode/enabled 0" stepKey="disableSingleStoreMode"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!--Create CMS Content Page--> + <!--Go to New CMS Page page--> + <amOnPage url="{{CmsNewPagePage.url}}" stepKey="navigateToCreateNewPage"/> + <waitForPageLoad stepKey="waitForNewPagePageLoad"/> + <actionGroup ref="FillOutCMSPageContent" stepKey="fillBasicPageData"/> + <!--verify successfully saved--> + <actionGroup ref="saveCmsPage" stepKey="saveNewPage"/> + <!--verify page on frontend--> + <amOnPage url="{{StorefrontHomePage.url}}/{{_duplicatedCMSPage.identifier}}" stepKey="amOnPageTestPage"/> + <actionGroup ref="AssertStoreFrontCMSPage" stepKey="verifyPageDataOnFrontend"> + <argument name="cmsTitle" value="{{_duplicatedCMSPage.title}}"/> + <argument name="cmsContent" value="{{_duplicatedCMSPage.content}}"/> + <argument name="cmsContentHeading" value="{{_duplicatedCMSPage.content_heading}}"/> + </actionGroup> + <!--verify page in grid--> + <actionGroup ref="navigateToCreatedCMSPage" stepKey="verifyPageInGrid"> + <argument name="CMSPage" value="_duplicatedCMSPage"/> + </actionGroup> + <actionGroup ref="DeletePageByUrlKeyActionGroup" stepKey="deletePage"> + <argument name="UrlKey" value="{{_duplicatedCMSPage.identifier}}"/> + </actionGroup> + + <!--Create page for default store view--> + <!--Go to New CMS Page page--> + <amOnPage url="{{CmsNewPagePage.url}}" stepKey="navigateToCreateNewPage2"/> + <waitForPageLoad stepKey="waitForNewPagePageLoad2"/> + <!--Fill the CMS page form--> + <actionGroup ref="FillOutCMSPageContent" stepKey="fillBasicPageDataForPageWithDefaultStore"/> + <actionGroup ref="SelectCMSPageStoreView" stepKey="selectCMSPageStoreView"> + <argument name="storeViewName" value="Default Store View"/> + </actionGroup> + <!--Verify successfully saved--> + <actionGroup ref="saveCmsPage" stepKey="savePageWithDefaultStore"/> + <!--Navigate to page in Admin--> + <actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCMSPageWithDefaultStoreInAdmin"> + <argument name="CMSPage" value="_duplicatedCMSPage"/> + </actionGroup> + <!--Verify Page Data in Admin--> + <actionGroup ref="AssertCMSPageContent" stepKey="verifyPageWithDefaultStoreDataInAdmin"/> + <!--Verify Store ID--> + <actionGroup ref="AssertCMSPageStoreId" stepKey="verifyStoreId"> + <argument name="storeId" value="1"/> + </actionGroup> + <!--Delete page--> + <actionGroup ref="DeletePageByUrlKeyActionGroup" stepKey="deletePageWithDefaultStore"> + <argument name="UrlKey" value="{{_duplicatedCMSPage.identifier}}"/> + </actionGroup> + + <!--Block Cache Exploit--> + <!--Go to New CMS Page page--> + <amOnPage url="{{CmsNewPagePage.url}}" stepKey="navigateToCreateNewPage3"/> + <waitForPageLoad stepKey="waitForNewPagePageLoad3"/> + <!--Fill the CMS page form--> + <actionGroup ref="FillOutCMSPageContent" stepKey="fillBasicPageDataForPageWithBlock"/> + <fillField selector="{{CmsNewPagePageContentSection.content}}" userInput="{{block class='Magento\Framework\View\Element\Text' text='bla bla bla' cache_key='BACKEND_ACL_RESOURCES' cache_lifetime=999}}" stepKey="fillFieldContent"/> + <actionGroup ref="SelectCMSPageStoreView" stepKey="selectCMSPageStoreViewForPageWithBlock"> + <argument name="storeViewName" value="Default Store View"/> + </actionGroup> + <!--Verify successfully saved--> + <actionGroup ref="saveCmsPage" stepKey="savePageWithBlock"/> + <!--verify page on frontend--> + <amOnPage url="{{StorefrontHomePage.url}}/{{_duplicatedCMSPage.identifier}}" stepKey="amOnPageWithBlock"/> + <actionGroup ref="AssertStoreFrontCMSPage" stepKey="verifyPageWithBlockDataOnFrontend"> + <argument name="cmsTitle" value="{{_duplicatedCMSPage.title}}"/> + <argument name="cmsContent" value="bla bla bla"/> + <argument name="cmsContentHeading" value="{{_duplicatedCMSPage.content_heading}}"/> + </actionGroup> + <!--Delete page with block--> + <actionGroup ref="DeletePageByUrlKeyActionGroup" stepKey="deletePageWithBlock"> + <argument name="UrlKey" value="{{_duplicatedCMSPage.identifier}}"/> + </actionGroup> + + <!--Create CMS page with single store mode--> + <!--Enable single store mode--> + <magentoCLI command="config:set general/single_store_mode/enabled 1" stepKey="enableSingleStoreMode"/> + <!--Go to New CMS Page page--> + <amOnPage url="{{CmsNewPagePage.url}}" stepKey="navigateToCreateNewPage4"/> + <waitForPageLoad stepKey="waitForNewPagePageLoad4"/> + <!--Fill the CMS page form--> + <actionGroup ref="FillOutCMSPageContent" stepKey="fillBasicPageDataInSingleStoreMode"/> + <!--Verify successfully saved--> + <actionGroup ref="saveCmsPage" stepKey="savePageInSingleStoreMode"/> + <!--verify page on frontend--> + <amOnPage url="{{StorefrontHomePage.url}}/{{_duplicatedCMSPage.identifier}}" stepKey="amOnPageTestPageInSingleStoreMode"/> + <actionGroup ref="AssertStoreFrontCMSPage" stepKey="verifyPageDataOnFrontendInSingleStoreMode"> + <argument name="cmsTitle" value="{{_duplicatedCMSPage.title}}"/> + <argument name="cmsContent" value="{{_duplicatedCMSPage.content}}"/> + <argument name="cmsContentHeading" value="{{_duplicatedCMSPage.content_heading}}"/> + </actionGroup> + <!--Navigate to page in Admin--> + <actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCMSPageInAdminInSingleStoreMode"> + <argument name="CMSPage" value="_duplicatedCMSPage"/> + </actionGroup> + <!--Verify Page Data in Admin--> + <actionGroup ref="AssertCMSPageContent" stepKey="verifyPageDataInAdminInSingleStoreMode"/> + <!--Delete page--> + <actionGroup ref="DeletePageByUrlKeyActionGroup" stepKey="deletePageInSingleStoreMode"> + <argument name="UrlKey" value="{{_duplicatedCMSPage.identifier}}"/> + </actionGroup> + + <!--Create disabled page--> + <!--Go to New CMS Page page--> + <amOnPage url="{{CmsNewPagePage.url}}" stepKey="navigateToCreateNewPage5"/> + <waitForPageLoad stepKey="waitForNewPagePageLoad5"/> + <!--Fill the CMS page form--> + <actionGroup ref="FillOutCMSPageContent" stepKey="fillBasicPageDataForDisabledPage"/> + <actionGroup ref="SetCMSPageDisabled" stepKey="setCMSPageDisabled"/> + <!--Verify successfully saved--> + <actionGroup ref="saveCmsPage" stepKey="saveDisabledPage"/> + <!--Check that page is disabled on frontend--> + <amOnPage url="{{StorefrontHomePage.url}}/{{_duplicatedCMSPage.identifier}}" stepKey="amOnDeactivatedPageOnFrontend"/> + <waitForPageLoad stepKey="waitForDeactivatedPageLoadOnFrontend"/> + <see userInput="Whoops, our bad..." stepKey="seePageError"/> + <!--Delete page--> + <actionGroup ref="DeletePageByUrlKeyActionGroup" stepKey="deleteDisabledPage"> + <argument name="UrlKey" value="{{_duplicatedCMSPage.identifier}}"/> + </actionGroup> + </test> +</tests> \ No newline at end of file From fc8d4496ef384d9f9d85e551bfb90a3119bc83ed Mon Sep 17 00:00:00 2001 From: --global <v.vygovskyi@atwix.com> Date: Wed, 3 Apr 2019 12:41:52 +0300 Subject: [PATCH 002/586] #631 added mftf_migrated tag --- .../Cms/Test/Mftf/Test/AdminCreateCmsPageEntityTest.xml | 2 +- .../Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.xml | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsPageEntityTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsPageEntityTest.xml index 253f5e5fb4c67..c53344efcc519 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsPageEntityTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsPageEntityTest.xml @@ -97,7 +97,7 @@ <argument name="UrlKey" value="{{_duplicatedCMSPage.identifier}}"/> </actionGroup> - <!--Create CMS page with single store mode--> + <!--Create CMS page in single store mode--> <!--Enable single store mode--> <magentoCLI command="config:set general/single_store_mode/enabled 1" stepKey="enableSingleStoreMode"/> <!--Go to New CMS Page page--> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.xml index 88434bbc009ce..46cc63e417e61 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.xml @@ -15,6 +15,7 @@ <data name="data/identifier" xsi:type="string">identifier-%isolation%</data> <data name="data/store_id" xsi:type="string">All Store Views</data> <data name="data/content/content" xsi:type="string">cms_page_text_content%isolation%</data> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageSuccessSaveMessage" /> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageInGrid" /> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPagePreview" /> @@ -27,6 +28,7 @@ <data name="data/identifier" xsi:type="string">identifier-%isolation%</data> <data name="data/store_id" xsi:type="string">Main Website/Main Website Store/Default Store View</data> <data name="data/content/content" xsi:type="string">cms_page_text_content%isolation%</data> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageSuccessSaveMessage" /> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageForm" /> </variation> @@ -38,6 +40,7 @@ <data name="data/store_id" xsi:type="string">Main Website/Main Website Store/Default Store View</data> <data name="data/is_active" xsi:type="string">No</data> <data name="data/content/content" xsi:type="string">cms_page_text_content%isolation%</data> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageSuccessSaveMessage" /> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageDisabledOnFrontend" /> </variation> @@ -50,6 +53,7 @@ <data name="data/is_active" xsi:type="string">Yes</data> <data name="data/content/content" xsi:type="string">\\{{block class='Magento\Framework\View\Element\Text' text='bla bla bla' cache_key='BACKEND_ACL_RESOURCES' cache_lifetime=999\}}</data> <data name="displayContent" xsi:type="string">bla bla bla</data> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageSuccessSaveMessage" /> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPagePreview" /> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageOnFrontend" /> @@ -62,6 +66,7 @@ <data name="data/title" xsi:type="string">NewCmsPage%isolation%</data> <data name="data/identifier" xsi:type="string">identifier-%isolation%</data> <data name="data/content/content" xsi:type="string">cms_page_text_content%isolation%</data> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageSuccessSaveMessage" /> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageFormSingleStoreMode" /> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageOnFrontend" /> From 49d53277949e4e92e9f85585f11f38d1ba3389df Mon Sep 17 00:00:00 2001 From: Volodymyr Vygovskyi <v.vygovskyi@atwix.com> Date: Fri, 12 Apr 2019 17:20:22 +0300 Subject: [PATCH 003/586] refactored according to best practices --- .../AdminCMSPageSetDisabledActionGroup.xml | 14 ++ ...dminCmsPageFillContentFieldActionGroup.xml | 16 ++ ...PageNavigateToCreateNewPageActionGroup.xml | 14 ++ ...nCmsPageSelectPageStoreViewActionGroup.xml | 18 +++ .../AssertCMSPageContentActionGroup.xml | 12 -- .../AssertCMSPageInGridActionGroup.xml | 25 +++ ...ssertCMSPageNotFoundOnFrontActionGroup.xml | 18 +++ .../AssertCMSPageStoreIdActionGroup.xml | 22 +++ .../FillOutCMSPageContentActionGroup.xml | 16 -- ...efrontCMSPageNavigateToPageActionGroup.xml | 16 ++ .../AdminCmsPageCreateDisabledPageTest.xml | 42 +++++ ...inCmsPageCreatePageForDefaultStoreTest.xml | 49 ++++++ ...CmsPageCreatePageInSingleStoreModeTest.xml | 53 +++++++ .../Mftf/Test/AdminCmsPageCreatePageTest.xml | 47 ++++++ .../AdminCmsPageCreatePageWithBlockTest.xml | 50 ++++++ .../Test/AdminCreateCmsPageEntityTest.xml | 146 ------------------ .../Store/Test/Mftf/Data/StoreConfigData.xml | 21 +++ .../Test/TestCase/CreateCmsPageEntityTest.xml | 15 +- 18 files changed, 410 insertions(+), 184 deletions(-) create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminCMSPageSetDisabledActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminCmsPageFillContentFieldActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminCmsPageNavigateToCreateNewPageActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminCmsPageSelectPageStoreViewActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageInGridActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageNotFoundOnFrontActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageStoreIdActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontCMSPageNavigateToPageActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreateDisabledPageTest.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageForDefaultStoreTest.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageInSingleStoreModeTest.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageTest.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageWithBlockTest.xml delete mode 100644 app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsPageEntityTest.xml create mode 100644 app/code/Magento/Store/Test/Mftf/Data/StoreConfigData.xml diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminCMSPageSetDisabledActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminCMSPageSetDisabledActionGroup.xml new file mode 100644 index 0000000000000..6005cd5738199 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminCMSPageSetDisabledActionGroup.xml @@ -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="AdminCMSPageSetDisabled"> + <seeElement selector="{{CmsNewPagePageBasicFieldsSection.isActive('1')}}" stepKey="seePageIsEnabled" /> + <click selector="{{CmsNewPagePageBasicFieldsSection.isActiveLabel}}" stepKey="setPageDisabled"/> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminCmsPageFillContentFieldActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminCmsPageFillContentFieldActionGroup.xml new file mode 100644 index 0000000000000..7480e791f4145 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminCmsPageFillContentFieldActionGroup.xml @@ -0,0 +1,16 @@ +<?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="AdminCmsPageFillContentField"> + <arguments> + <argument name="content" type="string"/> + </arguments> + <fillField selector="{{CmsNewPagePageContentSection.content}}" userInput="{{content}}" stepKey="fillFieldContent"/> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminCmsPageNavigateToCreateNewPageActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminCmsPageNavigateToCreateNewPageActionGroup.xml new file mode 100644 index 0000000000000..432a3b60d9177 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminCmsPageNavigateToCreateNewPageActionGroup.xml @@ -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="AdminCmsPageNavigateToCreateNewPage"> + <amOnPage url="{{CmsNewPagePage.url}}" stepKey="navigateToCreateNewPage"/> + <waitForPageLoad stepKey="waitForNewPagePageLoad"/> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminCmsPageSelectPageStoreViewActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminCmsPageSelectPageStoreViewActionGroup.xml new file mode 100644 index 0000000000000..b5b61926b2ba8 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminCmsPageSelectPageStoreViewActionGroup.xml @@ -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="AdminCmsPageSelectPageStoreView"> + <arguments> + <argument name="storeViewName" type="string"/> + </arguments> + <click selector="{{CmsNewPagePiwSection.header}}" stepKey="clickPageInWebsites"/> + <waitForElementVisible selector="{{CmsNewPagePiwSection.selectStoreView(storeViewName)}}" stepKey="waitForStoreGridReload"/> + <clickWithLeftButton selector="{{CmsNewPagePiwSection.selectStoreView(storeViewName)}}" stepKey="clickStoreView"/> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageContentActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageContentActionGroup.xml index e8861ff089faa..dde6237390257 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageContentActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageContentActionGroup.xml @@ -23,18 +23,6 @@ <executeJS function="(el = document.querySelector('[name=\'identifier\']')) && el['se' + 'tAt' + 'tribute']('data-value', el.value.split('-')[0]);" stepKey="setAttribute" /> <seeElement selector="{{CmsNewPagePageBasicFieldsSection.duplicatedURLKey(_duplicatedCMSPage.title)}}" stepKey="see"/> </actionGroup> - <actionGroup name="AssertCMSPageStoreId"> - <arguments> - <argument name="storeId" type="string"/> - </arguments> - <click selector="{{CmsNewPagePiwSection.header}}" stepKey="clickPageInWebsites"/> - <waitForElementVisible selector="{{CmsNewPagePiwSection.storeIdDropdown}}" stepKey="waitForStoresSectionReload"/> - <grabValueFrom selector="{{CmsNewPagePiwSection.storeIdDropdown}}" stepKey="grabValueFromStoreView"/> - <assertEquals stepKey="assertTitle" message="pass"> - <expectedResult type="string">{{storeId}}</expectedResult> - <actualResult type="variable">grabValueFromStoreView</actualResult> - </assertEquals> - </actionGroup> <actionGroup name="AssertStoreFrontCMSPage"> <arguments> <argument name="cmsTitle" type="string"/> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageInGridActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageInGridActionGroup.xml new file mode 100644 index 0000000000000..bbb8345ffcacd --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageInGridActionGroup.xml @@ -0,0 +1,25 @@ +<?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="AssertCMSPageInGrid"> + <arguments> + <argument name="identifier" defaultValue=""/> + </arguments> + <amOnPage url="{{CmsPagesPage.url}}" stepKey="navigateToCMSPagesGrid"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <conditionalClick selector="{{CmsPagesPageActionsSection.clearAllButton}}" dependentSelector="{{CmsPagesPageActionsSection.activeFilters}}" stepKey="clickToResetFilter" visible="true"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + <conditionalClick selector="//div[contains(@data-role, 'grid-wrapper')]/table/thead/tr/th/span[contains(text(), 'ID')]" dependentSelector="//span[contains(text(), 'ID')]/parent::th[not(contains(@class, '_descend'))]/parent::tr/parent::thead/parent::table/parent::div[contains(@data-role, 'grid-wrapper')]" stepKey="clickToAttemptSortByIdDescending" visible="true"/> + <waitForLoadingMaskToDisappear stepKey="waitForFirstIdSortDescendingToFinish" /> + <!-- Conditional Click again in case it goes from default state to ascending on first click --> + <conditionalClick selector="//div[contains(@data-role, 'grid-wrapper')]/table/thead/tr/th/span[contains(text(), 'ID')]" dependentSelector="//span[contains(text(), 'ID')]/parent::th[not(contains(@class, '_descend'))]/parent::tr/parent::thead/parent::table/parent::div[contains(@data-role, 'grid-wrapper')]" stepKey="secondClickToAttemptSortByIdDescending" visible="true"/> + <waitForLoadingMaskToDisappear stepKey="waitForSecondIdSortDescendingToFinish" /> + <click selector="{{CmsPagesPageActionsSection.select(identifier)}}" stepKey="clickSelectCMSPage" /> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageNotFoundOnFrontActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageNotFoundOnFrontActionGroup.xml new file mode 100644 index 0000000000000..a9d12a9721f87 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageNotFoundOnFrontActionGroup.xml @@ -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="AssertCMSPageNotFoundOnFront"> + <arguments> + <argument name="identifier" type="string"/> + </arguments> + <amOnPage url="{{StorefrontHomePage.url}}/{{identifier}}" stepKey="amOnPageOnStorefront"/> + <waitForPageLoad stepKey="waitForPageLoadOnStorefront"/> + <see userInput="Whoops, our bad..." stepKey="seePageErrorNotFound"/> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageStoreIdActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageStoreIdActionGroup.xml new file mode 100644 index 0000000000000..4ef3b75f77082 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageStoreIdActionGroup.xml @@ -0,0 +1,22 @@ +<?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="AssertCMSPageStoreId"> + <arguments> + <argument name="storeId" type="string"/> + </arguments> + <click selector="{{CmsNewPagePiwSection.header}}" stepKey="clickPageInWebsites"/> + <waitForElementVisible selector="{{CmsNewPagePiwSection.storeIdDropdown}}" stepKey="waitForStoresSectionReload"/> + <grabValueFrom selector="{{CmsNewPagePiwSection.storeIdDropdown}}" stepKey="grabValueFromStoreView"/> + <assertEquals stepKey="assertTitle" message="pass"> + <expectedResult type="string">{{storeId}}</expectedResult> + <actualResult type="variable">grabValueFromStoreView</actualResult> + </assertEquals> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/FillOutCMSPageContentActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/FillOutCMSPageContentActionGroup.xml index b1f66f166472e..173c81a1e049a 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/FillOutCMSPageContentActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/FillOutCMSPageContentActionGroup.xml @@ -15,20 +15,4 @@ <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_duplicatedCMSPage.identifier}}" stepKey="fillFieldUrlKey"/> </actionGroup> - <actionGroup name="SetCMSPageDisabled"> - <seeElement selector="{{CmsNewPagePageBasicFieldsSection.isActive('1')}}" stepKey="seePageIsEnabled" /> - <click selector="{{CmsNewPagePageBasicFieldsSection.isActiveLabel}}" stepKey="setPageDisabled"/> - </actionGroup> - <actionGroup name="SetCMSPageEnabled"> - <seeElement selector="{{CmsNewPagePageBasicFieldsSection.isActive('0')}}" stepKey="seePageIsDisabled" /> - <click selector="{{CmsNewPagePageBasicFieldsSection.isActiveLabel}}" stepKey="setPageEnabled"/> - </actionGroup> - <actionGroup name="SelectCMSPageStoreView"> - <arguments> - <argument name="storeViewName" type="string"/> - </arguments> - <click selector="{{CmsNewPagePiwSection.header}}" stepKey="clickPageInWebsites"/> - <waitForElementVisible selector="{{CmsNewPagePiwSection.selectStoreView(storeViewName)}}" stepKey="waitForStoreGridReload"/> - <clickWithLeftButton selector="{{CmsNewPagePiwSection.selectStoreView(storeViewName)}}" stepKey="clickStoreView"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontCMSPageNavigateToPageActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontCMSPageNavigateToPageActionGroup.xml new file mode 100644 index 0000000000000..c27fe2f316ec9 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontCMSPageNavigateToPageActionGroup.xml @@ -0,0 +1,16 @@ +<?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="StorefrontCMSPageNavigateToPage"> + <arguments> + <argument name="identifier" type="string"/> + </arguments> + <amOnPage url="{{StorefrontHomePage.url}}/{{identifier}}" stepKey="amOnCmsPageOnStorefront"/> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreateDisabledPageTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreateDisabledPageTest.xml new file mode 100644 index 0000000000000..cee38905f49ba --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreateDisabledPageTest.xml @@ -0,0 +1,42 @@ +<?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="AdminCmsPageCreateDisabledPageTest"> + <annotations> + <features value="Cms"/> + <title value="Create disabled CMS Page via the Admin"/> + <description value="Admin should be able to create a CMS Page"/> + <group value="backend"/> + <group value="cMSContent"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + </before> + <after> + <actionGroup ref="logout" stepKey="logout"/> + </after> + <!--Go to New CMS Page page--> + <actionGroup ref="AdminCmsPageNavigateToCreateNewPage" stepKey="navigateToCreateNewPage"/> + <!--Fill the CMS page form--> + <actionGroup ref="FillOutCMSPageContent" stepKey="fillBasicPageDataForDisabledPage"/> + <!--Set page disabled--> + <actionGroup ref="AdminCMSPageSetDisabled" stepKey="setCMSPageDisabled"/> + <!--Verify successfully saved--> + <actionGroup ref="saveCmsPage" stepKey="saveDisabledPage"/> + <!--Check that page is disabled on frontend--> + <actionGroup ref="AssertCMSPageNotFoundOnFront" stepKey="checkFirstPageNotFoundOnFront"> + <argument name="identifier" value="{{_duplicatedCMSPage.identifier}}"/> + </actionGroup> + <!--Delete page--> + <actionGroup ref="DeletePageByUrlKeyActionGroup" stepKey="deleteDisabledPage"> + <argument name="UrlKey" value="{{_duplicatedCMSPage.identifier}}"/> + </actionGroup> + </test> +</tests> \ No newline at end of file diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageForDefaultStoreTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageForDefaultStoreTest.xml new file mode 100644 index 0000000000000..4863737a39368 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageForDefaultStoreTest.xml @@ -0,0 +1,49 @@ +<?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="AdminCmsPageCreatePageForDefaultStoreTest"> + <annotations> + <features value="Cms"/> + <title value="Create CMS Page via the Admin for default store"/> + <description value="Admin should be able to create a CMS Page"/> + <group value="backend"/> + <group value="cMSContent"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + </before> + <after> + <actionGroup ref="logout" stepKey="logout"/> + </after> + <!--Go to New CMS Page page--> + <actionGroup ref="AdminCmsPageNavigateToCreateNewPage" stepKey="navigateToCreateNewPage"/> + <!--Fill the CMS page form--> + <actionGroup ref="FillOutCMSPageContent" stepKey="fillBasicPageDataForPageWithDefaultStore"/> + <actionGroup ref="AdminCmsPageSelectPageStoreView" stepKey="selectCMSPageStoreView"> + <argument name="storeViewName" value="Default Store View"/> + </actionGroup> + <!--Verify successfully saved--> + <actionGroup ref="saveCmsPage" stepKey="savePageWithDefaultStore"/> + <!--Navigate to page in Admin--> + <actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCMSPageWithDefaultStoreInAdmin"> + <argument name="CMSPage" value="_duplicatedCMSPage"/> + </actionGroup> + <!--Verify Page Data in Admin--> + <actionGroup ref="AssertCMSPageContent" stepKey="verifyPageWithDefaultStoreDataInAdmin"/> + <!--Verify Store ID--> + <actionGroup ref="AssertCMSPageStoreId" stepKey="verifyStoreId"> + <argument name="storeId" value="1"/> + </actionGroup> + <!--Delete page--> + <actionGroup ref="DeletePageByUrlKeyActionGroup" stepKey="deletePageWithDefaultStore"> + <argument name="UrlKey" value="{{_duplicatedCMSPage.identifier}}"/> + </actionGroup> + </test> +</tests> \ No newline at end of file diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageInSingleStoreModeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageInSingleStoreModeTest.xml new file mode 100644 index 0000000000000..913fe4b15fd33 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageInSingleStoreModeTest.xml @@ -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="AdminCmsPageCreatePageInSingleStoreModeTest"> + <annotations> + <features value="Cms"/> + <title value="Create CMS Page via the Admin in single store mode"/> + <description value="Admin should be able to create a CMS Page"/> + <group value="backend"/> + <group value="cMSContent"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <magentoCLI command="config:set {{StorefrontSingleStoreModeEnabledConfigData.path}} {{StorefrontSingleStoreModeEnabledConfigData.value}}" stepKey="enableSingleStoreMode" /> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + </before> + <after> + <magentoCLI command="config:set {{StorefrontSingleStoreModeDisabledConfigData.path}} {{StorefrontSingleStoreModeDisabledConfigData.value}}" stepKey="enableSingleStoreMode" /> + <actionGroup ref="logout" stepKey="logout"/> + </after> + <!--Go to New CMS Page page--> + <actionGroup ref="AdminCmsPageNavigateToCreateNewPage" stepKey="navigateToCreateNewPage"/> + <!--Fill the CMS page form--> + <actionGroup ref="FillOutCMSPageContent" stepKey="fillBasicPageDataForPageWithDefaultStore"/> + <!--Verify successfully saved--> + <actionGroup ref="saveCmsPage" stepKey="savePageInSingleStoreMode"/> + <!--verify page on frontend--> + <actionGroup ref="StorefrontCMSPageNavigateToPage" stepKey="navigateToPageOnStoreFront"> + <argument name="identifier" value="{{_duplicatedCMSPage.identifier}}"/> + </actionGroup> + <actionGroup ref="AssertStoreFrontCMSPage" stepKey="verifyPageDataOnFrontend"> + <argument name="cmsTitle" value="{{_duplicatedCMSPage.title}}"/> + <argument name="cmsContent" value="{{_duplicatedCMSPage.content}}"/> + <argument name="cmsContentHeading" value="{{_duplicatedCMSPage.content_heading}}"/> + </actionGroup> + <!--Navigate to page in Admin--> + <actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCMSPageInAdminInSingleStoreMode"> + <argument name="CMSPage" value="_duplicatedCMSPage"/> + </actionGroup> + <!--Verify Page Data in Admin--> + <actionGroup ref="AssertCMSPageContent" stepKey="verifyPageDataInAdminInSingleStoreMode"/> + <!--Delete page--> + <actionGroup ref="DeletePageByUrlKeyActionGroup" stepKey="deletePageInSingleStoreMode"> + <argument name="UrlKey" value="{{_duplicatedCMSPage.identifier}}"/> + </actionGroup> + </test> +</tests> \ No newline at end of file diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageTest.xml new file mode 100644 index 0000000000000..940549d48483a --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageTest.xml @@ -0,0 +1,47 @@ +<?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="AdminCmsPageCreatePageTest"> + <annotations> + <features value="Cms"/> + <title value="Create CMS Page via the Admin"/> + <description value="Admin should be able to create a CMS Page"/> + <group value="backend"/> + <group value="cMSContent"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + </before> + <after> + <actionGroup ref="logout" stepKey="logout"/> + </after> + <!--Go to New CMS Page page--> + <actionGroup ref="AdminCmsPageNavigateToCreateNewPage" stepKey="navigateToCreateNewPage"/> + <actionGroup ref="FillOutCMSPageContent" stepKey="fillBasicPageData"/> + <!--verify successfully saved--> + <actionGroup ref="saveCmsPage" stepKey="saveNewPage"/> + <!--verify page on frontend--> + <actionGroup ref="StorefrontCMSPageNavigateToPage" stepKey="navigateToPageOnStoreFront"> + <argument name="identifier" value="{{_duplicatedCMSPage.identifier}}"/> + </actionGroup> + <actionGroup ref="AssertStoreFrontCMSPage" stepKey="verifyPageDataOnFrontend"> + <argument name="cmsTitle" value="{{_duplicatedCMSPage.title}}"/> + <argument name="cmsContent" value="{{_duplicatedCMSPage.content}}"/> + <argument name="cmsContentHeading" value="{{_duplicatedCMSPage.content_heading}}"/> + </actionGroup> + <!--verify page in grid--> + <actionGroup ref="AssertCMSPageInGrid" stepKey="verifyPageInGrid"> + <argument name="identifier" value="_duplicatedCMSPage.identifier"/> + </actionGroup> + <actionGroup ref="DeletePageByUrlKeyActionGroup" stepKey="deletePage"> + <argument name="UrlKey" value="{{_duplicatedCMSPage.identifier}}"/> + </actionGroup> + </test> +</tests> \ No newline at end of file diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageWithBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageWithBlockTest.xml new file mode 100644 index 0000000000000..7d5046c5c0186 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageWithBlockTest.xml @@ -0,0 +1,50 @@ +<?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="AdminCmsPageCreatePageWithBlockTest"> + <annotations> + <features value="Cms"/> + <title value="Create CMS Page that contains block content via the Admin"/> + <description value="Admin should be able to create a CMS Page"/> + <group value="backend"/> + <group value="cMSContent"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + </before> + <after> + <actionGroup ref="logout" stepKey="logout"/> + </after> + <!--Go to New CMS Page page--> + <actionGroup ref="AdminCmsPageNavigateToCreateNewPage" stepKey="navigateToCreateNewPage"/> + <actionGroup ref="FillOutCMSPageContent" stepKey="fillBasicPageData"/> + <actionGroup ref="AdminCmsPageFillContentField" stepKey="fillContentField"> + <argument name="content" value="{{block class='Magento\Framework\View\Element\Text' text='bla bla bla' cache_key='BACKEND_ACL_RESOURCES' cache_lifetime=999}}"/> + </actionGroup> + <actionGroup ref="AdminCmsPageSelectPageStoreView" stepKey="selectCMSPageStoreViewForPageWithBlock"> + <argument name="storeViewName" value="Default Store View"/> + </actionGroup> + <!--Verify successfully saved--> + <actionGroup ref="saveCmsPage" stepKey="savePageWithBlock"/> + <!--verify page on frontend--> + <actionGroup ref="StorefrontCMSPageNavigateToPage" stepKey="navigateToPageOnStoreFront"> + <argument name="identifier" value="{{_duplicatedCMSPage.identifier}}"/> + </actionGroup> + <actionGroup ref="AssertStoreFrontCMSPage" stepKey="verifyPageWithBlockDataOnFrontend"> + <argument name="cmsTitle" value="{{_duplicatedCMSPage.title}}"/> + <argument name="cmsContent" value="bla bla bla"/> + <argument name="cmsContentHeading" value="{{_duplicatedCMSPage.content_heading}}"/> + </actionGroup> + <!--Delete page with block--> + <actionGroup ref="DeletePageByUrlKeyActionGroup" stepKey="deletePageWithBlock"> + <argument name="UrlKey" value="{{_duplicatedCMSPage.identifier}}"/> + </actionGroup> + </test> +</tests> \ No newline at end of file diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsPageEntityTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsPageEntityTest.xml deleted file mode 100644 index c53344efcc519..0000000000000 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsPageEntityTest.xml +++ /dev/null @@ -1,146 +0,0 @@ -<?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="AdminCreateCmsPageEntityTest"> - <annotations> - <features value="Cms"/> - <title value="Create CMS Page via the Admin"/> - <description value="Admin should be able to create a CMS Page"/> - <group value="backend"/> - <group value="cMSContent"/> - <group value="mtf_migrated"/> - </annotations> - <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - </before> - <after> - <!--Disable single store mode--> - <magentoCLI command="config:set general/single_store_mode/enabled 0" stepKey="disableSingleStoreMode"/> - <actionGroup ref="logout" stepKey="logout"/> - </after> - - <!--Create CMS Content Page--> - <!--Go to New CMS Page page--> - <amOnPage url="{{CmsNewPagePage.url}}" stepKey="navigateToCreateNewPage"/> - <waitForPageLoad stepKey="waitForNewPagePageLoad"/> - <actionGroup ref="FillOutCMSPageContent" stepKey="fillBasicPageData"/> - <!--verify successfully saved--> - <actionGroup ref="saveCmsPage" stepKey="saveNewPage"/> - <!--verify page on frontend--> - <amOnPage url="{{StorefrontHomePage.url}}/{{_duplicatedCMSPage.identifier}}" stepKey="amOnPageTestPage"/> - <actionGroup ref="AssertStoreFrontCMSPage" stepKey="verifyPageDataOnFrontend"> - <argument name="cmsTitle" value="{{_duplicatedCMSPage.title}}"/> - <argument name="cmsContent" value="{{_duplicatedCMSPage.content}}"/> - <argument name="cmsContentHeading" value="{{_duplicatedCMSPage.content_heading}}"/> - </actionGroup> - <!--verify page in grid--> - <actionGroup ref="navigateToCreatedCMSPage" stepKey="verifyPageInGrid"> - <argument name="CMSPage" value="_duplicatedCMSPage"/> - </actionGroup> - <actionGroup ref="DeletePageByUrlKeyActionGroup" stepKey="deletePage"> - <argument name="UrlKey" value="{{_duplicatedCMSPage.identifier}}"/> - </actionGroup> - - <!--Create page for default store view--> - <!--Go to New CMS Page page--> - <amOnPage url="{{CmsNewPagePage.url}}" stepKey="navigateToCreateNewPage2"/> - <waitForPageLoad stepKey="waitForNewPagePageLoad2"/> - <!--Fill the CMS page form--> - <actionGroup ref="FillOutCMSPageContent" stepKey="fillBasicPageDataForPageWithDefaultStore"/> - <actionGroup ref="SelectCMSPageStoreView" stepKey="selectCMSPageStoreView"> - <argument name="storeViewName" value="Default Store View"/> - </actionGroup> - <!--Verify successfully saved--> - <actionGroup ref="saveCmsPage" stepKey="savePageWithDefaultStore"/> - <!--Navigate to page in Admin--> - <actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCMSPageWithDefaultStoreInAdmin"> - <argument name="CMSPage" value="_duplicatedCMSPage"/> - </actionGroup> - <!--Verify Page Data in Admin--> - <actionGroup ref="AssertCMSPageContent" stepKey="verifyPageWithDefaultStoreDataInAdmin"/> - <!--Verify Store ID--> - <actionGroup ref="AssertCMSPageStoreId" stepKey="verifyStoreId"> - <argument name="storeId" value="1"/> - </actionGroup> - <!--Delete page--> - <actionGroup ref="DeletePageByUrlKeyActionGroup" stepKey="deletePageWithDefaultStore"> - <argument name="UrlKey" value="{{_duplicatedCMSPage.identifier}}"/> - </actionGroup> - - <!--Block Cache Exploit--> - <!--Go to New CMS Page page--> - <amOnPage url="{{CmsNewPagePage.url}}" stepKey="navigateToCreateNewPage3"/> - <waitForPageLoad stepKey="waitForNewPagePageLoad3"/> - <!--Fill the CMS page form--> - <actionGroup ref="FillOutCMSPageContent" stepKey="fillBasicPageDataForPageWithBlock"/> - <fillField selector="{{CmsNewPagePageContentSection.content}}" userInput="{{block class='Magento\Framework\View\Element\Text' text='bla bla bla' cache_key='BACKEND_ACL_RESOURCES' cache_lifetime=999}}" stepKey="fillFieldContent"/> - <actionGroup ref="SelectCMSPageStoreView" stepKey="selectCMSPageStoreViewForPageWithBlock"> - <argument name="storeViewName" value="Default Store View"/> - </actionGroup> - <!--Verify successfully saved--> - <actionGroup ref="saveCmsPage" stepKey="savePageWithBlock"/> - <!--verify page on frontend--> - <amOnPage url="{{StorefrontHomePage.url}}/{{_duplicatedCMSPage.identifier}}" stepKey="amOnPageWithBlock"/> - <actionGroup ref="AssertStoreFrontCMSPage" stepKey="verifyPageWithBlockDataOnFrontend"> - <argument name="cmsTitle" value="{{_duplicatedCMSPage.title}}"/> - <argument name="cmsContent" value="bla bla bla"/> - <argument name="cmsContentHeading" value="{{_duplicatedCMSPage.content_heading}}"/> - </actionGroup> - <!--Delete page with block--> - <actionGroup ref="DeletePageByUrlKeyActionGroup" stepKey="deletePageWithBlock"> - <argument name="UrlKey" value="{{_duplicatedCMSPage.identifier}}"/> - </actionGroup> - - <!--Create CMS page in single store mode--> - <!--Enable single store mode--> - <magentoCLI command="config:set general/single_store_mode/enabled 1" stepKey="enableSingleStoreMode"/> - <!--Go to New CMS Page page--> - <amOnPage url="{{CmsNewPagePage.url}}" stepKey="navigateToCreateNewPage4"/> - <waitForPageLoad stepKey="waitForNewPagePageLoad4"/> - <!--Fill the CMS page form--> - <actionGroup ref="FillOutCMSPageContent" stepKey="fillBasicPageDataInSingleStoreMode"/> - <!--Verify successfully saved--> - <actionGroup ref="saveCmsPage" stepKey="savePageInSingleStoreMode"/> - <!--verify page on frontend--> - <amOnPage url="{{StorefrontHomePage.url}}/{{_duplicatedCMSPage.identifier}}" stepKey="amOnPageTestPageInSingleStoreMode"/> - <actionGroup ref="AssertStoreFrontCMSPage" stepKey="verifyPageDataOnFrontendInSingleStoreMode"> - <argument name="cmsTitle" value="{{_duplicatedCMSPage.title}}"/> - <argument name="cmsContent" value="{{_duplicatedCMSPage.content}}"/> - <argument name="cmsContentHeading" value="{{_duplicatedCMSPage.content_heading}}"/> - </actionGroup> - <!--Navigate to page in Admin--> - <actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCMSPageInAdminInSingleStoreMode"> - <argument name="CMSPage" value="_duplicatedCMSPage"/> - </actionGroup> - <!--Verify Page Data in Admin--> - <actionGroup ref="AssertCMSPageContent" stepKey="verifyPageDataInAdminInSingleStoreMode"/> - <!--Delete page--> - <actionGroup ref="DeletePageByUrlKeyActionGroup" stepKey="deletePageInSingleStoreMode"> - <argument name="UrlKey" value="{{_duplicatedCMSPage.identifier}}"/> - </actionGroup> - - <!--Create disabled page--> - <!--Go to New CMS Page page--> - <amOnPage url="{{CmsNewPagePage.url}}" stepKey="navigateToCreateNewPage5"/> - <waitForPageLoad stepKey="waitForNewPagePageLoad5"/> - <!--Fill the CMS page form--> - <actionGroup ref="FillOutCMSPageContent" stepKey="fillBasicPageDataForDisabledPage"/> - <actionGroup ref="SetCMSPageDisabled" stepKey="setCMSPageDisabled"/> - <!--Verify successfully saved--> - <actionGroup ref="saveCmsPage" stepKey="saveDisabledPage"/> - <!--Check that page is disabled on frontend--> - <amOnPage url="{{StorefrontHomePage.url}}/{{_duplicatedCMSPage.identifier}}" stepKey="amOnDeactivatedPageOnFrontend"/> - <waitForPageLoad stepKey="waitForDeactivatedPageLoadOnFrontend"/> - <see userInput="Whoops, our bad..." stepKey="seePageError"/> - <!--Delete page--> - <actionGroup ref="DeletePageByUrlKeyActionGroup" stepKey="deleteDisabledPage"> - <argument name="UrlKey" value="{{_duplicatedCMSPage.identifier}}"/> - </actionGroup> - </test> -</tests> \ No newline at end of file diff --git a/app/code/Magento/Store/Test/Mftf/Data/StoreConfigData.xml b/app/code/Magento/Store/Test/Mftf/Data/StoreConfigData.xml new file mode 100644 index 0000000000000..7ec513869ea16 --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/Data/StoreConfigData.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + <entity name="StorefrontSingleStoreModeEnabledConfigData"> + <data key="path">general/single_store_mode/enabled</data> + <data key="scope_id">0</data> + <data key="label">Yes</data> + <data key="value">1</data> + </entity> + <entity name="StorefrontSingleStoreModeDisabledConfigData"> + <data key="path">general/single_store_mode/enabled</data> + <data key="scope_id">0</data> + <data key="label">No</data> + <data key="value">0</data> + </entity> +</entities> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.xml index 46cc63e417e61..bf477e1215486 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.xml @@ -8,44 +8,41 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Cms\Test\TestCase\CreateCmsPageEntityTest" summary="Create Cms Page" ticketId="MAGETWO-25580"> <variation name="CreateCmsPageEntityTestVariation1" summary="Create CMS Content Page" ticketId="MAGETWO-12399"> - <data name="tag" xsi:type="string">test_type:acceptance_test, test_type:extended_acceptance_test, severity:S1</data> + <data name="tag" xsi:type="string">test_type:acceptance_test, test_type:extended_acceptance_test, severity:S1, mftf_migrated:yes</data> <data name="fixtureType" xsi:type="string">cmsPage</data> <data name="data/is_active" xsi:type="string">Yes</data> <data name="data/title" xsi:type="string">NewCmsPage%isolation%</data> <data name="data/identifier" xsi:type="string">identifier-%isolation%</data> <data name="data/store_id" xsi:type="string">All Store Views</data> <data name="data/content/content" xsi:type="string">cms_page_text_content%isolation%</data> - <data name="tag" xsi:type="string">mftf_migrated:yes</data> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageSuccessSaveMessage" /> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageInGrid" /> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPagePreview" /> </variation> <variation name="CreateCmsPageEntityTestVariation2" summary="Create page for default store view"> - <data name="tag" xsi:type="string">severity:S1</data> + <data name="tag" xsi:type="string">severity:S1, mftf_migrated:yes</data> <data name="fixtureType" xsi:type="string">cmsPage</data> <data name="data/is_active" xsi:type="string">Yes</data> <data name="data/title" xsi:type="string">NewCmsPage%isolation%</data> <data name="data/identifier" xsi:type="string">identifier-%isolation%</data> <data name="data/store_id" xsi:type="string">Main Website/Main Website Store/Default Store View</data> <data name="data/content/content" xsi:type="string">cms_page_text_content%isolation%</data> - <data name="tag" xsi:type="string">mftf_migrated:yes</data> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageSuccessSaveMessage" /> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageForm" /> </variation> <variation name="CreateCmsPageEntityTestVariation4" summary="Create disabled page"> - <data name="tag" xsi:type="string">severity:S3</data> + <data name="tag" xsi:type="string">severity:S3, mftf_migrated:yes</data> <data name="fixtureType" xsi:type="string">cmsPage</data> <data name="data/title" xsi:type="string">NewCmsPage%isolation%</data> <data name="data/identifier" xsi:type="string">identifier-%isolation%</data> <data name="data/store_id" xsi:type="string">Main Website/Main Website Store/Default Store View</data> <data name="data/is_active" xsi:type="string">No</data> <data name="data/content/content" xsi:type="string">cms_page_text_content%isolation%</data> - <data name="tag" xsi:type="string">mftf_migrated:yes</data> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageSuccessSaveMessage" /> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageDisabledOnFrontend" /> </variation> <variation name="CreateCmsPageEntityTestVariation5" summary="Block Cache Exploit" ticketId="MAGETWO-48017"> - <data name="tag" xsi:type="string">severity:S2</data> + <data name="tag" xsi:type="string">severity:S2, mftf_migrated:yes</data> <data name="fixtureType" xsi:type="string">cmsPage</data> <data name="data/title" xsi:type="string">NewCmsPage%isolation%</data> <data name="data/identifier" xsi:type="string">identifier-%isolation%</data> @@ -53,20 +50,18 @@ <data name="data/is_active" xsi:type="string">Yes</data> <data name="data/content/content" xsi:type="string">\\{{block class='Magento\Framework\View\Element\Text' text='bla bla bla' cache_key='BACKEND_ACL_RESOURCES' cache_lifetime=999\}}</data> <data name="displayContent" xsi:type="string">bla bla bla</data> - <data name="tag" xsi:type="string">mftf_migrated:yes</data> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageSuccessSaveMessage" /> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPagePreview" /> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageOnFrontend" /> </variation> <variation name="CreateCmsPageEntityTestVariation6" summary="Create CMS page with single store mode" ticketId="MAGETWO-59654"> - <data name="tag" xsi:type="string">test_type:acceptance_test, test_type:extended_acceptance_test</data> + <data name="tag" xsi:type="string">test_type:acceptance_test, test_type:extended_acceptance_test, mftf_migrated:yes</data> <data name="configData" xsi:type="string">enable_single_store_mode</data> <data name="fixtureType" xsi:type="string">cmsPage</data> <data name="data/is_active" xsi:type="string">Yes</data> <data name="data/title" xsi:type="string">NewCmsPage%isolation%</data> <data name="data/identifier" xsi:type="string">identifier-%isolation%</data> <data name="data/content/content" xsi:type="string">cms_page_text_content%isolation%</data> - <data name="tag" xsi:type="string">mftf_migrated:yes</data> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageSuccessSaveMessage" /> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageFormSingleStoreMode" /> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageOnFrontend" /> From 0bb861c55712c38280ef4c750788c7006a6c90eb Mon Sep 17 00:00:00 2001 From: Volodymyr Vygovskyi <v.vygovskyi@atwix.com> Date: Wed, 1 May 2019 11:31:29 +0300 Subject: [PATCH 004/586] refactoring, fixing code review notes --- ...xml => AdminDisableCMSPageActionGroup.xml} | 2 +- ...minFillCMSPageContentFieldActionGroup.xml} | 2 +- .../AdminOpenCMSPagesGridActionGroup.xml | 14 +++++++++++ ... AdminOpenCreateNewCMSPageActionGroup.xml} | 2 +- .../AdminSelectCMSPageFromGridActionGroup.xml | 16 ++++++++++++ ...dminSelectCMSPageStoreViewActionGroup.xml} | 2 +- .../AssertCMSPageInGridActionGroup.xml | 25 ------------------- ...MSPageNotFoundOnStorefrontActionGroup.xml} | 7 +----- .../AssertCMSPageStoreIdActionGroup.xml | 2 +- ...l => StorefrontGoToCMSPageActionGroup.xml} | 3 ++- .../Mftf/Section/CmsNewPagePiwSection.xml | 2 +- .../AdminCmsPageCreateDisabledPageTest.xml | 7 +++--- ...inCmsPageCreatePageForDefaultStoreTest.xml | 6 ++--- ...CmsPageCreatePageInSingleStoreModeTest.xml | 6 ++--- .../Mftf/Test/AdminCmsPageCreatePageTest.xml | 9 ++++--- .../AdminCmsPageCreatePageWithBlockTest.xml | 8 +++--- 16 files changed, 59 insertions(+), 54 deletions(-) rename app/code/Magento/Cms/Test/Mftf/ActionGroup/{AdminCMSPageSetDisabledActionGroup.xml => AdminDisableCMSPageActionGroup.xml} (92%) rename app/code/Magento/Cms/Test/Mftf/ActionGroup/{AdminCmsPageFillContentFieldActionGroup.xml => AdminFillCMSPageContentFieldActionGroup.xml} (89%) create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminOpenCMSPagesGridActionGroup.xml rename app/code/Magento/Cms/Test/Mftf/ActionGroup/{AdminCmsPageNavigateToCreateNewPageActionGroup.xml => AdminOpenCreateNewCMSPageActionGroup.xml} (88%) create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminSelectCMSPageFromGridActionGroup.xml rename app/code/Magento/Cms/Test/Mftf/ActionGroup/{AdminCmsPageSelectPageStoreViewActionGroup.xml => AdminSelectCMSPageStoreViewActionGroup.xml} (92%) delete mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageInGridActionGroup.xml rename app/code/Magento/Cms/Test/Mftf/ActionGroup/{AssertCMSPageNotFoundOnFrontActionGroup.xml => AssertCMSPageNotFoundOnStorefrontActionGroup.xml} (57%) rename app/code/Magento/Cms/Test/Mftf/ActionGroup/{StorefrontCMSPageNavigateToPageActionGroup.xml => StorefrontGoToCMSPageActionGroup.xml} (81%) diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminCMSPageSetDisabledActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminDisableCMSPageActionGroup.xml similarity index 92% rename from app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminCMSPageSetDisabledActionGroup.xml rename to app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminDisableCMSPageActionGroup.xml index 6005cd5738199..53f53227167ee 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminCMSPageSetDisabledActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminDisableCMSPageActionGroup.xml @@ -7,7 +7,7 @@ --> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminCMSPageSetDisabled"> + <actionGroup name="AdminDisableCMSPage"> <seeElement selector="{{CmsNewPagePageBasicFieldsSection.isActive('1')}}" stepKey="seePageIsEnabled" /> <click selector="{{CmsNewPagePageBasicFieldsSection.isActiveLabel}}" stepKey="setPageDisabled"/> </actionGroup> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminCmsPageFillContentFieldActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminFillCMSPageContentFieldActionGroup.xml similarity index 89% rename from app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminCmsPageFillContentFieldActionGroup.xml rename to app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminFillCMSPageContentFieldActionGroup.xml index 7480e791f4145..9bd440695ecf2 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminCmsPageFillContentFieldActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminFillCMSPageContentFieldActionGroup.xml @@ -7,7 +7,7 @@ --> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminCmsPageFillContentField"> + <actionGroup name="AdminFillCMSPageContentFieldActionGroup"> <arguments> <argument name="content" type="string"/> </arguments> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminOpenCMSPagesGridActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminOpenCMSPagesGridActionGroup.xml new file mode 100644 index 0000000000000..8b140ea486603 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminOpenCMSPagesGridActionGroup.xml @@ -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="AdminOpenCMSPagesGridActionGroup"> + <amOnPage url="{{CmsPagesPage.url}}" stepKey="navigateToCMSPagesGrid"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminCmsPageNavigateToCreateNewPageActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminOpenCreateNewCMSPageActionGroup.xml similarity index 88% rename from app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminCmsPageNavigateToCreateNewPageActionGroup.xml rename to app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminOpenCreateNewCMSPageActionGroup.xml index 432a3b60d9177..c9f97855be79d 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminCmsPageNavigateToCreateNewPageActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminOpenCreateNewCMSPageActionGroup.xml @@ -7,7 +7,7 @@ --> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminCmsPageNavigateToCreateNewPage"> + <actionGroup name="AdminOpenCreateNewCMSPageActionGroup"> <amOnPage url="{{CmsNewPagePage.url}}" stepKey="navigateToCreateNewPage"/> <waitForPageLoad stepKey="waitForNewPagePageLoad"/> </actionGroup> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminSelectCMSPageFromGridActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminSelectCMSPageFromGridActionGroup.xml new file mode 100644 index 0000000000000..6a08b8fa89eef --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminSelectCMSPageFromGridActionGroup.xml @@ -0,0 +1,16 @@ +<?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="AdminSelectCMSPageFromGridActionGroup"> + <arguments> + <argument name="identifier" defaultValue=""/> + </arguments> + <click selector="{{CmsPagesPageActionsSection.select(identifier)}}" stepKey="clickSelectCMSPage" /> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminCmsPageSelectPageStoreViewActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminSelectCMSPageStoreViewActionGroup.xml similarity index 92% rename from app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminCmsPageSelectPageStoreViewActionGroup.xml rename to app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminSelectCMSPageStoreViewActionGroup.xml index b5b61926b2ba8..3e4a67e595c04 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminCmsPageSelectPageStoreViewActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminSelectCMSPageStoreViewActionGroup.xml @@ -7,7 +7,7 @@ --> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminCmsPageSelectPageStoreView"> + <actionGroup name="AdminSelectCMSPageStoreViewActionGroup"> <arguments> <argument name="storeViewName" type="string"/> </arguments> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageInGridActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageInGridActionGroup.xml deleted file mode 100644 index bbb8345ffcacd..0000000000000 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageInGridActionGroup.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?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="AssertCMSPageInGrid"> - <arguments> - <argument name="identifier" defaultValue=""/> - </arguments> - <amOnPage url="{{CmsPagesPage.url}}" stepKey="navigateToCMSPagesGrid"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - <conditionalClick selector="{{CmsPagesPageActionsSection.clearAllButton}}" dependentSelector="{{CmsPagesPageActionsSection.activeFilters}}" stepKey="clickToResetFilter" visible="true"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - <conditionalClick selector="//div[contains(@data-role, 'grid-wrapper')]/table/thead/tr/th/span[contains(text(), 'ID')]" dependentSelector="//span[contains(text(), 'ID')]/parent::th[not(contains(@class, '_descend'))]/parent::tr/parent::thead/parent::table/parent::div[contains(@data-role, 'grid-wrapper')]" stepKey="clickToAttemptSortByIdDescending" visible="true"/> - <waitForLoadingMaskToDisappear stepKey="waitForFirstIdSortDescendingToFinish" /> - <!-- Conditional Click again in case it goes from default state to ascending on first click --> - <conditionalClick selector="//div[contains(@data-role, 'grid-wrapper')]/table/thead/tr/th/span[contains(text(), 'ID')]" dependentSelector="//span[contains(text(), 'ID')]/parent::th[not(contains(@class, '_descend'))]/parent::tr/parent::thead/parent::table/parent::div[contains(@data-role, 'grid-wrapper')]" stepKey="secondClickToAttemptSortByIdDescending" visible="true"/> - <waitForLoadingMaskToDisappear stepKey="waitForSecondIdSortDescendingToFinish" /> - <click selector="{{CmsPagesPageActionsSection.select(identifier)}}" stepKey="clickSelectCMSPage" /> - </actionGroup> -</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageNotFoundOnFrontActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageNotFoundOnStorefrontActionGroup.xml similarity index 57% rename from app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageNotFoundOnFrontActionGroup.xml rename to app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageNotFoundOnStorefrontActionGroup.xml index a9d12a9721f87..c0e0a1b599482 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageNotFoundOnFrontActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageNotFoundOnStorefrontActionGroup.xml @@ -7,12 +7,7 @@ --> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AssertCMSPageNotFoundOnFront"> - <arguments> - <argument name="identifier" type="string"/> - </arguments> - <amOnPage url="{{StorefrontHomePage.url}}/{{identifier}}" stepKey="amOnPageOnStorefront"/> - <waitForPageLoad stepKey="waitForPageLoadOnStorefront"/> + <actionGroup name="AssertCMSPageNotFoundOnStorefrontActionGroup"> <see userInput="Whoops, our bad..." stepKey="seePageErrorNotFound"/> </actionGroup> </actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageStoreIdActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageStoreIdActionGroup.xml index 4ef3b75f77082..4d05d68e5e9b2 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageStoreIdActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageStoreIdActionGroup.xml @@ -7,7 +7,7 @@ --> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AssertCMSPageStoreId"> + <actionGroup name="AssertCMSPageStoreIdActionGroup"> <arguments> <argument name="storeId" type="string"/> </arguments> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontCMSPageNavigateToPageActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontGoToCMSPageActionGroup.xml similarity index 81% rename from app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontCMSPageNavigateToPageActionGroup.xml rename to app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontGoToCMSPageActionGroup.xml index c27fe2f316ec9..ac27ac89bba14 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontCMSPageNavigateToPageActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontGoToCMSPageActionGroup.xml @@ -7,10 +7,11 @@ --> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="StorefrontCMSPageNavigateToPage"> + <actionGroup name="StorefrontGoToCMSPageActionGroup"> <arguments> <argument name="identifier" type="string"/> </arguments> <amOnPage url="{{StorefrontHomePage.url}}/{{identifier}}" stepKey="amOnCmsPageOnStorefront"/> + <waitForPageLoad stepKey="waitForPageLoadOnStorefront"/> </actionGroup> </actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Cms/Test/Mftf/Section/CmsNewPagePiwSection.xml b/app/code/Magento/Cms/Test/Mftf/Section/CmsNewPagePiwSection.xml index b22cbbe6b0843..cccdbaddfb4d2 100644 --- a/app/code/Magento/Cms/Test/Mftf/Section/CmsNewPagePiwSection.xml +++ b/app/code/Magento/Cms/Test/Mftf/Section/CmsNewPagePiwSection.xml @@ -11,6 +11,6 @@ <section name="CmsNewPagePiwSection"> <element name="header" type="button" selector="div[data-index=websites]" timeout="30"/> <element name="selectStoreView" type="select" selector="//option[contains(text(),'{{var1}}')]" parameterized="true"/> - <element name="storeIdDropdown" type="select" selector="select[name='store_id']"/> + <element name="storeIdDropdown" type="select" selector="//div[@data-bind="scope: 'cms_page_form.cms_page_form'"]//select[@name='store_id']"/> </section> </sections> \ No newline at end of file diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreateDisabledPageTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreateDisabledPageTest.xml index cee38905f49ba..6227b99a402a1 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreateDisabledPageTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreateDisabledPageTest.xml @@ -23,17 +23,18 @@ <actionGroup ref="logout" stepKey="logout"/> </after> <!--Go to New CMS Page page--> - <actionGroup ref="AdminCmsPageNavigateToCreateNewPage" stepKey="navigateToCreateNewPage"/> + <actionGroup ref="AdminOpenCreateNewCMSPageActionGroup" stepKey="navigateToCreateNewPage"/> <!--Fill the CMS page form--> <actionGroup ref="FillOutCMSPageContent" stepKey="fillBasicPageDataForDisabledPage"/> <!--Set page disabled--> - <actionGroup ref="AdminCMSPageSetDisabled" stepKey="setCMSPageDisabled"/> + <actionGroup ref="AdminDisableCMSPage" stepKey="setCMSPageDisabled"/> <!--Verify successfully saved--> <actionGroup ref="saveCmsPage" stepKey="saveDisabledPage"/> <!--Check that page is disabled on frontend--> - <actionGroup ref="AssertCMSPageNotFoundOnFront" stepKey="checkFirstPageNotFoundOnFront"> + <actionGroup ref="StorefrontGoToCMSPageActionGroup" stepKey="goToCMSPageOnStorefront"> <argument name="identifier" value="{{_duplicatedCMSPage.identifier}}"/> </actionGroup> + <actionGroup ref="AssertCMSPageNotFoundOnStorefrontActionGroup" stepKey="seeNotFoundError"/> <!--Delete page--> <actionGroup ref="DeletePageByUrlKeyActionGroup" stepKey="deleteDisabledPage"> <argument name="UrlKey" value="{{_duplicatedCMSPage.identifier}}"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageForDefaultStoreTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageForDefaultStoreTest.xml index 4863737a39368..8b1b7fa482a6e 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageForDefaultStoreTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageForDefaultStoreTest.xml @@ -23,10 +23,10 @@ <actionGroup ref="logout" stepKey="logout"/> </after> <!--Go to New CMS Page page--> - <actionGroup ref="AdminCmsPageNavigateToCreateNewPage" stepKey="navigateToCreateNewPage"/> + <actionGroup ref="AdminOpenCreateNewCMSPageActionGroup" stepKey="navigateToCreateNewPage"/> <!--Fill the CMS page form--> <actionGroup ref="FillOutCMSPageContent" stepKey="fillBasicPageDataForPageWithDefaultStore"/> - <actionGroup ref="AdminCmsPageSelectPageStoreView" stepKey="selectCMSPageStoreView"> + <actionGroup ref="AdminSelectCMSPageStoreViewActionGroup" stepKey="selectCMSPageStoreView"> <argument name="storeViewName" value="Default Store View"/> </actionGroup> <!--Verify successfully saved--> @@ -38,7 +38,7 @@ <!--Verify Page Data in Admin--> <actionGroup ref="AssertCMSPageContent" stepKey="verifyPageWithDefaultStoreDataInAdmin"/> <!--Verify Store ID--> - <actionGroup ref="AssertCMSPageStoreId" stepKey="verifyStoreId"> + <actionGroup ref="AssertCMSPageStoreIdActionGroup" stepKey="verifyStoreId"> <argument name="storeId" value="1"/> </actionGroup> <!--Delete page--> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageInSingleStoreModeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageInSingleStoreModeTest.xml index 913fe4b15fd33..2ba101f82e248 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageInSingleStoreModeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageInSingleStoreModeTest.xml @@ -21,17 +21,17 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> </before> <after> - <magentoCLI command="config:set {{StorefrontSingleStoreModeDisabledConfigData.path}} {{StorefrontSingleStoreModeDisabledConfigData.value}}" stepKey="enableSingleStoreMode" /> + <magentoCLI command="config:set {{StorefrontSingleStoreModeDisabledConfigData.path}} {{StorefrontSingleStoreModeDisabledConfigData.value}}" stepKey="disableSingleStoreMode" /> <actionGroup ref="logout" stepKey="logout"/> </after> <!--Go to New CMS Page page--> - <actionGroup ref="AdminCmsPageNavigateToCreateNewPage" stepKey="navigateToCreateNewPage"/> + <actionGroup ref="AdminOpenCreateNewCMSPageActionGroup" stepKey="navigateToCreateNewPage"/> <!--Fill the CMS page form--> <actionGroup ref="FillOutCMSPageContent" stepKey="fillBasicPageDataForPageWithDefaultStore"/> <!--Verify successfully saved--> <actionGroup ref="saveCmsPage" stepKey="savePageInSingleStoreMode"/> <!--verify page on frontend--> - <actionGroup ref="StorefrontCMSPageNavigateToPage" stepKey="navigateToPageOnStoreFront"> + <actionGroup ref="StorefrontGoToCMSPageActionGroup" stepKey="navigateToPageOnStoreFront"> <argument name="identifier" value="{{_duplicatedCMSPage.identifier}}"/> </actionGroup> <actionGroup ref="AssertStoreFrontCMSPage" stepKey="verifyPageDataOnFrontend"> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageTest.xml index 940549d48483a..260bfea1f2b49 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageTest.xml @@ -23,12 +23,12 @@ <actionGroup ref="logout" stepKey="logout"/> </after> <!--Go to New CMS Page page--> - <actionGroup ref="AdminCmsPageNavigateToCreateNewPage" stepKey="navigateToCreateNewPage"/> + <actionGroup ref="AdminOpenCreateNewCMSPageActionGroup" stepKey="navigateToCreateNewPage"/> <actionGroup ref="FillOutCMSPageContent" stepKey="fillBasicPageData"/> <!--verify successfully saved--> <actionGroup ref="saveCmsPage" stepKey="saveNewPage"/> <!--verify page on frontend--> - <actionGroup ref="StorefrontCMSPageNavigateToPage" stepKey="navigateToPageOnStoreFront"> + <actionGroup ref="StorefrontGoToCMSPageActionGroup" stepKey="navigateToPageOnStoreFront"> <argument name="identifier" value="{{_duplicatedCMSPage.identifier}}"/> </actionGroup> <actionGroup ref="AssertStoreFrontCMSPage" stepKey="verifyPageDataOnFrontend"> @@ -37,7 +37,10 @@ <argument name="cmsContentHeading" value="{{_duplicatedCMSPage.content_heading}}"/> </actionGroup> <!--verify page in grid--> - <actionGroup ref="AssertCMSPageInGrid" stepKey="verifyPageInGrid"> + <actionGroup ref="AdminOpenCMSPagesGridActionGroup" stepKey="openCMSPagesGridActionGroup"/> + <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearGridFilters"/> + <actionGroup ref="SortByIdDescendingActionGroup" stepKey="sortGridByIdDescending"/> + <actionGroup ref="AdminSelectCMSPageFromGridActionGroup" stepKey="verifyPageInGrid"> <argument name="identifier" value="_duplicatedCMSPage.identifier"/> </actionGroup> <actionGroup ref="DeletePageByUrlKeyActionGroup" stepKey="deletePage"> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageWithBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageWithBlockTest.xml index 7d5046c5c0186..b7ab6f3b67e7c 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageWithBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageWithBlockTest.xml @@ -23,18 +23,18 @@ <actionGroup ref="logout" stepKey="logout"/> </after> <!--Go to New CMS Page page--> - <actionGroup ref="AdminCmsPageNavigateToCreateNewPage" stepKey="navigateToCreateNewPage"/> + <actionGroup ref="AdminOpenCreateNewCMSPageActionGroup" stepKey="navigateToCreateNewPage"/> <actionGroup ref="FillOutCMSPageContent" stepKey="fillBasicPageData"/> - <actionGroup ref="AdminCmsPageFillContentField" stepKey="fillContentField"> + <actionGroup ref="AdminFillCMSPageContentFieldActionGroup" stepKey="fillContentField"> <argument name="content" value="{{block class='Magento\Framework\View\Element\Text' text='bla bla bla' cache_key='BACKEND_ACL_RESOURCES' cache_lifetime=999}}"/> </actionGroup> - <actionGroup ref="AdminCmsPageSelectPageStoreView" stepKey="selectCMSPageStoreViewForPageWithBlock"> + <actionGroup ref="AdminSelectCMSPageStoreViewActionGroup" stepKey="selectCMSPageStoreViewForPageWithBlock"> <argument name="storeViewName" value="Default Store View"/> </actionGroup> <!--Verify successfully saved--> <actionGroup ref="saveCmsPage" stepKey="savePageWithBlock"/> <!--verify page on frontend--> - <actionGroup ref="StorefrontCMSPageNavigateToPage" stepKey="navigateToPageOnStoreFront"> + <actionGroup ref="StorefrontGoToCMSPageActionGroup" stepKey="navigateToPageOnStoreFront"> <argument name="identifier" value="{{_duplicatedCMSPage.identifier}}"/> </actionGroup> <actionGroup ref="AssertStoreFrontCMSPage" stepKey="verifyPageWithBlockDataOnFrontend"> From ab8b8bd4a34b7d069f548b2976589741ec8d47be Mon Sep 17 00:00:00 2001 From: Volodymyr Vygovskyi <v.vygovskyi@atwix.com> Date: Wed, 1 May 2019 11:38:20 +0300 Subject: [PATCH 005/586] minor refactoring --- ...abledPageTest.xml => AdminCMSPageCreateDisabledPageTest.xml} | 2 +- ...reTest.xml => AdminCMSPageCreatePageForDefaultStoreTest.xml} | 2 +- ...Test.xml => AdminCMSPageCreatePageInSingleStoreModeTest.xml} | 2 +- ...CmsPageCreatePageTest.xml => AdminCMSPageCreatePageTest.xml} | 2 +- ...ithBlockTest.xml => AdminCMSPageCreatePageWithBlockTest.xml} | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) rename app/code/Magento/Cms/Test/Mftf/Test/{AdminCmsPageCreateDisabledPageTest.xml => AdminCMSPageCreateDisabledPageTest.xml} (97%) rename app/code/Magento/Cms/Test/Mftf/Test/{AdminCmsPageCreatePageForDefaultStoreTest.xml => AdminCMSPageCreatePageForDefaultStoreTest.xml} (97%) rename app/code/Magento/Cms/Test/Mftf/Test/{AdminCmsPageCreatePageInSingleStoreModeTest.xml => AdminCMSPageCreatePageInSingleStoreModeTest.xml} (97%) rename app/code/Magento/Cms/Test/Mftf/Test/{AdminCmsPageCreatePageTest.xml => AdminCMSPageCreatePageTest.xml} (98%) rename app/code/Magento/Cms/Test/Mftf/Test/{AdminCmsPageCreatePageWithBlockTest.xml => AdminCMSPageCreatePageWithBlockTest.xml} (97%) diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreateDisabledPageTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreateDisabledPageTest.xml similarity index 97% rename from app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreateDisabledPageTest.xml rename to app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreateDisabledPageTest.xml index 6227b99a402a1..3a9427349c0fa 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreateDisabledPageTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreateDisabledPageTest.xml @@ -7,7 +7,7 @@ --> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminCmsPageCreateDisabledPageTest"> + <test name="AdminCMSPageCreateDisabledPageTest"> <annotations> <features value="Cms"/> <title value="Create disabled CMS Page via the Admin"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageForDefaultStoreTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageForDefaultStoreTest.xml similarity index 97% rename from app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageForDefaultStoreTest.xml rename to app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageForDefaultStoreTest.xml index 8b1b7fa482a6e..eaab13202c89d 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageForDefaultStoreTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageForDefaultStoreTest.xml @@ -7,7 +7,7 @@ --> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminCmsPageCreatePageForDefaultStoreTest"> + <test name="AdminCMSPageCreatePageForDefaultStoreTest"> <annotations> <features value="Cms"/> <title value="Create CMS Page via the Admin for default store"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageInSingleStoreModeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageInSingleStoreModeTest.xml similarity index 97% rename from app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageInSingleStoreModeTest.xml rename to app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageInSingleStoreModeTest.xml index 2ba101f82e248..a550ce6f4a9c5 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageInSingleStoreModeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageInSingleStoreModeTest.xml @@ -7,7 +7,7 @@ --> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminCmsPageCreatePageInSingleStoreModeTest"> + <test name="AdminCMSPageCreatePageInSingleStoreModeTest"> <annotations> <features value="Cms"/> <title value="Create CMS Page via the Admin in single store mode"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageTest.xml similarity index 98% rename from app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageTest.xml rename to app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageTest.xml index 260bfea1f2b49..4e1a5b5ed6422 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageTest.xml @@ -7,7 +7,7 @@ --> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminCmsPageCreatePageTest"> + <test name="AdminCMSPageCreatePageTest"> <annotations> <features value="Cms"/> <title value="Create CMS Page via the Admin"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageWithBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageWithBlockTest.xml similarity index 97% rename from app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageWithBlockTest.xml rename to app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageWithBlockTest.xml index b7ab6f3b67e7c..c4112111aa839 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageCreatePageWithBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageWithBlockTest.xml @@ -7,7 +7,7 @@ --> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminCmsPageCreatePageWithBlockTest"> + <test name="AdminCMSPageCreatePageWithBlockTest"> <annotations> <features value="Cms"/> <title value="Create CMS Page that contains block content via the Admin"/> From 3f0a6b2fffaabbade27e8044b6bcaa6d92bd8952 Mon Sep 17 00:00:00 2001 From: Volodymyr Vygovskyi <v.vygovskyi@atwix.com> Date: Wed, 1 May 2019 16:56:02 +0300 Subject: [PATCH 006/586] updated stepkey name in AdminOpenCMSPagesGridActionGroup --- .../Test/Mftf/ActionGroup/AdminOpenCMSPagesGridActionGroup.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminOpenCMSPagesGridActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminOpenCMSPagesGridActionGroup.xml index 8b140ea486603..fe5c6202c977d 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminOpenCMSPagesGridActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminOpenCMSPagesGridActionGroup.xml @@ -9,6 +9,6 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminOpenCMSPagesGridActionGroup"> <amOnPage url="{{CmsPagesPage.url}}" stepKey="navigateToCMSPagesGrid"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> + <waitForPageLoad stepKey="waitForPageLoad"/> </actionGroup> </actionGroups> \ No newline at end of file From ae520b8575e5d07ceb758c93bdb470a874568ebc Mon Sep 17 00:00:00 2001 From: Volodymyr Vygovskyi <v.vygovskyi@atwix.com> Date: Wed, 15 May 2019 11:07:15 +0300 Subject: [PATCH 007/586] fixed AdminCMSPageCreateDisabledPageTest after the merge --- .../Cms/Test/Mftf/Test/AdminCMSPageCreateDisabledPageTest.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreateDisabledPageTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreateDisabledPageTest.xml index 3a9427349c0fa..2f609f7a88b43 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreateDisabledPageTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreateDisabledPageTest.xml @@ -24,10 +24,10 @@ </after> <!--Go to New CMS Page page--> <actionGroup ref="AdminOpenCreateNewCMSPageActionGroup" stepKey="navigateToCreateNewPage"/> - <!--Fill the CMS page form--> - <actionGroup ref="FillOutCMSPageContent" stepKey="fillBasicPageDataForDisabledPage"/> <!--Set page disabled--> <actionGroup ref="AdminDisableCMSPage" stepKey="setCMSPageDisabled"/> + <!--Fill the CMS page form--> + <actionGroup ref="FillOutCMSPageContent" stepKey="fillBasicPageDataForDisabledPage"/> <!--Verify successfully saved--> <actionGroup ref="saveCmsPage" stepKey="saveDisabledPage"/> <!--Check that page is disabled on frontend--> From 0105e4c59d5606662a100580c4627e29f6f999cf Mon Sep 17 00:00:00 2001 From: Denis Kopylov <dkopylov@magenius.team> Date: Thu, 23 May 2019 17:11:41 +0300 Subject: [PATCH 008/586] [Catalog|Sales] Fix wrong behavior of grid row click event --- .../web/catalog/category/assign-products.js | 19 +- .../adminhtml/web/order/create/scripts.js | 445 +++++++++--------- lib/web/mage/adminhtml/grid.js | 89 ++-- 3 files changed, 293 insertions(+), 260 deletions(-) diff --git a/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/assign-products.js b/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/assign-products.js index 829c04c13106d..598bde9106231 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/assign-products.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/assign-products.js @@ -51,15 +51,28 @@ define([ */ function categoryProductRowClick(grid, event) { var trElement = Event.findElement(event, 'tr'), - isInput = Event.element(event).tagName === 'INPUT', + eventElement = Event.element(event), + isInputCheckbox = eventElement.tagName === 'INPUT' && eventElement.type === 'checkbox', + isInputPosition = grid.targetElement + && grid.targetElement.tagName === 'INPUT' + && grid.targetElement.name === 'position', checked = false, checkbox = null; - if (trElement) { + if (eventElement.tagName === 'LABEL' + && trElement.querySelector('#' + eventElement.htmlFor) + && trElement.querySelector('#' + eventElement.htmlFor).type === 'checkbox' + ) { + event.stopPropagation(); + trElement.querySelector('#' + eventElement.htmlFor).trigger('click'); + return; + } + + if (trElement && !isInputPosition) { checkbox = Element.getElementsBySelector(trElement, 'input'); if (checkbox[0]) { - checked = isInput ? checkbox[0].checked : !checkbox[0].checked; + checked = isInputCheckbox ? checkbox[0].checked : !checkbox[0].checked; gridJsObject.setCheckboxChecked(checkbox[0], checked); } } diff --git a/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js b/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js index c508a5ecdfa58..d6221b8914449 100644 --- a/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js +++ b/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js @@ -19,17 +19,17 @@ define([ window.AdminOrder = new Class.create(); AdminOrder.prototype = { - initialize : function(data){ - if(!data) data = {}; - this.loadBaseUrl = false; - this.customerId = data.customer_id ? data.customer_id : false; - this.storeId = data.store_id ? data.store_id : false; - this.quoteId = data['quote_id'] ? data['quote_id'] : false; - this.currencyId = false; + initialize: function (data) { + if (!data) data = {}; + this.loadBaseUrl = false; + this.customerId = data.customer_id ? data.customer_id : false; + this.storeId = data.store_id ? data.store_id : false; + this.quoteId = data['quote_id'] ? data['quote_id'] : false; + this.currencyId = false; this.currencySymbol = data.currency_symbol ? data.currency_symbol : ''; - this.addresses = data.addresses ? data.addresses : $H({}); + this.addresses = data.addresses ? data.addresses : $H({}); this.shippingAsBilling = data.shippingAsBilling ? data.shippingAsBilling : false; - this.gridProducts = $H({}); + this.gridProducts = $H({}); this.gridProductsGift = $H({}); this.billingAddressContainer = ''; this.shippingAddressContainer = ''; @@ -55,10 +55,10 @@ define([ } }); - jQuery.async('#order-items', (function(){ + jQuery.async('#order-items', (function () { this.dataArea = new OrderFormArea('data', $(this.getAreaId('data')), this); this.itemsArea = Object.extend(new OrderFormArea('items', $(this.getAreaId('items')), this), { - addControlButton: function(button){ + addControlButton: function (button) { var controlButtonArea = $(this.node).select('.actions')[0]; if (typeof controlButtonArea != 'undefined') { var buttons = controlButtonArea.childElements(); @@ -75,7 +75,7 @@ define([ var searchButtonId = 'add_products', searchButton = new ControlButton(jQuery.mage.__('Add Products'), searchButtonId), searchAreaId = this.getAreaId('search'); - searchButton.onClick = function() { + searchButton.onClick = function () { $(searchAreaId).show(); var el = this; window.setTimeout(function () { @@ -84,13 +84,13 @@ define([ }; if (jQuery('#' + this.getAreaId('items')).is(':visible')) { - this.dataArea.onLoad = this.dataArea.onLoad.wrap(function(proceed) { + this.dataArea.onLoad = this.dataArea.onLoad.wrap(function (proceed) { proceed(); this._parent.itemsArea.setNode($(this._parent.getAreaId('items'))); this._parent.itemsArea.onLoad(); }); - this.itemsArea.onLoad = this.itemsArea.onLoad.wrap(function(proceed) { + this.itemsArea.onLoad = this.itemsArea.onLoad.wrap(function (proceed) { proceed(); if ($(searchAreaId) && !$(searchAreaId).visible() && !$(searchButtonId)) { this.addControlButton(searchButton); @@ -102,35 +102,35 @@ define([ }).bind(this)); jQuery('#edit_form') - .on('submitOrder', function(){ + .on('submitOrder', function () { jQuery(this).trigger('realOrder'); }) .on('realOrder', this._realSubmit.bind(this)); }, - areasLoaded: function(){ + areasLoaded: function () { }, - itemsLoaded: function(){ + itemsLoaded: function () { }, - dataLoaded: function(){ + dataLoaded: function () { this.dataShow(); }, - setLoadBaseUrl : function(url){ + setLoadBaseUrl: function (url) { this.loadBaseUrl = url; }, - setAddresses : function(addresses){ + setAddresses: function (addresses) { this.addresses = addresses; }, - addExcludedPaymentMethod : function(method){ + addExcludedPaymentMethod: function (method) { this.excludedPaymentMethods.push(method); }, - setCustomerId : function(id){ + setCustomerId: function (id) { this.customerId = id; this.loadArea('header', true); $(this.getAreaId('header')).callback = 'setCustomerAfter'; @@ -138,18 +138,17 @@ define([ $('reset_order_top_button').show(); }, - setCustomerAfter : function () { + setCustomerAfter: function () { this.customerSelectorHide(); if (this.storeId) { $(this.getAreaId('data')).callback = 'dataLoaded'; this.loadArea(['data'], true); - } - else { + } else { this.storeSelectorShow(); } }, - setStoreId : function(id){ + setStoreId: function (id) { this.storeId = id; this.storeSelectorHide(); this.sidebarShow(); @@ -158,26 +157,25 @@ define([ this.loadArea(['header', 'data'], true); }, - setCurrencyId : function(id){ + setCurrencyId: function (id) { this.currencyId = id; //this.loadArea(['sidebar', 'data'], true); this.loadArea(['data'], true); }, - setCurrencySymbol : function(symbol){ + setCurrencySymbol: function (symbol) { this.currencySymbol = symbol; }, - selectAddress : function(el, container){ + selectAddress: function (el, container) { id = el.value; if (id.length == 0) { id = '0'; } - if(this.addresses[id]){ + if (this.addresses[id]) { this.fillAddressFields(container, this.addresses[id]); - } - else{ + } else { this.fillAddressFields(container, {}); } @@ -187,7 +185,7 @@ define([ this.resetPaymentMethod(); if (this.isShippingField(container) && !this.isShippingMethodReseted) { this.resetShippingMethod(data); - } else{ + } else { this.saveData(data); } }, @@ -313,13 +311,13 @@ define([ }); }, - fillAddressFields: function(container, data){ + fillAddressFields: function (container, data) { var regionIdElem = false; var regionIdElemValue = false; var fields = $(container).select('input', 'select', 'textarea'); var re = /[^\[]*\[[^\]]*\]\[([^\]]*)\](\[(\d)\])?/; - for(var i=0;i<fields.length;i++){ + for (var i = 0; i < fields.length; i++) { // skip input type file @Security error code: 1000 if (fields[i].tagName.toLowerCase() == 'input' && fields[i].type.toLowerCase() == 'file') { continue; @@ -331,9 +329,9 @@ define([ var name = matchRes[1]; var index = matchRes[3]; - if (index){ + if (index) { // multiply line - if (data[name]){ + if (data[name]) { var values = data[name].split("\n"); fields[i].value = values[index] ? values[index] : ''; } else { @@ -358,7 +356,7 @@ define([ fields[i].changeUpdater(); } - if (name == 'region' && data['region_id'] && !data['region']){ + if (name == 'region' && data['region_id'] && !data['region']) { fields[i].value = data['region_id']; } @@ -366,7 +364,7 @@ define([ } }, - disableShippingAddress : function(flag) { + disableShippingAddress: function (flag) { this.shippingAsBilling = flag; if ($('order-shipping_address_customer_address_id')) { $('order-shipping_address_customer_address_id').disabled = flag; @@ -376,7 +374,7 @@ define([ for (var i = 0; i < dataFields.length; i++) { dataFields[i].disabled = flag; - if(this.isOnlyVirtualProduct) { + if (this.isOnlyVirtualProduct) { dataFields[i].setValue(''); } } @@ -433,8 +431,8 @@ define([ */ loadShippingRates: function () { var addressContainer = this.shippingAsBilling ? - 'billingAddressContainer' : - 'shippingAddressContainer', + 'billingAddressContainer' : + 'shippingAddressContainer', data = this.serializeData(this[addressContainer]).toObject(); data['collect_shipping_rates'] = 1; @@ -444,7 +442,7 @@ define([ return false; }, - setShippingMethod: function(method) { + setShippingMethod: function (method) { var data = {}; data['order[shipping_method]'] = method; @@ -461,18 +459,18 @@ define([ * * @return boolean */ - loadPaymentMethods: function() { + loadPaymentMethods: function () { var data = this.serializeData(this.billingAddressContainer).toObject(); - this.loadArea(['billing_method','totals'], true, data); + this.loadArea(['billing_method', 'totals'], true, data); return false; }, - switchPaymentMethod: function(method){ + switchPaymentMethod: function (method) { jQuery('#edit_form') .off('submitOrder') - .on('submitOrder', function(){ + .on('submitOrder', function () { jQuery(this).trigger('realOrder'); }); jQuery('#edit_form').trigger('changePaymentMethod', [method]); @@ -482,35 +480,35 @@ define([ this.loadArea(['card_validation'], true, data); }, - setPaymentMethod : function(method){ - if (this.paymentMethod && $('payment_form_'+this.paymentMethod)) { - var form = 'payment_form_'+this.paymentMethod; - [form + '_before', form, form + '_after'].each(function(el) { + setPaymentMethod: function (method) { + if (this.paymentMethod && $('payment_form_' + this.paymentMethod)) { + var form = 'payment_form_' + this.paymentMethod; + [form + '_before', form, form + '_after'].each(function (el) { var block = $(el); if (block) { block.hide(); - block.select('input', 'select', 'textarea').each(function(field) { + block.select('input', 'select', 'textarea').each(function (field) { field.disabled = true; }); } }); } - if(!this.paymentMethod || method){ - $('order-billing_method_form').select('input', 'select', 'textarea').each(function(elem){ - if(elem.type != 'radio') elem.disabled = true; + if (!this.paymentMethod || method) { + $('order-billing_method_form').select('input', 'select', 'textarea').each(function (elem) { + if (elem.type != 'radio') elem.disabled = true; }) } - if ($('payment_form_'+method)){ + if ($('payment_form_' + method)) { jQuery('#' + this.getAreaId('billing_method')).trigger('contentUpdated'); this.paymentMethod = method; - var form = 'payment_form_'+method; - [form + '_before', form, form + '_after'].each(function(el) { + var form = 'payment_form_' + method; + [form + '_before', form, form + '_after'].each(function (el) { var block = $(el); if (block) { block.show(); - block.select('input', 'select', 'textarea').each(function(field) { + block.select('input', 'select', 'textarea').each(function (field) { field.disabled = false; if (!el.include('_before') && !el.include('_after') && !field.bindChange) { field.bindChange = true; @@ -518,15 +516,15 @@ define([ field.method = method; field.observe('change', this.changePaymentData.bind(this)) } - },this); + }, this); } - },this); + }, this); } }, - changePaymentData : function(event){ + changePaymentData: function (event) { var elem = Event.element(event); - if(elem && elem.method){ + if (elem && elem.method) { var data = this.getPaymentData(elem.method); if (data) { this.loadArea(['card_validation'], true, data); @@ -536,8 +534,8 @@ define([ } }, - getPaymentData : function(currentMethod){ - if (typeof(currentMethod) == 'undefined') { + getPaymentData: function (currentMethod) { + if (typeof (currentMethod) == 'undefined') { if (this.paymentMethod) { currentMethod = this.paymentMethod; } else { @@ -549,7 +547,7 @@ define([ } var data = {}; var fields = $('payment_form_' + currentMethod).select('input', 'select'); - for(var i=0;i<fields.length;i++){ + for (var i = 0; i < fields.length; i++) { data[fields[i].name] = fields[i].getValue(); } if ((typeof data['payment[cc_type]']) != 'undefined' && (!data['payment[cc_type]'] || !data['payment[cc_number]'])) { @@ -558,32 +556,38 @@ define([ return data; }, - applyCoupon : function(code){ - this.loadArea(['items', 'shipping_method', 'totals', 'billing_method'], true, {'order[coupon][code]':code, reset_shipping: 0}); + applyCoupon: function (code) { + this.loadArea(['items', 'shipping_method', 'totals', 'billing_method'], true, { + 'order[coupon][code]': code, + reset_shipping: 0 + }); this.orderItemChanged = false; }, - addProduct : function(id){ - this.loadArea(['items', 'shipping_method', 'totals', 'billing_method'], true, {add_product:id, reset_shipping: true}); + addProduct: function (id) { + this.loadArea(['items', 'shipping_method', 'totals', 'billing_method'], true, { + add_product: id, + reset_shipping: true + }); }, - removeQuoteItem : function(id){ + removeQuoteItem: function (id) { this.loadArea(['items', 'shipping_method', 'totals', 'billing_method'], true, - {remove_item:id, from:'quote',reset_shipping: true}); + {remove_item: id, from: 'quote', reset_shipping: true}); }, - moveQuoteItem : function(id, to){ - this.loadArea(['sidebar_'+to, 'items', 'shipping_method', 'totals', 'billing_method'], this.getAreaId('items'), - {move_item:id, to:to, reset_shipping: true}); + moveQuoteItem: function (id, to) { + this.loadArea(['sidebar_' + to, 'items', 'shipping_method', 'totals', 'billing_method'], this.getAreaId('items'), + {move_item: id, to: to, reset_shipping: true}); }, - productGridShow : function(buttonElement){ + productGridShow: function (buttonElement) { this.productGridShowButton = buttonElement; Element.hide(buttonElement); this.showArea('search'); }, - productGridRowInit : function(grid, row){ + productGridRowInit: function (grid, row) { var checkbox = $(row).select('.checkbox')[0]; var inputs = $(row).select('.input-text'); if (checkbox && inputs.length > 0) { @@ -606,29 +610,39 @@ define([ input.disabled = !checkbox.checked || input.hasClassName('input-inactive'); - Event.observe(input,'keyup', this.productGridRowInputChange.bind(this)); - Event.observe(input,'change',this.productGridRowInputChange.bind(this)); + Event.observe(input, 'keyup', this.productGridRowInputChange.bind(this)); + Event.observe(input, 'change', this.productGridRowInputChange.bind(this)); } } }, - productGridRowInputChange : function(event){ + productGridRowInputChange: function (event) { var element = Event.element(event); - if (element && element.checkboxElement && element.checkboxElement.checked){ - if (element.name!='giftmessage' || element.checked) { + if (element && element.checkboxElement && element.checkboxElement.checked) { + if (element.name != 'giftmessage' || element.checked) { this.gridProducts.get(element.checkboxElement.value)[element.name] = element.value; - } else if (element.name=='giftmessage' && this.gridProducts.get(element.checkboxElement.value)[element.name]) { - delete(this.gridProducts.get(element.checkboxElement.value)[element.name]); + } else if (element.name == 'giftmessage' && this.gridProducts.get(element.checkboxElement.value)[element.name]) { + delete (this.gridProducts.get(element.checkboxElement.value)[element.name]); } } }, - productGridRowClick : function(grid, event){ + productGridRowClick: function (grid, event) { var trElement = Event.findElement(event, 'tr'); var qtyElement = trElement.select('input[name="qty"]')[0]; var eventElement = Event.element(event); - var isInputCheckbox = eventElement.tagName == 'INPUT' && eventElement.type == 'checkbox'; - var isInputQty = eventElement.tagName == 'INPUT' && eventElement.name == 'qty'; + + if (eventElement.tagName === 'LABEL' + && trElement.querySelector('#' + eventElement.htmlFor) + && trElement.querySelector('#' + eventElement.htmlFor).type === 'checkbox' + ) { + event.stopPropagation(); + trElement.querySelector('#' + eventElement.htmlFor).trigger('click'); + return; + } + + var isInputCheckbox = (eventElement.tagName === 'INPUT' && eventElement.type === 'checkbox'); + var isInputQty = grid.targetElement && grid.targetElement.tagName === 'INPUT' && grid.targetElement.name === 'qty'; if (trElement && !isInputQty) { var checkbox = Element.select(trElement, 'input[type="checkbox"]')[0]; var confLink = Element.select(trElement, 'a')[0]; @@ -650,10 +664,10 @@ define([ if (!priceBase) { this.productPriceBase[productId] = 0; } else { - this.productPriceBase[productId] = parseFloat(priceBase[1].replace(/,/g,'')); + this.productPriceBase[productId] = parseFloat(priceBase[1].replace(/,/g, '')); } } - productConfigure.setConfirmCallback(listType, function() { + productConfigure.setConfirmCallback(listType, function () { // sync qty of popup and qty of grid var confirmedCurrentQty = productConfigure.getCurrentConfirmedQtyElement(); if (qtyElement && confirmedCurrentQty && !isNaN(confirmedCurrentQty.value)) { @@ -669,12 +683,12 @@ define([ // and set checkbox checked grid.setCheckboxChecked(checkbox, true); }.bind(this)); - productConfigure.setCancelCallback(listType, function() { + productConfigure.setCancelCallback(listType, function () { if (!$(productConfigure.confirmedCurrentId) || !$(productConfigure.confirmedCurrentId).innerHTML) { grid.setCheckboxChecked(checkbox, false); } }); - productConfigure.setShowWindowCallback(listType, function() { + productConfigure.setShowWindowCallback(listType, function () { // sync qty of grid and qty of popup var formCurrentQty = productConfigure.getCurrentFormQtyElement(); if (formCurrentQty && qtyElement && !isNaN(qtyElement.value)) { @@ -690,7 +704,7 @@ define([ /** * Is need to summarize price */ - _isSummarizePrice: function(elm) { + _isSummarizePrice: function (elm) { if (elm && elm.hasAttribute('summarizePrice')) { this.summarizePrice = parseInt(elm.readAttribute('summarizePrice')); } @@ -717,9 +731,9 @@ define([ } return 0; }; - for(var i = 0; i < elms.length; i++) { + for (var i = 0; i < elms.length; i++) { if (elms[i].type == 'select-one' || elms[i].type == 'select-multiple') { - for(var ii = 0; ii < elms[i].options.length; ii++) { + for (var ii = 0; ii < elms[i].options.length; ii++) { if (elms[i].options[ii].selected) { if (this._isSummarizePrice(elms[i].options[ii])) { productPrice += getPrice(elms[i].options[ii]); @@ -728,8 +742,7 @@ define([ } } } - } - else if (((elms[i].type == 'checkbox' || elms[i].type == 'radio') && elms[i].checked) + } else if (((elms[i].type == 'checkbox' || elms[i].type == 'radio') && elms[i].checked) || ((elms[i].type == 'file' || elms[i].type == 'text' || elms[i].type == 'textarea' || elms[i].type == 'hidden') && Form.Element.getValue(elms[i])) ) { @@ -748,9 +761,9 @@ define([ return productPrice; }, - productGridCheckboxCheck : function(grid, element, checked){ + productGridCheckboxCheck: function (grid, element, checked) { if (checked) { - if(element.inputElements) { + if (element.inputElements) { this.gridProducts.set(element.value, {}); var product = this.gridProducts.get(element.value); for (var i = 0; i < element.inputElements.length; i++) { @@ -765,36 +778,36 @@ define([ if (input.checked || input.name != 'giftmessage') { product[input.name] = input.value; } else if (product[input.name]) { - delete(product[input.name]); + delete (product[input.name]); } } } } else { - if(element.inputElements){ - for(var i = 0; i < element.inputElements.length; i++) { + if (element.inputElements) { + for (var i = 0; i < element.inputElements.length; i++) { element.inputElements[i].disabled = true; } } this.gridProducts.unset(element.value); } - grid.reloadParams = {'products[]':this.gridProducts.keys()}; + grid.reloadParams = {'products[]': this.gridProducts.keys()}; }, /** * Submit configured products to quote */ - productGridAddSelected : function(){ - if(this.productGridShowButton) Element.show(this.productGridShowButton); - var area = ['search', 'items', 'shipping_method', 'totals', 'giftmessage','billing_method']; + productGridAddSelected: function () { + if (this.productGridShowButton) Element.show(this.productGridShowButton); + var area = ['search', 'items', 'shipping_method', 'totals', 'giftmessage', 'billing_method']; // prepare additional fields and filtered items of products var fieldsPrepare = {}; var itemsFilter = []; var products = this.gridProducts.toObject(); for (var productId in products) { itemsFilter.push(productId); - var paramKey = 'item['+productId+']'; + var paramKey = 'item[' + productId + ']'; for (var productParamKey in products[productId]) { - paramKey += '['+productParamKey+']'; + paramKey += '[' + productParamKey + ']'; fieldsPrepare[paramKey] = products[productId][productParamKey]; } } @@ -804,47 +817,47 @@ define([ this.gridProducts = $H({}); }, - selectCustomer : function(grid, event){ + selectCustomer: function (grid, event) { var element = Event.findElement(event, 'tr'); - if (element.title){ + if (element.title) { this.setCustomerId(element.title); } }, - customerSelectorHide : function(){ + customerSelectorHide: function () { this.hideArea('customer-selector'); }, - customerSelectorShow : function(){ + customerSelectorShow: function () { this.showArea('customer-selector'); }, - storeSelectorHide : function(){ + storeSelectorHide: function () { this.hideArea('store-selector'); }, - storeSelectorShow : function(){ + storeSelectorShow: function () { this.showArea('store-selector'); }, - dataHide : function(){ + dataHide: function () { this.hideArea('data'); }, - dataShow : function(){ + dataShow: function () { if ($('submit_order_top_button')) { $('submit_order_top_button').show(); } this.showArea('data'); }, - clearShoppingCart : function(confirmMessage){ + clearShoppingCart: function (confirmMessage) { var self = this; confirm({ content: confirmMessage, actions: { - confirm: function() { + confirm: function () { self.collectElementsValue = false; order.sidebarApplyChanges({'sidebar[empty_customer_cart]': 1}); self.collectElementsValue = true; @@ -853,12 +866,12 @@ define([ }); }, - sidebarApplyChanges : function(auxiliaryParams) { + sidebarApplyChanges: function (auxiliaryParams) { if ($(this.getAreaId('sidebar'))) { var data = {}; if (this.collectElementsValue) { var elems = $(this.getAreaId('sidebar')).select('input'); - for (var i=0; i < elems.length; i++) { + for (var i = 0; i < elems.length; i++) { if (elems[i].getValue()) { data[elems[i].name] = elems[i].getValue(); } @@ -870,20 +883,20 @@ define([ } } data.reset_shipping = true; - this.loadArea(['sidebar', 'items', 'shipping_method', 'billing_method','totals', 'giftmessage'], true, data); + this.loadArea(['sidebar', 'items', 'shipping_method', 'billing_method', 'totals', 'giftmessage'], true, data); } }, - sidebarHide : function(){ - if(this.storeId === false && $('page:left') && $('page:container')){ + sidebarHide: function () { + if (this.storeId === false && $('page:left') && $('page:container')) { $('page:left').hide(); $('page:container').removeClassName('container'); $('page:container').addClassName('container-collapsed'); } }, - sidebarShow : function(){ - if($('page:left') && $('page:container')){ + sidebarShow: function () { + if ($('page:left') && $('page:container')) { $('page:left').show(); $('page:container').removeClassName('container-collapsed'); $('page:container').addClassName('container'); @@ -904,7 +917,7 @@ define([ for (var i in params) { if (params[i] === null) { unset(params[i]); - } else if (typeof(params[i]) == 'boolean') { + } else if (typeof (params[i]) == 'boolean') { params[i] = params[i] ? 1 : 0; } } @@ -913,15 +926,15 @@ define([ fields.push(new Element('input', {type: 'hidden', name: name, value: params[name]})); } // add additional fields before triggered submit - productConfigure.setBeforeSubmitCallback(listType, function() { + productConfigure.setBeforeSubmitCallback(listType, function () { productConfigure.addFields(fields); }.bind(this)); // response handler - productConfigure.setOnLoadIFrameCallback(listType, function(response) { + productConfigure.setOnLoadIFrameCallback(listType, function (response) { if (!response.ok) { return; } - this.loadArea(['items', 'shipping_method', 'billing_method','totals', 'giftmessage'], true); + this.loadArea(['items', 'shipping_method', 'billing_method', 'totals', 'giftmessage'], true); }.bind(this)); // show item configuration itemId = itemId ? itemId : productId; @@ -929,17 +942,17 @@ define([ return false; }, - removeSidebarItem : function(id, from){ - this.loadArea(['sidebar_'+from], 'sidebar_data_'+from, {remove_item:id, from:from}); + removeSidebarItem: function (id, from) { + this.loadArea(['sidebar_' + from], 'sidebar_data_' + from, {remove_item: id, from: from}); }, - itemsUpdate : function(){ - var area = ['sidebar', 'items', 'shipping_method', 'billing_method','totals', 'giftmessage']; + itemsUpdate: function () { + var area = ['sidebar', 'items', 'shipping_method', 'billing_method', 'totals', 'giftmessage']; // prepare additional fields var fieldsPrepare = {update_items: 1}; var info = $('order-items_grid').select('input', 'select', 'textarea'); - for(var i=0; i<info.length; i++){ - if(!info[i].disabled && (info[i].type != 'checkbox' || info[i].checked)) { + for (var i = 0; i < info.length; i++) { + if (!info[i].disabled && (info[i].type != 'checkbox' || info[i].checked)) { fieldsPrepare[info[i].name] = info[i].getValue(); } } @@ -948,17 +961,17 @@ define([ this.orderItemChanged = false; }, - itemsOnchangeBind : function(){ + itemsOnchangeBind: function () { var elems = $('order-items_grid').select('input', 'select', 'textarea'); - for(var i=0; i<elems.length; i++){ - if(!elems[i].bindOnchange){ + for (var i = 0; i < elems.length; i++) { + if (!elems[i].bindOnchange) { elems[i].bindOnchange = true; elems[i].observe('change', this.itemChange.bind(this)) } } }, - itemChange : function(event){ + itemChange: function (event) { this.giftmessageOnItemChange(event); this.orderItemChanged = true; }, @@ -971,7 +984,7 @@ define([ * @param fieldsPrepare * @param itemsFilter */ - productConfigureSubmit : function(listType, area, fieldsPrepare, itemsFilter) { + productConfigureSubmit: function (listType, area, fieldsPrepare, itemsFilter) { // prepare loading areas and build url area = this.prepareArea(area); this.loadingAreas = area; @@ -996,7 +1009,7 @@ define([ // prepare and do submit productConfigure.addListType(listType, {urlSubmit: url}); - productConfigure.setOnLoadIFrameCallback(listType, function(response){ + productConfigure.setOnLoadIFrameCallback(listType, function (response) { this.loadAreaResponseHandler(response); }.bind(this)); productConfigure.submit(listType); @@ -1009,20 +1022,20 @@ define([ * * @param itemId */ - showQuoteItemConfiguration: function(itemId){ + showQuoteItemConfiguration: function (itemId) { var listType = 'quote_items'; - var qtyElement = $('order-items_grid').select('input[name="item\['+itemId+'\]\[qty\]"]')[0]; - productConfigure.setConfirmCallback(listType, function() { + var qtyElement = $('order-items_grid').select('input[name="item\[' + itemId + '\]\[qty\]"]')[0]; + productConfigure.setConfirmCallback(listType, function () { // sync qty of popup and qty of grid var confirmedCurrentQty = productConfigure.getCurrentConfirmedQtyElement(); if (qtyElement && confirmedCurrentQty && !isNaN(confirmedCurrentQty.value)) { qtyElement.value = confirmedCurrentQty.value; } - this.productConfigureAddFields['item['+itemId+'][configured]'] = 1; + this.productConfigureAddFields['item[' + itemId + '][configured]'] = 1; this.itemsUpdate(); }.bind(this)); - productConfigure.setShowWindowCallback(listType, function() { + productConfigure.setShowWindowCallback(listType, function () { // sync qty of grid and qty of popup var formCurrentQty = productConfigure.getCurrentFormQtyElement(); if (formCurrentQty && qtyElement && !isNaN(qtyElement.value)) { @@ -1032,60 +1045,59 @@ define([ productConfigure.showItemConfiguration(listType, itemId); }, - accountFieldsBind : function(container){ - if($(container)){ + accountFieldsBind: function (container) { + if ($(container)) { var fields = $(container).select('input', 'select', 'textarea'); - for(var i=0; i<fields.length; i++){ - if(fields[i].id == 'group_id'){ + for (var i = 0; i < fields.length; i++) { + if (fields[i].id == 'group_id') { fields[i].observe('change', this.accountGroupChange.bind(this)) - } - else{ + } else { fields[i].observe('change', this.accountFieldChange.bind(this)) } } } }, - accountGroupChange : function(){ + accountGroupChange: function () { this.loadArea(['data'], true, this.serializeData('order-form_account').toObject()); }, - accountFieldChange : function(){ + accountFieldChange: function () { this.saveData(this.serializeData('order-form_account')); }, - commentFieldsBind : function(container){ - if($(container)){ + commentFieldsBind: function (container) { + if ($(container)) { var fields = $(container).select('input', 'textarea'); - for(var i=0; i<fields.length; i++) + for (var i = 0; i < fields.length; i++) fields[i].observe('change', this.commentFieldChange.bind(this)) } }, - commentFieldChange : function(){ + commentFieldChange: function () { this.saveData(this.serializeData('order-comment')); }, - giftmessageFieldsBind : function(container){ - if($(container)){ + giftmessageFieldsBind: function (container) { + if ($(container)) { var fields = $(container).select('input', 'textarea'); - for(var i=0; i<fields.length; i++) + for (var i = 0; i < fields.length; i++) fields[i].observe('change', this.giftmessageFieldChange.bind(this)) } }, - giftmessageFieldChange : function(){ + giftmessageFieldChange: function () { this.giftMessageDataChanged = true; }, - giftmessageOnItemChange : function(event) { + giftmessageOnItemChange: function (event) { var element = Event.element(event); - if(element.name.indexOf("giftmessage") != -1 && element.type == "checkbox" && !element.checked) { + if (element.name.indexOf("giftmessage") != -1 && element.type == "checkbox" && !element.checked) { var messages = $("order-giftmessage").select('textarea'); var name; - for(var i=0; i<messages.length; i++) { + for (var i = 0; i < messages.length; i++) { name = messages[i].id.split("_"); - if(name.length < 2) continue; + if (name.length < 2) continue; if (element.name.indexOf("[" + name[1] + "]") != -1 && messages[i].value != "") { alert({ content: "First, clean the Message field in Gift Message form" @@ -1096,7 +1108,7 @@ define([ } }, - loadArea : function(area, indicator, params){ + loadArea: function (area, indicator, params) { var deferred = new jQuery.Deferred(); var url = this.loadBaseUrl; if (area) { @@ -1110,20 +1122,19 @@ define([ if (indicator) { this.loadingAreas = area; new Ajax.Request(url, { - parameters:params, + parameters: params, loaderArea: indicator, - onSuccess: function(transport) { + onSuccess: function (transport) { var response = transport.responseText.evalJSON(); this.loadAreaResponseHandler(response); deferred.resolve(); }.bind(this) }); - } - else { + } else { new Ajax.Request(url, { - parameters:params, + parameters: params, loaderArea: indicator, - onSuccess: function(transport) { + onSuccess: function (transport) { deferred.resolve(); } }); @@ -1134,7 +1145,7 @@ define([ return deferred.promise(); }, - loadAreaResponseHandler : function (response) { + loadAreaResponseHandler: function (response) { if (response.error) { alert({ content: response.message @@ -1169,45 +1180,44 @@ define([ } }, - prepareArea : function(area) { + prepareArea: function (area) { if (this.giftMessageDataChanged) { return area.without('giftmessage'); } return area; }, - saveData : function(data){ + saveData: function (data) { this.loadArea(false, false, data); }, - showArea : function(area){ + showArea: function (area) { var id = this.getAreaId(area); - if($(id)) { + if ($(id)) { $(id).show(); this.areaOverlay(); } }, - hideArea : function(area){ + hideArea: function (area) { var id = this.getAreaId(area); - if($(id)) { + if ($(id)) { $(id).hide(); this.areaOverlay(); } }, - areaOverlay : function() - { - $H(order.overlayData).each(function(e){ + areaOverlay: function () { + $H(order.overlayData).each(function (e) { e.value.fx(); }); }, - getAreaId : function(area){ - return 'order-'+area; + getAreaId: function (area) { + return 'order-' + area; }, - prepareParams : function(params){ + prepareParams: function (params) { if (!params) { params = {}; } @@ -1227,7 +1237,7 @@ define([ if (this.isPaymentValidationAvailable()) { var data = this.serializeData('order-billing_method'); if (data) { - data.each(function(value) { + data.each(function (value) { params[value[0]] = value[1]; }); } @@ -1242,7 +1252,7 @@ define([ * * @returns {boolean} */ - isPaymentValidationAvailable : function(){ + isPaymentValidationAvailable: function () { return ((typeof this.paymentMethod) == 'undefined' || this.excludedPaymentMethods.indexOf(this.paymentMethod) == -1); }, @@ -1260,21 +1270,19 @@ define([ return $H(data); }, - toggleCustomPrice: function(checkbox, elemId, tierBlock) { + toggleCustomPrice: function (checkbox, elemId, tierBlock) { if (checkbox.checked) { $(elemId).disabled = false; $(elemId).show(); - if($(tierBlock)) $(tierBlock).hide(); - } - else { + if ($(tierBlock)) $(tierBlock).hide(); + } else { $(elemId).disabled = true; $(elemId).hide(); - if($(tierBlock)) $(tierBlock).show(); + if ($(tierBlock)) $(tierBlock).show(); } }, - submit : function() - { + submit: function () { var $editForm = jQuery('#edit_form'); if ($editForm.valid()) { @@ -1284,9 +1292,9 @@ define([ }, _realSubmit: function () { - var disableAndSave = function() { + var disableAndSave = function () { disableElements('save'); - jQuery('#edit_form').on('invalid-form.validate', function() { + jQuery('#edit_form').on('invalid-form.validate', function () { enableElements('save'); jQuery('#edit_form').trigger('processStop'); jQuery('#edit_form').off('invalid-form.validate'); @@ -1301,11 +1309,11 @@ define([ confirm({ content: jQuery.mage.__('You have item changes'), actions: { - confirm: function() { + confirm: function () { jQuery('#edit_form').trigger('processStart'); disableAndSave(); }, - cancel: function() { + cancel: function () { self.itemsUpdate(); } } @@ -1315,8 +1323,10 @@ define([ } }, - overlay : function(elId, show, observe) { - if (typeof(show) == 'undefined') { show = true; } + overlay: function (elId, show, observe) { + if (typeof (show) == 'undefined') { + show = true; + } var orderObj = this; var obj = this.overlayData.get(elId); @@ -1325,7 +1335,7 @@ define([ show: show, el: elId, order: orderObj, - fx: function(event) { + fx: function (event) { this.order.processOverlay(this.el, this.show); } }; @@ -1341,7 +1351,7 @@ define([ this.processOverlay(elId, show); }, - processOverlay : function(elId, show) { + processOverlay: function (elId, show) { var el = $(elId); if (!el) { @@ -1373,8 +1383,7 @@ define([ }); }, - validateVat: function(parameters) - { + validateVat: function (parameters) { var params = { country: $(parameters.countryElementId).value, vat: $(parameters.vatElementId).value @@ -1389,7 +1398,7 @@ define([ new Ajax.Request(parameters.validateUrl, { parameters: params, - onSuccess: function(response) { + onSuccess: function (response) { var message = ''; var groupActionRequired = null; try { @@ -1428,8 +1437,7 @@ define([ alert({ content: message }); - } - else { + } else { this.processCustomerGroupChange( parameters.groupIdHtmlId, message, @@ -1443,8 +1451,7 @@ define([ }); }, - processCustomerGroupChange: function(groupIdHtmlId, message, customerGroupMessage, errorMessage, groupId, action) - { + processCustomerGroupChange: function (groupIdHtmlId, message, customerGroupMessage, errorMessage, groupId, action) { var groupMessage = ''; try { var currentCustomerGroupId = $(groupIdHtmlId).value; @@ -1484,8 +1491,8 @@ define([ _parent: null, _callbackName: null, - initialize: function(name, node, parent){ - if(!node) + initialize: function (name, node, parent) { + if (!node) return; this._name = name; this._parent = parent; @@ -1494,7 +1501,7 @@ define([ this._callbackName = name + 'Loaded'; node.callback = this._callbackName; } - parent[this._callbackName] = parent[this._callbackName].wrap((function (proceed){ + parent[this._callbackName] = parent[this._callbackName].wrap((function (proceed) { proceed(); this.onLoad(); }).bind(this)); @@ -1502,14 +1509,14 @@ define([ this.setNode(node); }, - setNode: function(node){ + setNode: function (node) { if (!node.callback) { node.callback = this._callbackName; } this.node = node; }, - onLoad: function(){ + onLoad: function () { } }; @@ -1519,21 +1526,21 @@ define([ _label: '', _node: null, - initialize: function(label, id){ + initialize: function (label, id) { this._label = label; this._node = new Element('button', { 'class': 'action-secondary action-add', - 'type': 'button' + 'type': 'button' }); if (typeof id !== 'undefined') { this._node.setAttribute('id', id) } }, - onClick: function(){ + onClick: function () { }, - insertIn: function(element, position){ + insertIn: function (element, position) { var node = Object.extend(this._node), content = {}; node.observe('click', this.onClick); @@ -1542,7 +1549,7 @@ define([ Element.insert(element, content); }, - getLabel: function(){ + getLabel: function () { return this._label; } }; diff --git a/lib/web/mage/adminhtml/grid.js b/lib/web/mage/adminhtml/grid.js index 5f7a709f04fea..a946060da06ed 100644 --- a/lib/web/mage/adminhtml/grid.js +++ b/lib/web/mage/adminhtml/grid.js @@ -33,6 +33,7 @@ define([ setLocation(element.title); } } + window.openGridRow = openGridRow; window.varienGrid = new Class.create(); @@ -63,11 +64,13 @@ define([ this.initRowCallback = false; this.doFilterCallback = false; this.sortableUpdateCallback = false; + this.targetElement = undefined; this.reloadParams = false; this.trOnMouseOver = this.rowMouseOver.bindAsEventListener(this); this.trOnMouseOut = this.rowMouseOut.bindAsEventListener(this); + this.trOnMouseDown = this.rowMouseDown.bindAsEventListener(this); this.trOnClick = this.rowMouseClick.bindAsEventListener(this); this.trOnDblClick = this.rowMouseDblClick.bindAsEventListener(this); this.trOnKeyPress = this.keyPress.bindAsEventListener(this); @@ -96,6 +99,7 @@ define([ Event.observe(this.rows[row], 'mouseover', this.trOnMouseOver); Event.observe(this.rows[row], 'mouseout', this.trOnMouseOut); + Event.observe(this.rows[row], 'mousedown', this.trOnMouseDown); Event.observe(this.rows[row], 'click', this.trOnClick); Event.observe(this.rows[row], 'dblclick', this.trOnDblClick); } @@ -114,8 +118,7 @@ define([ if (this.initCallback) { try { this.initCallback(this); - } - catch (e) { + } catch (e) { if (window.console) { //eslint-disable-line max-depth console.log(e); } @@ -179,6 +182,13 @@ define([ Element.removeClassName(element, 'on-mouse'); }, + /** + * @param {*} event + */ + rowMouseDown: function (event) { + this.targetElement = event.target; + }, + /** * @param {*} event */ @@ -186,11 +196,11 @@ define([ if (this.rowClickCallback) { try { this.rowClickCallback(this, event); - } - catch (e) { + } catch (e) { } } varienGlobalEvents.fireEvent('gridRowClick', event); + this.targetElement = undefined; }, /** @@ -203,7 +213,8 @@ define([ /** * Key press. */ - keyPress: function () {}, + keyPress: function () { + }, /** * @param {*} event @@ -404,8 +415,8 @@ define([ */ bindFilterFields: function () { var filters = $$( - '#' + this.containerId + ' [data-role="filter-form"] input', - '#' + this.containerId + ' [data-role="filter-form"] select' + '#' + this.containerId + ' [data-role="filter-form"] input', + '#' + this.containerId + ' [data-role="filter-form"] select' ), i; @@ -452,7 +463,8 @@ define([ return ui; }, - update: this.sortableUpdateCallback ? this.sortableUpdateCallback : function () {}, + update: this.sortableUpdateCallback ? this.sortableUpdateCallback : function () { + }, tolerance: 'pointer' }); } @@ -472,8 +484,8 @@ define([ */ doFilter: function (callback) { var filters = $$( - '#' + this.containerId + ' [data-role="filter-form"] input', - '#' + this.containerId + ' [data-role="filter-form"] select' + '#' + this.containerId + ' [data-role="filter-form"] input', + '#' + this.containerId + ' [data-role="filter-form"] select' ), elements = [], i; @@ -589,24 +601,24 @@ define([ */ initialize: function (containerId, grid, checkedValues, formFieldNameInternal, formFieldName) { this.setOldCallback('row_click', grid.rowClickCallback); - this.setOldCallback('init', grid.initCallback); - this.setOldCallback('init_row', grid.initRowCallback); - this.setOldCallback('pre_init', grid.preInitCallback); + this.setOldCallback('init', grid.initCallback); + this.setOldCallback('init_row', grid.initRowCallback); + this.setOldCallback('pre_init', grid.preInitCallback); - this.useAjax = false; - this.grid = grid; + this.useAjax = false; + this.grid = grid; this.grid.massaction = this; - this.containerId = containerId; + this.containerId = containerId; this.initMassactionElements(); - this.checkedString = checkedValues; - this.formFieldName = formFieldName; - this.formFieldNameInternal = formFieldNameInternal; + this.checkedString = checkedValues; + this.formFieldName = formFieldName; + this.formFieldNameInternal = formFieldNameInternal; - this.grid.initCallback = this.onGridInit.bind(this); - this.grid.preInitCallback = this.onGridPreInit.bind(this); - this.grid.initRowCallback = this.onGridRowInit.bind(this); - this.grid.rowClickCallback = this.onGridRowClick.bind(this); + this.grid.initCallback = this.onGridInit.bind(this); + this.grid.preInitCallback = this.onGridPreInit.bind(this); + this.grid.initRowCallback = this.onGridRowInit.bind(this); + this.grid.rowClickCallback = this.onGridRowClick.bind(this); this.initCheckboxes(); this.checkCheckboxes(); }, @@ -629,16 +641,16 @@ define([ * Init massaction elements. */ initMassactionElements: function () { - this.container = $(this.containerId); - this.multiselect = $(this.containerId + '-mass-select'); - this.count = $(this.containerId + '-count'); - this.formHiddens = $(this.containerId + '-form-hiddens'); + this.container = $(this.containerId); + this.multiselect = $(this.containerId + '-mass-select'); + this.count = $(this.containerId + '-count'); + this.formHiddens = $(this.containerId + '-form-hiddens'); this.formAdditional = $(this.containerId + '-form-additional'); - this.select = $(this.containerId + '-select'); - this.form = this.prepareForm(); + this.select = $(this.containerId + '-select'); + this.form = this.prepareForm(); jQuery(this.form).mage('validation'); this.select.observe('change', this.onSelectChange.bindAsEventListener(this)); - this.lastChecked = { + this.lastChecked = { left: false, top: false, checkbox: false @@ -795,7 +807,7 @@ define([ this.getOldCallback('row_click')(grid, evt); } else { checkbox = Element.select(trElement, 'input'); - isInput = Event.element(evt).tagName == 'input'; //eslint-disable-line eqeqeq + isInput = Event.element(evt).tagName == 'input'; //eslint-disable-line eqeqeq checked = isInput ? checkbox[0].checked : !checkbox[0].checked; if (checked) { //eslint-disable-line max-depth @@ -1107,7 +1119,8 @@ define([ try { listener = this.getListener(this.currentItem.complete) || Prototype.emptyFunction; listener(this.grid, this, transport); - } catch (e) {} + } catch (e) { + } } }, @@ -1318,8 +1331,8 @@ define([ * @return {String} */ trimComma: function (string) { - string = string.replace(new RegExp('^(,+)','i'), ''); - string = string.replace(new RegExp('(,+)$','i'), ''); + string = string.replace(new RegExp('^(,+)', 'i'), ''); + string = string.replace(new RegExp('(,+)$', 'i'), ''); return string; } @@ -1339,14 +1352,14 @@ define([ initialize: function (hiddenDataHolder, predefinedData, inputsToManage, grid, reloadParamName) { //Grid inputs this.tabIndex = 1000; - this.inputsToManage = inputsToManage; + this.inputsToManage = inputsToManage; this.multidimensionalMode = inputsToManage.length > 0; //Hash with grid data - this.gridData = this.getGridDataHash(predefinedData); + this.gridData = this.getGridDataHash(predefinedData); //Hidden input data holder - this.hiddenDataHolder = $(hiddenDataHolder); + this.hiddenDataHolder = $(hiddenDataHolder); this.hiddenDataHolder.value = this.serializeObject(); this.grid = grid; @@ -1439,7 +1452,7 @@ define([ */ rowClick: function (grid, event) { var trElement = Event.findElement(event, 'tr'), - isInput = Event.element(event).tagName == 'INPUT', //eslint-disable-line eqeqeq + isInput = Event.element(event).tagName == 'INPUT', //eslint-disable-line eqeqeq checkbox, checked; if (trElement) { From 89dd87d5a150edccb542085b51c3b5bfdf6592f7 Mon Sep 17 00:00:00 2001 From: DmitryTsymbal <d.tsymbal@atwix.com> Date: Fri, 7 Jun 2019 18:04:29 +0300 Subject: [PATCH 009/586] Convert NewCustomerPasswordComplexityTest --- .../StorefrontFillRegistryFormActionGroup.xml | 31 +++++++++++++++++ .../StorefrontSeeHeaderLinksActionGroup.xml | 19 +++++++++++ .../Mftf/Section/StorefrontHeaderSection.xml | 16 +++++++++ .../NewCustomerPasswordComplexityTest.xml | 33 +++++++++++++++++++ 4 files changed, 99 insertions(+) create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontFillRegistryFormActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontSeeHeaderLinksActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/Section/StorefrontHeaderSection.xml create mode 100644 app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordComplexityTest.xml diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontFillRegistryFormActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontFillRegistryFormActionGroup.xml new file mode 100644 index 0000000000000..0a1440937a554 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontFillRegistryFormActionGroup.xml @@ -0,0 +1,31 @@ +<?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="StorefrontFillRegistryFormActionGroup"> + + <!--Fill Registry Form with password length is below 8 characters --> + <fillField stepKey="fillFirstName1stVariation" userInput="John" selector="{{StorefrontCustomerCreateFormSection.firstnameField}}"/> + <fillField stepKey="fillLastName1stVariation" userInput="Doe" selector="{{StorefrontCustomerCreateFormSection.lastnameField}}"/> + <fillField stepKey="fillEmail1stVariation" userInput="johndoe@domain.com" selector="{{StorefrontCustomerCreateFormSection.emailField}}"/> + <fillField stepKey="fillPassword1stVariation" userInput="123123" selector="{{StorefrontCustomerCreateFormSection.passwordField}}"/> + <fillField stepKey="fillConfirmPassword1stVariation" userInput="123123" selector="{{StorefrontCustomerCreateFormSection.confirmPasswordField}}"/> + <click stepKey="clickCreateAccountButton1stVariation" selector="{{StorefrontCustomerCreateFormSection.createAccountButton}}"/> + <see userInput="Minimum length of this field must be equal or greater than 8 symbols. Leading and trailing spaces will be ignored." stepKey="seeTheErrorMessageIsDisplayed1"/> + + <!--Fill Registry Form with not secure enough password --> + <fillField stepKey="fillFirstName2ndVariation" userInput="John" selector="{{StorefrontCustomerCreateFormSection.firstnameField}}"/> + <fillField stepKey="fillLastName2ndVariation" userInput="Doe" selector="{{StorefrontCustomerCreateFormSection.lastnameField}}"/> + <fillField stepKey="fillEmail2ndVariation" userInput="johndoe@domain.com" selector="{{StorefrontCustomerCreateFormSection.emailField}}"/> + <fillField stepKey="fillPassword2ndVariation" userInput="123123qa" selector="{{StorefrontCustomerCreateFormSection.passwordField}}"/> + <fillField stepKey="fillConfirmPassword2ndVariation" userInput="123123qa" selector="{{StorefrontCustomerCreateFormSection.confirmPasswordField}}"/> + <click stepKey="clickCreateAccountButton" selector="{{StorefrontCustomerCreateFormSection.createAccountButton}}"/> + <see userInput="Minimum of different classes of characters in password is 3. Classes of characters: Lower Case, Upper Case, Digits, Special Characters." stepKey="seeTheErrorMessageIsDisplayed2"/> + + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontSeeHeaderLinksActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontSeeHeaderLinksActionGroup.xml new file mode 100644 index 0000000000000..b70560ad2cd86 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontSeeHeaderLinksActionGroup.xml @@ -0,0 +1,19 @@ +<?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="StorefrontSeeHeaderLinksActionGroup"> + <arguments> + <argument name="LinkName" type="string" defaultValue="Create an Account"/> + </arguments> + + <see stepKey="SeeElement" selector="{{StorefrontHeaderSection.headerlinks}}" userInput="{{LinkName}}"/> + <click stepKey="ClickLink" selector="{{StorefrontHeaderSection.HeaderLinkByText(LinkName)}}"/> + <waitForPageLoad stepKey="Wait"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/Section/StorefrontHeaderSection.xml b/app/code/Magento/Cms/Test/Mftf/Section/StorefrontHeaderSection.xml new file mode 100644 index 0000000000000..fefde1e6035f3 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/Section/StorefrontHeaderSection.xml @@ -0,0 +1,16 @@ +<?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="StorefrontHeaderSection"> + <element name="headerlinks" type="text" selector="ul.header.links"/> + <element name="HeaderLinkByText" type="text" selector="//ul[contains(@class, 'header') and contains(@class, 'links')]/li/a[contains(text(),'{{LinkName}}')]" + parameterized="true" /> + </section> +</sections> diff --git a/app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordComplexityTest.xml b/app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordComplexityTest.xml new file mode 100644 index 0000000000000..a414878997021 --- /dev/null +++ b/app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordComplexityTest.xml @@ -0,0 +1,33 @@ +<?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="NewCustomerPasswordComplexityTest"> + <annotations> + <features value="Security"/> + <stories value="Checking customer's password length and password complexity"/> + <title value="Notify the customer if password length or complexity is not match to requirements"/> + <description value="Show notifies to the customer if password length or complexity is not match to requirements"/> + <group value="security"/> + <group value="mtf_migrated"/> + </annotations> + + <!-- TEST BODY --> + <!-- Go to storefront home page --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openStoreFrontHomePage"/> + <!-- Click the Registration Link --> + <actionGroup ref="StorefrontSeeHeaderLinksActionGroup" stepKey="ClickTheLink"> + <argument name="LinkName" value="Create an Account" /> + </actionGroup> + <!-- Fill Registry Form with Incorrect Password (Two variations) --> + <actionGroup ref="StorefrontFillRegistryFormActionGroup" stepKey="FillRegistryForm"/> + <!--Test Body END--> + + </test> +</tests> From 100a81eb41648eabb41c2d77059368750916758e Mon Sep 17 00:00:00 2001 From: DmitryTsymbal <d.tsymbal@atwix.com> Date: Fri, 7 Jun 2019 18:32:45 +0300 Subject: [PATCH 010/586] Refactoring --- .../Test/Mftf/Test/NewCustomerPasswordComplexityTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordComplexityTest.xml b/app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordComplexityTest.xml index a414878997021..29135332d6125 100644 --- a/app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordComplexityTest.xml +++ b/app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordComplexityTest.xml @@ -23,7 +23,7 @@ <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openStoreFrontHomePage"/> <!-- Click the Registration Link --> <actionGroup ref="StorefrontSeeHeaderLinksActionGroup" stepKey="ClickTheLink"> - <argument name="LinkName" value="Create an Account" /> + <argument name="LinkName" value="Create an Account" /> </actionGroup> <!-- Fill Registry Form with Incorrect Password (Two variations) --> <actionGroup ref="StorefrontFillRegistryFormActionGroup" stepKey="FillRegistryForm"/> From 0225d61d7b56a28e0e9a15d0699a1bf2630791c3 Mon Sep 17 00:00:00 2001 From: Volodymyr Vygovskyi <v.vygovskyi@atwix.com> Date: Wed, 24 Jul 2019 10:47:50 +0300 Subject: [PATCH 011/586] fixed actiongroup name --- .../Test/Mftf/ActionGroup/AdminDisableCMSPageActionGroup.xml | 2 +- .../Cms/Test/Mftf/Test/AdminCMSPageCreateDisabledPageTest.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminDisableCMSPageActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminDisableCMSPageActionGroup.xml index 53f53227167ee..6617c8eea8155 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminDisableCMSPageActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminDisableCMSPageActionGroup.xml @@ -7,7 +7,7 @@ --> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminDisableCMSPage"> + <actionGroup name="AdminDisableCMSPageActionGroup"> <seeElement selector="{{CmsNewPagePageBasicFieldsSection.isActive('1')}}" stepKey="seePageIsEnabled" /> <click selector="{{CmsNewPagePageBasicFieldsSection.isActiveLabel}}" stepKey="setPageDisabled"/> </actionGroup> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreateDisabledPageTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreateDisabledPageTest.xml index 2f609f7a88b43..dc40310b15191 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreateDisabledPageTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreateDisabledPageTest.xml @@ -25,7 +25,7 @@ <!--Go to New CMS Page page--> <actionGroup ref="AdminOpenCreateNewCMSPageActionGroup" stepKey="navigateToCreateNewPage"/> <!--Set page disabled--> - <actionGroup ref="AdminDisableCMSPage" stepKey="setCMSPageDisabled"/> + <actionGroup ref="AdminDisableCMSPageActionGroup" stepKey="setCMSPageDisabled"/> <!--Fill the CMS page form--> <actionGroup ref="FillOutCMSPageContent" stepKey="fillBasicPageDataForDisabledPage"/> <!--Verify successfully saved--> From 7c9b5f7fe45ba39d64f782b609efc370ea2684e3 Mon Sep 17 00:00:00 2001 From: DmitryTsymbal <d.tsymbal@atwix.com> Date: Tue, 30 Jul 2019 12:43:39 +0300 Subject: [PATCH 012/586] refactoring --- .../StorefrontClickHeaderLinkActionGroup.xml | 17 ++++++++++ .../StorefrontFillRegistryFormActionGroup.xml | 31 ------------------- .../StorefrontSeeHeaderLinksActionGroup.xml | 3 -- ...teAccountPasswordComplexityActionGroup.xml | 17 ++++++++++ .../Customer/Test/Mftf/Data/CustomerData.xml | 20 ++++++++++++ .../StorefrontCustomerCreateFormSection.xml | 1 + .../NewCustomerPasswordComplexityTest.xml | 24 +++++++++++--- .../NewCustomerPasswordComplexityTest.xml | 2 ++ 8 files changed, 77 insertions(+), 38 deletions(-) create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontClickHeaderLinkActionGroup.xml delete mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontFillRegistryFormActionGroup.xml create mode 100644 app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertMessageCustomerCreateAccountPasswordComplexityActionGroup.xml diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontClickHeaderLinkActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontClickHeaderLinkActionGroup.xml new file mode 100644 index 0000000000000..46c06e909b4d9 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontClickHeaderLinkActionGroup.xml @@ -0,0 +1,17 @@ +<?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="StorefrontClickHeaderLinkActionGroup"> + <arguments> + <argument name="LinkName" type="string" defaultValue="Create an Account"/> + </arguments> + <click stepKey="ClickTheLink" selector="{{StorefrontHeaderSection.HeaderLinkByText(LinkName)}}"/> + <waitForPageLoad stepKey="Wait"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontFillRegistryFormActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontFillRegistryFormActionGroup.xml deleted file mode 100644 index 0a1440937a554..0000000000000 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontFillRegistryFormActionGroup.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?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="StorefrontFillRegistryFormActionGroup"> - - <!--Fill Registry Form with password length is below 8 characters --> - <fillField stepKey="fillFirstName1stVariation" userInput="John" selector="{{StorefrontCustomerCreateFormSection.firstnameField}}"/> - <fillField stepKey="fillLastName1stVariation" userInput="Doe" selector="{{StorefrontCustomerCreateFormSection.lastnameField}}"/> - <fillField stepKey="fillEmail1stVariation" userInput="johndoe@domain.com" selector="{{StorefrontCustomerCreateFormSection.emailField}}"/> - <fillField stepKey="fillPassword1stVariation" userInput="123123" selector="{{StorefrontCustomerCreateFormSection.passwordField}}"/> - <fillField stepKey="fillConfirmPassword1stVariation" userInput="123123" selector="{{StorefrontCustomerCreateFormSection.confirmPasswordField}}"/> - <click stepKey="clickCreateAccountButton1stVariation" selector="{{StorefrontCustomerCreateFormSection.createAccountButton}}"/> - <see userInput="Minimum length of this field must be equal or greater than 8 symbols. Leading and trailing spaces will be ignored." stepKey="seeTheErrorMessageIsDisplayed1"/> - - <!--Fill Registry Form with not secure enough password --> - <fillField stepKey="fillFirstName2ndVariation" userInput="John" selector="{{StorefrontCustomerCreateFormSection.firstnameField}}"/> - <fillField stepKey="fillLastName2ndVariation" userInput="Doe" selector="{{StorefrontCustomerCreateFormSection.lastnameField}}"/> - <fillField stepKey="fillEmail2ndVariation" userInput="johndoe@domain.com" selector="{{StorefrontCustomerCreateFormSection.emailField}}"/> - <fillField stepKey="fillPassword2ndVariation" userInput="123123qa" selector="{{StorefrontCustomerCreateFormSection.passwordField}}"/> - <fillField stepKey="fillConfirmPassword2ndVariation" userInput="123123qa" selector="{{StorefrontCustomerCreateFormSection.confirmPasswordField}}"/> - <click stepKey="clickCreateAccountButton" selector="{{StorefrontCustomerCreateFormSection.createAccountButton}}"/> - <see userInput="Minimum of different classes of characters in password is 3. Classes of characters: Lower Case, Upper Case, Digits, Special Characters." stepKey="seeTheErrorMessageIsDisplayed2"/> - - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontSeeHeaderLinksActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontSeeHeaderLinksActionGroup.xml index b70560ad2cd86..3155cca583d59 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontSeeHeaderLinksActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontSeeHeaderLinksActionGroup.xml @@ -11,9 +11,6 @@ <arguments> <argument name="LinkName" type="string" defaultValue="Create an Account"/> </arguments> - <see stepKey="SeeElement" selector="{{StorefrontHeaderSection.headerlinks}}" userInput="{{LinkName}}"/> - <click stepKey="ClickLink" selector="{{StorefrontHeaderSection.HeaderLinkByText(LinkName)}}"/> - <waitForPageLoad stepKey="Wait"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertMessageCustomerCreateAccountPasswordComplexityActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertMessageCustomerCreateAccountPasswordComplexityActionGroup.xml new file mode 100644 index 0000000000000..9d7dbc604f59d --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertMessageCustomerCreateAccountPasswordComplexityActionGroup.xml @@ -0,0 +1,17 @@ +<?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="AssertMessageCustomerCreateAccountPasswordComplexityActionGroup"> + <arguments> + <argument name="message" type="string"/> + </arguments> + <see userInput="{{message}}" selector="{{StorefrontCustomerCreateFormSection.PasswordErrorMessages}}" stepKey="verifyMessage" /> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/Data/CustomerData.xml b/app/code/Magento/Customer/Test/Mftf/Data/CustomerData.xml index 5904067aea639..77bf6277d9c21 100644 --- a/app/code/Magento/Customer/Test/Mftf/Data/CustomerData.xml +++ b/app/code/Magento/Customer/Test/Mftf/Data/CustomerData.xml @@ -271,4 +271,24 @@ <requiredEntity type="address">US_Address_TX</requiredEntity> <requiredEntity type="address">US_Address_NY_Not_Default_Address</requiredEntity> </entity> + <entity name="Simple_Customer_With_Password_Length_Is_Below_Eight_Characters" type="customer"> + <data key="group_id">1</data> + <data key="email" unique="prefix">John.Doe@example.com</data> + <data key="firstname">John</data> + <data key="lastname">Doe</data> + <data key="fullname">John Doe</data> + <data key="password">123123</data> + <data key="store_id">0</data> + <data key="website_id">0</data> + </entity> + <entity name="Simple_Customer_With_Not_Secure_Password" type="customer"> + <data key="group_id">1</data> + <data key="email" unique="prefix">John.Doe@example.com</data> + <data key="firstname">John</data> + <data key="lastname">Doe</data> + <data key="fullname">John Doe</data> + <data key="password">123123qa</data> + <data key="store_id">0</data> + <data key="website_id">0</data> + </entity> </entities> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection.xml index 8881a2a012ce8..5a731b2c3f0ed 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection.xml @@ -17,6 +17,7 @@ <element name="passwordField" type="input" selector="#password"/> <element name="confirmPasswordField" type="input" selector="#password-confirmation"/> <element name="createAccountButton" type="button" selector="button.action.submit.primary" timeout="30"/> + <element name="PasswordErrorMessages" type="text" selector="#password-error"/> </section> <section name="StoreFrontCustomerAdvancedAttributesSection"> <element name="textFieldAttribute" type="input" selector="//input[@id='{{var}}']" parameterized="true" /> diff --git a/app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordComplexityTest.xml b/app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordComplexityTest.xml index 29135332d6125..ccd97f83cd0a6 100644 --- a/app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordComplexityTest.xml +++ b/app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordComplexityTest.xml @@ -21,12 +21,28 @@ <!-- TEST BODY --> <!-- Go to storefront home page --> <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openStoreFrontHomePage"/> + <!-- See the Registration Link --> + <actionGroup ref="StorefrontSeeHeaderLinksActionGroup" stepKey="SeeTheLink"/> <!-- Click the Registration Link --> - <actionGroup ref="StorefrontSeeHeaderLinksActionGroup" stepKey="ClickTheLink"> - <argument name="LinkName" value="Create an Account" /> + <actionGroup ref="StorefrontClickHeaderLinkActionGroup" stepKey="ClickTheLink"> + <argument name="LinkName" value="Create an Account"/> + </actionGroup> + <!-- Fill Registration Form with Password length is bellow 8 Characters --> + <actionGroup ref="StorefrontFillCustomerAccountCreationFormActionGroup" stepKey="FillRegistrationFormPasswordLengthBellowEightCharacters"> + <argument name="customer" value="Simple_Customer_With_Password_Length_Is_Below_Eight_Characters"/> + </actionGroup> + <!-- See the Error --> + <actionGroup ref="AssertMessageCustomerCreateAccountPasswordComplexityActionGroup" stepKey="SeeTheErrorPasswordLength"> + <argument name="message" value="Minimum length of this field must be equal or greater than 8 symbols. Leading and trailing spaces will be ignored."/> + </actionGroup> + <!-- Fill Registration Form with not secure enough password --> + <actionGroup ref="StorefrontFillCustomerAccountCreationFormActionGroup" stepKey="FillRegistrationFormPasswordNotSecure"> + <argument name="customer" value="Simple_Customer_With_Not_Secure_Password"/> + </actionGroup> + <!-- See the Error --> + <actionGroup ref="AssertMessageCustomerCreateAccountPasswordComplexityActionGroup" stepKey="SeeTheErrorPasswordSecure"> + <argument name="message" value="Minimum of different classes of characters in password is 3. Classes of characters: Lower Case, Upper Case, Digits, Special Characters."/> </actionGroup> - <!-- Fill Registry Form with Incorrect Password (Two variations) --> - <actionGroup ref="StorefrontFillRegistryFormActionGroup" stepKey="FillRegistryForm"/> <!--Test Body END--> </test> diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/NewCustomerPasswordComplexityTest.xml b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/NewCustomerPasswordComplexityTest.xml index a169a3f175cc6..7b6f3e981714c 100644 --- a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/NewCustomerPasswordComplexityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/NewCustomerPasswordComplexityTest.xml @@ -16,6 +16,7 @@ <data name="customer/data/password" xsi:type="string">123123</data> <data name="customer/data/password_confirmation" xsi:type="string">123123</data> <constraint name="Magento\Security\Test\Constraint\AssertPasswordLengthErrorMessage" /> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> </variation> <variation name="PasswordComplexityTest" summary="Customer password is not secure enough"> <data name="tag" xsi:type="string">severity:S1</data> @@ -26,6 +27,7 @@ <data name="customer/data/password" xsi:type="string">123123qa</data> <data name="customer/data/password_confirmation" xsi:type="string">123123qa</data> <constraint name="Magento\Security\Test\Constraint\AssertPasswordIsNotSecureEnoughMessage" /> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> </variation> </testCase> </config> From 06d06f1824c374af835fe2e5d222f8c7e5b2f9f0 Mon Sep 17 00:00:00 2001 From: David Lambauer <david@run-as-root.sh> Date: Sun, 11 Aug 2019 17:18:18 +0200 Subject: [PATCH 013/586] Added Unit Test for Actions Block. Use FQCN. Reduce Code-Smell --- .../Block/Grid/Renderer/Actions.php | 32 +++++---- .../Unit/Block/Grid/Renderer/ActionsTest.php | 70 +++++++++++++++++++ 2 files changed, 88 insertions(+), 14 deletions(-) create mode 100644 app/code/Magento/AdminNotification/Test/Unit/Block/Grid/Renderer/ActionsTest.php diff --git a/app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php b/app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php index 82f70d92e4930..ab591702ceae6 100644 --- a/app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php +++ b/app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php @@ -1,4 +1,6 @@ <?php +declare(strict_types=1); + /** * Adminhtml AdminNotification Severity Renderer * @@ -8,12 +10,17 @@ namespace Magento\AdminNotification\Block\Grid\Renderer; +use Magento\Backend\Block\Context; +use Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer; +use Magento\Framework\App\ActionInterface; +use Magento\Framework\DataObject; +use Magento\Framework\Url\Helper\Data; + /** * Renderer class for action in the admin notifications grid - * * @package Magento\AdminNotification\Block\Grid\Renderer */ -class Actions extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer +class Actions extends AbstractRenderer { /** * @var \Magento\Framework\Url\Helper\Data @@ -25,11 +32,8 @@ class Actions extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\Abstrac * @param \Magento\Framework\Url\Helper\Data $urlHelper * @param array $data */ - public function __construct( - \Magento\Backend\Block\Context $context, - \Magento\Framework\Url\Helper\Data $urlHelper, - array $data = [] - ) { + public function __construct(Context $context, Data $urlHelper, array $data = []) + { $this->_urlHelper = $urlHelper; parent::__construct($context, $data); } @@ -40,16 +44,16 @@ public function __construct( * @param \Magento\Framework\DataObject $row * @return string */ - public function render(\Magento\Framework\DataObject $row) + public function render(DataObject $row) : string { - $readDetailsHtml = $row->getUrl() ? '<a class="action-details" target="_blank" href="' . - $this->escapeUrl($row->getUrl()) + $readDetailsHtml = $row->getData('url') ? '<a class="action-details" target="_blank" href="' . + $this->escapeUrl($row->getData('url')) . '">' . __('Read Details') . '</a>' : ''; - $markAsReadHtml = !$row->getIsRead() ? '<a class="action-mark" href="' . $this->getUrl( + $markAsReadHtml = !$row->getData('is_read') ? '<a class="action-mark" href="' . $this->getUrl( '*/*/markAsRead/', - ['_current' => true, 'id' => $row->getId()] + ['_current' => true, 'id' => $row->getData('id')] ) . '">' . __( 'Mark as Read' ) . '</a>' : ''; @@ -63,8 +67,8 @@ public function render(\Magento\Framework\DataObject $row) '*/*/remove/', [ '_current' => true, - 'id' => $row->getId(), - \Magento\Framework\App\ActionInterface::PARAM_NAME_URL_ENCODED => $encodedUrl + 'id' => $row->getData('id'), + ActionInterface::PARAM_NAME_URL_ENCODED => $encodedUrl ] ), __('Are you sure?'), diff --git a/app/code/Magento/AdminNotification/Test/Unit/Block/Grid/Renderer/ActionsTest.php b/app/code/Magento/AdminNotification/Test/Unit/Block/Grid/Renderer/ActionsTest.php new file mode 100644 index 0000000000000..4ffbcd56e8dcb --- /dev/null +++ b/app/code/Magento/AdminNotification/Test/Unit/Block/Grid/Renderer/ActionsTest.php @@ -0,0 +1,70 @@ +<?php +declare(strict_types=1); + +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +/** + * Test class for \Magento\AdminNotification\Block\Grid\Renderer\Actions + */ +namespace Magento\AdminNotification\Test\Unit\Block\Grid\Renderer; + +use Magento\AdminNotification\Block\Grid\Renderer\Actions; +use Magento\Backend\Block\Context; +use Magento\Framework\DataObject; +use Magento\Framework\Escaper; +use Magento\Framework\Url\Helper\Data; +use Magento\Framework\UrlInterface; +use PHPUnit\Framework\TestCase; + +class ActionsTest extends TestCase +{ + /** + * System under Test + * + * @var Actions + */ + private $sut; + + protected function setUp() : void + { + parent::setUp(); + + /** @var Escaper | \PHPUnit_Framework_MockObject_MockObject $escaperMock */ + $escaperMock = $this->getMockBuilder(Escaper::class)->disableOriginalConstructor()->getMock(); + $escaperMock->expects($this->once())->method('escapeUrl')->willReturn('https://magento.com'); + + /** @var UrlInterface | \PHPUnit_Framework_MockObject_MockObject $urlBuilder */ + $urlBuilder = $this->getMockBuilder(UrlInterface::class)->getMock(); + $urlBuilder->expects($this->once())->method('getUrl')->willReturn('http://magento.com'); + + /** @var Context | \PHPUnit_Framework_MockObject_MockObject $contextMock */ + $contextMock = $this->getMockBuilder(Context::class)->disableOriginalConstructor()->getMock(); + $contextMock->expects($this->once())->method('getEscaper')->willReturn($escaperMock); + $contextMock->expects($this->once())->method('getUrlBuilder')->willReturn($urlBuilder); + + /** @var Data | \PHPUnit_Framework_MockObject_MockObject $urlHelperMock */ + $urlHelperMock = $this->getMockBuilder(Data::class)->disableOriginalConstructor()->getMock(); + $urlHelperMock->expects($this->once())->method('getEncodedUrl')->willReturn('http://magento.com'); + + $this->sut = new Actions($contextMock, $urlHelperMock); + + } + + public function test_should_render_message_when_urlIsGiven() : void + { + $dataObject = new DataObject(); + $dataObject->setdata('url', 'https://magento.com'); + $dataObject->setdata('is_read', true); + $dataObject->setdata('id', 1); + + $actual = $this->sut->render($dataObject); + $expected = <<<HTML +<a class="action-details" target="_blank" href="https://magento.com">Read Details</a><a class="action-delete" href="http://magento.com" onClick="deleteConfirm('Are you sure?', this.href); return false;">Remove</a> +HTML; + + $this->assertEquals($actual, $expected); + } +} From cae8810baaee949298eccee884d2a6f97fcd3898 Mon Sep 17 00:00:00 2001 From: David Lambauer <david@run-as-root.sh> Date: Sun, 11 Aug 2019 17:19:19 +0200 Subject: [PATCH 014/586] Added Unit Test for Notice Block. Added strict type hint. Removed Code-Smell --- .../Block/Grid/Renderer/Notice.php | 13 +++-- .../Unit/Block/Grid/Renderer/NoticeTest.php | 56 +++++++++++++++++++ 2 files changed, 65 insertions(+), 4 deletions(-) create mode 100644 app/code/Magento/AdminNotification/Test/Unit/Block/Grid/Renderer/NoticeTest.php diff --git a/app/code/Magento/AdminNotification/Block/Grid/Renderer/Notice.php b/app/code/Magento/AdminNotification/Block/Grid/Renderer/Notice.php index ccc1b98a228ce..8de85cf1b241f 100644 --- a/app/code/Magento/AdminNotification/Block/Grid/Renderer/Notice.php +++ b/app/code/Magento/AdminNotification/Block/Grid/Renderer/Notice.php @@ -1,4 +1,6 @@ <?php +declare(strict_types=1); + /** * Adminhtml AdminNotification Severity Renderer * @@ -7,7 +9,10 @@ */ namespace Magento\AdminNotification\Block\Grid\Renderer; -class Notice extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer +use Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer; +use Magento\Framework\DataObject; + +class Notice extends AbstractRenderer { /** * Renders grid column @@ -15,11 +20,11 @@ class Notice extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\Abstract * @param \Magento\Framework\DataObject $row * @return string */ - public function render(\Magento\Framework\DataObject $row) + public function render(DataObject $row) : string { return '<span class="grid-row-title">' . - $this->escapeHtml($row->getTitle()) . + $this->escapeHtml($row->getData('title')) . '</span>' . - ($row->getDescription() ? '<br />' . $this->escapeHtml($row->getDescription()) : ''); + ($row->getData('description') ? '<br />' . $this->escapeHtml($row->getData('description')) : ''); } } diff --git a/app/code/Magento/AdminNotification/Test/Unit/Block/Grid/Renderer/NoticeTest.php b/app/code/Magento/AdminNotification/Test/Unit/Block/Grid/Renderer/NoticeTest.php new file mode 100644 index 0000000000000..4ed41a79bdaa8 --- /dev/null +++ b/app/code/Magento/AdminNotification/Test/Unit/Block/Grid/Renderer/NoticeTest.php @@ -0,0 +1,56 @@ +<?php +declare(strict_types=1); + +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +/** + * Test class for \Magento\AdminNotification\Block\Grid\Renderer\Actions + */ +namespace Magento\AdminNotification\Test\Unit\Block\Grid\Renderer; + +use Magento\AdminNotification\Block\Grid\Renderer\Notice; +use Magento\Framework\DataObject; +use Magento\Framework\Escaper; +use Magento\Backend\Block\Context; +use PHPUnit\Framework\TestCase; + +class NoticeTest extends TestCase +{ + /** + * System under Test + * + * @var Notice + */ + private $sut; + + protected function setUp() : void + { + parent::setUp(); + + /** @var Escaper | \PHPUnit_Framework_MockObject_MockObject $escaperMock */ + $escaperMock = $this->getMockBuilder(Escaper::class)->disableOriginalConstructor()->getMock(); + $escaperMock->expects($this->exactly(2))->method('escapeHtml')->willReturn('<div>Some random html</div>'); + + /** @var Context | \PHPUnit_Framework_MockObject_MockObject $contextMock */ + $contextMock = $this->getMockBuilder(Context::class)->disableOriginalConstructor()->getMock(); + $contextMock->expects($this->once())->method('getEscaper')->willReturn($escaperMock); + + $this->sut = new Notice($contextMock); + + } + + public function test_should_render_notice() : void + { + $dataObject = new DataObject(); + $dataObject->setData('title', 'A great Title'); + $dataObject->setData('description', 'Handy description right here'); + + $actual = $this->sut->render($dataObject); + $expected = '<span class="grid-row-title"><div>Some random html</div></span><br /><div>Some random html</div>'; + + $this->assertEquals($actual, $expected); + } +} From 32f9293b28fc9a212a506e5e45cad538983f07ef Mon Sep 17 00:00:00 2001 From: David Lambauer <david@run-as-root.sh> Date: Sun, 11 Aug 2019 17:20:19 +0200 Subject: [PATCH 015/586] Added Unit Test for Severity Block. Use FQCN. Added strict type hints --- .../Block/Grid/Renderer/Severity.php | 22 +++-- .../Unit/Block/Grid/Renderer/SeverityTest.php | 87 +++++++++++++++++++ 2 files changed, 101 insertions(+), 8 deletions(-) create mode 100644 app/code/Magento/AdminNotification/Test/Unit/Block/Grid/Renderer/SeverityTest.php diff --git a/app/code/Magento/AdminNotification/Block/Grid/Renderer/Severity.php b/app/code/Magento/AdminNotification/Block/Grid/Renderer/Severity.php index 033fa52c55081..69c9d1994e764 100644 --- a/app/code/Magento/AdminNotification/Block/Grid/Renderer/Severity.php +++ b/app/code/Magento/AdminNotification/Block/Grid/Renderer/Severity.php @@ -1,4 +1,6 @@ <?php +declare(strict_types=1); + /** * Adminhtml AdminNotification Severity Renderer * @@ -7,9 +9,13 @@ */ namespace Magento\AdminNotification\Block\Grid\Renderer; +use Magento\AdminNotification\Model\Inbox; +use Magento\Backend\Block\Context; +use Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer; +use Magento\Framework\DataObject; use Magento\Framework\Notification\MessageInterface; -class Severity extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer +class Severity extends AbstractRenderer { /** * @var \Magento\AdminNotification\Model\Inbox @@ -21,11 +27,8 @@ class Severity extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\Abstra * @param \Magento\AdminNotification\Model\Inbox $notice * @param array $data */ - public function __construct( - \Magento\Backend\Block\Context $context, - \Magento\AdminNotification\Model\Inbox $notice, - array $data = [] - ) { + public function __construct(Context $context, Inbox $notice, array $data = []) + { parent::__construct($context, $data); $this->_notice = $notice; } @@ -36,12 +39,14 @@ public function __construct( * @param \Magento\Framework\DataObject $row * @return string */ - public function render(\Magento\Framework\DataObject $row) + public function render(DataObject $row) : string { $class = ''; $value = ''; - switch ($row->getData($this->getColumn()->getIndex())) { + $column = $this->getColumn(); + $index = $column->getData('index'); + switch ($row->getData($index)) { case MessageInterface::SEVERITY_CRITICAL: $class = 'critical'; $value = $this->_notice->getSeverities(MessageInterface::SEVERITY_CRITICAL); @@ -59,6 +64,7 @@ public function render(\Magento\Framework\DataObject $row) $value = $this->_notice->getSeverities(MessageInterface::SEVERITY_NOTICE); break; } + return '<span class="grid-severity-' . $class . '"><span>' . $value . '</span></span>'; } } diff --git a/app/code/Magento/AdminNotification/Test/Unit/Block/Grid/Renderer/SeverityTest.php b/app/code/Magento/AdminNotification/Test/Unit/Block/Grid/Renderer/SeverityTest.php new file mode 100644 index 0000000000000..2791d6d6ce15e --- /dev/null +++ b/app/code/Magento/AdminNotification/Test/Unit/Block/Grid/Renderer/SeverityTest.php @@ -0,0 +1,87 @@ +<?php +declare(strict_types=1); + +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +/** + * Test class for \Magento\AdminNotification\Block\Grid\Renderer\Actions + */ +namespace Magento\AdminNotification\Test\Unit\Block\Grid\Renderer; + +use Magento\AdminNotification\Block\Grid\Renderer\Severity; +use Magento\AdminNotification\Model\Inbox; +use Magento\Backend\Block\Context; +use Magento\Backend\Block\Widget\Grid\Column; +use Magento\Framework\DataObject; +use Magento\Framework\Escaper; +use PHPUnit\Framework\TestCase; + +class SeverityTest extends TestCase +{ + /** + * System under Test + * + * @var Severity + */ + private $sut; + + protected function setUp() : void + { + parent::setUp(); + + /** @var Inbox |\PHPUnit_Framework_MockObject_MockObject $inboxMock */ + $inboxMock = $this->getMockBuilder(Inbox::class)->disableOriginalConstructor()->getMock(); + + /** @var Context | \PHPUnit_Framework_MockObject_MockObject $contextMock */ + $contextMock = $this->getMockBuilder(Context::class)->disableOriginalConstructor()->getMock(); + + $this->sut = new Severity($contextMock, $inboxMock); + } + + public function test_should_render_severity() : void + { + /** @var Column | \PHPUnit_Framework_MockObject_MockObject $columnMock */ + $columnMock = $this->getMockBuilder(Column::class)->disableOriginalConstructor()->getMock(); + $columnMock->expects($this->exactly(5))->method('getData')->with($this->equalTo('index'))->willReturn('a magic index'); + $this->sut->setColumn($columnMock); + $dataObject = new DataObject(); + + // Test critical severity + $dataObject->setData('a magic index', 1); + $actual = $this->sut->render($dataObject); + $expected = '<span class="grid-severity-critical"><span></span></span>'; + + $this->assertEquals($actual, $expected); + + // Test major severity + $dataObject->setData('a magic index', 2); + $actual = $this->sut->render($dataObject); + $expected = '<span class="grid-severity-major"><span></span></span>'; + + $this->assertEquals($actual, $expected); + + // Test minor severity + $dataObject->setData('a magic index', 3); + $actual = $this->sut->render($dataObject); + $expected = '<span class="grid-severity-minor"><span></span></span>'; + + $this->assertEquals($actual, $expected); + + // Test notice severity + $dataObject->setData('a magic index', 4); + $actual = $this->sut->render($dataObject); + $expected = '<span class="grid-severity-notice"><span></span></span>'; + + $this->assertEquals($actual, $expected); + + // Test default severity + $dataObject->setData('a magic index', 5); + $actual = $this->sut->render($dataObject); + $expected = '<span class="grid-severity-"><span></span></span>'; + + $this->assertEquals($actual, $expected); + } +} From 3188cac632b7b54d9afd78f0d3993930d469b946 Mon Sep 17 00:00:00 2001 From: David Lambauer <david@run-as-root.sh> Date: Sun, 11 Aug 2019 17:43:59 +0200 Subject: [PATCH 016/586] Fix CS --- .../Test/Unit/Block/Grid/Renderer/ActionsTest.php | 13 ++++++++----- .../Test/Unit/Block/Grid/Renderer/NoticeTest.php | 3 +-- .../Test/Unit/Block/Grid/Renderer/SeverityTest.php | 14 +++++++------- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/app/code/Magento/AdminNotification/Test/Unit/Block/Grid/Renderer/ActionsTest.php b/app/code/Magento/AdminNotification/Test/Unit/Block/Grid/Renderer/ActionsTest.php index 4ffbcd56e8dcb..781734186ce6b 100644 --- a/app/code/Magento/AdminNotification/Test/Unit/Block/Grid/Renderer/ActionsTest.php +++ b/app/code/Magento/AdminNotification/Test/Unit/Block/Grid/Renderer/ActionsTest.php @@ -1,5 +1,5 @@ <?php -declare(strict_types=1); +declare(strict_types = 1); /** * Copyright © Magento, Inc. All rights reserved. @@ -9,6 +9,7 @@ /** * Test class for \Magento\AdminNotification\Block\Grid\Renderer\Actions */ + namespace Magento\AdminNotification\Test\Unit\Block\Grid\Renderer; use Magento\AdminNotification\Block\Grid\Renderer\Actions; @@ -23,7 +24,6 @@ class ActionsTest extends TestCase { /** * System under Test - * * @var Actions */ private $sut; @@ -50,20 +50,23 @@ protected function setUp() : void $urlHelperMock->expects($this->once())->method('getEncodedUrl')->willReturn('http://magento.com'); $this->sut = new Actions($contextMock, $urlHelperMock); - } - public function test_should_render_message_when_urlIsGiven() : void + public function testShouldRenderMessageWhenUrlIsGiven() : void { $dataObject = new DataObject(); $dataObject->setdata('url', 'https://magento.com'); $dataObject->setdata('is_read', true); $dataObject->setdata('id', 1); - $actual = $this->sut->render($dataObject); + $actual = $this->sut->render($dataObject); + + // Ignoring Code Style at this point due to the long HEREDOC + // phpcs:disable $expected = <<<HTML <a class="action-details" target="_blank" href="https://magento.com">Read Details</a><a class="action-delete" href="http://magento.com" onClick="deleteConfirm('Are you sure?', this.href); return false;">Remove</a> HTML; + // phpcs:enable $this->assertEquals($actual, $expected); } diff --git a/app/code/Magento/AdminNotification/Test/Unit/Block/Grid/Renderer/NoticeTest.php b/app/code/Magento/AdminNotification/Test/Unit/Block/Grid/Renderer/NoticeTest.php index 4ed41a79bdaa8..7b4b0a0f66e96 100644 --- a/app/code/Magento/AdminNotification/Test/Unit/Block/Grid/Renderer/NoticeTest.php +++ b/app/code/Magento/AdminNotification/Test/Unit/Block/Grid/Renderer/NoticeTest.php @@ -39,10 +39,9 @@ protected function setUp() : void $contextMock->expects($this->once())->method('getEscaper')->willReturn($escaperMock); $this->sut = new Notice($contextMock); - } - public function test_should_render_notice() : void + public function testShouldRenderNotice() : void { $dataObject = new DataObject(); $dataObject->setData('title', 'A great Title'); diff --git a/app/code/Magento/AdminNotification/Test/Unit/Block/Grid/Renderer/SeverityTest.php b/app/code/Magento/AdminNotification/Test/Unit/Block/Grid/Renderer/SeverityTest.php index 2791d6d6ce15e..f42c740ca8fee 100644 --- a/app/code/Magento/AdminNotification/Test/Unit/Block/Grid/Renderer/SeverityTest.php +++ b/app/code/Magento/AdminNotification/Test/Unit/Block/Grid/Renderer/SeverityTest.php @@ -41,44 +41,44 @@ protected function setUp() : void $this->sut = new Severity($contextMock, $inboxMock); } - public function test_should_render_severity() : void + public function testShouldRenderSeverity() : void { /** @var Column | \PHPUnit_Framework_MockObject_MockObject $columnMock */ $columnMock = $this->getMockBuilder(Column::class)->disableOriginalConstructor()->getMock(); - $columnMock->expects($this->exactly(5))->method('getData')->with($this->equalTo('index'))->willReturn('a magic index'); + $columnMock->expects($this->exactly(5))->method('getData')->with($this->equalTo('index'))->willReturn('index'); $this->sut->setColumn($columnMock); $dataObject = new DataObject(); // Test critical severity - $dataObject->setData('a magic index', 1); + $dataObject->setData('index', 1); $actual = $this->sut->render($dataObject); $expected = '<span class="grid-severity-critical"><span></span></span>'; $this->assertEquals($actual, $expected); // Test major severity - $dataObject->setData('a magic index', 2); + $dataObject->setData('index', 2); $actual = $this->sut->render($dataObject); $expected = '<span class="grid-severity-major"><span></span></span>'; $this->assertEquals($actual, $expected); // Test minor severity - $dataObject->setData('a magic index', 3); + $dataObject->setData('index', 3); $actual = $this->sut->render($dataObject); $expected = '<span class="grid-severity-minor"><span></span></span>'; $this->assertEquals($actual, $expected); // Test notice severity - $dataObject->setData('a magic index', 4); + $dataObject->setData('index', 4); $actual = $this->sut->render($dataObject); $expected = '<span class="grid-severity-notice"><span></span></span>'; $this->assertEquals($actual, $expected); // Test default severity - $dataObject->setData('a magic index', 5); + $dataObject->setData('index', 5); $actual = $this->sut->render($dataObject); $expected = '<span class="grid-severity-"><span></span></span>'; From c2155d5c01a158656a00a921ae15cf145de779cd Mon Sep 17 00:00:00 2001 From: David Lambauer <david@run-as-root.sh> Date: Sun, 11 Aug 2019 18:32:49 +0200 Subject: [PATCH 017/586] Fixed PHP CS --- .../AdminNotification/Block/Grid/Renderer/Actions.php | 1 + .../Magento/AdminNotification/Block/Grid/Renderer/Notice.php | 5 +++++ .../AdminNotification/Block/Grid/Renderer/Severity.php | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php b/app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php index ab591702ceae6..2db5bfec92395 100644 --- a/app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php +++ b/app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php @@ -18,6 +18,7 @@ /** * Renderer class for action in the admin notifications grid + * * @package Magento\AdminNotification\Block\Grid\Renderer */ class Actions extends AbstractRenderer diff --git a/app/code/Magento/AdminNotification/Block/Grid/Renderer/Notice.php b/app/code/Magento/AdminNotification/Block/Grid/Renderer/Notice.php index 8de85cf1b241f..34919258dbc6c 100644 --- a/app/code/Magento/AdminNotification/Block/Grid/Renderer/Notice.php +++ b/app/code/Magento/AdminNotification/Block/Grid/Renderer/Notice.php @@ -12,6 +12,11 @@ use Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer; use Magento\Framework\DataObject; +/** + * Renderer class for notice in the admin notifications grid + * + * @package Magento\AdminNotification\Block\Grid\Renderer + */ class Notice extends AbstractRenderer { /** diff --git a/app/code/Magento/AdminNotification/Block/Grid/Renderer/Severity.php b/app/code/Magento/AdminNotification/Block/Grid/Renderer/Severity.php index 69c9d1994e764..bf26bc15813e1 100644 --- a/app/code/Magento/AdminNotification/Block/Grid/Renderer/Severity.php +++ b/app/code/Magento/AdminNotification/Block/Grid/Renderer/Severity.php @@ -15,6 +15,11 @@ use Magento\Framework\DataObject; use Magento\Framework\Notification\MessageInterface; +/** + * Renderer class for severity in the admin notifications grid + * + * @package Magento\AdminNotification\Block\Grid\Renderer + */ class Severity extends AbstractRenderer { /** From f208cf5d0db47c13a70fe4e3cf7e3dd3763c6424 Mon Sep 17 00:00:00 2001 From: Kate Kyzyma <kate@atwix.com> Date: Wed, 28 Aug 2019 16:32:48 +0300 Subject: [PATCH 018/586] Working on the test --- ...dminAddUrlRewriteForCmsPageActionGroup.xml | 40 ++++++++ .../Section/AdminUrlRewriteEditSection.xml | 1 + ...AdminDeleteCmsPageUrlRewriteEntityTest.xml | 99 +++++++++++++++++++ 3 files changed, 140 insertions(+) create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminAddUrlRewriteForCmsPageActionGroup.xml create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteEntityTest.xml diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminAddUrlRewriteForCmsPageActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminAddUrlRewriteForCmsPageActionGroup.xml new file mode 100644 index 0000000000000..f46bd7f5e0386 --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminAddUrlRewriteForCmsPageActionGroup.xml @@ -0,0 +1,40 @@ +<?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="AdminAddUrlRewriteForCmsPageActionGroup"> + <annotations> + <description>Goes to the Admin Add URL Rewrite edit page. Fills in the provided URL details. Clicks on Save. Validates that the Success Message is present.</description> + </annotations> + <arguments> + <argument name="cmsPageUrlKey" type="string"/> + <argument name="customUrlRewriteValue" type="string"/> + <argument name="storeValue" type="string"/> + <argument name="requestPath" type="string"/> + <argument name="redirectTypeValue" type="string"/> + <argument name="description" type="string"/> + </arguments> + + <amOnPage url="{{AdminUrlRewriteEditPage.url}}" stepKey="openUrlRewriteEditPage"/> + <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad"/> + <click selector="{{AdminUrlRewriteEditSection.createCustomUrlRewrite}}" stepKey="clickOnCustomUrlRewrite"/> + <click selector="{{AdminUrlRewriteEditSection.createCustomUrlRewriteValue('customUrlRewriteValue')}}" stepKey="selectForCsmPage"/> + <waitForPageLoad stepKey="waitForCategoryEditSectionToLoad"/> + <click selector="{{AdminUrlRewriteEditSection.cmsPage('cmsPageUrlKey')}}" stepKey="selectCmsPage"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <click selector="{{AdminUrlRewriteEditSection.store}}" stepKey="clickOnStore"/> + <click selector="{{AdminUrlRewriteEditSection.storeValue('storeValue')}}" stepKey="clickOnStoreValue"/> + <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPath"/> + <click selector="{{AdminUrlRewriteEditSection.redirectType}}" stepKey="selectRedirectType"/> + <click selector="{{AdminUrlRewriteEditSection.redirectTypeValue('redirectTypeValue')}}" stepKey="clickOnRedirectTypeValue"/> + <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescription"/> + <click selector="{{AdminUrlRewriteEditSection.saveButton}}" stepKey="clickOnSaveButton"/> + <seeElement selector="{{AdminUrlRewriteIndexSection.successMessage}}" stepKey="seeSuccessSaveMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Section/AdminUrlRewriteEditSection.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Section/AdminUrlRewriteEditSection.xml index 52939607f5377..5a55562e99334 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Section/AdminUrlRewriteEditSection.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Section/AdminUrlRewriteEditSection.xml @@ -19,6 +19,7 @@ <element name="redirectTypeValue" type="select" selector="//select[@id='redirect_type']//option[contains(., '{{Var}}')]" parameterized="true"/> <element name="description" type="input" selector="#description"/> <element name="categoryInTree" type="text" selector="//li[contains(@class,'active-category jstree-open')]/a[contains(., '{{categoryName}}')]" parameterized="true"/> + <element name="cmsPage" selector="//td[contains(text(), '{{cmsPageUrlKey}}')]" type="button" parameterized="true"/> <element name="saveButton" type="button" selector="#save" timeout="30"/> <element name="deleteButton" type="button" selector="#delete" timeout="30"/> <element name="okButton" type="button" selector="//button[@class='action-primary action-accept']" timeout="30"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteEntityTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteEntityTest.xml new file mode 100644 index 0000000000000..705786afa83bb --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteEntityTest.xml @@ -0,0 +1,99 @@ +<?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="AdminDeleteCmsPageUrlRewriteEntityTest"> + <annotations> + <stories value="Delete CMS Page URL rewrite"/> + <title value="Delete CMS Page URL rewrite"/> + <description value="Log in to admin and delete CMS Page URL rewrite"/> + <group value="cMSContent"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <createData entity="simpleCmsPage" stepKey="createCMSPage"/> + <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + </before> + <after> + <deleteData createDataKey="createCMSPage" stepKey="deleteCMSPage"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!-- Create URL Rewrite for CMS Page with No redirects --> + <actionGroup ref="AdminAddUrlRewriteForCmsPageActionGroup" stepKey="addUrlRewrite"> + <argument name="cmsPageUrlKey" value="$$createCMSPage.identifier$$"/> + <argument name="customUrlRewriteValue" value="For CMS page'"/> + <argument name="storeValue" value="Default Store View"/> + <argument name="requestPath" value="newrequestpath"/> + <argument name="redirectTypeValue" value="No"/> + <argument name="description" value="cms_default_no_redirect"/> + </actionGroup> + + <!-- Create URL Rewrite for CMS Page with temporary redirect --> + <actionGroup ref="AdminAddUrlRewriteForCmsPageActionGroup" stepKey="addUrlRewriteTemporary"> + <argument name="cmsPageUrlKey" value="$$createCMSPage.identifier$$"/> + <argument name="customUrlRewriteValue" value="For CMS page'"/> + <argument name="storeValue" value="Default Store View"/> + <argument name="requestPath" value="temporaryrequestpath.html"/> + <argument name="redirectTypeValue" value="Temporary (302)"/> + <argument name="description" value="cms_default_temporary_redirect"/> + </actionGroup> + + <!-- Create URL Rewrite for CMS Page with permanent redirect --> + <actionGroup ref="AdminAddUrlRewriteForCmsPageActionGroup" stepKey="addUrlRewritePermanent"> + <argument name="cmsPageUrlKey" value="$$createCMSPage.identifier$$"/> + <argument name="customUrlRewriteValue" value="For CMS page'"/> + <argument name="storeValue" value="Default Store View"/> + <argument name="requestPath" value="permanentrequestpath.html"/> + <argument name="redirectTypeValue" value="Permanent (301)"/> + <argument name="description" value="cms_default_permanent_redirect"/> + </actionGroup> + + <!--Delete the URL Rewrite for CMS Page with No redirects--> + <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite"> + <argument name="requestPath" value="newrequestpath"/> + </actionGroup> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage"> + <argument name="message" value="You deleted the URL rewrite."/> + </actionGroup> + <!--Search and verify AssertUrlRewriteNotInGrid--> + <actionGroup ref="AdminSearchDeletedUrlRewrite" stepKey="searchDeletedUrlRewriteInGrid"> + <argument name="requestPath" value="newrequestpath"/> + </actionGroup> + <!--Verify AssertPageByUrlRewriteIsNotFound--> + <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="assertPageByUrlRewriteIsNotFound"> + <argument name="requestPath" value="newrequestpath"/> + </actionGroup> + + <!--Delete the URL Rewrite for CMS Page with with temporary redirect--> + <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteTemporaryUrlRewrite"> + <argument name="requestPath" value="temporaryrequestpath.html"/> + </actionGroup> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessageSecondTime"> + <argument name="message" value="You deleted the URL rewrite."/> + </actionGroup> + <!--Verify AssertPageByUrlRewriteIsNotFound--> + <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="assertPageByUrlRewriteIsNotFoundSecondTime"> + <argument name="requestPath" value="temporaryrequestpath.html"/> + </actionGroup> + + <!--Delete the URL Rewrite for CMS Page with permanent redirect--> + <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deletePermanentUrlRewrite"> + <argument name="requestPath" value="permanentrequestpath.html"/> + </actionGroup> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessageThirdTime"> + <argument name="message" value="You deleted the URL rewrite."/> + </actionGroup> + <!--Verify AssertPageByUrlRewriteIsNotFound--> + <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="assertPageByUrlRewriteIsNotFoundThirdTime"> + <argument name="requestPath" value="permanentrequestpath.html"/> + </actionGroup> + + </test> +</tests> From 4674e41ea82a9e51bfb8b56c76a3533446d1c310 Mon Sep 17 00:00:00 2001 From: Kate Kyzyma <kate@atwix.com> Date: Wed, 28 Aug 2019 21:12:41 +0300 Subject: [PATCH 019/586] Convert DeleteCmsPageUrlRewriteEntityTest to MFTF --- .../Cms/Test/TestCase/DeleteCmsPageUrlRewriteEntityTest.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageUrlRewriteEntityTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageUrlRewriteEntityTest.xml index 8262d88bdff1a..ea9d49d662bdd 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageUrlRewriteEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageUrlRewriteEntityTest.xml @@ -8,20 +8,20 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Cms\Test\TestCase\DeleteCmsPageUrlRewriteEntityTest" summary="Delete Cms Page URL Rewrites" ticketId="MAGETWO-25915"> <variation name="DeleteCmsPageUrlRewriteEntityTestVariation1"> - <data name="tag" xsi:type="string">severity:S2</data> + <data name="tag" xsi:type="string">severity:S2,mftf_migrated:yes</data> <data name="urlRewrite/dataset" xsi:type="string">cms_default_no_redirect</data> <constraint name="Magento\UrlRewrite\Test\Constraint\AssertUrlRewriteDeletedMessage" /> <constraint name="Magento\UrlRewrite\Test\Constraint\AssertUrlRewriteNotInGrid" /> <constraint name="Magento\UrlRewrite\Test\Constraint\AssertPageByUrlRewriteIsNotFound" /> </variation> <variation name="DeleteCmsPageUrlRewriteEntityTestVariation2"> - <data name="tag" xsi:type="string">severity:S2</data> + <data name="tag" xsi:type="string">severity:S2,mftf_migrated:yes</data> <data name="urlRewrite/dataset" xsi:type="string">cms_default_permanent_redirect</data> <constraint name="Magento\UrlRewrite\Test\Constraint\AssertUrlRewriteDeletedMessage" /> <constraint name="Magento\UrlRewrite\Test\Constraint\AssertPageByUrlRewriteIsNotFound" /> </variation> <variation name="DeleteCmsPageUrlRewriteEntityTestVariation3"> - <data name="tag" xsi:type="string">severity:S2</data> + <data name="tag" xsi:type="string">severity:S2,mftf_migrated:yes</data> <data name="urlRewrite/dataset" xsi:type="string">cms_default_temporary_redirect</data> <constraint name="Magento\UrlRewrite\Test\Constraint\AssertUrlRewriteDeletedMessage" /> <constraint name="Magento\UrlRewrite\Test\Constraint\AssertPageByUrlRewriteIsNotFound" /> From 459c596a74c209b001b1afcfcde8717f46132fec Mon Sep 17 00:00:00 2001 From: Tan Sezer <t.sezer@youwe.nl> Date: Thu, 29 Aug 2019 16:46:38 +0200 Subject: [PATCH 020/586] add eav_attribute_option join for ordering by sort_order column for attributes --- .../Model/Entity/Attribute/Source/Table.php | 8 +++++- .../ResourceModel/Entity/Attribute/Option.php | 27 +++++++++++++++++++ .../Entity/Attribute/Source/TableTest.php | 3 +++ 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Eav/Model/Entity/Attribute/Source/Table.php b/app/code/Magento/Eav/Model/Entity/Attribute/Source/Table.php index f9aa1a9ed3ba1..908f29069c429 100644 --- a/app/code/Magento/Eav/Model/Entity/Attribute/Source/Table.php +++ b/app/code/Magento/Eav/Model/Entity/Attribute/Source/Table.php @@ -213,7 +213,13 @@ public function addValueSortToCollection($collection, $dir = \Magento\Framework\ $valueExpr ); - $collection->getSelect()->order("{$attribute->getAttributeCode()} {$dir}"); + $this->_attrOptionFactory->create()->addOptionToCollection( + $collection, + $attribute, + $valueExpr + ); + + $collection->getSelect()->order("{$attribute->getAttributeCode()}_order {$dir}"); return $this; } diff --git a/app/code/Magento/Eav/Model/ResourceModel/Entity/Attribute/Option.php b/app/code/Magento/Eav/Model/ResourceModel/Entity/Attribute/Option.php index 79c277dcb6a82..6dc51247fb3f3 100644 --- a/app/code/Magento/Eav/Model/ResourceModel/Entity/Attribute/Option.php +++ b/app/code/Magento/Eav/Model/ResourceModel/Entity/Attribute/Option.php @@ -61,6 +61,33 @@ public function addOptionValueToCollection($collection, $attribute, $valueExpr) return $this; } + /** + * Add Join with option for collection select + * + * @param \Magento\Eav\Model\Entity\Collection\AbstractCollection $collection + * @param \Magento\Eav\Model\Entity\Attribute $attribute + * @param \Zend_Db_Expr $valueExpr + * @return $this + */ + public function addOptionToCollection($collection, $attribute, $valueExpr) + { + $connection = $this->getConnection(); + $attributeCode = $attribute->getAttributeCode(); + $optionTable1 = $attributeCode . '_option_t1'; + $tableJoinCond1 = "{$optionTable1}.option_id={$valueExpr}"; + $valueExpr = $connection->getIfNullSql( + "{$optionTable1}.sort_order" + ); + + $collection->getSelect()->joinLeft( + [$optionTable1 => $this->getTable('eav_attribute_option')], + $tableJoinCond1, + ["{$attributeCode}_order" => $valueExpr] + ); + + return $this; + } + /** * Retrieve Select for update Flat data * diff --git a/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Source/TableTest.php b/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Source/TableTest.php index b68446d22f910..49e7be7ecf594 100644 --- a/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Source/TableTest.php +++ b/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Source/TableTest.php @@ -314,6 +314,9 @@ public function testAddValueSortToCollection() $attrOption->expects($this->once())->method('addOptionValueToCollection') ->with($collection, $this->abstractAttributeMock, $expr) ->willReturnSelf(); + $attrOption->expects($this->once())->method('addOptionToCollection') + ->with($collection, $this->abstractAttributeMock, $expr) + ->willReturnSelf(); $select->expects($this->once())->method('order')->with("{$attributeCode} {$dir}"); $this->assertEquals($this->model, $this->model->addValueSortToCollection($collection, $dir)); From a047aca104cb76d743bb318887f6ff7530175d5d Mon Sep 17 00:00:00 2001 From: Tan Sezer <t.sezer@youwe.nl> Date: Thu, 29 Aug 2019 17:02:43 +0200 Subject: [PATCH 021/586] add a line --- app/code/Magento/Eav/Model/Entity/Attribute/Source/Table.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/code/Magento/Eav/Model/Entity/Attribute/Source/Table.php b/app/code/Magento/Eav/Model/Entity/Attribute/Source/Table.php index 908f29069c429..ef7b4a69808bc 100644 --- a/app/code/Magento/Eav/Model/Entity/Attribute/Source/Table.php +++ b/app/code/Magento/Eav/Model/Entity/Attribute/Source/Table.php @@ -211,9 +211,7 @@ public function addValueSortToCollection($collection, $dir = \Magento\Framework\ $collection, $attribute, $valueExpr - ); - - $this->_attrOptionFactory->create()->addOptionToCollection( + )->addOptionToCollection( $collection, $attribute, $valueExpr From 952d12e423f2a02c0ead3a7fd8cd7588a15d0760 Mon Sep 17 00:00:00 2001 From: Tan Sezer <t.sezer@youwe.nl> Date: Fri, 30 Aug 2019 11:24:37 +0200 Subject: [PATCH 022/586] fix unit test for ordering of attribute --- .../Eav/Test/Unit/Model/Entity/Attribute/Source/TableTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Source/TableTest.php b/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Source/TableTest.php index 49e7be7ecf594..2997874f6ea34 100644 --- a/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Source/TableTest.php +++ b/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Source/TableTest.php @@ -317,7 +317,7 @@ public function testAddValueSortToCollection() $attrOption->expects($this->once())->method('addOptionToCollection') ->with($collection, $this->abstractAttributeMock, $expr) ->willReturnSelf(); - $select->expects($this->once())->method('order')->with("{$attributeCode} {$dir}"); + $select->expects($this->once())->method('order')->with("{$attributeCode}_order {$dir}"); $this->assertEquals($this->model, $this->model->addValueSortToCollection($collection, $dir)); } From e5907065e80f35ef450fc94ef5a83a1ddec9928c Mon Sep 17 00:00:00 2001 From: David Lambauer <david@run-as-root.sh> Date: Mon, 2 Sep 2019 22:02:40 +0200 Subject: [PATCH 023/586] Fixed Id Call due to model intercept. --- .../Magento/AdminNotification/Block/Grid/Renderer/Actions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php b/app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php index 2db5bfec92395..af8ccf65dd769 100644 --- a/app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php +++ b/app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php @@ -54,7 +54,7 @@ public function render(DataObject $row) : string $markAsReadHtml = !$row->getData('is_read') ? '<a class="action-mark" href="' . $this->getUrl( '*/*/markAsRead/', - ['_current' => true, 'id' => $row->getData('id')] + ['_current' => true, 'id' => $row->getData('notification_id')] ) . '">' . __( 'Mark as Read' ) . '</a>' : ''; @@ -68,7 +68,7 @@ public function render(DataObject $row) : string '*/*/remove/', [ '_current' => true, - 'id' => $row->getData('id'), + 'id' => $row->getData('notification_id'), ActionInterface::PARAM_NAME_URL_ENCODED => $encodedUrl ] ), From 3e42c25472b9269045281631a9a84cc2f5726a3a Mon Sep 17 00:00:00 2001 From: David Lambauer <david@run-as-root.sh> Date: Tue, 17 Sep 2019 17:39:27 +0200 Subject: [PATCH 024/586] Removed static types for compatibility --- .../Magento/AdminNotification/Block/Grid/Renderer/Actions.php | 2 +- .../Magento/AdminNotification/Block/Grid/Renderer/Notice.php | 2 +- .../Magento/AdminNotification/Block/Grid/Renderer/Severity.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php b/app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php index af8ccf65dd769..86cf528fd4971 100644 --- a/app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php +++ b/app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php @@ -45,7 +45,7 @@ public function __construct(Context $context, Data $urlHelper, array $data = []) * @param \Magento\Framework\DataObject $row * @return string */ - public function render(DataObject $row) : string + public function render(DataObject $row) { $readDetailsHtml = $row->getData('url') ? '<a class="action-details" target="_blank" href="' . $this->escapeUrl($row->getData('url')) diff --git a/app/code/Magento/AdminNotification/Block/Grid/Renderer/Notice.php b/app/code/Magento/AdminNotification/Block/Grid/Renderer/Notice.php index 34919258dbc6c..1cf56d60db9de 100644 --- a/app/code/Magento/AdminNotification/Block/Grid/Renderer/Notice.php +++ b/app/code/Magento/AdminNotification/Block/Grid/Renderer/Notice.php @@ -25,7 +25,7 @@ class Notice extends AbstractRenderer * @param \Magento\Framework\DataObject $row * @return string */ - public function render(DataObject $row) : string + public function render(DataObject $row) { return '<span class="grid-row-title">' . $this->escapeHtml($row->getData('title')) . diff --git a/app/code/Magento/AdminNotification/Block/Grid/Renderer/Severity.php b/app/code/Magento/AdminNotification/Block/Grid/Renderer/Severity.php index bf26bc15813e1..d50781b1f6415 100644 --- a/app/code/Magento/AdminNotification/Block/Grid/Renderer/Severity.php +++ b/app/code/Magento/AdminNotification/Block/Grid/Renderer/Severity.php @@ -44,7 +44,7 @@ public function __construct(Context $context, Inbox $notice, array $data = []) * @param \Magento\Framework\DataObject $row * @return string */ - public function render(DataObject $row) : string + public function render(DataObject $row) { $class = ''; $value = ''; From a7f87cedecb81ea4901266aadd669fd8f3bea347 Mon Sep 17 00:00:00 2001 From: "rostyslav.hymon" <rostyslav.hymon@transoftgroup.com> Date: Wed, 2 Oct 2019 17:11:19 +0300 Subject: [PATCH 025/586] MC-18457: Free Shipping Minimum Order Amount Excluding/Including Tax options --- .../Model/Carrier/Freeshipping.php | 23 +- ...eeShippingDisplayWithInclTaxOptionTest.xml | 68 ++++++ .../Unit/Model/Carrier/FreeshippingTest.php | 200 ++++++++++++++++++ .../OfflineShipping/etc/adminhtml/system.xml | 4 + .../Magento/Quote/Model/Quote/Address.php | 21 +- .../Test/Mftf/Data/FreeShippingMethodData.xml | 15 ++ .../Mftf/Metadata/shipping_methods-meta.xml | 3 + .../Sales/Total/Quote/CommonTaxCollector.php | 4 + 8 files changed, 324 insertions(+), 14 deletions(-) create mode 100644 app/code/Magento/OfflineShipping/Test/Mftf/Test/StorefrontFreeShippingDisplayWithInclTaxOptionTest.xml create mode 100644 app/code/Magento/OfflineShipping/Test/Unit/Model/Carrier/FreeshippingTest.php diff --git a/app/code/Magento/OfflineShipping/Model/Carrier/Freeshipping.php b/app/code/Magento/OfflineShipping/Model/Carrier/Freeshipping.php index 674e6b8089787..a1fca2b155f11 100644 --- a/app/code/Magento/OfflineShipping/Model/Carrier/Freeshipping.php +++ b/app/code/Magento/OfflineShipping/Model/Carrier/Freeshipping.php @@ -63,6 +63,24 @@ public function __construct( parent::__construct($scopeConfig, $rateErrorFactory, $logger, $data); } + /** + * Check subtotal for allowed free shipping + * + * @param RateRequest $request + * + * @return bool + */ + private function isFreeShippingRequired(RateRequest $request): bool + { + $minSubtotal = $request->getPackageValueWithDiscount(); + if ($request->getBaseSubtotalWithDiscountInclTax() + && $this->getConfigFlag('tax_including')) { + $minSubtotal = $request->getBaseSubtotalWithDiscountInclTax(); + } + + return $minSubtotal >= $this->getConfigData('free_shipping_subtotal'); + } + /** * FreeShipping Rates Collector * @@ -80,10 +98,7 @@ public function collectRates(RateRequest $request) $this->_updateFreeMethodQuote($request); - if ($request->getFreeShipping() || $request->getPackageValueWithDiscount() >= $this->getConfigData( - 'free_shipping_subtotal' - ) - ) { + if ($request->getFreeShipping() || $this->isFreeShippingRequired($request)) { /** @var \Magento\Quote\Model\Quote\Address\RateResult\Method $method */ $method = $this->_rateMethodFactory->create(); diff --git a/app/code/Magento/OfflineShipping/Test/Mftf/Test/StorefrontFreeShippingDisplayWithInclTaxOptionTest.xml b/app/code/Magento/OfflineShipping/Test/Mftf/Test/StorefrontFreeShippingDisplayWithInclTaxOptionTest.xml new file mode 100644 index 0000000000000..db44a06b54a88 --- /dev/null +++ b/app/code/Magento/OfflineShipping/Test/Mftf/Test/StorefrontFreeShippingDisplayWithInclTaxOptionTest.xml @@ -0,0 +1,68 @@ +<?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="StorefrontFreeShippingDisplayWithInclTaxOptionTest"> + <annotations> + <features value="Shipping"/> + <stories value="Offline Shipping Methods"/> + <title value="Free Shipping Minimum Order Amount Excluding/Including Tax options"/> + <description value="Free Shipping Minimum Order Amount Excluding/Including Tax options"/> + <severity value="AVERAGE"/> + <testCaseId value="MC-20613"/> + <useCaseId value="MC-18457"/> + <group value="shipping"/> + </annotations> + <before> + <createData entity="SimpleProduct2" stepKey="createSimpleProduct"> + <field key="price">100.00</field> + </createData> + <!-- Enable free shipping method --> + <createData entity="FreeShippinMethodConfig" stepKey="enableFreeShippingMethod"/> + <createData entity="setFreeShippingSubtotal" stepKey="setFreeShippingSubtotal"/> + <createData entity="SetTaxIncluding" stepKey="setTaxIncluding"/> + <!-- Tax configuration (Store>Configuration; Sales>Tax) --> + <createData entity="Tax_Config_CA" stepKey="configureTaxForCA"/> + <createData entity="defaultTaxRule" stepKey="createTaxRule"/> + </before> + <after> + <!-- Disable free shipping method --> + <createData entity="FreeShippinMethodDefault" stepKey="disableFreeShippingMethod"/> + <createData entity="setFreeShippingSubtotalToDefault" stepKey="setFreeShippingSubtotalToDefault"/> + <createData entity="SetTaxIncludingToDefault" stepKey="setTaxIncludingToDefault"/> + <deleteData createDataKey="createTaxRule" stepKey="deleteTaxRule"/> + <createData entity="DefaultTaxConfig" stepKey="resetTaxConfiguration"/> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> + </after> + <!-- Add simple product to cart --> + <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart"> + <argument name="product" value="$$createSimpleProduct$$"/> + </actionGroup> + <!-- Assert that taxes are applied correctly for CA --> + <amOnPage url="{{CheckoutCartPage.url}}" stepKey="goToCheckout"/> + <waitForPageLoad stepKey="waitForCart"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.tax}}" stepKey="waitForOverviewVisible"/> + <waitForElement time="30" selector="{{CheckoutCartSummarySection.estimateShippingAndTaxForm}}" stepKey="waitForEstimateShippingAndTaxForm"/> + <waitForElement time="30" selector="{{CheckoutCartSummarySection.shippingMethodForm}}" stepKey="waitForShippingMethodForm"/> + <conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false" stepKey="expandEstimateShippingandTax" /> + <selectOption selector="{{CheckoutCartSummarySection.country}}" userInput="United States" stepKey="selectUSCountry"/> + <waitForPageLoad stepKey="waitForSelectCountry"/> + <selectOption selector="{{CheckoutCartSummarySection.stateProvince}}" userInput="California" stepKey="selectCaliforniaRegion"/> + <waitForPageLoad stepKey="waitForSelectRegion"/> + <see selector="{{CheckoutPaymentSection.tax}}" userInput="$8.25" stepKey="seeTaxForCA"/> + <!-- See available Free Shipping option --> + <actionGroup ref="StorefrontAssertShippingMethodPresentInCartActionGroup" stepKey="assertShippingMethodLabel"> + <argument name="shippingMethod" value="{{freeTitleDefault.value}}"/> + </actionGroup> + <!-- Change State to New York --> + <selectOption selector="{{CheckoutCartSummarySection.stateProvince}}" userInput="{{US_Address_NY.state}}" stepKey="selectAnotherState"/> + <waitForPageLoad stepKey="waitForShippingMethodLoad"/> + <dontSee selector="{{CheckoutCartSummarySection.shippingMethodLabel}}" userInput="{{freeTitleDefault.value}}" stepKey="assertShippingMethodIsNotPresentInCart"/> + </test> +</tests> diff --git a/app/code/Magento/OfflineShipping/Test/Unit/Model/Carrier/FreeshippingTest.php b/app/code/Magento/OfflineShipping/Test/Unit/Model/Carrier/FreeshippingTest.php new file mode 100644 index 0000000000000..7f8959e610d42 --- /dev/null +++ b/app/code/Magento/OfflineShipping/Test/Unit/Model/Carrier/FreeshippingTest.php @@ -0,0 +1,200 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\OfflineShipping\Test\Unit\Model\Carrier; + +use Magento\Quote\Model\Quote\Address\RateResult\Method; +use Magento\Shipping\Model\Rate\Result; +use Magento\OfflineShipping\Model\Carrier\Freeshipping; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Quote\Model\Quote\Address\RateResult\MethodFactory; +use Magento\Shipping\Model\Rate\ResultFactory; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Quote\Model\Quote\Address\RateRequest; +use Magento\Store\Model\ScopeInterface; +use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\MockObject\MockObject; +use Magento\Quote\Model\Quote\Item as QuoteItem; +use PHPUnit\Framework\MockObject\Matcher\InvokedCount; + +/** + * Class for test free shipping + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ +class FreeshippingTest extends TestCase +{ + /** + * @var Freeshipping + */ + private $model; + + /** + * @var ScopeConfigInterface|MockObject + */ + private $scopeConfigMock; + + /** + * @var ResultFactory|MockObject + */ + private $resultFactoryMock; + + /** + * @var MethodFactory|MockObject + */ + private $methodFactoryMock; + + /** + * @var ObjectManager + */ + private $helper; + + /** + * @inheritdoc + */ + protected function setUp() + { + $this->scopeConfigMock = $this->getMockBuilder(\Magento\Framework\App\Config::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->resultFactoryMock = $this->getMockBuilder(ResultFactory::class) + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + + $this->methodFactoryMock = $this + ->getMockBuilder(MethodFactory::class) + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + + $this->helper = new ObjectManager($this); + $this->model = $this->helper->getObject( + Freeshipping::class, + [ + 'scopeConfig' => $this->scopeConfigMock, + '_rateResultFactory' => $this->resultFactoryMock, + '_rateMethodFactory' => $this->methodFactoryMock, + ] + ); + } + + /** + * Test for collect rate free shipping with tax options + * + * @param int $subtotalInclTax + * @param int $minOrderAmount + * @param int $packageValueWithDiscount + * @param int $baseSubtotalWithDiscountInclTax + * @param InvokedCount $expectedCallAppend + * + * @return void + * @dataProvider freeShippingWithSubtotalTaxDataProvider + */ + public function testCollectRatesFreeShippingWithTaxOptions( + int $subtotalInclTax, + int $minOrderAmount, + int $packageValueWithDiscount, + int $baseSubtotalWithDiscountInclTax, + InvokedCount $expectedCallAppend + ): void { + /** @var RateRequest|MockObject $request */ + $request = $this->getMockBuilder(RateRequest::class) + ->disableOriginalConstructor() + ->setMethods( + [ + 'getAllItems', + 'getPackageQty', + 'getFreeShipping', + 'getBaseSubtotalWithDiscountInclTax', + 'getPackageValueWithDiscount', + ] + ) + ->getMock(); + $item = $this->getMockBuilder(QuoteItem::class) + ->disableOriginalConstructor() + ->getMock(); + $this->scopeConfigMock->expects($this->at(0)) + ->method('isSetFlag') + ->willReturn(true); + $this->scopeConfigMock->expects($this->at(1)) + ->method('isSetFlag') + ->with( + 'carriers/freeshipping/tax_including', + ScopeInterface::SCOPE_STORE, + null + ) + ->willReturn($subtotalInclTax); + $this->scopeConfigMock->expects($this->at(2)) + ->method('getValue') + ->with( + 'carriers/freeshipping/free_shipping_subtotal', + ScopeInterface::SCOPE_STORE, + null + ) + ->willReturn($minOrderAmount); + $method = $this->getMockBuilder(Method::class) + ->disableOriginalConstructor() + ->setMethods(['setCarrier', 'setCarrierTitle', 'setMethod', 'setMethodTitle', 'setPrice', 'setCost']) + ->getMock(); + $resultModel = $this->getMockBuilder(Result::class) + ->disableOriginalConstructor() + ->setMethods(['append']) + ->getMock(); + $this->resultFactoryMock->method('create') + ->willReturn($resultModel); + $request->method('getPackageValueWithDiscount') + ->willReturn($packageValueWithDiscount); + $request->method('getAllItems') + ->willReturn([$item]); + $request->method('getFreeShipping') + ->willReturn(false); + $request->method('getBaseSubtotalWithDiscountInclTax') + ->willReturn($baseSubtotalWithDiscountInclTax); + $this->methodFactoryMock->method('create')->willReturn($method); + + $resultModel->expects($expectedCallAppend) + ->method('append') + ->with($method); + + $this->model->collectRates($request); + } + + /** + * @return array + */ + public function freeShippingWithSubtotalTaxDataProvider(): array + { + return [ + [ + 'subtotalInclTax' => 1, + 'minOrderAmount' => 10, + 'packageValueWithDiscount' => 8, + 'baseSubtotalWithDiscountInclTax' => 15, + 'expectedCallAppend' => $this->once(), + + ], + [ + 'subtotalInclTax' => 1, + 'minOrderAmount' => 20, + 'packageValueWithDiscount' => 8, + 'baseSubtotalWithDiscountInclTax' => 15, + 'expectedCallAppend' => $this->never(), + + ], + [ + 'subtotalInclTax' => 0, + 'minOrderAmount' => 10, + 'packageValueWithDiscount' => 8, + 'baseSubtotalWithDiscountInclTax' => 15, + 'expectedCallAppend' => $this->never(), + + ], + ]; + } +} diff --git a/app/code/Magento/OfflineShipping/etc/adminhtml/system.xml b/app/code/Magento/OfflineShipping/etc/adminhtml/system.xml index 2b29d2211b9d1..cb75bddf4d7bd 100644 --- a/app/code/Magento/OfflineShipping/etc/adminhtml/system.xml +++ b/app/code/Magento/OfflineShipping/etc/adminhtml/system.xml @@ -127,6 +127,10 @@ <label>Minimum Order Amount</label> <validate>validate-number validate-zero-or-greater</validate> </field> + <field id="tax_including" translate="label" sortOrder="5" type="select" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1"> + <label>Include Tax to Amount</label> + <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> + </field> <field id="name" translate="label" type="text" sortOrder="3" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1"> <label>Method Name</label> </field> diff --git a/app/code/Magento/Quote/Model/Quote/Address.php b/app/code/Magento/Quote/Model/Quote/Address.php index 3ecbc69b80785..ecc51a00e8fb5 100644 --- a/app/code/Magento/Quote/Model/Quote/Address.php +++ b/app/code/Magento/Quote/Model/Quote/Address.php @@ -471,7 +471,7 @@ protected function _isDefaultShippingNullOrSameAsBillingAddress() /** * Declare address quote model object * - * @param \Magento\Quote\Model\Quote $quote + * @param \Magento\Quote\Model\Quote $quote * @return $this */ public function setQuote(\Magento\Quote\Model\Quote $quote) @@ -691,7 +691,7 @@ public function getItemQty($itemId = 0) */ public function hasItems() { - return sizeof($this->getAllItems()) > 0; + return count($this->getAllItems()) > 0; } /** @@ -1020,6 +1020,7 @@ public function requestShippingRates(\Magento\Quote\Model\Quote\Item\AbstractIte $request->setLimitCarrier($this->getLimitCarrier()); $baseSubtotalInclTax = $this->getBaseSubtotalTotalInclTax(); $request->setBaseSubtotalInclTax($baseSubtotalInclTax); + $request->setBaseSubtotalWithDiscountInclTax($this->getBaseSubtotalWithDiscount() + $this->getBaseTaxAmount()); $result = $this->_rateCollector->create()->collectRates($request)->getResult(); @@ -1225,8 +1226,8 @@ public function setBaseShippingAmount($value, $alreadyExclTax = false) /** * Set total amount value * - * @param string $code - * @param float $amount + * @param string $code + * @param float $amount * @return $this */ public function setTotalAmount($code, $amount) @@ -1243,8 +1244,8 @@ public function setTotalAmount($code, $amount) /** * Set total amount value in base store currency * - * @param string $code - * @param float $amount + * @param string $code + * @param float $amount * @return $this */ public function setBaseTotalAmount($code, $amount) @@ -1261,8 +1262,8 @@ public function setBaseTotalAmount($code, $amount) /** * Add amount total amount value * - * @param string $code - * @param float $amount + * @param string $code + * @param float $amount * @return $this */ public function addTotalAmount($code, $amount) @@ -1276,8 +1277,8 @@ public function addTotalAmount($code, $amount) /** * Add amount total amount value in base store currency * - * @param string $code - * @param float $amount + * @param string $code + * @param float $amount * @return $this */ public function addBaseTotalAmount($code, $amount) diff --git a/app/code/Magento/Shipping/Test/Mftf/Data/FreeShippingMethodData.xml b/app/code/Magento/Shipping/Test/Mftf/Data/FreeShippingMethodData.xml index d700aa622c177..3d3667e59903f 100644 --- a/app/code/Magento/Shipping/Test/Mftf/Data/FreeShippingMethodData.xml +++ b/app/code/Magento/Shipping/Test/Mftf/Data/FreeShippingMethodData.xml @@ -26,6 +26,7 @@ <requiredEntity type="title">freeTitleDefault</requiredEntity> <requiredEntity type="name">freeNameDefault</requiredEntity> <requiredEntity type="free_shipping_subtotal">freeShippingSubtotalDefault</requiredEntity> + <requiredEntity type="tax_including">TaxIncludingDefault</requiredEntity> <requiredEntity type="specificerrmsg">freeSpecificerrmsgDefault</requiredEntity> <requiredEntity type="sallowspecific">freeSallowspecificDefault</requiredEntity> <requiredEntity type="specificcountry">freeSpecificcountryDefault</requiredEntity> @@ -44,6 +45,9 @@ <entity name="freeShippingSubtotalDefault" type="free_shipping_subtotal"> <data key="value" /> </entity> + <entity name="TaxIncludingDefault" type="tax_including"> + <data key="value">0</data> + </entity> <entity name="freeSpecificerrmsgDefault" type="specificerrmsg"> <data key="value">This shipping method is not available. To use this shipping method, please contact us.</data> </entity> @@ -66,6 +70,17 @@ <entity name="freeShippingSubtotal" type="free_shipping_subtotal"> <data key="value">101</data> </entity> + <!--Set Free Shipping "Include Tax to Amount" to "Yes"--> + <entity name="SetTaxIncluding" type="free_shipping_method"> + <requiredEntity type="tax_including">TaxIncluding</requiredEntity> + </entity> + <entity name="TaxIncluding" type="tax_including"> + <data key="value">1</data> + </entity> + <!--Set to default Free Shipping "Include Tax to Amount"--> + <entity name="SetTaxIncludingToDefault" type="free_shipping_method"> + <requiredEntity type="tax_including">TaxIncludingDefault</requiredEntity> + </entity> <!--Set to default Free Shipping Subtotal--> <entity name="setFreeShippingSubtotalToDefault" type="free_shipping_method"> <requiredEntity type="free_shipping_subtotal">freeShippingSubtotalDefault</requiredEntity> diff --git a/app/code/Magento/Shipping/Test/Mftf/Metadata/shipping_methods-meta.xml b/app/code/Magento/Shipping/Test/Mftf/Metadata/shipping_methods-meta.xml index 5781b886386f6..14c0d6d5af725 100644 --- a/app/code/Magento/Shipping/Test/Mftf/Metadata/shipping_methods-meta.xml +++ b/app/code/Magento/Shipping/Test/Mftf/Metadata/shipping_methods-meta.xml @@ -66,6 +66,9 @@ <object key="free_shipping_subtotal" dataType="free_shipping_subtotal"> <field key="value">string</field> </object> + <object key="tax_including" dataType="tax_including"> + <field key="value">boolean</field> + </object> <object key="specificerrmsg" dataType="specificerrmsg"> <field key="value">string</field> </object> diff --git a/app/code/Magento/Tax/Model/Sales/Total/Quote/CommonTaxCollector.php b/app/code/Magento/Tax/Model/Sales/Total/Quote/CommonTaxCollector.php index 77b3cfa3a08bb..c70c715d32c1b 100644 --- a/app/code/Magento/Tax/Model/Sales/Total/Quote/CommonTaxCollector.php +++ b/app/code/Magento/Tax/Model/Sales/Total/Quote/CommonTaxCollector.php @@ -383,6 +383,7 @@ public function mapItems( $priceIncludesTax, $useBaseCurrency ); + //phpcs:ignore Magento2.Performance.ForeachArrayMerge $itemDataObjects = array_merge($itemDataObjects, $extraTaxableItems); } } else { @@ -394,6 +395,7 @@ public function mapItems( $priceIncludesTax, $useBaseCurrency ); + //phpcs:ignore Magento2.Performance.ForeachArrayMerge $itemDataObjects = array_merge($itemDataObjects, $extraTaxableItems); } } @@ -592,6 +594,7 @@ protected function processProductItems( $total->setBaseSubtotalTotalInclTax($baseSubtotalInclTax); $total->setBaseSubtotalInclTax($baseSubtotalInclTax); $shippingAssignment->getShipping()->getAddress()->setBaseSubtotalTotalInclTax($baseSubtotalInclTax); + $shippingAssignment->getShipping()->getAddress()->setBaseTaxAmount($baseTax); return $this; } @@ -799,6 +802,7 @@ public function convertAppliedTaxes($appliedTaxes, $baseAppliedTaxes, $extraInfo 'rates' => $rates, ]; if (!empty($extraInfo)) { + //phpcs:ignore Magento2.Performance.ForeachArrayMerge $appliedTaxArray = array_merge($appliedTaxArray, $extraInfo); } From f5a7ac98dadb79e5c994fee06a5e03b8346e1671 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Thu, 3 Oct 2019 16:02:55 +0300 Subject: [PATCH 026/586] MC-5233: DateTime product attributes support --- .../Product/Attribute/Edit/Tab/Advanced.php | 50 +++++- .../Product/Attribute/Edit/Tab/Main.php | 112 +++++++++----- .../Attribute/Edit/Tab/AdvancedTest.php | 104 ++++++++++--- .../Unit/Ui/Component/ColumnFactoryTest.php | 143 ++++++++++++++++-- .../Product/Form/Modifier/EavTest.php | 100 +++++++----- .../Catalog/Ui/Component/ColumnFactory.php | 72 +++++++-- .../Catalog/Ui/Component/Listing/Columns.php | 5 +- .../Product/Form/Modifier/Eav.php | 16 ++ app/code/Magento/Catalog/etc/adminhtml/di.xml | 17 +++ app/code/Magento/Catalog/etc/config.xml | 7 + .../catalog/product/attribute/js.phtml | 1 + .../product_attribute_add_form.xml | 26 ++++ .../Magento/Eav/Model/Entity/Attribute.php | 37 ++++- .../Entity/Attribute/Frontend/Datetime.php | 6 +- .../Attribute/Frontend/DatetimeTest.php | 62 ++++++-- .../Test/Unit/Model/Entity/AttributeTest.php | 2 + .../adminhtml/web/js/product-attributes.js | 8 + app/code/Magento/Ui/Component/Filters.php | 3 + .../Ui/Component/Filters/Type/Date.php | 47 ++++-- .../Component/Form/Element/DataType/Date.php | 24 ++- .../Unit/Component/Filters/Type/DateTest.php | 113 +++++++++----- .../Ui/Test/Unit/Component/FiltersTest.php | 47 ++++-- .../Form/Element/DataType/DateTest.php | 69 ++++++++- .../Ui/view/base/web/js/form/element/date.js | 7 + .../Ui/view/base/web/js/grid/columns/date.js | 17 ++- .../view/base/web/js/grid/filters/filters.js | 4 + .../Ui/view/base/web/js/grid/filters/range.js | 8 + 27 files changed, 872 insertions(+), 235 deletions(-) diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php index 1b6756968662f..89239a2e3e608 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php @@ -7,16 +7,20 @@ namespace Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab; use Magento\Backend\Block\Widget\Form\Generic; +use Magento\Catalog\Model\ResourceModel\Eav\Attribute; use Magento\Config\Model\Config\Source\Yesno; use Magento\Eav\Block\Adminhtml\Attribute\PropertyLocker; use Magento\Eav\Helper\Data; use Magento\Framework\App\ObjectManager; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Stdlib\DateTime; /** - * Product attribute add/edit form main tab + * Product attribute add/edit advanced form tab * * @api * @since 100.0.2 + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class Advanced extends Generic { @@ -70,7 +74,7 @@ public function __construct( * Adding product form elements for editing attribute * * @return $this - * @throws \Magento\Framework\Exception\LocalizedException + * @throws LocalizedException * @SuppressWarnings(PHPMD) */ protected function _prepareForm() @@ -139,7 +143,21 @@ protected function _prepareForm() 'label' => __('Default Value'), 'title' => __('Default Value'), 'value' => $attributeObject->getDefaultValue(), - 'date_format' => $dateFormat + 'date_format' => $dateFormat, + ] + ); + + $timeFormat = $this->_localeDate->getTimeFormat(\IntlDateFormatter::SHORT); + $fieldset->addField( + 'default_value_datetime', + 'date', + [ + 'name' => 'default_value_datetime', + 'label' => __('Default Value'), + 'title' => __('Default Value'), + 'value' => $this->getLocalizedDateDefaultValue(), + 'date_format' => $dateFormat, + 'time_format' => $timeFormat, ] ); @@ -266,7 +284,7 @@ protected function _initFormValues() /** * Retrieve attribute object from registry * - * @return mixed + * @return Attribute */ private function getAttributeObject() { @@ -285,4 +303,28 @@ private function getPropertyLocker() } return $this->propertyLocker; } + + /** + * Get localized date default value + * + * @return string + * @throws LocalizedException + */ + private function getLocalizedDateDefaultValue(): string + { + $attributeObject = $this->getAttributeObject(); + if (empty($attributeObject->getDefaultValue()) || $attributeObject->getFrontendInput() !== 'datetime') { + return (string)$attributeObject->getDefaultValue(); + } + + try { + $localizedDate = $this->_localeDate->date($attributeObject->getDefaultValue(), null, false); + $localizedDate->setTimezone(new \DateTimeZone($this->_localeDate->getConfigTimezone())); + $localizedDate = $localizedDate->format(DateTime::DATETIME_PHP_FORMAT); + } catch (\Exception $e) { + throw new LocalizedException(__('The default date is invalid.')); + } + + return $localizedDate; + } } diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Main.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Main.php index 85cf37a1214b5..ddc7273432cb3 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Main.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Main.php @@ -7,60 +7,60 @@ /** * Product attribute add/edit form main tab * - * @author Magento Core Team <core@magentocommerce.com> + * @author Magento Core Team <core@magentocommerce.com> */ namespace Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab; +use Magento\Catalog\Block\Adminhtml\Product\Helper\Form\Apply as HelperApply; use Magento\Eav\Block\Adminhtml\Attribute\Edit\Main\AbstractMain; +use Magento\Framework\Data\Form\Element\AbstractElement; +use Magento\Framework\Data\Form\Element\Fieldset; +use Magento\Framework\DataObject; /** + * Product attribute add/edit form main tab + * * @api - * @SuppressWarnings(PHPMD.DepthOfInheritance) * @since 100.0.2 */ class Main extends AbstractMain { /** - * Adding product form elements for editing attribute - * - * @return $this - * @SuppressWarnings(PHPMD.UnusedLocalVariable) + * @inheritdoc */ protected function _prepareForm() { parent::_prepareForm(); - /** @var \Magento\Catalog\Model\ResourceModel\Eav\Attribute $attributeObject */ - $attributeObject = $this->getAttributeObject(); - /* @var $form \Magento\Framework\Data\Form */ - $form = $this->getForm(); - /* @var $fieldset \Magento\Framework\Data\Form\Element\Fieldset */ - $fieldset = $form->getElement('base_fieldset'); - $fieldsToRemove = ['attribute_code', 'is_unique', 'frontend_class']; - foreach ($fieldset->getElements() as $element) { - /** @var \Magento\Framework\Data\Form\AbstractForm $element */ - if (substr($element->getId(), 0, strlen('default_value')) == 'default_value') { - $fieldsToRemove[] = $element->getId(); - } - } - foreach ($fieldsToRemove as $id) { - $fieldset->removeField($id); - } + $this->removeUnusedFields(); + $this->processFrontendInputTypes(); + + $this->_eventManager->dispatch('product_attribute_form_build_main_tab', ['form' => $this->getForm()]); + + return $this; + } + /** + * @inheritdoc + */ + protected function _getAdditionalElementTypes() + { + return ['apply' => HelperApply::class]; + } + + /** + * Process frontend input types for product attributes + * + * @return void + */ + private function processFrontendInputTypes(): void + { + $form = $this->getForm(); + /** @var AbstractElement $frontendInputElm */ $frontendInputElm = $form->getElement('frontend_input'); - $additionalTypes = [ - ['value' => 'price', 'label' => __('Price')], - ['value' => 'media_image', 'label' => __('Media Image')], - ]; - $additionalReadOnlyTypes = ['gallery' => __('Gallery')]; - if (isset($additionalReadOnlyTypes[$attributeObject->getFrontendInput()])) { - $additionalTypes[] = [ - 'value' => $attributeObject->getFrontendInput(), - 'label' => $additionalReadOnlyTypes[$attributeObject->getFrontendInput()], - ]; - } + $additionalTypes = $this->getAdditionalFrontendInputTypes(); - $response = new \Magento\Framework\DataObject(); + $response = new DataObject(); $response->setTypes([]); $this->_eventManager->dispatch('adminhtml_product_attribute_types', ['response' => $response]); $_hiddenFields = []; @@ -74,19 +74,51 @@ protected function _prepareForm() $frontendInputValues = array_merge($frontendInputElm->getValues(), $additionalTypes); $frontendInputElm->setValues($frontendInputValues); + } - $this->_eventManager->dispatch('product_attribute_form_build_main_tab', ['form' => $form]); + /** + * Get additional Frontend Input Types for product attributes + * + * @return array + */ + private function getAdditionalFrontendInputTypes(): array + { + $additionalTypes = [ + ['value' => 'price', 'label' => __('Price')], + ['value' => 'media_image', 'label' => __('Media Image')], + ]; - return $this; + $additionalReadOnlyTypes = ['gallery' => __('Gallery')]; + $attributeObject = $this->getAttributeObject(); + if (isset($additionalReadOnlyTypes[$attributeObject->getFrontendInput()])) { + $additionalTypes[] = [ + 'value' => $attributeObject->getFrontendInput(), + 'label' => $additionalReadOnlyTypes[$attributeObject->getFrontendInput()], + ]; + } + + return $additionalTypes; } /** - * Retrieve additional element types for product attributes + * Remove unused form fields * - * @return array + * @return void */ - protected function _getAdditionalElementTypes() + private function removeUnusedFields(): void { - return ['apply' => \Magento\Catalog\Block\Adminhtml\Product\Helper\Form\Apply::class]; + $form = $this->getForm(); + /* @var $fieldset Fieldset */ + $fieldset = $form->getElement('base_fieldset'); + $fieldsToRemove = ['attribute_code', 'is_unique', 'frontend_class']; + foreach ($fieldset->getElements() as $element) { + /** @var AbstractElement $element */ + if (substr($element->getId(), 0, strlen('default_value')) == 'default_value') { + $fieldsToRemove[] = $element->getId(); + } + } + foreach ($fieldsToRemove as $id) { + $fieldset->removeField($id); + } } } diff --git a/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Attribute/Edit/Tab/AdvancedTest.php b/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Attribute/Edit/Tab/AdvancedTest.php index 0352bc83cafb7..4d9345d0b3f22 100644 --- a/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Attribute/Edit/Tab/AdvancedTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Attribute/Edit/Tab/AdvancedTest.php @@ -5,66 +5,87 @@ */ namespace Magento\Catalog\Test\Unit\Block\Adminhtml\Product\Attribute\Edit\Tab; +use Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab\Advanced; +use Magento\Catalog\Model\ResourceModel\Eav\Attribute; +use Magento\Config\Model\Config\Source\Yesno; use Magento\Eav\Block\Adminhtml\Attribute\PropertyLocker; +use Magento\Eav\Helper\Data as EavHelper; +use Magento\Eav\Model\Entity\Type as EntityType; +use Magento\Framework\Data\Form; +use Magento\Framework\Data\Form\Element\Fieldset; +use Magento\Framework\Data\Form\Element\Text; +use Magento\Framework\Data\FormFactory; +use Magento\Framework\Filesystem; +use Magento\Framework\Filesystem\Directory\ReadInterface; +use Magento\Framework\Registry; +use Magento\Framework\Stdlib\DateTime; +use Magento\Framework\Stdlib\DateTime\TimezoneInterface; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use PHPUnit\Framework\MockObject\MockObject; /** + * Test product attribute add/edit advanced form tab + * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class AdvancedTest extends \PHPUnit\Framework\TestCase { /** - * @var \Magento\Catalog\Block\Adminhtml\Product\Attribute\Grid + * @var Advanced */ protected $block; /** - * @var \Magento\Framework\Data\FormFactory|\PHPUnit_Framework_MockObject_MockObject + * @var FormFactory|MockObject */ protected $formFactory; /** - * @var \Magento\Framework\Registry|\PHPUnit_Framework_MockObject_MockObject + * @var Registry|MockObject */ protected $registry; /** - * @var \Magento\Framework\Stdlib\DateTime\TimezoneInterface|\PHPUnit_Framework_MockObject_MockObject + * @var TimezoneInterface|MockObject */ protected $localeDate; /** - * @var \Magento\Config\Model\Config\Source\Yesno|\PHPUnit_Framework_MockObject_MockObject + * @var Yesno|MockObject */ protected $yesNo; /** - * @var \Magento\Eav\Helper\Data|\PHPUnit_Framework_MockObject_MockObject + * @var EavHelper|MockObject */ protected $eavData; /** - * @var \Magento\Framework\Filesystem|\PHPUnit_Framework_MockObject_MockObject + * @var Filesystem|MockObject */ protected $filesystem; /** - * @var PropertyLocker|\PHPUnit_Framework_MockObject_MockObject + * @var PropertyLocker|MockObject */ protected $propertyLocker; + /** + * @inheritdoc + */ protected function setUp() { - $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - $this->registry = $this->createMock(\Magento\Framework\Registry::class); - $this->formFactory = $this->createMock(\Magento\Framework\Data\FormFactory::class); - $this->yesNo = $this->createMock(\Magento\Config\Model\Config\Source\Yesno::class); - $this->localeDate = $this->createMock(\Magento\Framework\Stdlib\DateTime\TimezoneInterface::class); - $this->eavData = $this->createMock(\Magento\Eav\Helper\Data::class); - $this->filesystem = $this->createMock(\Magento\Framework\Filesystem::class); + $objectManager = new ObjectManager($this); + $this->registry = $this->createMock(Registry::class); + $this->formFactory = $this->createMock(FormFactory::class); + $this->yesNo = $this->createMock(Yesno::class); + $this->localeDate = $this->createMock(TimezoneInterface::class); + $this->eavData = $this->createMock(EavHelper::class); + $this->filesystem = $this->createMock(Filesystem::class); $this->propertyLocker = $this->createMock(PropertyLocker::class); $this->block = $objectManager->getObject( - \Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab\Advanced::class, + Advanced::class, [ 'registry' => $this->registry, 'formFactory' => $this->formFactory, @@ -77,17 +98,35 @@ protected function setUp() ); } + /** + * Test the block's html output + */ public function testToHtml() { - $fieldSet = $this->createMock(\Magento\Framework\Data\Form\Element\Fieldset::class); - $form = $this->createMock(\Magento\Framework\Data\Form::class); + $defaultValue = 'default_value'; + $localizedDefaultValue = 'localized_default_value'; + $frontendInput = 'datetime'; + $dateFormat = 'mm/dd/yy'; + $timeFormat = 'H:i:s:'; + $timeZone = 'America/Chicago'; + + $fieldSet = $this->createMock(Fieldset::class); + $form = $this->createMock(Form::class); $attributeModel = $this->createPartialMock( - \Magento\Catalog\Model\ResourceModel\Eav\Attribute::class, - ['getDefaultValue', 'setDisabled', 'getId', 'getEntityType', 'getIsUserDefined', 'getAttributeCode'] + Attribute::class, + [ + 'getDefaultValue', + 'setDisabled', + 'getId', + 'getEntityType', + 'getIsUserDefined', + 'getAttributeCode', + 'getFrontendInput' + ] ); - $entityType = $this->createMock(\Magento\Eav\Model\Entity\Type::class); - $formElement = $this->createPartialMock(\Magento\Framework\Data\Form\Element\Text::class, ['setDisabled']); - $directoryReadInterface = $this->createMock(\Magento\Framework\Filesystem\Directory\ReadInterface::class); + $entityType = $this->createMock(EntityType::class); + $formElement = $this->createPartialMock(Text::class, ['setDisabled']); + $directoryReadInterface = $this->createMock(ReadInterface::class); $this->registry->expects($this->any())->method('registry')->with('entity_attribute') ->willReturn($attributeModel); @@ -95,13 +134,28 @@ public function testToHtml() $form->expects($this->any())->method('addFieldset')->willReturn($fieldSet); $form->expects($this->any())->method('getElement')->willReturn($formElement); $fieldSet->expects($this->any())->method('addField')->willReturnSelf(); - $attributeModel->expects($this->any())->method('getDefaultValue')->willReturn('default_value'); + $attributeModel->expects($this->any())->method('getDefaultValue')->willReturn($defaultValue); $attributeModel->expects($this->any())->method('setDisabled')->willReturnSelf(); $attributeModel->expects($this->any())->method('getId')->willReturn(1); $attributeModel->expects($this->any())->method('getEntityType')->willReturn($entityType); $attributeModel->expects($this->any())->method('getIsUserDefined')->willReturn(false); $attributeModel->expects($this->any())->method('getAttributeCode')->willReturn('attribute_code'); - $this->localeDate->expects($this->any())->method('getDateFormat')->willReturn('mm/dd/yy'); + $attributeModel->expects($this->any())->method('getFrontendInput')->willReturn($frontendInput); + + $dateTimeMock = $this->createMock(\DateTime::class); + $dateTimeMock->expects($this->once())->method('setTimezone')->with(new \DateTimeZone($timeZone)); + $dateTimeMock->expects($this->once()) + ->method('format') + ->with(DateTime::DATETIME_PHP_FORMAT) + ->willReturn($localizedDefaultValue); + $this->localeDate->expects($this->any())->method('getDateFormat')->willReturn($dateFormat); + $this->localeDate->expects($this->any())->method('getTimeFormat')->willReturn($timeFormat); + $this->localeDate->expects($this->once())->method('getConfigTimezone')->willReturn($timeZone); + $this->localeDate->expects($this->once()) + ->method('date') + ->with($defaultValue, null, false) + ->willReturn($dateTimeMock); + $entityType->expects($this->any())->method('getEntityTypeCode')->willReturn('entity_type_code'); $this->eavData->expects($this->any())->method('getFrontendClasses')->willReturn([]); $formElement->expects($this->exactly(2))->method('setDisabled')->willReturnSelf(); diff --git a/app/code/Magento/Catalog/Test/Unit/Ui/Component/ColumnFactoryTest.php b/app/code/Magento/Catalog/Test/Unit/Ui/Component/ColumnFactoryTest.php index 774edcfeb6b64..f002173de7996 100644 --- a/app/code/Magento/Catalog/Test/Unit/Ui/Component/ColumnFactoryTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Ui/Component/ColumnFactoryTest.php @@ -7,14 +7,16 @@ namespace Magento\Catalog\Test\Unit\Ui\Component; -use PHPUnit\Framework\TestCase; +use Magento\Catalog\Model\ResourceModel\Eav\Attribute; use Magento\Catalog\Ui\Component\ColumnFactory; +use Magento\Framework\Stdlib\DateTime\TimezoneInterface; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; -use Magento\Catalog\Api\Data\ProductAttributeInterface; use Magento\Framework\View\Element\UiComponent\ContextInterface; use Magento\Framework\View\Element\UiComponentFactory; use Magento\Ui\Component\Listing\Columns\ColumnInterface; use Magento\Ui\Component\Filters\FilterModifier; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; /** * ColumnFactory test. @@ -32,25 +34,30 @@ class ColumnFactoryTest extends TestCase private $objectManager; /** - * @var ProductAttributeInterface|\PHPUnit\Framework\MockObject\MockObject + * @var Attribute|MockObject */ private $attribute; /** - * @var ContextInterface|\PHPUnit\Framework\MockObject\MockObject + * @var ContextInterface|MockObject */ private $context; /** - * @var UiComponentFactory|\PHPUnit\Framework\MockObject\MockObject + * @var UiComponentFactory|MockObject */ private $uiComponentFactory; /** - * @var ColumnInterface|\PHPUnit\Framework\MockObject\MockObject + * @var ColumnInterface|MockObject */ private $column; + /** + * @var TimezoneInterface|MockObject + */ + private $timeZone; + /** * @inheritdoc */ @@ -58,18 +65,30 @@ protected function setUp(): void { $this->objectManager = new ObjectManager($this); - $this->attribute = $this->getMockBuilder(ProductAttributeInterface::class) - ->setMethods(['usesSource']) - ->getMockForAbstractClass(); + $this->attribute = $this->createPartialMock( + Attribute::class, + [ + 'getAttributeCode', + 'getIsFilterableInGrid', + 'getFrontendInput', + 'getDefaultFrontendLabel', + 'getIsVisibleInGrid', + ] + ); $this->context = $this->createMock(ContextInterface::class); $this->uiComponentFactory = $this->createMock(UiComponentFactory::class); $this->column = $this->getMockForAbstractClass(ColumnInterface::class); $this->uiComponentFactory->method('create') ->willReturn($this->column); + $this->timeZone = $this->createMock(TimezoneInterface::class); - $this->columnFactory = $this->objectManager->getObject(ColumnFactory::class, [ - 'componentFactory' => $this->uiComponentFactory - ]); + $this->columnFactory = $this->objectManager->getObject( + ColumnFactory::class, + [ + 'componentFactory' => $this->uiComponentFactory, + 'timezone' => $this->timeZone, + ] + ); } /** @@ -96,7 +115,6 @@ public function testCreatedObject(): void * * @param array $filterModifiers * @param null|string $filter - * * @return void * @dataProvider filterModifiersProvider */ @@ -132,7 +150,7 @@ public function testCreateWithNotFilterableInGridAttribute(array $filterModifier } /** - * Filter modifiers data provider. + * Filter modifiers data provider * * @return array */ @@ -153,4 +171,101 @@ public function filterModifiersProvider(): array ], ]; } + + /** + * Test to create date column + * + * @param string $frontendInput + * @param bool $showsTime + * @param string $expectedDateFormat + * @param string $expectedTimezone + * @dataProvider createDateColumnDataProvider + */ + public function testCreateDateColumn( + string $frontendInput, + bool $showsTime, + string $expectedDateFormat, + string $expectedTimezone + ) { + $attributeCode = 'attribute_code'; + $dateFormat = 'date_format'; + $dateTimeFormat = 'datetime_format'; + $defaultTimezone = 'default_timezone'; + $configTimezone = 'config_timezone'; + $label = 'Date label'; + + $expectedConfig = [ + 'data' => [ + 'config' => [ + 'label' => __($label), + 'dataType' => 'date', + 'add_field' => true, + 'visible' => true, + 'filter' => 'dateRange', + 'component' => 'Magento_Ui/js/grid/columns/date', + 'timeZone' => $expectedTimezone, + 'dateFormat' => $expectedDateFormat, + 'options' => [ + 'showsTime' => $showsTime + ] + ], + ], + 'context' => $this->context, + ]; + + $this->attribute->method('getAttributeCode') + ->willReturn($attributeCode); + $this->attribute->method('getDefaultFrontendLabel') + ->willReturn($label); + $this->attribute->method('getIsFilterableInGrid') + ->willReturn(true); + $this->attribute->method('getIsVisibleInGrid') + ->willReturn(true); + $this->attribute->method('getFrontendInput') + ->willReturn($frontendInput); + + $this->timeZone->method('getDateFormat') + ->with(\IntlDateFormatter::MEDIUM) + ->willReturn($dateFormat); + $this->timeZone->method('getDateTimeFormat') + ->with(\IntlDateFormatter::MEDIUM) + ->willReturn($dateTimeFormat); + $this->timeZone->method('getDefaultTimezone') + ->willReturn($defaultTimezone); + $this->timeZone->method('getConfigTimezone') + ->willReturn($configTimezone); + + $this->uiComponentFactory->expects($this->once()) + ->method('create') + ->with($attributeCode, 'column', $expectedConfig) + ->willReturn($this->column); + + $this->assertEquals( + $this->column, + $this->columnFactory->create($this->attribute, $this->context) + ); + } + + /** + * Data provider to create date column test + * + * @return array + */ + public function createDateColumnDataProvider(): array + { + return [ + [ + 'frontendInput' => 'date', + 'showsTime' => false, + 'dateFormat' => 'date_format', + 'expectedTimezone' => 'default_timezone', + ], + [ + 'frontendInput' => 'datetime', + 'showsTime' => true, + 'expectedDateFormat' => 'datetime_format', + 'expectedTimezone' => 'config_timezone', + ], + ]; + } } diff --git a/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/EavTest.php b/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/EavTest.php index 88075b13f1430..834cb505e0903 100644 --- a/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/EavTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/EavTest.php @@ -38,6 +38,7 @@ use Magento\Framework\Stdlib\ArrayManager; use Magento\Catalog\Model\ResourceModel\Eav\AttributeFactory as EavAttributeFactory; use Magento\Framework\Event\ManagerInterface; +use PHPUnit\Framework\MockObject\MockObject; /** * Class EavTest @@ -49,142 +50,142 @@ class EavTest extends AbstractModifierTest { /** - * @var Config|\PHPUnit_Framework_MockObject_MockObject + * @var Config|MockObject */ private $eavConfigMock; /** - * @var EavValidationRules|\PHPUnit_Framework_MockObject_MockObject + * @var EavValidationRules|MockObject */ private $eavValidationRulesMock; /** - * @var RequestInterface|\PHPUnit_Framework_MockObject_MockObject + * @var RequestInterface|MockObject */ private $requestMock; /** - * @var GroupCollectionFactory|\PHPUnit_Framework_MockObject_MockObject + * @var GroupCollectionFactory|MockObject */ private $groupCollectionFactoryMock; /** - * @var GroupCollection|\PHPUnit_Framework_MockObject_MockObject + * @var GroupCollection|MockObject */ private $groupCollectionMock; /** - * @var Group|\PHPUnit_Framework_MockObject_MockObject + * @var Group|MockObject */ private $groupMock; /** - * @var EavAttribute|\PHPUnit_Framework_MockObject_MockObject + * @var EavAttribute|MockObject */ private $attributeMock; /** - * @var EntityType|\PHPUnit_Framework_MockObject_MockObject + * @var EntityType|MockObject */ private $entityTypeMock; /** - * @var AttributeCollectionFactory|\PHPUnit_Framework_MockObject_MockObject + * @var AttributeCollectionFactory|MockObject */ private $attributeCollectionFactoryMock; /** - * @var AttributeCollection|\PHPUnit_Framework_MockObject_MockObject + * @var AttributeCollection|MockObject */ private $attributeCollectionMock; /** - * @var StoreManagerInterface|\PHPUnit_Framework_MockObject_MockObject + * @var StoreManagerInterface|MockObject */ private $storeManagerMock; /** - * @var FormElementMapper|\PHPUnit_Framework_MockObject_MockObject + * @var FormElementMapper|MockObject */ private $formElementMapperMock; /** - * @var MetaPropertiesMapper|\PHPUnit_Framework_MockObject_MockObject + * @var MetaPropertiesMapper|MockObject */ private $metaPropertiesMapperMock; /** - * @var SearchCriteriaBuilder|\PHPUnit_Framework_MockObject_MockObject + * @var SearchCriteriaBuilder|MockObject */ private $searchCriteriaBuilderMock; /** - * @var ProductAttributeGroupRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject + * @var ProductAttributeGroupRepositoryInterface|MockObject */ private $attributeGroupRepositoryMock; /** - * @var SearchCriteria|\PHPUnit_Framework_MockObject_MockObject + * @var SearchCriteria|MockObject */ private $searchCriteriaMock; /** - * @var SortOrderBuilder|\PHPUnit_Framework_MockObject_MockObject + * @var SortOrderBuilder|MockObject */ private $sortOrderBuilderMock; /** - * @var ProductAttributeRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject + * @var ProductAttributeRepositoryInterface|MockObject */ private $attributeRepositoryMock; /** - * @var AttributeGroupInterface|\PHPUnit_Framework_MockObject_MockObject + * @var AttributeGroupInterface|MockObject */ private $attributeGroupMock; /** - * @var SearchResultsInterface|\PHPUnit_Framework_MockObject_MockObject + * @var SearchResultsInterface|MockObject */ private $searchResultsMock; /** - * @var Attribute|\PHPUnit_Framework_MockObject_MockObject + * @var Attribute|MockObject */ private $eavAttributeMock; /** - * @var StoreInterface|\PHPUnit_Framework_MockObject_MockObject + * @var StoreInterface|MockObject */ protected $storeMock; /** - * @var Currency|\PHPUnit_Framework_MockObject_MockObject + * @var Currency|MockObject */ protected $currencyMock; /** - * @var CurrencyLocale|\PHPUnit_Framework_MockObject_MockObject + * @var CurrencyLocale|MockObject */ protected $currencyLocaleMock; /** - * @var ProductAttributeInterface|\PHPUnit_Framework_MockObject_MockObject + * @var ProductAttributeInterface|MockObject */ protected $productAttributeMock; /** - * @var ArrayManager|\PHPUnit_Framework_MockObject_MockObject + * @var ArrayManager|MockObject */ protected $arrayManagerMock; /** - * @var EavAttributeFactory|\PHPUnit_Framework_MockObject_MockObject + * @var EavAttributeFactory|MockObject */ protected $eavAttributeFactoryMock; /** - * @var ManagerInterface|\PHPUnit_Framework_MockObject_MockObject + * @var ManagerInterface|MockObject */ protected $eventManagerMock; @@ -457,8 +458,10 @@ public function testModifyData() * @param string|null $attrValue * @param array $expected * @param bool $locked - * @covers \Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Eav::isProductExists - * @covers \Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Eav::setupAttributeMeta + * @param string|null $frontendInput + * @param array $expectedCustomize + * @covers \Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Eav::isProductExists + * @covers \Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Eav::setupAttributeMeta * @dataProvider setupAttributeMetaDataProvider */ public function testSetupAttributeMetaDefaultAttribute( @@ -466,7 +469,9 @@ public function testSetupAttributeMetaDefaultAttribute( bool $productRequired, $attrValue, array $expected, - $locked = false + bool $locked = false, + string $frontendInput = null, + array $expectedCustomize = [] ) : void { $configPath = 'arguments/data/config'; $groupCode = 'product-details'; @@ -492,6 +497,7 @@ public function testSetupAttributeMetaDefaultAttribute( $this->productAttributeMock->method('getDefaultValue')->willReturn('required_value'); $this->productAttributeMock->method('getAttributeCode')->willReturn('code'); $this->productAttributeMock->method('getValue')->willReturn('value'); + $this->productAttributeMock->method('getFrontendInput')->willReturn($frontendInput); $attributeMock = $this->getMockBuilder(AttributeInterface::class) ->setMethods(['getValue']) @@ -527,14 +533,16 @@ function ($value) use ($attributeOptionsExpected) { } ) ) - ->willReturn($expected); + ->willReturn($expected + $expectedCustomize); $this->arrayManagerMock->method('get')->willReturn([]); $this->arrayManagerMock->method('exists')->willReturn(true); + $actual = $this->eav->setupAttributeMeta($this->productAttributeMock, $groupCode, $sortOrder); + $this->assertEquals( - $expected, - $this->eav->setupAttributeMeta($this->productAttributeMock, $groupCode, $sortOrder) + $expected + $expectedCustomize, + $actual ); } @@ -660,7 +668,29 @@ public function setupAttributeMetaDataProvider() 'globalScope' => false, 'sortOrder' => 0, ], - ] + ], + 'datetime_null_prod_not_new_and_required' => [ + 'productId' => 1, + 'productRequired' => true, + 'attrValue' => 'val', + 'expected' => [ + 'dataType' => 'datetime', + 'formElement' => 'datetime', + 'visible' => null, + 'required' => true, + 'notice' => null, + 'default' => null, + 'label' => new Phrase(null), + 'code' => 'code', + 'source' => 'product-details', + 'scopeLabel' => '', + 'globalScope' => false, + 'sortOrder' => 0, + ], + 'locked' => false, + 'frontendInput' => 'datetime', + 'expectedCustomize' => ['arguments' => ['data' => ['config' => ['options' => ['showsTime' => 1]]]]], + ], ]; } } diff --git a/app/code/Magento/Catalog/Ui/Component/ColumnFactory.php b/app/code/Magento/Catalog/Ui/Component/ColumnFactory.php index 9a6a22fcb0985..c538273476b1f 100644 --- a/app/code/Magento/Catalog/Ui/Component/ColumnFactory.php +++ b/app/code/Magento/Catalog/Ui/Component/ColumnFactory.php @@ -5,7 +5,14 @@ */ namespace Magento\Catalog\Ui\Component; +use Magento\Catalog\Api\Data\ProductAttributeInterface; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Stdlib\DateTime\TimezoneInterface; +use Magento\Framework\View\Element\UiComponent\ContextInterface; +use Magento\Framework\View\Element\UiComponentFactory; use Magento\Ui\Component\Filters\FilterModifier; +use Magento\Ui\Component\Listing\Columns\ColumnInterface; /** * Column Factory @@ -16,7 +23,7 @@ class ColumnFactory { /** - * @var \Magento\Framework\View\Element\UiComponentFactory + * @var UiComponentFactory */ protected $componentFactory; @@ -40,25 +47,36 @@ class ColumnFactory 'select' => 'select', 'multiselect' => 'multiselect', 'date' => 'date', + 'datetime' => 'date', ]; /** - * @param \Magento\Framework\View\Element\UiComponentFactory $componentFactory + * @var TimezoneInterface */ - public function __construct(\Magento\Framework\View\Element\UiComponentFactory $componentFactory) - { + private $timezone; + + /** + * @param UiComponentFactory $componentFactory + * @param TimezoneInterface|null $timezone + */ + public function __construct( + UiComponentFactory $componentFactory, + TimezoneInterface $timezone = null + ) { $this->componentFactory = $componentFactory; + $this->timezone = $timezone + ?? ObjectManager::getInstance()->get(TimezoneInterface::class); } /** * Create Factory * - * @param \Magento\Catalog\Api\Data\ProductAttributeInterface $attribute - * @param \Magento\Framework\View\Element\UiComponent\ContextInterface $context + * @param ProductAttributeInterface $attribute + * @param ContextInterface $context * @param array $config * - * @return \Magento\Ui\Component\Listing\Columns\ColumnInterface - * @throws \Magento\Framework\Exception\LocalizedException + * @return ColumnInterface + * @throws LocalizedException */ public function create($attribute, $context, array $config = []) { @@ -84,19 +102,46 @@ public function create($attribute, $context, array $config = []) $optionData['__disableTmpl'] = true; } } - + $config['component'] = $this->getJsComponent($config['dataType']); - + + if ($config['dataType'] === 'date') { + $config += $this->getDateConfig($attribute); + } + $arguments = [ 'data' => [ 'config' => $config, ], 'context' => $context, ]; - + return $this->componentFactory->create($columnName, 'column', $arguments); } + /** + * Get config for Date columns + * + * @param ProductAttributeInterface $attribute + * @return array + */ + private function getDateConfig(ProductAttributeInterface $attribute): array + { + $isDatetime = $attribute->getFrontendInput() === 'datetime'; + $dateFormat = $isDatetime + ? $this->timezone->getDateTimeFormat(\IntlDateFormatter::MEDIUM) + : $this->timezone->getDateFormat(\IntlDateFormatter::MEDIUM); + $timeZone = $isDatetime + ? $this->timezone->getConfigTimezone() + : $this->timezone->getDefaultTimezone(); + + return [ + 'timeZone' => $timeZone, + 'dateFormat' => $dateFormat, + 'options' => [ 'showsTime' => $isDatetime], + ]; + } + /** * Get Js Component * @@ -112,7 +157,7 @@ protected function getJsComponent($dataType) /** * Get Data Type * - * @param \Magento\Catalog\Api\Data\ProductAttributeInterface $attribute + * @param ProductAttributeInterface $attribute * * @return string */ @@ -129,8 +174,9 @@ protected function getDataType($attribute) */ protected function getFilterType($frontendInput) { - $filtersMap = ['date' => 'dateRange']; + $filtersMap = ['date' => 'dateRange', 'datetime' => 'dateRange']; $result = array_replace_recursive($this->dataTypeMap, $filtersMap); + return $result[$frontendInput] ?? $result['default']; } } diff --git a/app/code/Magento/Catalog/Ui/Component/Listing/Columns.php b/app/code/Magento/Catalog/Ui/Component/Listing/Columns.php index 8ea6d8b9e5a06..d7b9bc3846f49 100644 --- a/app/code/Magento/Catalog/Ui/Component/Listing/Columns.php +++ b/app/code/Magento/Catalog/Ui/Component/Listing/Columns.php @@ -6,6 +6,8 @@ namespace Magento\Catalog\Ui\Component\Listing; /** + * Column IU component + * * @api * @since 100.0.2 */ @@ -30,6 +32,7 @@ class Columns extends \Magento\Ui\Component\Listing\Columns 'boolean' => 'select', 'multiselect' => 'select', 'date' => 'dateRange', + 'datetime' => 'datetimeRange', ]; /** @@ -52,7 +55,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function prepare() { diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php index 4039ff862f6fe..e41b2390930f0 100644 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php @@ -746,6 +746,9 @@ public function setupAttributeMeta(ProductAttributeInterface $attribute, $groupC // Gallery attribute is being handled by "Images And Videos" section $meta = []; break; + case 'datetime': + $meta = $this->customizeDatetimeAttribute($meta); + break; } //Checking access to design config. @@ -948,6 +951,19 @@ private function customizeWysiwyg(ProductAttributeInterface $attribute, array $m return $meta; } + /** + * Customize datetime attribute + * + * @param array $meta + * @return array + */ + private function customizeDatetimeAttribute(array $meta) + { + $meta['arguments']['data']['config']['options']['showsTime'] = 1; + + return $meta; + } + /** * Retrieve form element * diff --git a/app/code/Magento/Catalog/etc/adminhtml/di.xml b/app/code/Magento/Catalog/etc/adminhtml/di.xml index c04cfb2dce00a..9e02d3da9f5d8 100644 --- a/app/code/Magento/Catalog/etc/adminhtml/di.xml +++ b/app/code/Magento/Catalog/etc/adminhtml/di.xml @@ -232,4 +232,21 @@ </argument> </arguments> </type> + <type name="Magento\Eav\Model\Adminhtml\System\Config\Source\Inputtype"> + <arguments> + <argument name="optionsArray" xsi:type="array"> + <item name="450" xsi:type="array"> + <item name="value" xsi:type="string">datetime</item> + <item name="label" xsi:type="string" translate="true">Date and Time</item> + </item> + </argument> + </arguments> + </type> + <type name="Magento\Ui\DataProvider\Mapper\FormElement"> + <arguments> + <argument name="mappings" xsi:type="array"> + <item name="datetime" xsi:type="string">date</item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/Catalog/etc/config.xml b/app/code/Magento/Catalog/etc/config.xml index 20511f4ff2295..8506d2ae03032 100644 --- a/app/code/Magento/Catalog/etc/config.xml +++ b/app/code/Magento/Catalog/etc/config.xml @@ -78,5 +78,12 @@ <thumbnail_position>stretch</thumbnail_position> </watermark> </design> + <general> + <validator_data> + <input_types> + <datetime>datetime</datetime> + </input_types> + </validator_data> + </general> </default> </config> diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/js.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/js.phtml index f020eddc35dbd..212a345f4bcbc 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/js.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/js.phtml @@ -172,6 +172,7 @@ function switchDefaultValueField() break; case 'date': + case 'datetime': defaultValueDateVisibility = true; break; diff --git a/app/code/Magento/Catalog/view/adminhtml/ui_component/product_attribute_add_form.xml b/app/code/Magento/Catalog/view/adminhtml/ui_component/product_attribute_add_form.xml index 6c5d37a92ea4a..3a6621137ed5a 100644 --- a/app/code/Magento/Catalog/view/adminhtml/ui_component/product_attribute_add_form.xml +++ b/app/code/Magento/Catalog/view/adminhtml/ui_component/product_attribute_add_form.xml @@ -101,6 +101,7 @@ <item name="textarea" xsi:type="string">textarea</item> <item name="texteditor" xsi:type="string">texteditor</item> <item name="date" xsi:type="string">date</item> + <item name="datetime" xsi:type="string">datetime</item> <item name="boolean" xsi:type="string">boolean</item> <item name="multiselect" xsi:type="string">multiselect</item> <item name="select" xsi:type="string">select</item> @@ -287,6 +288,7 @@ <item name="textarea" xsi:type="string">textarea</item> <item name="texteditor" xsi:type="string">texteditor</item> <item name="date" xsi:type="string">date</item> + <item name="datetime" xsi:type="string">datetime</item> <item name="boolean" xsi:type="string">boolean</item> <item name="multiselect" xsi:type="string">multiselect</item> <item name="select" xsi:type="string">select</item> @@ -376,6 +378,29 @@ <dataScope>default_value_date</dataScope> </settings> </field> + <field name="default_value_datetime" component="Magento_Catalog/js/components/visible-on-option/date" sortOrder="35" formElement="date"> + <argument name="data" xsi:type="array"> + <item name="config" xsi:type="array"> + <item name="valuesForOptions" xsi:type="array"> + <item name="datetime" xsi:type="string">datetime</item> + </item> + </item> + </argument> + <settings> + <dataType>text</dataType> + <label translate="true">Default Value</label> + <dataScope>default_value_datetime</dataScope> + </settings> + <formElements> + <date> + <settings> + <options> + <option name="showsTime" xsi:type="boolean">true</option> + </options> + </settings> + </date> + </formElements> + </field> <field name="is_unique" component="Magento_Catalog/js/components/visible-on-option/yesno" sortOrder="40" formElement="checkbox"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> @@ -412,6 +437,7 @@ <item name="textarea" xsi:type="string">textarea</item> <item name="texteditor" xsi:type="string">texteditor</item> <item name="date" xsi:type="string">date</item> + <item name="datetime" xsi:type="string">date</item> <item name="boolean" xsi:type="string">boolean</item> <item name="multiselect" xsi:type="string">multiselect</item> <item name="select" xsi:type="string">select</item> diff --git a/app/code/Magento/Eav/Model/Entity/Attribute.php b/app/code/Magento/Eav/Model/Entity/Attribute.php index 8bd9ca2cc03c8..82eafa6174bb2 100644 --- a/app/code/Magento/Eav/Model/Entity/Attribute.php +++ b/app/code/Magento/Eav/Model/Entity/Attribute.php @@ -285,13 +285,8 @@ public function beforeSave() // save default date value as timestamp if ($hasDefaultValue) { - try { - $locale = $this->_localeResolver->getLocale(); - $defaultValue = $this->_localeDate->date($defaultValue, $locale, false, false); - $this->setDefaultValue($defaultValue->format(DateTime::DATETIME_PHP_FORMAT)); - } catch (\Exception $e) { - throw new LocalizedException(__('The default date is invalid. Verify the date and try again.')); - } + $defaultValue = $this->getUtcDateDefaultValue($defaultValue); + $this->setDefaultValue($defaultValue); } } @@ -310,6 +305,29 @@ public function beforeSave() return parent::beforeSave(); } + /** + * Convert localized date default value to UTC + * + * @param string $defaultValue + * @return string + * @throws LocalizedException + */ + private function getUtcDateDefaultValue(string $defaultValue): string + { + $hasTime = $this->getFrontendInput() === 'datetime'; + try { + $defaultValue = $this->_localeDate->date($defaultValue, null, $hasTime, $hasTime); + if ($hasTime) { + $defaultValue->setTimezone(new \DateTimeZone($this->_localeDate->getDefaultTimezone())); + } + $utcValue = $defaultValue->format(DateTime::DATETIME_PHP_FORMAT); + } catch (\Exception $e) { + throw new LocalizedException(__('The default date is invalid. Verify the date and try again.')); + } + + return $utcValue; + } + /** * @inheritdoc * @@ -346,6 +364,7 @@ public function getBackendTypeByInput($type) break; case 'date': + case 'datetime': $field = 'datetime'; break; @@ -401,6 +420,10 @@ public function getDefaultValueByInput($type) $field = 'default_value_date'; break; + case 'datetime': + $field = 'default_value_datetime'; + break; + case 'boolean': $field = 'default_value_yesno'; break; diff --git a/app/code/Magento/Eav/Model/Entity/Attribute/Frontend/Datetime.php b/app/code/Magento/Eav/Model/Entity/Attribute/Frontend/Datetime.php index a9cd3be246bb1..8effd73d34af2 100644 --- a/app/code/Magento/Eav/Model/Entity/Attribute/Frontend/Datetime.php +++ b/app/code/Magento/Eav/Model/Entity/Attribute/Frontend/Datetime.php @@ -7,6 +7,8 @@ namespace Magento\Eav\Model\Entity\Attribute\Frontend; /** + * Entity datetime frontend attribute + * * @api * @since 100.0.2 */ @@ -42,10 +44,12 @@ public function getValue(\Magento\Framework\DataObject $object) $value = parent::getValue($object); if ($value) { + $timeType = $this->getAttribute()->getFrontendInput() === 'datetime' + ? \IntlDateFormatter::MEDIUM : \IntlDateFormatter::NONE; $data = $this->_localeDate->formatDateTime( new \DateTime($value), \IntlDateFormatter::MEDIUM, - \IntlDateFormatter::NONE + $timeType ); } diff --git a/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Frontend/DatetimeTest.php b/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Frontend/DatetimeTest.php index 66549f2e00415..c775548fc8c75 100644 --- a/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Frontend/DatetimeTest.php +++ b/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Frontend/DatetimeTest.php @@ -5,22 +5,31 @@ */ namespace Magento\Eav\Test\Unit\Model\Entity\Attribute\Frontend; +use Magento\Eav\Model\Entity\Attribute\AbstractAttribute; use Magento\Eav\Model\Entity\Attribute\Frontend\Datetime; +use Magento\Eav\Model\Entity\Attribute\Source\BooleanFactory; +use Magento\Framework\DataObject; +use Magento\Framework\Stdlib\DateTime\TimezoneInterface; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; -class DatetimeTest extends \PHPUnit\Framework\TestCase +/** + * Class to test Entity datetime frontend attribute + */ +class DatetimeTest extends TestCase { /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var TimezoneInterface|MockObject */ private $localeDateMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var BooleanFactory|MockObject */ private $booleanFactoryMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var AbstractAttribute|MockObject */ private $attributeMock; @@ -29,40 +38,63 @@ class DatetimeTest extends \PHPUnit\Framework\TestCase */ private $model; + /** + * @inheritdoc + */ protected function setUp() { - $this->booleanFactoryMock = $this->createMock(\Magento\Eav\Model\Entity\Attribute\Source\BooleanFactory::class); - $this->localeDateMock = $this->createMock(\Magento\Framework\Stdlib\DateTime\TimezoneInterface::class); + $this->booleanFactoryMock = $this->createMock(BooleanFactory::class); + $this->localeDateMock = $this->createMock(TimezoneInterface::class); $this->attributeMock = $this->createPartialMock( - \Magento\Eav\Model\Entity\Attribute\AbstractAttribute::class, - ['getAttributeCode', 'getFrontendLabel', 'getData'] + AbstractAttribute::class, + ['getAttributeCode', 'getFrontendLabel', 'getFrontendInput'] ); $this->model = new Datetime($this->booleanFactoryMock, $this->localeDateMock); $this->model->setAttribute($this->attributeMock); } - public function testGetValue() + /** + * Test to retrieve attribute value + * + * @param string $frontendInput + * @param int $timeType + * @dataProvider getValueDataProvider + */ + public function testGetValue(string $frontendInput, int $timeType) { $attributeValue = '11-11-2011'; + $attributeCode = 'datetime'; $date = new \DateTime($attributeValue); - $object = new \Magento\Framework\DataObject(['datetime' => $attributeValue]); + $object = new DataObject([$attributeCode => $attributeValue]); $this->attributeMock->expects($this->any()) ->method('getAttributeCode') - ->willReturn('datetime'); + ->willReturn($attributeCode); $this->attributeMock->expects($this->any()) - ->method('getData') - ->with('frontend_input') - ->willReturn('text'); + ->method('getFrontendInput') + ->willReturn($frontendInput); $this->localeDateMock->expects($this->once()) ->method('formatDateTime') - ->with($date, \IntlDateFormatter::MEDIUM, \IntlDateFormatter::NONE, null, null, null) + ->with($date, \IntlDateFormatter::MEDIUM, $timeType) ->willReturn($attributeValue); $this->assertEquals($attributeValue, $this->model->getValue($object)); } + /** + * Retrieve attribute value data provider + * + * @return array + */ + public function getValueDataProvider(): array + { + return [ + ['frontendInput' => 'date', 'timeType' => \IntlDateFormatter::NONE], + ['frontendInput' => 'datetime', 'timeType' => \IntlDateFormatter::MEDIUM], + ]; + } + /** * @param mixed $labelText * @param string $attributeCode diff --git a/app/code/Magento/Eav/Test/Unit/Model/Entity/AttributeTest.php b/app/code/Magento/Eav/Test/Unit/Model/Entity/AttributeTest.php index 402497a1379c0..7aa5bca00f0b6 100644 --- a/app/code/Magento/Eav/Test/Unit/Model/Entity/AttributeTest.php +++ b/app/code/Magento/Eav/Test/Unit/Model/Entity/AttributeTest.php @@ -57,6 +57,7 @@ public static function dataGetBackendTypeByInput() ['image', 'text'], ['textarea', 'text'], ['date', 'datetime'], + ['datetime', 'datetime'], ['select', 'int'], ['boolean', 'int'], ['price', 'decimal'], @@ -91,6 +92,7 @@ public static function dataGetDefaultValueByInput() ['weight', 'default_value_text'], ['textarea', 'default_value_textarea'], ['date', 'default_value_date'], + ['datetime', 'default_value_datetime'], ['boolean', 'default_value_yesno'] ]; } diff --git a/app/code/Magento/Swatches/view/adminhtml/web/js/product-attributes.js b/app/code/Magento/Swatches/view/adminhtml/web/js/product-attributes.js index f795f99e8112d..9e48af20ee945 100644 --- a/app/code/Magento/Swatches/view/adminhtml/web/js/product-attributes.js +++ b/app/code/Magento/Swatches/view/adminhtml/web/js/product-attributes.js @@ -31,6 +31,7 @@ define([ defaultValueText: $('#default_value_text'), defaultValueTextarea: $('#default_value_textarea'), defaultValueDate: $('#default_value_date'), + defaultValueDatetime: $('#default_value_datetime'), defaultValueYesno: $('#default_value_yesno'), isGlobal: $('#is_global'), useProductImageForSwatch: $('#use_product_image_for_swatch'), @@ -178,6 +179,7 @@ define([ defaultValueTextVisibility = false, defaultValueTextareaVisibility = false, defaultValueDateVisibility = false, + defaultValueDatetimeVisibility = false, defaultValueYesnoVisibility = false, scopeVisibility = true, useProductImageForSwatch = false, @@ -203,6 +205,10 @@ define([ defaultValueDateVisibility = true; break; + case 'datetime': + defaultValueDatetimeVisibility = true; + break; + case 'boolean': defaultValueYesnoVisibility = true; break; @@ -256,6 +262,7 @@ define([ defaultValueTextVisibility = false; defaultValueTextareaVisibility = false; defaultValueDateVisibility = false; + defaultValueDatetimeVisibility = false; defaultValueYesnoVisibility = false; break; @@ -279,6 +286,7 @@ define([ this.setRowVisibility(this.defaultValueText, defaultValueTextVisibility); this.setRowVisibility(this.defaultValueTextarea, defaultValueTextareaVisibility); this.setRowVisibility(this.defaultValueDate, defaultValueDateVisibility); + this.setRowVisibility(this.defaultValueDatetime, defaultValueDatetimeVisibility); this.setRowVisibility(this.defaultValueYesno, defaultValueYesnoVisibility); this.setRowVisibility(this.isGlobal, scopeVisibility); diff --git a/app/code/Magento/Ui/Component/Filters.php b/app/code/Magento/Ui/Component/Filters.php index fe02c23af9c8a..5bf89ae7936e9 100644 --- a/app/code/Magento/Ui/Component/Filters.php +++ b/app/code/Magento/Ui/Component/Filters.php @@ -12,6 +12,8 @@ use Magento\Ui\Component\Listing\Columns\ColumnInterface; /** + * Grid filters UI component + * * @api * @since 100.0.2 */ @@ -36,6 +38,7 @@ class Filters extends AbstractComponent implements ObserverInterface 'textRange' => 'filterRange', 'select' => 'filterSelect', 'dateRange' => 'filterDate', + 'datetimeRange' => 'filterDate', ]; /** diff --git a/app/code/Magento/Ui/Component/Filters/Type/Date.php b/app/code/Magento/Ui/Component/Filters/Type/Date.php index e854b888c45e6..28ad8568ebe31 100644 --- a/app/code/Magento/Ui/Component/Filters/Type/Date.php +++ b/app/code/Magento/Ui/Component/Filters/Type/Date.php @@ -9,6 +9,8 @@ use Magento\Ui\Component\Form\Element\DataType\Date as DataTypeDate; /** + * Date grid filter UI Component + * * @api * @since 100.0.2 */ @@ -84,30 +86,18 @@ protected function applyFilter() if (isset($value['from'])) { $this->applyFilterByType( 'gteq', - $this->wrappedComponent->convertDate( - $value['from'], - 0, - 0, - 0, - !$this->getData('config/skipTimeZoneConversion') - ) + $this->convertDatetime((string)$value['from']) ); } if (isset($value['to'])) { $this->applyFilterByType( 'lteq', - $this->wrappedComponent->convertDate( - $value['to'], - 23, - 59, - 59, - !$this->getData('config/skipTimeZoneConversion') - ) + $this->convertDatetime((string)$value['to'], 23, 59, 59) ); } } else { - $this->applyFilterByType('eq', $this->wrappedComponent->convertDate($value)); + $this->applyFilterByType('eq', $this->convertDatetime((string)$value)); } } } @@ -130,4 +120,31 @@ protected function applyFilterByType($type, $value) $this->getContext()->getDataProvider()->addFilter($filter); } } + + /** + * Convert given date to default (UTC) timezone + * + * @param string $value + * @param int $hour + * @param int $minute + * @param int $second + * @return \DateTime + */ + private function convertDatetime(string $value, int $hour = 0, int $minute = 0, int $second = 0): ?\DateTime + { + $value = $this->getData('config/options/showsTime') + ? $this->wrappedComponent->convertDatetime( + $value, + !$this->getData('config/skipTimeZoneConversion') + ) + : $this->wrappedComponent->convertDate( + $value, + $hour, + $minute, + $second, + !$this->getData('config/skipTimeZoneConversion') + ); + + return $value; + } } diff --git a/app/code/Magento/Ui/Component/Form/Element/DataType/Date.php b/app/code/Magento/Ui/Component/Form/Element/DataType/Date.php index 31d2fe786cfd8..8ea6236e8e2e2 100644 --- a/app/code/Magento/Ui/Component/Form/Element/DataType/Date.php +++ b/app/code/Magento/Ui/Component/Form/Element/DataType/Date.php @@ -111,7 +111,7 @@ public function getComponentName() public function convertDate($date, $hour = 0, $minute = 0, $second = 0, $setUtcTimeZone = true) { try { - $dateObj = $this->localeDate->date($date, $this->getLocale(), true); + $dateObj = $this->localeDate->date($date, $this->getLocale(), false); $dateObj->setTime($hour, $minute, $second); //convert store date to default date in UTC timezone without DST if ($setUtcTimeZone) { @@ -122,4 +122,26 @@ public function convertDate($date, $hour = 0, $minute = 0, $second = 0, $setUtcT return null; } } + + /** + * Convert given date to default (UTC) timezone + * + * @param string $date + * @param bool $setUtcTimeZone + * @return \DateTime|null + */ + public function convertDatetime(string $date, bool $setUtcTimeZone = true): ?\DateTime + { + try { + $date = rtrim($date, 'Z'); + $dateObj = new \DateTime($date, new \DateTimeZone($this->localeDate->getConfigTimezone())); + //convert store date to default date in UTC timezone without DST + if ($setUtcTimeZone) { + $dateObj->setTimezone(new \DateTimeZone('UTC')); + } + return $dateObj; + } catch (\Exception $e) { + return null; + } + } } diff --git a/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php b/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php index 78456968cbef1..7038a587be0b0 100644 --- a/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php +++ b/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php @@ -13,6 +13,7 @@ use Magento\Ui\Component\Filters\Type\Date; use Magento\Framework\View\Element\UiComponent\ContextInterface; use Magento\Ui\Component\Form\Element\DataType\Date as FormDate; +use PHPUnit\Framework\MockObject\MockObject; /** * Class DateTest @@ -20,27 +21,27 @@ class DateTest extends \PHPUnit\Framework\TestCase { /** - * @var ContextInterface|\PHPUnit_Framework_MockObject_MockObject + * @var ContextInterface|MockObject */ private $contextMock; /** - * @var UiComponentFactory|\PHPUnit_Framework_MockObject_MockObject + * @var UiComponentFactory|MockObject */ private $uiComponentFactory; /** - * @var FilterBuilder|\PHPUnit_Framework_MockObject_MockObject + * @var FilterBuilder|MockObject */ private $filterBuilderMock; /** - * @var FilterModifier|\PHPUnit_Framework_MockObject_MockObject + * @var FilterModifier|MockObject */ private $filterModifierMock; /** - * @var DataProviderInterface|\PHPUnit_Framework_MockObject_MockObject + * @var DataProviderInterface|MockObject */ private $dataProviderMock; @@ -89,18 +90,19 @@ public function testGetComponentName() * Run test prepare method * * @param string $name + * @param bool $showsTime * @param array $filterData * @param array|null $expectedCondition * @dataProvider getPrepareDataProvider * @return void */ - public function testPrepare($name, $filterData, $expectedCondition) + public function testPrepare(string $name, bool $showsTime, array $filterData, ?array $expectedCondition) { $processor = $this->getMockBuilder(\Magento\Framework\View\Element\UiComponent\Processor::class) ->disableOriginalConstructor() ->getMock(); $this->contextMock->expects(static::atLeastOnce())->method('getProcessor')->willReturn($processor); - /** @var FormDate $uiComponent */ + /** @var FormDate|MockObject $uiComponent */ $uiComponent = $this->getMockBuilder(FormDate::class) ->disableOriginalConstructor() ->getMock(); @@ -125,7 +127,7 @@ public function testPrepare($name, $filterData, $expectedCondition) ->willReturn($this->dataProviderMock); if ($expectedCondition !== null) { - $this->processFilters($name, $filterData, $expectedCondition, $uiComponent); + $this->processFilters($name, $showsTime, $filterData, $expectedCondition, $uiComponent); } $this->uiComponentFactory->expects($this->any()) @@ -139,7 +141,10 @@ public function testPrepare($name, $filterData, $expectedCondition) $this->filterBuilderMock, $this->filterModifierMock, [], - ['name' => $name] + [ + 'name' => $name, + 'config' => ['options' => ['showsTime' => $showsTime]], + ] ); $date->prepare(); } @@ -152,7 +157,7 @@ public function testPrepare($name, $filterData, $expectedCondition) * @param string $expectedDate * @param int $i * - * @return Filter|\PHPUnit_Framework_MockObject_MockObject + * @return Filter|MockObject */ private function getFilterMock($name, $expectedType, $expectedDate, &$i) { @@ -184,57 +189,87 @@ public function getPrepareDataProvider() { return [ [ - 'test_date', - ['test_date' => ['from' => '11-05-2015', 'to' => null]], - ['date' => '2015-05-11 00:00:00', 'type' => 'gteq'], + 'name' => 'test_date', + 'showsTime' => false, + 'filterData' => ['test_date' => ['from' => '11-05-2015', 'to' => null]], + 'expectedCondition' => ['date' => '2015-05-11 00:00:00', 'type' => 'gteq'], ], [ - 'test_date', - ['test_date' => ['from' => null, 'to' => '11-05-2015']], - ['date' => '2015-05-11 23:59:59', 'type' => 'lteq'], + 'name' => 'test_date', + 'showsTime' => false, + 'filterData' => ['test_date' => ['from' => null, 'to' => '11-05-2015']], + 'expectedCondition' => ['date' => '2015-05-11 23:59:59', 'type' => 'lteq'], ], [ - 'test_date', - ['test_date' => ['from' => '11-05-2015', 'to' => '11-05-2015']], - [ + 'name' => 'test_date', + 'showsTime' => false, + 'filterData' => ['test_date' => ['from' => '11-05-2015', 'to' => '11-05-2015']], + 'expectedCondition' => [ 'date_from' => '2015-05-11 00:00:00', 'type_from' => 'gteq', 'date_to' => '2015-05-11 23:59:59', 'type_to' => 'lteq' ], ], [ - 'test_date', - ['test_date' => '11-05-2015'], - ['date' => '2015-05-11 00:00:00', 'type' => 'eq'], + 'name' => 'test_date', + 'showsTime' => false, + 'filterData' => ['test_date' => '11-05-2015'], + 'expectedCondition' => ['date' => '2015-05-11 00:00:00', 'type' => 'eq'], + ], + [ + 'name' => 'test_date', + 'showsTime' => false, + 'filterData' => ['test_date' => ['from' => '', 'to' => '']], + 'expectedCondition' => null, ], [ - 'test_date', - ['test_date' => ['from' => '', 'to' => '']], - null, + 'name' => 'test_date', + 'showsTime' => true, + 'filterData' => ['test_date' => ['from' => '11-05-2015 10:20:00', 'to' => '11-05-2015 18:25:00']], + 'expectedCondition' => [ + 'date_from' => '2015-05-11 10:20:00', 'type_from' => 'gteq', + 'date_to' => '2015-05-11 18:25:00', 'type_to' => 'lteq' + ], ], ]; } /** - * @param $name - * @param $filterData - * @param $expectedCondition - * @param $uiComponent + * @param string $name + * @param bool $showsTime + * @param array $filterData + * @param array $expectedCondition + * @param MockObject $uiComponent */ - private function processFilters($name, $filterData, $expectedCondition, $uiComponent) - { + private function processFilters( + string $name, + bool $showsTime, + array $filterData, + array $expectedCondition, + FormDate $uiComponent + ) { if (is_string($filterData[$name])) { $uiComponent->expects(static::once()) - ->method('convertDate') + ->method($showsTime ? 'convertDatetime' : 'convertDate') ->with($filterData[$name]) ->willReturn(new \DateTime($filterData[$name])); } else { - $from = new \DateTime($filterData[$name]['from']); - $to = new \DateTime($filterData[$name]['to'] . ' 23:59:59'); - $uiComponent->method('convertDate') - ->willReturnMap([ - [$filterData[$name]['from'], 0, 0, 0, true, $from], - [$filterData[$name]['to'], 23, 59, 59, true, $to], - ]); + if ($showsTime) { + $from = new \DateTime($filterData[$name]['from']); + $to = new \DateTime($filterData[$name]['to']); + $uiComponent->method('convertDatetime') + ->willReturnMap([ + [$filterData[$name]['from'], true, $from], + [$filterData[$name]['to'], true, $to], + ]); + } else { + $from = new \DateTime($filterData[$name]['from']); + $to = new \DateTime($filterData[$name]['to'] . ' 23:59:59'); + $uiComponent->method('convertDate') + ->willReturnMap([ + [$filterData[$name]['from'], 0, 0, 0, true, $from], + [$filterData[$name]['to'], 23, 59, 59, true, $to], + ]); + } } $i = 0; diff --git a/app/code/Magento/Ui/Test/Unit/Component/FiltersTest.php b/app/code/Magento/Ui/Test/Unit/Component/FiltersTest.php index 402fd30bf4d5b..19a1be69ca1d7 100644 --- a/app/code/Magento/Ui/Test/Unit/Component/FiltersTest.php +++ b/app/code/Magento/Ui/Test/Unit/Component/FiltersTest.php @@ -8,23 +8,27 @@ namespace Magento\Ui\Test\Unit\Component; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; -use \Magento\Ui\Component\Filters; +use Magento\Framework\View\Element\UiComponent\ContextInterface; +use Magento\Framework\View\Element\UiComponentFactory; +use Magento\Framework\View\Element\UiComponentInterface; +use Magento\Ui\Component\Filters; +use PHPUnit\Framework\MockObject\MockObject; /** * Unit tests for \Magento\Ui\Component\Filters class */ class FiltersTest extends \PHPUnit\Framework\TestCase { - /** @var Filters|\PHPUnit_Framework_MockObject_MockObject */ + /** @var Filters|MockObject */ private $filters; - /** @var \Magento\Framework\View\Element\UiComponentInterface|\PHPUnit_Framework_MockObject_MockObject */ + /** @var UiComponentInterface|MockObject */ private $uiComponentInterface; - /** @var \Magento\Framework\View\Element\UiComponentFactory|\PHPUnit_Framework_MockObject_MockObject */ + /** @var UiComponentFactory|MockObject */ private $uiComponentFactory; - /** @var \Magento\Framework\View\Element\UiComponent\ContextInterface|\PHPUnit_Framework_MockObject_MockObject */ + /** @var ContextInterface|MockObject */ private $context; /** @@ -33,13 +37,13 @@ class FiltersTest extends \PHPUnit\Framework\TestCase protected function setUp() { $objectManager = new ObjectManager($this); - $this->uiComponentInterface = $this->getMockBuilder(\Magento\Framework\View\Element\UiComponentInterface::class) + $this->uiComponentInterface = $this->getMockBuilder(UiComponentInterface::class) ->disableOriginalConstructor() ->getMock(); - $this->uiComponentFactory = $this->getMockBuilder(\Magento\Framework\View\Element\UiComponentFactory::class) + $this->uiComponentFactory = $this->getMockBuilder(UiComponentFactory::class) ->disableOriginalConstructor() ->getMock(); - $this->context = $this->getMockBuilder(\Magento\Framework\View\Element\UiComponent\ContextInterface::class) + $this->context = $this->getMockBuilder(ContextInterface::class) ->disableOriginalConstructor() ->getMock(); $this->filters = $objectManager->getObject( @@ -52,7 +56,14 @@ protected function setUp() ); } - public function testUpdate() + /** + * Test to Update filter component according to $component + * + * @param string $filterType + * @param string $filterName + * @dataProvider updateDataProvider + */ + public function testUpdate(string $filterType, string $filterName) { $componentName = 'component_name'; $componentConfig = [0, 1, 2]; @@ -60,7 +71,10 @@ public function testUpdate() ->disableOriginalConstructor() ->setMethods(['getData', 'getName', 'getConfiguration']) ->getMockForAbstractClass(); - $columnInterface->expects($this->atLeastOnce())->method('getData')->with('config/filter')->willReturn('text'); + $columnInterface->expects($this->atLeastOnce()) + ->method('getData') + ->with('config/filter') + ->willReturn($filterType); $columnInterface->expects($this->atLeastOnce())->method('getName')->willReturn($componentName); $columnInterface->expects($this->once())->method('getConfiguration')->willReturn($componentConfig); $filterComponent = $this->getMockBuilder(\Magento\Framework\View\Element\UiComponentInterface::class) @@ -71,11 +85,22 @@ public function testUpdate() ->willReturnSelf(); $filterComponent->expects($this->once())->method('prepare')->willReturnSelf(); $this->uiComponentFactory->expects($this->once())->method('create') - ->with($componentName, 'filterInput', ['context' => $this->context]) + ->with($componentName, $filterName, ['context' => $this->context]) ->willReturn($filterComponent); $this->filters->update($columnInterface); /** Verify that filter is already set and it wouldn't be set again */ $this->filters->update($columnInterface); } + + /** + * @return array + */ + public function updateDataProvider(): array + { + return [ + ['text', 'filterInput'], + ['datetimeRange', 'filterDate'], + ]; + } } diff --git a/app/code/Magento/Ui/Test/Unit/Component/Form/Element/DataType/DateTest.php b/app/code/Magento/Ui/Test/Unit/Component/Form/Element/DataType/DateTest.php index cdb11f05daa8c..015c025e7c102 100644 --- a/app/code/Magento/Ui/Test/Unit/Component/Form/Element/DataType/DateTest.php +++ b/app/code/Magento/Ui/Test/Unit/Component/Form/Element/DataType/DateTest.php @@ -11,27 +11,35 @@ use Magento\Framework\View\Element\UiComponent\Context; use Magento\Framework\View\Element\UiComponent\Processor; use Magento\Ui\Component\Form\Element\DataType\Date; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; -class DateTest extends \PHPUnit\Framework\TestCase +/** + * Class to test Date form element + */ +class DateTest extends TestCase { - /** @var \PHPUnit_Framework_MockObject_MockObject */ + /** @var Context|MockObject */ private $contextMock; - /** @var \PHPUnit_Framework_MockObject_MockObject */ + /** @var TimezoneInterface|MockObject */ private $localeDateMock; - /** @var \PHPUnit_Framework_MockObject_MockObject */ + /** @var ResolverInterface|MockObject */ private $localeResolverMock; - /** @var \Magento\Ui\Component\Form\Element\DataType\Date */ + /** @var Date */ private $date; - /** @var \PHPUnit_Framework_MockObject_MockObject */ + /** @var Processor|MockObject */ private $processorMock; - /** @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager */ + /** @var ObjectManager */ private $objectManagerHelper; + /** + * @inheritdoc + */ public function setUp() { $this->contextMock = $this->createMock(Context::class); @@ -39,9 +47,12 @@ public function setUp() $this->localeResolverMock = $this->createMock(ResolverInterface::class); $this->objectManagerHelper = new ObjectManager($this); $this->processorMock = $this->createMock(Processor::class); - $this->contextMock->expects($this->atLeastOnce())->method('getProcessor')->willReturn($this->processorMock); + $this->contextMock->method('getProcessor')->willReturn($this->processorMock); } + /** + * Test to Prepare component configuration with Time offset + */ public function testPrepareWithTimeOffset() { $this->date = new Date( @@ -72,6 +83,9 @@ public function testPrepareWithTimeOffset() $this->assertEquals($localeDateFormat, $config['options']['dateFormat']); } + /** + * Test to Prepare component configuration without Time offset + */ public function testPrepareWithoutTimeOffset() { $defaultDateFormat = 'MM/dd/y'; @@ -130,4 +144,43 @@ public function testPrepare() $this->assertEquals('America/Chicago', $configArray['storeTimeZone']); $this->assertEquals('de-DE', $configArray['options']['storeLocale']); } + + /** + * Test to Convert given date to default (UTC) timezone + * + * @param string $dateStr + * @param bool $setUtcTimeZone + * @param string $convertedDate + * @dataProvider convertDatetimeDataProvider + */ + public function testConvertDatetime(string $dateStr, bool $setUtcTimeZone, string $convertedDate) + { + $this->localeDateMock->method('getConfigTimezone') + ->willReturn('America/Los_Angeles'); + + $this->date = $this->objectManagerHelper->getObject( + Date::class, + [ + 'localeDate' => $this->localeDateMock, + ] + ); + + $this->assertEquals( + $convertedDate, + $this->date->convertDatetime($dateStr, $setUtcTimeZone)->format('Y-m-d H:i:s'), + "The date value wasn't converted" + ); + } + + /** + * @return array + */ + public function convertDatetimeDataProvider(): array + { + return [ + ['2019-09-30T12:32:00.000Z', false, '2019-09-30 12:32:00'], + ['2019-09-30T12:32:00.000', false, '2019-09-30 12:32:00'], + ['2019-09-30T12:32:00.000Z', true, '2019-09-30 19:32:00'], + ]; + } } diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/date.js b/app/code/Magento/Ui/view/base/web/js/form/element/date.js index ac28271e90a3b..1432372dd75a9 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/date.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/date.js @@ -107,6 +107,13 @@ define([ return this._super().observe(['shiftedValue']); }, + /** + * @inheritdoc + */ + getPreview: function () { + return this.shiftedValue(); + }, + /** * Prepares and sets date/time value that will be displayed * in the input field. diff --git a/app/code/Magento/Ui/view/base/web/js/grid/columns/date.js b/app/code/Magento/Ui/view/base/web/js/grid/columns/date.js index 3f9c5b20d6215..cc69d990372c1 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/columns/date.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/columns/date.js @@ -9,8 +9,10 @@ define([ 'mageUtils', 'moment', - './column' -], function (utils, moment, Column) { + './column', + 'underscore', + 'moment-timezone-with-data' +], function (utils, moment, Column, _) { 'use strict'; return Column.extend({ @@ -20,9 +22,9 @@ define([ }, /** - * Overrides base method to normalize date format. + * Overrides base method to normalize date format * - * @returns {DateColumn} Chainable. + * @returns {DateColumn} Chainable */ initConfig: function () { this._super(); @@ -38,12 +40,15 @@ define([ * @returns {String} Formatted date. */ getLabel: function (value, format) { - var date; + var date = moment.utc(this._super()); if (this.storeLocale !== undefined) { moment.locale(this.storeLocale, utils.extend({}, this.calendarConfig)); } - date = moment(this._super()); + + if (!_.isUndefined(this.timeZone)) { + date = date.tz(this.timeZone); + } date = date.isValid() && value[this.index] ? date.format(format || this.dateFormat) : diff --git a/app/code/Magento/Ui/view/base/web/js/grid/filters/filters.js b/app/code/Magento/Ui/view/base/web/js/grid/filters/filters.js index 98c3eb1c6f882..a6fae9df50c4d 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/filters/filters.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/filters/filters.js @@ -83,6 +83,10 @@ define([ component: 'Magento_Ui/js/grid/filters/range', rangeType: 'date' }, + datetimeRange: { + component: 'Magento_Ui/js/grid/filters/range', + rangeType: 'datetime' + }, textRange: { component: 'Magento_Ui/js/grid/filters/range', rangeType: 'text' diff --git a/app/code/Magento/Ui/view/base/web/js/grid/filters/range.js b/app/code/Magento/Ui/view/base/web/js/grid/filters/range.js index ccfba8e98b6f4..1949234c89324 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/filters/range.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/filters/range.js @@ -30,6 +30,14 @@ define([ dateFormat: 'MM/dd/YYYY', shiftedValue: 'filter' }, + datetime: { + component: 'Magento_Ui/js/form/element/date', + dateFormat: 'MM/dd/YYYY', + shiftedValue: 'filter', + options: { + showsTime: true + } + }, text: { component: 'Magento_Ui/js/form/element/abstract' }, From e9c704b9277e2567278992dabd14946e65c42f42 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Fri, 4 Oct 2019 10:12:06 +0300 Subject: [PATCH 027/586] MC-5233: DateTime product attributes support --- .../Attribute/Frontend/DatetimeTest.php | 2 +- .../Unit/Component/Filters/Type/DateTest.php | 21 ++++--- .../Ui/Test/Unit/Component/FiltersTest.php | 2 +- .../Eav/Model/Entity/AttributeTest.php | 55 ++++++++++++------- 4 files changed, 49 insertions(+), 31 deletions(-) diff --git a/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Frontend/DatetimeTest.php b/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Frontend/DatetimeTest.php index c775548fc8c75..163f3d208e724 100644 --- a/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Frontend/DatetimeTest.php +++ b/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Frontend/DatetimeTest.php @@ -56,7 +56,7 @@ protected function setUp() /** * Test to retrieve attribute value - * + * * @param string $frontendInput * @param int $timeType * @dataProvider getValueDataProvider diff --git a/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php b/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php index 7038a587be0b0..31d7ca92c5985 100644 --- a/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php +++ b/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php @@ -239,6 +239,7 @@ public function getPrepareDataProvider() * @param array $filterData * @param array $expectedCondition * @param MockObject $uiComponent + * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ private function processFilters( string $name, @@ -257,18 +258,22 @@ private function processFilters( $from = new \DateTime($filterData[$name]['from']); $to = new \DateTime($filterData[$name]['to']); $uiComponent->method('convertDatetime') - ->willReturnMap([ - [$filterData[$name]['from'], true, $from], - [$filterData[$name]['to'], true, $to], - ]); + ->willReturnMap( + [ + [$filterData[$name]['from'], true, $from], + [$filterData[$name]['to'], true, $to], + ] + ); } else { $from = new \DateTime($filterData[$name]['from']); $to = new \DateTime($filterData[$name]['to'] . ' 23:59:59'); $uiComponent->method('convertDate') - ->willReturnMap([ - [$filterData[$name]['from'], 0, 0, 0, true, $from], - [$filterData[$name]['to'], 23, 59, 59, true, $to], - ]); + ->willReturnMap( + [ + [$filterData[$name]['from'], 0, 0, 0, true, $from], + [$filterData[$name]['to'], 23, 59, 59, true, $to], + ] + ); } } diff --git a/app/code/Magento/Ui/Test/Unit/Component/FiltersTest.php b/app/code/Magento/Ui/Test/Unit/Component/FiltersTest.php index 19a1be69ca1d7..d4cf7f1af8d62 100644 --- a/app/code/Magento/Ui/Test/Unit/Component/FiltersTest.php +++ b/app/code/Magento/Ui/Test/Unit/Component/FiltersTest.php @@ -58,7 +58,7 @@ protected function setUp() /** * Test to Update filter component according to $component - * + * * @param string $filterType * @param string $filterName * @dataProvider updateDataProvider diff --git a/dev/tests/integration/testsuite/Magento/Eav/Model/Entity/AttributeTest.php b/dev/tests/integration/testsuite/Magento/Eav/Model/Entity/AttributeTest.php index 2750e2a768aab..5df08762e29a7 100644 --- a/dev/tests/integration/testsuite/Magento/Eav/Model/Entity/AttributeTest.php +++ b/dev/tests/integration/testsuite/Magento/Eav/Model/Entity/AttributeTest.php @@ -3,15 +3,20 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ - declare(strict_types=1); namespace Magento\Eav\Model\Entity; -use Magento\TestFramework\Helper\Bootstrap; +use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Locale\ResolverInterface; +use Magento\Framework\ObjectManagerInterface; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; -class AttributeTest extends \PHPUnit\Framework\TestCase +/** + * Class to test EAV Entity attribute model + */ +class AttributeTest extends TestCase { /** * @var Attribute @@ -19,33 +24,33 @@ class AttributeTest extends \PHPUnit\Framework\TestCase private $attribute; /** - * @var \Magento\Framework\ObjectManagerInterface + * @var ObjectManagerInterface */ private $objectManager; /** * @var ResolverInterface */ - private $_localeResolver; + private $localeResolver; /** - * {@inheritdoc} + * @inheritdoc */ protected function setUp() { $this->objectManager = Bootstrap::getObjectManager(); $this->attribute = $this->objectManager->get(Attribute::class); - $this->_localeResolver = $this->objectManager->get(ResolverInterface::class); + $this->localeResolver = $this->objectManager->get(ResolverInterface::class); } /** - * {@inheritdoc} + * @inheritdoc */ protected function tearDown() { $this->attribute = null; $this->objectManager = null; - $this->_localeResolver = null; + $this->localeResolver = null; } /** @@ -56,11 +61,17 @@ protected function tearDown() * @dataProvider beforeSaveDataProvider * @throws */ - public function testBeforeSave($defaultValue, $backendType, $locale, $expected) - { + public function testBeforeSave( + string $defaultValue, + string $backendType, + string $frontendInput, + string $locale, + string $expected + ) { $this->attribute->setDefaultValue($defaultValue); $this->attribute->setBackendType($backendType); - $this->_localeResolver->setLocale($locale); + $this->attribute->setFrontendInput($frontendInput); + $this->localeResolver->setLocale($locale); $this->attribute->beforeSave(); $this->assertEquals($expected, $this->attribute->getDefaultValue()); @@ -74,13 +85,15 @@ public function testBeforeSave($defaultValue, $backendType, $locale, $expected) public function beforeSaveDataProvider() { return [ - ['21/07/18', 'datetime', 'en_AU', '2018-07-21 00:00:00'], - ['07/21/18', 'datetime', 'en_US', '2018-07-21 00:00:00'], - ['21/07/18', 'datetime', 'fr_FR', '2018-07-21 00:00:00'], - ['21/07/18', 'datetime', 'de_DE', '2018-07-21 00:00:00'], - ['21/07/18', 'datetime', 'uk_UA', '2018-07-21 00:00:00'], - ['100.50', 'decimal', 'en_US', '100.50'], - ['100,50', 'decimal', 'uk_UA', '100.5'], + ['21/07/18', 'datetime', 'date', 'en_AU', '2018-07-21 00:00:00'], + ['07/21/18', 'datetime', 'date', 'en_US', '2018-07-21 00:00:00'], + ['21/07/18', 'datetime', 'date', 'fr_FR', '2018-07-21 00:00:00'], + ['21/07/18', 'datetime', 'date', 'de_DE', '2018-07-21 00:00:00'], + ['21/07/18', 'datetime', 'date', 'uk_UA', '2018-07-21 00:00:00'], + ['100.50', 'decimal', 'decimal', 'en_US', '100.50'], + ['100,50', 'decimal', 'decimal', 'uk_UA', '100.5'], + ['07/21/2019 2:30 PM', 'datetime', 'datetime', 'en_US', '2019-07-21 21:30:00'], + ['21.07.2019 14:30', 'datetime', 'datetime', 'uk_UA', '2019-07-21 21:30:00'], ]; } @@ -90,13 +103,13 @@ public function beforeSaveDataProvider() * @param string $locale * @param string $expected * @dataProvider beforeSaveErrorDataDataProvider - * @expectedException \Magento\Framework\Exception\LocalizedException + * @expectedException LocalizedException */ public function testBeforeSaveErrorData($defaultValue, $backendType, $locale, $expected) { $this->attribute->setDefaultValue($defaultValue); $this->attribute->setBackendType($backendType); - $this->_localeResolver->setLocale($locale); + $this->localeResolver->setLocale($locale); $this->attribute->beforeSave(); $this->expectExceptionMessage($expected); From a8f3b9e8931d69a4bfa3af51483ed89b16292eea Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <p.bystritsky@yandex.ru> Date: Fri, 27 Sep 2019 17:19:04 +0300 Subject: [PATCH 028/586] magento/magento2#22856: Catalog price rules are not working with custom options as expected. --- .../Product/View/Options/AbstractOptions.php | 30 ++++- .../Magento/Catalog/Model/Product/Option.php | 123 ++++++------------ .../Model/Product/Option/Type/DefaultType.php | 67 ++++++---- .../Model/Product/Option/Type/Select.php | 31 +++-- .../Catalog/Model/Product/Option/Value.php | 60 +++++++-- .../CalculateCustomOptionCatalogRule.php | 99 ++++++++++++++ .../Unit/Model/Product/Option/ValueTest.php | 32 +++-- app/code/Magento/CatalogRule/Model/Rule.php | 15 ++- .../Model/Product/BundlePriceAbstract.php | 21 ++- ...ndleWithCatalogPriceRuleCalculatorTest.php | 1 + .../Block/Product/View/OptionsTest.php | 70 ++++++++-- 11 files changed, 400 insertions(+), 149 deletions(-) create mode 100644 app/code/Magento/Catalog/Pricing/Price/CalculateCustomOptionCatalogRule.php diff --git a/app/code/Magento/Catalog/Block/Product/View/Options/AbstractOptions.php b/app/code/Magento/Catalog/Block/Product/View/Options/AbstractOptions.php index 030b6e1d2204c..0bfdcc678e9f7 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Options/AbstractOptions.php +++ b/app/code/Magento/Catalog/Block/Product/View/Options/AbstractOptions.php @@ -3,16 +3,14 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ - -/** - * Product options abstract type block - * - * @author Magento Core Team <core@magentocommerce.com> - */ +declare(strict_types=1); namespace Magento\Catalog\Block\Product\View\Options; +use Magento\Catalog\Pricing\Price\BasePrice; +use Magento\Catalog\Pricing\Price\CalculateCustomOptionCatalogRule; use Magento\Catalog\Pricing\Price\CustomOptionPriceInterface; +use Magento\Framework\App\ObjectManager; /** * Product options section abstract block. @@ -47,20 +45,29 @@ abstract class AbstractOptions extends \Magento\Framework\View\Element\Template */ protected $_catalogHelper; + /** + * @var CalculateCustomOptionCatalogRule + */ + private $calculateCustomOptionCatalogRule; + /** * @param \Magento\Framework\View\Element\Template\Context $context * @param \Magento\Framework\Pricing\Helper\Data $pricingHelper * @param \Magento\Catalog\Helper\Data $catalogData * @param array $data + * @param CalculateCustomOptionCatalogRule $calculateCustomOptionCatalogRule */ public function __construct( \Magento\Framework\View\Element\Template\Context $context, \Magento\Framework\Pricing\Helper\Data $pricingHelper, \Magento\Catalog\Helper\Data $catalogData, - array $data = [] + array $data = [], + CalculateCustomOptionCatalogRule $calculateCustomOptionCatalogRule = null ) { $this->pricingHelper = $pricingHelper; $this->_catalogHelper = $catalogData; + $this->calculateCustomOptionCatalogRule = $calculateCustomOptionCatalogRule + ?? ObjectManager::getInstance()->get(CalculateCustomOptionCatalogRule::class); parent::__construct($context, $data); } @@ -161,6 +168,15 @@ protected function _formatPrice($value, $flag = true) $priceStr = $sign; $customOptionPrice = $this->getProduct()->getPriceInfo()->getPrice('custom_option_price'); + + if (!$value['is_percent']) { + $value['pricing_value'] = $this->calculateCustomOptionCatalogRule->execute( + $this->getProduct(), + (float)$value['pricing_value'], + (bool)$value['is_percent'] + ); + } + $context = [CustomOptionPriceInterface::CONFIGURATION_OPTION_FLAG => true]; $optionAmount = $customOptionPrice->getCustomAmount($value['pricing_value'], null, $context); $priceStr .= $this->getLayout()->getBlock('product.price.render.default')->renderAmount( diff --git a/app/code/Magento/Catalog/Model/Product/Option.php b/app/code/Magento/Catalog/Model/Product/Option.php index 4f730834412e4..0170de5dc1ed4 100644 --- a/app/code/Magento/Catalog/Model/Product/Option.php +++ b/app/code/Magento/Catalog/Model/Product/Option.php @@ -3,6 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); namespace Magento\Catalog\Model\Product; @@ -11,8 +12,10 @@ use Magento\Catalog\Api\Data\ProductCustomOptionValuesInterfaceFactory; use Magento\Catalog\Api\Data\ProductInterface; use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\Product\Option\Value; use Magento\Catalog\Model\ResourceModel\Product\Option\Value\Collection; -use Magento\Catalog\Pricing\Price\BasePrice; +use Magento\Catalog\Pricing\Price\CalculateCustomOptionCatalogRule; +use Magento\Framework\App\ObjectManager; use Magento\Framework\EntityManager\MetadataPool; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Model\AbstractExtensibleModel; @@ -108,6 +111,11 @@ class Option extends AbstractExtensibleModel implements ProductCustomOptionInter */ private $customOptionValuesFactory; + /** + * @var CalculateCustomOptionCatalogRule + */ + private $calculateCustomOptionCatalogRule; + /** * @param \Magento\Framework\Model\Context $context * @param \Magento\Framework\Registry $registry @@ -121,6 +129,7 @@ class Option extends AbstractExtensibleModel implements ProductCustomOptionInter * @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection * @param array $data * @param ProductCustomOptionValuesInterfaceFactory|null $customOptionValuesFactory + * @param CalculateCustomOptionCatalogRule $calculateCustomOptionCatalogRule * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -135,14 +144,17 @@ public function __construct( \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, array $data = [], - ProductCustomOptionValuesInterfaceFactory $customOptionValuesFactory = null + ProductCustomOptionValuesInterfaceFactory $customOptionValuesFactory = null, + CalculateCustomOptionCatalogRule $calculateCustomOptionCatalogRule = null ) { $this->productOptionValue = $productOptionValue; $this->optionTypeFactory = $optionFactory; $this->validatorPool = $validatorPool; $this->string = $string; $this->customOptionValuesFactory = $customOptionValuesFactory ?: - \Magento\Framework\App\ObjectManager::getInstance()->get(ProductCustomOptionValuesInterfaceFactory::class); + ObjectManager::getInstance()->get(ProductCustomOptionValuesInterfaceFactory::class); + $this->calculateCustomOptionCatalogRule = $calculateCustomOptionCatalogRule ?? + ObjectManager::getInstance()->get(CalculateCustomOptionCatalogRule::class); parent::__construct( $context, @@ -156,10 +168,7 @@ public function __construct( } /** - * Get resource instance - * - * @return \Magento\Framework\Model\ResourceModel\Db\AbstractDb - * @deprecated 101.1.0 because resource models should be used directly + * @inheritdoc */ protected function _getResource() { @@ -439,10 +448,12 @@ public function afterSave() */ public function getPrice($flag = false) { - if ($flag && $this->getPriceType() == self::$typePercent) { - $basePrice = $this->getProduct()->getPriceInfo()->getPrice(BasePrice::PRICE_CODE)->getValue(); - $price = $basePrice * ($this->_getData(self::KEY_PRICE) / 100); - return $price; + if ($flag) { + return $this->calculateCustomOptionCatalogRule->execute( + $this->getProduct(), + (float)$this->getData(self::KEY_PRICE), + $this->getPriceType() === Value::TYPE_PERCENT + ); } return $this->_getData(self::KEY_PRICE); } @@ -536,9 +547,7 @@ public function getSearchableData($productId, $storeId) } /** - * Clearing object's data - * - * @return $this + * @inheritdoc */ protected function _clearData() { @@ -548,9 +557,7 @@ protected function _clearData() } /** - * Clearing cyclic references - * - * @return $this + * @inheritdoc */ protected function _clearReferences() { @@ -571,9 +578,7 @@ protected function _getValidationRulesBeforeSave() } /** - * Get product SKU - * - * @return string + * @inheritdoc */ public function getProductSku() { @@ -585,9 +590,7 @@ public function getProductSku() } /** - * Get option id - * - * @return int|null + * @inheritdoc * @codeCoverageIgnoreStart */ public function getOptionId() @@ -596,9 +599,7 @@ public function getOptionId() } /** - * Get option title - * - * @return string + * @inheritdoc */ public function getTitle() { @@ -606,9 +607,7 @@ public function getTitle() } /** - * Get option type - * - * @return string + * @inheritdoc */ public function getType() { @@ -616,9 +615,7 @@ public function getType() } /** - * Get sort order - * - * @return int + * @inheritdoc */ public function getSortOrder() { @@ -626,10 +623,7 @@ public function getSortOrder() } /** - * Get is require - * - * @return bool - * @SuppressWarnings(PHPMD.BooleanGetMethodName) + * @inheritdoc */ public function getIsRequire() { @@ -637,9 +631,7 @@ public function getIsRequire() } /** - * Get price type - * - * @return string|null + * @inheritdoc */ public function getPriceType() { @@ -647,9 +639,7 @@ public function getPriceType() } /** - * Get Sku - * - * @return string|null + * @inheritdoc */ public function getSku() { @@ -697,10 +687,7 @@ public function getImageSizeY() } /** - * Set product SKU - * - * @param string $productSku - * @return $this + * @inheritdoc */ public function setProductSku($productSku) { @@ -708,10 +695,7 @@ public function setProductSku($productSku) } /** - * Set option id - * - * @param int $optionId - * @return $this + * @inheritdoc */ public function setOptionId($optionId) { @@ -719,10 +703,7 @@ public function setOptionId($optionId) } /** - * Set option title - * - * @param string $title - * @return $this + * @inheritdoc */ public function setTitle($title) { @@ -730,10 +711,7 @@ public function setTitle($title) } /** - * Set option type - * - * @param string $type - * @return $this + * @inheritdoc */ public function setType($type) { @@ -741,10 +719,7 @@ public function setType($type) } /** - * Set sort order - * - * @param int $sortOrder - * @return $this + * @inheritdoc */ public function setSortOrder($sortOrder) { @@ -752,10 +727,7 @@ public function setSortOrder($sortOrder) } /** - * Set is require - * - * @param bool $isRequired - * @return $this + * @inheritdoc */ public function setIsRequire($isRequired) { @@ -763,10 +735,7 @@ public function setIsRequire($isRequired) } /** - * Set price - * - * @param float $price - * @return $this + * @inheritdoc */ public function setPrice($price) { @@ -774,10 +743,7 @@ public function setPrice($price) } /** - * Set price type - * - * @param string $priceType - * @return $this + * @inheritdoc */ public function setPriceType($priceType) { @@ -785,10 +751,7 @@ public function setPriceType($priceType) } /** - * Set Sku - * - * @param string $sku - * @return $this + * @inheritdoc */ public function setSku($sku) { @@ -929,7 +892,7 @@ public function setExtensionAttributes( private function getOptionRepository() { if (null === $this->optionRepository) { - $this->optionRepository = \Magento\Framework\App\ObjectManager::getInstance() + $this->optionRepository = ObjectManager::getInstance() ->get(\Magento\Catalog\Model\Product\Option\Repository::class); } return $this->optionRepository; @@ -943,7 +906,7 @@ private function getOptionRepository() private function getMetadataPool() { if (null === $this->metadataPool) { - $this->metadataPool = \Magento\Framework\App\ObjectManager::getInstance() + $this->metadataPool = ObjectManager::getInstance() ->get(\Magento\Framework\EntityManager\MetadataPool::class); } return $this->metadataPool; diff --git a/app/code/Magento/Catalog/Model/Product/Option/Type/DefaultType.php b/app/code/Magento/Catalog/Model/Product/Option/Type/DefaultType.php index c388be8b6f394..be7f1921afccf 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/Type/DefaultType.php +++ b/app/code/Magento/Catalog/Model/Product/Option/Type/DefaultType.php @@ -3,17 +3,26 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); namespace Magento\Catalog\Model\Product\Option\Type; -use Magento\Framework\Exception\LocalizedException; use Magento\Catalog\Api\Data\ProductCustomOptionInterface; +use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\Product\Configuration\Item\ItemInterface; +use Magento\Catalog\Model\Product\Configuration\Item\Option\OptionInterface; +use Magento\Catalog\Model\Product\Option; +use Magento\Catalog\Model\Product\Option\Value; +use Magento\Catalog\Pricing\Price\CalculateCustomOptionCatalogRule; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\Exception\LocalizedException; /** * Catalog product option default type * * @api * @author Magento Core Team <core@magentocommerce.com> + * @SuppressWarnings(PHPMD.CookieAndSessionMisuse) * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @since 100.0.2 */ @@ -22,14 +31,14 @@ class DefaultType extends \Magento\Framework\DataObject /** * Option Instance * - * @var \Magento\Catalog\Model\Product\Option + * @var Option */ protected $_option; /** * Product Instance * - * @var \Magento\Catalog\Model\Product + * @var Product */ protected $_product; @@ -54,27 +63,36 @@ class DefaultType extends \Magento\Framework\DataObject */ protected $_checkoutSession; + /** + * @var CalculateCustomOptionCatalogRule + */ + private $calculateCustomOptionCatalogRule; + /** * Construct * * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param array $data + * @param CalculateCustomOptionCatalogRule $calculateCustomOptionCatalogRule */ public function __construct( \Magento\Checkout\Model\Session $checkoutSession, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - array $data = [] + array $data = [], + CalculateCustomOptionCatalogRule $calculateCustomOptionCatalogRule = null ) { $this->_checkoutSession = $checkoutSession; parent::__construct($data); $this->_scopeConfig = $scopeConfig; + $this->calculateCustomOptionCatalogRule = $calculateCustomOptionCatalogRule ?? ObjectManager::getInstance() + ->get(CalculateCustomOptionCatalogRule::class); } /** * Option Instance setter * - * @param \Magento\Catalog\Model\Product\Option $option + * @param Option $option * @return $this */ public function setOption($option) @@ -86,12 +104,12 @@ public function setOption($option) /** * Option Instance getter * + * @return Option * @throws \Magento\Framework\Exception\LocalizedException - * @return \Magento\Catalog\Model\Product\Option */ public function getOption() { - if ($this->_option instanceof \Magento\Catalog\Model\Product\Option) { + if ($this->_option instanceof Option) { return $this->_option; } throw new LocalizedException(__('The option instance type in options group is incorrect.')); @@ -100,7 +118,7 @@ public function getOption() /** * Product Instance setter * - * @param \Magento\Catalog\Model\Product $product + * @param Product $product * @return $this */ public function setProduct($product) @@ -112,12 +130,12 @@ public function setProduct($product) /** * Product Instance getter * + * @return Product * @throws \Magento\Framework\Exception\LocalizedException - * @return \Magento\Catalog\Model\Product */ public function getProduct() { - if ($this->_product instanceof \Magento\Catalog\Model\Product) { + if ($this->_product instanceof Product) { return $this->_product; } throw new LocalizedException(__('The product instance type in options group is incorrect.')); @@ -126,15 +144,12 @@ public function getProduct() /** * Getter for Configuration Item Option * - * @return \Magento\Catalog\Model\Product\Configuration\Item\Option\OptionInterface + * @return OptionInterface * @throws LocalizedException */ public function getConfigurationItemOption() { - if ($this->_getData( - 'configuration_item_option' - ) instanceof \Magento\Catalog\Model\Product\Configuration\Item\Option\OptionInterface - ) { + if ($this->_getData('configuration_item_option') instanceof OptionInterface) { return $this->_getData('configuration_item_option'); } @@ -149,14 +164,12 @@ public function getConfigurationItemOption() /** * Getter for Configuration Item * - * @return \Magento\Catalog\Model\Product\Configuration\Item\ItemInterface + * @return ItemInterface * @throws \Magento\Framework\Exception\LocalizedException */ public function getConfigurationItem() { - if ($this->_getData( - 'configuration_item' - ) instanceof \Magento\Catalog\Model\Product\Configuration\Item\ItemInterface + if ($this->_getData('configuration_item') instanceof ItemInterface ) { return $this->_getData('configuration_item'); } @@ -341,7 +354,11 @@ public function getOptionPrice($optionValue, $basePrice) { $option = $this->getOption(); - return $this->_getChargeableOptionPrice($option->getPrice(), $option->getPriceType() == 'percent', $basePrice); + return $this->calculateCustomOptionCatalogRule->execute( + $option->getProduct(), + (float)$option->getPrice(), + $option->getPriceType() === Value::TYPE_PERCENT + ); } /** @@ -368,14 +385,14 @@ public function getProductOptions() $options = $this->getProduct()->getOptions(); if ($options != null) { foreach ($options as $_option) { - /* @var $option \Magento\Catalog\Model\Product\Option */ + /* @var $option Option */ $this->_productOptions[$this->getProduct()->getId()][$_option->getTitle()] = [ 'option_id' => $_option->getId(), ]; if ($_option->getGroupByType() == ProductCustomOptionInterface::OPTION_GROUP_SELECT) { $optionValues = []; foreach ($_option->getValues() as $_value) { - /* @var $value \Magento\Catalog\Model\Product\Option\Value */ + /* @var $value Value */ $optionValues[$_value->getTitle()] = $_value->getId(); } $this->_productOptions[$this @@ -395,12 +412,14 @@ public function getProductOptions() } /** + * Return final chargeable price for option + * * @param float $price Price of option * @param boolean $isPercent Price type - percent or fixed * @param float $basePrice For percent price type * @return float * @deprecated 102.0.4 typo in method name - * @see _getChargeableOptionPrice + * @see CalculateCustomOptionCatalogRule::execute */ protected function _getChargableOptionPrice($price, $isPercent, $basePrice) { @@ -414,6 +433,8 @@ protected function _getChargableOptionPrice($price, $isPercent, $basePrice) * @param boolean $isPercent Price type - percent or fixed * @param float $basePrice For percent price type * @return float + * @deprecated + * @see CalculateCustomOptionCatalogRule::execute */ protected function _getChargeableOptionPrice($price, $isPercent, $basePrice) { diff --git a/app/code/Magento/Catalog/Model/Product/Option/Type/Select.php b/app/code/Magento/Catalog/Model/Product/Option/Type/Select.php index d2766b1bbb054..8eebd3e91c2ee 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/Type/Select.php +++ b/app/code/Magento/Catalog/Model/Product/Option/Type/Select.php @@ -3,9 +3,13 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); namespace Magento\Catalog\Model\Product\Option\Type; +use Magento\Catalog\Model\Product\Option\Value; +use Magento\Catalog\Pricing\Price\CalculateCustomOptionCatalogRule; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\LocalizedException; /** @@ -37,6 +41,11 @@ class Select extends \Magento\Catalog\Model\Product\Option\Type\DefaultType */ private $singleSelectionTypes; + /** + * @var CalculateCustomOptionCatalogRule + */ + private $calculateCustomOptionCatalogRule; + /** * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig @@ -44,6 +53,7 @@ class Select extends \Magento\Catalog\Model\Product\Option\Type\DefaultType * @param \Magento\Framework\Escaper $escaper * @param array $data * @param array $singleSelectionTypes + * @param CalculateCustomOptionCatalogRule $calculateCustomOptionCatalogRule */ public function __construct( \Magento\Checkout\Model\Session $checkoutSession, @@ -51,7 +61,8 @@ public function __construct( \Magento\Framework\Stdlib\StringUtils $string, \Magento\Framework\Escaper $escaper, array $data = [], - array $singleSelectionTypes = [] + array $singleSelectionTypes = [], + CalculateCustomOptionCatalogRule $calculateCustomOptionCatalogRule = null ) { $this->string = $string; $this->_escaper = $escaper; @@ -61,6 +72,8 @@ public function __construct( 'drop_down' => \Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_DROP_DOWN, 'radio' => \Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_RADIO, ]; + $this->calculateCustomOptionCatalogRule = $calculateCustomOptionCatalogRule ?? ObjectManager::getInstance() + ->get(CalculateCustomOptionCatalogRule::class); } /** @@ -248,10 +261,10 @@ public function getOptionPrice($optionValue, $basePrice) foreach (explode(',', $optionValue) as $value) { $_result = $option->getValueById($value); if ($_result) { - $result += $this->_getChargeableOptionPrice( - $_result->getPrice(), - $_result->getPriceType() == 'percent', - $basePrice + $result += $this->calculateCustomOptionCatalogRule->execute( + $option->getProduct(), + (float)$_result->getPrice(), + $_result->getPriceType() === Value::TYPE_PERCENT ); } else { if ($this->getListener()) { @@ -263,10 +276,10 @@ public function getOptionPrice($optionValue, $basePrice) } elseif ($this->_isSingleSelection()) { $_result = $option->getValueById($optionValue); if ($_result) { - $result = $this->_getChargeableOptionPrice( - $_result->getPrice(), - $_result->getPriceType() == 'percent', - $basePrice + $result = $this->calculateCustomOptionCatalogRule->execute( + $option->getProduct(), + (float)$_result->getPrice(), + $_result->getPriceType() === Value::TYPE_PERCENT ); } else { if ($this->getListener()) { diff --git a/app/code/Magento/Catalog/Model/Product/Option/Value.php b/app/code/Magento/Catalog/Model/Product/Option/Value.php index ebbc060c99edf..fce39614248ca 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/Value.php +++ b/app/code/Magento/Catalog/Model/Product/Option/Value.php @@ -3,13 +3,16 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); namespace Magento\Catalog\Model\Product\Option; use Magento\Catalog\Model\Product; use Magento\Catalog\Model\Product\Option; -use Magento\Framework\Model\AbstractModel; use Magento\Catalog\Pricing\Price\BasePrice; +use Magento\Catalog\Pricing\Price\CalculateCustomOptionCatalogRule; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\Model\AbstractModel; use Magento\Catalog\Pricing\Price\CustomOptionPriceCalculator; use Magento\Catalog\Pricing\Price\RegularPrice; @@ -69,6 +72,11 @@ class Value extends AbstractModel implements \Magento\Catalog\Api\Data\ProductCu */ private $customOptionPriceCalculator; + /** + * @var CalculateCustomOptionCatalogRule + */ + private $calculateCustomOptionCatalogRule; + /** * @param \Magento\Framework\Model\Context $context * @param \Magento\Framework\Registry $registry @@ -77,6 +85,7 @@ class Value extends AbstractModel implements \Magento\Catalog\Api\Data\ProductCu * @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection * @param array $data * @param CustomOptionPriceCalculator|null $customOptionPriceCalculator + * @param CalculateCustomOptionCatalogRule|null $CalculateCustomOptionCatalogRule */ public function __construct( \Magento\Framework\Model\Context $context, @@ -85,11 +94,14 @@ public function __construct( \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, array $data = [], - CustomOptionPriceCalculator $customOptionPriceCalculator = null + CustomOptionPriceCalculator $customOptionPriceCalculator = null, + CalculateCustomOptionCatalogRule $CalculateCustomOptionCatalogRule = null ) { $this->_valueCollectionFactory = $valueCollectionFactory; $this->customOptionPriceCalculator = $customOptionPriceCalculator - ?? \Magento\Framework\App\ObjectManager::getInstance()->get(CustomOptionPriceCalculator::class); + ?? ObjectManager::getInstance()->get(CustomOptionPriceCalculator::class); + $this->calculateCustomOptionCatalogRule = $CalculateCustomOptionCatalogRule + ?? ObjectManager::getInstance()->get(CalculateCustomOptionCatalogRule::class); parent::__construct( $context, @@ -101,7 +113,7 @@ public function __construct( } /** - * @return void + * @inheritDoc */ protected function _construct() { @@ -109,6 +121,8 @@ protected function _construct() } /** + * Add value. + * * @codeCoverageIgnoreStart * @param mixed $value * @return $this @@ -120,6 +134,8 @@ public function addValue($value) } /** + * Get values. + * * @return array */ public function getValues() @@ -128,6 +144,8 @@ public function getValues() } /** + * Set values. + * * @param array $values * @return $this */ @@ -138,6 +156,8 @@ public function setValues($values) } /** + * Unset values. + * * @return $this */ public function unsetValues() @@ -147,6 +167,8 @@ public function unsetValues() } /** + * Set option. + * * @param Option $option * @return $this */ @@ -157,6 +179,8 @@ public function setOption(Option $option) } /** + * Unset option. + * * @return $this */ public function unsetOption() @@ -166,7 +190,7 @@ public function unsetOption() } /** - * Enter description here... + * Get option. * * @return Option */ @@ -176,6 +200,8 @@ public function getOption() } /** + * Set product. + * * @param Product $product * @return $this */ @@ -188,6 +214,8 @@ public function setProduct($product) //@codeCoverageIgnoreEnd /** + * Get product. + * * @return Product */ public function getProduct() @@ -199,7 +227,10 @@ public function getProduct() } /** + * Save values. + * * @return $this + * @throws \Exception */ public function saveValues() { @@ -225,8 +256,9 @@ public function saveValues() } /** - * Return price. If $flag is true and price is percent - * return converted percent to price + * Return price. + * + * If $flag is true and price is percent return converted percent to price * * @param bool $flag * @return float|int @@ -234,7 +266,11 @@ public function saveValues() public function getPrice($flag = false) { if ($flag) { - return $this->customOptionPriceCalculator->getOptionPriceByPriceCode($this, BasePrice::PRICE_CODE); + return $this->calculateCustomOptionCatalogRule->execute( + $this->getProduct(), + (float)$this->getData(self::KEY_PRICE), + $this->getPriceType() === self::TYPE_PERCENT + ); } return $this->_getData(self::KEY_PRICE); } @@ -250,7 +286,7 @@ public function getRegularPrice() } /** - * Enter description here... + * Get values collection. * * @param Option $option * @return \Magento\Catalog\Model\ResourceModel\Product\Option\Value\Collection @@ -268,6 +304,8 @@ public function getValuesCollection(Option $option) } /** + * Get values by option. + * * @param array $optionIds * @param int $option_id * @param int $store_id @@ -287,6 +325,8 @@ public function getValuesByOption($optionIds, $option_id, $store_id) } /** + * Delete value. + * * @param int $option_id * @return $this */ @@ -297,6 +337,8 @@ public function deleteValue($option_id) } /** + * Delete values. + * * @param int $option_type_id * @return $this */ diff --git a/app/code/Magento/Catalog/Pricing/Price/CalculateCustomOptionCatalogRule.php b/app/code/Magento/Catalog/Pricing/Price/CalculateCustomOptionCatalogRule.php new file mode 100644 index 0000000000000..91ff8f921566c --- /dev/null +++ b/app/code/Magento/Catalog/Pricing/Price/CalculateCustomOptionCatalogRule.php @@ -0,0 +1,99 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Pricing\Price; + +use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\Product\PriceModifierInterface; +use Magento\CatalogRule\Pricing\Price\CatalogRulePrice; +use Magento\Framework\Pricing\Price\BasePriceProviderInterface; +use Magento\Framework\Pricing\PriceCurrencyInterface; + +/** + * Calculates prices of custom options of the product with catalog rules applied. + */ +class CalculateCustomOptionCatalogRule +{ + /** + * @var PriceCurrencyInterface + */ + private $priceCurrency; + + /** + * @var PriceModifierInterface + */ + private $priceModifier; + + /** + * @param PriceCurrencyInterface $priceCurrency + * @param PriceModifierInterface $priceModifier + */ + public function __construct( + PriceCurrencyInterface $priceCurrency, + PriceModifierInterface $priceModifier + ) { + $this->priceModifier = $priceModifier; + $this->priceCurrency = $priceCurrency; + } + + /** + * Calculate prices of custom options of the product with catalog rules applied. + * + * @param Product $product + * @param float $optionPriceValue + * @param bool $isPercent + * @return float + */ + public function execute( + Product $product, + float $optionPriceValue, + bool $isPercent + ): float { + $basePrice = $this->getGetBasePriceWithOutCatalogRules($product); + if ($isPercent) { + $optionPrice = $basePrice * $optionPriceValue / 100; + } else { + $optionPrice = $optionPriceValue; + } + + $totalPriceModified = $this->priceModifier->modifyPrice( + $basePrice + $optionPrice, + $product + ); + $basePriceModified = $this->priceModifier->modifyPrice( + $basePrice, + $product + ); + $price = $totalPriceModified - $basePriceModified; + + return $this->priceCurrency->convertAndRound($price); + } + + /** + * Get product base price without catalog rules applied. + * + * @param Product $product + * @return float + */ + private function getGetBasePriceWithOutCatalogRules(Product $product): float + { + $basePrice = null; + foreach ($product->getPriceInfo()->getPrices() as $price) { + if ($price instanceof BasePriceProviderInterface + && $price->getPriceCode() !== CatalogRulePrice::PRICE_CODE + && $price->getValue() !== false + ) { + $basePrice = min( + $price->getValue(), + $basePrice ?? $price->getValue() + ); + } + } + + return $basePrice ?? $product->getPrice(); + } +} diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/Option/ValueTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/Option/ValueTest.php index 1ff5bef78cd79..212c8020750d2 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/Option/ValueTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/Option/ValueTest.php @@ -3,15 +3,21 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\Catalog\Test\Unit\Model\Product\Option; +declare(strict_types=1); -use \Magento\Catalog\Model\Product\Option\Value; +namespace Magento\Catalog\Test\Unit\Model\Product\Option; use Magento\Catalog\Model\Product; + use Magento\Catalog\Model\Product\Option; -use Magento\Framework\Model\ActionValidator\RemoveAction; +use Magento\Catalog\Model\Product\Option\Value; +use Magento\Catalog\Pricing\Price\CalculateCustomOptionCatalogRule; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use PHPUnit\Framework\MockObject\MockObject; +/** + * Test for \Magento\Catalog\Model\Product\Option\Value class. + */ class ValueTest extends \PHPUnit\Framework\TestCase { /** @@ -24,6 +30,11 @@ class ValueTest extends \PHPUnit\Framework\TestCase */ private $customOptionPriceCalculatorMock; + /** + * @var CalculateCustomOptionCatalogRule|MockObject + */ + private $CalculateCustomOptionCatalogRule; + protected function setUp() { $mockedResource = $this->getMockedResource(); @@ -33,6 +44,10 @@ protected function setUp() \Magento\Catalog\Pricing\Price\CustomOptionPriceCalculator::class ); + $this->CalculateCustomOptionCatalogRule = $this->createMock( + CalculateCustomOptionCatalogRule::class + ); + $helper = new ObjectManager($this); $this->model = $helper->getObject( \Magento\Catalog\Model\Product\Option\Value::class, @@ -40,6 +55,7 @@ protected function setUp() 'resource' => $mockedResource, 'valueCollectionFactory' => $mockedCollectionFactory, 'customOptionPriceCalculator' => $this->customOptionPriceCalculatorMock, + 'CalculateCustomOptionCatalogRule' => $this->CalculateCustomOptionCatalogRule ] ); $this->model->setOption($this->getMockedOption()); @@ -66,11 +82,11 @@ public function testGetPrice() $this->model->setPriceType(Value::TYPE_PERCENT); $this->assertEquals($price, $this->model->getPrice(false)); - $percentPice = 100; - $this->customOptionPriceCalculatorMock->expects($this->atLeastOnce()) - ->method('getOptionPriceByPriceCode') - ->willReturn($percentPice); - $this->assertEquals($percentPice, $this->model->getPrice(true)); + $percentPrice = 100; + $this->CalculateCustomOptionCatalogRule->expects($this->atLeastOnce()) + ->method('execute') + ->willReturn($percentPrice); + $this->assertEquals($percentPrice, $this->model->getPrice(true)); } public function testGetValuesCollection() diff --git a/app/code/Magento/CatalogRule/Model/Rule.php b/app/code/Magento/CatalogRule/Model/Rule.php index f2e8e54d34665..cd24201963f25 100644 --- a/app/code/Magento/CatalogRule/Model/Rule.php +++ b/app/code/Magento/CatalogRule/Model/Rule.php @@ -3,6 +3,8 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\CatalogRule\Model; use Magento\Catalog\Model\Product; @@ -13,6 +15,7 @@ use Magento\CatalogRule\Helper\Data; use Magento\CatalogRule\Model\Data\Condition\Converter; use Magento\CatalogRule\Model\Indexer\Rule\RuleProductProcessor; +use Magento\CatalogRule\Model\ResourceModel\Product\ConditionsToCollectionApplier; use Magento\CatalogRule\Model\ResourceModel\Rule as RuleResourceModel; use Magento\CatalogRule\Model\Rule\Action\CollectionFactory as RuleCollectionFactory; use Magento\CatalogRule\Model\Rule\Condition\CombineFactory; @@ -33,7 +36,6 @@ use Magento\Framework\Stdlib\DateTime; use Magento\Framework\Stdlib\DateTime\TimezoneInterface; use Magento\Store\Model\StoreManagerInterface; -use Magento\CatalogRule\Model\ResourceModel\Product\ConditionsToCollectionApplier; /** * Catalog Rule data model @@ -499,7 +501,8 @@ public function calcProductPriceRule(Product $product, $price) } else { $customerGroupId = $this->_customerSession->getCustomerGroupId(); } - $dateTs = $this->_localeDate->scopeTimeStamp($storeId); + $currentDateTime = new \DateTime(); + $dateTs = $currentDateTime->getTimestamp(); $cacheKey = date('Y-m-d', $dateTs) . "|{$websiteId}|{$customerGroupId}|{$productId}|{$price}"; if (!array_key_exists($cacheKey, self::$_priceRulesData)) { @@ -895,4 +898,12 @@ public function getIdentities() { return ['price']; } + + /** + * Clear price rules cache. + */ + public function clearPriceRulesData(): void + { + self::$_priceRulesData = []; + } } diff --git a/dev/tests/integration/testsuite/Magento/Bundle/Model/Product/BundlePriceAbstract.php b/dev/tests/integration/testsuite/Magento/Bundle/Model/Product/BundlePriceAbstract.php index e30916810b1e0..2a7b80e62797d 100644 --- a/dev/tests/integration/testsuite/Magento/Bundle/Model/Product/BundlePriceAbstract.php +++ b/dev/tests/integration/testsuite/Magento/Bundle/Model/Product/BundlePriceAbstract.php @@ -3,11 +3,13 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); namespace Magento\Bundle\Model\Product; /** * Abstract class for testing bundle prices + * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ abstract class BundlePriceAbstract extends \PHPUnit\Framework\TestCase @@ -29,6 +31,14 @@ abstract class BundlePriceAbstract extends \PHPUnit\Framework\TestCase */ protected $productCollectionFactory; + /** + * @var \Magento\CatalogRule\Model\RuleFactory + */ + private $ruleFactory; + + /** + * @inheritdoc + */ protected function setUp() { $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); @@ -42,15 +52,19 @@ protected function setUp() true, \Magento\Store\Model\ScopeInterface::SCOPE_STORE ); + $this->ruleFactory = $this->objectManager->get(\Magento\CatalogRule\Model\RuleFactory::class); } /** - * Get test cases + * Get test cases. + * * @return array */ abstract public function getTestCases(); /** + * Prepare fixture. + * * @param array $strategyModifiers * @param string $productSku * @return void @@ -61,11 +75,14 @@ abstract public function getTestCases(); */ protected function prepareFixture($strategyModifiers, $productSku) { + $this->ruleFactory->create()->clearPriceRulesData(); + $bundleProduct = $this->productRepository->get($productSku); foreach ($strategyModifiers as $modifier) { if (method_exists($this, $modifier['modifierName'])) { array_unshift($modifier['data'], $bundleProduct); + // phpcs:ignore Magento2.Functions.DiscouragedFunction $bundleProduct = call_user_func_array([$this, $modifier['modifierName']], $modifier['data']); } else { throw new \Magento\Framework\Exception\InputException( @@ -113,6 +130,8 @@ protected function addSimpleProduct(\Magento\Catalog\Model\Product $bundleProduc } /** + * Add custom option. + * * @param \Magento\Catalog\Model\Product $bundleProduct * @param array $optionsData * @return \Magento\Catalog\Model\Product diff --git a/dev/tests/integration/testsuite/Magento/Bundle/Model/Product/FixedBundleWithCatalogPriceRuleCalculatorTest.php b/dev/tests/integration/testsuite/Magento/Bundle/Model/Product/FixedBundleWithCatalogPriceRuleCalculatorTest.php index b3c46c75bcfb7..2b0e8c75a15e0 100644 --- a/dev/tests/integration/testsuite/Magento/Bundle/Model/Product/FixedBundleWithCatalogPriceRuleCalculatorTest.php +++ b/dev/tests/integration/testsuite/Magento/Bundle/Model/Product/FixedBundleWithCatalogPriceRuleCalculatorTest.php @@ -3,6 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); namespace Magento\Bundle\Model\Product; diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/OptionsTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/OptionsTest.php index 152ad6a6286f4..8997920ac1e3a 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/OptionsTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/OptionsTest.php @@ -3,8 +3,12 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Catalog\Block\Product\View; +use Magento\CatalogRule\Model\Indexer\IndexBuilder; + /** * Test class for \Magento\Catalog\Block\Product\View\Options. */ @@ -30,12 +34,19 @@ class OptionsTest extends \PHPUnit\Framework\TestCase */ protected $productRepository; + /** + * @var IndexBuilder + */ + private $indexBuilder; + protected function setUp() { $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $this->productRepository = $this->objectManager->create(\Magento\Catalog\Api\ProductRepositoryInterface::class); + $this->indexBuilder = $this->objectManager->create(IndexBuilder::class); + try { $this->product = $this->productRepository->get('simple'); } catch (\Magento\Framework\Exception\NoSuchEntityException $e) { @@ -113,24 +124,63 @@ private function getExpectedJsonConfig() { return [ 0 => [ - 'prices' => - ['oldPrice' => - ['amount' => 10, 'adjustments' => []], + 'prices' => ['oldPrice' => ['amount' => 10, 'adjustments' => []], 'basePrice' => ['amount' => 10], 'finalPrice' => ['amount' => 10] ], - 'type' => 'fixed', - 'name' => 'drop_down option 1', + 'type' => 'fixed', + 'name' => 'drop_down option 1', ], 1 => [ - 'prices' => - ['oldPrice' => - ['amount' => 40, 'adjustments' => []], + 'prices' => ['oldPrice' => ['amount' => 40, 'adjustments' => []], 'basePrice' => ['amount' => 40], 'finalPrice' => ['amount' => 40], ], - 'type' => 'percent', - 'name' => 'drop_down option 2', + 'type' => 'percent', + 'name' => 'drop_down option 2', + ], + ]; + } + + /** + * Test option prices with catalog price rules applied. + * + * @magentoDbIsolation disabled + * @magentoDataFixture Magento/CatalogRule/_files/two_rules.php + * @magentoDataFixture Magento/Catalog/_files/product_with_dropdown_option.php + */ + public function testGetJsonConfigWithCatalogRules() + { + $this->indexBuilder->reindexFull(); + + $config = json_decode($this->block->getJsonConfig(), true); + $configValues = array_values($config); + $this->assertEquals($this->getExpectedJsonConfigWithCatalogRules(), array_values($configValues[0])); + } + + /** + * Expected data for testGetJsonConfigWithCatalogRules + * + * @return array + */ + private function getExpectedJsonConfigWithCatalogRules() + { + return [ + 0 => [ + 'prices' => ['oldPrice' => ['amount' => 10, 'adjustments' => []], + 'basePrice' => ['amount' => 9.5], + 'finalPrice' => ['amount' => 9.5], + ], + 'type' => 'fixed', + 'name' => 'drop_down option 1', + ], + 1 => [ + 'prices' => ['oldPrice' => ['amount' => 40, 'adjustments' => []], + 'basePrice' => ['amount' => 38], + 'finalPrice' => ['amount' => 38], + ], + 'type' => 'percent', + 'name' => 'drop_down option 2', ], ]; } From 3bb11bb745298a44ade08ea94cdbf44e35adb35b Mon Sep 17 00:00:00 2001 From: Daniel Ruf <d.ruf@bitexpert.de> Date: Fri, 4 Oct 2019 10:12:18 +0200 Subject: [PATCH 029/586] Simplify some conditional checks --- .../Model/OperationProcessor.php | 4 +--- .../Magento/Indexer/Test/Unit/Model/IndexerTest.php | 10 +--------- .../Ui/view/base/web/js/lib/validation/rules.js | 2 +- lib/web/mage/validation.js | 2 +- 4 files changed, 4 insertions(+), 14 deletions(-) diff --git a/app/code/Magento/AsynchronousOperations/Model/OperationProcessor.php b/app/code/Magento/AsynchronousOperations/Model/OperationProcessor.php index 6826c34fd35f0..a617a943db9f9 100644 --- a/app/code/Magento/AsynchronousOperations/Model/OperationProcessor.php +++ b/app/code/Magento/AsynchronousOperations/Model/OperationProcessor.php @@ -206,9 +206,7 @@ private function executeHandler($callback, $entityParams) } } catch (NoSuchEntityException $e) { $this->logger->error($e->getMessage()); - $result['status'] = ($e instanceof TemporaryStateExceptionInterface) ? - OperationInterface::STATUS_TYPE_NOT_RETRIABLY_FAILED : - OperationInterface::STATUS_TYPE_NOT_RETRIABLY_FAILED; + $result['status'] = OperationInterface::STATUS_TYPE_NOT_RETRIABLY_FAILED; $result['error_code'] = $e->getCode(); $result['messages'][] = $e->getMessage(); } catch (LocalizedException $e) { diff --git a/app/code/Magento/Indexer/Test/Unit/Model/IndexerTest.php b/app/code/Magento/Indexer/Test/Unit/Model/IndexerTest.php index 6b7cc12218990..3edba23897a35 100644 --- a/app/code/Magento/Indexer/Test/Unit/Model/IndexerTest.php +++ b/app/code/Magento/Indexer/Test/Unit/Model/IndexerTest.php @@ -154,15 +154,7 @@ public function testGetLatestUpdated($getViewIsEnabled, $getViewGetUpdated, $get $this->stateFactoryMock->expects($this->once())->method('create')->will($this->returnValue($stateMock)); if ($getViewIsEnabled && $getViewGetUpdated) { - if (!$getStateGetUpdated) { - $this->assertEquals($getViewGetUpdated, $this->model->getLatestUpdated()); - } else { - if ($getViewGetUpdated == $getStateGetUpdated) { - $this->assertEquals($getViewGetUpdated, $this->model->getLatestUpdated()); - } else { - $this->assertEquals($getViewGetUpdated, $this->model->getLatestUpdated()); - } - } + $this->assertEquals($getViewGetUpdated, $this->model->getLatestUpdated()); } else { $this->assertEquals($getStateGetUpdated, $this->model->getLatestUpdated()); } diff --git a/app/code/Magento/Ui/view/base/web/js/lib/validation/rules.js b/app/code/Magento/Ui/view/base/web/js/lib/validation/rules.js index d765f842a0895..b558ca2c28079 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/validation/rules.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/validation/rules.js @@ -822,7 +822,7 @@ define([ ], 'validate-state': [ function (value) { - return value !== 0 || value === ''; + return value !== 0; }, $.mage.__('Please select State/Province.') ], diff --git a/lib/web/mage/validation.js b/lib/web/mage/validation.js index dfa35473176b9..e4ace239cf1b5 100644 --- a/lib/web/mage/validation.js +++ b/lib/web/mage/validation.js @@ -1122,7 +1122,7 @@ ], 'validate-state': [ function (v) { - return v !== 0 || v === ''; + return v !== 0; }, $.mage.__('Please select State/Province.') ], From b6d071f9b57a784206730e1f3612fd13ffdabf4b Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Mon, 7 Oct 2019 16:26:34 +0300 Subject: [PATCH 030/586] MC-5233: DateTime product attributes support --- .../Block/Adminhtml/Product/Attribute/Edit/Tab/Main.php | 2 +- app/code/Magento/Catalog/Ui/Component/ColumnFactory.php | 6 +++--- .../Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php | 2 +- .../Eav/Model/Entity/Attribute/Frontend/Datetime.php | 4 ++-- .../Magento/Ui/Component/Form/Element/DataType/Date.php | 8 ++++---- app/code/Magento/Ui/view/base/web/js/grid/columns/date.js | 4 ++-- .../testsuite/Magento/Eav/Model/Entity/AttributeTest.php | 3 +-- 7 files changed, 14 insertions(+), 15 deletions(-) diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Main.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Main.php index ddc7273432cb3..955ea259ec9a8 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Main.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Main.php @@ -113,7 +113,7 @@ private function removeUnusedFields(): void $fieldsToRemove = ['attribute_code', 'is_unique', 'frontend_class']; foreach ($fieldset->getElements() as $element) { /** @var AbstractElement $element */ - if (substr($element->getId(), 0, strlen('default_value')) == 'default_value') { + if (substr($element->getId(), 0, strlen('default_value')) === 'default_value') { $fieldsToRemove[] = $element->getId(); } } diff --git a/app/code/Magento/Catalog/Ui/Component/ColumnFactory.php b/app/code/Magento/Catalog/Ui/Component/ColumnFactory.php index c538273476b1f..bbcd9bbc9f03a 100644 --- a/app/code/Magento/Catalog/Ui/Component/ColumnFactory.php +++ b/app/code/Magento/Catalog/Ui/Component/ColumnFactory.php @@ -131,14 +131,14 @@ private function getDateConfig(ProductAttributeInterface $attribute): array $dateFormat = $isDatetime ? $this->timezone->getDateTimeFormat(\IntlDateFormatter::MEDIUM) : $this->timezone->getDateFormat(\IntlDateFormatter::MEDIUM); - $timeZone = $isDatetime + $timezone = $isDatetime ? $this->timezone->getConfigTimezone() : $this->timezone->getDefaultTimezone(); return [ - 'timeZone' => $timeZone, + 'timezone' => $timezone, 'dateFormat' => $dateFormat, - 'options' => [ 'showsTime' => $isDatetime], + 'options' => ['showsTime' => $isDatetime], ]; } diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php index e41b2390930f0..0c76feb2c94ec 100644 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php @@ -957,7 +957,7 @@ private function customizeWysiwyg(ProductAttributeInterface $attribute, array $m * @param array $meta * @return array */ - private function customizeDatetimeAttribute(array $meta) + private function customizeDatetimeAttribute(array $meta): array { $meta['arguments']['data']['config']['options']['showsTime'] = 1; diff --git a/app/code/Magento/Eav/Model/Entity/Attribute/Frontend/Datetime.php b/app/code/Magento/Eav/Model/Entity/Attribute/Frontend/Datetime.php index 8effd73d34af2..ea454fc0bcc74 100644 --- a/app/code/Magento/Eav/Model/Entity/Attribute/Frontend/Datetime.php +++ b/app/code/Magento/Eav/Model/Entity/Attribute/Frontend/Datetime.php @@ -44,12 +44,12 @@ public function getValue(\Magento\Framework\DataObject $object) $value = parent::getValue($object); if ($value) { - $timeType = $this->getAttribute()->getFrontendInput() === 'datetime' + $showTime = $this->getAttribute()->getFrontendInput() === 'datetime' ? \IntlDateFormatter::MEDIUM : \IntlDateFormatter::NONE; $data = $this->_localeDate->formatDateTime( new \DateTime($value), \IntlDateFormatter::MEDIUM, - $timeType + $showTime ); } diff --git a/app/code/Magento/Ui/Component/Form/Element/DataType/Date.php b/app/code/Magento/Ui/Component/Form/Element/DataType/Date.php index 8ea6236e8e2e2..6bf1eacd161cc 100644 --- a/app/code/Magento/Ui/Component/Form/Element/DataType/Date.php +++ b/app/code/Magento/Ui/Component/Form/Element/DataType/Date.php @@ -127,20 +127,20 @@ public function convertDate($date, $hour = 0, $minute = 0, $second = 0, $setUtcT * Convert given date to default (UTC) timezone * * @param string $date - * @param bool $setUtcTimeZone + * @param bool $setUtcTimezone * @return \DateTime|null */ - public function convertDatetime(string $date, bool $setUtcTimeZone = true): ?\DateTime + public function convertDatetime(string $date, bool $setUtcTimezone = true): ?\DateTime { try { $date = rtrim($date, 'Z'); $dateObj = new \DateTime($date, new \DateTimeZone($this->localeDate->getConfigTimezone())); //convert store date to default date in UTC timezone without DST - if ($setUtcTimeZone) { + if ($setUtcTimezone) { $dateObj->setTimezone(new \DateTimeZone('UTC')); } return $dateObj; - } catch (\Exception $e) { + } catch (\Throwable $e) { return null; } } diff --git a/app/code/Magento/Ui/view/base/web/js/grid/columns/date.js b/app/code/Magento/Ui/view/base/web/js/grid/columns/date.js index cc69d990372c1..3179529e282c6 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/columns/date.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/columns/date.js @@ -46,8 +46,8 @@ define([ moment.locale(this.storeLocale, utils.extend({}, this.calendarConfig)); } - if (!_.isUndefined(this.timeZone)) { - date = date.tz(this.timeZone); + if (!_.isUndefined(this.timezone)) { + date = date.tz(this.timezone); } date = date.isValid() && value[this.index] ? diff --git a/dev/tests/integration/testsuite/Magento/Eav/Model/Entity/AttributeTest.php b/dev/tests/integration/testsuite/Magento/Eav/Model/Entity/AttributeTest.php index 5df08762e29a7..5b05308c786b5 100644 --- a/dev/tests/integration/testsuite/Magento/Eav/Model/Entity/AttributeTest.php +++ b/dev/tests/integration/testsuite/Magento/Eav/Model/Entity/AttributeTest.php @@ -7,7 +7,6 @@ namespace Magento\Eav\Model\Entity; -use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Locale\ResolverInterface; use Magento\Framework\ObjectManagerInterface; use Magento\TestFramework\Helper\Bootstrap; @@ -103,7 +102,7 @@ public function beforeSaveDataProvider() * @param string $locale * @param string $expected * @dataProvider beforeSaveErrorDataDataProvider - * @expectedException LocalizedException + * @expectedException \Magento\Framework\Exception\LocalizedException */ public function testBeforeSaveErrorData($defaultValue, $backendType, $locale, $expected) { From 9c9f9fcc5bed3b5df1ef81df4c8ff3333a826bb1 Mon Sep 17 00:00:00 2001 From: Daniel Ruf <d.ruf@bitexpert.de> Date: Tue, 8 Oct 2019 09:55:29 +0200 Subject: [PATCH 031/586] Fix parameter order --- .../Magento/AsynchronousOperations/Model/OperationProcessor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/AsynchronousOperations/Model/OperationProcessor.php b/app/code/Magento/AsynchronousOperations/Model/OperationProcessor.php index a617a943db9f9..5f644fa03ae27 100644 --- a/app/code/Magento/AsynchronousOperations/Model/OperationProcessor.php +++ b/app/code/Magento/AsynchronousOperations/Model/OperationProcessor.php @@ -80,9 +80,9 @@ class OperationProcessor * @param ConsumerConfigurationInterface $configuration * @param Json $jsonHelper * @param OperationManagementInterface $operationManagement - * @param LoggerInterface $logger * @param \Magento\Framework\Webapi\ServiceOutputProcessor $serviceOutputProcessor * @param \Magento\Framework\Communication\ConfigInterface $communicationConfig + * @param LoggerInterface $logger */ public function __construct( MessageValidator $messageValidator, From 7c55ae5bb6322225b97cdc5c61884e75cb6575b8 Mon Sep 17 00:00:00 2001 From: Daniel Ruf <d.ruf@bitexpert.de> Date: Tue, 8 Oct 2019 10:11:54 +0200 Subject: [PATCH 032/586] Add missing types --- .../AsynchronousOperations/Model/OperationProcessor.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/AsynchronousOperations/Model/OperationProcessor.php b/app/code/Magento/AsynchronousOperations/Model/OperationProcessor.php index 5f644fa03ae27..ded507958d8a3 100644 --- a/app/code/Magento/AsynchronousOperations/Model/OperationProcessor.php +++ b/app/code/Magento/AsynchronousOperations/Model/OperationProcessor.php @@ -174,8 +174,8 @@ public function process(string $encodedMessage) /** * Execute topic handler * - * @param $callback - * @param $entityParams + * @param callable $callback + * @param array $entityParams * @return array */ private function executeHandler($callback, $entityParams) From 6e5e27fbd66f06423dd53ac9c7b2d8bc645227ba Mon Sep 17 00:00:00 2001 From: Daniel Ruf <d.ruf@bitexpert.de> Date: Tue, 8 Oct 2019 11:20:58 +0200 Subject: [PATCH 033/586] Refactor array_merge in loop and call_user_func_array --- .../AsynchronousOperations/Model/OperationProcessor.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/AsynchronousOperations/Model/OperationProcessor.php b/app/code/Magento/AsynchronousOperations/Model/OperationProcessor.php index ded507958d8a3..5e7cb6b7a0916 100644 --- a/app/code/Magento/AsynchronousOperations/Model/OperationProcessor.php +++ b/app/code/Magento/AsynchronousOperations/Model/OperationProcessor.php @@ -133,13 +133,15 @@ public function process(string $encodedMessage) $outputData = null; if ($errorCode === null) { + $handlerMessages = []; foreach ($handlers as $callback) { $result = $this->executeHandler($callback, $entityParams); $status = $result['status']; $errorCode = $result['error_code']; - $messages = array_merge($messages, $result['messages']); + $handlerMessages[] = $result['messages']; $outputData = $result['output_data']; } + $messages = array_merge($messages, ...$handlerMessages); } if (isset($outputData)) { @@ -187,7 +189,7 @@ private function executeHandler($callback, $entityParams) 'output_data' => null ]; try { - $result['output_data'] = call_user_func_array($callback, $entityParams); + $result['output_data'] = $callback(...$entityParams); $result['messages'][] = sprintf('Service execution success %s::%s', get_class($callback[0]), $callback[1]); } catch (\Zend_Db_Adapter_Exception $e) { $this->logger->critical($e->getMessage()); From 7b05c055b110b3bb8441afbdb1e9d8bfbeed6516 Mon Sep 17 00:00:00 2001 From: Daniel Ruf <d.ruf@bitexpert.de> Date: Tue, 8 Oct 2019 13:14:15 +0200 Subject: [PATCH 034/586] Revert small change --- .../AsynchronousOperations/Model/OperationProcessor.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/code/Magento/AsynchronousOperations/Model/OperationProcessor.php b/app/code/Magento/AsynchronousOperations/Model/OperationProcessor.php index 5e7cb6b7a0916..f7a411c745b1f 100644 --- a/app/code/Magento/AsynchronousOperations/Model/OperationProcessor.php +++ b/app/code/Magento/AsynchronousOperations/Model/OperationProcessor.php @@ -133,15 +133,13 @@ public function process(string $encodedMessage) $outputData = null; if ($errorCode === null) { - $handlerMessages = []; foreach ($handlers as $callback) { $result = $this->executeHandler($callback, $entityParams); $status = $result['status']; $errorCode = $result['error_code']; - $handlerMessages[] = $result['messages']; + $messages = array_merge($messages, $result['messages']); $outputData = $result['output_data']; } - $messages = array_merge($messages, ...$handlerMessages); } if (isset($outputData)) { From 5a014040afd71105af6ba32737ceba8436d6e640 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Tue, 8 Oct 2019 15:42:11 +0300 Subject: [PATCH 035/586] MC-5233: DateTime product attributes support --- .../AdminProductAttributeActionGroup.xml | 11 ++++ .../Test/Mftf/Data/ProductAttributeData.xml | 4 ++ .../AdminCreateProductAttributeSection.xml | 1 + ...dminCreateDatetimeProductAttributeTest.xml | 61 +++++++++++++++++++ 4 files changed, 77 insertions(+) create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml index 3e54574c553e3..4081a362153bb 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml @@ -370,4 +370,15 @@ <checkOption selector="{{AttributePropertiesSection.dropdownNthOptionIsDefault(row)}}" stepKey="setAsDefault" after="fillStoreView"/> </actionGroup> + + <!-- Go to advanced attribute properties --> + <actionGroup name="AdminNavigateToProductAttributeAdvancedSection"> + <annotations> + <description>Navigate and open Advanced Attribute Properties section on product attribute page</description> + </annotations> + + <scrollTo selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}" stepKey="scrollToSection"/> + <click selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}" stepKey="openSection"/> + <waitForElementVisible selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" stepKey="waitForSlideOutSection"/> + </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml index 6614fa4b5dbeb..38a273fe9fb41 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml @@ -309,6 +309,10 @@ <data key="frontend_input">date</data> <data key="is_required_admin">No</data> </entity> + <entity name="datetimeProductAttribute" extends="productAttributeWysiwyg" type="ProductAttribute"> + <data key="frontend_input">datetime</data> + <data key="is_required_admin">No</data> + </entity> <entity name="priceProductAttribute" extends="productAttributeWysiwyg" type="ProductAttribute"> <data key="frontend_input">date</data> <data key="is_required_admin">No</data> diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml index 462f721913b9c..1236e07a2f278 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml @@ -93,6 +93,7 @@ <element name="DefaultValueText" type="textarea" selector="#default_value_text"/> <element name="DefaultValueTextArea" type="textarea" selector="#default_value_textarea"/> <element name="DefaultValueDate" type="textarea" selector="#default_value_date"/> + <element name="DefaultValueDatetime" type="textarea" selector="#default_value_datetime"/> <element name="DefaultValueYesNo" type="textarea" selector="#default_value_yesno"/> <element name="Scope" type="select" selector="#is_global"/> <element name="UniqueValue" type="select" selector="#is_unique"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml new file mode 100644 index 0000000000000..5d1f0716f33f7 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml @@ -0,0 +1,61 @@ +<?xml version="1.0"?> +<!-- +/** + * 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="AdminCreateDatetimeProductAttributeTest"> + <annotations> + <features value="Catalog"/> + <stories value="Datetime product attributes support"/> + <title value="Datetime product attribute type is supported"/> + <description value="Admin should be able to create datetime product attribute"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-21451"/> + <group value="Catalog"/> + </annotations> + <before> + <actionGroup ref="LoginAsAdmin" stepKey="login"/> + </before> + <after> + <actionGroup ref="deleteProductAttribute" stepKey="deleteAttribute"> + <argument name="ProductAttribute" value="datetimeProductAttribute"/> + </actionGroup> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <amOnPage url="{{ProductAttributePage.url}}" stepKey="navigateToNewProductAttributePage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <!-- Set attribute properties --> + <fillField selector="{{AttributePropertiesSection.DefaultLabel}}" + userInput="{{ProductAttributeFrontendLabel.label}}" stepKey="fillDefaultLabel"/> + <selectOption selector="{{AttributePropertiesSection.InputType}}" + userInput="{{datetimeProductAttribute.frontend_input}}" stepKey="fillInputType"/> + <actionGroup ref="AdminNavigateToProductAttributeAdvancedSection" stepKey="goToAdvancedSectionNew"/> + <fillField selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" + userInput="{{datetimeProductAttribute.attribute_code}}" + stepKey="fillAttributeCode"/> + <!-- Generate and set a default value --> + <generateDate date="now" format="m/j/y g:i A" stepKey="generateDefaultValue"/> + <fillField selector="{{AdvancedAttributePropertiesSection.DefaultValueDatetime}}" + userInput="{$generateDefaultValue}" + stepKey="fillDefaultValue"/> + <!-- Save the new product attribute --> + <click selector="{{AttributePropertiesSection.Save}}" stepKey="clickSaveAttribute"/> + <waitForPageLoad stepKey="waitForGridPageLoadAfterSaveAttribute"/> + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" + stepKey="waitForSuccessMessage"/> + <!-- Navigate to created product attribute --> + <actionGroup ref="navigateToCreatedProductAttribute" stepKey="navigateToAttribute"> + <argument name="ProductAttribute" value="datetimeProductAttribute"/> + </actionGroup> + <!-- Check the saved date and time default value --> + <actionGroup ref="AdminNavigateToProductAttributeAdvancedSection" stepKey="goToAdvancedSection"/> + <scrollTo selector="{{AdvancedAttributePropertiesSection.DefaultValueDatetime}}" stepKey="scrollToDefaultValue"/> + <seeInField userInput="{$generateDefaultValue}" + selector="{{AdvancedAttributePropertiesSection.DefaultValueDatetime}}" + stepKey="checkDefaultValue"/> + </test> +</tests> From a9f42f9ed40aef0aaaefd5754d575fcb80f4fc7d Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Tue, 8 Oct 2019 15:43:47 +0300 Subject: [PATCH 036/586] MC-5233: DateTime product attributes support --- app/code/Magento/Ui/view/base/web/js/grid/columns/date.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Ui/view/base/web/js/grid/columns/date.js b/app/code/Magento/Ui/view/base/web/js/grid/columns/date.js index 3179529e282c6..88959cda7499d 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/columns/date.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/columns/date.js @@ -40,12 +40,14 @@ define([ * @returns {String} Formatted date. */ getLabel: function (value, format) { - var date = moment.utc(this._super()); + var date; if (this.storeLocale !== undefined) { moment.locale(this.storeLocale, utils.extend({}, this.calendarConfig)); } + date = moment.utc(this._super()); + if (!_.isUndefined(this.timezone)) { date = date.tz(this.timezone); } From db1887747b87bc699c3ceb9796aff30eed30a0a5 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <engcom-vendorworker-foxtrot@adobe.com> Date: Tue, 8 Oct 2019 16:22:53 +0300 Subject: [PATCH 037/586] magento/magento2#24103: Refactoring. --- .../AdminNotification/Block/Grid/Renderer/Actions.php | 10 +++++----- .../AdminNotification/Block/Grid/Renderer/Notice.php | 4 ++-- .../AdminNotification/Block/Grid/Renderer/Severity.php | 2 +- .../Test/Unit/Block/Grid/Renderer/SeverityTest.php | 7 +++++-- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php b/app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php index 86cf528fd4971..0a19531a34a0c 100644 --- a/app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php +++ b/app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php @@ -47,14 +47,14 @@ public function __construct(Context $context, Data $urlHelper, array $data = []) */ public function render(DataObject $row) { - $readDetailsHtml = $row->getData('url') ? '<a class="action-details" target="_blank" href="' . - $this->escapeUrl($row->getData('url')) + $readDetailsHtml = $row->getUrl() ? '<a class="action-details" target="_blank" href="' . + $this->escapeUrl($row->getUrl()) . '">' . __('Read Details') . '</a>' : ''; - $markAsReadHtml = !$row->getData('is_read') ? '<a class="action-mark" href="' . $this->getUrl( + $markAsReadHtml = !$row->getIsRead() ? '<a class="action-mark" href="' . $this->getUrl( '*/*/markAsRead/', - ['_current' => true, 'id' => $row->getData('notification_id')] + ['_current' => true, 'id' => $row->getNotificationId()] ) . '">' . __( 'Mark as Read' ) . '</a>' : ''; @@ -68,7 +68,7 @@ public function render(DataObject $row) '*/*/remove/', [ '_current' => true, - 'id' => $row->getData('notification_id'), + 'id' => $row->getNotificationId(), ActionInterface::PARAM_NAME_URL_ENCODED => $encodedUrl ] ), diff --git a/app/code/Magento/AdminNotification/Block/Grid/Renderer/Notice.php b/app/code/Magento/AdminNotification/Block/Grid/Renderer/Notice.php index 1cf56d60db9de..bd553e97aff79 100644 --- a/app/code/Magento/AdminNotification/Block/Grid/Renderer/Notice.php +++ b/app/code/Magento/AdminNotification/Block/Grid/Renderer/Notice.php @@ -28,8 +28,8 @@ class Notice extends AbstractRenderer public function render(DataObject $row) { return '<span class="grid-row-title">' . - $this->escapeHtml($row->getData('title')) . + $this->escapeHtml($row->getTitle()) . '</span>' . - ($row->getData('description') ? '<br />' . $this->escapeHtml($row->getData('description')) : ''); + ($row->getDescription() ? '<br />' . $this->escapeHtml($row->getDescription()) : ''); } } diff --git a/app/code/Magento/AdminNotification/Block/Grid/Renderer/Severity.php b/app/code/Magento/AdminNotification/Block/Grid/Renderer/Severity.php index d50781b1f6415..f7f8633e42e79 100644 --- a/app/code/Magento/AdminNotification/Block/Grid/Renderer/Severity.php +++ b/app/code/Magento/AdminNotification/Block/Grid/Renderer/Severity.php @@ -50,7 +50,7 @@ public function render(DataObject $row) $value = ''; $column = $this->getColumn(); - $index = $column->getData('index'); + $index = $column->getIndex(); switch ($row->getData($index)) { case MessageInterface::SEVERITY_CRITICAL: $class = 'critical'; diff --git a/app/code/Magento/AdminNotification/Test/Unit/Block/Grid/Renderer/SeverityTest.php b/app/code/Magento/AdminNotification/Test/Unit/Block/Grid/Renderer/SeverityTest.php index f42c740ca8fee..2a30be02f173b 100644 --- a/app/code/Magento/AdminNotification/Test/Unit/Block/Grid/Renderer/SeverityTest.php +++ b/app/code/Magento/AdminNotification/Test/Unit/Block/Grid/Renderer/SeverityTest.php @@ -44,8 +44,11 @@ protected function setUp() : void public function testShouldRenderSeverity() : void { /** @var Column | \PHPUnit_Framework_MockObject_MockObject $columnMock */ - $columnMock = $this->getMockBuilder(Column::class)->disableOriginalConstructor()->getMock(); - $columnMock->expects($this->exactly(5))->method('getData')->with($this->equalTo('index'))->willReturn('index'); + $columnMock = $this->getMockBuilder(Column::class) + ->disableOriginalConstructor() + ->setMethods(['getIndex']) + ->getMock(); + $columnMock->expects($this->exactly(5))->method('getIndex')->willReturn('index'); $this->sut->setColumn($columnMock); $dataObject = new DataObject(); From 1a780d2a113b0deba056fc983e2660aa4d21ff58 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Wed, 9 Oct 2019 14:42:37 +0300 Subject: [PATCH 038/586] MC-5233: DateTime product attributes support --- .../AdminProductAttributeActionGroup.xml | 19 +++++- .../Test/Mftf/Data/ProductAttributeData.xml | 2 +- .../Section/AdminProductGridFilterSection.xml | 2 + ...dminCreateDatetimeProductAttributeTest.xml | 37 ++++------- ...SimpleProductWithDatetimeAttributeTest.xml | 65 +++++++++++++++++++ 5 files changed, 98 insertions(+), 27 deletions(-) create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml index 4081a362153bb..bc99e8d3f57e9 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml @@ -345,6 +345,23 @@ <fillField stepKey="fillDefaultValue" selector="{{AdvancedAttributePropertiesSection.DefaultValueDate}}" userInput="{{date}}"/> </actionGroup> + <!-- Inputs datetime default value and attribute code--> + <actionGroup name="CreateProductAttributeWithDatetimeField" extends="createProductAttribute" insertAfter="checkRequired"> + <annotations> + <description>EXTENDS: createProductAttribute. Fills in the Attribute Code and Default Value (Attribute Type: Date and Time Field).</description> + </annotations> + <arguments> + <argument name="date" type="string"/> + </arguments> + + <scrollTo selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}" stepKey="scrollToAdvancedSection"/> + <click selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}" stepKey="openAdvancedSection"/> + <waitForElementVisible selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" stepKey="waitForSlideOutAdvancedSection"/> + <fillField stepKey="fillCode" selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" userInput="{{attribute.attribute_code}}"/> + <scrollTo selector="{{AdvancedAttributePropertiesSection.DefaultValueDatetime}}" stepKey="scrollToDefaultField"/> + <fillField stepKey="fillDefaultValue" selector="{{AdvancedAttributePropertiesSection.DefaultValueDatetime}}" userInput="{{date}}"/> + </actionGroup> + <!-- Creates dropdown option at row without saving--> <actionGroup name="createAttributeDropdownNthOption"> <annotations> @@ -377,7 +394,7 @@ <description>Navigate and open Advanced Attribute Properties section on product attribute page</description> </annotations> - <scrollTo selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}" stepKey="scrollToSection"/> + <scrollTo selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}" stepKey="scrollToSection"/> <click selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}" stepKey="openSection"/> <waitForElementVisible selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" stepKey="waitForSlideOutSection"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml index 38a273fe9fb41..b24a765706f2d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml @@ -309,7 +309,7 @@ <data key="frontend_input">date</data> <data key="is_required_admin">No</data> </entity> - <entity name="datetimeProductAttribute" extends="productAttributeWysiwyg" type="ProductAttribute"> + <entity name="DatetimeProductAttribute" extends="productAttributeWysiwyg" type="ProductAttribute"> <data key="frontend_input">datetime</data> <data key="is_required_admin">No</data> </entity> diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductGridFilterSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductGridFilterSection.xml index 3b6f24c0f259d..4e86f14611c24 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductGridFilterSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductGridFilterSection.xml @@ -36,5 +36,7 @@ <element name="productCount" type="text" selector="#catalog_category_products-total-count"/> <element name="productPerPage" type="select" selector="#catalog_category_products_page-limit"/> <element name="storeViewDropdown" type="text" selector="//select[@name='store_id']/option[contains(.,'{{storeView}}')]" parameterized="true"/> + <element name="inputByCodeRangeFrom" type="input" selector="input.admin__control-text[name='{{code}}[from]']" parameterized="true"/> + <element name="inputByCodeRangeTo" type="input" selector="input.admin__control-text[name='{{code}}[to]']" parameterized="true"/> </section> </sections> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml index 5d1f0716f33f7..d084eb962c5da 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml @@ -14,44 +14,31 @@ <description value="Admin should be able to create datetime product attribute"/> <severity value="CRITICAL"/> <testCaseId value="MC-21451"/> - <group value="Catalog"/> + <group value="catalog"/> </annotations> <before> <actionGroup ref="LoginAsAdmin" stepKey="login"/> </before> <after> <actionGroup ref="deleteProductAttribute" stepKey="deleteAttribute"> - <argument name="ProductAttribute" value="datetimeProductAttribute"/> + <argument name="ProductAttribute" value="DatetimeProductAttribute"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> </after> - - <amOnPage url="{{ProductAttributePage.url}}" stepKey="navigateToNewProductAttributePage"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <!-- Set attribute properties --> - <fillField selector="{{AttributePropertiesSection.DefaultLabel}}" - userInput="{{ProductAttributeFrontendLabel.label}}" stepKey="fillDefaultLabel"/> - <selectOption selector="{{AttributePropertiesSection.InputType}}" - userInput="{{datetimeProductAttribute.frontend_input}}" stepKey="fillInputType"/> - <actionGroup ref="AdminNavigateToProductAttributeAdvancedSection" stepKey="goToAdvancedSectionNew"/> - <fillField selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" - userInput="{{datetimeProductAttribute.attribute_code}}" - stepKey="fillAttributeCode"/> - <!-- Generate and set a default value --> + <!-- Generate the datetime default value --> <generateDate date="now" format="m/j/y g:i A" stepKey="generateDefaultValue"/> - <fillField selector="{{AdvancedAttributePropertiesSection.DefaultValueDatetime}}" - userInput="{$generateDefaultValue}" - stepKey="fillDefaultValue"/> - <!-- Save the new product attribute --> - <click selector="{{AttributePropertiesSection.Save}}" stepKey="clickSaveAttribute"/> - <waitForPageLoad stepKey="waitForGridPageLoadAfterSaveAttribute"/> - <seeElement selector="{{AdminProductMessagesSection.successMessage}}" - stepKey="waitForSuccessMessage"/> + <!-- Create new datetime product attribute --> + <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="goToProductAttributes"/> + <waitForPageLoad stepKey="waitForPageLoadAttributes"/> + <actionGroup ref="CreateProductAttributeWithDatetimeField" stepKey="createAttribute"> + <argument name="attribute" value="DatetimeProductAttribute"/> + <argument name="date" value="{$generateDefaultValue}"/> + </actionGroup> <!-- Navigate to created product attribute --> <actionGroup ref="navigateToCreatedProductAttribute" stepKey="navigateToAttribute"> - <argument name="ProductAttribute" value="datetimeProductAttribute"/> + <argument name="ProductAttribute" value="DatetimeProductAttribute"/> </actionGroup> - <!-- Check the saved date and time default value --> + <!-- Check the saved datetime default value --> <actionGroup ref="AdminNavigateToProductAttributeAdvancedSection" stepKey="goToAdvancedSection"/> <scrollTo selector="{{AdvancedAttributePropertiesSection.DefaultValueDatetime}}" stepKey="scrollToDefaultValue"/> <seeInField userInput="{$generateDefaultValue}" diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml new file mode 100644 index 0000000000000..a21c5a84447dc --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml @@ -0,0 +1,65 @@ +<?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="AdminCreateSimpleProductWithDatetimeAttributeTest"> + <annotations> + <features value="Catalog"/> + <stories value="Datetime product attributes support"/> + <title value="Set datetime attribute to product"/> + <description value="Admin should be able to specify datetime attribute to product and find by them in product grid"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-21461"/> + <group value="catalog"/> + </annotations> + + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + </before> + <after> + <deleteData createDataKey="createDatetimeAttribute" stepKey="DatetimeProductAttribute"/> + <actionGroup ref="deleteProductBySku" stepKey="deleteCreatedProduct"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!-- Generate default value --> + <generateDate date="now" format="m/j/Y g:i A" stepKey="generateDefaultValue"/> + <generateDate date="now" format="M j, Y g:i:00 A" stepKey="generateDefaultGridValue"/> + <generateDate date="+1 minute" format="m/j/Y g:i A" stepKey="generateFilterToDate"/> + <!-- Create new datetime product attribute --> + <createData entity="DatetimeProductAttribute" stepKey="createDatetimeAttribute"> + <field key="default_value">{$generateDefaultValue}</field> + </createData> + <!-- Open the new simple product page --> + <actionGroup ref="AdminOpenNewProductFormPageActionGroup" stepKey="openNewProductPage"/> + <actionGroup ref="fillMainProductForm" stepKey="fillDefaultProductFields"/> + <!-- Add datetime attribute --> + <actionGroup ref="addProductAttributeInProductModal" stepKey="addDatetimeAttribute"> + <argument name="attributeCode" value="$createDatetimeAttribute.attribute_code$"/> + </actionGroup> + <!-- Check default value --> + <scrollTo selector="{{AdminProductAttributesSection.sectionHeader}}" stepKey="goToAttributesSection"/> + <click selector="{{AdminProductAttributesSection.sectionHeader}}" stepKey="openAttributesSection"/> + <waitForElementVisible selector="{{AdminProductAttributesSection.attributeTextInputByCode($createDatetimeAttribute.attribute_code$)}}" stepKey="waitForSlideOutAttributes"/> + <seeInField selector="{{AdminProductAttributesSection.attributeTextInputByCode($createDatetimeAttribute.attribute_code$)}}" userInput="$generateDefaultValue" stepKey="checkDefaultValue"/> + <!-- Save the product --> + <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <!-- Check datetime grid filter --> + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToAdminProductIndexPage"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.inputByCodeRangeFrom($createDatetimeAttribute.attribute_code$)}}" userInput="{$generateDefaultValue}" stepKey="fillProductDatetimeFromFilter"/> + <fillField selector="{{AdminProductGridFilterSection.inputByCodeRangeTo($createDatetimeAttribute.attribute_code$)}}" userInput="{$generateFilterToDate}" stepKey="fillProductDatetimeToFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad"/> + <see selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="{{_defaultProduct.name}}" stepKey="checkAppliedDatetimeFilter"/> + <see selector="{{AdminProductGridSection.productGridContentsOnRow('1')}}" userInput="{$generateDefaultGridValue}" stepKey="checkDefaultValueInGrid"/> + </test> +</tests> From 7379bc9a62df7af85003a26bf94f72bee16989cc Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Thu, 10 Oct 2019 11:16:11 +0300 Subject: [PATCH 039/586] MC-5233: DateTime product attributes support --- .../AdminProductAttributeActionGroup.xml | 10 +++++----- .../Section/AdminCreateProductAttributeSection.xml | 2 +- .../AdminCreateDatetimeProductAttributeTest.xml | 5 +++-- ...reateSimpleProductWithDatetimeAttributeTest.xml | 14 +++++++------- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml index bc99e8d3f57e9..6deec50a831b4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml @@ -355,11 +355,11 @@ </arguments> <scrollTo selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}" stepKey="scrollToAdvancedSection"/> - <click selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}" stepKey="openAdvancedSection"/> + <conditionalClick selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}" dependentSelector="{{AdvancedAttributePropertiesSection.AttributeCode}}" visible="false" stepKey="openAdvancedSection"/> <waitForElementVisible selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" stepKey="waitForSlideOutAdvancedSection"/> - <fillField stepKey="fillCode" selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" userInput="{{attribute.attribute_code}}"/> - <scrollTo selector="{{AdvancedAttributePropertiesSection.DefaultValueDatetime}}" stepKey="scrollToDefaultField"/> - <fillField stepKey="fillDefaultValue" selector="{{AdvancedAttributePropertiesSection.DefaultValueDatetime}}" userInput="{{date}}"/> + <fillField selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" userInput="{{attribute.attribute_code}}" stepKey="fillCode"/> + <scrollTo selector="{{AdvancedAttributePropertiesSection.defaultValueDatetime}}" stepKey="scrollToDefaultField"/> + <fillField selector="{{AdvancedAttributePropertiesSection.defaultValueDatetime}}" userInput="{{date}}" stepKey="fillDefaultValue"/> </actionGroup> <!-- Creates dropdown option at row without saving--> @@ -395,7 +395,7 @@ </annotations> <scrollTo selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}" stepKey="scrollToSection"/> - <click selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}" stepKey="openSection"/> + <conditionalClick selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}" dependentSelector="{{AdvancedAttributePropertiesSection.AttributeCode}}" visible="false" stepKey="openSection"/> <waitForElementVisible selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" stepKey="waitForSlideOutSection"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml index 1236e07a2f278..e6b86c7a9172b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml @@ -93,7 +93,7 @@ <element name="DefaultValueText" type="textarea" selector="#default_value_text"/> <element name="DefaultValueTextArea" type="textarea" selector="#default_value_textarea"/> <element name="DefaultValueDate" type="textarea" selector="#default_value_date"/> - <element name="DefaultValueDatetime" type="textarea" selector="#default_value_datetime"/> + <element name="defaultValueDatetime" type="textarea" selector="#default_value_datetime"/> <element name="DefaultValueYesNo" type="textarea" selector="#default_value_yesno"/> <element name="Scope" type="select" selector="#is_global"/> <element name="UniqueValue" type="select" selector="#is_unique"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml index d084eb962c5da..e46114ff752f6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml @@ -23,6 +23,7 @@ <actionGroup ref="deleteProductAttribute" stepKey="deleteAttribute"> <argument name="ProductAttribute" value="DatetimeProductAttribute"/> </actionGroup> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="resetGridFilter"/> <actionGroup ref="logout" stepKey="logout"/> </after> <!-- Generate the datetime default value --> @@ -40,9 +41,9 @@ </actionGroup> <!-- Check the saved datetime default value --> <actionGroup ref="AdminNavigateToProductAttributeAdvancedSection" stepKey="goToAdvancedSection"/> - <scrollTo selector="{{AdvancedAttributePropertiesSection.DefaultValueDatetime}}" stepKey="scrollToDefaultValue"/> + <scrollTo selector="{{AdvancedAttributePropertiesSection.defaultValueDatetime}}" stepKey="scrollToDefaultValue"/> <seeInField userInput="{$generateDefaultValue}" - selector="{{AdvancedAttributePropertiesSection.DefaultValueDatetime}}" + selector="{{AdvancedAttributePropertiesSection.defaultValueDatetime}}" stepKey="checkDefaultValue"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml index a21c5a84447dc..019baa4ac153d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml @@ -22,10 +22,11 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> </before> <after> - <deleteData createDataKey="createDatetimeAttribute" stepKey="DatetimeProductAttribute"/> + <deleteData createDataKey="createDatetimeAttribute" stepKey="deleteDatetimeAttribute"/> <actionGroup ref="deleteProductBySku" stepKey="deleteCreatedProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> + <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFiltersOnProductIndexPage"/> <actionGroup ref="logout" stepKey="logout"/> </after> @@ -53,13 +54,12 @@ <actionGroup ref="saveProductForm" stepKey="saveProduct"/> <!-- Check datetime grid filter --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToAdminProductIndexPage"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openProductFilters"/> <fillField selector="{{AdminProductGridFilterSection.inputByCodeRangeFrom($createDatetimeAttribute.attribute_code$)}}" userInput="{$generateDefaultValue}" stepKey="fillProductDatetimeFromFilter"/> <fillField selector="{{AdminProductGridFilterSection.inputByCodeRangeTo($createDatetimeAttribute.attribute_code$)}}" userInput="{$generateFilterToDate}" stepKey="fillProductDatetimeToFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad"/> - <see selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="{{_defaultProduct.name}}" stepKey="checkAppliedDatetimeFilter"/> - <see selector="{{AdminProductGridSection.productGridContentsOnRow('1')}}" userInput="{$generateDefaultGridValue}" stepKey="checkDefaultValueInGrid"/> + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFilters"/> + <see selector="{{AdminDataGridTableSection.gridCell('1', 'Name')}}" userInput="{{_defaultProduct.name}}" stepKey="checkAppliedDatetimeFilter"/> + <see selector="{{AdminDataGridTableSection.rowTemplateStrict(_defaultProduct.name)}}" userInput="{$generateDefaultGridValue}" stepKey="checkDefaultValueInGrid"/> </test> </tests> From 9110f821c258e91431596d835c0b811083d327f3 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Thu, 10 Oct 2019 12:44:11 +0300 Subject: [PATCH 040/586] MC-5233: DateTime product attributes support --- .../Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml | 1 + .../Test/Mftf/Section/AdminCreateProductAttributeSection.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml index 6deec50a831b4..389330fd7deb5 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml @@ -17,6 +17,7 @@ </arguments> <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingFilters"/> <fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="{{ProductAttribute.attribute_code}}" stepKey="setAttributeCode"/> <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/> <click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="clickOnAttributeRow"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml index e6b86c7a9172b..31c4f5198a8b0 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml @@ -93,7 +93,7 @@ <element name="DefaultValueText" type="textarea" selector="#default_value_text"/> <element name="DefaultValueTextArea" type="textarea" selector="#default_value_textarea"/> <element name="DefaultValueDate" type="textarea" selector="#default_value_date"/> - <element name="defaultValueDatetime" type="textarea" selector="#default_value_datetime"/> + <element name="defaultValueDatetime" type="text" selector="#default_value_datetime"/> <element name="DefaultValueYesNo" type="textarea" selector="#default_value_yesno"/> <element name="Scope" type="select" selector="#is_global"/> <element name="UniqueValue" type="select" selector="#is_unique"/> From c5a1666a93e10806f1861a7df958a6f4de5c4a99 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Thu, 10 Oct 2019 12:49:48 +0300 Subject: [PATCH 041/586] MC-5233: DateTime product attributes support --- .../Test/Unit/Ui/Component/ColumnFactoryTest.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Unit/Ui/Component/ColumnFactoryTest.php b/app/code/Magento/Catalog/Test/Unit/Ui/Component/ColumnFactoryTest.php index f002173de7996..4e6730b553307 100644 --- a/app/code/Magento/Catalog/Test/Unit/Ui/Component/ColumnFactoryTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Ui/Component/ColumnFactoryTest.php @@ -56,7 +56,7 @@ class ColumnFactoryTest extends TestCase /** * @var TimezoneInterface|MockObject */ - private $timeZone; + private $timezone; /** * @inheritdoc @@ -80,13 +80,13 @@ protected function setUp(): void $this->column = $this->getMockForAbstractClass(ColumnInterface::class); $this->uiComponentFactory->method('create') ->willReturn($this->column); - $this->timeZone = $this->createMock(TimezoneInterface::class); + $this->timezone = $this->createMock(TimezoneInterface::class); $this->columnFactory = $this->objectManager->getObject( ColumnFactory::class, [ 'componentFactory' => $this->uiComponentFactory, - 'timezone' => $this->timeZone, + 'timezone' => $this->timezone, ] ); } @@ -203,7 +203,7 @@ public function testCreateDateColumn( 'visible' => true, 'filter' => 'dateRange', 'component' => 'Magento_Ui/js/grid/columns/date', - 'timeZone' => $expectedTimezone, + 'timezone' => $expectedTimezone, 'dateFormat' => $expectedDateFormat, 'options' => [ 'showsTime' => $showsTime @@ -224,15 +224,15 @@ public function testCreateDateColumn( $this->attribute->method('getFrontendInput') ->willReturn($frontendInput); - $this->timeZone->method('getDateFormat') + $this->timezone->method('getDateFormat') ->with(\IntlDateFormatter::MEDIUM) ->willReturn($dateFormat); - $this->timeZone->method('getDateTimeFormat') + $this->timezone->method('getDateTimeFormat') ->with(\IntlDateFormatter::MEDIUM) ->willReturn($dateTimeFormat); - $this->timeZone->method('getDefaultTimezone') + $this->timezone->method('getDefaultTimezone') ->willReturn($defaultTimezone); - $this->timeZone->method('getConfigTimezone') + $this->timezone->method('getConfigTimezone') ->willReturn($configTimezone); $this->uiComponentFactory->expects($this->once()) From e9f0b8a117f09134ed15652e551266a237de3c6e Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Thu, 10 Oct 2019 14:12:39 +0300 Subject: [PATCH 042/586] MC-5233: DateTime product attributes support --- .../Test/Mftf/Section/AdminCreateProductAttributeSection.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml index 31c4f5198a8b0..0934e39dcb062 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml @@ -93,7 +93,7 @@ <element name="DefaultValueText" type="textarea" selector="#default_value_text"/> <element name="DefaultValueTextArea" type="textarea" selector="#default_value_textarea"/> <element name="DefaultValueDate" type="textarea" selector="#default_value_date"/> - <element name="defaultValueDatetime" type="text" selector="#default_value_datetime"/> + <element name="defaultValueDatetime" type="date" selector="#default_value_datetime"/> <element name="DefaultValueYesNo" type="textarea" selector="#default_value_yesno"/> <element name="Scope" type="select" selector="#is_global"/> <element name="UniqueValue" type="select" selector="#is_unique"/> From 27e2049537f34d8ce0748e2f47afc9f95ffed1b1 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Thu, 10 Oct 2019 17:09:16 +0300 Subject: [PATCH 043/586] MC-5233: DateTime product attributes support --- app/code/Magento/Catalog/Ui/Component/Listing/Columns.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Ui/Component/Listing/Columns.php b/app/code/Magento/Catalog/Ui/Component/Listing/Columns.php index d7b9bc3846f49..1e056d9f8d517 100644 --- a/app/code/Magento/Catalog/Ui/Component/Listing/Columns.php +++ b/app/code/Magento/Catalog/Ui/Component/Listing/Columns.php @@ -14,7 +14,7 @@ class Columns extends \Magento\Ui\Component\Listing\Columns { /** - * Default columns max order + * Default columns max order value */ const DEFAULT_COLUMNS_MAX_ORDER = 100; From ee1807bbcd027f37f0d3460710c713f9793b5395 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Fri, 11 Oct 2019 13:34:14 +0300 Subject: [PATCH 044/586] MC-5233: DateTime product attributes support --- .../AdminCreateSimpleProductWithDatetimeAttributeTest.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml index 019baa4ac153d..6772e95b6ec27 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml @@ -45,13 +45,15 @@ <actionGroup ref="addProductAttributeInProductModal" stepKey="addDatetimeAttribute"> <argument name="attributeCode" value="$createDatetimeAttribute.attribute_code$"/> </actionGroup> + <!-- Flush config cache to reset product attributes in attribute set --> + <magentoCLI command="cache:flush" arguments="config" stepKey="flushConfigCache"/> + <!-- Save the product --> + <actionGroup ref="saveProductForm" stepKey="saveProduct"/> <!-- Check default value --> <scrollTo selector="{{AdminProductAttributesSection.sectionHeader}}" stepKey="goToAttributesSection"/> <click selector="{{AdminProductAttributesSection.sectionHeader}}" stepKey="openAttributesSection"/> <waitForElementVisible selector="{{AdminProductAttributesSection.attributeTextInputByCode($createDatetimeAttribute.attribute_code$)}}" stepKey="waitForSlideOutAttributes"/> <seeInField selector="{{AdminProductAttributesSection.attributeTextInputByCode($createDatetimeAttribute.attribute_code$)}}" userInput="$generateDefaultValue" stepKey="checkDefaultValue"/> - <!-- Save the product --> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> <!-- Check datetime grid filter --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToAdminProductIndexPage"/> <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> From b5787de0a17e13c749cf4bc5a3df771f8435829d Mon Sep 17 00:00:00 2001 From: Namrata Vora <namrata@seepossible.com> Date: Thu, 17 Oct 2019 14:04:45 +0530 Subject: [PATCH 045/586] Added translate for strings and added missing node in existing translate attribute on xml. --- app/code/Magento/AdvancedSearch/etc/adminhtml/system.xml | 2 +- app/code/Magento/Analytics/etc/adminhtml/system.xml | 2 +- .../view/adminhtml/ui_component/bulk_listing.xml | 2 +- .../Magento_Backend/layout/layout_test_grid_handle.xml | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/AdvancedSearch/etc/adminhtml/system.xml b/app/code/Magento/AdvancedSearch/etc/adminhtml/system.xml index 63c78e07c7bfc..905dd3e7d1819 100644 --- a/app/code/Magento/AdvancedSearch/etc/adminhtml/system.xml +++ b/app/code/Magento/AdvancedSearch/etc/adminhtml/system.xml @@ -60,7 +60,7 @@ <field id="search_suggestion_enabled">1</field> </depends> </field> - <field id="search_suggestion_count_results_enabled" translate="label" type="select" sortOrder="92" showInDefault="1" showInWebsite="1" showInStore="1"> + <field id="search_suggestion_count_results_enabled" translate="label comment" type="select" sortOrder="92" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Show Results Count for Each Suggestion</label> <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> <comment>When you enable this option your site may slow down.</comment> diff --git a/app/code/Magento/Analytics/etc/adminhtml/system.xml b/app/code/Magento/Analytics/etc/adminhtml/system.xml index c7da840b7e665..79dd914cb3c1d 100644 --- a/app/code/Magento/Analytics/etc/adminhtml/system.xml +++ b/app/code/Magento/Analytics/etc/adminhtml/system.xml @@ -29,7 +29,7 @@ <frontend_model>Magento\Analytics\Block\Adminhtml\System\Config\CollectionTimeLabel</frontend_model> <backend_model>Magento\Analytics\Model\Config\Backend\CollectionTime</backend_model> </field> - <field id="vertical" translate="label comment" type="select" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="0"> + <field id="vertical" translate="hint label comment" type="select" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="0"> <hint>Industry Data</hint> <label>Industry</label> <comment>In order to personalize your Advanced Reporting experience, please select your industry.</comment> diff --git a/app/code/Magento/AsynchronousOperations/view/adminhtml/ui_component/bulk_listing.xml b/app/code/Magento/AsynchronousOperations/view/adminhtml/ui_component/bulk_listing.xml index 512b08d6a8de2..87dc0525eb1c0 100644 --- a/app/code/Magento/AsynchronousOperations/view/adminhtml/ui_component/bulk_listing.xml +++ b/app/code/Magento/AsynchronousOperations/view/adminhtml/ui_component/bulk_listing.xml @@ -92,7 +92,7 @@ <actionsColumn name="actions" class="\Magento\AsynchronousOperations\Ui\Component\Listing\Column\Actions"> <settings> <indexField>id</indexField> - <label>Action</label> + <label translate="true">Action</label> </settings> </actionsColumn> </columns> diff --git a/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/Magento/test_default/Magento_Backend/layout/layout_test_grid_handle.xml b/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/Magento/test_default/Magento_Backend/layout/layout_test_grid_handle.xml index 621e9f13409f1..70bf2af6a5fcf 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/Magento/test_default/Magento_Backend/layout/layout_test_grid_handle.xml +++ b/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/Magento/test_default/Magento_Backend/layout/layout_test_grid_handle.xml @@ -55,12 +55,12 @@ <item name="option_id1" xsi:type="array"> <item name="label" xsi:type="string" translate="true">Option One</item> <item name="url" xsi:type="string">*/*/option1</item> - <item name="complete" xsi:type="string">Test</item> + <item name="complete" xsi:type="string" translate="true">Test</item> </item> <item name="option_id2" xsi:type="array"> <item name="label" xsi:type="string" translate="true">Option Two</item> <item name="url" xsi:type="string">*/*/option2</item> - <item name="confirm" xsi:type="string">Are you sure?</item> + <item name="confirm" xsi:type="string" translate="true">Are you sure?</item> </item> <item name="option_id3" xsi:type="array"> <item name="label" xsi:type="string" translate="true">Option Three</item> From 216540f3f9577ad0d57785790c5160505e823f1a Mon Sep 17 00:00:00 2001 From: Andrey Legayev <andrey@ven.com> Date: Thu, 17 Oct 2019 21:58:39 +0300 Subject: [PATCH 046/586] Replace multiple string concatenation by joining array of strings --- .../App/ObjectManager/ConfigLoader/Compiled.php | 2 +- .../Framework/View/Element/AbstractBlock.php | 14 ++++++++++++-- lib/internal/Magento/Framework/View/Layout.php | 14 ++++++++------ 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/lib/internal/Magento/Framework/App/ObjectManager/ConfigLoader/Compiled.php b/lib/internal/Magento/Framework/App/ObjectManager/ConfigLoader/Compiled.php index 01e5031461f85..1dec1666d526a 100644 --- a/lib/internal/Magento/Framework/App/ObjectManager/ConfigLoader/Compiled.php +++ b/lib/internal/Magento/Framework/App/ObjectManager/ConfigLoader/Compiled.php @@ -42,6 +42,6 @@ public function load($area) public static function getFilePath($area) { $diPath = DirectoryList::getDefaultConfig()[DirectoryList::GENERATED_METADATA][DirectoryList::PATH]; - return BP . '/' . $diPath . '/' . $area . '.php'; + return join('', [BP, '/', $diPath, '/', $area, '.php']); } } diff --git a/lib/internal/Magento/Framework/View/Element/AbstractBlock.php b/lib/internal/Magento/Framework/View/Element/AbstractBlock.php index f8e8d2fee264a..1788fba3386f4 100644 --- a/lib/internal/Magento/Framework/View/Element/AbstractBlock.php +++ b/lib/internal/Magento/Framework/View/Element/AbstractBlock.php @@ -517,9 +517,14 @@ public function getChildHtml($alias = '', $useCache = true) $out = $layout->renderElement($childName, $useCache); } } else { + $outParts = []; foreach ($layout->getChildNames($name) as $child) { - $out .= $layout->renderElement($child, $useCache); + $elementHtml = $layout->renderElement($child, $useCache); + if (!empty($elementHtml)) { + $outParts[] = $elementHtml; + } } + $out = join('', $outParts); } return $out; @@ -548,9 +553,14 @@ public function getChildChildHtml($alias, $childChildAlias = '', $useCache = tru $childChildName = $layout->getChildName($childName, $childChildAlias); $out = $layout->renderElement($childChildName, $useCache); } else { + $outParts = []; foreach ($layout->getChildNames($childName) as $childChild) { - $out .= $layout->renderElement($childChild, $useCache); + $elementHtml = $layout->renderElement($childChild, $useCache); + if (!empty($elementHtml)) { + $outParts[] = $elementHtml; + } } + $out = join('', $outParts); } return $out; } diff --git a/lib/internal/Magento/Framework/View/Layout.php b/lib/internal/Magento/Framework/View/Layout.php index a622006f32a1e..994a19b03695d 100644 --- a/lib/internal/Magento/Framework/View/Layout.php +++ b/lib/internal/Magento/Framework/View/Layout.php @@ -586,13 +586,16 @@ protected function _renderUiComponent($name) */ protected function _renderContainer($name, $useCache = true) { - $html = ''; + $htmlParts = []; $children = $this->getChildNames($name); foreach ($children as $child) { - $html .= $this->renderElement($child, $useCache); + $childHtml = $this->renderElement($child, $useCache); + if (!empty($childHtml)) { + $htmlParts[] = $childHtml; + } } - if ($html == '' || !$this->structure->getAttribute($name, Element::CONTAINER_OPT_HTML_TAG)) { - return $html; + if (empty($htmlParts) || !$this->structure->getAttribute($name, Element::CONTAINER_OPT_HTML_TAG)) { + return join('', $htmlParts); } $htmlId = $this->structure->getAttribute($name, Element::CONTAINER_OPT_HTML_ID); @@ -606,8 +609,7 @@ protected function _renderContainer($name, $useCache = true) } $htmlTag = $this->structure->getAttribute($name, Element::CONTAINER_OPT_HTML_TAG); - - $html = sprintf('<%1$s%2$s%3$s>%4$s</%1$s>', $htmlTag, $htmlId, $htmlClass, $html); + $html = sprintf('<%1$s%2$s%3$s>%4$s</%1$s>', $htmlTag, $htmlId, $htmlClass, join('', $htmlParts)); return $html; } From e917b007ed8a233007c1a19d22776315eb7870d4 Mon Sep 17 00:00:00 2001 From: Andrey Legayev <andrey@ven.com> Date: Thu, 17 Oct 2019 21:59:32 +0300 Subject: [PATCH 047/586] Replace two calls to str_replace() by single strtr() I've tested: str_replace() is slower than strtr() in this case --- lib/internal/Magento/Framework/Phrase/Renderer/Translate.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/Phrase/Renderer/Translate.php b/lib/internal/Magento/Framework/Phrase/Renderer/Translate.php index c9329caf49370..e2c8a737c344b 100644 --- a/lib/internal/Magento/Framework/Phrase/Renderer/Translate.php +++ b/lib/internal/Magento/Framework/Phrase/Renderer/Translate.php @@ -50,8 +50,7 @@ public function render(array $source, array $arguments) { $text = end($source); /* If phrase contains escaped quotes then use translation for phrase with non-escaped quote */ - $text = str_replace('\"', '"', $text); - $text = str_replace("\\'", "'", $text); + $text = strtr($text, ['\"' => '"', "\\'" => "'"]); try { $data = $this->translator->getData(); From aa068f94560b90f40aa5392d426c53f76aa7a895 Mon Sep 17 00:00:00 2001 From: Andrey Legayev <andrey@ven.com> Date: Thu, 17 Oct 2019 22:00:34 +0300 Subject: [PATCH 048/586] Replace in_array() by isset() --- .../Model/ResourceModel/Eav/Attribute.php | 25 ++++++++++--------- .../Framework/DB/Select/SelectRenderer.php | 8 +++++- lib/internal/Magento/Framework/Module/Dir.php | 16 ++++++------ 3 files changed, 29 insertions(+), 20 deletions(-) diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Eav/Attribute.php b/app/code/Magento/Catalog/Model/ResourceModel/Eav/Attribute.php index 355561c5e384d..97f126e388730 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Eav/Attribute.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Eav/Attribute.php @@ -38,6 +38,18 @@ class Attribute extends \Magento\Eav\Model\Entity\Attribute implements const KEY_IS_GLOBAL = 'is_global'; + private const ALLOWED_INPUT_TYPES = [ + 'boolean' => true, + 'date' => true, + 'datetime' => true, + 'multiselect' => true, + 'price' => true, + 'select' => true, + 'text' => true, + 'textarea' => true, + 'weight' => true, + ]; + /** * @var LockValidatorInterface */ @@ -403,18 +415,7 @@ public function getSourceModel() */ public function isAllowedForRuleCondition() { - $allowedInputTypes = [ - 'boolean', - 'date', - 'datetime', - 'multiselect', - 'price', - 'select', - 'text', - 'textarea', - 'weight', - ]; - return $this->getIsVisible() && in_array($this->getFrontendInput(), $allowedInputTypes); + return $this->getIsVisible() && isset(self::ALLOWED_INPUT_TYPES[$this->getFrontendInput()]); } /** diff --git a/lib/internal/Magento/Framework/DB/Select/SelectRenderer.php b/lib/internal/Magento/Framework/DB/Select/SelectRenderer.php index 11dbaeb82317a..ce53c07789bde 100644 --- a/lib/internal/Magento/Framework/DB/Select/SelectRenderer.php +++ b/lib/internal/Magento/Framework/DB/Select/SelectRenderer.php @@ -12,6 +12,11 @@ */ class SelectRenderer implements RendererInterface { + private const MANDATORY_SELECT_PARTS = [ + Select::COLUMNS => true, + Select::FROM => true + ]; + /** * @var RendererInterface[] */ @@ -67,7 +72,8 @@ public function render(Select $select, $sql = '') { $sql = Select::SQL_SELECT; foreach ($this->renderers as $renderer) { - if (in_array($renderer['part'], [Select::COLUMNS, Select::FROM]) || $select->getPart($renderer['part'])) { + $part = $renderer['part']; + if (isset(self::MANDATORY_SELECT_PARTS[$part]) || $select->getPart($part)) { $sql = $renderer['renderer']->render($select, $sql); } } diff --git a/lib/internal/Magento/Framework/Module/Dir.php b/lib/internal/Magento/Framework/Module/Dir.php index e6b60453b9577..4baf5f2f10ec6 100644 --- a/lib/internal/Magento/Framework/Module/Dir.php +++ b/lib/internal/Magento/Framework/Module/Dir.php @@ -22,6 +22,14 @@ class Dir const MODULE_SETUP_DIR = 'Setup'; /**#@-*/ + private const ALLOWED_DIR_TYPES = [ + self::MODULE_ETC_DIR => true, + self::MODULE_I18N_DIR => true, + self::MODULE_VIEW_DIR => true, + self::MODULE_CONTROLLER_DIR => true, + self::MODULE_SETUP_DIR => true + ]; + /**#@-*/ private $componentRegistrar; @@ -52,13 +60,7 @@ public function getDir($moduleName, $type = '') } if ($type) { - if (!in_array($type, [ - self::MODULE_ETC_DIR, - self::MODULE_I18N_DIR, - self::MODULE_VIEW_DIR, - self::MODULE_CONTROLLER_DIR, - self::MODULE_SETUP_DIR - ])) { + if (!isset(self::ALLOWED_DIR_TYPES[$type])) { throw new \InvalidArgumentException("Directory type '{$type}' is not recognized."); } $path .= '/' . $type; From c0ce7eac9a5f9f233b12b4e354b09664dbaf3d26 Mon Sep 17 00:00:00 2001 From: Andrey Legayev <andrey@ven.com> Date: Thu, 17 Oct 2019 22:01:17 +0300 Subject: [PATCH 049/586] Micro optimization: Replace != with !== --- .../Attribute/Backend/GroupPrice/AbstractGroupPrice.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/GroupPrice/AbstractGroupPrice.php b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/GroupPrice/AbstractGroupPrice.php index e26717e47274c..d301cc7b63c52 100644 --- a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/GroupPrice/AbstractGroupPrice.php +++ b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/GroupPrice/AbstractGroupPrice.php @@ -97,17 +97,16 @@ protected function _getWebsiteCurrencyRates() ); foreach ($this->_storeManager->getWebsites() as $website) { /* @var $website \Magento\Store\Model\Website */ - if ($website->getBaseCurrencyCode() != $baseCurrency) { + $websiteBaseCurrency = $website->getBaseCurrencyCode(); + if ($websiteBaseCurrency !== $baseCurrency) { $rate = $this->_currencyFactory->create()->load( $baseCurrency - )->getRate( - $website->getBaseCurrencyCode() - ); + )->getRate($websiteBaseCurrency); if (!$rate) { $rate = 1; } $this->_rates[$website->getId()] = [ - 'code' => $website->getBaseCurrencyCode(), + 'code' => $websiteBaseCurrency, 'rate' => $rate, ]; } else { From 33c7de98bbc6f1baa6c9d1712b6a7e6d94a506ad Mon Sep 17 00:00:00 2001 From: Andrey Legayev <andrey@ven.com> Date: Fri, 18 Oct 2019 19:52:53 +0300 Subject: [PATCH 050/586] Fixes for PHPCS --- .../Attribute/Backend/GroupPrice/AbstractGroupPrice.php | 4 ++++ .../Framework/App/ObjectManager/ConfigLoader/Compiled.php | 8 ++++---- lib/internal/Magento/Framework/Module/Dir.php | 3 +++ .../Magento/Framework/Phrase/Renderer/Translate.php | 3 +++ .../Magento/Framework/View/Element/AbstractBlock.php | 3 +++ 5 files changed, 17 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/GroupPrice/AbstractGroupPrice.php b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/GroupPrice/AbstractGroupPrice.php index d301cc7b63c52..68aeabfc70d34 100644 --- a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/GroupPrice/AbstractGroupPrice.php +++ b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/GroupPrice/AbstractGroupPrice.php @@ -186,6 +186,7 @@ public function validate($object) } $compare = implode( '-', + // phpcs:ignore Magento2.Performance.ForeachArrayMerge array_merge( [$priceRow['website_id'], $priceRow['cust_group']], $this->_getAdditionalUniqueFields($priceRow) @@ -209,6 +210,7 @@ public function validate($object) if ($price['website_id'] == 0) { $compare = implode( '-', + // phpcs:ignore Magento2.Performance.ForeachArrayMerge array_merge( [$price['website_id'], $price['cust_group']], $this->_getAdditionalUniqueFields($price) @@ -233,6 +235,7 @@ public function validate($object) $globalCompare = implode( '-', + // phpcs:ignore Magento2.Performance.ForeachArrayMerge array_merge([0, $priceRow['cust_group']], $this->_getAdditionalUniqueFields($priceRow)) ); $websiteCurrency = $rates[$priceRow['website_id']]['code']; @@ -278,6 +281,7 @@ public function preparePriceData(array $priceData, $productTypeId, $websiteId) if (!array_filter($v)) { continue; } + // phpcs:ignore Magento2.Performance.ForeachArrayMerge $key = implode('-', array_merge([$v['cust_group']], $this->_getAdditionalUniqueFields($v))); if ($v['website_id'] == $websiteId) { $data[$key] = $v; diff --git a/lib/internal/Magento/Framework/App/ObjectManager/ConfigLoader/Compiled.php b/lib/internal/Magento/Framework/App/ObjectManager/ConfigLoader/Compiled.php index 1dec1666d526a..5fc668e2d9c5e 100644 --- a/lib/internal/Magento/Framework/App/ObjectManager/ConfigLoader/Compiled.php +++ b/lib/internal/Magento/Framework/App/ObjectManager/ConfigLoader/Compiled.php @@ -1,6 +1,5 @@ <?php /** - * * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ @@ -8,9 +7,10 @@ use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\ObjectManager\ConfigLoaderInterface; -use Magento\Framework\Serialize\SerializerInterface; -use Magento\Framework\Serialize\Serializer\Serialize; +/** + * Class Compiled + */ class Compiled implements ConfigLoaderInterface { /** @@ -21,7 +21,7 @@ class Compiled implements ConfigLoaderInterface private $configCache = []; /** - * {inheritdoc} + * @inheritdoc */ public function load($area) { diff --git a/lib/internal/Magento/Framework/Module/Dir.php b/lib/internal/Magento/Framework/Module/Dir.php index 4baf5f2f10ec6..99570b97e7251 100644 --- a/lib/internal/Magento/Framework/Module/Dir.php +++ b/lib/internal/Magento/Framework/Module/Dir.php @@ -10,6 +10,9 @@ use Magento\Framework\Component\ComponentRegistrar; use Magento\Framework\Component\ComponentRegistrarInterface; +/** + * Class Dir + */ class Dir { /**#@+ diff --git a/lib/internal/Magento/Framework/Phrase/Renderer/Translate.php b/lib/internal/Magento/Framework/Phrase/Renderer/Translate.php index e2c8a737c344b..4edf0fe049902 100644 --- a/lib/internal/Magento/Framework/Phrase/Renderer/Translate.php +++ b/lib/internal/Magento/Framework/Phrase/Renderer/Translate.php @@ -11,6 +11,9 @@ use Magento\Framework\TranslateInterface; use Psr\Log\LoggerInterface; +/** + * Class Translate + */ class Translate implements RendererInterface { /** diff --git a/lib/internal/Magento/Framework/View/Element/AbstractBlock.php b/lib/internal/Magento/Framework/View/Element/AbstractBlock.php index 1788fba3386f4..57cf1f68efca6 100644 --- a/lib/internal/Magento/Framework/View/Element/AbstractBlock.php +++ b/lib/internal/Magento/Framework/View/Element/AbstractBlock.php @@ -16,6 +16,7 @@ * * Marked as public API because it is actively used now. * + * phpcs:disable Magento2.Classes.AbstractApi * @api * @SuppressWarnings(PHPMD.ExcessivePublicCount) * @SuppressWarnings(PHPMD.ExcessiveClassComplexity) @@ -244,6 +245,8 @@ public function getRequest() * Please override this one instead of overriding real __construct constructor * * @return void + * + * phpcs:disable Magento2.CodeAnalysis.EmptyBlock */ protected function _construct() { From 4fb5da819cb2517de204e7dcf8c545505eeabd2c Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <p.bystritsky@yandex.ru> Date: Sat, 19 Oct 2019 19:41:02 +0300 Subject: [PATCH 051/586] magento/magento2#22856: Catalog price rules are not working with custom options as expected. --- .../CalculateCustomOptionCatalogRule.php | 50 +++- .../CalculateCustomOptionCatalogRuleTest.php | 266 ++++++++++++++++++ 2 files changed, 301 insertions(+), 15 deletions(-) create mode 100644 app/code/Magento/Catalog/Test/Unit/Pricing/Price/CalculateCustomOptionCatalogRuleTest.php diff --git a/app/code/Magento/Catalog/Pricing/Price/CalculateCustomOptionCatalogRule.php b/app/code/Magento/Catalog/Pricing/Price/CalculateCustomOptionCatalogRule.php index 91ff8f921566c..b3f3ac7bf68ef 100644 --- a/app/code/Magento/Catalog/Pricing/Price/CalculateCustomOptionCatalogRule.php +++ b/app/code/Magento/Catalog/Pricing/Price/CalculateCustomOptionCatalogRule.php @@ -53,24 +53,31 @@ public function execute( float $optionPriceValue, bool $isPercent ): float { - $basePrice = $this->getGetBasePriceWithOutCatalogRules($product); - if ($isPercent) { - $optionPrice = $basePrice * $optionPriceValue / 100; - } else { - $optionPrice = $optionPriceValue; - } - - $totalPriceModified = $this->priceModifier->modifyPrice( - $basePrice + $optionPrice, - $product - ); - $basePriceModified = $this->priceModifier->modifyPrice( - $basePrice, + $regularPrice = (float)$product->getPriceInfo() + ->getPrice(RegularPrice::PRICE_CODE) + ->getValue(); + $catalogRulePrice = $this->priceModifier->modifyPrice( + $regularPrice, $product ); - $price = $totalPriceModified - $basePriceModified; + $basePriceWithOutCatalogRules = (float)$this->getGetBasePriceWithOutCatalogRules($product); + // Apply catalog price rules to product options only if catalog price rules are applied to product. + if ($catalogRulePrice < $basePriceWithOutCatalogRules) { + $optionPrice = $this->getOptionPriceWithoutPriceRule($optionPriceValue, $isPercent, $regularPrice); + $totalCatalogRulePrice = $this->priceModifier->modifyPrice( + $regularPrice + $optionPrice, + $product + ); + $finalOptionPrice = $totalCatalogRulePrice - $catalogRulePrice; + } else { + $finalOptionPrice = $this->getOptionPriceWithoutPriceRule( + $optionPriceValue, + $isPercent, + $this->getGetBasePriceWithOutCatalogRules($product) + ); + } - return $this->priceCurrency->convertAndRound($price); + return $this->priceCurrency->convertAndRound($finalOptionPrice); } /** @@ -96,4 +103,17 @@ private function getGetBasePriceWithOutCatalogRules(Product $product): float return $basePrice ?? $product->getPrice(); } + + /** + * Calculate option price without catalog price rule discount. + * + * @param float $optionPriceValue + * @param bool $isPercent + * @param float $basePrice + * @return float + */ + private function getOptionPriceWithoutPriceRule(float $optionPriceValue, bool $isPercent, float $basePrice): float + { + return $isPercent ? $basePrice * $optionPriceValue / 100 : $optionPriceValue; + } } diff --git a/app/code/Magento/Catalog/Test/Unit/Pricing/Price/CalculateCustomOptionCatalogRuleTest.php b/app/code/Magento/Catalog/Test/Unit/Pricing/Price/CalculateCustomOptionCatalogRuleTest.php new file mode 100644 index 0000000000000..1a99ac5d451f0 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Unit/Pricing/Price/CalculateCustomOptionCatalogRuleTest.php @@ -0,0 +1,266 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Test\Unit\Pricing\Price; + +use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\Product\PriceModifier\Composite as PriceModifier; +use Magento\Catalog\Pricing\Price\CalculateCustomOptionCatalogRule; +use Magento\Catalog\Pricing\Price\RegularPrice; +use Magento\Catalog\Pricing\Price\SpecialPrice; +use Magento\CatalogRule\Pricing\Price\CatalogRulePrice; +use Magento\Directory\Model\PriceCurrency; +use Magento\Framework\Pricing\PriceInfo\Base; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Test for CalculateCustomOptionCatalogRule class. + */ +class CalculateCustomOptionCatalogRuleTest extends TestCase +{ + /** + * @var Product|MockObject + */ + private $saleableItemMock; + + /** + * @var RegularPrice|MockObject + */ + private $regularPriceMock; + + /** + * @var SpecialPrice|MockObject + */ + private $specialPriceMock; + + /** + * @var CatalogRulePrice|MockObject + */ + private $catalogRulePriceMock; + + /** + * @var PriceModifier|MockObject + */ + private $priceModifierMock; + + /** + * @var CalculateCustomOptionCatalogRule + */ + private $calculateCustomOptionCatalogRule; + + /** + * @inheritdoc + */ + protected function setUp() + { + $objectManager = new ObjectManager($this); + $this->saleableItemMock = $this->createMock(Product::class); + $this->regularPriceMock = $this->createMock(RegularPrice::class); + $this->specialPriceMock = $this->createMock(SpecialPrice::class); + $this->catalogRulePriceMock = $this->createMock(CatalogRulePrice::class); + $priceInfoMock = $this->createMock(Base::class); + $this->saleableItemMock->expects($this->any()) + ->method('getPriceInfo') + ->willReturn($priceInfoMock); + $this->regularPriceMock->expects($this->any()) + ->method('getPriceCode') + ->willReturn(RegularPrice::PRICE_CODE); + $this->specialPriceMock->expects($this->any()) + ->method('getPriceCode') + ->willReturn(SpecialPrice::PRICE_CODE); + $this->catalogRulePriceMock->expects($this->any()) + ->method('getPriceCode') + ->willReturn(CatalogRulePrice::PRICE_CODE); + $priceInfoMock->expects($this->any()) + ->method('getPrices') + ->willReturn( + [ + 'regular_price' => $this->regularPriceMock, + 'special_price' => $this->specialPriceMock, + 'catalog_rule_price' => $this->catalogRulePriceMock + ] + ); + $priceInfoMock->expects($this->any()) + ->method('getPrice') + ->willReturnMap( + [ + ['regular_price', $this->regularPriceMock], + ['special_price', $this->specialPriceMock], + ['catalog_rule_price', $this->catalogRulePriceMock], + ] + ); + $priceCurrencyMock = $this->createMock(PriceCurrency::class); + $priceCurrencyMock->expects($this->any()) + ->method('convertAndRound') + ->willReturnArgument(0); + $this->priceModifierMock = $this->createMock(PriceModifier::class); + + $this->calculateCustomOptionCatalogRule = $objectManager->getObject( + CalculateCustomOptionCatalogRule::class, + [ + 'priceCurrency' => $priceCurrencyMock, + 'priceModifier' => $this->priceModifierMock, + ] + ); + } + + /** + * Tests correct option price calculation with different catalog rules and special prices combination. + * + * @dataProvider executeDataProvider + * @param array $prices + * @param float $catalogRulePriceModifier + * @param float $optionPriceValue + * @param bool $isPercent + * @param float $expectedResult + */ + public function testExecute( + array $prices, + float $catalogRulePriceModifier, + float $optionPriceValue, + bool $isPercent, + float $expectedResult + ) { + $this->regularPriceMock->expects($this->any()) + ->method('getValue') + ->willReturn($prices['regularPriceValue']); + $this->specialPriceMock->expects($this->any()) + ->method('getValue') + ->willReturn($prices['specialPriceValue']); + $this->priceModifierMock->expects($this->any()) + ->method('modifyPrice') + ->willReturnCallback( + function ($price) use ($catalogRulePriceModifier) { + return $price * $catalogRulePriceModifier; + } + ); + + $finalPrice = $this->calculateCustomOptionCatalogRule->execute( + $this->saleableItemMock, + $optionPriceValue, + $isPercent + ); + + $this->assertSame($expectedResult, $finalPrice); + } + + /** + * Data provider for testExecute. + * + * "Active" means this price type has biggest discount, so other prices doesn't count. + * + * @return array + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + */ + public function executeDataProvider(): array + { + return [ + 'No special price, no catalog price rules, fixed option price' => [ + 'prices' => [ + 'regularPriceValue' => 1000, + 'specialPriceValue' => 1000, + ], + 'catalogRulePriceModifier' => 1.0, + 'optionPriceValue' => 100.0, + 'isPercent' => false, + 'expectedResult' => 100.0 + ], + 'No special price, no catalog price rules, percent option price' => [ + 'prices' => [ + 'regularPriceValue' => 1000, + 'specialPriceValue' => 1000, + ], + 'catalogRulePriceModifier' => 1.0, + 'optionPriceValue' => 100.0, + 'isPercent' => true, + 'expectedResult' => 1000.0 + ], + 'No special price, catalog price rule set, fixed option price' => [ + 'prices' => [ + 'regularPriceValue' => 1000, + 'specialPriceValue' => 1000, + ], + 'catalogRulePriceModifier' => 0.9, + 'optionPriceValue' => 100.0, + 'isPercent' => false, + 'expectedResult' => 90.0 + ], + 'No special price, catalog price rule set, percent option price' => [ + 'prices' => [ + 'regularPriceValue' => 1000, + 'specialPriceValue' => 1000, + ], + 'catalogRulePriceModifier' => 0.9, + 'optionPriceValue' => 100.0, + 'isPercent' => true, + 'expectedResult' => 900.0 + ], + 'Special price set, no catalog price rule, fixed option price' => [ + 'prices' => [ + 'regularPriceValue' => 1000, + 'specialPriceValue' => 900, + ], + 'catalogRulePriceModifier' => 1.0, + 'optionPriceValue' => 100.0, + 'isPercent' => false, + 'expectedResult' => 100.0 + ], + 'Special price set, no catalog price rule, percent option price' => [ + 'prices' => [ + 'regularPriceValue' => 1000, + 'specialPriceValue' => 900, + ], + 'catalogRulePriceModifier' => 1.0, + 'optionPriceValue' => 100.0, + 'isPercent' => true, + 'expectedResult' => 900.0 + ], + 'Special price set and active, catalog price rule set, fixed option price' => [ + 'prices' => [ + 'regularPriceValue' => 1000, + 'specialPriceValue' => 800, + ], + 'catalogRulePriceModifier' => 0.9, + 'optionPriceValue' => 100.0, + 'isPercent' => false, + 'expectedResult' => 100.0 + ], + 'Special price set and active, catalog price rule set, percent option price' => [ + 'prices' => [ + 'regularPriceValue' => 1000, + 'specialPriceValue' => 800, + ], + 'catalogRulePriceModifier' => 0.9, + 'optionPriceValue' => 100.0, + 'isPercent' => true, + 'expectedResult' => 800.0 + ], + 'Special price set, catalog price rule set and active, fixed option price' => [ + 'prices' => [ + 'regularPriceValue' => 1000, + 'specialPriceValue' => 950, + ], + 'catalogRulePriceModifier' => 0.9, + 'optionPriceValue' => 100.0, + 'isPercent' => false, + 'expectedResult' => 90.0 + ], + 'Special price set, catalog price rule set and active, percent option price' => [ + 'prices' => [ + 'regularPriceValue' => 1000, + 'specialPriceValue' => 950, + ], + 'catalogRulePriceModifier' => 0.9, + 'optionPriceValue' => 100.0, + 'isPercent' => true, + 'expectedResult' => 900.0 + ], + ]; + } +} From ca502c3970ea846b3be81b220ddde074c0a2b0f8 Mon Sep 17 00:00:00 2001 From: Andrey Legayev <andrey@ven.com> Date: Sun, 20 Oct 2019 17:25:46 +0300 Subject: [PATCH 052/586] Rollback some changes after benchmarking on PHP 7.2 --- .../Framework/App/ObjectManager/ConfigLoader/Compiled.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/App/ObjectManager/ConfigLoader/Compiled.php b/lib/internal/Magento/Framework/App/ObjectManager/ConfigLoader/Compiled.php index 5fc668e2d9c5e..7408e8b230bd9 100644 --- a/lib/internal/Magento/Framework/App/ObjectManager/ConfigLoader/Compiled.php +++ b/lib/internal/Magento/Framework/App/ObjectManager/ConfigLoader/Compiled.php @@ -42,6 +42,6 @@ public function load($area) public static function getFilePath($area) { $diPath = DirectoryList::getDefaultConfig()[DirectoryList::GENERATED_METADATA][DirectoryList::PATH]; - return join('', [BP, '/', $diPath, '/', $area, '.php']); + return BP . '/' . $diPath . '/' . $area . '.php'; } } From 156c689eedb3fd39b91d771c60e8d7eda611f4be Mon Sep 17 00:00:00 2001 From: Andrey Legayev <andrey@ven.com> Date: Tue, 22 Oct 2019 13:49:18 +0300 Subject: [PATCH 053/586] Revert string concat optimizations - there is no real improvement I've run performance tests for string concat vs. array join: https://gist.github.com/andrey-legayev/24ed101a34d4775bf1b6f9879581f51a No real performance improvement (which surprised me). But anyway - I'm rolling back string concatenation improvements, because it doesn't make any sense. --- .../Framework/View/Element/AbstractBlock.php | 14 ++------------ lib/internal/Magento/Framework/View/Layout.php | 14 ++++++-------- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/lib/internal/Magento/Framework/View/Element/AbstractBlock.php b/lib/internal/Magento/Framework/View/Element/AbstractBlock.php index 57cf1f68efca6..0d7e3154440e9 100644 --- a/lib/internal/Magento/Framework/View/Element/AbstractBlock.php +++ b/lib/internal/Magento/Framework/View/Element/AbstractBlock.php @@ -520,14 +520,9 @@ public function getChildHtml($alias = '', $useCache = true) $out = $layout->renderElement($childName, $useCache); } } else { - $outParts = []; foreach ($layout->getChildNames($name) as $child) { - $elementHtml = $layout->renderElement($child, $useCache); - if (!empty($elementHtml)) { - $outParts[] = $elementHtml; - } + $out .= $layout->renderElement($child, $useCache); } - $out = join('', $outParts); } return $out; @@ -556,14 +551,9 @@ public function getChildChildHtml($alias, $childChildAlias = '', $useCache = tru $childChildName = $layout->getChildName($childName, $childChildAlias); $out = $layout->renderElement($childChildName, $useCache); } else { - $outParts = []; foreach ($layout->getChildNames($childName) as $childChild) { - $elementHtml = $layout->renderElement($childChild, $useCache); - if (!empty($elementHtml)) { - $outParts[] = $elementHtml; - } + $out .= $layout->renderElement($childChild, $useCache); } - $out = join('', $outParts); } return $out; } diff --git a/lib/internal/Magento/Framework/View/Layout.php b/lib/internal/Magento/Framework/View/Layout.php index 994a19b03695d..a622006f32a1e 100644 --- a/lib/internal/Magento/Framework/View/Layout.php +++ b/lib/internal/Magento/Framework/View/Layout.php @@ -586,16 +586,13 @@ protected function _renderUiComponent($name) */ protected function _renderContainer($name, $useCache = true) { - $htmlParts = []; + $html = ''; $children = $this->getChildNames($name); foreach ($children as $child) { - $childHtml = $this->renderElement($child, $useCache); - if (!empty($childHtml)) { - $htmlParts[] = $childHtml; - } + $html .= $this->renderElement($child, $useCache); } - if (empty($htmlParts) || !$this->structure->getAttribute($name, Element::CONTAINER_OPT_HTML_TAG)) { - return join('', $htmlParts); + if ($html == '' || !$this->structure->getAttribute($name, Element::CONTAINER_OPT_HTML_TAG)) { + return $html; } $htmlId = $this->structure->getAttribute($name, Element::CONTAINER_OPT_HTML_ID); @@ -609,7 +606,8 @@ protected function _renderContainer($name, $useCache = true) } $htmlTag = $this->structure->getAttribute($name, Element::CONTAINER_OPT_HTML_TAG); - $html = sprintf('<%1$s%2$s%3$s>%4$s</%1$s>', $htmlTag, $htmlId, $htmlClass, join('', $htmlParts)); + + $html = sprintf('<%1$s%2$s%3$s>%4$s</%1$s>', $htmlTag, $htmlId, $htmlClass, $html); return $html; } From ee8373fa27727abb5139747ea5547a81fa3735ac Mon Sep 17 00:00:00 2001 From: Michal Sz <michal.szymanski@accenture.com> Date: Wed, 23 Oct 2019 20:04:10 +0200 Subject: [PATCH 054/586] Implement catching for all Errors - ref Magento issue #23350 --- lib/internal/Magento/Framework/App/Bootstrap.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/App/Bootstrap.php b/lib/internal/Magento/Framework/App/Bootstrap.php index 717b810cffd29..57b40faabc764 100644 --- a/lib/internal/Magento/Framework/App/Bootstrap.php +++ b/lib/internal/Magento/Framework/App/Bootstrap.php @@ -269,6 +269,8 @@ public function run(AppInterface $application) } } catch (\Exception $e) { $this->terminate($e); + } catch (\Error $e) { + $this->terminate($e); } } // phpcs:enable @@ -418,12 +420,12 @@ public function isDeveloperMode() /** * Display an exception and terminate program execution * - * @param \Exception $e + * @param \Throwable $e * @return void * * phpcs:disable Magento2.Security.LanguageConstruct, Squiz.Commenting.FunctionCommentThrowTag */ - protected function terminate(\Exception $e) + protected function terminate(\Throwable $e) { if ($this->isDeveloperMode()) { From 5c054e111d7ec9ccfe1a4cba6c89905a53dc8efb Mon Sep 17 00:00:00 2001 From: Michal Sz <michal.szymanski@accenture.com> Date: Thu, 24 Oct 2019 07:46:13 +0200 Subject: [PATCH 055/586] Unifying the catch statement - ref Magento issue #23350 --- lib/internal/Magento/Framework/App/Bootstrap.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/internal/Magento/Framework/App/Bootstrap.php b/lib/internal/Magento/Framework/App/Bootstrap.php index 57b40faabc764..d3290f8518b6e 100644 --- a/lib/internal/Magento/Framework/App/Bootstrap.php +++ b/lib/internal/Magento/Framework/App/Bootstrap.php @@ -267,11 +267,10 @@ public function run(AppInterface $application) throw $e; } } - } catch (\Exception $e) { - $this->terminate($e); - } catch (\Error $e) { + } catch (\Throwable $e) { $this->terminate($e); } + } // phpcs:enable /** From 296a0905267003b033bc9d71ecd1a4f8921e1f3d Mon Sep 17 00:00:00 2001 From: phil <philkun@users.noreply.github.com> Date: Thu, 24 Oct 2019 09:41:54 +0100 Subject: [PATCH 056/586] Allow autoplay for vimeo thumb click Currently on click a video thumb the video does not start, but the code to autoplay is incorrect since 2017 https://developers.google.com/web/updates/2017/09/autoplay-policy-changes --- .../Magento/ProductVideo/view/frontend/web/js/load-player.js | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/ProductVideo/view/frontend/web/js/load-player.js b/app/code/Magento/ProductVideo/view/frontend/web/js/load-player.js index ede0d2019309d..aead951043448 100644 --- a/app/code/Magento/ProductVideo/view/frontend/web/js/load-player.js +++ b/app/code/Magento/ProductVideo/view/frontend/web/js/load-player.js @@ -344,6 +344,7 @@ define([ .attr('mozallowfullscreen', '') .attr('allowfullscreen', '') .attr('referrerPolicy', 'origin') + .attr('allow', 'autoplay') ); this._player = window.$f(this.element.children(':first')[0]); From 10626e06c1ee25471e9338e32b866bb0706c3c2f Mon Sep 17 00:00:00 2001 From: Buba Suma <soumah@adobe.com> Date: Fri, 18 Oct 2019 18:02:22 -0500 Subject: [PATCH 057/586] MC-21807: Implement control over minimum_should_match for elasticsearch queries - Add ability to configure and apply minimum_should_match --- .../FieldsMappingPreprocessorInterface.php | 22 ++ .../Config/Backend/MinimumShouldMatch.php | 41 +++ .../SearchAdapter/Query/Builder/Match.php | 14 +- .../Config/Backend/MinimumShouldMatchTest.php | 75 ++++++ .../SearchAdapter/Query/Builder/MatchTest.php | 240 ++++++++++-------- .../Elasticsearch/etc/adminhtml/system.xml | 20 +- app/code/Magento/Elasticsearch/etc/config.xml | 2 + .../FieldMapper/AddDefaultSearchField.php | 33 +++ .../CopySearchableFieldsToSearchField.php | 52 ++++ .../Model/Client/Elasticsearch.php | 44 +++- .../FieldMapper/AddDefaultSearchFieldTest.php | 85 +++++++ .../CopySearchableFieldsToSearchFieldTest.php | 136 ++++++++++ .../Unit/Model/Client/ElasticsearchTest.php | 6 +- .../Elasticsearch6/etc/adminhtml/system.xml | 12 +- .../Magento/Elasticsearch6/etc/config.xml | 1 + app/code/Magento/Elasticsearch6/etc/di.xml | 9 + 16 files changed, 675 insertions(+), 117 deletions(-) create mode 100644 app/code/Magento/Elasticsearch/Model/Adapter/FieldsMappingPreprocessorInterface.php create mode 100644 app/code/Magento/Elasticsearch/Model/Config/Backend/MinimumShouldMatch.php create mode 100644 app/code/Magento/Elasticsearch/Test/Unit/Model/Config/Backend/MinimumShouldMatchTest.php create mode 100644 app/code/Magento/Elasticsearch6/Model/Adapter/FieldMapper/AddDefaultSearchField.php create mode 100644 app/code/Magento/Elasticsearch6/Model/Adapter/FieldMapper/CopySearchableFieldsToSearchField.php create mode 100644 app/code/Magento/Elasticsearch6/Test/Unit/Model/Adapter/FieldMapper/AddDefaultSearchFieldTest.php create mode 100644 app/code/Magento/Elasticsearch6/Test/Unit/Model/Adapter/FieldMapper/CopySearchableFieldsToSearchFieldTest.php diff --git a/app/code/Magento/Elasticsearch/Model/Adapter/FieldsMappingPreprocessorInterface.php b/app/code/Magento/Elasticsearch/Model/Adapter/FieldsMappingPreprocessorInterface.php new file mode 100644 index 0000000000000..6eea6560f7273 --- /dev/null +++ b/app/code/Magento/Elasticsearch/Model/Adapter/FieldsMappingPreprocessorInterface.php @@ -0,0 +1,22 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Elasticsearch\Model\Adapter; + +/** + * Modifies fields mapping before save + */ +interface FieldsMappingPreprocessorInterface +{ + /** + * Modifies fields mapping before save + * + * @param array $mapping + * @return array + */ + public function process(array $mapping): array; +} diff --git a/app/code/Magento/Elasticsearch/Model/Config/Backend/MinimumShouldMatch.php b/app/code/Magento/Elasticsearch/Model/Config/Backend/MinimumShouldMatch.php new file mode 100644 index 0000000000000..434270c62d3d9 --- /dev/null +++ b/app/code/Magento/Elasticsearch/Model/Config/Backend/MinimumShouldMatch.php @@ -0,0 +1,41 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Elasticsearch\Model\Config\Backend; + +use Magento\Framework\App\Config\Value; +use Magento\Framework\Exception\LocalizedException; + +/** + * Elasticsearch minimum should match data model + */ +class MinimumShouldMatch extends Value +{ + /** + * @inheritDoc + */ + public function beforeSave() + { + $result = parent::beforeSave(); + $this->validateValue(); + return $result; + } + + /** + * Validates config value + * + * @throws LocalizedException + */ + public function validateValue(): void + { + if (strlen($this->getValue()) && !preg_match('/^((\d+<)?-?\d+%?\s?)+$/', $this->getValue())) { + throw new LocalizedException( + __('Value for the field "%1" was not saved because of the incorrect format.', __('Minimum Terms to Match')) + ); + } + } +} diff --git a/app/code/Magento/Elasticsearch/SearchAdapter/Query/Builder/Match.php b/app/code/Magento/Elasticsearch/SearchAdapter/Query/Builder/Match.php index ddf75c0a78e25..8a44b58d35fb8 100644 --- a/app/code/Magento/Elasticsearch/SearchAdapter/Query/Builder/Match.php +++ b/app/code/Magento/Elasticsearch/SearchAdapter/Query/Builder/Match.php @@ -7,6 +7,7 @@ use Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\AttributeProvider; use Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\ResolverInterface as TypeResolver; +use Magento\Elasticsearch\Model\Config; use Magento\Elasticsearch\SearchAdapter\Query\ValueTransformerPool; use Magento\Framework\App\ObjectManager; use Magento\Framework\Search\Request\Query\BoolExpression; @@ -50,6 +51,10 @@ class Match implements QueryInterface * @var ValueTransformerPool */ private $valueTransformerPool; + /** + * @var Config + */ + private $config; /** * @param FieldMapperInterface $fieldMapper @@ -57,13 +62,15 @@ class Match implements QueryInterface * @param AttributeProvider|null $attributeProvider * @param TypeResolver|null $fieldTypeResolver * @param ValueTransformerPool|null $valueTransformerPool + * @param Config|null $config */ public function __construct( FieldMapperInterface $fieldMapper, array $preprocessorContainer, AttributeProvider $attributeProvider = null, TypeResolver $fieldTypeResolver = null, - ValueTransformerPool $valueTransformerPool = null + ValueTransformerPool $valueTransformerPool = null, + Config $config = null ) { $this->fieldMapper = $fieldMapper; $this->preprocessorContainer = $preprocessorContainer; @@ -73,6 +80,7 @@ public function __construct( ->get(TypeResolver::class); $this->valueTransformerPool = $valueTransformerPool ?? ObjectManager::getInstance() ->get(ValueTransformerPool::class); + $this->config = $config ?? ObjectManager::getInstance()->get(Config::class); } /** @@ -83,11 +91,15 @@ public function build(array $selectQuery, RequestQueryInterface $requestQuery, $ $queryValue = $this->prepareQuery($requestQuery->getValue(), $conditionType); $queries = $this->buildQueries($requestQuery->getMatches(), $queryValue); $requestQueryBoost = $requestQuery->getBoost() ?: 1; + $minimumShouldMatch = $this->config->getElasticsearchConfigData('minimum_should_match'); foreach ($queries as $query) { $queryBody = $query['body']; $matchKey = isset($queryBody['match_phrase']) ? 'match_phrase' : 'match'; foreach ($queryBody[$matchKey] as $field => $matchQuery) { $matchQuery['boost'] = $requestQueryBoost + $matchQuery['boost']; + if ($minimumShouldMatch) { + $matchQuery['minimum_should_match'] = $minimumShouldMatch; + } $queryBody[$matchKey][$field] = $matchQuery; } $selectQuery['bool'][$query['condition']][] = $queryBody; diff --git a/app/code/Magento/Elasticsearch/Test/Unit/Model/Config/Backend/MinimumShouldMatchTest.php b/app/code/Magento/Elasticsearch/Test/Unit/Model/Config/Backend/MinimumShouldMatchTest.php new file mode 100644 index 0000000000000..e8f3621eda25d --- /dev/null +++ b/app/code/Magento/Elasticsearch/Test/Unit/Model/Config/Backend/MinimumShouldMatchTest.php @@ -0,0 +1,75 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Elasticsearch\Test\Unit\Model\Config\Backend; + +use Magento\Elasticsearch\Model\Config\Backend\MinimumShouldMatch; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use PHPUnit\Framework\TestCase; +use Throwable; + +/** + * Test elasticsearch minimum should match data model + */ +class MinimumShouldMatchTest extends TestCase +{ + /** + * @var MinimumShouldMatch + */ + private $model; + + /** + * @inheritDoc + */ + protected function setUp() + { + $objectManager = new ObjectManager($this); + $this->model = $objectManager->getObject(MinimumShouldMatch::class); + parent::setUp(); + } + + /** + * @param string $value + * @param bool $valid + * @dataProvider validateValueDataProvider + * @throws LocalizedException + */ + public function testValidateValue(string $value, bool $valid) + { + $this->model->setValue($value); + try { + $this->model->validateValue(); + } catch (Throwable $exception) { + $this->assertFalse($valid); + return; + } + $this->assertTrue($valid); + } + + /** + * @return array + */ + public function validateValueDataProvider(): array + { + return [ + ['3', true], + ['-2', true], + ['75%', true], + ['-25%', true], + ['3<90%', true], + ['2<-25% 9<-3', true], + ['90%<3', false], + ['<90%', false], + ['90%<', false], + ['-3<2', false], + ['two', false], + ['2<', false], + ['<2', false], + ]; + } +} diff --git a/app/code/Magento/Elasticsearch/Test/Unit/SearchAdapter/Query/Builder/MatchTest.php b/app/code/Magento/Elasticsearch/Test/Unit/SearchAdapter/Query/Builder/MatchTest.php index d0ffc6debcd8a..705b06e9769f2 100644 --- a/app/code/Magento/Elasticsearch/Test/Unit/SearchAdapter/Query/Builder/MatchTest.php +++ b/app/code/Magento/Elasticsearch/Test/Unit/SearchAdapter/Query/Builder/MatchTest.php @@ -9,14 +9,19 @@ use Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\AttributeProvider; use Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\ResolverInterface as TypeResolver; use Magento\Elasticsearch\Model\Adapter\FieldMapperInterface; +use Magento\Elasticsearch\Model\Config; use Magento\Elasticsearch\SearchAdapter\Query\Builder\Match as MatchQueryBuilder; use Magento\Elasticsearch\SearchAdapter\Query\ValueTransformerInterface; use Magento\Elasticsearch\SearchAdapter\Query\ValueTransformerPool; use Magento\Framework\Search\Request\Query\Match as MatchRequestQuery; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use PHPUnit\Framework\MockObject\MockObject as MockObject; +use PHPUnit\Framework\TestCase; -class MatchTest extends \PHPUnit\Framework\TestCase +/** + * Test Match query builder + */ +class MatchTest extends TestCase { /** * @var AttributeProvider|MockObject @@ -32,6 +37,14 @@ class MatchTest extends \PHPUnit\Framework\TestCase * @var MatchQueryBuilder */ private $matchQueryBuilder; + /** + * @var MockObject + */ + private $config; + /** + * @var MockObject + */ + private $fieldMapper; /** * @inheritdoc @@ -40,22 +53,25 @@ protected function setUp() { $this->attributeProvider = $this->createMock(AttributeProvider::class); $this->fieldTypeResolver = $this->createMock(TypeResolver::class); - + $this->config = $this->createMock(Config::class); + $this->fieldMapper = $this->getMockForAbstractClass(FieldMapperInterface::class); + $this->fieldMapper->method('getFieldName') + ->willReturnArgument(0); $valueTransformerPoolMock = $this->createMock(ValueTransformerPool::class); $valueTransformerMock = $this->createMock(ValueTransformerInterface::class); $valueTransformerPoolMock->method('get') ->willReturn($valueTransformerMock); $valueTransformerMock->method('transform') ->willReturnArgument(0); - $this->matchQueryBuilder = (new ObjectManager($this))->getObject( MatchQueryBuilder::class, [ - 'fieldMapper' => $this->getFieldMapper(), + 'fieldMapper' => $this->fieldMapper, 'preprocessorContainer' => [], 'attributeProvider' => $this->attributeProvider, 'fieldTypeResolver' => $this->fieldTypeResolver, 'valueTransformerPool' => $valueTransformerPoolMock, + 'config' => $this->config, ] ); } @@ -63,130 +79,146 @@ protected function setUp() /** * Tests that method constructs a correct select query. * - * @see MatchQueryBuilder::build + * @param string $searchQuery + * @param array $fields + * @param array $expected + * @param string|null $minimumShouldMatch + * @dataProvider buildDataProvider */ - public function testBuild() - { - $attributeAdapter = $this->createMock(AttributeAdapter::class); - $this->attributeProvider->expects($this->once()) - ->method('getByAttributeCode') - ->with('some_field') - ->willReturn($attributeAdapter); - $this->fieldTypeResolver->expects($this->once()) - ->method('getFieldType') - ->with($attributeAdapter) - ->willReturn('text'); - - $rawQueryValue = 'query_value'; - $selectQuery = $this->matchQueryBuilder->build([], $this->getMatchRequestQuery($rawQueryValue), 'not'); + public function testBuild( + string $searchQuery, + array $fields, + array $expected, + ?string $minimumShouldMatch = null + ) { + $this->config->method('getElasticsearchConfigData') + ->with('minimum_should_match') + ->willReturn($minimumShouldMatch); + + foreach ($fields as $field) { + $this->mockAttribute($field['field']); + } + + $requestQuery = new MatchRequestQuery('match', $searchQuery, 1, $fields); + $query = $this->matchQueryBuilder->build([], $requestQuery, 'should'); $expectedSelectQuery = [ 'bool' => [ - 'must_not' => [ + 'should' => $expected, + ], + ]; + + $this->assertEquals( + $expectedSelectQuery, + $query + ); + } + + /** + * @return array + */ + public function buildDataProvider(): array + { + return [ + 'match query without minimum_should_match' => [ + 'fitness bottle', + [ + [ + 'field' => 'name', + 'boost' => 5 + ] + ], + [ + [ + 'match' => [ + 'name' => [ + 'query' => 'fitness bottle', + 'boost' => 6, + ], + ], + ], + ] + ], + 'match_phrase query without minimum_should_match' => [ + '"fitness bottle"', + [ + [ + 'field' => 'name', + 'boost' => 5 + ] + ], + [ + [ + 'match_phrase' => [ + 'name' => [ + 'query' => 'fitness bottle', + 'boost' => 6, + ], + ], + ], + ] + ], + 'match query with minimum_should_match' => [ + 'fitness bottle', + [ + [ + 'field' => 'name', + 'boost' => 5 + ] + ], + [ [ 'match' => [ - 'some_field' => [ - 'query' => $rawQueryValue, - 'boost' => 43, + 'name' => [ + 'query' => 'fitness bottle', + 'boost' => 6, + 'minimum_should_match' => '2<75%', ], ], ], ], + '2<75%' ], + 'match_phrase query with minimum_should_match' => [ + '"fitness bottle"', + [ + [ + 'field' => 'name', + 'boost' => 5 + ] + ], + [ + [ + 'match_phrase' => [ + 'name' => [ + 'query' => 'fitness bottle', + 'boost' => 6, + 'minimum_should_match' => '2<75%', + ], + ], + ], + ], + '2<75%' + ] ]; - $this->assertEquals($expectedSelectQuery, $selectQuery); } /** - * Tests that method constructs a correct "match" query depending on query value. - * - * @dataProvider matchProvider + * Mock attribute * - * @param string $rawQueryValue - * @param string $queryValue - * @param string $match + * @param string $attributeCode + * @param string $type */ - public function testBuildMatchQuery($rawQueryValue, $queryValue, $match) + private function mockAttribute(string $attributeCode, string $type = 'text') { $attributeAdapter = $this->createMock(AttributeAdapter::class); $this->attributeProvider->expects($this->once()) ->method('getByAttributeCode') - ->with('some_field') + ->with($attributeCode) ->willReturn($attributeAdapter); $this->fieldTypeResolver->expects($this->once()) ->method('getFieldType') ->with($attributeAdapter) - ->willReturn('text'); - - $query = $this->matchQueryBuilder->build([], $this->getMatchRequestQuery($rawQueryValue), 'should'); - - $expectedSelectQuery = [ - 'bool' => [ - 'should' => [ - [ - $match => [ - 'some_field' => [ - 'query' => $queryValue, - 'boost' => 43, - ], - ], - ], - ], - ], - ]; - - $this->assertEquals( - $expectedSelectQuery, - $query, - sprintf('Wrong "match" query. Should be processed with "%s"', $match) - ); - } - - /** - * @return array - */ - public function matchProvider() - { - return [ - ['query_value', 'query_value', 'match'], - ['"query value"', 'query value', 'match_phrase'], - ]; - } - - /** - * Gets fieldMapper mock object. - * - * @return FieldMapperInterface|MockObject - */ - private function getFieldMapper() - { - $fieldMapper = $this->getMockBuilder(FieldMapperInterface::class) - ->getMockForAbstractClass(); - - $fieldMapper->method('getFieldName') - ->with('some_field', ['type' => FieldMapperInterface::TYPE_QUERY]) - ->willReturnArgument(0); - - return $fieldMapper; - } - - /** - * Gets RequestQuery mock object. - * - * @param string $rawQueryValue - * @return MatchRequestQuery|MockObject - */ - private function getMatchRequestQuery($rawQueryValue) - { - $matchRequestQuery = $this->getMockBuilder(MatchRequestQuery::class) - ->disableOriginalConstructor() - ->getMock(); - - $matchRequestQuery->method('getValue') - ->willReturn($rawQueryValue); - $matchRequestQuery->method('getMatches') - ->willReturn([['field' => 'some_field', 'boost' => 42]]); - - return $matchRequestQuery; + ->willReturn($type); } } diff --git a/app/code/Magento/Elasticsearch/etc/adminhtml/system.xml b/app/code/Magento/Elasticsearch/etc/adminhtml/system.xml index dd42b408ff75e..1f61a48db9bfa 100644 --- a/app/code/Magento/Elasticsearch/etc/adminhtml/system.xml +++ b/app/code/Magento/Elasticsearch/etc/adminhtml/system.xml @@ -55,7 +55,15 @@ <field id="engine">elasticsearch</field> </depends> </field> - <field id="elasticsearch_test_connect_wizard" translate="button_label" sortOrder="68" showInDefault="1" showInWebsite="0" showInStore="0"> + <field id="elasticsearch_minimum_should_match" translate="label" type="text" sortOrder="68" showInDefault="1" showInWebsite="0" showInStore="0"> + <label>Minimum Terms to Match</label> + <depends> + <field id="engine">elasticsearch</field> + </depends> + <comment><![CDATA[See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-minimum-should-match.html">here</a> for possible values.]]></comment> + <backend_model>Magento\Elasticsearch\Model\Config\Backend\MinimumShouldMatch</backend_model> + </field> + <field id="elasticsearch_test_connect_wizard" translate="button_label" sortOrder="69" showInDefault="1" showInWebsite="0" showInStore="0"> <label/> <button_label>Test Connection</button_label> <frontend_model>Magento\Elasticsearch\Block\Adminhtml\System\Config\TestConnection</frontend_model> @@ -109,7 +117,15 @@ <field id="engine">elasticsearch5</field> </depends> </field> - <field id="elasticsearch5_test_connect_wizard" translate="button_label" sortOrder="68" showInDefault="1" showInWebsite="0" showInStore="0"> + <field id="elasticsearch5_minimum_should_match" translate="label" type="text" sortOrder="68" showInDefault="1" showInWebsite="0" showInStore="0"> + <label>Minimum Terms to Match</label> + <depends> + <field id="engine">elasticsearch5</field> + </depends> + <comment><![CDATA[See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-minimum-should-match.html">here</a> for possible values.]]></comment> + <backend_model>Magento\Elasticsearch\Model\Config\Backend\MinimumShouldMatch</backend_model> + </field> + <field id="elasticsearch5_test_connect_wizard" translate="button_label" sortOrder="69" showInDefault="1" showInWebsite="0" showInStore="0"> <label/> <button_label>Test Connection</button_label> <frontend_model>Magento\Elasticsearch\Block\Adminhtml\System\Config\Elasticsearch5\TestConnection</frontend_model> diff --git a/app/code/Magento/Elasticsearch/etc/config.xml b/app/code/Magento/Elasticsearch/etc/config.xml index 0e01aba5ed857..9df21978b5414 100644 --- a/app/code/Magento/Elasticsearch/etc/config.xml +++ b/app/code/Magento/Elasticsearch/etc/config.xml @@ -14,12 +14,14 @@ <elasticsearch_index_prefix>magento2</elasticsearch_index_prefix> <elasticsearch_enable_auth>0</elasticsearch_enable_auth> <elasticsearch_server_timeout>15</elasticsearch_server_timeout> + <elasticsearch_minimum_should_match></elasticsearch_minimum_should_match> <elasticsearch5_server_hostname>localhost</elasticsearch5_server_hostname> <elasticsearch5_server_port>9200</elasticsearch5_server_port> <elasticsearch5_index_prefix>magento2</elasticsearch5_index_prefix> <elasticsearch5_enable_auth>0</elasticsearch5_enable_auth> <elasticsearch5_server_timeout>15</elasticsearch5_server_timeout> + <elasticsearch5_minimum_should_match></elasticsearch5_minimum_should_match> </search> </catalog> </default> diff --git a/app/code/Magento/Elasticsearch6/Model/Adapter/FieldMapper/AddDefaultSearchField.php b/app/code/Magento/Elasticsearch6/Model/Adapter/FieldMapper/AddDefaultSearchField.php new file mode 100644 index 0000000000000..27767f6567d96 --- /dev/null +++ b/app/code/Magento/Elasticsearch6/Model/Adapter/FieldMapper/AddDefaultSearchField.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Elasticsearch6\Model\Adapter\FieldMapper; + +use Magento\Elasticsearch\Model\Adapter\FieldsMappingPreprocessorInterface; + +/** + * Add default search field (catch all field) to the mapping. + */ +class AddDefaultSearchField implements FieldsMappingPreprocessorInterface +{ + /** + * catch all field name + */ + private const NAME = '_search'; + /** + * Add default search field (catch all field) to the fields. + * + * Emulates catch all field (_all) for elasticsearch version 6.0+ + * + * @param array $mapping + * @return array + */ + public function process(array $mapping): array + { + return [self::NAME => ['type' => 'text']] + $mapping; + } +} diff --git a/app/code/Magento/Elasticsearch6/Model/Adapter/FieldMapper/CopySearchableFieldsToSearchField.php b/app/code/Magento/Elasticsearch6/Model/Adapter/FieldMapper/CopySearchableFieldsToSearchField.php new file mode 100644 index 0000000000000..6179eacba5ad7 --- /dev/null +++ b/app/code/Magento/Elasticsearch6/Model/Adapter/FieldMapper/CopySearchableFieldsToSearchField.php @@ -0,0 +1,52 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Elasticsearch6\Model\Adapter\FieldMapper; + +use Magento\Elasticsearch\Model\Adapter\FieldsMappingPreprocessorInterface; + +/** + * Add "copy_to" parameter for default search field to index fields. + */ +class CopySearchableFieldsToSearchField implements FieldsMappingPreprocessorInterface +{ + /** + * List of field types to copy + */ + private const FIELD_TYPES = ['text', 'keyword']; + /** + * Add "copy_to" parameter for default search field to index fields. + * + * Emulates catch all field (_all) for elasticsearch version 6.0+ + * + * @param array $mapping + * @return array + */ + public function process(array $mapping): array + { + foreach ($mapping as $field => $definition) { + if ($this->isSearchable($definition)) { + $definition['copy_to'][] = '_search'; + $mapping[$field] = $definition; + } + } + return $mapping; + } + + /** + * Determine if the field is searchable by mapping + * + * The field is searchable if it's indexed and its mapping type is either "text" or "keyword" + * + * @param array $mapping + * @return bool + */ + private function isSearchable(array $mapping): bool + { + return in_array($mapping['type'] ?? null, self::FIELD_TYPES) && (($mapping['index'] ?? true) !== false); + } +} diff --git a/app/code/Magento/Elasticsearch6/Model/Client/Elasticsearch.php b/app/code/Magento/Elasticsearch6/Model/Client/Elasticsearch.php index 34129a5af0012..c72ce4776909e 100644 --- a/app/code/Magento/Elasticsearch6/Model/Client/Elasticsearch.php +++ b/app/code/Magento/Elasticsearch6/Model/Client/Elasticsearch.php @@ -5,8 +5,9 @@ */ namespace Magento\Elasticsearch6\Model\Client; -use Magento\Framework\Exception\LocalizedException; use Magento\AdvancedSearch\Model\Client\ClientInterface; +use Magento\Elasticsearch\Model\Adapter\FieldsMappingPreprocessorInterface; +use Magento\Framework\Exception\LocalizedException; /** * Elasticsearch client @@ -29,17 +30,23 @@ class Elasticsearch implements ClientInterface * @var bool */ private $pingResult; + /** + * @var FieldsMappingPreprocessorInterface[] + */ + private $fieldsMappingPreprocessors; /** * Initialize Elasticsearch Client * * @param array $options * @param \Elasticsearch\Client|null $elasticsearchClient + * @param FieldsMappingPreprocessorInterface[] $fieldsMappingPreprocessors * @throws LocalizedException */ public function __construct( $options = [], - $elasticsearchClient = null + $elasticsearchClient = null, + $fieldsMappingPreprocessors = [] ) { if (empty($options['hostname']) || ((!empty($options['enableAuth']) && ($options['enableAuth'] == 1)) && (empty($options['username']) || empty($options['password'])))) { @@ -54,6 +61,17 @@ public function __construct( } $this->client[getmypid()] = $elasticsearchClient; $this->clientOptions = $options; + foreach ($fieldsMappingPreprocessors as $preprocessor) { + if (!$preprocessor instanceof FieldsMappingPreprocessorInterface) { + throw new \InvalidArgumentException( + sprintf( + 'Instance of FieldsMappingPreprocessorInterface is expected, got %s instead.', + get_class($preprocessor) + ) + ); + } + } + $this->fieldsMappingPreprocessors = $fieldsMappingPreprocessors; } /** @@ -249,11 +267,7 @@ public function addFieldsMapping(array $fields, $index, $entityType) 'type' => $entityType, 'body' => [ $entityType => [ - 'properties' => [ - '_search' => [ - 'type' => 'text' - ], - ], + 'properties' => [], 'dynamic_templates' => [ [ 'price_mapping' => [ @@ -291,7 +305,7 @@ public function addFieldsMapping(array $fields, $index, $entityType) ], ]; - foreach ($fields as $field => $fieldInfo) { + foreach ($this->applyFieldsMappingPreprocessors($fields) as $field => $fieldInfo) { $params['body'][$entityType]['properties'][$field] = $fieldInfo; } @@ -336,4 +350,18 @@ public function suggest($query) { return $this->getClient()->suggest($query); } + + /** + * Apply fields mapping preprocessors + * + * @param array $properties + * @return array + */ + private function applyFieldsMappingPreprocessors(array $properties): array + { + foreach ($this->fieldsMappingPreprocessors as $preprocessor) { + $properties = $preprocessor->process($properties); + } + return $properties; + } } diff --git a/app/code/Magento/Elasticsearch6/Test/Unit/Model/Adapter/FieldMapper/AddDefaultSearchFieldTest.php b/app/code/Magento/Elasticsearch6/Test/Unit/Model/Adapter/FieldMapper/AddDefaultSearchFieldTest.php new file mode 100644 index 0000000000000..7da68168f8c97 --- /dev/null +++ b/app/code/Magento/Elasticsearch6/Test/Unit/Model/Adapter/FieldMapper/AddDefaultSearchFieldTest.php @@ -0,0 +1,85 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Elasticsearch6\Test\Unit\Model\Adapter\FieldMapper; + +use Magento\Elasticsearch6\Model\Adapter\FieldMapper\AddDefaultSearchField; +use Magento\Framework\TestFramework\Unit\BaseTestCase; + +/** + * Test mapping preprocessor AddDefaultSearchField + */ +class AddDefaultSearchFieldTest extends BaseTestCase +{ + /** + * @var AddDefaultSearchField + */ + private $model; + + /** + * @inheritDoc + */ + protected function setUp() + { + parent::setUp(); + $this->model = $this->objectManager->getObject(AddDefaultSearchField::class); + } + + /** + * Test default search field "_search" should be prepended and overwrite if exist. + * + * @dataProvider processDataProvider + * @param array $mappingBefore + * @param array $mappingAfter + */ + public function testProcess(array $mappingBefore, array $mappingAfter) + { + $this->assertEquals($mappingAfter, $this->model->process($mappingBefore)); + } + + /** + * @return array + */ + public function processDataProvider(): array + { + return [ + '_search field should be prepended if not exist' => [ + [ + 'name' => [ + 'type' => 'text' + ] + ], + [ + '_search' => [ + 'type' => 'text' + ], + 'name' => [ + 'type' => 'text' + ] + ] + ], + '_search field should be prepended and overwrite if exist' => [ + [ + 'name' => [ + 'type' => 'text', + ], + '_search' => [ + 'type' => 'keyword' + ], + ], + [ + '_search' => [ + 'type' => 'text' + ], + 'name' => [ + 'type' => 'text', + ] + ] + ] + ]; + } +} diff --git a/app/code/Magento/Elasticsearch6/Test/Unit/Model/Adapter/FieldMapper/CopySearchableFieldsToSearchFieldTest.php b/app/code/Magento/Elasticsearch6/Test/Unit/Model/Adapter/FieldMapper/CopySearchableFieldsToSearchFieldTest.php new file mode 100644 index 0000000000000..c366e55fbbdf7 --- /dev/null +++ b/app/code/Magento/Elasticsearch6/Test/Unit/Model/Adapter/FieldMapper/CopySearchableFieldsToSearchFieldTest.php @@ -0,0 +1,136 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Elasticsearch6\Test\Unit\Model\Adapter\FieldMapper; + +use Magento\Elasticsearch6\Model\Adapter\FieldMapper\CopySearchableFieldsToSearchField; +use Magento\Framework\TestFramework\Unit\BaseTestCase; + +/** + * Test mapping preprocessor CopySearchableFieldsToSearchField + */ +class CopySearchableFieldsToSearchFieldTest extends BaseTestCase +{ + /** + * @var CopySearchableFieldsToSearchField + */ + private $model; + + /** + * @inheritDoc + */ + protected function setUp() + { + parent::setUp(); + $this->model = $this->objectManager->getObject(CopySearchableFieldsToSearchField::class); + } + + /** + * Test "copy_to" parameter should be added to searchable fields. + * + * @dataProvider processDataProvider + * @param array $mappingBefore + * @param array $mappingAfter + */ + public function testProcess(array $mappingBefore, array $mappingAfter) + { + $this->assertEquals($mappingAfter, $this->model->process($mappingBefore)); + } + + /** + * @return array + */ + public function processDataProvider(): array + { + return [ + 'index text field should be copied' => [ + [ + 'name' => [ + 'type' => 'text' + ] + ], + [ + 'name' => [ + 'type' => 'text', + 'copy_to' => [ + '_search' + ] + ] + ] + ], + 'non-index text field should not be copied' => [ + [ + 'name' => [ + 'type' => 'text', + 'index' => false + ] + ], + [ + 'name' => [ + 'type' => 'text', + 'index' => false + ] + ] + ], + 'index keyword field should be copied' => [ + [ + 'material' => [ + 'type' => 'keyword' + ] + ], + [ + 'material' => [ + 'type' => 'keyword', + 'copy_to' => [ + '_search' + ] + ] + ] + ], + 'non-index keyword field should not be copied' => [ + [ + 'country_of_manufacture' => [ + 'type' => 'keyword', + 'index' => false + ] + ], + [ + 'country_of_manufacture' => [ + 'type' => 'keyword', + 'index' => false + ] + ] + ], + 'index integer field should not be copied' => [ + [ + 'sale' => [ + 'type' => 'integer', + ] + ], + [ + 'sale' => [ + 'type' => 'integer', + ] + ] + ], + 'non-index integer field should not be copied' => [ + [ + 'position_category_1' => [ + 'type' => 'integer', + 'index' => false + ] + ], + [ + 'position_category_1' => [ + 'type' => 'integer', + 'index' => false + ] + ] + ], + ]; + } +} diff --git a/app/code/Magento/Elasticsearch6/Test/Unit/Model/Client/ElasticsearchTest.php b/app/code/Magento/Elasticsearch6/Test/Unit/Model/Client/ElasticsearchTest.php index 487a5a886f951..b7cca13fdefef 100644 --- a/app/code/Magento/Elasticsearch6/Test/Unit/Model/Client/ElasticsearchTest.php +++ b/app/code/Magento/Elasticsearch6/Test/Unit/Model/Client/ElasticsearchTest.php @@ -6,6 +6,7 @@ namespace Magento\Elasticsearch6\Test\Unit\Model\Client; use Magento\Elasticsearch\Model\Client\Elasticsearch as ElasticsearchClient; +use Magento\Elasticsearch6\Model\Adapter\FieldMapper\AddDefaultSearchField; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; /** @@ -86,7 +87,10 @@ protected function setUp() \Magento\Elasticsearch6\Model\Client\Elasticsearch::class, [ 'options' => $this->getOptions(), - 'elasticsearchClient' => $this->elasticsearchClientMock + 'elasticsearchClient' => $this->elasticsearchClientMock, + 'fieldsMappingPreprocessors' => [ + new AddDefaultSearchField() + ] ] ); } diff --git a/app/code/Magento/Elasticsearch6/etc/adminhtml/system.xml b/app/code/Magento/Elasticsearch6/etc/adminhtml/system.xml index 067a0acb8c908..8d22fcbc5f8f4 100644 --- a/app/code/Magento/Elasticsearch6/etc/adminhtml/system.xml +++ b/app/code/Magento/Elasticsearch6/etc/adminhtml/system.xml @@ -70,7 +70,17 @@ </depends> </field> - <field id="elasticsearch6_test_connect_wizard" translate="button_label" sortOrder="78" showInDefault="1" + <field id="elasticsearch6_minimum_should_match" translate="label" type="text" sortOrder="78" showInDefault="1" + showInWebsite="0" showInStore="0"> + <label>Minimum Terms to Match</label> + <depends> + <field id="engine">elasticsearch6</field> + </depends> + <comment><![CDATA[See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-minimum-should-match.html">here</a> for possible values.]]></comment> + <backend_model>Magento\Elasticsearch\Model\Config\Backend\MinimumShouldMatch</backend_model> + </field> + + <field id="elasticsearch6_test_connect_wizard" translate="button_label" sortOrder="79" showInDefault="1" showInWebsite="0" showInStore="0"> <label/> <button_label>Test Connection</button_label> diff --git a/app/code/Magento/Elasticsearch6/etc/config.xml b/app/code/Magento/Elasticsearch6/etc/config.xml index 047ae977fdef1..3c0f28ee16eaa 100644 --- a/app/code/Magento/Elasticsearch6/etc/config.xml +++ b/app/code/Magento/Elasticsearch6/etc/config.xml @@ -14,6 +14,7 @@ <elasticsearch6_index_prefix>magento2</elasticsearch6_index_prefix> <elasticsearch6_enable_auth>0</elasticsearch6_enable_auth> <elasticsearch6_server_timeout>15</elasticsearch6_server_timeout> + <elasticsearch6_minimum_should_match></elasticsearch6_minimum_should_match> </search> </catalog> </default> diff --git a/app/code/Magento/Elasticsearch6/etc/di.xml b/app/code/Magento/Elasticsearch6/etc/di.xml index 580c61ffc8cdb..6419b0aa3ee73 100644 --- a/app/code/Magento/Elasticsearch6/etc/di.xml +++ b/app/code/Magento/Elasticsearch6/etc/di.xml @@ -111,6 +111,15 @@ </arguments> </type> + <type name="Magento\Elasticsearch6\Model\Client\Elasticsearch"> + <arguments> + <argument name="fieldsMappingPreprocessors" xsi:type="array"> + <item name="elasticsearch6_copy_searchable_fields_to_search_field" xsi:type="object">Magento\Elasticsearch6\Model\Adapter\FieldMapper\CopySearchableFieldsToSearchField</item> + <item name="elasticsearch6_add_default_search_field" xsi:type="object">Magento\Elasticsearch6\Model\Adapter\FieldMapper\AddDefaultSearchField</item> + </argument> + </arguments> + </type> + <type name="Magento\Framework\Search\Dynamic\IntervalFactory"> <arguments> <argument name="intervals" xsi:type="array"> From 529c46f8d445cfb27c58519bf0caab398c15d1c7 Mon Sep 17 00:00:00 2001 From: Marc Rodriguez <marc.rodriguez@interactiv4.com> Date: Sun, 27 Oct 2019 14:36:07 +0100 Subject: [PATCH 058/586] Error in vendor/magento/module-shipping/Model/Config/Source/Allmethods.php - public function toOptionArray --- app/code/Magento/Shipping/Model/Config/Source/Allmethods.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/code/Magento/Shipping/Model/Config/Source/Allmethods.php b/app/code/Magento/Shipping/Model/Config/Source/Allmethods.php index e310df8ed11cb..bafb9ed49cf30 100644 --- a/app/code/Magento/Shipping/Model/Config/Source/Allmethods.php +++ b/app/code/Magento/Shipping/Model/Config/Source/Allmethods.php @@ -56,6 +56,11 @@ public function toOptionArray($isActiveOnlyFlag = false) ); $methods[$carrierCode] = ['label' => $carrierTitle, 'value' => []]; foreach ($carrierMethods as $methodCode => $methodTitle) { + + /** Check it $carrierMethods array was well formed */ + if (!$methodCode) { + continue; + } $methods[$carrierCode]['value'][] = [ 'value' => $carrierCode . '_' . $methodCode, 'label' => '[' . $carrierCode . '] ' . $methodTitle, From 74892074f9bbed128a4c0c2e7c14a8f47d317755 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <p.bystritsky@yandex.ru> Date: Mon, 28 Oct 2019 14:29:51 +0200 Subject: [PATCH 059/586] magento/magento2#22856: Integration test fix. --- .../Magento/Catalog/Block/Product/View/OptionsTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/OptionsTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/OptionsTest.php index 8997920ac1e3a..3d767502dd784 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/OptionsTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/OptionsTest.php @@ -152,7 +152,7 @@ private function getExpectedJsonConfig() public function testGetJsonConfigWithCatalogRules() { $this->indexBuilder->reindexFull(); - + sleep(1); $config = json_decode($this->block->getJsonConfig(), true); $configValues = array_values($config); $this->assertEquals($this->getExpectedJsonConfigWithCatalogRules(), array_values($configValues[0])); From c57d98c67343794530cd9e9d7405c095bc31fad8 Mon Sep 17 00:00:00 2001 From: Douglas Radburn <douglas.radburn@pinpointdesigns.co.uk> Date: Mon, 28 Oct 2019 21:27:10 +0000 Subject: [PATCH 060/586] Updated page 1 to not include p1 in URL link --- app/code/Magento/Theme/Block/Html/Pager.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Theme/Block/Html/Pager.php b/app/code/Magento/Theme/Block/Html/Pager.php index ad3f4aad676eb..e86310b66bb4b 100644 --- a/app/code/Magento/Theme/Block/Html/Pager.php +++ b/app/code/Magento/Theme/Block/Html/Pager.php @@ -450,7 +450,9 @@ public function getLastPageUrl() */ public function getPageUrl($page) { - return $this->getPagerUrl([$this->getPageVarName() => $page]); + return $this->getPagerUrl([ + $this->getPageVarName() => $page > 1 ? $page : null, + ]); } /** From f0e0d1c3bbe846694c2a1c919b796c2a53d50570 Mon Sep 17 00:00:00 2001 From: Daniel Ruf <d.ruf@bitexpert.de> Date: Tue, 29 Oct 2019 10:10:06 +0100 Subject: [PATCH 061/586] Do not use splat operator as we use associative arrays --- .../Magento/AsynchronousOperations/Model/OperationProcessor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/AsynchronousOperations/Model/OperationProcessor.php b/app/code/Magento/AsynchronousOperations/Model/OperationProcessor.php index f7a411c745b1f..ded507958d8a3 100644 --- a/app/code/Magento/AsynchronousOperations/Model/OperationProcessor.php +++ b/app/code/Magento/AsynchronousOperations/Model/OperationProcessor.php @@ -187,7 +187,7 @@ private function executeHandler($callback, $entityParams) 'output_data' => null ]; try { - $result['output_data'] = $callback(...$entityParams); + $result['output_data'] = call_user_func_array($callback, $entityParams); $result['messages'][] = sprintf('Service execution success %s::%s', get_class($callback[0]), $callback[1]); } catch (\Zend_Db_Adapter_Exception $e) { $this->logger->critical($e->getMessage()); From 79be5ed26493ef2ad801d3a06da44357b2459abf Mon Sep 17 00:00:00 2001 From: Adarsh Manickam <adarsh.apple@icloud.com> Date: Fri, 1 Nov 2019 13:42:48 +0530 Subject: [PATCH 062/586] Fixed model save and ObjectManager usage --- .../Adminhtml/Email/Template/Save.php | 71 +++++++++++++++---- 1 file changed, 57 insertions(+), 14 deletions(-) diff --git a/app/code/Magento/Email/Controller/Adminhtml/Email/Template/Save.php b/app/code/Magento/Email/Controller/Adminhtml/Email/Template/Save.php index 135506f4068a8..e61f45dd8be0f 100644 --- a/app/code/Magento/Email/Controller/Adminhtml/Email/Template/Save.php +++ b/app/code/Magento/Email/Controller/Adminhtml/Email/Template/Save.php @@ -1,15 +1,62 @@ <?php /** - * * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Email\Controller\Adminhtml\Email\Template; +use Exception; +use Magento\Backend\App\Action\Context; +use Magento\Backend\Model\Session; +use Magento\Email\Controller\Adminhtml\Email\Template; +use Magento\Email\Model\ResourceModel\Template as TemplateResource; +use Magento\Framework\App\Action\HttpPostActionInterface; use Magento\Framework\App\TemplateTypesInterface; +use Magento\Framework\Registry; +use Magento\Framework\Stdlib\DateTime\DateTime; -class Save extends \Magento\Email\Controller\Adminhtml\Email\Template +/** + * Save Controller + */ +class Save extends Template implements HttpPostActionInterface { + /** + * @var DateTime + */ + private $dateTime; + + /** + * @var TemplateResource + */ + private $templateResource; + + /** + * @var Session + */ + private $backendSession; + + /** + * Save constructor + * + * @param Context $context + * @param Registry $coreRegistry + * @param DateTime $dateTime + * @param TemplateResource $templateResource + * @param Session $backendSession + */ + public function __construct( + Context $context, + Registry $coreRegistry, + DateTime $dateTime, + TemplateResource $templateResource, + Session $backendSession + ) { + $this->dateTime = $dateTime; + $this->templateResource = $templateResource; + $this->backendSession = $backendSession; + parent::__construct($context, $coreRegistry); + } + /** * Save transactional email action * @@ -18,10 +65,10 @@ class Save extends \Magento\Email\Controller\Adminhtml\Email\Template public function execute() { $request = $this->getRequest(); - $id = $this->getRequest()->getParam('id'); + $templateId = $this->getRequest()->getParam('id'); $template = $this->_initTemplate('id'); - if (!$template->getId() && $id) { + if (!$template->getId() && $templateId) { $this->messageManager->addErrorMessage(__('This email template no longer exists.')); $this->_redirect('adminhtml/*/'); return; @@ -37,7 +84,7 @@ public function execute() )->setTemplateStyles( $request->getParam('template_styles') )->setModifiedAt( - $this->_objectManager->get(\Magento\Framework\Stdlib\DateTime\DateTime::class)->gmtDate() + $this->dateTime->gmtDate() )->setOrigTemplateCode( $request->getParam('orig_template_code') )->setOrigTemplateVariables( @@ -53,17 +100,13 @@ public function execute() $template->setTemplateStyles(''); } - $template->save(); - $this->_objectManager->get(\Magento\Backend\Model\Session::class)->setFormData(false); + $this->templateResource->save($template); + + $this->backendSession->setFormData(false); $this->messageManager->addSuccessMessage(__('You saved the email template.')); $this->_redirect('adminhtml/*'); - } catch (\Exception $e) { - $this->_objectManager->get( - \Magento\Backend\Model\Session::class - )->setData( - 'email_template_form_data', - $request->getParams() - ); + } catch (Exception $e) { + $this->backendSession->setData('email_template_form_data', $request->getParams()); $this->messageManager->addErrorMessage($e->getMessage()); $this->_forward('new'); } From 0bf7a4c1b87cf0a738ab17ad76a4cb5b46443167 Mon Sep 17 00:00:00 2001 From: Behnam Shayani <behnam.shayani@vaimo.com> Date: Sun, 3 Nov 2019 20:43:31 +0100 Subject: [PATCH 063/586] fix performance issue with attribute that have large numebr of options, do not loop over all options --- .../Adapter/BatchDataMapper/ProductDataMapper.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Elasticsearch/Model/Adapter/BatchDataMapper/ProductDataMapper.php b/app/code/Magento/Elasticsearch/Model/Adapter/BatchDataMapper/ProductDataMapper.php index 270ca37e2d42c..19b553dd05f08 100644 --- a/app/code/Magento/Elasticsearch/Model/Adapter/BatchDataMapper/ProductDataMapper.php +++ b/app/code/Magento/Elasticsearch/Model/Adapter/BatchDataMapper/ProductDataMapper.php @@ -285,9 +285,9 @@ private function getValuesLabels(Attribute $attribute, array $attributeValues): return $attributeLabels; } - foreach ($options as $option) { - if (\in_array($option->getValue(), $attributeValues)) { - $attributeLabels[] = $option->getLabel(); + foreach ($attributeValues as $attributeValue) { + if (isset($options[$attributeValue])) { + $attributeLabels[] = $options[$attributeValue]->getLabel(); } } @@ -304,7 +304,11 @@ private function getAttributeOptions(Attribute $attribute): array { if (!isset($this->attributeOptionsCache[$attribute->getId()])) { $options = $attribute->getOptions() ?? []; - $this->attributeOptionsCache[$attribute->getId()] = $options; + $optionsByValue = []; + foreach ($options as $option) { + $optionsByValue[$option->getValue()] = $option; + } + $this->attributeOptionsCache[$attribute->getId()] = $optionsByValue; } return $this->attributeOptionsCache[$attribute->getId()]; From 2b5b9860c395ae85e6c1dc4a736571c9b8985e55 Mon Sep 17 00:00:00 2001 From: Ihor Sviziev <ihor-sviziev@users.noreply.github.com> Date: Mon, 4 Nov 2019 13:33:44 +0200 Subject: [PATCH 064/586] magento/magento2#25452 Elastic Search 5 Indexing Performance Issue Fix static tests --- .../Adapter/BatchDataMapper/ProductDataMapper.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Elasticsearch/Model/Adapter/BatchDataMapper/ProductDataMapper.php b/app/code/Magento/Elasticsearch/Model/Adapter/BatchDataMapper/ProductDataMapper.php index 19b553dd05f08..7b0f9cfe4b274 100644 --- a/app/code/Magento/Elasticsearch/Model/Adapter/BatchDataMapper/ProductDataMapper.php +++ b/app/code/Magento/Elasticsearch/Model/Adapter/BatchDataMapper/ProductDataMapper.php @@ -252,9 +252,14 @@ private function prepareAttributeValues( */ private function prepareMultiselectValues(array $values): array { - return \array_merge(...\array_map(function (string $value) { - return \explode(',', $value); - }, $values)); + return \array_merge( + ...\array_map( + function (string $value) { + return \explode(',', $value); + }, + $values + ) + ); } /** From ab1d4d67cd3dfba9346179f043e56a210616bd3f Mon Sep 17 00:00:00 2001 From: Edward Simpson <edward@skywire.co.uk> Date: Tue, 5 Nov 2019 17:05:18 +0000 Subject: [PATCH 065/586] Clearer PHPDocs comment for AbstractBlock::escapeJJsQuote and Escaper::escapeJsQuote --- lib/internal/Magento/Framework/Escaper.php | 3 ++- lib/internal/Magento/Framework/View/Element/AbstractBlock.php | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/Escaper.php b/lib/internal/Magento/Framework/Escaper.php index 1b766dea2105c..1587d33ddab49 100644 --- a/lib/internal/Magento/Framework/Escaper.php +++ b/lib/internal/Magento/Framework/Escaper.php @@ -310,7 +310,8 @@ public function escapeCss($string) } /** - * Escape quotes in java script + * Escape single quotes/apostrophes ('), or other specified $quote character + * in javascript (string or array of strings) * * @param string|array $data * @param string $quote diff --git a/lib/internal/Magento/Framework/View/Element/AbstractBlock.php b/lib/internal/Magento/Framework/View/Element/AbstractBlock.php index 4df1ac515a87b..59d925034d80d 100644 --- a/lib/internal/Magento/Framework/View/Element/AbstractBlock.php +++ b/lib/internal/Magento/Framework/View/Element/AbstractBlock.php @@ -985,10 +985,12 @@ public function escapeQuote($data, $addSlashes = false) } /** - * Escape quotes in java scripts + * Escape single quotes/apostrophes ('), or other specified $quote character + * in javascript (string or array of strings) * * @param string|array $data * @param string $quote + * * @return string|array * @deprecated 100.2.0 */ From bedbb377740644f236e93b2e34fc8fd70530aaa6 Mon Sep 17 00:00:00 2001 From: Anton Kaplia <akaplya@adobe.com> Date: Tue, 5 Nov 2019 11:13:10 -0600 Subject: [PATCH 066/586] JSON fields support --- app/etc/di.xml | 3 + .../Db/MySQL/Definition/Columns/Json.php | 73 +++++++++++++++++++ .../Declaration/Schema/Dto/Columns/Json.php | 68 +++++++++++++++++ .../Declaration/Schema/Dto/Factories/Json.php | 47 ++++++++++++ .../Setup/Declaration/Schema/etc/schema.xsd | 1 + .../Schema/etc/types/texts/json.xsd | 23 ++++++ .../JsonDefinition.php | 25 +++++++ 7 files changed, 240 insertions(+) create mode 100644 lib/internal/Magento/Framework/Setup/Declaration/Schema/Db/MySQL/Definition/Columns/Json.php create mode 100644 lib/internal/Magento/Framework/Setup/Declaration/Schema/Dto/Columns/Json.php create mode 100644 lib/internal/Magento/Framework/Setup/Declaration/Schema/Dto/Factories/Json.php create mode 100644 lib/internal/Magento/Framework/Setup/Declaration/Schema/etc/types/texts/json.xsd create mode 100644 lib/internal/Magento/Framework/Setup/SchemaListenerDefinition/JsonDefinition.php diff --git a/app/etc/di.xml b/app/etc/di.xml index f8818de2af842..167471dbd0397 100644 --- a/app/etc/di.xml +++ b/app/etc/di.xml @@ -1453,6 +1453,7 @@ <item name="primary" xsi:type="object">\Magento\Framework\Setup\Declaration\Schema\Dto\Factories\Primary</item> <item name="foreign" xsi:type="object">\Magento\Framework\Setup\Declaration\Schema\Dto\Factories\Foreign</item> <item name="index" xsi:type="object">\Magento\Framework\Setup\Declaration\Schema\Dto\Factories\Index</item> + <item name="json" xsi:type="object">\Magento\Framework\Setup\Declaration\Schema\Dto\Factories\Json</item> </argument> </arguments> </type> @@ -1480,6 +1481,7 @@ <item name="varchar" xsi:type="object">\Magento\Framework\Setup\Declaration\Schema\Db\MySQL\Definition\Columns\StringBinary</item> <item name="binary" xsi:type="object">\Magento\Framework\Setup\Declaration\Schema\Db\MySQL\Definition\Columns\StringBinary</item> <item name="varbinary" xsi:type="object">\Magento\Framework\Setup\Declaration\Schema\Db\MySQL\Definition\Columns\StringBinary</item> + <item name="json" xsi:type="object">\Magento\Framework\Setup\Declaration\Schema\Db\MySQL\Definition\Columns\Json</item> <item name="index" xsi:type="object">\Magento\Framework\Setup\Declaration\Schema\Db\MySQL\Definition\Index</item> <item name="unique" xsi:type="object">\Magento\Framework\Setup\Declaration\Schema\Db\MySQL\Definition\Constraints\Internal</item> <item name="primary" xsi:type="object">\Magento\Framework\Setup\Declaration\Schema\Db\MySQL\Definition\Constraints\Internal</item> @@ -1593,6 +1595,7 @@ <item name="datetime" xsi:type="object">Magento\Framework\Setup\SchemaListenerDefinition\TimestampDefinition</item> <item name="date" xsi:type="object">Magento\Framework\Setup\SchemaListenerDefinition\DateDefinition</item> <item name="boolean" xsi:type="object">Magento\Framework\Setup\SchemaListenerDefinition\BooleanDefinition</item> + <item name="json" xsi:type="object">Magento\Framework\Setup\SchemaListenerDefinition\JsonDefinition</item> </argument> </arguments> </type> diff --git a/lib/internal/Magento/Framework/Setup/Declaration/Schema/Db/MySQL/Definition/Columns/Json.php b/lib/internal/Magento/Framework/Setup/Declaration/Schema/Db/MySQL/Definition/Columns/Json.php new file mode 100644 index 0000000000000..2ed65a9ff9d03 --- /dev/null +++ b/lib/internal/Magento/Framework/Setup/Declaration/Schema/Db/MySQL/Definition/Columns/Json.php @@ -0,0 +1,73 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Framework\Setup\Declaration\Schema\Db\MySQL\Definition\Columns; + +use Magento\Framework\App\ResourceConnection; +use Magento\Framework\Setup\Declaration\Schema\Db\DbDefinitionProcessorInterface; +use Magento\Framework\Setup\Declaration\Schema\Dto\ElementInterface; + +/** + * Process json data type. + * + * @inheritdoc + */ +class Json implements DbDefinitionProcessorInterface +{ + /** + * @var Nullable + */ + private $nullable; + + /** + * @var ResourceConnection + */ + private $resourceConnection; + + /** + * @var Comment + */ + private $comment; + + /** + * Blob constructor. + * + * @param Nullable $nullable + * @param Comment $comment + * @param ResourceConnection $resourceConnection + */ + public function __construct( + Nullable $nullable, + Comment $comment, + ResourceConnection $resourceConnection + ) { + $this->nullable = $nullable; + $this->resourceConnection = $resourceConnection; + $this->comment = $comment; + } + + /** + * @inheritdoc + */ + public function toDefinition(ElementInterface $column) + { + return sprintf( + '%s %s %s %s', + $this->resourceConnection->getConnection()->quoteIdentifier($column->getName()), + $column->getType(), + $this->nullable->toDefinition($column), + $this->comment->toDefinition($column) + ); + } + + /** + * @inheritdoc + */ + public function fromDefinition(array $data) + { + return $data; + } +} diff --git a/lib/internal/Magento/Framework/Setup/Declaration/Schema/Dto/Columns/Json.php b/lib/internal/Magento/Framework/Setup/Declaration/Schema/Dto/Columns/Json.php new file mode 100644 index 0000000000000..8b8de071068a1 --- /dev/null +++ b/lib/internal/Magento/Framework/Setup/Declaration/Schema/Dto/Columns/Json.php @@ -0,0 +1,68 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Framework\Setup\Declaration\Schema\Dto\Columns; + +use Magento\Framework\Setup\Declaration\Schema\Dto\Column; +use Magento\Framework\Setup\Declaration\Schema\Dto\ElementDiffAwareInterface; +use Magento\Framework\Setup\Declaration\Schema\Dto\Table; + +/** + * Text column. + * Declared in SQL, like: JSON + */ +class Json extends Column implements + ElementDiffAwareInterface, + ColumnNullableAwareInterface +{ + /**Json + * @var bool + */ + private $nullable; + + /** + * Constructor. + * + * @param string $name + * @param string $type + * @param Table $table + * @param bool $nullable + * @param string|null $comment + * @param string|null $onCreate + */ + public function __construct( + string $name, + string $type, + Table $table, + bool $nullable = true, + string $comment = null, + string $onCreate = null + ) { + parent::__construct($name, $type, $table, $comment, $onCreate); + $this->nullable = $nullable; + } + + /** + * Check whether column can be nullable. + * + * @return bool + */ + public function isNullable() + { + return $this->nullable; + } + + /** + * @inheritdoc + */ + public function getDiffSensitiveParams() + { + return [ + 'type' => $this->getType(), + 'nullable' => $this->isNullable(), + 'comment' => $this->getComment() + ]; + } +} diff --git a/lib/internal/Magento/Framework/Setup/Declaration/Schema/Dto/Factories/Json.php b/lib/internal/Magento/Framework/Setup/Declaration/Schema/Dto/Factories/Json.php new file mode 100644 index 0000000000000..f778b048413de --- /dev/null +++ b/lib/internal/Magento/Framework/Setup/Declaration/Schema/Dto/Factories/Json.php @@ -0,0 +1,47 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Framework\Setup\Declaration\Schema\Dto\Factories; + +use Magento\Framework\ObjectManagerInterface; + +/** + * Class Json + */ +class Json implements FactoryInterface +{ + + /** + * @var ObjectManagerInterface + */ + private $objectManager; + + /** + * @var string + */ + private $className; + + /** + * Constructor. + * + * @param ObjectManagerInterface $objectManager + * @param string $className + */ + public function __construct( + ObjectManagerInterface $objectManager, + $className = \Magento\Framework\Setup\Declaration\Schema\Dto\Columns\Blob::class + ) { + $this->objectManager = $objectManager; + $this->className = $className; + } + + /** + * {@inheritdoc} + */ + public function create(array $data) + { + return $this->objectManager->create($this->className, $data); + } +} diff --git a/lib/internal/Magento/Framework/Setup/Declaration/Schema/etc/schema.xsd b/lib/internal/Magento/Framework/Setup/Declaration/Schema/etc/schema.xsd index e3c54413f810b..bb9136d8a9ae6 100644 --- a/lib/internal/Magento/Framework/Setup/Declaration/Schema/etc/schema.xsd +++ b/lib/internal/Magento/Framework/Setup/Declaration/Schema/etc/schema.xsd @@ -20,6 +20,7 @@ <xs:include schemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/types/texts/longtext.xsd" /> <xs:include schemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/types/texts/mediumtext.xsd" /> <xs:include schemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/types/texts/varchar.xsd" /> + <xs:include schemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/types/texts/json.xsd" /> <xs:include schemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/types/binaries/blob.xsd" /> <xs:include schemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/types/binaries/mediumblob.xsd" /> <xs:include schemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/types/binaries/longblob.xsd" /> diff --git a/lib/internal/Magento/Framework/Setup/Declaration/Schema/etc/types/texts/json.xsd b/lib/internal/Magento/Framework/Setup/Declaration/Schema/etc/types/texts/json.xsd new file mode 100644 index 0000000000000..690f84a5ef43f --- /dev/null +++ b/lib/internal/Magento/Framework/Setup/Declaration/Schema/etc/types/texts/json.xsd @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> + <xs:include schemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/types/column.xsd"/> + + <xs:complexType name="json"> + <xs:complexContent> + <xs:extension base="abstractColumnType"> + <xs:annotation> + <xs:documentation> + Well formatted Json object + </xs:documentation> + </xs:annotation> + <xs:attribute name="nullable" type="xs:boolean" /> + </xs:extension> + </xs:complexContent> + </xs:complexType> +</xs:schema> diff --git a/lib/internal/Magento/Framework/Setup/SchemaListenerDefinition/JsonDefinition.php b/lib/internal/Magento/Framework/Setup/SchemaListenerDefinition/JsonDefinition.php new file mode 100644 index 0000000000000..04866dde943f4 --- /dev/null +++ b/lib/internal/Magento/Framework/Setup/SchemaListenerDefinition/JsonDefinition.php @@ -0,0 +1,25 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Framework\Setup\SchemaListenerDefinition; + +/** + * Json type definition. + */ +class JsonDefinition implements DefinitionConverterInterface +{ + /** + * @inheritdoc + */ + public function convertToDefinition(array $definition) + { + return [ + 'xsi:type' => $definition['type'], + 'name' => $definition['name'], + 'nullable' => $definition['nullable'] ?? true + ]; + } +} From ba5ee6edc002d2462c5bb784bd13b53dc4b87e60 Mon Sep 17 00:00:00 2001 From: Anton Kaplia <akaplya@adobe.com> Date: Tue, 5 Nov 2019 12:32:02 -0600 Subject: [PATCH 067/586] Fix static tests --- .../Schema/Db/MySQL/Definition/Columns/Json.php | 7 ++++--- .../Setup/Declaration/Schema/Dto/Columns/Json.php | 9 +++++---- .../Setup/Declaration/Schema/Dto/Factories/Json.php | 9 ++++++--- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/lib/internal/Magento/Framework/Setup/Declaration/Schema/Db/MySQL/Definition/Columns/Json.php b/lib/internal/Magento/Framework/Setup/Declaration/Schema/Db/MySQL/Definition/Columns/Json.php index 2ed65a9ff9d03..b25b70674e0d0 100644 --- a/lib/internal/Magento/Framework/Setup/Declaration/Schema/Db/MySQL/Definition/Columns/Json.php +++ b/lib/internal/Magento/Framework/Setup/Declaration/Schema/Db/MySQL/Definition/Columns/Json.php @@ -12,8 +12,6 @@ /** * Process json data type. - * - * @inheritdoc */ class Json implements DbDefinitionProcessorInterface { @@ -64,7 +62,10 @@ public function toDefinition(ElementInterface $column) } /** - * @inheritdoc + * Returns an array of column definitions + * + * @param array $data + * @return array */ public function fromDefinition(array $data) { diff --git a/lib/internal/Magento/Framework/Setup/Declaration/Schema/Dto/Columns/Json.php b/lib/internal/Magento/Framework/Setup/Declaration/Schema/Dto/Columns/Json.php index 8b8de071068a1..0f1e785730d38 100644 --- a/lib/internal/Magento/Framework/Setup/Declaration/Schema/Dto/Columns/Json.php +++ b/lib/internal/Magento/Framework/Setup/Declaration/Schema/Dto/Columns/Json.php @@ -3,6 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + namespace Magento\Framework\Setup\Declaration\Schema\Dto\Columns; use Magento\Framework\Setup\Declaration\Schema\Dto\Column; @@ -10,14 +11,14 @@ use Magento\Framework\Setup\Declaration\Schema\Dto\Table; /** + * Json + * * Text column. * Declared in SQL, like: JSON */ -class Json extends Column implements - ElementDiffAwareInterface, - ColumnNullableAwareInterface +class Json extends Column implements ElementDiffAwareInterface, ColumnNullableAwareInterface { - /**Json + /** * @var bool */ private $nullable; diff --git a/lib/internal/Magento/Framework/Setup/Declaration/Schema/Dto/Factories/Json.php b/lib/internal/Magento/Framework/Setup/Declaration/Schema/Dto/Factories/Json.php index f778b048413de..ec20e4a9438f3 100644 --- a/lib/internal/Magento/Framework/Setup/Declaration/Schema/Dto/Factories/Json.php +++ b/lib/internal/Magento/Framework/Setup/Declaration/Schema/Dto/Factories/Json.php @@ -3,6 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + namespace Magento\Framework\Setup\Declaration\Schema\Dto\Factories; use Magento\Framework\ObjectManagerInterface; @@ -12,7 +13,6 @@ */ class Json implements FactoryInterface { - /** * @var ObjectManagerInterface */ @@ -27,7 +27,7 @@ class Json implements FactoryInterface * Constructor. * * @param ObjectManagerInterface $objectManager - * @param string $className + * @param string $className */ public function __construct( ObjectManagerInterface $objectManager, @@ -38,7 +38,10 @@ public function __construct( } /** - * {@inheritdoc} + * Create element using definition data array. + * + * @param array $data + * @return \Magento\Framework\Setup\Declaration\Schema\Dto\ElementInterface|mixed */ public function create(array $data) { From 9bbc8f2db89920b68d9dfb0397771947c2da70b7 Mon Sep 17 00:00:00 2001 From: Edward Simpson <edward@skywire.co.uk> Date: Wed, 6 Nov 2019 10:09:16 +0000 Subject: [PATCH 068/586] Simplifying Escaper and AbstractBlock escapeJsQuote description and modifying PHPDoc param to specify can be string and array of strings --- lib/internal/Magento/Framework/Escaper.php | 5 ++--- .../Magento/Framework/View/Element/AbstractBlock.php | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/internal/Magento/Framework/Escaper.php b/lib/internal/Magento/Framework/Escaper.php index 1587d33ddab49..dd7a780af09fe 100644 --- a/lib/internal/Magento/Framework/Escaper.php +++ b/lib/internal/Magento/Framework/Escaper.php @@ -310,10 +310,9 @@ public function escapeCss($string) } /** - * Escape single quotes/apostrophes ('), or other specified $quote character - * in javascript (string or array of strings) + * Escape single quotes/apostrophes ('), or other specified $quote character in javascript * - * @param string|array $data + * @param string|string[]|array $data * @param string $quote * @return string|array * @deprecated 100.2.0 diff --git a/lib/internal/Magento/Framework/View/Element/AbstractBlock.php b/lib/internal/Magento/Framework/View/Element/AbstractBlock.php index 59d925034d80d..9b09818c3a2db 100644 --- a/lib/internal/Magento/Framework/View/Element/AbstractBlock.php +++ b/lib/internal/Magento/Framework/View/Element/AbstractBlock.php @@ -985,10 +985,9 @@ public function escapeQuote($data, $addSlashes = false) } /** - * Escape single quotes/apostrophes ('), or other specified $quote character - * in javascript (string or array of strings) + * Escape single quotes/apostrophes ('), or other specified $quote character in javascript * - * @param string|array $data + * @param string|string[]|array $data * @param string $quote * * @return string|array From a81802a9ceed3782da19a4f3a2a8267107b695a2 Mon Sep 17 00:00:00 2001 From: Buba Suma <soumah@adobe.com> Date: Fri, 25 Oct 2019 17:18:40 -0500 Subject: [PATCH 069/586] MC-22572: Shuffle related, up-sale and cross-sale products either by priority and weight - Fix random order of related, up-sell and cross-sell products - Add support for weighted random order of related, up-sell and cross-sell products --- .../templates/product/list/items.phtml | 10 ++- .../view/frontend/web/js/related-products.js | 77 +++++++++++++++--- .../view/frontend/web/js/upsell-products.js | 78 +++++++++++++++---- 3 files changed, 137 insertions(+), 28 deletions(-) diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml index 926e7c78a7df0..8f1fe3fa6874c 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml @@ -23,6 +23,7 @@ switch ($type = $block->getType()) { $items = $block->getAllItems(); $limit = $block->getPositionLimit(); $shuffle = (int) $block->isShuffled(); + $isWeightedRandom = (int) $block->getRotation()->isWeightedRandom($block->getProductListType()); $canItemsAddToCart = $block->canItemsAddToCart(); $showAddTo = true; @@ -43,6 +44,7 @@ switch ($type = $block->getType()) { $items = $block->getItems(); $limit = 0; $shuffle = 0; + $isWeightedRandom = 0; $canItemsAddToCart = $block->canItemsAddToCart(); $showAddTo = true; @@ -62,6 +64,7 @@ switch ($type = $block->getType()) { $items = $block->getAllItems(); $limit = $block->getPositionLimit(); $shuffle = (int) $block->isShuffled(); + $isWeightedRandom = (int) $block->getRotation()->isWeightedRandom($block->getProductListType()); $showAddTo = false; $showCart = false; @@ -82,6 +85,7 @@ switch ($type = $block->getType()) { $items = $block->getItemCollection()->getItems(); $limit = $block->getItemLimit('upsell'); $shuffle = 0; + $isWeightedRandom = 0; $showAddTo = false; $showCart = false; @@ -156,9 +160,9 @@ switch ($type = $block->getType()) { <?php if ($type == 'related' || $type == 'upsell') :?> <?php if ($type == 'related') :?> -<div class="block <?= $block->escapeHtmlAttr($class) ?>" data-mage-init='{"relatedProducts":{"relatedCheckbox":".related.checkbox"}}' data-limit="<?= $block->escapeHtmlAttr($limit) ?>" data-shuffle="<?= /* @noEscape */ $shuffle ?>"> +<div class="block <?= $block->escapeHtmlAttr($class) ?>" data-mage-init='{"relatedProducts":{"relatedCheckbox":".related.checkbox"}}' data-limit="<?= $block->escapeHtmlAttr($limit) ?>" data-shuffle="<?= /* @noEscape */ $shuffle ?>" data-shuffle-weighted="<?= /* @noEscape */ $isWeightedRandom ?>"> <?php else :?> - <div class="block <?= $block->escapeHtmlAttr($class) ?>" data-mage-init='{"upsellProducts":{}}' data-limit="<?= $block->escapeHtmlAttr($limit) ?>" data-shuffle="<?= /* @noEscape */ $shuffle ?>"> + <div class="block <?= $block->escapeHtmlAttr($class) ?>" data-mage-init='{"upsellProducts":{}}' data-limit="<?= $block->escapeHtmlAttr($limit) ?>" data-shuffle="<?= /* @noEscape */ $shuffle ?>" data-shuffle-weighted="<?= /* @noEscape */ $isWeightedRandom ?>"> <?php endif; ?> <?php else :?> <div class="block <?= $block->escapeHtmlAttr($class) ?>"> @@ -183,7 +187,7 @@ switch ($type = $block->getType()) { <?php endif; ?> <?php endif; ?> <?php if ($type == 'related' || $type == 'upsell') :?> - <li class="item product product-item" style="display: none;"> + <li class="item product product-item" style="display: none;" data-shuffle-group="<?= $block->escapeHtmlAttr($_item->getPriority()) ?>" > <?php else :?> <li class="item product product-item"> <?php endif; ?> diff --git a/app/code/Magento/Catalog/view/frontend/web/js/related-products.js b/app/code/Magento/Catalog/view/frontend/web/js/related-products.js index c875dd8f5d2c7..bc54fdeac5c28 100644 --- a/app/code/Magento/Catalog/view/frontend/web/js/related-products.js +++ b/app/code/Magento/Catalog/view/frontend/web/js/related-products.js @@ -28,10 +28,14 @@ define([ _create: function () { $(this.options.selectAllLink, this.element).on('click', $.proxy(this._selectAllRelated, this)); $(this.options.relatedCheckbox, this.element).on('click', $.proxy(this._addRelatedToProduct, this)); + + if (this.element.data('shuffle')) { + this._shuffle(this.element.find(this.options.elementsSelector)); + } this._showRelatedProducts( this.element.find(this.options.elementsSelector), this.element.data('limit'), - this.element.data('shuffle') + this.element.data('shuffle-weighted') ); }, @@ -69,24 +73,66 @@ define([ ); }, + /* jscs:disable */ + /* eslint-disable */ /** * Show related products according to limit. Shuffle if needed. * @param {*} elements * @param {*} limit - * @param {*} shuffle + * @param weightedRandom * @private */ - _showRelatedProducts: function (elements, limit, shuffle) { - var index; - - if (shuffle) { - this._shuffle(elements); - } + _showRelatedProducts: function (elements, limit, weightedRandom) { + var index, weights = [], random = [], weight = 2, shown = 0, $element, currentGroup, prevGroup; if (limit === 0) { limit = elements.length; } + if (weightedRandom && limit > 0 && limit < elements.length) { + for (index = 0; index < limit; index++) { + $element = $(elements[index]); + if ($element.data('shuffle-group') !== '') { + break; + } + $element.show(); + shown++; + } + limit -= shown; + for (index = elements.length - 1; index >= 0; index--) { + $element = $(elements[index]); + currentGroup = $element.data('shuffle-group'); + if (currentGroup !== '') { + weights.push([index, Math.log(weight)]); + if (typeof prevGroup !== 'undefined' && prevGroup !== currentGroup) { + weight += 2; + } + prevGroup = currentGroup; + } + } + + if (weights.length === 0) { + return; + } + + for (index = 0; index < weights.length; index++) { + random.push([weights[index][0], Math.pow(Math.random(), 1 / weights[index][1])]); + } + + random.sort(function(a, b) { + a = a[1]; + b = b[1]; + return a < b ? 1 : (a > b ? -1 : 0); + }); + index = 0; + while (limit) { + $(elements[random[index][0]]).show(); + limit--; + index++ + } + return; + } + for (index = 0; index < limit; index++) { $(elements[index]).show(); } @@ -96,12 +142,19 @@ define([ /* eslint-disable */ /** * Shuffle an array - * @param {Array} o + * @param {Array} elements * @returns {*} */ - _shuffle: function shuffle(o) { //v1.0 - for (var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x); - return o; + _shuffle: function shuffle(elements) { + var parent, child, lastSibling; + if (elements.length) { + parent = $(elements[0]).parent(); + } + while (elements.length) { + child = elements.splice(Math.floor(Math.random() * elements.length), 1)[0]; + lastSibling = parent.find('[data-shuffle-group="' + $(child).data('shuffle-group') + '"]').last(); + lastSibling.after(child); + } } /* jscs:disable */ diff --git a/app/code/Magento/Catalog/view/frontend/web/js/upsell-products.js b/app/code/Magento/Catalog/view/frontend/web/js/upsell-products.js index da2526d5679c8..867011d3d1646 100644 --- a/app/code/Magento/Catalog/view/frontend/web/js/upsell-products.js +++ b/app/code/Magento/Catalog/view/frontend/web/js/upsell-products.js @@ -19,33 +19,78 @@ define([ * @private */ _create: function () { + if (this.element.data('shuffle')) { + this._shuffle(this.element.find(this.options.elementsSelector)); + } this._showUpsellProducts( this.element.find(this.options.elementsSelector), this.element.data('limit'), - this.element.data('shuffle') + this.element.data('shuffle-weighted') ); }, + /* jscs:disable */ + /* eslint-disable */ /** * Show upsell products according to limit. Shuffle if needed. * @param {*} elements * @param {Number} limit - * @param {Boolean} shuffle + * @param {Boolean} weightedRandom * @private */ - _showUpsellProducts: function (elements, limit, shuffle) { - var index; - - if (shuffle) { - this._shuffle(elements); - } + _showUpsellProducts: function (elements, limit, weightedRandom) { + var index, weights = [], random = [], weight = 2, shown = 0, $element, currentGroup, prevGroup; if (limit === 0) { limit = elements.length; } + if (weightedRandom && limit > 0 && limit < elements.length) { + for (index = 0; index < limit; index++) { + $element = $(elements[index]); + if ($element.data('shuffle-group') !== '') { + break; + } + $element.show(); + shown++; + } + limit -= shown; + for (index = elements.length - 1; index >= 0; index--) { + $element = $(elements[index]); + currentGroup = $element.data('shuffle-group'); + if (currentGroup !== '') { + weights.push([index, Math.log(weight)]); + if (typeof prevGroup !== 'undefined' && prevGroup !== currentGroup) { + weight += 2; + } + prevGroup = currentGroup; + } + } + + if (weights.length === 0) { + return; + } + + for (index = 0; index < weights.length; index++) { + random.push([weights[index][0], Math.pow(Math.random(), 1 / weights[index][1])]); + } + + random.sort(function(a, b) { + a = a[1]; + b = b[1]; + return a < b ? 1 : (a > b ? -1 : 0); + }); + index = 0; + while (limit) { + $(elements[random[index][0]]).show(); + limit--; + index++ + } + return; + } + for (index = 0; index < limit; index++) { - $(this.element).find(elements[index]).show(); + $(elements[index]).show(); } }, @@ -53,12 +98,19 @@ define([ /* eslint-disable */ /** * Shuffle an array - * @param o + * @param elements * @returns {*} */ - _shuffle: function shuffle(o){ //v1.0 - for (var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x); - return o; + _shuffle: function shuffle(elements){ //v1.0 + var parent, child, lastSibling; + if (elements.length) { + parent = $(elements[0]).parent(); + } + while (elements.length) { + child = elements.splice(Math.floor(Math.random() * elements.length), 1)[0]; + lastSibling = parent.find('[data-shuffle-group="' + $(child).data('shuffle-group') + '"]').last(); + lastSibling.after(child); + } } /* jscs:disable */ From 627ac5a88c7f355f60cc764ef08bfe3d5df7a888 Mon Sep 17 00:00:00 2001 From: Nazarn96 <nazarn96@gmail.com> Date: Thu, 7 Nov 2019 12:06:17 +0200 Subject: [PATCH 070/586] fix static-test --- lib/internal/Magento/Framework/App/Bootstrap.php | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/internal/Magento/Framework/App/Bootstrap.php b/lib/internal/Magento/Framework/App/Bootstrap.php index d3290f8518b6e..e98631ec4adbd 100644 --- a/lib/internal/Magento/Framework/App/Bootstrap.php +++ b/lib/internal/Magento/Framework/App/Bootstrap.php @@ -270,7 +270,6 @@ public function run(AppInterface $application) } catch (\Throwable $e) { $this->terminate($e); } - } // phpcs:enable /** From 8b5818df65ad4ab7ed33fe5933782151f9b0d2cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Corr=C3=AAa=20Gomes?= <rafaelcgstz@gmail.com> Date: Thu, 7 Nov 2019 22:55:40 -0300 Subject: [PATCH 071/586] Contact form > Adding ViewModel --- .../Contact/ViewModel/UserDataProvider.php | 72 +++++++++++++++++++ .../frontend/layout/contact_index_index.xml | 3 + .../view/frontend/templates/form.phtml | 11 +-- 3 files changed, 82 insertions(+), 4 deletions(-) create mode 100644 app/code/Magento/Contact/ViewModel/UserDataProvider.php diff --git a/app/code/Magento/Contact/ViewModel/UserDataProvider.php b/app/code/Magento/Contact/ViewModel/UserDataProvider.php new file mode 100644 index 0000000000000..678f4349b0e88 --- /dev/null +++ b/app/code/Magento/Contact/ViewModel/UserDataProvider.php @@ -0,0 +1,72 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Contact\ViewModel; + +use Magento\Contact\Helper\Data; +use Magento\Framework\View\Element\Block\ArgumentInterface; + +/** + * Provides the user data to fill the form. + */ +class UserDataProvider implements ArgumentInterface +{ + + /** + * @var Data + */ + private $helper; + + /** + * UserDataProvider constructor. + * @param Data $helper + */ + public function __construct( + Data $helper + ) { + $this->helper = $helper; + } + + /** + * Get user name + * + * @return string + */ + public function getUserName() + { + return $this->helper->getPostValue('name') ?: $this->helper->getUserName(); + } + + /** + * Get user email + * + * @return string + */ + public function getUserEmail() + { + return $this->helper->getPostValue('email') ?: $this->helper->getUserEmail(); + } + + /** + * Get user telephone + * + * @return string + */ + public function getUserTelephone() + { + return $this->helper->getPostValue('telephone'); + } + + /** + * Get user comment + * + * @return string + */ + public function getUserComment() + { + return $this->helper->getPostValue('comment'); + } +} diff --git a/app/code/Magento/Contact/view/frontend/layout/contact_index_index.xml b/app/code/Magento/Contact/view/frontend/layout/contact_index_index.xml index 078c1a4ff5621..c7009831d4642 100644 --- a/app/code/Magento/Contact/view/frontend/layout/contact_index_index.xml +++ b/app/code/Magento/Contact/view/frontend/layout/contact_index_index.xml @@ -13,6 +13,9 @@ <referenceContainer name="content"> <block class="Magento\Contact\Block\ContactForm" name="contactForm" template="Magento_Contact::form.phtml"> <container name="form.additional.info" label="Form Additional Info"/> + <arguments> + <argument name="view_model" xsi:type="object">Magento\Contact\ViewModel\UserDataProvider</argument> + </arguments> </block> </referenceContainer> </body> diff --git a/app/code/Magento/Contact/view/frontend/templates/form.phtml b/app/code/Magento/Contact/view/frontend/templates/form.phtml index d64a991bcafad..74708bf276a78 100644 --- a/app/code/Magento/Contact/view/frontend/templates/form.phtml +++ b/app/code/Magento/Contact/view/frontend/templates/form.phtml @@ -6,6 +6,9 @@ // @codingStandardsIgnoreFile /** @var \Magento\Contact\Block\ContactForm $block */ +/** @var \Magento\Contact\ViewModel\UserDataProvider $viewModel */ + +$viewModel = $block->getViewModel(); ?> <form class="form contact" action="<?= $block->escapeUrl($block->getFormAction()) ?>" @@ -19,25 +22,25 @@ <div class="field name required"> <label class="label" for="name"><span><?= $block->escapeHtml(__('Name')) ?></span></label> <div class="control"> - <input name="name" id="name" title="<?= $block->escapeHtmlAttr(__('Name')) ?>" value="<?= $block->escapeHtmlAttr($this->helper('Magento\Contact\Helper\Data')->getPostValue('name') ?: $this->helper('Magento\Contact\Helper\Data')->getUserName()) ?>" class="input-text" type="text" data-validate="{required:true}"/> + <input name="name" id="name" title="<?= $block->escapeHtmlAttr(__('Name')) ?>" value="<?= $block->escapeHtmlAttr($viewModel->getUserName()) ?>" class="input-text" type="text" data-validate="{required:true}"/> </div> </div> <div class="field email required"> <label class="label" for="email"><span><?= $block->escapeHtml(__('Email')) ?></span></label> <div class="control"> - <input name="email" id="email" title="<?= $block->escapeHtmlAttr(__('Email')) ?>" value="<?= $block->escapeHtmlAttr($this->helper('Magento\Contact\Helper\Data')->getPostValue('email') ?: $this->helper('Magento\Contact\Helper\Data')->getUserEmail()) ?>" class="input-text" type="email" data-validate="{required:true, 'validate-email':true}"/> + <input name="email" id="email" title="<?= $block->escapeHtmlAttr(__('Email')) ?>" value="<?= $block->escapeHtmlAttr($viewModel->getUserEmail()) ?>" class="input-text" type="email" data-validate="{required:true, 'validate-email':true}"/> </div> </div> <div class="field telephone"> <label class="label" for="telephone"><span><?= $block->escapeHtml(__('Phone Number')) ?></span></label> <div class="control"> - <input name="telephone" id="telephone" title="<?= $block->escapeHtmlAttr(__('Phone Number')) ?>" value="<?= $block->escapeHtmlAttr($this->helper('Magento\Contact\Helper\Data')->getPostValue('telephone')) ?>" class="input-text" type="text" /> + <input name="telephone" id="telephone" title="<?= $block->escapeHtmlAttr(__('Phone Number')) ?>" value="<?= $block->escapeHtmlAttr($viewModel->getUserTelephone()) ?>" class="input-text" type="text" /> </div> </div> <div class="field comment required"> <label class="label" for="comment"><span><?= $block->escapeHtml(__('What’s on your mind?')) ?></span></label> <div class="control"> - <textarea name="comment" id="comment" title="<?= $block->escapeHtmlAttr(__('What’s on your mind?')) ?>" class="input-text" cols="5" rows="3" data-validate="{required:true}"><?= $block->escapeHtml($this->helper('Magento\Contact\Helper\Data')->getPostValue('comment')) ?></textarea> + <textarea name="comment" id="comment" title="<?= $block->escapeHtmlAttr(__('What’s on your mind?')) ?>" class="input-text" cols="5" rows="3" data-validate="{required:true}"><?= $block->escapeHtml($viewModel->getUserComment()) ?></textarea> </div> </div> <?= $block->getChildHtml('form.additional.info') ?> From bde46816fb391793b2a8958dbcd85ef95ca793ec Mon Sep 17 00:00:00 2001 From: Adarsh Manickam <adarsh.apple@icloud.com> Date: Fri, 8 Nov 2019 15:44:12 +0530 Subject: [PATCH 072/586] Added backward compatibility --- .../Adminhtml/Email/Template/Save.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/Email/Controller/Adminhtml/Email/Template/Save.php b/app/code/Magento/Email/Controller/Adminhtml/Email/Template/Save.php index e61f45dd8be0f..8e0b4d30ec511 100644 --- a/app/code/Magento/Email/Controller/Adminhtml/Email/Template/Save.php +++ b/app/code/Magento/Email/Controller/Adminhtml/Email/Template/Save.php @@ -11,6 +11,7 @@ use Magento\Email\Controller\Adminhtml\Email\Template; use Magento\Email\Model\ResourceModel\Template as TemplateResource; use Magento\Framework\App\Action\HttpPostActionInterface; +use Magento\Framework\App\ObjectManager; use Magento\Framework\App\TemplateTypesInterface; use Magento\Framework\Registry; use Magento\Framework\Stdlib\DateTime\DateTime; @@ -40,20 +41,20 @@ class Save extends Template implements HttpPostActionInterface * * @param Context $context * @param Registry $coreRegistry - * @param DateTime $dateTime - * @param TemplateResource $templateResource - * @param Session $backendSession + * @param DateTime|null $dateTime + * @param TemplateResource|null $templateResource + * @param Session|null $backendSession */ public function __construct( Context $context, Registry $coreRegistry, - DateTime $dateTime, - TemplateResource $templateResource, - Session $backendSession + DateTime $dateTime = null, + TemplateResource $templateResource = null, + Session $backendSession = null ) { - $this->dateTime = $dateTime; - $this->templateResource = $templateResource; - $this->backendSession = $backendSession; + $this->dateTime = $dateTime ?: ObjectManager::getInstance()->get(DateTime::class); + $this->templateResource = $templateResource ?: ObjectManager::getInstance()->get(TemplateResource::class); + $this->backendSession = $backendSession ?: ObjectManager::getInstance()->get(Session::class); parent::__construct($context, $coreRegistry); } From 2314bd3e02f0449af9e88d440fdc620e609d29fa Mon Sep 17 00:00:00 2001 From: Buba Suma <soumah@adobe.com> Date: Mon, 11 Nov 2019 10:46:29 -0600 Subject: [PATCH 073/586] MC-21807: Implement control over minimum_should_match for elasticsearch queries - Fix Magento-Health-Index-PR build failures --- .../FieldMapper/AddDefaultSearchFieldTest.php | 23 +++++-------------- .../CopySearchableFieldsToSearchFieldTest.php | 23 +++++-------------- 2 files changed, 12 insertions(+), 34 deletions(-) diff --git a/app/code/Magento/Elasticsearch6/Test/Unit/Model/Adapter/FieldMapper/AddDefaultSearchFieldTest.php b/app/code/Magento/Elasticsearch6/Test/Unit/Model/Adapter/FieldMapper/AddDefaultSearchFieldTest.php index 7da68168f8c97..1a1e7f4e0d643 100644 --- a/app/code/Magento/Elasticsearch6/Test/Unit/Model/Adapter/FieldMapper/AddDefaultSearchFieldTest.php +++ b/app/code/Magento/Elasticsearch6/Test/Unit/Model/Adapter/FieldMapper/AddDefaultSearchFieldTest.php @@ -8,27 +8,14 @@ namespace Magento\Elasticsearch6\Test\Unit\Model\Adapter\FieldMapper; use Magento\Elasticsearch6\Model\Adapter\FieldMapper\AddDefaultSearchField; -use Magento\Framework\TestFramework\Unit\BaseTestCase; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use PHPUnit\Framework\TestCase; /** * Test mapping preprocessor AddDefaultSearchField */ -class AddDefaultSearchFieldTest extends BaseTestCase +class AddDefaultSearchFieldTest extends TestCase { - /** - * @var AddDefaultSearchField - */ - private $model; - - /** - * @inheritDoc - */ - protected function setUp() - { - parent::setUp(); - $this->model = $this->objectManager->getObject(AddDefaultSearchField::class); - } - /** * Test default search field "_search" should be prepended and overwrite if exist. * @@ -38,7 +25,9 @@ protected function setUp() */ public function testProcess(array $mappingBefore, array $mappingAfter) { - $this->assertEquals($mappingAfter, $this->model->process($mappingBefore)); + $objectManager = new ObjectManager($this); + $model = $objectManager->getObject(AddDefaultSearchField::class); + $this->assertEquals($mappingAfter, $model->process($mappingBefore)); } /** diff --git a/app/code/Magento/Elasticsearch6/Test/Unit/Model/Adapter/FieldMapper/CopySearchableFieldsToSearchFieldTest.php b/app/code/Magento/Elasticsearch6/Test/Unit/Model/Adapter/FieldMapper/CopySearchableFieldsToSearchFieldTest.php index c366e55fbbdf7..cfe8b71095d21 100644 --- a/app/code/Magento/Elasticsearch6/Test/Unit/Model/Adapter/FieldMapper/CopySearchableFieldsToSearchFieldTest.php +++ b/app/code/Magento/Elasticsearch6/Test/Unit/Model/Adapter/FieldMapper/CopySearchableFieldsToSearchFieldTest.php @@ -8,27 +8,14 @@ namespace Magento\Elasticsearch6\Test\Unit\Model\Adapter\FieldMapper; use Magento\Elasticsearch6\Model\Adapter\FieldMapper\CopySearchableFieldsToSearchField; -use Magento\Framework\TestFramework\Unit\BaseTestCase; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use PHPUnit\Framework\TestCase; /** * Test mapping preprocessor CopySearchableFieldsToSearchField */ -class CopySearchableFieldsToSearchFieldTest extends BaseTestCase +class CopySearchableFieldsToSearchFieldTest extends TestCase { - /** - * @var CopySearchableFieldsToSearchField - */ - private $model; - - /** - * @inheritDoc - */ - protected function setUp() - { - parent::setUp(); - $this->model = $this->objectManager->getObject(CopySearchableFieldsToSearchField::class); - } - /** * Test "copy_to" parameter should be added to searchable fields. * @@ -38,7 +25,9 @@ protected function setUp() */ public function testProcess(array $mappingBefore, array $mappingAfter) { - $this->assertEquals($mappingAfter, $this->model->process($mappingBefore)); + $objectManager = new ObjectManager($this); + $model = $objectManager->getObject(CopySearchableFieldsToSearchField::class); + $this->assertEquals($mappingAfter, $model->process($mappingBefore)); } /** From 20ae9e3f3c9b89afe9a7439728cb05f20c09080d Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <p.bystritsky@yandex.ru> Date: Tue, 12 Nov 2019 11:32:07 +0200 Subject: [PATCH 074/586] magento/magento2#22856: Integration test fix. --- .../CatalogRule/_files/catalog_rule_10_off_not_logged.php | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_10_off_not_logged.php b/dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_10_off_not_logged.php index 48ed1956c88a1..52357706b0610 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_10_off_not_logged.php +++ b/dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_10_off_not_logged.php @@ -31,3 +31,4 @@ $indexBuilder = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() ->get(\Magento\CatalogRule\Model\Indexer\IndexBuilder::class); $indexBuilder->reindexFull(); +sleep(1); From 30087a0c1d12f11d77153932f0a2e9b3fb2a9cb8 Mon Sep 17 00:00:00 2001 From: Daniel Ruf <d.ruf@bitexpert.de> Date: Tue, 12 Nov 2019 14:55:14 +0100 Subject: [PATCH 075/586] Remove unused TemporaryStateExceptionInterface --- .../Magento/AsynchronousOperations/Model/OperationProcessor.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/AsynchronousOperations/Model/OperationProcessor.php b/app/code/Magento/AsynchronousOperations/Model/OperationProcessor.php index ded507958d8a3..b1bc990159bf3 100644 --- a/app/code/Magento/AsynchronousOperations/Model/OperationProcessor.php +++ b/app/code/Magento/AsynchronousOperations/Model/OperationProcessor.php @@ -18,7 +18,6 @@ use Magento\Framework\MessageQueue\ConsumerConfigurationInterface; use Psr\Log\LoggerInterface; use Magento\Framework\Exception\LocalizedException; -use Magento\Framework\Exception\TemporaryStateExceptionInterface; use Magento\Framework\DB\Adapter\ConnectionException; use Magento\Framework\DB\Adapter\DeadlockException; use Magento\Framework\DB\Adapter\LockWaitException; From 69447cbbfa4e70b162b9d080bd25f0a377edd6db Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <51681487+engcom-Foxtrot@users.noreply.github.com> Date: Wed, 13 Nov 2019 11:35:19 +0200 Subject: [PATCH 076/586] magento/magento2#22990: Static tests fix. --- .../web/catalog/category/assign-products.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/assign-products.js b/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/assign-products.js index 598bde9106231..20f773b650223 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/assign-products.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/assign-products.js @@ -53,15 +53,15 @@ define([ var trElement = Event.findElement(event, 'tr'), eventElement = Event.element(event), isInputCheckbox = eventElement.tagName === 'INPUT' && eventElement.type === 'checkbox', - isInputPosition = grid.targetElement - && grid.targetElement.tagName === 'INPUT' - && grid.targetElement.name === 'position', + isInputPosition = grid.targetElement && + grid.targetElement.tagName === 'INPUT' && + grid.targetElement.name === 'position', checked = false, checkbox = null; - if (eventElement.tagName === 'LABEL' - && trElement.querySelector('#' + eventElement.htmlFor) - && trElement.querySelector('#' + eventElement.htmlFor).type === 'checkbox' + if (eventElement.tagName === 'LABEL' && + trElement.querySelector('#' + eventElement.htmlFor) && + trElement.querySelector('#' + eventElement.htmlFor).type === 'checkbox' ) { event.stopPropagation(); trElement.querySelector('#' + eventElement.htmlFor).trigger('click'); From 021b5d858670d2f3c8eb2e82bc2454d825abe776 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <51681487+engcom-Foxtrot@users.noreply.github.com> Date: Wed, 13 Nov 2019 12:50:22 +0200 Subject: [PATCH 077/586] magento/magento2#22990: Static tests fix. --- .../view/adminhtml/web/catalog/category/assign-products.js | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/assign-products.js b/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/assign-products.js index 20f773b650223..807f92b2aa27e 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/assign-products.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/assign-products.js @@ -65,6 +65,7 @@ define([ ) { event.stopPropagation(); trElement.querySelector('#' + eventElement.htmlFor).trigger('click'); + return; } From 27a57deb6a6e2f4746e3d0a83946b8234818eee3 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <51681487+engcom-Foxtrot@users.noreply.github.com> Date: Wed, 13 Nov 2019 14:29:10 +0200 Subject: [PATCH 078/586] magento/magento2#22990: Static tests fix. --- .../view/adminhtml/web/catalog/category/assign-products.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/assign-products.js b/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/assign-products.js index 807f92b2aa27e..35b8958f2f8fd 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/assign-products.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/assign-products.js @@ -65,7 +65,7 @@ define([ ) { event.stopPropagation(); trElement.querySelector('#' + eventElement.htmlFor).trigger('click'); - + return; } From 0693cc2a75a1646080501176e24d3fd41a72a6b5 Mon Sep 17 00:00:00 2001 From: Alexey Arendarenko <alexeya@ven.com> Date: Thu, 14 Nov 2019 15:08:45 +0200 Subject: [PATCH 079/586] UrlRewrite module fixes add ability to save query param from request during redirect to target path --- app/code/Magento/UrlRewrite/Controller/Router.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/UrlRewrite/Controller/Router.php b/app/code/Magento/UrlRewrite/Controller/Router.php index dd26f49b8efa4..0525621b6a20e 100644 --- a/app/code/Magento/UrlRewrite/Controller/Router.php +++ b/app/code/Magento/UrlRewrite/Controller/Router.php @@ -118,7 +118,7 @@ protected function processRedirect($request, $rewrite) if ($rewrite->getEntityType() !== Rewrite::ENTITY_TYPE_CUSTOM || ($prefix = substr($target, 0, 6)) !== 'http:/' && $prefix !== 'https:' ) { - $target = $this->url->getUrl('', ['_direct' => $target]); + $target = $this->url->getUrl('', ['_direct' => $target, '_query' => $request->getParams()]); } return $this->redirect($request, $target, $rewrite->getRedirectType()); } From 19b7bdac3a33eb12395b9f362a7c03e013228cc8 Mon Sep 17 00:00:00 2001 From: Alexey Arendarenko <alexeya@ven.com> Date: Thu, 14 Nov 2019 15:08:55 +0200 Subject: [PATCH 080/586] UrlRewrite module fixes update unit test --- .../Test/Unit/Controller/RouterTest.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/UrlRewrite/Test/Unit/Controller/RouterTest.php b/app/code/Magento/UrlRewrite/Test/Unit/Controller/RouterTest.php index c935b3c7ec4cb..c67f3f400b007 100644 --- a/app/code/Magento/UrlRewrite/Test/Unit/Controller/RouterTest.php +++ b/app/code/Magento/UrlRewrite/Test/Unit/Controller/RouterTest.php @@ -260,6 +260,7 @@ public function testNoRewriteAfterStoreSwitcherWhenOldRewriteEqualsToNewOne() */ public function testMatchWithRedirect() { + $queryParams = []; $this->storeManager->expects($this->any())->method('getStore')->will($this->returnValue($this->store)); $urlRewrite = $this->getMockBuilder(UrlRewrite::class) ->disableOriginalConstructor()->getMock(); @@ -268,7 +269,11 @@ public function testMatchWithRedirect() $this->urlFinder->expects($this->any())->method('findOneByData')->will($this->returnValue($urlRewrite)); $this->response->expects($this->once())->method('setRedirect') ->with('new-target-path', 'redirect-code'); - $this->url->expects($this->once())->method('getUrl')->with('', ['_direct' => 'target-path']) + $this->request->expects($this->once())->method('getParams')->willReturn($queryParams); + $this->url->expects($this->once())->method('getUrl')->with( + '', + ['_direct' => 'target-path', '_query' => $queryParams] + ) ->will($this->returnValue('new-target-path')); $this->request->expects($this->once())->method('setDispatched')->with(true); $this->actionFactory->expects($this->once())->method('create') @@ -282,6 +287,7 @@ public function testMatchWithRedirect() */ public function testMatchWithCustomInternalRedirect() { + $queryParams = []; $this->storeManager->expects($this->any())->method('getStore')->will($this->returnValue($this->store)); $urlRewrite = $this->getMockBuilder(UrlRewrite::class) ->disableOriginalConstructor()->getMock(); @@ -289,8 +295,12 @@ public function testMatchWithCustomInternalRedirect() $urlRewrite->expects($this->any())->method('getRedirectType')->will($this->returnValue('redirect-code')); $urlRewrite->expects($this->any())->method('getTargetPath')->will($this->returnValue('target-path')); $this->urlFinder->expects($this->any())->method('findOneByData')->will($this->returnValue($urlRewrite)); + $this->request->expects($this->any())->method('getParams')->willReturn($queryParams); $this->response->expects($this->once())->method('setRedirect')->with('a', 'redirect-code'); - $this->url->expects($this->once())->method('getUrl')->with('', ['_direct' => 'target-path'])->willReturn('a'); + $this->url->expects($this->once())->method('getUrl')->with( + '', + ['_direct' => 'target-path', '_query' => $queryParams] + )->willReturn('a'); $this->request->expects($this->once())->method('setDispatched')->with(true); $this->actionFactory->expects($this->once())->method('create') ->with(\Magento\Framework\App\Action\Redirect::class); @@ -312,6 +322,7 @@ public function testMatchWithCustomExternalRedirect($targetPath) $urlRewrite->expects($this->any())->method('getTargetPath')->will($this->returnValue($targetPath)); $this->urlFinder->expects($this->any())->method('findOneByData')->will($this->returnValue($urlRewrite)); $this->response->expects($this->once())->method('setRedirect')->with($targetPath, 'redirect-code'); + $this->request->expects($this->never())->method('getParams'); $this->url->expects($this->never())->method('getUrl'); $this->request->expects($this->once())->method('setDispatched')->with(true); $this->actionFactory->expects($this->once())->method('create') From e287963e0444f009098c7dcd1206f49d2b52cb1a Mon Sep 17 00:00:00 2001 From: Kate Kyzyma <kate@atwix.com> Date: Thu, 14 Nov 2019 17:58:46 +0200 Subject: [PATCH 081/586] Code refactoring --- ...eateNewUrlRewriteForCmsPageActionGroup.xml | 23 +++++ ...llNewCmsPageUrlRewriteFormActionGroup.xml} | 14 +-- ...minGoToAddNewUrlRewritePageActionGroup.xml | 19 ++++ ...ageFromGridForNewUrlRewriteActionGroup.xml | 22 +++++ ...AdminDeleteCmsPageUrlRewriteEntityTest.xml | 99 ------------------- ...teCmsPageUrlRewriteWithNoRedirectsTest.xml | 59 +++++++++++ ...ageUrlRewriteWithPermanentRedirectTest.xml | 55 +++++++++++ ...ageUrlRewriteWithTemporaryRedirectTest.xml | 55 +++++++++++ 8 files changed, 235 insertions(+), 111 deletions(-) create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminCreateNewUrlRewriteForCmsPageActionGroup.xml rename app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/{AdminAddUrlRewriteForCmsPageActionGroup.xml => AdminFillNewCmsPageUrlRewriteFormActionGroup.xml} (56%) create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminGoToAddNewUrlRewritePageActionGroup.xml create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSelectCmsPageFromGridForNewUrlRewriteActionGroup.xml delete mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteEntityTest.xml create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminCreateNewUrlRewriteForCmsPageActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminCreateNewUrlRewriteForCmsPageActionGroup.xml new file mode 100644 index 0000000000000..143198e4a1faa --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminCreateNewUrlRewriteForCmsPageActionGroup.xml @@ -0,0 +1,23 @@ +<?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="AdminCreateNewUrlRewriteForCmsPageActionGroup"> + <annotations> + <description>Select "For Csm Page" URL Rewrite type</description> + </annotations> + <arguments> + <argument name="customUrlRewriteValue" type="string"/> + </arguments> + + <click selector="{{AdminUrlRewriteEditSection.createCustomUrlRewrite}}" stepKey="clickOnCustomUrlRewrite"/> + <click selector="{{AdminUrlRewriteEditSection.createCustomUrlRewriteValue('customUrlRewriteValue')}}" stepKey="selectForCsmPage"/> + <waitForPageLoad stepKey="waitForCategoryEditSectionToLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminAddUrlRewriteForCmsPageActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminFillNewCmsPageUrlRewriteFormActionGroup.xml similarity index 56% rename from app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminAddUrlRewriteForCmsPageActionGroup.xml rename to app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminFillNewCmsPageUrlRewriteFormActionGroup.xml index f46bd7f5e0386..0c540d0698dd8 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminAddUrlRewriteForCmsPageActionGroup.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminFillNewCmsPageUrlRewriteFormActionGroup.xml @@ -8,26 +8,17 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminAddUrlRewriteForCmsPageActionGroup"> + <actionGroup name="AdminFillNewCmsPageUrlRewriteFormActionGroup"> <annotations> - <description>Goes to the Admin Add URL Rewrite edit page. Fills in the provided URL details. Clicks on Save. Validates that the Success Message is present.</description> + <description>Fills in the provided URL details. Clicks on Save.</description> </annotations> <arguments> - <argument name="cmsPageUrlKey" type="string"/> - <argument name="customUrlRewriteValue" type="string"/> <argument name="storeValue" type="string"/> <argument name="requestPath" type="string"/> <argument name="redirectTypeValue" type="string"/> <argument name="description" type="string"/> </arguments> - <amOnPage url="{{AdminUrlRewriteEditPage.url}}" stepKey="openUrlRewriteEditPage"/> - <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad"/> - <click selector="{{AdminUrlRewriteEditSection.createCustomUrlRewrite}}" stepKey="clickOnCustomUrlRewrite"/> - <click selector="{{AdminUrlRewriteEditSection.createCustomUrlRewriteValue('customUrlRewriteValue')}}" stepKey="selectForCsmPage"/> - <waitForPageLoad stepKey="waitForCategoryEditSectionToLoad"/> - <click selector="{{AdminUrlRewriteEditSection.cmsPage('cmsPageUrlKey')}}" stepKey="selectCmsPage"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> <click selector="{{AdminUrlRewriteEditSection.store}}" stepKey="clickOnStore"/> <click selector="{{AdminUrlRewriteEditSection.storeValue('storeValue')}}" stepKey="clickOnStoreValue"/> <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPath"/> @@ -35,6 +26,5 @@ <click selector="{{AdminUrlRewriteEditSection.redirectTypeValue('redirectTypeValue')}}" stepKey="clickOnRedirectTypeValue"/> <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescription"/> <click selector="{{AdminUrlRewriteEditSection.saveButton}}" stepKey="clickOnSaveButton"/> - <seeElement selector="{{AdminUrlRewriteIndexSection.successMessage}}" stepKey="seeSuccessSaveMessage"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminGoToAddNewUrlRewritePageActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminGoToAddNewUrlRewritePageActionGroup.xml new file mode 100644 index 0000000000000..e0e8df47852d6 --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminGoToAddNewUrlRewritePageActionGroup.xml @@ -0,0 +1,19 @@ +<?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="AdminGoToAddNewUrlRewritePageActionGroup"> + <annotations> + <description>Goes to the Admin Add URL Rewrite edit page</description> + </annotations> + + <amOnPage url="{{AdminUrlRewriteEditPage.url}}" stepKey="openUrlRewriteEditPage"/> + <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSelectCmsPageFromGridForNewUrlRewriteActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSelectCmsPageFromGridForNewUrlRewriteActionGroup.xml new file mode 100644 index 0000000000000..2713e3937469b --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSelectCmsPageFromGridForNewUrlRewriteActionGroup.xml @@ -0,0 +1,22 @@ +<?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="AdminSelectCmsPageFromGridForNewUrlRewriteActionGroup"> + <annotations> + <description>Select Cms Page for URL Rewrite from the grid</description> + </annotations> + <arguments> + <argument name="cmsPageUrlKey" type="string"/> + </arguments> + + <click selector="{{AdminUrlRewriteEditSection.cmsPage('cmsPageUrlKey')}}" stepKey="selectCmsPage"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteEntityTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteEntityTest.xml deleted file mode 100644 index 705786afa83bb..0000000000000 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteEntityTest.xml +++ /dev/null @@ -1,99 +0,0 @@ -<?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="AdminDeleteCmsPageUrlRewriteEntityTest"> - <annotations> - <stories value="Delete CMS Page URL rewrite"/> - <title value="Delete CMS Page URL rewrite"/> - <description value="Log in to admin and delete CMS Page URL rewrite"/> - <group value="cMSContent"/> - <group value="mtf_migrated"/> - </annotations> - - <before> - <createData entity="simpleCmsPage" stepKey="createCMSPage"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> - </before> - <after> - <deleteData createDataKey="createCMSPage" stepKey="deleteCMSPage"/> - <actionGroup ref="logout" stepKey="logout"/> - </after> - - <!-- Create URL Rewrite for CMS Page with No redirects --> - <actionGroup ref="AdminAddUrlRewriteForCmsPageActionGroup" stepKey="addUrlRewrite"> - <argument name="cmsPageUrlKey" value="$$createCMSPage.identifier$$"/> - <argument name="customUrlRewriteValue" value="For CMS page'"/> - <argument name="storeValue" value="Default Store View"/> - <argument name="requestPath" value="newrequestpath"/> - <argument name="redirectTypeValue" value="No"/> - <argument name="description" value="cms_default_no_redirect"/> - </actionGroup> - - <!-- Create URL Rewrite for CMS Page with temporary redirect --> - <actionGroup ref="AdminAddUrlRewriteForCmsPageActionGroup" stepKey="addUrlRewriteTemporary"> - <argument name="cmsPageUrlKey" value="$$createCMSPage.identifier$$"/> - <argument name="customUrlRewriteValue" value="For CMS page'"/> - <argument name="storeValue" value="Default Store View"/> - <argument name="requestPath" value="temporaryrequestpath.html"/> - <argument name="redirectTypeValue" value="Temporary (302)"/> - <argument name="description" value="cms_default_temporary_redirect"/> - </actionGroup> - - <!-- Create URL Rewrite for CMS Page with permanent redirect --> - <actionGroup ref="AdminAddUrlRewriteForCmsPageActionGroup" stepKey="addUrlRewritePermanent"> - <argument name="cmsPageUrlKey" value="$$createCMSPage.identifier$$"/> - <argument name="customUrlRewriteValue" value="For CMS page'"/> - <argument name="storeValue" value="Default Store View"/> - <argument name="requestPath" value="permanentrequestpath.html"/> - <argument name="redirectTypeValue" value="Permanent (301)"/> - <argument name="description" value="cms_default_permanent_redirect"/> - </actionGroup> - - <!--Delete the URL Rewrite for CMS Page with No redirects--> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite"> - <argument name="requestPath" value="newrequestpath"/> - </actionGroup> - <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage"> - <argument name="message" value="You deleted the URL rewrite."/> - </actionGroup> - <!--Search and verify AssertUrlRewriteNotInGrid--> - <actionGroup ref="AdminSearchDeletedUrlRewrite" stepKey="searchDeletedUrlRewriteInGrid"> - <argument name="requestPath" value="newrequestpath"/> - </actionGroup> - <!--Verify AssertPageByUrlRewriteIsNotFound--> - <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="assertPageByUrlRewriteIsNotFound"> - <argument name="requestPath" value="newrequestpath"/> - </actionGroup> - - <!--Delete the URL Rewrite for CMS Page with with temporary redirect--> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteTemporaryUrlRewrite"> - <argument name="requestPath" value="temporaryrequestpath.html"/> - </actionGroup> - <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessageSecondTime"> - <argument name="message" value="You deleted the URL rewrite."/> - </actionGroup> - <!--Verify AssertPageByUrlRewriteIsNotFound--> - <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="assertPageByUrlRewriteIsNotFoundSecondTime"> - <argument name="requestPath" value="temporaryrequestpath.html"/> - </actionGroup> - - <!--Delete the URL Rewrite for CMS Page with permanent redirect--> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deletePermanentUrlRewrite"> - <argument name="requestPath" value="permanentrequestpath.html"/> - </actionGroup> - <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessageThirdTime"> - <argument name="message" value="You deleted the URL rewrite."/> - </actionGroup> - <!--Verify AssertPageByUrlRewriteIsNotFound--> - <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="assertPageByUrlRewriteIsNotFoundThirdTime"> - <argument name="requestPath" value="permanentrequestpath.html"/> - </actionGroup> - - </test> -</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml new file mode 100644 index 0000000000000..4c3bd8179578c --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml @@ -0,0 +1,59 @@ +<?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="AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest"> + <annotations> + <stories value="Delete CMS Page URL rewrite with No Redirects"/> + <title value="Delete CMS Page URL rewrite with No Redirects"/> + <description value="Log in to admin and delete CMS Page URL rewrite with No Redirects"/> + <group value="cMSContent"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <createData entity="simpleCmsPage" stepKey="createCMSPage"/> + <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + </before> + <after> + <deleteData createDataKey="createCMSPage" stepKey="deleteCMSPage"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <actionGroup ref="AdminGoToAddNewUrlRewritePageActionGroup" stepKey="openUrlRewriteEditPage"/> + <actionGroup ref="AdminCreateNewUrlRewriteForCmsPageActionGroup" stepKey="selectForCsmPageType"> + <argument name="customUrlRewriteValue" value="For CMS page'"/> + </actionGroup> + <actionGroup ref="AdminSelectCmsPageFromGridForNewUrlRewriteActionGroup" stepKey="selectCmsPge"> + <argument name="cmsPageUrlKey" value="$$createCMSPage.identifier$$"/> + </actionGroup> + <actionGroup ref="AdminFillNewCmsPageUrlRewriteFormActionGroup" stepKey="fillTheForm"> + <argument name="storeValue" value="Default Store View"/> + <argument name="requestPath" value="newrequestpath"/> + <argument name="redirectTypeValue" value="No"/> + <argument name="description" value="cms_default_no_redirect"/> + </actionGroup> + + <!--Delete the URL Rewrite for CMS Page with No redirects--> + <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite"> + <argument name="requestPath" value="newrequestpath"/> + </actionGroup> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage"> + <argument name="message" value="You deleted the URL rewrite."/> + </actionGroup> + <!--Search and verify AssertUrlRewriteNotInGrid--> + <actionGroup ref="AdminSearchDeletedUrlRewrite" stepKey="searchDeletedUrlRewriteInGrid"> + <argument name="requestPath" value="newrequestpath"/> + </actionGroup> + <!--Verify AssertPageByUrlRewriteIsNotFound--> + <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="assertPageByUrlRewriteIsNotFound"> + <argument name="requestPath" value="newrequestpath"/> + </actionGroup> + + </test> +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml new file mode 100644 index 0000000000000..89f663b54e017 --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml @@ -0,0 +1,55 @@ +<?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="AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest"> + <annotations> + <stories value="Delete CMS Page URL rewrite with Permanent Redirect"/> + <title value="Delete CMS Page URL rewrite with Permanent Redirect"/> + <description value="Log in to admin and delete CMS Page URL rewrite with Permanent Redirect"/> + <group value="cMSContent"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <createData entity="simpleCmsPage" stepKey="createCMSPage"/> + <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + </before> + <after> + <deleteData createDataKey="createCMSPage" stepKey="deleteCMSPage"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <actionGroup ref="AdminGoToAddNewUrlRewritePageActionGroup" stepKey="openUrlRewriteEditPage"/> + <actionGroup ref="AdminCreateNewUrlRewriteForCmsPageActionGroup" stepKey="selectForCsmPageType"> + <argument name="customUrlRewriteValue" value="For CMS page'"/> + </actionGroup> + <actionGroup ref="AdminSelectCmsPageFromGridForNewUrlRewriteActionGroup" stepKey="selectCmsPge"> + <argument name="cmsPageUrlKey" value="$$createCMSPage.identifier$$"/> + </actionGroup> + <actionGroup ref="AdminFillNewCmsPageUrlRewriteFormActionGroup" stepKey="fillTheForm"> + <argument name="storeValue" value="Default Store View"/> + <argument name="requestPath" value="permanentrequestpath.html"/> + <argument name="redirectTypeValue" value="Permanent (301)"/> + <argument name="description" value="cms_default_permanent_redirect"/> + </actionGroup> + + <!-- Delete the URL Rewrite for CMS Page with permanent redirect--> + <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deletePermanentUrlRewrite"> + <argument name="requestPath" value="permanentrequestpath.html"/> + </actionGroup> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage"> + <argument name="message" value="You deleted the URL rewrite."/> + </actionGroup> + <!-- Verify AssertPageByUrlRewriteIsNotFound --> + <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="assertPageByUrlRewriteIsNotFound"> + <argument name="requestPath" value="permanentrequestpath.html"/> + </actionGroup> + + </test> +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml new file mode 100644 index 0000000000000..ad7aec335b7a3 --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml @@ -0,0 +1,55 @@ +<?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="AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest"> + <annotations> + <stories value="Delete CMS Page URL rewrite with Temporary Redirect"/> + <title value="Delete CMS Page URL rewrite with Temporary Redirect"/> + <description value="Log in to admin and delete CMS Page URL rewrite with Temporary Redirect"/> + <group value="cMSContent"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <createData entity="simpleCmsPage" stepKey="createCMSPage"/> + <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + </before> + <after> + <deleteData createDataKey="createCMSPage" stepKey="deleteCMSPage"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <actionGroup ref="AdminGoToAddNewUrlRewritePageActionGroup" stepKey="openUrlRewriteEditPage"/> + <actionGroup ref="AdminCreateNewUrlRewriteForCmsPageActionGroup" stepKey="selectForCsmPageType"> + <argument name="customUrlRewriteValue" value="For CMS page'"/> + </actionGroup> + <actionGroup ref="AdminSelectCmsPageFromGridForNewUrlRewriteActionGroup" stepKey="selectCmsPge"> + <argument name="cmsPageUrlKey" value="$$createCMSPage.identifier$$"/> + </actionGroup> + <actionGroup ref="AdminFillNewCmsPageUrlRewriteFormActionGroup" stepKey="fillTheForm"> + <argument name="storeValue" value="Default Store View"/> + <argument name="requestPath" value="temporaryrequestpath.html"/> + <argument name="redirectTypeValue" value="Temporary (302)"/> + <argument name="description" value="cms_default_temporary_redirect"/> + </actionGroup> + + <!-- Delete the URL Rewrite for CMS Page with with temporary redirect--> + <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteTemporaryUrlRewrite"> + <argument name="requestPath" value="temporaryrequestpath.html"/> + </actionGroup> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage"> + <argument name="message" value="You deleted the URL rewrite."/> + </actionGroup> + <!--Verify AssertPageByUrlRewriteIsNotFound--> + <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="assertPageByUrlRewriteIsNotFound"> + <argument name="requestPath" value="temporaryrequestpath.html"/> + </actionGroup> + + </test> +</tests> From 841872ca4313ca6b4a3587a65598ce8206ad90a9 Mon Sep 17 00:00:00 2001 From: Buba Suma <soumah@adobe.com> Date: Thu, 14 Nov 2019 13:14:53 -0600 Subject: [PATCH 082/586] MC-23068: Change in-product doc url to devdocs - Move "Minimum Terms to Match" down to search configuration section - Change documentation URL for "Minimum Terms to Match" --- .../Elasticsearch/etc/adminhtml/system.xml | 32 +++++++++---------- .../Elasticsearch6/etc/adminhtml/system.xml | 17 +++++----- 2 files changed, 24 insertions(+), 25 deletions(-) diff --git a/app/code/Magento/Elasticsearch/etc/adminhtml/system.xml b/app/code/Magento/Elasticsearch/etc/adminhtml/system.xml index 1f61a48db9bfa..41c6710412db9 100644 --- a/app/code/Magento/Elasticsearch/etc/adminhtml/system.xml +++ b/app/code/Magento/Elasticsearch/etc/adminhtml/system.xml @@ -55,21 +55,21 @@ <field id="engine">elasticsearch</field> </depends> </field> - <field id="elasticsearch_minimum_should_match" translate="label" type="text" sortOrder="68" showInDefault="1" showInWebsite="0" showInStore="0"> - <label>Minimum Terms to Match</label> + <field id="elasticsearch_test_connect_wizard" translate="button_label" sortOrder="68" showInDefault="1" showInWebsite="0" showInStore="0"> + <label/> + <button_label>Test Connection</button_label> + <frontend_model>Magento\Elasticsearch\Block\Adminhtml\System\Config\TestConnection</frontend_model> <depends> <field id="engine">elasticsearch</field> </depends> - <comment><![CDATA[See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-minimum-should-match.html">here</a> for possible values.]]></comment> - <backend_model>Magento\Elasticsearch\Model\Config\Backend\MinimumShouldMatch</backend_model> </field> - <field id="elasticsearch_test_connect_wizard" translate="button_label" sortOrder="69" showInDefault="1" showInWebsite="0" showInStore="0"> - <label/> - <button_label>Test Connection</button_label> - <frontend_model>Magento\Elasticsearch\Block\Adminhtml\System\Config\TestConnection</frontend_model> + <field id="elasticsearch_minimum_should_match" translate="label" type="text" sortOrder="93" showInDefault="1" showInWebsite="0" showInStore="0"> + <label>Minimum Terms to Match</label> <depends> <field id="engine">elasticsearch</field> </depends> + <comment><![CDATA[<a href="https://docs.magento.com/m2/ce/user_guide/catalog/search-elasticsearch.html">Learn more</a> about valid syntax.]]></comment> + <backend_model>Magento\Elasticsearch\Model\Config\Backend\MinimumShouldMatch</backend_model> </field> <!-- Elasticsearch 5.0+ --> <field id="elasticsearch5_server_hostname" translate="label" type="text" sortOrder="61" showInDefault="1" showInWebsite="0" showInStore="0"> @@ -117,21 +117,21 @@ <field id="engine">elasticsearch5</field> </depends> </field> - <field id="elasticsearch5_minimum_should_match" translate="label" type="text" sortOrder="68" showInDefault="1" showInWebsite="0" showInStore="0"> - <label>Minimum Terms to Match</label> + <field id="elasticsearch5_test_connect_wizard" translate="button_label" sortOrder="68" showInDefault="1" showInWebsite="0" showInStore="0"> + <label/> + <button_label>Test Connection</button_label> + <frontend_model>Magento\Elasticsearch\Block\Adminhtml\System\Config\Elasticsearch5\TestConnection</frontend_model> <depends> <field id="engine">elasticsearch5</field> </depends> - <comment><![CDATA[See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-minimum-should-match.html">here</a> for possible values.]]></comment> - <backend_model>Magento\Elasticsearch\Model\Config\Backend\MinimumShouldMatch</backend_model> </field> - <field id="elasticsearch5_test_connect_wizard" translate="button_label" sortOrder="69" showInDefault="1" showInWebsite="0" showInStore="0"> - <label/> - <button_label>Test Connection</button_label> - <frontend_model>Magento\Elasticsearch\Block\Adminhtml\System\Config\Elasticsearch5\TestConnection</frontend_model> + <field id="elasticsearch5_minimum_should_match" translate="label" type="text" sortOrder="93" showInDefault="1" showInWebsite="0" showInStore="0"> + <label>Minimum Terms to Match</label> <depends> <field id="engine">elasticsearch5</field> </depends> + <comment><![CDATA[<a href="https://docs.magento.com/m2/ce/user_guide/catalog/search-elasticsearch.html">Learn more</a> about valid syntax.]]></comment> + <backend_model>Magento\Elasticsearch\Model\Config\Backend\MinimumShouldMatch</backend_model> </field> </group> </section> diff --git a/app/code/Magento/Elasticsearch6/etc/adminhtml/system.xml b/app/code/Magento/Elasticsearch6/etc/adminhtml/system.xml index 8d22fcbc5f8f4..beccb0c1ceb81 100644 --- a/app/code/Magento/Elasticsearch6/etc/adminhtml/system.xml +++ b/app/code/Magento/Elasticsearch6/etc/adminhtml/system.xml @@ -70,24 +70,23 @@ </depends> </field> - <field id="elasticsearch6_minimum_should_match" translate="label" type="text" sortOrder="78" showInDefault="1" + <field id="elasticsearch6_test_connect_wizard" translate="button_label" sortOrder="78" showInDefault="1" showInWebsite="0" showInStore="0"> - <label>Minimum Terms to Match</label> + <label/> + <button_label>Test Connection</button_label> + <frontend_model>Magento\Elasticsearch6\Block\Adminhtml\System\Config\TestConnection</frontend_model> <depends> <field id="engine">elasticsearch6</field> </depends> - <comment><![CDATA[See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-minimum-should-match.html">here</a> for possible values.]]></comment> - <backend_model>Magento\Elasticsearch\Model\Config\Backend\MinimumShouldMatch</backend_model> </field> - - <field id="elasticsearch6_test_connect_wizard" translate="button_label" sortOrder="79" showInDefault="1" + <field id="elasticsearch6_minimum_should_match" translate="label" type="text" sortOrder="93" showInDefault="1" showInWebsite="0" showInStore="0"> - <label/> - <button_label>Test Connection</button_label> - <frontend_model>Magento\Elasticsearch6\Block\Adminhtml\System\Config\TestConnection</frontend_model> + <label>Minimum Terms to Match</label> <depends> <field id="engine">elasticsearch6</field> </depends> + <comment><![CDATA[<a href="https://docs.magento.com/m2/ce/user_guide/catalog/search-elasticsearch.html">Learn more</a> about valid syntax.]]></comment> + <backend_model>Magento\Elasticsearch\Model\Config\Backend\MinimumShouldMatch</backend_model> </field> </group> </section> From f63475c37e37dde8eef9f404f518eb415c7557b0 Mon Sep 17 00:00:00 2001 From: Alexey Arendarenko <alexeya@ven.com> Date: Thu, 14 Nov 2019 15:10:37 +0200 Subject: [PATCH 083/586] UrlRewrite module fixes update fixture update integration test --- .../UrlRewrite/Controller/UrlRewriteTest.php | 30 +++++++++++++ .../Magento/UrlRewrite/_files/url_rewrite.php | 42 ++++++++++++++++++- .../_files/url_rewrite_rollback.php | 4 +- 3 files changed, 73 insertions(+), 3 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/UrlRewrite/Controller/UrlRewriteTest.php b/dev/tests/integration/testsuite/Magento/UrlRewrite/Controller/UrlRewriteTest.php index 5f8adc5d65113..b6a551cc6ad50 100644 --- a/dev/tests/integration/testsuite/Magento/UrlRewrite/Controller/UrlRewriteTest.php +++ b/dev/tests/integration/testsuite/Magento/UrlRewrite/Controller/UrlRewriteTest.php @@ -80,6 +80,36 @@ public function requestDataProvider(): array 'request' => '/page-similar/', 'redirect' => '/page-b', ], + 'Use Case #7: Rewrite: page-similar --(301)--> page-a; ' + . 'Request: page-similar?param=1 --(301)--> page-a?param=1' => [ + 'request' => '/page-similar?param=1', + 'redirect' => '/page-a?param=1', + ], + 'Use Case #8: Rewrite: page-similar/ --(301)--> page-b; ' + . 'Request: page-similar/?param=1 --(301)--> page-b?param=1' => [ + 'request' => '/page-similar/?param=1', + 'redirect' => '/page-b?param=1', + ], + 'Use Case #9: Rewrite: page-similar-query-param --(301)--> page-d?param1=1;' + . 'Request: page-similar-query-param --(301)--> page-d?param1=1' => [ + 'request' => '/page-similar-query-param', + 'redirect' => '/page-d?param1=1', + ], + 'Use Case #10: Rewrite: page-similar-query-param --(301)--> page-d?param1=1; ' + . 'Request: page-similar-query-param?param2=1 --(301)--> page-d?param1=1¶m2=1' => [ + 'request' => '/page-similar-query-param?param2=1', + 'redirect' => '/page-d?param1=1¶m2=1', + ], + 'Use Case #11: Rewrite: page-similar-query-param/ --(301)--> page-e?param1=1; ' + . 'Request: page-similar-query-param/ --(301)--> page-e?param1=1' => [ + 'request' => '/page-similar-query-param/', + 'redirect' => '/page-e?param1=1', + ], + 'Use Case #12: Rewrite: page-similar-query-param/ --(301)--> page-e?param1=1;' + . 'Request: page-similar-query-param/?param2=1 --(301)--> page-e?param1=1¶m2=1' => [ + 'request' => '/page-similar-query-param/?param2=1', + 'redirect' => '/page-e?param1=1¶m2=1', + ], ]; } } diff --git a/dev/tests/integration/testsuite/Magento/UrlRewrite/_files/url_rewrite.php b/dev/tests/integration/testsuite/Magento/UrlRewrite/_files/url_rewrite.php index 8e82aa853d4a4..dc3f5490f5a53 100644 --- a/dev/tests/integration/testsuite/Magento/UrlRewrite/_files/url_rewrite.php +++ b/dev/tests/integration/testsuite/Magento/UrlRewrite/_files/url_rewrite.php @@ -64,6 +64,26 @@ ->setStores([$storeID, $secondStoreId]); $pageResource->save($page); +$page = $objectManager->create(Page::class); +$page->setTitle('Cms D') + ->setIdentifier('page-d') + ->setIsActive(1) + ->setContent('<h1>Cms Page D</h1>') + ->setPageLayout('1column') + ->setCustomTheme('Magento/blank') + ->setStores([$storeID, $secondStoreId]); +$pageResource->save($page); + +$page = $objectManager->create(Page::class); +$page->setTitle('Cms E') + ->setIdentifier('page-e') + ->setIsActive(1) + ->setContent('<h1>Cms Page E</h1>') + ->setPageLayout('1column') + ->setCustomTheme('Magento/blank') + ->setStores([$storeID, $secondStoreId]); +$pageResource->save($page); + $rewrite = $objectManager->create(UrlRewrite::class); $rewrite->setEntityType('custom') ->setRequestPath('page-one/') @@ -88,7 +108,7 @@ ->setTargetPath('page-a') ->setRedirectType(OptionProvider::PERMANENT) ->setStoreId($storeID) - ->setDescription('From age-similar without trailing slash to page-a'); + ->setDescription('From page-similar without trailing slash to page-a'); $rewriteResource->save($rewrite); $rewrite = $objectManager->create(UrlRewrite::class); @@ -97,7 +117,7 @@ ->setTargetPath('page-b') ->setRedirectType(OptionProvider::PERMANENT) ->setStoreId($storeID) - ->setDescription('From age-similar with trailing slash to page-b'); + ->setDescription('From page-similar with trailing slash to page-b'); $rewriteResource->save($rewrite); //Emulating auto-generated aliases (like the ones used for categories). @@ -117,3 +137,21 @@ ->setRedirectType(0) ->setStoreId($secondStoreId); $rewriteResource->save($rewrite); + +$rewrite = $objectManager->create(UrlRewrite::class); +$rewrite->setEntityType('custom') + ->setRequestPath('page-similar-query-param') + ->setTargetPath('page-d?param1=1') + ->setRedirectType(OptionProvider::PERMANENT) + ->setStoreId($storeID) + ->setDescription('From page-similar-query-param to page-d with query param'); +$rewriteResource->save($rewrite); + +$rewrite = $objectManager->create(UrlRewrite::class); +$rewrite->setEntityType('custom') + ->setRequestPath('page-similar-query-param/') + ->setTargetPath('page-e?param1=1') + ->setRedirectType(OptionProvider::PERMANENT) + ->setStoreId($storeID) + ->setDescription('From page-similar-query-param with trailing slash to page-e with query param'); +$rewriteResource->save($rewrite); diff --git a/dev/tests/integration/testsuite/Magento/UrlRewrite/_files/url_rewrite_rollback.php b/dev/tests/integration/testsuite/Magento/UrlRewrite/_files/url_rewrite_rollback.php index 22d95751fbf26..76b84810ac433 100644 --- a/dev/tests/integration/testsuite/Magento/UrlRewrite/_files/url_rewrite_rollback.php +++ b/dev/tests/integration/testsuite/Magento/UrlRewrite/_files/url_rewrite_rollback.php @@ -19,6 +19,8 @@ $pageRepository->deleteById('page-a'); $pageRepository->deleteById('page-b'); $pageRepository->deleteById('page-c'); +$pageRepository->deleteById('page-d'); +$pageRepository->deleteById('page-e'); /** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */ $productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() @@ -29,7 +31,7 @@ ->create(\Magento\UrlRewrite\Model\ResourceModel\UrlRewriteCollection::class); $collection = $urlRewriteCollection ->addFieldToFilter('entity_type', 'custom') - ->addFieldToFilter('target_path', ['page-a/', 'page-a', 'page-b', 'page-c']) + ->addFieldToFilter('target_path', ['page-a/', 'page-a', 'page-b', 'page-c', 'page-d?param1=1', 'page-e?param1=1']) ->load() ->walk('delete'); From 094565fa335f20e3b77280c12090f5ad58dd0625 Mon Sep 17 00:00:00 2001 From: Dan Wallis <mrdanwallis@gmail.com> Date: Sat, 16 Nov 2019 14:55:14 +0000 Subject: [PATCH 084/586] Add right arrow to show some items have children --- .../Magento/backend/web/css/source/_actions.less | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/design/adminhtml/Magento/backend/web/css/source/_actions.less b/app/design/adminhtml/Magento/backend/web/css/source/_actions.less index 886bbcc29a3b9..28912d873ae00 100644 --- a/app/design/adminhtml/Magento/backend/web/css/source/_actions.less +++ b/app/design/adminhtml/Magento/backend/web/css/source/_actions.less @@ -444,6 +444,20 @@ button { > .action-menu-item { min-width: 100%; } + + &::after { + border-color: transparent transparent transparent #000; + border-style: solid; + border-width: 0.4rem 0 0.4rem 0.5rem; + content: ''; + height: 0; + margin-top: -0.2rem; + position: absolute; + right: 1rem; + top: 50%; + transition: all .2s linear; + width: 0; + } } } From 540b1340275b001aca44ce3d889a039614167a8e Mon Sep 17 00:00:00 2001 From: Mateusz Krzeszowiak <mateusz.krzeszowiak@creativestyle.pl> Date: Wed, 13 Nov 2019 18:10:05 +0100 Subject: [PATCH 085/586] Refactor JavaScript mixins module Fixes https://github.com/magento/magento2/issues/25586. --- lib/web/mage/requirejs/mixins.js | 152 ++++++++++++------------------- 1 file changed, 57 insertions(+), 95 deletions(-) diff --git a/lib/web/mage/requirejs/mixins.js b/lib/web/mage/requirejs/mixins.js index 77d98e0f81394..acda3ebf467d7 100644 --- a/lib/web/mage/requirejs/mixins.js +++ b/lib/web/mage/requirejs/mixins.js @@ -7,7 +7,25 @@ define('mixins', [ ], function (module) { 'use strict'; - var rjsMixins; + var contexts = require.s.contexts, + defContextName = '_', + defContext = contexts[defContextName], + unbundledContext = require.s.newContext('$'), + defaultConfig = defContext.config, + unbundledConfig = { + baseUrl: defaultConfig.baseUrl, + paths: defaultConfig.paths, + shim: defaultConfig.shim, + config: defaultConfig.config, + map: defaultConfig.map + }, + rjsMixins; + + /** + * Prepare a separate context where modules are not assigned to bundles + * so we are able to get their true path and corresponding mixins. + */ + unbundledContext.configure(unbundledConfig); /** * Checks if specified string contains @@ -50,14 +68,14 @@ define('mixins', [ /** * Extracts url (without baseUrl prefix) - * from a modules' name. + * from a module name ignoring the fact that it may be bundled. * * @param {String} name - Name, path or alias of a module. - * @param {Object} config - Contexts' configuartion. + * @param {Object} config - Context's configuartion. * @returns {String} */ function getPath(name, config) { - var url = require.toUrl(name); + var url = unbundledContext.require.toUrl(name); return removeBaseUrl(url, config); } @@ -73,11 +91,11 @@ define('mixins', [ } /** - * Iterativly calls mixins passing to them + * Iteratively calls mixins passing to them * current value of a 'target' parameter. * * @param {*} target - Value to be modified. - * @param {...Function} mixins + * @param {...Function} mixins - List of mixins to apply. * @returns {*} Modified 'target' value. */ function applyMixins(target) { @@ -94,8 +112,13 @@ define('mixins', [ /** * Loads specified module along with its' mixins. + * This method is called for each module defined with "mixins!" prefix + * in its name that was added by processNames method. * * @param {String} name - Module to be loaded. + * @param {Function} req - Local "require" function to use to load other modules. + * @param {Function} onLoad - A function to call with the value for name. + * @param {Object} config - RequireJS configuration object. */ load: function (name, req, onLoad, config) { var path = getPath(name, config), @@ -110,14 +133,14 @@ define('mixins', [ /** * Retrieves list of mixins associated with a specified module. * - * @param {String} path - Path to the module (without base url). + * @param {String} path - Path to the module (without base URL). * @returns {Array} An array of paths to mixins. */ getMixins: function (path) { var config = module.config() || {}, - mixins; + mixins; - // fix for when urlArgs is set + // Fix for when urlArgs is set. if (path.indexOf('?') !== -1) { path = path.substring(0, path.indexOf('?')); } @@ -131,7 +154,7 @@ define('mixins', [ /** * Checks if specified module has associated with it mixins. * - * @param {String} path - Path to the module (without base url). + * @param {String} path - Path to the module (without base URL). * @returns {Boolean} */ hasMixins: function (path) { @@ -139,11 +162,11 @@ define('mixins', [ }, /** - * Modifies provided names perpending to them + * Modifies provided names prepending to them * the 'mixins!' plugin prefix if it's necessary. * * @param {(Array|String)} names - Module names, paths or aliases. - * @param {Object} context - Current requirejs context. + * @param {Object} context - Current RequireJS context. * @returns {Array|String} */ processNames: function (names, context) { @@ -179,101 +202,40 @@ require([ ], function (mixins) { 'use strict'; - var originalRequire = window.require, - originalDefine = window.define, - contexts = originalRequire.s.contexts, - defContextName = '_', - hasOwn = Object.prototype.hasOwnProperty, - getLastInQueue; - - getLastInQueue = - '(function () {' + - 'var queue = globalDefQueue,' + - 'item = queue[queue.length - 1];' + - '' + - 'return item;' + - '})();'; - - /** - * Returns property of an object if - * it's not defined in it's prototype. - * - * @param {Object} obj - Object whose property should be retrieved. - * @param {String} prop - Name of the property. - * @returns {*} Value of the property or false. - */ - function getOwn(obj, prop) { - return hasOwn.call(obj, prop) && obj[prop]; - } - - /** - * Overrides global 'require' method adding to it dependencies modfication. - */ - window.require = function (deps, callback, errback, optional) { - var contextName = defContextName, - context, - config; - - if (!Array.isArray(deps) && typeof deps !== 'string') { - config = deps; - - if (Array.isArray(callback)) { - deps = callback; - callback = errback; - errback = optional; - } else { - deps = []; - } - } - - if (config && config.context) { - contextName = config.context; - } - - context = getOwn(contexts, contextName); - - if (!context) { - context = contexts[contextName] = require.s.newContext(contextName); - } - - if (config) { - context.configure(config); - } - - deps = mixins.processNames(deps, context); - - return context.require(deps, callback, errback); - }; + var contexts = require.s.contexts, + defContextName = '_', + defContext = contexts[defContextName], + originalContextRequire = defContext.require, + processNames = mixins.processNames; /** - * Overrides global 'define' method adding to it dependencies modfication. + * Wrap default context's require function which gets called every time + * module is requested using require call. The upside of this approach + * is that deps parameter is already normalized and guaranteed to be an array. */ - window.define = function (name, deps, callback) { // eslint-disable-line no-unused-vars - var context = getOwn(contexts, defContextName), - result = originalDefine.apply(this, arguments), - queueItem = require.exec(getLastInQueue), - lastDeps = queueItem && queueItem[1]; - - if (Array.isArray(lastDeps)) { - queueItem[1] = mixins.processNames(lastDeps, context); - } + defContext.require = function (deps, callback, errback) { + deps = processNames(deps, defContext); - return result; + return originalContextRequire(deps, callback, errback); }; /** * Copy properties of original 'require' method. */ - Object.keys(originalRequire).forEach(function (key) { - require[key] = originalRequire[key]; + Object.keys(originalContextRequire).forEach(function (key) { + defContext.require[key] = originalContextRequire[key]; }); /** - * Copy properties of original 'define' method. + * Wrap shift method from context's definitions queue. + * Items are added to the queue when a new module is defined and taken + * from it every time require call happens. */ - Object.keys(originalDefine).forEach(function (key) { - define[key] = originalDefine[key]; - }); + defContext.defQueue.shift = function () { + var queueItem = Array.prototype.shift.call(this); + + queueItem[1] = processNames(queueItem[1], defContext); - window.requirejs = window.require; + return queueItem; + }; }); From a79a3e1d2b421458ce1d3fb564913f739f8e8f76 Mon Sep 17 00:00:00 2001 From: torhoehn <torhoehn@gmail.com> Date: Mon, 18 Nov 2019 15:56:27 +0100 Subject: [PATCH 086/586] set correct pram like in BlockRepository implementation --- app/code/Magento/Cms/Api/BlockRepositoryInterface.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Cms/Api/BlockRepositoryInterface.php b/app/code/Magento/Cms/Api/BlockRepositoryInterface.php index b713ca91ea852..4b180b5153295 100644 --- a/app/code/Magento/Cms/Api/BlockRepositoryInterface.php +++ b/app/code/Magento/Cms/Api/BlockRepositoryInterface.php @@ -24,7 +24,7 @@ public function save(Data\BlockInterface $block); /** * Retrieve block. * - * @param int $blockId + * @param string $blockId * @return \Magento\Cms\Api\Data\BlockInterface * @throws \Magento\Framework\Exception\LocalizedException */ @@ -51,7 +51,7 @@ public function delete(Data\BlockInterface $block); /** * Delete block by ID. * - * @param int $blockId + * @param string $blockId * @return bool true on success * @throws \Magento\Framework\Exception\NoSuchEntityException * @throws \Magento\Framework\Exception\LocalizedException From 21620c69868e3786148b3e8f5e0d0786a7f7540b Mon Sep 17 00:00:00 2001 From: Mateusz Krzeszowiak <mateusz.krzeszowiak@creativestyle.pl> Date: Mon, 18 Nov 2019 15:58:32 +0100 Subject: [PATCH 087/586] Add tests --- .../tests/lib/mage/requirejs/mixins.test.js | 148 ++++++++++++++++++ lib/web/mage/requirejs/mixins.js | 2 +- 2 files changed, 149 insertions(+), 1 deletion(-) create mode 100644 dev/tests/js/jasmine/tests/lib/mage/requirejs/mixins.test.js diff --git a/dev/tests/js/jasmine/tests/lib/mage/requirejs/mixins.test.js b/dev/tests/js/jasmine/tests/lib/mage/requirejs/mixins.test.js new file mode 100644 index 0000000000000..3d85f77b87467 --- /dev/null +++ b/dev/tests/js/jasmine/tests/lib/mage/requirejs/mixins.test.js @@ -0,0 +1,148 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +/* eslint max-nested-callbacks: 0 */ +require.config({ + paths: { + 'mixins': 'mage/requirejs/mixins' + } +}); + +define(['rjsResolver', 'mixins'], function (resolver, mixins) { + 'use strict'; + + var context = { + config: {} + }; + + describe('mixins module', function () { + beforeEach(function (done) { + // Wait for all modules to be loaded so they don't interfere with testing. + resolver(function () { + done(); + }); + }); + + describe('processNames method', function () { + beforeEach(function () { + spyOn(mixins, 'processNames').and.callThrough(); + spyOn(mixins, 'hasMixins').and.callThrough(); + }); + + it('gets called when module is both required and defined', function (done) { + var name = 'tests/assets/mixins/defined-module', + dependencyName = 'tests/assets/mixins/defined-module-dependency'; + + define(dependencyName, [], function () {}); + define(name, [dependencyName], function () {}); + + require([name], function () { + expect(mixins.processNames.calls.argsFor(0)[0]).toEqual([]); + expect(mixins.processNames.calls.argsFor(1)[0]).toEqual([dependencyName]); + expect(mixins.processNames.calls.argsFor(2)[0]).toEqual([name]); + done(); + }); + }); + + it('keeps name intact when it already contains another plugin', function () { + mixins.hasMixins.and.returnValue(true); + + expect(mixins.processNames('plugin!module', context)).toBe('plugin!module'); + }); + + it('keeps name intact when it has no mixins', function () { + mixins.hasMixins.and.returnValue(false); + + expect(mixins.processNames('module', context)).toBe('module'); + }); + + it('keeps names intact when they have no mixins', function () { + mixins.hasMixins.and.returnValue(false); + + expect(mixins.processNames(['module'], context)).toEqual(['module']); + }); + + it('adds prefix to name when it has mixins', function () { + mixins.hasMixins.and.returnValue(true); + + expect(mixins.processNames('module', context)).toBe('mixins!module'); + }); + + it('adds prefix to name when it contains a relative path', function () { + mixins.hasMixins.and.returnValue(false); + + expect(mixins.processNames('./module', context)).toBe('mixins!./module'); + }); + + it('adds prefix to names when they contain a relative path', function () { + mixins.hasMixins.and.returnValue(false); + + expect(mixins.processNames(['./module'], context)).toEqual(['mixins!./module']); + }); + + it('adds prefix to names when they have mixins', function () { + mixins.hasMixins.and.returnValue(true); + + expect(mixins.processNames(['module'], context)).toEqual(['mixins!module']); + }); + }); + + describe('load method', function () { + it('is not called when module has mixins', function (done) { + var name = 'tests/assets/mixins/load-not-called'; + + spyOn(mixins, 'hasMixins').and.returnValue(false); + spyOn(mixins, 'load').and.callThrough(); + + define(name, [], function () {}); + + require([name], function () { + expect(mixins.load.calls.any()).toBe(false); + done(); + }); + }); + + it('is called when module has mixins', function (done) { + var name = 'tests/assets/mixins/load-called'; + + spyOn(mixins, 'hasMixins').and.returnValue(true); + spyOn(mixins, 'load').and.callThrough(); + + define(name, [], function () {}); + + require([name], function () { + expect(mixins.load.calls.mostRecent().args[0]).toEqual(name); + done(); + }); + }); + + it('applies mixins for loaded module', function (done) { + var name = 'tests/assets/mixins/mixins-applied', + mixinName = 'tests/assets/mixins/mixins-applied-ext'; + + spyOn(mixins, 'hasMixins').and.returnValue(true); + spyOn(mixins, 'load').and.callThrough(); + spyOn(mixins, 'getMixins').and.returnValue([mixinName]); + + define(name, [], function () { + return { value: 'original' }; + }); + + define(mixinName, [], function () { + return function(module) { + module.value = 'changed'; + + return module; + }; + }); + + require([name], function (module) { + expect(module.value).toBe('changed'); + done(); + }); + }); + }); + }); +}); diff --git a/lib/web/mage/requirejs/mixins.js b/lib/web/mage/requirejs/mixins.js index acda3ebf467d7..613605038f4b9 100644 --- a/lib/web/mage/requirejs/mixins.js +++ b/lib/web/mage/requirejs/mixins.js @@ -71,7 +71,7 @@ define('mixins', [ * from a module name ignoring the fact that it may be bundled. * * @param {String} name - Name, path or alias of a module. - * @param {Object} config - Context's configuartion. + * @param {Object} config - Context's configuration. * @returns {String} */ function getPath(name, config) { From 8eb66b564753fd3fab258189a368c05d771eb2a7 Mon Sep 17 00:00:00 2001 From: Mateusz Krzeszowiak <mateusz.krzeszowiak@creativestyle.pl> Date: Mon, 18 Nov 2019 15:59:36 +0100 Subject: [PATCH 088/586] Test more of a public api then internal behaviour --- .../tests/lib/mage/requirejs/mixins.test.js | 199 +++++++++++------- 1 file changed, 119 insertions(+), 80 deletions(-) diff --git a/dev/tests/js/jasmine/tests/lib/mage/requirejs/mixins.test.js b/dev/tests/js/jasmine/tests/lib/mage/requirejs/mixins.test.js index 3d85f77b87467..52374a24e8c68 100644 --- a/dev/tests/js/jasmine/tests/lib/mage/requirejs/mixins.test.js +++ b/dev/tests/js/jasmine/tests/lib/mage/requirejs/mixins.test.js @@ -4,6 +4,8 @@ */ /* eslint max-nested-callbacks: 0 */ +// jscs:disable jsDoc + require.config({ paths: { 'mixins': 'mage/requirejs/mixins' @@ -13,136 +15,173 @@ require.config({ define(['rjsResolver', 'mixins'], function (resolver, mixins) { 'use strict'; - var context = { - config: {} - }; - describe('mixins module', function () { beforeEach(function (done) { + spyOn(mixins, 'hasMixins').and.callThrough(); + spyOn(mixins, 'getMixins').and.callThrough(); + spyOn(mixins, 'load').and.callThrough(); + // Wait for all modules to be loaded so they don't interfere with testing. resolver(function () { done(); }); }); - describe('processNames method', function () { - beforeEach(function () { - spyOn(mixins, 'processNames').and.callThrough(); - spyOn(mixins, 'hasMixins').and.callThrough(); - }); + it('does not affect modules without mixins', function (done) { + var name = 'tests/assets/mixins/no-mixins', + mixinName = 'tests/assets/mixins/no-mixins-ext'; - it('gets called when module is both required and defined', function (done) { - var name = 'tests/assets/mixins/defined-module', - dependencyName = 'tests/assets/mixins/defined-module-dependency'; + mixins.hasMixins.and.returnValue(false); - define(dependencyName, [], function () {}); - define(name, [dependencyName], function () {}); + define(name, [], function () { + return { + value: 'original' + }; + }); + + define(mixinName, [], function () { + return function (module) { + module.value = 'changed'; - require([name], function () { - expect(mixins.processNames.calls.argsFor(0)[0]).toEqual([]); - expect(mixins.processNames.calls.argsFor(1)[0]).toEqual([dependencyName]); - expect(mixins.processNames.calls.argsFor(2)[0]).toEqual([name]); - done(); - }); + return module; + }; }); - it('keeps name intact when it already contains another plugin', function () { - mixins.hasMixins.and.returnValue(true); + require([name], function (module) { + expect(module.value).toBe('original'); - expect(mixins.processNames('plugin!module', context)).toBe('plugin!module'); + done(); }); + }); + + it('does not affect modules that are loaded with plugins', function (done) { + var name = 'plugin!tests/assets/mixins/no-mixins', + mixinName = 'tests/assets/mixins/no-mixins-ext'; - it('keeps name intact when it has no mixins', function () { - mixins.hasMixins.and.returnValue(false); + mixins.hasMixins.and.returnValue(true); + mixins.getMixins.and.returnValue([mixinName]); + + define('plugin', [], function () { + return { + load: function (module, req, onLoad) { + req(module, onLoad); + } + }; + }); - expect(mixins.processNames('module', context)).toBe('module'); + define(name, [], function () { + return { + value: 'original' + }; }); - it('keeps names intact when they have no mixins', function () { - mixins.hasMixins.and.returnValue(false); + define(mixinName, [], function () { + return function (module) { + module.value = 'changed'; - expect(mixins.processNames(['module'], context)).toEqual(['module']); + return module; + }; }); - it('adds prefix to name when it has mixins', function () { - mixins.hasMixins.and.returnValue(true); + require([name], function (module) { + expect(module.value).toBe('original'); - expect(mixins.processNames('module', context)).toBe('mixins!module'); + done(); }); + }); + + it('applies mixins for normal module with mixins', function (done) { + var name = 'tests/assets/mixins/mixins-applied', + mixinName = 'tests/assets/mixins/mixins-applied-ext'; - it('adds prefix to name when it contains a relative path', function () { - mixins.hasMixins.and.returnValue(false); + mixins.hasMixins.and.returnValue(true); + mixins.getMixins.and.returnValue([mixinName]); - expect(mixins.processNames('./module', context)).toBe('mixins!./module'); + define(name, [], function () { + return { + value: 'original' + }; }); - it('adds prefix to names when they contain a relative path', function () { - mixins.hasMixins.and.returnValue(false); + define(mixinName, [], function () { + return function (module) { + module.value = 'changed'; - expect(mixins.processNames(['./module'], context)).toEqual(['mixins!./module']); + return module; + }; }); - it('adds prefix to names when they have mixins', function () { - mixins.hasMixins.and.returnValue(true); + require([name], function (module) { + expect(module.value).toBe('changed'); - expect(mixins.processNames(['module'], context)).toEqual(['mixins!module']); + done(); }); }); - describe('load method', function () { - it('is not called when module has mixins', function (done) { - var name = 'tests/assets/mixins/load-not-called'; - - spyOn(mixins, 'hasMixins').and.returnValue(false); - spyOn(mixins, 'load').and.callThrough(); + it('applies mixins for module that is a dependency', function (done) { + var name = 'tests/assets/mixins/module-with-dependency', + dependencyName = 'tests/assets/mixins/dependency-module', + mixinName = 'tests/assets/mixins/dependency-module-ext'; - define(name, [], function () {}); + mixins.hasMixins.and.returnValue(true); + mixins.getMixins.and.returnValue([mixinName]); - require([name], function () { - expect(mixins.load.calls.any()).toBe(false); - done(); - }); + define(dependencyName, [], function () { + return { + value: 'original' + }; }); - it('is called when module has mixins', function (done) { - var name = 'tests/assets/mixins/load-called'; + define(name, [dependencyName], function (module) { + expect(module.value).toBe('changed'); - spyOn(mixins, 'hasMixins').and.returnValue(true); - spyOn(mixins, 'load').and.callThrough(); + done(); - define(name, [], function () {}); + return {}; + }); - require([name], function () { - expect(mixins.load.calls.mostRecent().args[0]).toEqual(name); - done(); - }); + define(mixinName, [], function () { + return function (module) { + module.value = 'changed'; + + return module; + }; }); - it('applies mixins for loaded module', function (done) { - var name = 'tests/assets/mixins/mixins-applied', - mixinName = 'tests/assets/mixins/mixins-applied-ext'; + require([name], function () {}); + }); - spyOn(mixins, 'hasMixins').and.returnValue(true); - spyOn(mixins, 'load').and.callThrough(); - spyOn(mixins, 'getMixins').and.returnValue([mixinName]); + it('applies mixins for module that is a relative dependency', function (done) { + var name = 'tests/assets/mixins/module-with-relative-dependency', + dependencyName = 'tests/assets/mixins/relative-module', + mixinName = 'tests/assets/mixins/relative-module-ext'; - define(name, [], function () { - return { value: 'original' }; - }); + mixins.hasMixins.and.returnValue(true); + mixins.getMixins.and.returnValue([mixinName]); - define(mixinName, [], function () { - return function(module) { - module.value = 'changed'; + define(dependencyName, [], function () { + return { + value: 'original' + }; + }); - return module; - }; - }); + define(name, ['./relative-module'], function (module) { + expect(module.value).toBe('changed'); - require([name], function (module) { - expect(module.value).toBe('changed'); - done(); - }); + done(); + + return {}; + }); + + define(mixinName, [], function () { + return function (module) { + module.value = 'changed'; + + return module; + }; }); + + require([name], function () {}); }); }); }); From c8e81d828cb9ada6a7476ab85a9a3b9b7bae1071 Mon Sep 17 00:00:00 2001 From: Serhiy Yelahin <serhiy.yelahin@transoftgroup.com> Date: Wed, 20 Nov 2019 10:51:52 +0200 Subject: [PATCH 089/586] MC-25235: Tier Prices error on product update --- .../Product/Attribute/Backend/TierPrice/UpdateHandler.php | 7 +------ .../Attribute/Backend/TierPrice/UpdateHandlerTest.php | 3 ++- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/TierPrice/UpdateHandler.php b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/TierPrice/UpdateHandler.php index f1943bc108878..0daa1dfb5c8eb 100644 --- a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/TierPrice/UpdateHandler.php +++ b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/TierPrice/UpdateHandler.php @@ -96,12 +96,7 @@ public function execute($entity, $arguments = []) $productId = (int)$entity->getData($identifierField); // prepare original data to compare - $origPrices = []; - $originalId = $entity->getOrigData($identifierField); - if (empty($originalId) || $entity->getData($identifierField) == $originalId) { - $origPrices = $entity->getOrigData($attribute->getName()); - } - + $origPrices = $entity->getOrigData($attribute->getName()); $old = $this->prepareOldTierPriceToCompare($origPrices); // prepare data for save $new = $this->prepareNewDataForSave($priceRows, $isGlobal); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Backend/TierPrice/UpdateHandlerTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Backend/TierPrice/UpdateHandlerTest.php index cce00c50d37af..fde793d5c5f89 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Backend/TierPrice/UpdateHandlerTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Backend/TierPrice/UpdateHandlerTest.php @@ -108,6 +108,7 @@ public function testExecute(): void ]; $linkField = 'entity_id'; $productId = 10; + $originalProductId = 11; /** @var \PHPUnit_Framework_MockObject_MockObject $product */ $product = $this->getMockBuilder(\Magento\Catalog\Api\Data\ProductInterface::class) @@ -124,7 +125,7 @@ public function testExecute(): void ->willReturnMap( [ ['tier_price', $originalTierPrices], - ['entity_id', $productId] + ['entity_id', $originalProductId] ] ); $product->expects($this->atLeastOnce())->method('getStoreId')->willReturn(0); From 8b159d0e6e2d7d2034a2960cd484fe33a50ed2b3 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <engcom-vendorworker-foxtrot@adobe.com> Date: Thu, 21 Nov 2019 12:49:01 +0200 Subject: [PATCH 090/586] magento/magento2#22856: Integration test fix. --- .../Adminhtml/Product/Save/CreateCustomOptionsTest.php | 2 ++ .../Catalog/Model/Product/CreateCustomOptionsTest.php | 10 ++++++++++ .../ResourceModel/Attribute/Entity/AttributeTest.php | 1 + .../CatalogImportExport/Model/Import/ProductTest.php | 1 + .../_files/catalog_rule_10_off_not_logged_rollback.php | 1 + 5 files changed, 15 insertions(+) diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Save/CreateCustomOptionsTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Save/CreateCustomOptionsTest.php index 80f15da647b25..f979bad9d0f76 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Save/CreateCustomOptionsTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Save/CreateCustomOptionsTest.php @@ -51,6 +51,8 @@ protected function setUp() * @dataProvider productWithNewOptionsDataProvider * * @param array $productPostData + * + * @magentoDbIsolation enabled */ public function testSaveCustomOptionWithTypeField(array $productPostData): void { diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/CreateCustomOptionsTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/CreateCustomOptionsTest.php index 94bbcd8bae66b..9409163dc5e64 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/CreateCustomOptionsTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/CreateCustomOptionsTest.php @@ -120,6 +120,8 @@ public function testSaveOptionPriceByStore(): void * @dataProvider productCustomOptionsTypeTextDataProvider * * @param array $optionData + * + * @magentoDbIsolation enabled */ public function testCreateOptionsWithTypeText(array $optionData): void { @@ -140,6 +142,8 @@ public function testCreateOptionsWithTypeText(array $optionData): void * * @param string $rawExtensions * @param string $expectedExtensions + * + * @magentoDbIsolation enabled */ public function testFileExtensions(string $rawExtensions, string $expectedExtensions): void { @@ -174,6 +178,8 @@ public function testFileExtensions(string $rawExtensions, string $expectedExtens * * @param array $optionData * @param array $optionValueData + * + * @magentoDbIsolation enabled */ public function testCreateOptionsWithTypeSelect(array $optionData, array $optionValueData): void { @@ -199,6 +205,8 @@ public function testCreateOptionsWithTypeSelect(array $optionData, array $option * @dataProvider productCustomOptionsTypeDateDataProvider * * @param array $optionData + * + * @magentoDbIsolation enabled */ public function testCreateOptionsWithTypeDate(array $optionData): void { @@ -217,6 +225,8 @@ public function testCreateOptionsWithTypeDate(array $optionData): void * * @param array $optionData * @param \Exception $expectedErrorObject + * + * @magentoDbIsolation enabled */ public function testCreateOptionWithError(array $optionData, \Exception $expectedErrorObject): void { diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Attribute/Entity/AttributeTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Attribute/Entity/AttributeTest.php index 8ecf3da8e1aae..2df9c468ba10a 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Attribute/Entity/AttributeTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Attribute/Entity/AttributeTest.php @@ -23,6 +23,7 @@ * @magentoDataFixture Magento/Catalog/_files/dropdown_attribute.php * @magentoDataFixture Magento/Catalog/_files/multiselect_attribute.php * @magentoDataFixture Magento/Catalog/_files/product_without_options.php + * @magentoDbIsolation enabled */ class AttributeTest extends \PHPUnit\Framework\TestCase { diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php index 76e1c640b9fba..5ebdf3fb51e9f 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php @@ -2333,6 +2333,7 @@ public function testImportWithFilesystemImages() * @magentoDataFixture Magento/Catalog/_files/attribute_set_with_renamed_group.php * @magentoDataFixture Magento/Catalog/_files/product_without_options.php * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + * @magentoDbIsolation enabled */ public function testImportDataChangeAttributeSet() { diff --git a/dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_10_off_not_logged_rollback.php b/dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_10_off_not_logged_rollback.php index e7985e8d6b149..7c97c5926ce4f 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_10_off_not_logged_rollback.php +++ b/dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_10_off_not_logged_rollback.php @@ -26,3 +26,4 @@ /** @var \Magento\CatalogRule\Model\Indexer\IndexBuilder $indexBuilder */ $indexBuilder = $objectManager->get(\Magento\CatalogRule\Model\Indexer\IndexBuilder::class); $indexBuilder->reindexFull(); +sleep(1); From 822364927cfda079506ab0400734f7acbc372418 Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Fri, 22 Nov 2019 11:10:42 +0200 Subject: [PATCH 091/586] Adding dependency for New Relic system configs --- .../etc/adminhtml/system.xml | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/app/code/Magento/NewRelicReporting/etc/adminhtml/system.xml b/app/code/Magento/NewRelicReporting/etc/adminhtml/system.xml index 98f9c55adbdf0..60c52164021d9 100644 --- a/app/code/Magento/NewRelicReporting/etc/adminhtml/system.xml +++ b/app/code/Magento/NewRelicReporting/etc/adminhtml/system.xml @@ -19,37 +19,61 @@ </field> <field id="api_url" translate="label" type="text" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1"> <label>New Relic API URL</label> + <depends> + <field id="enable">1</field> + </depends> </field> <field id="insights_api_url" translate="label comment" type="text" sortOrder="3" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1"> <label>Insights API URL</label> <comment>Use %s to replace the account ID in the URL</comment> + <depends> + <field id="enable">1</field> + </depends> </field> <field id="account_id" translate="label comment" type="text" sortOrder="4" showInDefault="1" showInWebsite="1" showInStore="1"> <label>New Relic Account ID</label> <comment><![CDATA["Need a New Relic account? <a href="http://www.newrelic.com/magento" target="_blank">Click here to get one]]></comment> + <depends> + <field id="enable">1</field> + </depends> </field> <field id="app_id" translate="label comment" type="text" sortOrder="5" showInDefault="1" showInWebsite="1" showInStore="1"> <label>New Relic Application ID</label> <comment>This can commonly be found at the end of the URL when viewing the APM after "/applications/"</comment> + <depends> + <field id="enable">1</field> + </depends> </field> <field id="api" translate="label comment" type="obscure" sortOrder="6" showInDefault="1" showInWebsite="1" showInStore="1"> <label>New Relic API Key</label> <backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model> <comment>This is located by navigating to Events -> Deployments from the New Relic APM website</comment> + <depends> + <field id="enable">1</field> + </depends> </field> <field id="insights_insert_key" translate="label comment" type="obscure" sortOrder="7" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Insights API Key</label> <backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model> <comment>Generated under Insights in Manage data -> API Keys -> Insert Keys</comment> + <depends> + <field id="enable">1</field> + </depends> </field> <field id="app_name" translate="label comment" type="text" sortOrder="8" showInDefault="1" showInWebsite="1" showInStore="1"> <label>New Relic Application Name</label> <comment>This is located by navigating to Settings from the New Relic APM website</comment> + <depends> + <field id="enable">1</field> + </depends> </field> <field id="separate_apps" translate="label comment" type="select" sortOrder="9" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Send Adminhtml and Frontend as Separate Apps</label> <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> <comment>In addition to the main app (which includes all PHP execution), separate apps for adminhtml and frontend will be created. Requires New Relic Application Name to be set.</comment> + <depends> + <field id="enable">1</field> + </depends> </field> </group> <group id="cron" translate="label" type="text" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1"> From 9348fb818ae587d87e71d485a95592d105117e97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Szubert?= <bartlomiejszubert@gmail.com> Date: Sun, 24 Nov 2019 22:22:17 +0100 Subject: [PATCH 092/586] Fix #24713 - Symbol of the Belarusian currency BYR is outdated --- .../Dhl/Test/Unit/Model/_files/countries.xml | 2 +- app/code/Magento/Dhl/etc/countries.xml | 2 +- app/code/Magento/Directory/etc/config.xml | 2 +- app/code/Magento/GraphQl/etc/schema.graphqls | 2 +- .../Magento/Framework/Locale/Config.php | 2 +- .../Framework/Locale/Test/Unit/ConfigTest.php | 35 +++++++++++-------- 6 files changed, 25 insertions(+), 20 deletions(-) diff --git a/app/code/Magento/Dhl/Test/Unit/Model/_files/countries.xml b/app/code/Magento/Dhl/Test/Unit/Model/_files/countries.xml index 792465ce45942..d71bb69c99c9b 100644 --- a/app/code/Magento/Dhl/Test/Unit/Model/_files/countries.xml +++ b/app/code/Magento/Dhl/Test/Unit/Model/_files/countries.xml @@ -216,7 +216,7 @@ <name>Botswana</name> </BW> <BY> - <currency>BYR</currency> + <currency>BYN</currency> <weight_unit>KG</weight_unit> <measure_unit>CM</measure_unit> <region>AP</region> diff --git a/app/code/Magento/Dhl/etc/countries.xml b/app/code/Magento/Dhl/etc/countries.xml index 792465ce45942..d71bb69c99c9b 100644 --- a/app/code/Magento/Dhl/etc/countries.xml +++ b/app/code/Magento/Dhl/etc/countries.xml @@ -216,7 +216,7 @@ <name>Botswana</name> </BW> <BY> - <currency>BYR</currency> + <currency>BYN</currency> <weight_unit>KG</weight_unit> <measure_unit>CM</measure_unit> <region>AP</region> diff --git a/app/code/Magento/Directory/etc/config.xml b/app/code/Magento/Directory/etc/config.xml index 2ff0b484fe979..32099ff9d8af5 100644 --- a/app/code/Magento/Directory/etc/config.xml +++ b/app/code/Magento/Directory/etc/config.xml @@ -9,7 +9,7 @@ <default> <system> <currency> - <installed>AZN,AZM,AFN,ALL,DZD,AOA,ARS,AMD,AWG,AUD,BSD,BHD,BDT,BBD,BYR,BZD,BMD,BTN,BOB,BAM,BWP,BRL,GBP,BND,BGN,BUK,BIF,KHR,CAD,CVE,CZK,KYD,CLP,CNY,COP,KMF,CDF,CRC,HRK,CUP,DKK,DJF,DOP,XCD,EGP,SVC,GQE,ERN,EEK,ETB,EUR,FKP,FJD,GMD,GEK,GEL,GHS,GIP,GTQ,GNF,GYD,HTG,HNL,HKD,HUF,ISK,INR,IDR,IRR,IQD,ILS,JMD,JPY,JOD,KZT,KES,KWD,KGS,LAK,LVL,LBP,LSL,LRD,LYD,LTL,MOP,MKD,MGA,MWK,MYR,MVR,LSM,MRO,MUR,MXN,MDL,MNT,MAD,MZN,MMK,NAD,NPR,ANG,TRL,TRY,NZD,NIC,NGN,KPW,NOK,OMR,PKR,PAB,PGK,PYG,PEN,PHP,PLN,QAR,RHD,RON,ROL,RUB,RWF,SHP,STD,SAR,RSD,SCR,SLL,SGD,SKK,SBD,SOS,ZAR,KRW,LKR,SDG,SRD,SZL,SEK,CHF,SYP,TWD,TJS,TZS,THB,TOP,TTD,TND,TMM,USD,UGX,UAH,AED,UYU,UZS,VUV,VEB,VEF,VND,CHE,CHW,XOF,XPF,WST,YER,ZMK,ZWD</installed> + <installed>AZN,AZM,AFN,ALL,DZD,AOA,ARS,AMD,AWG,AUD,BSD,BHD,BDT,BBD,BYN,BZD,BMD,BTN,BOB,BAM,BWP,BRL,GBP,BND,BGN,BUK,BIF,KHR,CAD,CVE,CZK,KYD,CLP,CNY,COP,KMF,CDF,CRC,HRK,CUP,DKK,DJF,DOP,XCD,EGP,SVC,GQE,ERN,EEK,ETB,EUR,FKP,FJD,GMD,GEK,GEL,GHS,GIP,GTQ,GNF,GYD,HTG,HNL,HKD,HUF,ISK,INR,IDR,IRR,IQD,ILS,JMD,JPY,JOD,KZT,KES,KWD,KGS,LAK,LVL,LBP,LSL,LRD,LYD,LTL,MOP,MKD,MGA,MWK,MYR,MVR,LSM,MRO,MUR,MXN,MDL,MNT,MAD,MZN,MMK,NAD,NPR,ANG,TRL,TRY,NZD,NIC,NGN,KPW,NOK,OMR,PKR,PAB,PGK,PYG,PEN,PHP,PLN,QAR,RHD,RON,ROL,RUB,RWF,SHP,STD,SAR,RSD,SCR,SLL,SGD,SKK,SBD,SOS,ZAR,KRW,LKR,SDG,SRD,SZL,SEK,CHF,SYP,TWD,TJS,TZS,THB,TOP,TTD,TND,TMM,USD,UGX,UAH,AED,UYU,UZS,VUV,VEB,VEF,VND,CHE,CHW,XOF,XPF,WST,YER,ZMK,ZWD</installed> </currency> </system> <currency> diff --git a/app/code/Magento/GraphQl/etc/schema.graphqls b/app/code/Magento/GraphQl/etc/schema.graphqls index 559ccf9428929..fccde015c3388 100644 --- a/app/code/Magento/GraphQl/etc/schema.graphqls +++ b/app/code/Magento/GraphQl/etc/schema.graphqls @@ -113,7 +113,7 @@ enum CurrencyEnum @doc(description: "The list of available currency codes") { BHD BDT BBD - BYR + BYN BZD BMD BTN diff --git a/lib/internal/Magento/Framework/Locale/Config.php b/lib/internal/Magento/Framework/Locale/Config.php index f02ba78ccc3e0..c2d0147c7fdc8 100644 --- a/lib/internal/Magento/Framework/Locale/Config.php +++ b/lib/internal/Magento/Framework/Locale/Config.php @@ -129,7 +129,7 @@ class Config implements \Magento\Framework\Locale\ConfigInterface 'BHD', /*Bahraini Dinar*/ 'BDT', /*Bangladesh Taka*/ 'BBD', /*Barbados Dollar*/ - 'BYR', /*Belarussian Ruble*/ + 'BYN', /*Belarussian Ruble*/ 'BZD', /*Belize Dollar*/ 'BMD', /*Bermudan Dollar*/ 'BTN', /*Bhutan Ngultrum*/ diff --git a/lib/internal/Magento/Framework/Locale/Test/Unit/ConfigTest.php b/lib/internal/Magento/Framework/Locale/Test/Unit/ConfigTest.php index 149f6b5e33b6e..20731ee34558e 100644 --- a/lib/internal/Magento/Framework/Locale/Test/Unit/ConfigTest.php +++ b/lib/internal/Magento/Framework/Locale/Test/Unit/ConfigTest.php @@ -6,7 +6,11 @@ namespace Magento\Framework\Locale\Test\Unit; -class ConfigTest extends \PHPUnit\Framework\TestCase +use Magento\Framework\Locale\Config; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use PHPUnit\Framework\TestCase; + +class ConfigTest extends TestCase { private static $allAllowedLocales = [ 'af_ZA', 'ar_DZ', 'ar_EG', 'ar_KW', 'ar_MA', 'ar_SA', 'az_Latn_AZ', 'be_BY', 'bg_BG', 'bn_BD', @@ -22,7 +26,7 @@ class ConfigTest extends \PHPUnit\Framework\TestCase private static $allAllowedCurrencies = [ 'AFN', 'ALL', 'AZN', 'DZD', 'AOA', 'ARS', 'AMD', 'AWG', 'AUD', 'BSD', - 'BHD', 'BDT', 'BBD', 'BYR', 'BZD', 'BMD', 'BTN', 'BOB', 'BAM', 'BWP', + 'BHD', 'BDT', 'BBD', 'BYN', 'BZD', 'BMD', 'BTN', 'BOB', 'BAM', 'BWP', 'BRL', 'GBP', 'BND', 'BGN', 'BUK', 'BIF', 'KHR', 'CAD', 'CVE', 'CZK', 'KYD', 'GQE', 'CLP', 'CNY', 'COP', 'KMF', 'CDF', 'CRC', 'HRK', 'CUP', 'DKK', 'DJF', 'DOP', 'XCD', 'EGP', 'SVC', 'ERN', 'EEK', 'ETB', 'EUR', @@ -67,13 +71,14 @@ class ConfigTest extends \PHPUnit\Framework\TestCase 'QED', 'PNP', 'EJN', 'MTO', 'EBY', ]; - /** @var \Magento\Framework\Locale\Config */ + /** + * @var Config + */ private $configObject; public function testGetAllowedLocalesNoDataArray() { - $this->configObject = (new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this)) - ->getObject(\Magento\Framework\Locale\Config::class); + $this->configObject = (new ObjectManager($this))->getObject(Config::class); $retrievedLocales = $this->configObject->getAllowedLocales(); @@ -88,9 +93,9 @@ public function testGetAllowedLocalesNoDataArray() public function testGetAllowedLocalesGivenDataArray() { - $this->configObject = (new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this)) + $this->configObject = (new ObjectManager($this)) ->getObject( - \Magento\Framework\Locale\Config::class, + Config::class, [ 'data' => [ 'allowedLocales' => $this::$sampleAdditionalLocales, @@ -114,9 +119,9 @@ public function testGetAllowedLocalesGivenDataArray() public function testGetAllowedLocalesGivenRedundantDataArray() { - $this->configObject = (new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this)) + $this->configObject = (new ObjectManager($this)) ->getObject( - \Magento\Framework\Locale\Config::class, + Config::class, [ 'data' => [ 'allowedLocales' => $this::$samplePresentLocales, @@ -140,8 +145,8 @@ public function testGetAllowedLocalesGivenRedundantDataArray() public function testGetAllowedCurrenciesNoDataArray() { - $this->configObject = (new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this)) - ->getObject(\Magento\Framework\Locale\Config::class); + $this->configObject = (new ObjectManager($this)) + ->getObject(Config::class); $retrievedCurrencies = $this->configObject->getAllowedCurrencies(); @@ -156,9 +161,9 @@ public function testGetAllowedCurrenciesNoDataArray() public function testGetAllowedCurrenciesGivenDataArray() { - $this->configObject = (new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this)) + $this->configObject = (new ObjectManager($this)) ->getObject( - \Magento\Framework\Locale\Config::class, + Config::class, [ 'data' => [ 'allowedCurrencies' => $this::$sampleAdditionalCurrencies, @@ -182,9 +187,9 @@ public function testGetAllowedCurrenciesGivenDataArray() public function testGetAllowedCurrenciesGivenRedundantDataArray() { - $this->configObject = (new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this)) + $this->configObject = (new ObjectManager($this)) ->getObject( - \Magento\Framework\Locale\Config::class, + Config::class, [ 'data' => [ 'allowedCurrencies' => $this::$samplePresentCurrencies, From 95eea5245b97a8c6f62d435dbfe32c2f3ddcb4c8 Mon Sep 17 00:00:00 2001 From: Alexey Rakitin <alexey.rakitin@babenkocommerce.com> Date: Fri, 22 Nov 2019 13:00:25 +0200 Subject: [PATCH 093/586] magento/magento2#23481: Billing/Shipping Address edit form design update from order backend - Messages container added to correctly apply margin between message and form - Form wrapper html tag changed from 'fieldset' to 'div' - Added 'admin__fieldset' class to form for standard admin styles to work properly --- .../Sales/Block/Adminhtml/Order/Address/Form.php | 1 + .../adminhtml/templates/order/address/form.phtml | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Address/Form.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Address/Form.php index 1efa149b390ef..06f2edba878ae 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Address/Form.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Address/Form.php @@ -108,6 +108,7 @@ protected function _prepareForm() { parent::_prepareForm(); $this->_form->setId('edit_form'); + $this->_form->setClass('admin__fieldset'); $this->_form->setMethod('post'); $this->_form->setAction( $this->getUrl('sales/*/addressSave', ['address_id' => $this->_getAddress()->getId()]) diff --git a/app/code/Magento/Sales/view/adminhtml/templates/order/address/form.phtml b/app/code/Magento/Sales/view/adminhtml/templates/order/address/form.phtml index a7f3b3c1cc8f5..b794c418de8d9 100644 --- a/app/code/Magento/Sales/view/adminhtml/templates/order/address/form.phtml +++ b/app/code/Magento/Sales/view/adminhtml/templates/order/address/form.phtml @@ -4,13 +4,15 @@ * See COPYING.txt for license details. */ ?> -<div class="message message-notice"> - <div class="message-inner"> - <div class="message-content"><?= $block->escapeHtml(__('Changing address information will not recalculate shipping, tax or other order amount.')) ?></div> +<div class="messages"> + <div class="message message-notice"> + <div class="message-inner"> + <div class="message-content"><?= $block->escapeHtml(__('Changing address information will not recalculate shipping, tax or other order amount.')) ?></div> + </div> </div> </div> -<fieldset class="fieldset admin__fieldset-wrapper"> +<div class="fieldset admin__fieldset-wrapper"> <legend class="legend admin__legend"> <span><?= $block->escapeHtml($block->getHeaderText()) ?></span> </legend> @@ -18,4 +20,4 @@ <div class="form-inline" data-mage-init='{"Magento_Sales/order/edit/address/form":{}}'> <?= $block->getForm()->toHtml() ?> </div> -</fieldset> +</div> From 46b4e37bac99457c1cecd2c04fe740419a9042fe Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Mon, 25 Nov 2019 20:14:28 +0200 Subject: [PATCH 094/586] Covering the system dependency by MFTF --- .../AdminTogglesEnabledConfigActionGroup.xml | 17 +++++++++ ...AdminUnchecksUseSystemValueActionGroup.xml | 14 +++++++ ...rtAdminDoesntSeeConfigFieldActionGroup.xml | 17 +++++++++ .../AssertAdminSeesConfigFieldActionGroup.xml | 17 +++++++++ .../Mftf/Page/AdminNewRelicConfigPage.xml | 12 ++++++ .../AdminNewRelicConfigSystemSection.xml | 16 ++++++++ .../AdminChecksSystemConfigDependencyTest.xml | 38 +++++++++++++++++++ 7 files changed, 131 insertions(+) create mode 100644 app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminTogglesEnabledConfigActionGroup.xml create mode 100644 app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminUnchecksUseSystemValueActionGroup.xml create mode 100644 app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminDoesntSeeConfigFieldActionGroup.xml create mode 100644 app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminSeesConfigFieldActionGroup.xml create mode 100644 app/code/Magento/NewRelicReporting/Test/Mftf/Page/AdminNewRelicConfigPage.xml create mode 100644 app/code/Magento/NewRelicReporting/Test/Mftf/Section/AdminNewRelicConfigSystemSection.xml create mode 100644 app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminChecksSystemConfigDependencyTest.xml diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminTogglesEnabledConfigActionGroup.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminTogglesEnabledConfigActionGroup.xml new file mode 100644 index 0000000000000..f9632784f4a92 --- /dev/null +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminTogglesEnabledConfigActionGroup.xml @@ -0,0 +1,17 @@ +<?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="AdminTogglesEnabledConfigActionGroup"> + <arguments> + <argument name="state" type="string"/> + </arguments> + <selectOption selector="{{AdminNewRelicConfigSystemSection.status}}" userInput="{{state}}" stepKey="switchActiveState"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminUnchecksUseSystemValueActionGroup.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminUnchecksUseSystemValueActionGroup.xml new file mode 100644 index 0000000000000..7d90c1d8dd478 --- /dev/null +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminUnchecksUseSystemValueActionGroup.xml @@ -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="AdminUnchecksUseSystemValueActionGroup"> + <uncheckOption selector="{{AdminNewRelicConfigSystemSection.useSystemValueForEnabled}}" stepKey="uncheckCheckbox"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminDoesntSeeConfigFieldActionGroup.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminDoesntSeeConfigFieldActionGroup.xml new file mode 100644 index 0000000000000..6e87dbbfbbf4b --- /dev/null +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminDoesntSeeConfigFieldActionGroup.xml @@ -0,0 +1,17 @@ +<?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="AssertAdminDoesntSeeConfigFieldActionGroup"> + <arguments> + <argument name="config" type="string"/> + </arguments> + <dontSeeElement selector="{{config}}" stepKey="dontSeeConfigField"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminSeesConfigFieldActionGroup.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminSeesConfigFieldActionGroup.xml new file mode 100644 index 0000000000000..4df7099e50b28 --- /dev/null +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminSeesConfigFieldActionGroup.xml @@ -0,0 +1,17 @@ +<?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="AssertAdminSeesConfigFieldActionGroup"> + <arguments> + <argument name="config" type="string"/> + </arguments> + <seeElement selector="{{config}}" stepKey="seeConfigField"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/Page/AdminNewRelicConfigPage.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/Page/AdminNewRelicConfigPage.xml new file mode 100644 index 0000000000000..fda7d0ef336b1 --- /dev/null +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/Page/AdminNewRelicConfigPage.xml @@ -0,0 +1,12 @@ +<?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="AdminNewRelicConfigPage" url="admin/system_config/edit/section/newrelicreporting/" area="admin" module="Magento_Config"> + <section name="AdminNewRelicConfigSystemSection"/> + </page> +</pages> \ No newline at end of file diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/Section/AdminNewRelicConfigSystemSection.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/Section/AdminNewRelicConfigSystemSection.xml new file mode 100644 index 0000000000000..7c8baccca52fe --- /dev/null +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/Section/AdminNewRelicConfigSystemSection.xml @@ -0,0 +1,16 @@ +<?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="AdminNewRelicConfigSystemSection"> + <element name="status" type="select" selector="#row_newrelicreporting_general_enable [data-ui-id='select-groups-general-fields-enable-value']"/> + <element name="useSystemValueForEnabled" type="checkbox" selector="#newrelicreporting_general_enable_inherit"/> + <element name="apiUrl" type="select" selector="input#newrelicreporting_general_api_url"/> + </section> +</sections> diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminChecksSystemConfigDependencyTest.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminChecksSystemConfigDependencyTest.xml new file mode 100644 index 0000000000000..12aacbc964d2f --- /dev/null +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminChecksSystemConfigDependencyTest.xml @@ -0,0 +1,38 @@ +<?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="AdminChecksSystemConfigDependencyTest"> + <annotations> + <features value="NewRelicReporting"/> + <stories value="Admin is able to see the configuration fields only after enabling the feature"/> + <title value="Admin can see the configuration fields only after enabling the feature"/> + <description value="The system configs should be available only after enabling the New Relic feature."/> + <severity value="CRITICAL"/> + <group value="NewRelicReporting"/> + </annotations> + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <amOnPage url="{{AdminNewRelicConfigPage.url}}" stepKey="navigateToNewRelicConfigurationPage"/> + </before> + <after> + <actionGroup ref="logout" stepKey="logoutOfAdmin"/> + </after> + <actionGroup ref="AssertAdminDoesntSeeConfigFieldActionGroup" stepKey="checkIfApiUrlIsNotVisible"> + <argument name="config" value="{{AdminNewRelicConfigSystemSection.apiUrl}}"/> + </actionGroup> + <actionGroup ref="AdminUnchecksUseSystemValueActionGroup" stepKey="uncheckUseSystemValue"/> + <actionGroup ref="AdminTogglesEnabledConfigActionGroup" stepKey="enableNewRelic"> + <argument name="state" value="Yes"/> + </actionGroup> + <actionGroup ref="AssertAdminSeesConfigFieldActionGroup" stepKey="checkIfApiUrlIsVisible"> + <argument name="config" value="{{AdminNewRelicConfigSystemSection.apiUrl}}"/> + </actionGroup> + </test> +</tests> From 66fddf2e77580582c5c3f0ce957b73dfa3fd6f50 Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Tue, 26 Nov 2019 07:02:39 +0200 Subject: [PATCH 095/586] Adding expanding config tab step --- .../AdminExpandNewRelicConfigTabActionGroup.xml | 17 +++++++++++++++++ .../AdminNewRelicConfigSystemSection.xml | 1 + .../AdminChecksSystemConfigDependencyTest.xml | 7 +++++-- 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminExpandNewRelicConfigTabActionGroup.xml diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminExpandNewRelicConfigTabActionGroup.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminExpandNewRelicConfigTabActionGroup.xml new file mode 100644 index 0000000000000..4dc3d2ea8ea34 --- /dev/null +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminExpandNewRelicConfigTabActionGroup.xml @@ -0,0 +1,17 @@ +<?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="AdminExpandNewRelicConfigTabActionGroup"> + <arguments> + <argument name="tabName" type="string"/> + </arguments> + <conditionalClick selector="{{AdminNewRelicConfigSystemSection.tab(tabName)}}" dependentSelector="{{AdminNewRelicConfigSystemSection.status}}" visible="false" stepKey="expandTab"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/Section/AdminNewRelicConfigSystemSection.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/Section/AdminNewRelicConfigSystemSection.xml index 7c8baccca52fe..79625273b988e 100644 --- a/app/code/Magento/NewRelicReporting/Test/Mftf/Section/AdminNewRelicConfigSystemSection.xml +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/Section/AdminNewRelicConfigSystemSection.xml @@ -9,6 +9,7 @@ <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminNewRelicConfigSystemSection"> + <element name="tab" type="button" selector="#newrelicreporting_{{tab}}-head" parameterized="true"/> <element name="status" type="select" selector="#row_newrelicreporting_general_enable [data-ui-id='select-groups-general-fields-enable-value']"/> <element name="useSystemValueForEnabled" type="checkbox" selector="#newrelicreporting_general_enable_inherit"/> <element name="apiUrl" type="select" selector="input#newrelicreporting_general_api_url"/> diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminChecksSystemConfigDependencyTest.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminChecksSystemConfigDependencyTest.xml index 12aacbc964d2f..eabacffe9b181 100644 --- a/app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminChecksSystemConfigDependencyTest.xml +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminChecksSystemConfigDependencyTest.xml @@ -19,12 +19,15 @@ </annotations> <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <amOnPage url="{{AdminNewRelicConfigPage.url}}" stepKey="navigateToNewRelicConfigurationPage"/> + <actionGroup ref="AdminNavigateToNewRelicConfigurationActionGroup" stepKey="goToConfigPage"/> + <actionGroup ref="AdminExpandNewRelicConfigTabActionGroup" stepKey="expandGeneralTab"> + <argument name="tabName" value="general"/> + </actionGroup> </before> <after> <actionGroup ref="logout" stepKey="logoutOfAdmin"/> </after> - <actionGroup ref="AssertAdminDoesntSeeConfigFieldActionGroup" stepKey="checkIfApiUrlIsNotVisible"> + <actionGroup ref="AssertAdminDontSeeConfigFieldActionGroup" stepKey="checkIfApiUrlIsNotVisible"> <argument name="config" value="{{AdminNewRelicConfigSystemSection.apiUrl}}"/> </actionGroup> <actionGroup ref="AdminUnchecksUseSystemValueActionGroup" stepKey="uncheckUseSystemValue"/> From f8b6886538224a9816a381a4fb752674678d6d30 Mon Sep 17 00:00:00 2001 From: mmularski <mmularczyk9@gmail.com> Date: Wed, 10 Jul 2019 18:06:46 +0200 Subject: [PATCH 096/586] Issue-628. Convert CreateTermEntityTest to MFTF --- .../AdminAssertTermInGridActionGroup.xml | 21 ++++++ .../ActionGroup/CreateNewTermActionGroup.xml | 27 ++++++++ .../ActionGroup/DeleteTermActionGroup.xml | 26 +++++++ ...tAssertTermAbsentInCheckoutActionGroup.xml | 66 ++++++++++++++++++ ...refrontAssertTermInCheckoutActionGroup.xml | 68 +++++++++++++++++++ ...sageInMultishippingCheckoutActionGroup.xml | 65 ++++++++++++++++++ .../Test/Mftf/Data/TermData.xml | 38 +++++++++++ .../Test/Mftf/Page/AdminEditTermPage.xml | 14 ++++ .../Test/Mftf/Page/AdminNewTermPage.xml | 15 ++++ .../Test/Mftf/Page/AdminTermsPage.xml | 12 ++++ .../Test/Mftf/Page/CheckoutPage.xml | 14 ++++ .../Mftf/Section/AdminEditTermFormSection.xml | 15 ++++ .../Mftf/Section/AdminNewTermFormSection.xml | 23 +++++++ .../Section/AdminTermFormMessagesSection.xml | 15 ++++ .../Mftf/Section/AdminTermGridSection.xml | 18 +++++ .../StorefrontCheckoutAgreementsSection.xml | 16 +++++ .../AdminCreateActiveHtmlTermEntityTest.xml | 47 +++++++++++++ .../AdminCreateActiveTextTermEntityTest.xml | 47 +++++++++++++ .../AdminCreateDisabledTextTermEntityTest.xml | 47 +++++++++++++ ...abledTextTermOnMultishippingEntityTest.xml | 52 ++++++++++++++ .../MultishippingCheckoutAddressesPage.xml | 14 ++++ .../Page/MultishippingCheckoutBillingPage.xml | 14 ++++ .../MultishippingCheckoutOverviewPage.xml | 14 ++++ .../MultishippingCheckoutShippingPage.xml | 14 ++++ ...hippingCheckoutAddressesToolbarSection.xml | 14 ++++ ...ishippingCheckoutBillingToolbarSection.xml | 14 ++++ ...ishippingCheckoutOverviewReviewSection.xml | 14 ++++ ...shippingCheckoutShippingToolbarSection.xml | 14 ++++ 28 files changed, 758 insertions(+) create mode 100644 app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AdminAssertTermInGridActionGroup.xml create mode 100644 app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/CreateNewTermActionGroup.xml create mode 100644 app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/DeleteTermActionGroup.xml create mode 100644 app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/StorefrontAssertTermAbsentInCheckoutActionGroup.xml create mode 100644 app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/StorefrontAssertTermInCheckoutActionGroup.xml create mode 100644 app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/StorefrontAssertTermRequireMessageInMultishippingCheckoutActionGroup.xml create mode 100644 app/code/Magento/CheckoutAgreements/Test/Mftf/Data/TermData.xml create mode 100644 app/code/Magento/CheckoutAgreements/Test/Mftf/Page/AdminEditTermPage.xml create mode 100644 app/code/Magento/CheckoutAgreements/Test/Mftf/Page/AdminNewTermPage.xml create mode 100644 app/code/Magento/CheckoutAgreements/Test/Mftf/Page/AdminTermsPage.xml create mode 100644 app/code/Magento/CheckoutAgreements/Test/Mftf/Page/CheckoutPage.xml create mode 100644 app/code/Magento/CheckoutAgreements/Test/Mftf/Section/AdminEditTermFormSection.xml create mode 100644 app/code/Magento/CheckoutAgreements/Test/Mftf/Section/AdminNewTermFormSection.xml create mode 100644 app/code/Magento/CheckoutAgreements/Test/Mftf/Section/AdminTermFormMessagesSection.xml create mode 100644 app/code/Magento/CheckoutAgreements/Test/Mftf/Section/AdminTermGridSection.xml create mode 100644 app/code/Magento/CheckoutAgreements/Test/Mftf/Section/StorefrontCheckoutAgreementsSection.xml create mode 100644 app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveHtmlTermEntityTest.xml create mode 100644 app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveTextTermEntityTest.xml create mode 100644 app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateDisabledTextTermEntityTest.xml create mode 100644 app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateEnabledTextTermOnMultishippingEntityTest.xml create mode 100644 app/code/Magento/Multishipping/Test/Mftf/Page/MultishippingCheckoutAddressesPage.xml create mode 100644 app/code/Magento/Multishipping/Test/Mftf/Page/MultishippingCheckoutBillingPage.xml create mode 100644 app/code/Magento/Multishipping/Test/Mftf/Page/MultishippingCheckoutOverviewPage.xml create mode 100644 app/code/Magento/Multishipping/Test/Mftf/Page/MultishippingCheckoutShippingPage.xml create mode 100644 app/code/Magento/Multishipping/Test/Mftf/Section/StorefrontMultishippingCheckoutAddressesToolbarSection.xml create mode 100644 app/code/Magento/Multishipping/Test/Mftf/Section/StorefrontMultishippingCheckoutBillingToolbarSection.xml create mode 100644 app/code/Magento/Multishipping/Test/Mftf/Section/StorefrontMultishippingCheckoutOverviewReviewSection.xml create mode 100644 app/code/Magento/Multishipping/Test/Mftf/Section/StorefrontMultishippingCheckoutShippingToolbarSection.xml diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AdminAssertTermInGridActionGroup.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AdminAssertTermInGridActionGroup.xml new file mode 100644 index 0000000000000..965d8d2e01064 --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AdminAssertTermInGridActionGroup.xml @@ -0,0 +1,21 @@ +<?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="AdminAssertTermInGrid"> + <arguments> + <argument name="termName" type="string"/> + </arguments> + <amOnPage url="{{AdminTermsPage.url}}" stepKey="onTermGridPage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <fillField selector="{{AdminTermGridSection.filterByTermName}}" userInput="{{termName}}" stepKey="fillTermNameFilter"/> + <click selector="{{AdminTermGridSection.searchButton}}" stepKey="clickSearchButton"/> + <see selector="{{AdminTermGridSection.firstRowConditionName}}" userInput="{{termName}}" stepKey="assertTermInGrid"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/CreateNewTermActionGroup.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/CreateNewTermActionGroup.xml new file mode 100644 index 0000000000000..4923589ee9cf4 --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/CreateNewTermActionGroup.xml @@ -0,0 +1,27 @@ +<?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="CreateNewTerm"> + <arguments> + <argument name="term"/> + </arguments> + <amOnPage url="{{AdminNewTermPage.url}}" stepKey="amOnNewTermPage"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <fillField selector="{{AdminNewTermFormSection.conditionName}}" userInput="{{term.name}}" stepKey="fillFieldConditionName"/> + <selectOption selector="{{AdminNewTermFormSection.isActive}}" userInput="{{term.isActive}}" stepKey="selectOptionIsActive"/> + <selectOption selector="{{AdminNewTermFormSection.isHtml}}" userInput="{{term.isHtml}}" stepKey="selectOptionIsHtml"/> + <selectOption selector="{{AdminNewTermFormSection.mode}}" userInput="{{term.mode}}" stepKey="selectOptionMode"/> + <selectOption selector="{{AdminNewTermFormSection.storeView}}" userInput="{{term.storeView}}" stepKey="selectOptionStoreView" /> + <fillField selector="{{AdminNewTermFormSection.checkboxText}}" userInput="{{term.checkboxText}}" stepKey="fillFieldCheckboxText"/> + <fillField selector="{{AdminNewTermFormSection.content}}" userInput="{{term.content}}" stepKey="fillFieldContent"/> + <click selector="{{AdminNewTermFormSection.save}}" stepKey="saveTerm"/> + <see selector="{{AdminTermFormMessagesSection.successMessage}}" userInput="You saved the condition." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/DeleteTermActionGroup.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/DeleteTermActionGroup.xml new file mode 100644 index 0000000000000..7ed4d55f29f2d --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/DeleteTermActionGroup.xml @@ -0,0 +1,26 @@ +<?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="DeleteTerm"> + <arguments> + <argument name="term" /> + </arguments> + <amOnPage url="{{AdminTermsPage.url}}" stepKey="onTermGridPage"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <fillField selector="{{AdminTermGridSection.filterByTermName}}" userInput="{{term.name}}" stepKey="fillTermNameFilter"/> + <click selector="{{AdminTermGridSection.searchButton}}" stepKey="clickSearchButton"/> + <click selector="{{AdminTermGridSection.firstRowConditionId}}" stepKey="clickFirstRow"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + <click selector="{{AdminEditTermFormSection.delete}}" stepKey="clickDeleteButton"/> + <click selector="{{AdminEditTermFormSection.acceptPopupButton}}" stepKey="clickDeleteOkButton"/> + <waitForPageLoad stepKey="waitForPageLoad3"/> + <see selector="{{AdminTermFormMessagesSection.successMessage}}" userInput="You deleted the condition." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/StorefrontAssertTermAbsentInCheckoutActionGroup.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/StorefrontAssertTermAbsentInCheckoutActionGroup.xml new file mode 100644 index 0000000000000..ca2f1b0db59fe --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/StorefrontAssertTermAbsentInCheckoutActionGroup.xml @@ -0,0 +1,66 @@ +<?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="StorefrontAssertTermAbsentInCheckout"> + <arguments> + <argument name="termCheckboxText" type="string"/> + <argument name="product" defaultValue="SimpleTwo"/> + </arguments> + + <!--Add product to cart--> + <amOnPage url="{{StorefrontProductPage.url(product.custom_attributes[url_key])}}" stepKey="goToProductPage"/> + <waitForPageLoad stepKey="waitForProductPage"/> + <click selector="{{StorefrontProductPageSection.addToCartBtn}}" stepKey="addToCart"/> + <waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdding}}" stepKey="waitForElementNotVisibleAddToCartButtonTitleIsAdding"/> + <waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdded}}" stepKey="waitForElementNotVisibleAddToCartButtonTitleIsAdded"/> + <waitForElementVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAddToCart}}" stepKey="waitForElementVisibleAddToCartButtonTitleIsAddToCart"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" time="30" stepKey="waitForProductAddedMessage"/> + <see selector="{{StorefrontMessagesSection.success}}" userInput="You added {{product.name}} to your shopping cart." stepKey="seeAddToCartSuccessMessage"/> + + <!--Go to Checkout--> + <waitForElementNotVisible selector="{{StorefrontMinicartSection.emptyCart}}" stepKey="waitUpdateQuantity"/> + <wait time="5" stepKey="waitMinicartRendering"/> + <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickCart"/> + <click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="goToCheckout"/> + + <!--Process steps--> + <fillField selector="{{CheckoutShippingSection.email}}" userInput="{{CustomerEntityOne.email}}" stepKey="enterEmail"/> + <fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{CustomerEntityOne.firstname}}" stepKey="enterFirstName"/> + <fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{CustomerEntityOne.lastname}}" stepKey="enterLastName"/> + <fillField selector="{{CheckoutShippingSection.street}}" userInput="{{CustomerAddressSimple.street[0]}}" stepKey="enterStreet"/> + <fillField selector="{{CheckoutShippingSection.city}}" userInput="{{CustomerAddressSimple.city}}" stepKey="enterCity"/> + <selectOption selector="{{CheckoutShippingSection.region}}" userInput="{{CustomerAddressSimple.state}}" stepKey="selectRegion"/> + <fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{CustomerAddressSimple.postcode}}" stepKey="enterPostcode"/> + <fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{CustomerAddressSimple.telephone}}" stepKey="enterTelephone"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask1"/> + <click selector="{{CheckoutShippingMethodsSection.checkShippingMethodByName('')}}" stepKey="selectShippingMethod"/> + <waitForElement selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/> + <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/> + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> + <seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/> + + <!--Check if agreement is absent on checkout--> + <dontSee selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementButton}}" userInput="{{termCheckboxText}}" stepKey="seeTermInCheckout"/> + + <!--Checkout select Check/Money Order payment--> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask2"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + <conditionalClick selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('Check / Money order')}}" dependentSelector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('Check / Money order')}}" visible="true" stepKey="selectCheckmoPaymentMethod"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskAfterPaymentMethodSelection"/> + + <!--Click Place Order button--> + <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> + + <!--See success messages--> + <see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="seeSuccessTitle"/> + <see selector="{{CheckoutSuccessMainSection.orderNumberText}}" userInput="Your order # is: " stepKey="seeOrderNumber"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/StorefrontAssertTermInCheckoutActionGroup.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/StorefrontAssertTermInCheckoutActionGroup.xml new file mode 100644 index 0000000000000..fb2825de1a7ad --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/StorefrontAssertTermInCheckoutActionGroup.xml @@ -0,0 +1,68 @@ +<?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="StorefrontAssertTermInCheckout"> + <arguments> + <argument name="termCheckboxText" type="string"/> + <argument name="product" defaultValue="SimpleTwo"/> + </arguments> + + <!--Add product to cart--> + <amOnPage url="{{StorefrontProductPage.url(product.custom_attributes[url_key])}}" stepKey="goToProductPage"/> + <waitForPageLoad stepKey="waitForProductPage"/> + <click selector="{{StorefrontProductPageSection.addToCartBtn}}" stepKey="addToCart"/> + <waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdding}}" stepKey="waitForElementNotVisibleAddToCartButtonTitleIsAdding"/> + <waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdded}}" stepKey="waitForElementNotVisibleAddToCartButtonTitleIsAdded"/> + <waitForElementVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAddToCart}}" stepKey="waitForElementVisibleAddToCartButtonTitleIsAddToCart"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" time="30" stepKey="waitForProductAddedMessage"/> + <see selector="{{StorefrontMessagesSection.success}}" userInput="You added {{product.name}} to your shopping cart." stepKey="seeAddToCartSuccessMessage"/> + + <!--Go to Checkout--> + <waitForElementNotVisible selector="{{StorefrontMinicartSection.emptyCart}}" stepKey="waitUpdateQuantity"/> + <wait time="5" stepKey="waitMinicartRendering"/> + <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickCart"/> + <click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="goToCheckout"/> + + <!--Process steps--> + <fillField selector="{{CheckoutShippingSection.email}}" userInput="{{CustomerEntityOne.email}}" stepKey="enterEmail"/> + <fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{CustomerEntityOne.firstname}}" stepKey="enterFirstName"/> + <fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{CustomerEntityOne.lastname}}" stepKey="enterLastName"/> + <fillField selector="{{CheckoutShippingSection.street}}" userInput="{{CustomerAddressSimple.street[0]}}" stepKey="enterStreet"/> + <fillField selector="{{CheckoutShippingSection.city}}" userInput="{{CustomerAddressSimple.city}}" stepKey="enterCity"/> + <selectOption selector="{{CheckoutShippingSection.region}}" userInput="{{CustomerAddressSimple.state}}" stepKey="selectRegion"/> + <fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{CustomerAddressSimple.postcode}}" stepKey="enterPostcode"/> + <fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{CustomerAddressSimple.telephone}}" stepKey="enterTelephone"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask1"/> + <click selector="{{CheckoutShippingMethodsSection.checkShippingMethodByName('')}}" stepKey="selectShippingMethod"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask2"/> + <waitForElement selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/> + <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/> + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> + <seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/> + + <!--Check if agreement is present on checkout and select it--> + <see selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementButton}}" userInput="{{termCheckboxText}}" stepKey="seeTermInCheckout"/> + <selectOption selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementCheckbox}}" userInput="{{termCheckboxText}}" stepKey="checkAgreement"/> + + <!--Checkout select Check/Money Order payment--> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask3"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + <conditionalClick selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('Check / Money order')}}" dependentSelector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('Check / Money order')}}" visible="true" stepKey="selectCheckmoPaymentMethod"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskAfterPaymentMethodSelection"/> + + <!--Click Place Order button--> + <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> + + <!--See success messages--> + <see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="seeSuccessTitle"/> + <see selector="{{CheckoutSuccessMainSection.orderNumberText}}" userInput="Your order # is: " stepKey="seeOrderNumber"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/StorefrontAssertTermRequireMessageInMultishippingCheckoutActionGroup.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/StorefrontAssertTermRequireMessageInMultishippingCheckoutActionGroup.xml new file mode 100644 index 0000000000000..00637c6b22585 --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/StorefrontAssertTermRequireMessageInMultishippingCheckoutActionGroup.xml @@ -0,0 +1,65 @@ +<?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="StorefrontAssertTermRequireMessageInMultishippingCheckout"> + <arguments> + <argument name="termCheckboxText" type="string"/> + <argument name="product1" defaultValue="SimpleTwo"/> + <argument name="product2" defaultValue="SimpleTwo"/> + </arguments> + + <!--Add product1 to cart--> + <amOnPage url="{{StorefrontProductPage.url(product1.custom_attributes[url_key])}}" stepKey="goToProduct1Page"/> + <waitForPageLoad stepKey="waitForProduct1Page"/> + <click selector="{{StorefrontProductPageSection.addToCartBtn}}" stepKey="addToCart1"/> + <waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdding}}" stepKey="waitForElementNotVisibleAddToCartButton1TitleIsAdding"/> + <waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdded}}" stepKey="waitForElementNotVisibleAddToCartButton1TitleIsAdded"/> + <waitForElementVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAddToCart}}" stepKey="waitForElementVisibleAddToCartButton1TitleIsAddToCart"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" time="30" stepKey="waitForProduct1AddedMessage"/> + <see selector="{{StorefrontMessagesSection.success}}" userInput="You added {{product1.name}} to your shopping cart." stepKey="seeAddToCart1SuccessMessage"/> + + <!--Add product2 to cart--> + <amOnPage url="{{StorefrontProductPage.url(product2.custom_attributes[url_key])}}" stepKey="goToProduct2Page"/> + <waitForPageLoad stepKey="waitForProduct2Page"/> + <click selector="{{StorefrontProductPageSection.addToCartBtn}}" stepKey="addToCart2"/> + <waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdding}}" stepKey="waitForElementNotVisibleAddToCartButton2TitleIsAdding"/> + <waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdded}}" stepKey="waitForElementNotVisibleAddToCartButton2TitleIsAdded"/> + <waitForElementVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAddToCart}}" stepKey="waitForElementVisibleAddToCartButton2TitleIsAddToCart"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" time="30" stepKey="waitForProduct2AddedMessage"/> + <see selector="{{StorefrontMessagesSection.success}}" userInput="You added {{product2.name}} to your shopping cart." stepKey="seeAddToCart2SuccessMessage"/> + + <!--Go to Checkout Cart and proceed with multiple addresses--> + <amOnPage url="{{CheckoutCartPage.url}}" stepKey="goToCheckoutCart"/> + <waitForPageLoad stepKey="waitForPageLoad3"/> + <click selector="{{MultishippingSection.checkoutWithMultipleAddresses}}" stepKey="proceedMultishipping"/> + + <!--Procees do overview page--> + <click selector="{{StorefrontMultishippingCheckoutAddressesToolbarSection.goToShippingInformation}}" stepKey="clickGoToShippingInformation"/> + <waitForPageLoad stepKey="waitForPageLoad4"/> + <click selector="{{StorefrontMultishippingCheckoutShippingToolbarSection.continueToBilling}}" stepKey="clickContinueToBilling"/> + <waitForPageLoad stepKey="waitForPageLoad5"/> + <click selector="{{StorefrontMultishippingCheckoutBillingToolbarSection.goToReviewOrder}}" stepKey="clickGoToReviewOrder"/> + <waitForPageLoad stepKey="waitForPageLoad6"/> + + <!--Check if agreement is present on checkout and select it--> + <scrollTo selector="{{StorefrontMultishippingCheckoutOverviewReviewSection.placeOrder}}" stepKey="scrollToButtonPlaceOrder"/> + <see selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementButton}}" userInput="{{termCheckboxText}}" stepKey="seeTermInCheckout"/> + <click selector="{{StorefrontMultishippingCheckoutOverviewReviewSection.placeOrder}}" stepKey="tryToPlaceOrder1"/> + <see selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementErrorMessage}}" userInput="This is a required field." stepKey="seeErrorMessage"/> + <selectOption selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementCheckbox}}" userInput="{{termCheckboxText}}" stepKey="checkAgreement"/> + <click selector="{{StorefrontMultishippingCheckoutOverviewReviewSection.placeOrder}}" stepKey="tryToPlaceOrder2"/> + <dontSee selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementErrorMessage}}" userInput="This is a required field." stepKey="dontSeeErrorMessage"/> + + <!--See success message--> + <see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="seeSuccessTitle"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Data/TermData.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Data/TermData.xml new file mode 100644 index 0000000000000..f34aa52d1ebe3 --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Data/TermData.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + <entity name="activeTextTerm" type="term"> + <data key="name" unique="suffix">name</data> + <data key="isActive">Enabled</data> + <data key="isHtml">Text</data> + <data key="mode">Manually</data> + <data key="storeView">Default Store View</data> + <data key="checkboxText" unique="suffix">test_checkbox</data> + <data key="content" unique="suffix">TestMessage</data> + </entity> + <entity name="activeHtmlTerm" type="term"> + <data key="name" unique="suffix">name</data> + <data key="isActive">Enabled</data> + <data key="isHtml">HTML</data> + <data key="mode">Manually</data> + <data key="storeView">Default Store View</data> + <data key="checkboxText" unique="suffix">test_checkbox</data> + <data key="content"><html></data> + </entity> + <entity name="disabledTextTerm" type="term"> + <data key="name" unique="suffix">name</data> + <data key="isActive">Disabled</data> + <data key="isHtml">Text</data> + <data key="mode">Manually</data> + <data key="storeView">Default Store View</data> + <data key="checkboxText" unique="suffix">test_checkbox</data> + <data key="content" unique="suffix">TestMessage</data> + </entity> +</entities> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Page/AdminEditTermPage.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Page/AdminEditTermPage.xml new file mode 100644 index 0000000000000..3a13f7d7d5e60 --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Page/AdminEditTermPage.xml @@ -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="AdminEditTermPage" url="checkout/agreement/edit/id/{{termId}}/" area="admin" module="Magento_CheckoutAgreements" parameterized="true"> + <section name="AdminEditTermFormSection"/> + </page> +</pages> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Page/AdminNewTermPage.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Page/AdminNewTermPage.xml new file mode 100644 index 0000000000000..51ec18a1d17e5 --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Page/AdminNewTermPage.xml @@ -0,0 +1,15 @@ +<?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="AdminNewTermPage" url="checkout/agreement/new" area="admin" module="Magento_CheckoutAgreements"> + <section name="AdminNewTermFormSection"/> + <section name="AdminTermFormMessagesSection"/> + </page> +</pages> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Page/AdminTermsPage.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Page/AdminTermsPage.xml new file mode 100644 index 0000000000000..4fb1a9704d9d0 --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Page/AdminTermsPage.xml @@ -0,0 +1,12 @@ +<?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="AdminTermsPage" url="checkout/agreement/" area="admin" module="Magento_CheckoutAgreements"> + <section name="AdminTermGridSection"/> + </page> +</pages> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Page/CheckoutPage.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Page/CheckoutPage.xml new file mode 100644 index 0000000000000..fdb75ab4bc4c2 --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Page/CheckoutPage.xml @@ -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="CheckoutPage" url="/checkout" area="storefront" module="Magento_CheckoutAgreements"> + <section name="StorefrontCheckoutAgreementsSection"/> + </page> +</pages> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Section/AdminEditTermFormSection.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Section/AdminEditTermFormSection.xml new file mode 100644 index 0000000000000..734a75b49c03a --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Section/AdminEditTermFormSection.xml @@ -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="AdminEditTermFormSection"> + <element name="delete" type="button" selector=".page-main-actions #delete"/> + <element name="acceptPopupButton" type="button" selector="button.action-primary.action-accept"/> + </section> +</sections> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Section/AdminNewTermFormSection.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Section/AdminNewTermFormSection.xml new file mode 100644 index 0000000000000..3f8a12f526c01 --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Section/AdminNewTermFormSection.xml @@ -0,0 +1,23 @@ +<?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="AdminNewTermFormSection"> + <element name="save" type="button" selector=".page-main-actions #save"/> + + <element name="conditionName" type="input" selector="#name"/> + <element name="isActive" type="select" selector="#is_active"/> + <element name="isHtml" type="select" selector="#is_html"/> + <element name="mode" type="select" selector="#mode"/> + <element name="storeView" type="multiselect" selector="#stores"/> + <element name="checkboxText" type="input" selector="#checkbox_text"/> + <element name="content" type="textarea" selector="#content"/> + <element name="contentHeight" type="input" selector="#content_height"/> + </section> +</sections> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Section/AdminTermFormMessagesSection.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Section/AdminTermFormMessagesSection.xml new file mode 100644 index 0000000000000..a3a91855b0640 --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Section/AdminTermFormMessagesSection.xml @@ -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="AdminTermFormMessagesSection"> + <element name="successMessage" type="text" selector=".message-success"/> + <element name="errorMessage" type="text" selector=".message.message-error.error"/> + </section> +</sections> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Section/AdminTermGridSection.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Section/AdminTermGridSection.xml new file mode 100644 index 0000000000000..65211c78ec00a --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Section/AdminTermGridSection.xml @@ -0,0 +1,18 @@ +<?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="AdminTermGridSection"> + <element name="searchButton" type="button" selector=".admin__data-grid-header button[title=Search]"/> + <element name="resetButton" type="button" selector="button[title='Reset Filter']"/> + <element name="filterByTermName" type="input" selector="#agreementGrid_filter_name"/> + <element name="firstRowConditionName" type="text" selector=".data-grid>tbody>tr>td.col-name"/> + <element name="firstRowConditionId" type="text" selector=".data-grid>tbody>tr>td.col-id.col-agreement_id"/> + <element name="successMessage" type="text" selector=".message-success"/> + </section> +</sections> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Section/StorefrontCheckoutAgreementsSection.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Section/StorefrontCheckoutAgreementsSection.xml new file mode 100644 index 0000000000000..cb3e98949c622 --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Section/StorefrontCheckoutAgreementsSection.xml @@ -0,0 +1,16 @@ +<?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="StorefrontCheckoutAgreementsSection"> + <element name="checkoutAgreementCheckbox" type="checkbox" selector="div.checkout-agreement.field.choice.required > input"/> + <element name="checkoutAgreementButton" type="button" selector="div.checkout-agreements-block > div > div > div > label > button > span"/> + <element name="checkoutAgreementErrorMessage" type="button" selector="div.checkout-agreement.field.choice.required > div.mage-error"/> + </section> +</sections> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveHtmlTermEntityTest.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveHtmlTermEntityTest.xml new file mode 100644 index 0000000000000..481c6683d1add --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveHtmlTermEntityTest.xml @@ -0,0 +1,47 @@ +<?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="AdminCreateActiveHtmlTermEntityTest"> + <annotations> + <features value="CheckoutAgreements"/> + <stories value="Checkout agreements"/> + <title value="Create active HTML checkout agreement"/> + <description value="Admin should be able to create active HTML checkout agreement"/> + <severity value="CRITICAL"/> + <testCaseId value=""/> + <group value="checkoutAgreements"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <magentoCLI command="config:set checkout/options/enable_agreements 1" stepKey="setEnableTermsOnCheckout"/> + <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin" /> + <createData entity="SimpleTwo" stepKey="createdProduct"/> + </before> + <after> + <magentoCLI command="config:set checkout/options/enable_agreements 0" stepKey="setDisableTermsOnCheckout"/> + <deleteData createDataKey="createdProduct" stepKey="deletedProduct"/> + <actionGroup ref="DeleteTerm" stepKey="deleteTerm"> + <argument name="term" value="activeHtmlTerm"/> + </actionGroup> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <actionGroup ref="CreateNewTerm" stepKey="createTerm"> + <argument name="term" value="activeHtmlTerm"/> + </actionGroup> + <actionGroup ref="AdminAssertTermInGrid" stepKey="assertTermInGrid"> + <argument name="termName" value="{{activeHtmlTerm.name}}"/> + </actionGroup> + <actionGroup ref="StorefrontAssertTermInCheckout" stepKey="assertTermInCheckout"> + <argument name="termCheckboxText" value="{{activeHtmlTerm.checkboxText}}"/> + <argument name="product" value="$$createdProduct$$"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveTextTermEntityTest.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveTextTermEntityTest.xml new file mode 100644 index 0000000000000..3fc623de04f8f --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveTextTermEntityTest.xml @@ -0,0 +1,47 @@ +<?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="AdminCreateActiveTextTermEntityTest"> + <annotations> + <features value="CheckoutAgreements"/> + <stories value="Checkout agreements"/> + <title value="Create active text checkout agreement"/> + <description value="Admin should be able to create active text checkout agreement"/> + <severity value="CRITICAL"/> + <testCaseId value=""/> + <group value="checkoutAgreements"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <magentoCLI command="config:set checkout/options/enable_agreements 1" stepKey="setEnableTermsOnCheckout"/> + <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin" /> + <createData entity="SimpleTwo" stepKey="createdProduct"/> + </before> + <after> + <magentoCLI command="config:set checkout/options/enable_agreements 0" stepKey="setDisableTermsOnCheckout"/> + <deleteData createDataKey="createdProduct" stepKey="deletedProduct"/> + <actionGroup ref="DeleteTerm" stepKey="deleteTerm"> + <argument name="term" value="activeTextTerm"/> + </actionGroup> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <actionGroup ref="CreateNewTerm" stepKey="createTerm"> + <argument name="term" value="activeTextTerm"/> + </actionGroup> + <actionGroup ref="AdminAssertTermInGrid" stepKey="assertTermInGrid"> + <argument name="termName" value="{{activeTextTerm.name}}"/> + </actionGroup> + <actionGroup ref="StorefrontAssertTermInCheckout" stepKey="assertTermInCheckout"> + <argument name="termCheckboxText" value="{{activeTextTerm.checkboxText}}"/> + <argument name="product" value="$$createdProduct$$"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateDisabledTextTermEntityTest.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateDisabledTextTermEntityTest.xml new file mode 100644 index 0000000000000..d28acdcd3d4eb --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateDisabledTextTermEntityTest.xml @@ -0,0 +1,47 @@ +<?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="AdminCreateDisabledTextTermEntityTest"> + <annotations> + <features value="CheckoutAgreements"/> + <stories value="Checkout agreements"/> + <title value="Create disabled text checkout agreement"/> + <description value="Admin should be able to create disabled text checkout agreement"/> + <severity value="CRITICAL"/> + <testCaseId value=""/> + <group value="checkoutAgreements"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <magentoCLI command="config:set checkout/options/enable_agreements 1" stepKey="setEnableTermsOnCheckout"/> + <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin" /> + <createData entity="SimpleTwo" stepKey="createdProduct"/> + </before> + <after> + <magentoCLI command="config:set checkout/options/enable_agreements 0" stepKey="setDisableTermsOnCheckout"/> + <deleteData createDataKey="createdProduct" stepKey="deletedProduct"/> + <actionGroup ref="DeleteTerm" stepKey="deleteTerm"> + <argument name="term" value="disabledTextTerm"/> + </actionGroup> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <actionGroup ref="CreateNewTerm" stepKey="createTerm"> + <argument name="term" value="disabledTextTerm"/> + </actionGroup> + <actionGroup ref="AdminAssertTermInGrid" stepKey="assertTermInGrid"> + <argument name="termName" value="{{disabledTextTerm.name}}"/> + </actionGroup> + <actionGroup ref="StorefrontAssertTermAbsentInCheckout" stepKey="assertTermInCheckout"> + <argument name="termCheckboxText" value="{{disabledTextTerm.checkboxText}}"/> + <argument name="product" value="$$createdProduct$$"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateEnabledTextTermOnMultishippingEntityTest.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateEnabledTextTermOnMultishippingEntityTest.xml new file mode 100644 index 0000000000000..64b9ce7de2052 --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateEnabledTextTermOnMultishippingEntityTest.xml @@ -0,0 +1,52 @@ +<?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="AdminCreateEnabledTextTermOnMultishippingEntityTest"> + <annotations> + <features value="CheckoutAgreements"/> + <stories value="Checkout agreements"/> + <title value="Create enabled text checkout multishipping agreement"/> + <description value="Admin should be able to create enabled text checkout multishipping agreement"/> + <severity value="CRITICAL"/> + <testCaseId value=""/> + <group value="checkoutAgreements"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <magentoCLI command="config:set checkout/options/enable_agreements 1" stepKey="setEnableTermsOnCheckout"/> + <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin" /> + <createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="createdCustomer"/> + <createData entity="SimpleTwo" stepKey="createdProduct1"/> + <createData entity="SimpleTwo" stepKey="createdProduct2"/> + </before> + <after> + <magentoCLI command="config:set checkout/options/enable_agreements 0" stepKey="setDisableTermsOnCheckout"/> + <deleteData createDataKey="createdCustomer" stepKey="deletedCustomer"/> + <deleteData createDataKey="createdProduct1" stepKey="deletedProduct1"/> + <deleteData createDataKey="createdProduct2" stepKey="deletedProduct2"/> + <actionGroup ref="DeleteTerm" stepKey="deleteTerm"> + <argument name="term" value="activeTextTerm"/> + </actionGroup> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <actionGroup ref="CreateNewTerm" stepKey="createTerm"> + <argument name="term" value="activeTextTerm"/> + </actionGroup> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLogin"> + <argument name="Customer" value="$$createdCustomer$$" /> + </actionGroup> + <actionGroup ref="StorefrontAssertTermRequireMessageInMultishippingCheckout" stepKey="assertTermInCheckout"> + <argument name="termCheckboxText" value="{{activeTextTerm.checkboxText}}"/> + <argument name="product1" value="$$createdProduct1$$"/> + <argument name="product2" value="$$createdProduct2$$"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Page/MultishippingCheckoutAddressesPage.xml b/app/code/Magento/Multishipping/Test/Mftf/Page/MultishippingCheckoutAddressesPage.xml new file mode 100644 index 0000000000000..08ff948b200a7 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/Page/MultishippingCheckoutAddressesPage.xml @@ -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="MultishippingCheckoutAddressesPage" url="/multishipping/checkout/addresses" module="Magento_Multishipping" area="storefront"> + <section name="StorefrontMultishippingCheckoutAddressesToolbarSection"/> + </page> +</pages> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Page/MultishippingCheckoutBillingPage.xml b/app/code/Magento/Multishipping/Test/Mftf/Page/MultishippingCheckoutBillingPage.xml new file mode 100644 index 0000000000000..6e1fbaed2d29a --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/Page/MultishippingCheckoutBillingPage.xml @@ -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="MultishippingCheckoutBillingPage" url="/multishipping/checkout/billing" module="Magento_Multishipping" area="storefront"> + <section name="StorefrontMultishippingCheckoutBillingToolbarSection"/> + </page> +</pages> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Page/MultishippingCheckoutOverviewPage.xml b/app/code/Magento/Multishipping/Test/Mftf/Page/MultishippingCheckoutOverviewPage.xml new file mode 100644 index 0000000000000..2f56f70f96e02 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/Page/MultishippingCheckoutOverviewPage.xml @@ -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="MultishippingCheckoutOverviewPage" url="/multishipping/checkout/overview" module="Magento_Multishipping" area="storefront"> + <section name="StorefrontMultishippingCheckoutOverviewReviewSection"/> + </page> +</pages> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Page/MultishippingCheckoutShippingPage.xml b/app/code/Magento/Multishipping/Test/Mftf/Page/MultishippingCheckoutShippingPage.xml new file mode 100644 index 0000000000000..a3d54a9ed90a7 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/Page/MultishippingCheckoutShippingPage.xml @@ -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="MultishippingCheckoutShippingPage" url="/multishipping/checkout/shipping" module="Magento_Multishipping" area="storefront"> + <section name="StorefrontMultishippingCheckoutShippingToolbarSection"/> + </page> +</pages> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Section/StorefrontMultishippingCheckoutAddressesToolbarSection.xml b/app/code/Magento/Multishipping/Test/Mftf/Section/StorefrontMultishippingCheckoutAddressesToolbarSection.xml new file mode 100644 index 0000000000000..f238afe672156 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/Section/StorefrontMultishippingCheckoutAddressesToolbarSection.xml @@ -0,0 +1,14 @@ +<?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="StorefrontMultishippingCheckoutAddressesToolbarSection"> + <element name="goToShippingInformation" type="button" selector="button.action.primary.continue"/> + </section> +</sections> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Section/StorefrontMultishippingCheckoutBillingToolbarSection.xml b/app/code/Magento/Multishipping/Test/Mftf/Section/StorefrontMultishippingCheckoutBillingToolbarSection.xml new file mode 100644 index 0000000000000..6cfc09c1653fd --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/Section/StorefrontMultishippingCheckoutBillingToolbarSection.xml @@ -0,0 +1,14 @@ +<?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="StorefrontMultishippingCheckoutBillingToolbarSection"> + <element name="goToReviewOrder" type="button" selector="button.action.primary.continue"/> + </section> +</sections> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Section/StorefrontMultishippingCheckoutOverviewReviewSection.xml b/app/code/Magento/Multishipping/Test/Mftf/Section/StorefrontMultishippingCheckoutOverviewReviewSection.xml new file mode 100644 index 0000000000000..3c4de2990f9a5 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/Section/StorefrontMultishippingCheckoutOverviewReviewSection.xml @@ -0,0 +1,14 @@ +<?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="StorefrontMultishippingCheckoutOverviewReviewSection"> + <element name="placeOrder" type="button" selector="button.action.primary.submit"/> + </section> +</sections> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Section/StorefrontMultishippingCheckoutShippingToolbarSection.xml b/app/code/Magento/Multishipping/Test/Mftf/Section/StorefrontMultishippingCheckoutShippingToolbarSection.xml new file mode 100644 index 0000000000000..deea09acf2f2a --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/Section/StorefrontMultishippingCheckoutShippingToolbarSection.xml @@ -0,0 +1,14 @@ +<?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="StorefrontMultishippingCheckoutShippingToolbarSection"> + <element name="continueToBilling" type="button" selector="button.action.primary.continue"/> + </section> +</sections> From 7de9c303893073d30856e4ff4935765cb27810cb Mon Sep 17 00:00:00 2001 From: mmularski <mmularczyk9@gmail.com> Date: Tue, 26 Nov 2019 08:02:45 +0100 Subject: [PATCH 097/586] Issue-628. Convert CreateTermEntityTest to MFTF - CR fixes --- .../AdminAssertTermInGridActionGroup.xml | 2 +- .../ActionGroup/CreateNewTermActionGroup.xml | 4 +- .../ActionGroup/DeleteTermActionGroup.xml | 8 ++-- ...tAssertTermAbsentInCheckoutActionGroup.xml | 41 ++---------------- ...refrontAssertTermInCheckoutActionGroup.xml | 42 ++----------------- ...sageInMultishippingCheckoutActionGroup.xml | 34 +++------------ ...ontProcessCheckoutToPaymentActionGroup.xml | 35 ++++++++++++++++ .../Mftf/Section/AdminNewTermFormSection.xml | 1 - .../Mftf/Section/AdminTermGridSection.xml | 4 +- .../AdminCreateActiveHtmlTermEntityTest.xml | 13 +++--- .../AdminCreateActiveTextTermEntityTest.xml | 13 +++--- .../AdminCreateDisabledTextTermEntityTest.xml | 13 +++--- ...abledTextTermOnMultishippingEntityTest.xml | 14 ++++--- 13 files changed, 88 insertions(+), 136 deletions(-) create mode 100644 app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/StorefrontProcessCheckoutToPaymentActionGroup.xml diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AdminAssertTermInGridActionGroup.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AdminAssertTermInGridActionGroup.xml index 965d8d2e01064..9a855c6f8b5e9 100644 --- a/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AdminAssertTermInGridActionGroup.xml +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AdminAssertTermInGridActionGroup.xml @@ -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="AdminAssertTermInGrid"> + <actionGroup name="AdminAssertTermInGridActionGroup"> <arguments> <argument name="termName" type="string"/> </arguments> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/CreateNewTermActionGroup.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/CreateNewTermActionGroup.xml index 4923589ee9cf4..d420cc155a77c 100644 --- a/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/CreateNewTermActionGroup.xml +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/CreateNewTermActionGroup.xml @@ -8,12 +8,12 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="CreateNewTerm"> + <actionGroup name="CreateNewTermActionGroup"> <arguments> <argument name="term"/> </arguments> <amOnPage url="{{AdminNewTermPage.url}}" stepKey="amOnNewTermPage"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> + <waitForPageLoad stepKey="waitForAdminNewTermPageLoad"/> <fillField selector="{{AdminNewTermFormSection.conditionName}}" userInput="{{term.name}}" stepKey="fillFieldConditionName"/> <selectOption selector="{{AdminNewTermFormSection.isActive}}" userInput="{{term.isActive}}" stepKey="selectOptionIsActive"/> <selectOption selector="{{AdminNewTermFormSection.isHtml}}" userInput="{{term.isHtml}}" stepKey="selectOptionIsHtml"/> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/DeleteTermActionGroup.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/DeleteTermActionGroup.xml index 7ed4d55f29f2d..b88101ce88ef6 100644 --- a/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/DeleteTermActionGroup.xml +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/DeleteTermActionGroup.xml @@ -8,19 +8,19 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="DeleteTerm"> + <actionGroup name="DeleteTermActionGroup"> <arguments> <argument name="term" /> </arguments> <amOnPage url="{{AdminTermsPage.url}}" stepKey="onTermGridPage"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> + <waitForPageLoad stepKey="waitForAdminTermsGridPageLoad"/> <fillField selector="{{AdminTermGridSection.filterByTermName}}" userInput="{{term.name}}" stepKey="fillTermNameFilter"/> <click selector="{{AdminTermGridSection.searchButton}}" stepKey="clickSearchButton"/> <click selector="{{AdminTermGridSection.firstRowConditionId}}" stepKey="clickFirstRow"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> + <waitForPageLoad stepKey="waitForEditTermPageLoad"/> <click selector="{{AdminEditTermFormSection.delete}}" stepKey="clickDeleteButton"/> <click selector="{{AdminEditTermFormSection.acceptPopupButton}}" stepKey="clickDeleteOkButton"/> - <waitForPageLoad stepKey="waitForPageLoad3"/> + <waitForPageLoad stepKey="waitForAdminTermsGridPageLoad2"/> <see selector="{{AdminTermFormMessagesSection.successMessage}}" userInput="You deleted the condition." stepKey="seeSuccessMessage"/> </actionGroup> </actionGroups> \ No newline at end of file diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/StorefrontAssertTermAbsentInCheckoutActionGroup.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/StorefrontAssertTermAbsentInCheckoutActionGroup.xml index ca2f1b0db59fe..7be17d8ca69d0 100644 --- a/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/StorefrontAssertTermAbsentInCheckoutActionGroup.xml +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/StorefrontAssertTermAbsentInCheckoutActionGroup.xml @@ -8,51 +8,16 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="StorefrontAssertTermAbsentInCheckout"> + <actionGroup name="StorefrontAssertTermAbsentInCheckoutActionGroup"> <arguments> <argument name="termCheckboxText" type="string"/> - <argument name="product" defaultValue="SimpleTwo"/> </arguments> - - <!--Add product to cart--> - <amOnPage url="{{StorefrontProductPage.url(product.custom_attributes[url_key])}}" stepKey="goToProductPage"/> - <waitForPageLoad stepKey="waitForProductPage"/> - <click selector="{{StorefrontProductPageSection.addToCartBtn}}" stepKey="addToCart"/> - <waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdding}}" stepKey="waitForElementNotVisibleAddToCartButtonTitleIsAdding"/> - <waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdded}}" stepKey="waitForElementNotVisibleAddToCartButtonTitleIsAdded"/> - <waitForElementVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAddToCart}}" stepKey="waitForElementVisibleAddToCartButtonTitleIsAddToCart"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" time="30" stepKey="waitForProductAddedMessage"/> - <see selector="{{StorefrontMessagesSection.success}}" userInput="You added {{product.name}} to your shopping cart." stepKey="seeAddToCartSuccessMessage"/> - - <!--Go to Checkout--> - <waitForElementNotVisible selector="{{StorefrontMinicartSection.emptyCart}}" stepKey="waitUpdateQuantity"/> - <wait time="5" stepKey="waitMinicartRendering"/> - <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickCart"/> - <click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="goToCheckout"/> - - <!--Process steps--> - <fillField selector="{{CheckoutShippingSection.email}}" userInput="{{CustomerEntityOne.email}}" stepKey="enterEmail"/> - <fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{CustomerEntityOne.firstname}}" stepKey="enterFirstName"/> - <fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{CustomerEntityOne.lastname}}" stepKey="enterLastName"/> - <fillField selector="{{CheckoutShippingSection.street}}" userInput="{{CustomerAddressSimple.street[0]}}" stepKey="enterStreet"/> - <fillField selector="{{CheckoutShippingSection.city}}" userInput="{{CustomerAddressSimple.city}}" stepKey="enterCity"/> - <selectOption selector="{{CheckoutShippingSection.region}}" userInput="{{CustomerAddressSimple.state}}" stepKey="selectRegion"/> - <fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{CustomerAddressSimple.postcode}}" stepKey="enterPostcode"/> - <fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{CustomerAddressSimple.telephone}}" stepKey="enterTelephone"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask1"/> - <click selector="{{CheckoutShippingMethodsSection.checkShippingMethodByName('')}}" stepKey="selectShippingMethod"/> - <waitForElement selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/> - <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/> - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> - <seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/> - <!--Check if agreement is absent on checkout--> <dontSee selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementButton}}" userInput="{{termCheckboxText}}" stepKey="seeTermInCheckout"/> <!--Checkout select Check/Money Order payment--> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask2"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> + <waitForLoadingMaskToDisappear stepKey="waitForPaymentPageRendering"/> + <waitForPageLoad stepKey="waitForPaymentRendering"/> <conditionalClick selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('Check / Money order')}}" dependentSelector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('Check / Money order')}}" visible="true" stepKey="selectCheckmoPaymentMethod"/> <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskAfterPaymentMethodSelection"/> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/StorefrontAssertTermInCheckoutActionGroup.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/StorefrontAssertTermInCheckoutActionGroup.xml index fb2825de1a7ad..0cf745ce4e04f 100644 --- a/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/StorefrontAssertTermInCheckoutActionGroup.xml +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/StorefrontAssertTermInCheckoutActionGroup.xml @@ -8,53 +8,17 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="StorefrontAssertTermInCheckout"> + <actionGroup name="StorefrontAssertTermInCheckoutActionGroup"> <arguments> <argument name="termCheckboxText" type="string"/> - <argument name="product" defaultValue="SimpleTwo"/> </arguments> - - <!--Add product to cart--> - <amOnPage url="{{StorefrontProductPage.url(product.custom_attributes[url_key])}}" stepKey="goToProductPage"/> - <waitForPageLoad stepKey="waitForProductPage"/> - <click selector="{{StorefrontProductPageSection.addToCartBtn}}" stepKey="addToCart"/> - <waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdding}}" stepKey="waitForElementNotVisibleAddToCartButtonTitleIsAdding"/> - <waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdded}}" stepKey="waitForElementNotVisibleAddToCartButtonTitleIsAdded"/> - <waitForElementVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAddToCart}}" stepKey="waitForElementVisibleAddToCartButtonTitleIsAddToCart"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" time="30" stepKey="waitForProductAddedMessage"/> - <see selector="{{StorefrontMessagesSection.success}}" userInput="You added {{product.name}} to your shopping cart." stepKey="seeAddToCartSuccessMessage"/> - - <!--Go to Checkout--> - <waitForElementNotVisible selector="{{StorefrontMinicartSection.emptyCart}}" stepKey="waitUpdateQuantity"/> - <wait time="5" stepKey="waitMinicartRendering"/> - <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickCart"/> - <click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="goToCheckout"/> - - <!--Process steps--> - <fillField selector="{{CheckoutShippingSection.email}}" userInput="{{CustomerEntityOne.email}}" stepKey="enterEmail"/> - <fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{CustomerEntityOne.firstname}}" stepKey="enterFirstName"/> - <fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{CustomerEntityOne.lastname}}" stepKey="enterLastName"/> - <fillField selector="{{CheckoutShippingSection.street}}" userInput="{{CustomerAddressSimple.street[0]}}" stepKey="enterStreet"/> - <fillField selector="{{CheckoutShippingSection.city}}" userInput="{{CustomerAddressSimple.city}}" stepKey="enterCity"/> - <selectOption selector="{{CheckoutShippingSection.region}}" userInput="{{CustomerAddressSimple.state}}" stepKey="selectRegion"/> - <fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{CustomerAddressSimple.postcode}}" stepKey="enterPostcode"/> - <fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{CustomerAddressSimple.telephone}}" stepKey="enterTelephone"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask1"/> - <click selector="{{CheckoutShippingMethodsSection.checkShippingMethodByName('')}}" stepKey="selectShippingMethod"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask2"/> - <waitForElement selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/> - <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/> - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> - <seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/> - <!--Check if agreement is present on checkout and select it--> <see selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementButton}}" userInput="{{termCheckboxText}}" stepKey="seeTermInCheckout"/> <selectOption selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementCheckbox}}" userInput="{{termCheckboxText}}" stepKey="checkAgreement"/> <!--Checkout select Check/Money Order payment--> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask3"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> + <waitForLoadingMaskToDisappear stepKey="waitForPaymentPageRendering"/> + <waitForPageLoad stepKey="waitForPaymentRendering"/> <conditionalClick selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('Check / Money order')}}" dependentSelector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('Check / Money order')}}" visible="true" stepKey="selectCheckmoPaymentMethod"/> <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskAfterPaymentMethodSelection"/> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/StorefrontAssertTermRequireMessageInMultishippingCheckoutActionGroup.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/StorefrontAssertTermRequireMessageInMultishippingCheckoutActionGroup.xml index 00637c6b22585..35ac4826ccfef 100644 --- a/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/StorefrontAssertTermRequireMessageInMultishippingCheckoutActionGroup.xml +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/StorefrontAssertTermRequireMessageInMultishippingCheckoutActionGroup.xml @@ -8,47 +8,23 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="StorefrontAssertTermRequireMessageInMultishippingCheckout"> + <actionGroup name="StorefrontAssertTermRequireMessageInMultishippingCheckoutActionGroup"> <arguments> <argument name="termCheckboxText" type="string"/> - <argument name="product1" defaultValue="SimpleTwo"/> - <argument name="product2" defaultValue="SimpleTwo"/> </arguments> - <!--Add product1 to cart--> - <amOnPage url="{{StorefrontProductPage.url(product1.custom_attributes[url_key])}}" stepKey="goToProduct1Page"/> - <waitForPageLoad stepKey="waitForProduct1Page"/> - <click selector="{{StorefrontProductPageSection.addToCartBtn}}" stepKey="addToCart1"/> - <waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdding}}" stepKey="waitForElementNotVisibleAddToCartButton1TitleIsAdding"/> - <waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdded}}" stepKey="waitForElementNotVisibleAddToCartButton1TitleIsAdded"/> - <waitForElementVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAddToCart}}" stepKey="waitForElementVisibleAddToCartButton1TitleIsAddToCart"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" time="30" stepKey="waitForProduct1AddedMessage"/> - <see selector="{{StorefrontMessagesSection.success}}" userInput="You added {{product1.name}} to your shopping cart." stepKey="seeAddToCart1SuccessMessage"/> - - <!--Add product2 to cart--> - <amOnPage url="{{StorefrontProductPage.url(product2.custom_attributes[url_key])}}" stepKey="goToProduct2Page"/> - <waitForPageLoad stepKey="waitForProduct2Page"/> - <click selector="{{StorefrontProductPageSection.addToCartBtn}}" stepKey="addToCart2"/> - <waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdding}}" stepKey="waitForElementNotVisibleAddToCartButton2TitleIsAdding"/> - <waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdded}}" stepKey="waitForElementNotVisibleAddToCartButton2TitleIsAdded"/> - <waitForElementVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAddToCart}}" stepKey="waitForElementVisibleAddToCartButton2TitleIsAddToCart"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" time="30" stepKey="waitForProduct2AddedMessage"/> - <see selector="{{StorefrontMessagesSection.success}}" userInput="You added {{product2.name}} to your shopping cart." stepKey="seeAddToCart2SuccessMessage"/> - <!--Go to Checkout Cart and proceed with multiple addresses--> <amOnPage url="{{CheckoutCartPage.url}}" stepKey="goToCheckoutCart"/> - <waitForPageLoad stepKey="waitForPageLoad3"/> + <waitForPageLoad stepKey="waitForCheckoutPageLoad"/> <click selector="{{MultishippingSection.checkoutWithMultipleAddresses}}" stepKey="proceedMultishipping"/> <!--Procees do overview page--> <click selector="{{StorefrontMultishippingCheckoutAddressesToolbarSection.goToShippingInformation}}" stepKey="clickGoToShippingInformation"/> - <waitForPageLoad stepKey="waitForPageLoad4"/> + <waitForPageLoad stepKey="waitForCheckoutAddressToolbarPageLoad"/> <click selector="{{StorefrontMultishippingCheckoutShippingToolbarSection.continueToBilling}}" stepKey="clickContinueToBilling"/> - <waitForPageLoad stepKey="waitForPageLoad5"/> + <waitForPageLoad stepKey="waitForCheckoutShippingToolbarPageLoad"/> <click selector="{{StorefrontMultishippingCheckoutBillingToolbarSection.goToReviewOrder}}" stepKey="clickGoToReviewOrder"/> - <waitForPageLoad stepKey="waitForPageLoad6"/> + <waitForPageLoad stepKey="waitForCheckoutBillingToolbarPageLoad"/> <!--Check if agreement is present on checkout and select it--> <scrollTo selector="{{StorefrontMultishippingCheckoutOverviewReviewSection.placeOrder}}" stepKey="scrollToButtonPlaceOrder"/> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/StorefrontProcessCheckoutToPaymentActionGroup.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/StorefrontProcessCheckoutToPaymentActionGroup.xml new file mode 100644 index 0000000000000..c40f24836c815 --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/StorefrontProcessCheckoutToPaymentActionGroup.xml @@ -0,0 +1,35 @@ +<?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="StorefrontProcessCheckoutToPaymentActionGroup"> + <!--Go to Checkout--> + <waitForElementNotVisible selector="{{StorefrontMinicartSection.emptyCart}}" stepKey="waitUpdateQuantity"/> + <wait time="5" stepKey="waitMinicartRendering"/> + <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickCart"/> + <click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="goToCheckout"/> + + <!--Process steps--> + <fillField selector="{{CheckoutShippingSection.email}}" userInput="{{CustomerEntityOne.email}}" stepKey="enterEmail"/> + <fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{CustomerEntityOne.firstname}}" stepKey="enterFirstName"/> + <fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{CustomerEntityOne.lastname}}" stepKey="enterLastName"/> + <fillField selector="{{CheckoutShippingSection.street}}" userInput="{{CustomerAddressSimple.street[0]}}" stepKey="enterStreet"/> + <fillField selector="{{CheckoutShippingSection.city}}" userInput="{{CustomerAddressSimple.city}}" stepKey="enterCity"/> + <selectOption selector="{{CheckoutShippingSection.region}}" userInput="{{CustomerAddressSimple.state}}" stepKey="selectRegion"/> + <fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{CustomerAddressSimple.postcode}}" stepKey="enterPostcode"/> + <fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{CustomerAddressSimple.telephone}}" stepKey="enterTelephone"/> + <waitForLoadingMaskToDisappear stepKey="waitForShippingMethods"/> + <click selector="{{CheckoutShippingMethodsSection.checkShippingMethodByName('')}}" stepKey="selectShippingMethod"/> + <waitForElement selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForTheNextButton"/> + <waitForElementNotVisible selector=".loading-mask" time="300" stepKey="waitForProcessShippingMethod"/> + <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/> + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> + <seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Section/AdminNewTermFormSection.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Section/AdminNewTermFormSection.xml index 3f8a12f526c01..aeff29ef116fc 100644 --- a/app/code/Magento/CheckoutAgreements/Test/Mftf/Section/AdminNewTermFormSection.xml +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Section/AdminNewTermFormSection.xml @@ -10,7 +10,6 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminNewTermFormSection"> <element name="save" type="button" selector=".page-main-actions #save"/> - <element name="conditionName" type="input" selector="#name"/> <element name="isActive" type="select" selector="#is_active"/> <element name="isHtml" type="select" selector="#is_html"/> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Section/AdminTermGridSection.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Section/AdminTermGridSection.xml index 65211c78ec00a..326f9dcce4320 100644 --- a/app/code/Magento/CheckoutAgreements/Test/Mftf/Section/AdminTermGridSection.xml +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Section/AdminTermGridSection.xml @@ -8,8 +8,8 @@ <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminTermGridSection"> - <element name="searchButton" type="button" selector=".admin__data-grid-header button[title=Search]"/> - <element name="resetButton" type="button" selector="button[title='Reset Filter']"/> + <element name="searchButton" type="button" selector="//div[contains(@class,'admin__data-grid-header')]//div[contains(@class,'admin__filter-actions')]/button[1]"/> + <element name="resetButton" type="button" selector="//div[contains(@class,'admin__data-grid-header')]//div[contains(@class,'admin__filter-actions')]/button[2]"/> <element name="filterByTermName" type="input" selector="#agreementGrid_filter_name"/> <element name="firstRowConditionName" type="text" selector=".data-grid>tbody>tr>td.col-name"/> <element name="firstRowConditionId" type="text" selector=".data-grid>tbody>tr>td.col-id.col-agreement_id"/> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveHtmlTermEntityTest.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveHtmlTermEntityTest.xml index 481c6683d1add..ed9f5959be9d4 100644 --- a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveHtmlTermEntityTest.xml +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveHtmlTermEntityTest.xml @@ -27,21 +27,24 @@ <after> <magentoCLI command="config:set checkout/options/enable_agreements 0" stepKey="setDisableTermsOnCheckout"/> <deleteData createDataKey="createdProduct" stepKey="deletedProduct"/> - <actionGroup ref="DeleteTerm" stepKey="deleteTerm"> + <actionGroup ref="DeleteTermActionGroup" stepKey="deleteTerm"> <argument name="term" value="activeHtmlTerm"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> </after> - <actionGroup ref="CreateNewTerm" stepKey="createTerm"> + <actionGroup ref="CreateNewTermActionGroup" stepKey="createTerm"> <argument name="term" value="activeHtmlTerm"/> </actionGroup> - <actionGroup ref="AdminAssertTermInGrid" stepKey="assertTermInGrid"> + <actionGroup ref="AdminAssertTermInGridActionGroup" stepKey="assertTermInGrid"> <argument name="termName" value="{{activeHtmlTerm.name}}"/> </actionGroup> - <actionGroup ref="StorefrontAssertTermInCheckout" stepKey="assertTermInCheckout"> - <argument name="termCheckboxText" value="{{activeHtmlTerm.checkboxText}}"/> + <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToTheCart"> <argument name="product" value="$$createdProduct$$"/> </actionGroup> + <actionGroup ref="StorefrontProcessCheckoutToPaymentActionGroup" stepKey="processCheckoutToThePaymentMethodsPage"/> + <actionGroup ref="StorefrontAssertTermInCheckoutActionGroup" stepKey="assertTermInCheckout"> + <argument name="termCheckboxText" value="{{activeHtmlTerm.checkboxText}}"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveTextTermEntityTest.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveTextTermEntityTest.xml index 3fc623de04f8f..2a95c44a6d4eb 100644 --- a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveTextTermEntityTest.xml +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveTextTermEntityTest.xml @@ -27,21 +27,24 @@ <after> <magentoCLI command="config:set checkout/options/enable_agreements 0" stepKey="setDisableTermsOnCheckout"/> <deleteData createDataKey="createdProduct" stepKey="deletedProduct"/> - <actionGroup ref="DeleteTerm" stepKey="deleteTerm"> + <actionGroup ref="DeleteTermActionGroup" stepKey="deleteTerm"> <argument name="term" value="activeTextTerm"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> </after> - <actionGroup ref="CreateNewTerm" stepKey="createTerm"> + <actionGroup ref="CreateNewTermActionGroup" stepKey="createTerm"> <argument name="term" value="activeTextTerm"/> </actionGroup> - <actionGroup ref="AdminAssertTermInGrid" stepKey="assertTermInGrid"> + <actionGroup ref="AdminAssertTermInGridActionGroup" stepKey="assertTermInGrid"> <argument name="termName" value="{{activeTextTerm.name}}"/> </actionGroup> - <actionGroup ref="StorefrontAssertTermInCheckout" stepKey="assertTermInCheckout"> - <argument name="termCheckboxText" value="{{activeTextTerm.checkboxText}}"/> + <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToTheCart"> <argument name="product" value="$$createdProduct$$"/> </actionGroup> + <actionGroup ref="StorefrontProcessCheckoutToPaymentActionGroup" stepKey="processCheckoutToThePaymentMethodsPage"/> + <actionGroup ref="StorefrontAssertTermInCheckoutActionGroup" stepKey="assertTermInCheckout"> + <argument name="termCheckboxText" value="{{activeTextTerm.checkboxText}}"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateDisabledTextTermEntityTest.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateDisabledTextTermEntityTest.xml index d28acdcd3d4eb..d279d38f854d1 100644 --- a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateDisabledTextTermEntityTest.xml +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateDisabledTextTermEntityTest.xml @@ -27,21 +27,24 @@ <after> <magentoCLI command="config:set checkout/options/enable_agreements 0" stepKey="setDisableTermsOnCheckout"/> <deleteData createDataKey="createdProduct" stepKey="deletedProduct"/> - <actionGroup ref="DeleteTerm" stepKey="deleteTerm"> + <actionGroup ref="DeleteTermActionGroup" stepKey="deleteTerm"> <argument name="term" value="disabledTextTerm"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> </after> - <actionGroup ref="CreateNewTerm" stepKey="createTerm"> + <actionGroup ref="CreateNewTermActionGroup" stepKey="createTerm"> <argument name="term" value="disabledTextTerm"/> </actionGroup> - <actionGroup ref="AdminAssertTermInGrid" stepKey="assertTermInGrid"> + <actionGroup ref="AdminAssertTermInGridActionGroup" stepKey="assertTermInGrid"> <argument name="termName" value="{{disabledTextTerm.name}}"/> </actionGroup> - <actionGroup ref="StorefrontAssertTermAbsentInCheckout" stepKey="assertTermInCheckout"> - <argument name="termCheckboxText" value="{{disabledTextTerm.checkboxText}}"/> + <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToTheCart"> <argument name="product" value="$$createdProduct$$"/> </actionGroup> + <actionGroup ref="StorefrontProcessCheckoutToPaymentActionGroup" stepKey="processCheckoutToThePaymentMethodsPage"/> + <actionGroup ref="StorefrontAssertTermAbsentInCheckoutActionGroup" stepKey="assertTermAbsentInCheckout"> + <argument name="termCheckboxText" value="{{disabledTextTerm.checkboxText}}"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateEnabledTextTermOnMultishippingEntityTest.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateEnabledTextTermOnMultishippingEntityTest.xml index 64b9ce7de2052..e579d2653b44d 100644 --- a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateEnabledTextTermOnMultishippingEntityTest.xml +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateEnabledTextTermOnMultishippingEntityTest.xml @@ -31,22 +31,26 @@ <deleteData createDataKey="createdCustomer" stepKey="deletedCustomer"/> <deleteData createDataKey="createdProduct1" stepKey="deletedProduct1"/> <deleteData createDataKey="createdProduct2" stepKey="deletedProduct2"/> - <actionGroup ref="DeleteTerm" stepKey="deleteTerm"> + <actionGroup ref="DeleteTermActionGroup" stepKey="deleteTerm"> <argument name="term" value="activeTextTerm"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> </after> - <actionGroup ref="CreateNewTerm" stepKey="createTerm"> + <actionGroup ref="CreateNewTermActionGroup" stepKey="createTerm"> <argument name="term" value="activeTextTerm"/> </actionGroup> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLogin"> <argument name="Customer" value="$$createdCustomer$$" /> </actionGroup> - <actionGroup ref="StorefrontAssertTermRequireMessageInMultishippingCheckout" stepKey="assertTermInCheckout"> + <actionGroup ref="AddSimpleProductToCart" stepKey="addProduct1ToTheCart"> + <argument name="product" value="$$createdProduct1$$"/> + </actionGroup> + <actionGroup ref="AddSimpleProductToCart" stepKey="addProduct2ToTheCart"> + <argument name="product" value="$$createdProduct2$$"/> + </actionGroup> + <actionGroup ref="StorefrontAssertTermRequireMessageInMultishippingCheckoutActionGroup" stepKey="assertTermInCheckout"> <argument name="termCheckboxText" value="{{activeTextTerm.checkboxText}}"/> - <argument name="product1" value="$$createdProduct1$$"/> - <argument name="product2" value="$$createdProduct2$$"/> </actionGroup> </test> </tests> From 841bb75dfbb59a8971b0897b55a234923a2c30e5 Mon Sep 17 00:00:00 2001 From: ashna-jahan <ashna@jivainfotech.com> Date: Tue, 26 Nov 2019 19:35:25 +0530 Subject: [PATCH 098/586] fixed issue 25433 --- .../web/css/source/forms/fields/_control-table.less | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less b/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less index 697d11fb57d67..821ab04d8c44c 100644 --- a/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less +++ b/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less @@ -237,3 +237,16 @@ float: right; } } + +@media only screen and (min-width: 768px) +{ + .product_form_product_form_advanced_pricing_modal .admin__fieldset > .admin__field > .admin__field-control{ + min-width: 682px; + } + + .admin__control-table-wrapper { + max-width: 100% !important; + overflow-x: visible !important; + overflow-y: visible !important; + } +} \ No newline at end of file From 6991ebae4d56490f6cd7ba06fe74dfd1cc08ae81 Mon Sep 17 00:00:00 2001 From: Dmytro Yushkin <dyushkin@adobe.com> Date: Mon, 25 Nov 2019 16:42:05 -0600 Subject: [PATCH 099/586] MC-18459: Remove Special Price From and To Date fields from the Mass Update page --- .../Helper/Product/Edit/Action/Attribute.php | 28 ++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/app/code/Magento/Catalog/Helper/Product/Edit/Action/Attribute.php b/app/code/Magento/Catalog/Helper/Product/Edit/Action/Attribute.php index 2c1bacdb99e12..09d53427a3043 100644 --- a/app/code/Magento/Catalog/Helper/Product/Edit/Action/Attribute.php +++ b/app/code/Magento/Catalog/Helper/Product/Edit/Action/Attribute.php @@ -3,15 +3,15 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); -/** - * Adminhtml catalog product action attribute update helper - */ namespace Magento\Catalog\Helper\Product\Edit\Action; /** - * Class Attribute + * Adminhtml catalog product action attribute update helper. + * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * @SuppressWarnings(PHPMD.CookieAndSessionMisuse) */ class Attribute extends \Magento\Backend\Helper\Data { @@ -32,7 +32,7 @@ class Attribute extends \Magento\Backend\Helper\Data /** * Excluded from batch update attribute codes * - * @var string[] + * @var array */ protected $_excludedAttributes = ['url_key']; @@ -92,6 +92,7 @@ public function __construct( /** * Return product collection with selected product filter + * * Product collection didn't load * * @return \Magento\Catalog\Model\ResourceModel\Product\Collection @@ -171,8 +172,8 @@ public function getAttributes() $this->getProductsSetIds() ); - if ($this->_excludedAttributes) { - $this->_attributes->addFieldToFilter('attribute_code', ['nin' => $this->_excludedAttributes]); + if ($excludedAttributes = $this->getExcludedAttributes()) { + $this->_attributes->addFieldToFilter('attribute_code', ['nin' => $excludedAttributes]); } // check product type apply to limitation and remove attributes that impossible to change in mass-update @@ -193,11 +194,24 @@ public function getAttributes() } /** + * Gets website id. + * * @param int $storeId * @return int + * @throws \Magento\Framework\Exception\NoSuchEntityException */ public function getStoreWebsiteId($storeId) { return $this->_storeManager->getStore($storeId)->getWebsiteId(); } + + /** + * Retrieve excluded attributes. + * + * @return array + */ + public function getExcludedAttributes(): array + { + return $this->_excludedAttributes; + } } From 5d175a35f9b4f91fe94abe7dceb5155cb4fc54c3 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Wed, 27 Nov 2019 11:30:10 +0700 Subject: [PATCH 100/586] Resolve Export Coupon Code Grid redirect to DashBoard when create New Cart Price Rule issue24468 --- .../Promo/Quote/ExportCouponsCsv.php | 28 +++--- .../Promo/Quote/ExportCouponsXml.php | 30 +++---- .../Promo/Quote/ExportCouponsCsvTest.php | 87 ++++++++++++++++++ .../Promo/Quote/ExportCouponsXmlTest.php | 89 +++++++++++++++++++ 4 files changed, 206 insertions(+), 28 deletions(-) create mode 100644 app/code/Magento/SalesRule/Test/Unit/Controller/Adminhtml/Promo/Quote/ExportCouponsCsvTest.php create mode 100644 app/code/Magento/SalesRule/Test/Unit/Controller/Adminhtml/Promo/Quote/ExportCouponsXmlTest.php diff --git a/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/ExportCouponsCsv.php b/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/ExportCouponsCsv.php index 0f073ab4d65ce..513251ccbfe79 100644 --- a/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/ExportCouponsCsv.php +++ b/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/ExportCouponsCsv.php @@ -4,30 +4,32 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + +declare(strict_types=1); + namespace Magento\SalesRule\Controller\Adminhtml\Promo\Quote; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Controller\ResultFactory; +use Magento\SalesRule\Controller\Adminhtml\Promo\Quote; +use Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Coupons\Grid; +use Magento\Framework\View\Result\Layout; +use Magento\Framework\App\ResponseInterface; -class ExportCouponsCsv extends \Magento\SalesRule\Controller\Adminhtml\Promo\Quote +class ExportCouponsCsv extends Quote { /** * Export coupon codes as CSV file * - * @return \Magento\Framework\App\ResponseInterface|null + * @return ResponseInterface|null */ public function execute() { $this->_initRule(); - $rule = $this->_coreRegistry->registry(\Magento\SalesRule\Model\RegistryConstants::CURRENT_SALES_RULE); - if ($rule->getId()) { - $fileName = 'coupon_codes.csv'; - $content = $this->_view->getLayout()->createBlock( - \Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Coupons\Grid::class - )->getCsvFile(); - return $this->_fileFactory->create($fileName, $content, DirectoryList::VAR_DIR); - } else { - $this->_redirect('sales_rule/*/detail', ['_current' => true]); - return; - } + $fileName = 'coupon_codes.csv'; + /** @var Layout $resultLayout */ + $resultLayout = $this->resultFactory->create(ResultFactory::TYPE_LAYOUT); + $content = $resultLayout->getLayout()->createBlock(Grid::class)->getCsvFile(); + return $this->_fileFactory->create($fileName, $content, DirectoryList::VAR_DIR); } } diff --git a/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/ExportCouponsXml.php b/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/ExportCouponsXml.php index 35d81d3a971fc..c5c61748b4729 100644 --- a/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/ExportCouponsXml.php +++ b/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/ExportCouponsXml.php @@ -4,32 +4,32 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + +declare(strict_types=1); + namespace Magento\SalesRule\Controller\Adminhtml\Promo\Quote; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Controller\ResultFactory; +use Magento\SalesRule\Controller\Adminhtml\Promo\Quote; +use Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Coupons\Grid; +use Magento\Framework\View\Result\Layout; +use Magento\Framework\App\ResponseInterface; -class ExportCouponsXml extends \Magento\SalesRule\Controller\Adminhtml\Promo\Quote +class ExportCouponsXml extends Quote { /** * Export coupon codes as excel xml file * - * @return \Magento\Framework\App\ResponseInterface|null + * @return ResponseInterface|null */ public function execute() { $this->_initRule(); - $rule = $this->_coreRegistry->registry(\Magento\SalesRule\Model\RegistryConstants::CURRENT_SALES_RULE); - if ($rule->getId()) { - $fileName = 'coupon_codes.xml'; - $content = $this->_view->getLayout()->createBlock( - \Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Coupons\Grid::class - )->getExcelFile( - $fileName - ); - return $this->_fileFactory->create($fileName, $content, DirectoryList::VAR_DIR); - } else { - $this->_redirect('sales_rule/*/detail', ['_current' => true]); - return; - } + $fileName = 'coupon_codes.xml'; + /** @var Layout $resultLayout */ + $resultLayout = $this->resultFactory->create(ResultFactory::TYPE_LAYOUT); + $content = $resultLayout->getLayout()->createBlock(Grid::class)->getExcelFile($fileName); + return $this->_fileFactory->create($fileName, $content, DirectoryList::VAR_DIR); } } diff --git a/app/code/Magento/SalesRule/Test/Unit/Controller/Adminhtml/Promo/Quote/ExportCouponsCsvTest.php b/app/code/Magento/SalesRule/Test/Unit/Controller/Adminhtml/Promo/Quote/ExportCouponsCsvTest.php new file mode 100644 index 0000000000000..f3658ab52f8bb --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Unit/Controller/Adminhtml/Promo/Quote/ExportCouponsCsvTest.php @@ -0,0 +1,87 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\SalesRule\Test\Unit\Controller\Adminhtml\Promo\Quote; + +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use Magento\SalesRule\Controller\Adminhtml\Promo\Quote\ExportCouponsCsv; +use Magento\Framework\Controller\ResultFactory; +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\App\Response\Http\FileFactory; +use Magento\Framework\View\Result\Layout; +use Magento\Framework\View\LayoutInterface; +use Magento\Framework\View\Element\AbstractBlock; +use Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Coupons\Grid; +use PHPUnit\Framework\TestCase; + +class ExportCouponsCsvTest extends TestCase +{ + /** + * @var ExportCouponsCsv + */ + private $controller; + + /** + * @var FileFactory|\PHPUnit_Framework_MockObject_MockObject + */ + private $fileFactoryMock; + + /** + * @var ObjectManagerHelper + */ + private $objectManagerHelper; + + /** + * @var ResultFactory|\PHPUnit_Framework_MockObject_MockObject + */ + private $resultFactoryMock; + + /** + * Setup environment + */ + protected function setUp() + { + $this->objectManagerHelper = new ObjectManagerHelper($this); + $this->fileFactoryMock = $this->createMock(FileFactory::class); + $this->resultFactoryMock = $this->createMock(ResultFactory::class); + + $this->controller = $this->objectManagerHelper->getObject( + ExportCouponsCsv::class, + [ + 'fileFactory' => $this->fileFactoryMock, + 'resultFactory' => $this->resultFactoryMock + ] + ); + } + + /** + * Test execute function + */ + public function testExecute() + { + $fileName = 'coupon_codes.csv'; + + $resultLayoutMock = $this->createMock(Layout::class); + $layoutMock = $this->createMock(LayoutInterface::class); + $contentMock = $this->createPartialMock(AbstractBlock::class, ['getCsvFile']); + $this->resultFactoryMock + ->expects($this->once()) + ->method('create') + ->with(ResultFactory::TYPE_LAYOUT)->willReturn($resultLayoutMock); + $resultLayoutMock->expects($this->once())->method('getLayout')->willReturn($layoutMock); + $layoutMock->expects($this->once())->method('createBlock')->with(Grid::class) + ->willReturn($contentMock); + $contentMock->expects($this->once())->method('getCsvFile')->willReturn('csvFile'); + $this->fileFactoryMock + ->expects($this->once()) + ->method('create') + ->with($fileName, 'csvFile', DirectoryList::VAR_DIR); + + $this->controller->execute(); + } +} diff --git a/app/code/Magento/SalesRule/Test/Unit/Controller/Adminhtml/Promo/Quote/ExportCouponsXmlTest.php b/app/code/Magento/SalesRule/Test/Unit/Controller/Adminhtml/Promo/Quote/ExportCouponsXmlTest.php new file mode 100644 index 0000000000000..83ad95171033f --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Unit/Controller/Adminhtml/Promo/Quote/ExportCouponsXmlTest.php @@ -0,0 +1,89 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\SalesRule\Test\Unit\Controller\Adminhtml\Promo\Quote; + +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use Magento\SalesRule\Controller\Adminhtml\Promo\Quote\ExportCouponsXml; +use Magento\Framework\Controller\ResultFactory; +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\App\Response\Http\FileFactory; +use Magento\Framework\View\Result\Layout; +use Magento\Framework\View\LayoutInterface; +use Magento\Framework\View\Element\AbstractBlock; +use Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Coupons\Grid; +use PHPUnit\Framework\TestCase; + +class ExportCouponsXmlTest extends TestCase +{ + /** + * @var ExportCouponsXml + */ + private $controller; + + /** + * @var FileFactory|\PHPUnit_Framework_MockObject_MockObject + */ + private $fileFactoryMock; + + /** + * @var ObjectManagerHelper + */ + private $objectManagerHelper; + + /** + * @var ResultFactory|\PHPUnit_Framework_MockObject_MockObject + */ + private $resultFactoryMock; + + /** + * Setup environment + */ + protected function setUp() + { + $this->objectManagerHelper = new ObjectManagerHelper($this); + $this->fileFactoryMock = $this->createMock(FileFactory::class); + $this->resultFactoryMock = $this->createMock(ResultFactory::class); + + $this->controller = $this->objectManagerHelper->getObject( + ExportCouponsXml::class, + [ + 'fileFactory' => $this->fileFactoryMock, + 'resultFactory' => $this->resultFactoryMock + ] + ); + } + + /** + * Test execute function + */ + public function testExecute() + { + $fileName = 'coupon_codes.xml'; + + $resultLayoutMock = $this->createMock(Layout::class); + $layoutMock = $this->createMock(LayoutInterface::class); + $contentMock = $this->createPartialMock(AbstractBlock::class, ['getExcelFile']); + $this->resultFactoryMock + ->expects($this->once()) + ->method('create') + ->with(ResultFactory::TYPE_LAYOUT)->willReturn($resultLayoutMock); + $resultLayoutMock->expects($this->once())->method('getLayout')->willReturn($layoutMock); + $layoutMock->expects($this->once())->method('createBlock')->with(Grid::class) + ->willReturn($contentMock); + $contentMock->expects($this->once())->method('getExcelFile') + ->with($fileName) + ->willReturn('xmlFile'); + $this->fileFactoryMock + ->expects($this->once()) + ->method('create') + ->with($fileName, 'xmlFile', DirectoryList::VAR_DIR); + + $this->controller->execute(); + } +} From e2d6d58983a8a19d020dde8b2884c489d7939aef Mon Sep 17 00:00:00 2001 From: Ashna-Jahan <32352950+Ashna-Jahan@users.noreply.github.com> Date: Wed, 27 Nov 2019 11:42:33 +0530 Subject: [PATCH 101/586] Fixed Indentation Issues. --- .../web/css/source/forms/fields/_control-table.less | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less b/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less index 821ab04d8c44c..3ebb02e11ffa9 100644 --- a/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less +++ b/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less @@ -238,15 +238,13 @@ } } -@media only screen and (min-width: 768px) -{ - .product_form_product_form_advanced_pricing_modal .admin__fieldset > .admin__field > .admin__field-control{ +@media only screen and (min-width: 768px) { + .product_form_product_form_advanced_pricing_modal .admin__fieldset > .admin__field > .admin__field-control { min-width: 682px; - } - +} .admin__control-table-wrapper { max-width: 100% !important; overflow-x: visible !important; overflow-y: visible !important; } -} \ No newline at end of file +} From 853a1e58107d7b9f95b6e0cf07df9b81fe2dabd3 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Wed, 27 Nov 2019 13:20:51 +0700 Subject: [PATCH 102/586] Fix static test --- .../Adminhtml/Promo/Quote/ExportCouponsCsv.php | 9 +++++++-- .../Adminhtml/Promo/Quote/ExportCouponsXml.php | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/ExportCouponsCsv.php b/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/ExportCouponsCsv.php index 513251ccbfe79..53459f2c3e52f 100644 --- a/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/ExportCouponsCsv.php +++ b/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/ExportCouponsCsv.php @@ -1,6 +1,5 @@ <?php /** - * * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ @@ -15,8 +14,14 @@ use Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Coupons\Grid; use Magento\Framework\View\Result\Layout; use Magento\Framework\App\ResponseInterface; +use Magento\Framework\App\Action\HttpGetActionInterface; -class ExportCouponsCsv extends Quote +/** + * Export Coupons to csv file + * + * Class \Magento\SalesRule\Controller\Adminhtml\Promo\Quote\ExportCouponsCsv + */ +class ExportCouponsCsv extends Quote implements HttpGetActionInterface { /** * Export coupon codes as CSV file diff --git a/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/ExportCouponsXml.php b/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/ExportCouponsXml.php index c5c61748b4729..fa3d4455410c4 100644 --- a/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/ExportCouponsXml.php +++ b/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/ExportCouponsXml.php @@ -1,6 +1,5 @@ <?php /** - * * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ @@ -15,8 +14,14 @@ use Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Coupons\Grid; use Magento\Framework\View\Result\Layout; use Magento\Framework\App\ResponseInterface; +use Magento\Framework\App\Action\HttpGetActionInterface; -class ExportCouponsXml extends Quote +/** + * Export coupons to xml file + * + * Class \Magento\SalesRule\Controller\Adminhtml\Promo\Quote\ExportCouponsXml + */ +class ExportCouponsXml extends Quote implements HttpGetActionInterface { /** * Export coupon codes as excel xml file From 4c0f128c7ccd8bf1642f1ab870b4380ab0821c41 Mon Sep 17 00:00:00 2001 From: Ashna-Jahan <32352950+Ashna-Jahan@users.noreply.github.com> Date: Wed, 27 Nov 2019 13:18:34 +0530 Subject: [PATCH 103/586] Fixed the issue with window resizing. --- .../css/source/forms/fields/_control-table.less | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less b/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less index 3ebb02e11ffa9..5b5f6682d027e 100644 --- a/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less +++ b/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less @@ -238,13 +238,13 @@ } } -@media only screen and (min-width: 768px) { - .product_form_product_form_advanced_pricing_modal .admin__fieldset > .admin__field > .admin__field-control { - min-width: 682px; +.product_form_product_form_advanced_pricing_modal .admin__fieldset > .admin__field > .admin__field-control { + min-width: 682px; } - .admin__control-table-wrapper { - max-width: 100% !important; - overflow-x: visible !important; - overflow-y: visible !important; - } + +.admin__control-table-wrapper { + max-width: 100% !important; + overflow-x: visible !important; + overflow-y: visible !important; } + From 2bd319ba7865fb65d57a0ffdcd4745e33b9387b0 Mon Sep 17 00:00:00 2001 From: Ashna-Jahan <32352950+Ashna-Jahan@users.noreply.github.com> Date: Wed, 27 Nov 2019 13:49:55 +0530 Subject: [PATCH 104/586] Remove the unwanted spaces. --- .../web/css/source/forms/fields/_control-table.less | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less b/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less index 5b5f6682d027e..b304ae1de4c5a 100644 --- a/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less +++ b/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less @@ -241,10 +241,10 @@ .product_form_product_form_advanced_pricing_modal .admin__fieldset > .admin__field > .admin__field-control { min-width: 682px; } - + .admin__control-table-wrapper { - max-width: 100% !important; - overflow-x: visible !important; - overflow-y: visible !important; + max-width: 100%; + overflow-x: visible; + overflow-y: visible; } From a738307bdf9ff9153deb96569f8e3363337b15d3 Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Wed, 27 Nov 2019 14:46:43 +0200 Subject: [PATCH 105/586] Refactoring Action Groups --- ...NavigateToNewRelicConfigurationActionGroup.xml | 15 +++++++++++++++ ...ToggleNewRelicReportingEnabledActionGroup.xml} | 2 +- ...nUncheckNewRelicUseSystemValueActionGroup.xml} | 2 +- ...ewRelicConfigFieldIsNotVisibleActionGroup.xml} | 2 +- ...inNewRelicConfigFieldIsVisibleActionGroup.xml} | 2 +- .../AdminChecksSystemConfigDependencyTest.xml | 10 +++++----- 6 files changed, 24 insertions(+), 9 deletions(-) create mode 100644 app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminNavigateToNewRelicConfigurationActionGroup.xml rename app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/{AdminTogglesEnabledConfigActionGroup.xml => AdminToggleNewRelicReportingEnabledActionGroup.xml} (88%) rename app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/{AdminUnchecksUseSystemValueActionGroup.xml => AdminUncheckNewRelicUseSystemValueActionGroup.xml} (86%) rename app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/{AssertAdminDoesntSeeConfigFieldActionGroup.xml => AssertAdminNewRelicConfigFieldIsNotVisibleActionGroup.xml} (86%) rename app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/{AssertAdminSeesConfigFieldActionGroup.xml => AssertAdminNewRelicConfigFieldIsVisibleActionGroup.xml} (87%) diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminNavigateToNewRelicConfigurationActionGroup.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminNavigateToNewRelicConfigurationActionGroup.xml new file mode 100644 index 0000000000000..9e8314792b0bd --- /dev/null +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminNavigateToNewRelicConfigurationActionGroup.xml @@ -0,0 +1,15 @@ +<?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="AdminNavigateToNewRelicConfigurationActionGroup"> + <amOnPage url="{{AdminNewRelicConfigPage.url}}" stepKey="navigateToNewRelicConfigurationPage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminTogglesEnabledConfigActionGroup.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminToggleNewRelicReportingEnabledActionGroup.xml similarity index 88% rename from app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminTogglesEnabledConfigActionGroup.xml rename to app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminToggleNewRelicReportingEnabledActionGroup.xml index f9632784f4a92..602484189dda4 100644 --- a/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminTogglesEnabledConfigActionGroup.xml +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminToggleNewRelicReportingEnabledActionGroup.xml @@ -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="AdminTogglesEnabledConfigActionGroup"> + <actionGroup name="AdminToggleNewRelicReportingEnabledActionGroup"> <arguments> <argument name="state" type="string"/> </arguments> diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminUnchecksUseSystemValueActionGroup.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminUncheckNewRelicUseSystemValueActionGroup.xml similarity index 86% rename from app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminUnchecksUseSystemValueActionGroup.xml rename to app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminUncheckNewRelicUseSystemValueActionGroup.xml index 7d90c1d8dd478..31c57c680b2ef 100644 --- a/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminUnchecksUseSystemValueActionGroup.xml +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminUncheckNewRelicUseSystemValueActionGroup.xml @@ -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="AdminUnchecksUseSystemValueActionGroup"> + <actionGroup name="AdminUncheckNewRelicUseSystemValueActionGroup"> <uncheckOption selector="{{AdminNewRelicConfigSystemSection.useSystemValueForEnabled}}" stepKey="uncheckCheckbox"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminDoesntSeeConfigFieldActionGroup.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminNewRelicConfigFieldIsNotVisibleActionGroup.xml similarity index 86% rename from app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminDoesntSeeConfigFieldActionGroup.xml rename to app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminNewRelicConfigFieldIsNotVisibleActionGroup.xml index 6e87dbbfbbf4b..1c347512c1737 100644 --- a/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminDoesntSeeConfigFieldActionGroup.xml +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminNewRelicConfigFieldIsNotVisibleActionGroup.xml @@ -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="AssertAdminDoesntSeeConfigFieldActionGroup"> + <actionGroup name="AssertAdminNewRelicConfigFieldIsNotVisibleActionGroup"> <arguments> <argument name="config" type="string"/> </arguments> diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminSeesConfigFieldActionGroup.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminNewRelicConfigFieldIsVisibleActionGroup.xml similarity index 87% rename from app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminSeesConfigFieldActionGroup.xml rename to app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminNewRelicConfigFieldIsVisibleActionGroup.xml index 4df7099e50b28..fd3b3e47719c0 100644 --- a/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminSeesConfigFieldActionGroup.xml +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminNewRelicConfigFieldIsVisibleActionGroup.xml @@ -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="AssertAdminSeesConfigFieldActionGroup"> + <actionGroup name="AssertAdminNewRelicConfigFieldIsVisibleActionGroup"> <arguments> <argument name="config" type="string"/> </arguments> diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminChecksSystemConfigDependencyTest.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminChecksSystemConfigDependencyTest.xml index eabacffe9b181..676d1dcacf75f 100644 --- a/app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminChecksSystemConfigDependencyTest.xml +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminChecksSystemConfigDependencyTest.xml @@ -20,21 +20,21 @@ <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <actionGroup ref="AdminNavigateToNewRelicConfigurationActionGroup" stepKey="goToConfigPage"/> - <actionGroup ref="AdminExpandNewRelicConfigTabActionGroup" stepKey="expandGeneralTab"> + <actionGroup ref="AdminExpandNewRelicConfigTabActionGroup" stepKey="expandingGeneralTab"> <argument name="tabName" value="general"/> </actionGroup> </before> <after> <actionGroup ref="logout" stepKey="logoutOfAdmin"/> </after> - <actionGroup ref="AssertAdminDontSeeConfigFieldActionGroup" stepKey="checkIfApiUrlIsNotVisible"> + <actionGroup ref="AssertAdminNewRelicConfigFieldIsNotVisibleActionGroup" stepKey="checkingIfApiUrlIsNotVisible"> <argument name="config" value="{{AdminNewRelicConfigSystemSection.apiUrl}}"/> </actionGroup> - <actionGroup ref="AdminUnchecksUseSystemValueActionGroup" stepKey="uncheckUseSystemValue"/> - <actionGroup ref="AdminTogglesEnabledConfigActionGroup" stepKey="enableNewRelic"> + <actionGroup ref="AdminUncheckNewRelicUseSystemValueActionGroup" stepKey="uncheckUseSystemValue"/> + <actionGroup ref="AdminToggleNewRelicReportingEnabledActionGroup" stepKey="enablingNewRelicReporting"> <argument name="state" value="Yes"/> </actionGroup> - <actionGroup ref="AssertAdminSeesConfigFieldActionGroup" stepKey="checkIfApiUrlIsVisible"> + <actionGroup ref="AssertAdminNewRelicConfigFieldIsVisibleActionGroup" stepKey="checkingIfApiUrlIsVisible"> <argument name="config" value="{{AdminNewRelicConfigSystemSection.apiUrl}}"/> </actionGroup> </test> From 9a3d147d9947e83a9af80453acdcf07207449076 Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Wed, 27 Nov 2019 22:10:39 +0200 Subject: [PATCH 106/586] Refactoring the test coverage --- .../AdminExpandConfigSectionActionGroup.xml | 22 +++++++++++++++++++ .../Test/Mftf/Section/AdminConfigSection.xml | 3 +++ ...dminExpandNewRelicConfigTabActionGroup.xml | 17 -------------- ...checkNewRelicUseSystemValueActionGroup.xml | 8 +++++-- .../AdminNewRelicConfigSystemSection.xml | 3 +-- ...eckNewRelicSystemConfigDependencyTest.xml} | 12 +++++----- 6 files changed, 39 insertions(+), 26 deletions(-) create mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/AdminExpandConfigSectionActionGroup.xml delete mode 100644 app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminExpandNewRelicConfigTabActionGroup.xml rename app/code/Magento/NewRelicReporting/Test/Mftf/Test/{AdminChecksSystemConfigDependencyTest.xml => AdminCheckNewRelicSystemConfigDependencyTest.xml} (78%) diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/AdminExpandConfigSectionActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/AdminExpandConfigSectionActionGroup.xml new file mode 100644 index 0000000000000..03a3a45ef0947 --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/AdminExpandConfigSectionActionGroup.xml @@ -0,0 +1,22 @@ +<?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="AdminExpandConfigSectionActionGroup"> + <annotations> + <description>Expands configuration section passed via argument as Section Name.</description> + </annotations> + <arguments> + <argument name="sectionName" type="string"/> + </arguments> + + <conditionalClick selector="{{AdminConfigSection.collapsibleSectionByTitle(sectionName)}}" dependentSelector="{{AdminConfigSection.expandedSectionByTitle(sectionName)}}" visible="false" stepKey="expandSection" /> + <waitForElement selector="{{AdminConfigSection.expandedSectionByTitle(sectionName)}}" stepKey="waitOpenedSection"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/Section/AdminConfigSection.xml b/app/code/Magento/Config/Test/Mftf/Section/AdminConfigSection.xml index ffe3f0076ca8d..3bad136935734 100644 --- a/app/code/Magento/Config/Test/Mftf/Section/AdminConfigSection.xml +++ b/app/code/Magento/Config/Test/Mftf/Section/AdminConfigSection.xml @@ -19,5 +19,8 @@ <element name="defaultConfigButton" type="button" selector="#store-change-button" timeout="30"/> <element name="defaultConfigDropdown" type="button" selector="//ul[@class='dropdown-menu']" timeout="30"/> <element name="fieldError" type="text" selector="label.mage-error"/> + <element name="useSystemValue" type="checkbox" selector="#{{element}} > .use-default > input" parameterized="true"/> + <element name="collapsibleSectionByTitle" type="text" selector="//form[@id='config-edit-form']//div[@class='section-config'][contains(.,'{{sectionTitle}}')]" parameterized="true" /> + <element name="expandedSectionByTitle" type="text" selector="//form[@id='config-edit-form']//div[@class='section-config active'][contains(.,'{{sectionTitle}}')]" parameterized="true" /> </section> </sections> diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminExpandNewRelicConfigTabActionGroup.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminExpandNewRelicConfigTabActionGroup.xml deleted file mode 100644 index 4dc3d2ea8ea34..0000000000000 --- a/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminExpandNewRelicConfigTabActionGroup.xml +++ /dev/null @@ -1,17 +0,0 @@ -<?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="AdminExpandNewRelicConfigTabActionGroup"> - <arguments> - <argument name="tabName" type="string"/> - </arguments> - <conditionalClick selector="{{AdminNewRelicConfigSystemSection.tab(tabName)}}" dependentSelector="{{AdminNewRelicConfigSystemSection.status}}" visible="false" stepKey="expandTab"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminUncheckNewRelicUseSystemValueActionGroup.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminUncheckNewRelicUseSystemValueActionGroup.xml index 31c57c680b2ef..41f18f0f90d8d 100644 --- a/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminUncheckNewRelicUseSystemValueActionGroup.xml +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminUncheckNewRelicUseSystemValueActionGroup.xml @@ -8,7 +8,11 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminUncheckNewRelicUseSystemValueActionGroup"> - <uncheckOption selector="{{AdminNewRelicConfigSystemSection.useSystemValueForEnabled}}" stepKey="uncheckCheckbox"/> + <actionGroup name="AdminUncheckUseSystemValueActionGroup"> + <arguments> + <argument name="rowId" type="string"/> + </arguments> + + <uncheckOption selector="{{AdminConfigSection.useSystemValue(rowId)}}" stepKey="uncheckCheckbox"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/Section/AdminNewRelicConfigSystemSection.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/Section/AdminNewRelicConfigSystemSection.xml index 79625273b988e..8cecf62999bc3 100644 --- a/app/code/Magento/NewRelicReporting/Test/Mftf/Section/AdminNewRelicConfigSystemSection.xml +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/Section/AdminNewRelicConfigSystemSection.xml @@ -9,9 +9,8 @@ <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminNewRelicConfigSystemSection"> - <element name="tab" type="button" selector="#newrelicreporting_{{tab}}-head" parameterized="true"/> + <element name="statusRowId" type="text" selector="#row_newrelicreporting_general_enable"/> <element name="status" type="select" selector="#row_newrelicreporting_general_enable [data-ui-id='select-groups-general-fields-enable-value']"/> - <element name="useSystemValueForEnabled" type="checkbox" selector="#newrelicreporting_general_enable_inherit"/> <element name="apiUrl" type="select" selector="input#newrelicreporting_general_api_url"/> </section> </sections> diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminChecksSystemConfigDependencyTest.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminCheckNewRelicSystemConfigDependencyTest.xml similarity index 78% rename from app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminChecksSystemConfigDependencyTest.xml rename to app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminCheckNewRelicSystemConfigDependencyTest.xml index 676d1dcacf75f..c343f93de2c58 100644 --- a/app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminChecksSystemConfigDependencyTest.xml +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminCheckNewRelicSystemConfigDependencyTest.xml @@ -8,20 +8,20 @@ <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminChecksSystemConfigDependencyTest"> + <test name="AdminCheckNewRelicSystemConfigDependencyTest"> <annotations> <features value="NewRelicReporting"/> <stories value="Admin is able to see the configuration fields only after enabling the feature"/> <title value="Admin can see the configuration fields only after enabling the feature"/> <description value="The system configs should be available only after enabling the New Relic feature."/> - <severity value="CRITICAL"/> + <severity value="MINOR"/> <group value="NewRelicReporting"/> </annotations> <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <actionGroup ref="AdminNavigateToNewRelicConfigurationActionGroup" stepKey="goToConfigPage"/> - <actionGroup ref="AdminExpandNewRelicConfigTabActionGroup" stepKey="expandingGeneralTab"> - <argument name="tabName" value="general"/> + <actionGroup ref="AdminExpandConfigSectionActionGroup" stepKey="expandingGeneralSection"> + <argument name="sectionName" value="General"/> </actionGroup> </before> <after> @@ -30,7 +30,9 @@ <actionGroup ref="AssertAdminNewRelicConfigFieldIsNotVisibleActionGroup" stepKey="checkingIfApiUrlIsNotVisible"> <argument name="config" value="{{AdminNewRelicConfigSystemSection.apiUrl}}"/> </actionGroup> - <actionGroup ref="AdminUncheckNewRelicUseSystemValueActionGroup" stepKey="uncheckUseSystemValue"/> + <actionGroup ref="AdminUncheckUseSystemValueActionGroup" stepKey="uncheckUseSystemValue"> + <argument name="rowId" value="row_newrelicreporting_general_enable"/> + </actionGroup> <actionGroup ref="AdminToggleNewRelicReportingEnabledActionGroup" stepKey="enablingNewRelicReporting"> <argument name="state" value="Yes"/> </actionGroup> From d504f549ba789758a6ce271b23e63ab058611043 Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Wed, 27 Nov 2019 22:12:39 +0200 Subject: [PATCH 107/586] Refactoring the test coverage --- .../Test/Mftf/Section/AdminNewRelicConfigSystemSection.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/Section/AdminNewRelicConfigSystemSection.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/Section/AdminNewRelicConfigSystemSection.xml index 8cecf62999bc3..5bf849cd0134e 100644 --- a/app/code/Magento/NewRelicReporting/Test/Mftf/Section/AdminNewRelicConfigSystemSection.xml +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/Section/AdminNewRelicConfigSystemSection.xml @@ -9,8 +9,7 @@ <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminNewRelicConfigSystemSection"> - <element name="statusRowId" type="text" selector="#row_newrelicreporting_general_enable"/> <element name="status" type="select" selector="#row_newrelicreporting_general_enable [data-ui-id='select-groups-general-fields-enable-value']"/> - <element name="apiUrl" type="select" selector="input#newrelicreporting_general_api_url"/> + <element name="apiUrl" type="input" selector="input#newrelicreporting_general_api_url"/> </section> </sections> From f78f0c1da3f770d2fc2128b5ec846bfadb1509e8 Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Wed, 27 Nov 2019 22:23:25 +0200 Subject: [PATCH 108/586] Renaming the selector --- .../Magento/Config/Test/Mftf/Section/AdminConfigSection.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Config/Test/Mftf/Section/AdminConfigSection.xml b/app/code/Magento/Config/Test/Mftf/Section/AdminConfigSection.xml index 3bad136935734..a4fb3c7e32975 100644 --- a/app/code/Magento/Config/Test/Mftf/Section/AdminConfigSection.xml +++ b/app/code/Magento/Config/Test/Mftf/Section/AdminConfigSection.xml @@ -19,7 +19,7 @@ <element name="defaultConfigButton" type="button" selector="#store-change-button" timeout="30"/> <element name="defaultConfigDropdown" type="button" selector="//ul[@class='dropdown-menu']" timeout="30"/> <element name="fieldError" type="text" selector="label.mage-error"/> - <element name="useSystemValue" type="checkbox" selector="#{{element}} > .use-default > input" parameterized="true"/> + <element name="useSystemValue" type="checkbox" selector="#{{configRowId}} > .use-default > input" parameterized="true"/> <element name="collapsibleSectionByTitle" type="text" selector="//form[@id='config-edit-form']//div[@class='section-config'][contains(.,'{{sectionTitle}}')]" parameterized="true" /> <element name="expandedSectionByTitle" type="text" selector="//form[@id='config-edit-form']//div[@class='section-config active'][contains(.,'{{sectionTitle}}')]" parameterized="true" /> </section> From a1c3ade9d7afa02049f124b25c034c91733a626b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 10:46:26 +0100 Subject: [PATCH 109/586] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- .../ActionGroup/CreateBackupActionGroup.xml | 64 ------------------- .../CreateDatabaseBackupActionGroup.xml | 28 ++++++++ .../CreateMediaBackupActionGroup.xml | 28 ++++++++ .../CreateSystemBackupActionGroup.xml | 28 ++++++++ .../Test/AdminCreateAndDeleteBackupsTest.xml | 6 +- 5 files changed, 87 insertions(+), 67 deletions(-) delete mode 100644 app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateBackupActionGroup.xml create mode 100644 app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateDatabaseBackupActionGroup.xml create mode 100644 app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateMediaBackupActionGroup.xml create mode 100644 app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateSystemBackupActionGroup.xml diff --git a/app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateBackupActionGroup.xml b/app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateBackupActionGroup.xml deleted file mode 100644 index cc7691752c62e..0000000000000 --- a/app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateBackupActionGroup.xml +++ /dev/null @@ -1,64 +0,0 @@ -<?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="createSystemBackup"> - <annotations> - <description>Creates a System Backup using provided Backup Entity.</description> - </annotations> - <arguments> - <argument name="backup" defaultValue="SystemBackup"/> - </arguments> - - <click selector="{{AdminMainActionsSection.systemBackup}}" stepKey="clickCreateBackupButton"/> - <waitForElementVisible selector="{{AdminCreateBackupFormSection.backupNameField}}" stepKey="waitForForm"/> - <fillField selector="{{AdminCreateBackupFormSection.backupNameField}}" userInput="{{backup.name}}" stepKey="fillBackupName"/> - <click selector="{{AdminCreateBackupFormSection.ok}}" stepKey="clickOk"/> - <waitForElementNotVisible selector=".loading-mask" time="300" stepKey="waitForBackupProcess"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You created the system backup." stepKey="seeSuccessMessage"/> - <see selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="seeBackupInGrid"/> - <see selector="{{AdminGridTableSection.backupTypeByName(backup.name)}}" userInput="{{backup.type}}" stepKey="seeBackupType"/> - </actionGroup> - - <actionGroup name="createMediaBackup"> - <annotations> - <description>Creates a Media Backup using provided Backup Entity.</description> - </annotations> - <arguments> - <argument name="backup" defaultValue="MediaBackup"/> - </arguments> - - <click selector="{{AdminMainActionsSection.mediaBackup}}" stepKey="clickCreateBackupButton"/> - <waitForElementVisible selector="{{AdminCreateBackupFormSection.backupNameField}}" stepKey="waitForForm"/> - <fillField selector="{{AdminCreateBackupFormSection.backupNameField}}" userInput="{{backup.name}}" stepKey="fillBackupName"/> - <click selector="{{AdminCreateBackupFormSection.ok}}" stepKey="clickOk"/> - <waitForPageLoad time="120" stepKey="waitForBackupProcess"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You created the database and media backup." stepKey="seeSuccessMessage"/> - <see selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="seeBackupInGrid"/> - <see selector="{{AdminGridTableSection.backupTypeByName(backup.name)}}" userInput="{{backup.type}}" stepKey="seeBackupType"/> - </actionGroup> - - <actionGroup name="createDatabaseBackup"> - <annotations> - <description>Creates a Database Backup using provided Backup Entity.</description> - </annotations> - <arguments> - <argument name="backup" defaultValue="DatabaseBackup"/> - </arguments> - - <click selector="{{AdminMainActionsSection.databaseBackup}}" stepKey="clickCreateBackupButton"/> - <waitForElementVisible selector="{{AdminCreateBackupFormSection.backupNameField}}" stepKey="waitForForm"/> - <fillField selector="{{AdminCreateBackupFormSection.backupNameField}}" userInput="{{backup.name}}" stepKey="fillBackupName"/> - <click selector="{{AdminCreateBackupFormSection.ok}}" stepKey="clickOk"/> - <waitForPageLoad time="120" stepKey="waitForBackupProcess"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You created the database backup." stepKey="seeSuccessMessage"/> - <see selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="seeBackupInGrid"/> - <see selector="{{AdminGridTableSection.backupTypeByName(backup.name)}}" userInput="{{backup.type}}" stepKey="seeBackupType"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateDatabaseBackupActionGroup.xml b/app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateDatabaseBackupActionGroup.xml new file mode 100644 index 0000000000000..5d4e4a19509ea --- /dev/null +++ b/app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateDatabaseBackupActionGroup.xml @@ -0,0 +1,28 @@ +<?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="createDatabaseBackup"> + <annotations> + <description>Creates a Database Backup using provided Backup Entity.</description> + </annotations> + <arguments> + <argument name="backup" defaultValue="DatabaseBackup"/> + </arguments> + + <click selector="{{AdminMainActionsSection.databaseBackup}}" stepKey="clickCreateBackupButton"/> + <waitForElementVisible selector="{{AdminCreateBackupFormSection.backupNameField}}" stepKey="waitForForm"/> + <fillField selector="{{AdminCreateBackupFormSection.backupNameField}}" userInput="{{backup.name}}" stepKey="fillBackupName"/> + <click selector="{{AdminCreateBackupFormSection.ok}}" stepKey="clickOk"/> + <waitForPageLoad time="120" stepKey="waitForBackupProcess"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You created the database backup." stepKey="seeSuccessMessage"/> + <see selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="seeBackupInGrid"/> + <see selector="{{AdminGridTableSection.backupTypeByName(backup.name)}}" userInput="{{backup.type}}" stepKey="seeBackupType"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateMediaBackupActionGroup.xml b/app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateMediaBackupActionGroup.xml new file mode 100644 index 0000000000000..ffa66ae230c04 --- /dev/null +++ b/app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateMediaBackupActionGroup.xml @@ -0,0 +1,28 @@ +<?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="CreateMediaBackupActionGroup"> + <annotations> + <description>Creates a Media Backup using provided Backup Entity.</description> + </annotations> + <arguments> + <argument name="backup" defaultValue="MediaBackup"/> + </arguments> + + <click selector="{{AdminMainActionsSection.mediaBackup}}" stepKey="clickCreateBackupButton"/> + <waitForElementVisible selector="{{AdminCreateBackupFormSection.backupNameField}}" stepKey="waitForForm"/> + <fillField selector="{{AdminCreateBackupFormSection.backupNameField}}" userInput="{{backup.name}}" stepKey="fillBackupName"/> + <click selector="{{AdminCreateBackupFormSection.ok}}" stepKey="clickOk"/> + <waitForPageLoad time="120" stepKey="waitForBackupProcess"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You created the database and media backup." stepKey="seeSuccessMessage"/> + <see selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="seeBackupInGrid"/> + <see selector="{{AdminGridTableSection.backupTypeByName(backup.name)}}" userInput="{{backup.type}}" stepKey="seeBackupType"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateSystemBackupActionGroup.xml b/app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateSystemBackupActionGroup.xml new file mode 100644 index 0000000000000..ca4f7ad1544df --- /dev/null +++ b/app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateSystemBackupActionGroup.xml @@ -0,0 +1,28 @@ +<?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="CreateSystemBackupActionGroup"> + <annotations> + <description>Creates a System Backup using provided Backup Entity.</description> + </annotations> + <arguments> + <argument name="backup" defaultValue="SystemBackup"/> + </arguments> + + <click selector="{{AdminMainActionsSection.systemBackup}}" stepKey="clickCreateBackupButton"/> + <waitForElementVisible selector="{{AdminCreateBackupFormSection.backupNameField}}" stepKey="waitForForm"/> + <fillField selector="{{AdminCreateBackupFormSection.backupNameField}}" userInput="{{backup.name}}" stepKey="fillBackupName"/> + <click selector="{{AdminCreateBackupFormSection.ok}}" stepKey="clickOk"/> + <waitForElementNotVisible selector=".loading-mask" time="300" stepKey="waitForBackupProcess"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You created the system backup." stepKey="seeSuccessMessage"/> + <see selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="seeBackupInGrid"/> + <see selector="{{AdminGridTableSection.backupTypeByName(backup.name)}}" userInput="{{backup.type}}" stepKey="seeBackupType"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Backup/Test/Mftf/Test/AdminCreateAndDeleteBackupsTest.xml b/app/code/Magento/Backup/Test/Mftf/Test/AdminCreateAndDeleteBackupsTest.xml index 26f8817c0a1bb..778c6d5112b6a 100644 --- a/app/code/Magento/Backup/Test/Mftf/Test/AdminCreateAndDeleteBackupsTest.xml +++ b/app/code/Magento/Backup/Test/Mftf/Test/AdminCreateAndDeleteBackupsTest.xml @@ -30,13 +30,13 @@ <waitForPageLoad stepKey="waitForBackupPage"/> <!--Create system backup--> - <actionGroup ref="createSystemBackup" stepKey="createSystemBackup"/> + <actionGroup ref="CreateSystemBackupActionGroup" stepKey="createSystemBackup"/> <!--Create database/media backup--> - <actionGroup ref="createMediaBackup" stepKey="createMediaBackup"/> + <actionGroup ref="CreateMediaBackupActionGroup" stepKey="createMediaBackup"/> <!--Create database backup--> - <actionGroup ref="createDatabaseBackup" stepKey="createDatabaseBackup"/> + <actionGroup ref="CreateDatabaseBackupActionGroup" stepKey="createDatabaseBackup"/> <!--Delete system backup--> <actionGroup ref="deleteBackup" stepKey="deleteSystemBackup"> From 31e35c68f0a02a10a77ce0069acfec6ca1b1ba2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 10:55:34 +0100 Subject: [PATCH 110/586] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- .../AdminCreateNewRoleActionGroup.xml | 32 ++++++++++ ...oup.xml => AdminCreateUserActionGroup.xml} | 15 +---- .../AdminDeleteRoleActionGroup.xml | 27 ++++++++ .../Mftf/ActionGroup/AdminRoleActionGroup.xml | 62 ------------------- .../ConfigureBraintreeActionGroup.xml | 11 +--- .../DisableBraintreeActionGroup.xml | 19 ++++++ .../ActionGroup/GoToAllUsersActionGroup.xml | 21 +++++++ .../ActionGroup/GoToUserRolesActionGroup.xml | 21 +++++++ ...AnAdminOrderUsingBraintreePaymentTest1.xml | 14 ++--- 9 files changed, 129 insertions(+), 93 deletions(-) create mode 100644 app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminCreateNewRoleActionGroup.xml rename app/code/Magento/Braintree/Test/Mftf/ActionGroup/{AdminUserActionGroup.xml => AdminCreateUserActionGroup.xml} (77%) create mode 100644 app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminDeleteRoleActionGroup.xml delete mode 100644 app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminRoleActionGroup.xml create mode 100644 app/code/Magento/Braintree/Test/Mftf/ActionGroup/DisableBraintreeActionGroup.xml create mode 100644 app/code/Magento/Braintree/Test/Mftf/ActionGroup/GoToAllUsersActionGroup.xml create mode 100644 app/code/Magento/Braintree/Test/Mftf/ActionGroup/GoToUserRolesActionGroup.xml diff --git a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminCreateNewRoleActionGroup.xml b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminCreateNewRoleActionGroup.xml new file mode 100644 index 0000000000000..29000563ee87f --- /dev/null +++ b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminCreateNewRoleActionGroup.xml @@ -0,0 +1,32 @@ +<?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="AdminCreateNewRoleActionGroup"> + <annotations> + <description>Creates a User Role using the provided Data.</description> + </annotations> + <arguments> + <argument name="role" type="string" defaultValue=""/> + <argument name="resource" type="string" defaultValue="All"/> + <argument name="scope" type="string" defaultValue="Custom"/> + <argument name="websites" type="string" defaultValue="Main Website"/> + </arguments> + + <click selector="{{AdminCreateRoleSection.create}}" stepKey="clickToAddNewRole"/> + <fillField selector="{{AdminCreateRoleSection.name}}" userInput="{{role.name}}" stepKey="setRoleName"/> + <fillField stepKey="setPassword" selector="{{AdminCreateRoleSection.password}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/> + <click selector="{{AdminCreateRoleSection.roleResources}}" stepKey="clickToOpenRoleResources"/> + <waitForPageLoad stepKey="waitForRoleResourcePage" time="5"/> + <click stepKey="checkSales" selector="//a[text()='Sales']"/> + <click selector="{{AdminCreateRoleSection.save}}" stepKey="clickToSaveRole"/> + <waitForPageLoad stepKey="waitForPageLoad" time="10"/> + <see userInput="You saved the role." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminUserActionGroup.xml b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminCreateUserActionGroup.xml similarity index 77% rename from app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminUserActionGroup.xml rename to app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminCreateUserActionGroup.xml index 78e0db6bc44ee..82491f6362573 100644 --- a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminUserActionGroup.xml +++ b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminCreateUserActionGroup.xml @@ -7,20 +7,7 @@ --> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <!--Go to all users--> - <actionGroup name="GoToAllUsers"> - <annotations> - <description>Navigate to the Users page via Backend Admin Side Menu. PLEASE NOTE: Use the amOnPage action instead.</description> - </annotations> - - <click selector="{{AdminCreateUserSection.system}}" stepKey="clickOnSystemIcon"/> - <waitForPageLoad stepKey="waitForSystemsPageToOpen"/> - <click selector="{{AdminCreateUserSection.allUsers}}" stepKey="clickToSelectUserRoles"/> - <waitForPageLoad stepKey="waitForUserRolesPageToOpen"/> - </actionGroup> - - <!--Create new user with specified role--> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminCreateUserAction"> <annotations> <description>Creates a User using the NewAdmin User Entity and User Role Entity. PLEASE NOTE: The Action Group values are Hardcoded.</description> diff --git a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminDeleteRoleActionGroup.xml b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminDeleteRoleActionGroup.xml new file mode 100644 index 0000000000000..9ee3c79d1288e --- /dev/null +++ b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminDeleteRoleActionGroup.xml @@ -0,0 +1,27 @@ +<?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="AdminDeleteRoleActionGroup"> + <annotations> + <description>Deletes a User Role that contains the text 'Role'. PLEASE NOTE: The Action Group values are Hardcoded.</description> + </annotations> + <arguments> + <argument name="role" defaultValue=""/> + </arguments> + + <click stepKey="clickOnRole" selector="{{AdminDeleteRoleSection.theRole}}"/> + <fillField stepKey="TypeCurrentPassword" selector="{{AdminDeleteRoleSection.current_pass}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/> + <click stepKey="clickToDeleteRole" selector="{{AdminDeleteRoleSection.delete}}"/> + <waitForAjaxLoad stepKey="waitForDeleteConfirmationPopup" time="5"/> + <click stepKey="clickToConfirm" selector="{{AdminDeleteRoleSection.confirm}}"/> + <waitForPageLoad stepKey="waitForPageLoad" time="10"/> + <see stepKey="seeSuccessMessage" userInput="You deleted the role."/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminRoleActionGroup.xml b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminRoleActionGroup.xml deleted file mode 100644 index 384ccbf379bc3..0000000000000 --- a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminRoleActionGroup.xml +++ /dev/null @@ -1,62 +0,0 @@ -<?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="GoToUserRoles"> - <annotations> - <description>Navigate to the User Roles page via Backend Admin Side Menu. PLEASE NOTE: Use the amOnPage action instead.</description> - </annotations> - - <click selector="#menu-magento-backend-system" stepKey="clickOnSystemIcon"/> - <waitForPageLoad stepKey="waitForSystemsPageToOpen"/> - <click selector="//span[contains(text(), 'User Roles')]" stepKey="clickToSelectUserRoles"/> - <waitForPageLoad stepKey="waitForUserRolesPageToOpen"/> - </actionGroup> - - <!--Create new role--> - <actionGroup name="AdminCreateNewRole"> - <annotations> - <description>Creates a User Role using the provided Data.</description> - </annotations> - <arguments> - <argument name="role" type="string" defaultValue=""/> - <argument name="resource" type="string" defaultValue="All"/> - <argument name="scope" type="string" defaultValue="Custom"/> - <argument name="websites" type="string" defaultValue="Main Website"/> - </arguments> - - <click selector="{{AdminCreateRoleSection.create}}" stepKey="clickToAddNewRole"/> - <fillField selector="{{AdminCreateRoleSection.name}}" userInput="{{role.name}}" stepKey="setRoleName"/> - <fillField stepKey="setPassword" selector="{{AdminCreateRoleSection.password}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/> - <click selector="{{AdminCreateRoleSection.roleResources}}" stepKey="clickToOpenRoleResources"/> - <waitForPageLoad stepKey="waitForRoleResourcePage" time="5"/> - <click stepKey="checkSales" selector="//a[text()='Sales']"/> - <click selector="{{AdminCreateRoleSection.save}}" stepKey="clickToSaveRole"/> - <waitForPageLoad stepKey="waitForPageLoad" time="10"/> - <see userInput="You saved the role." stepKey="seeSuccessMessage"/> - </actionGroup> - - <!--Delete role--> - <actionGroup name="AdminDeleteRoleActionGroup"> - <annotations> - <description>Deletes a User Role that contains the text 'Role'. PLEASE NOTE: The Action Group values are Hardcoded.</description> - </annotations> - <arguments> - <argument name="role" defaultValue=""/> - </arguments> - - <click stepKey="clickOnRole" selector="{{AdminDeleteRoleSection.theRole}}"/> - <fillField stepKey="TypeCurrentPassword" selector="{{AdminDeleteRoleSection.current_pass}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/> - <click stepKey="clickToDeleteRole" selector="{{AdminDeleteRoleSection.delete}}"/> - <waitForAjaxLoad stepKey="waitForDeleteConfirmationPopup" time="5"/> - <click stepKey="clickToConfirm" selector="{{AdminDeleteRoleSection.confirm}}"/> - <waitForPageLoad stepKey="waitForPageLoad" time="10"/> - <see stepKey="seeSuccessMessage" userInput="You deleted the role."/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/ConfigureBraintreeActionGroup.xml b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/ConfigureBraintreeActionGroup.xml index 6f379c2e66a48..5e5f6d634caad 100644 --- a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/ConfigureBraintreeActionGroup.xml +++ b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/ConfigureBraintreeActionGroup.xml @@ -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="ConfigureBraintree"> + <actionGroup name="ConfigureBraintreeActionGroup"> <annotations> <description>Sets up the Braintree configuration setting using the BraintreeConfigurationSection Data Entity. PLEASE NOTE: The Action Group values are Hardcoded.</description> </annotations> @@ -49,13 +49,4 @@ <click stepKey="save" selector="{{BraintreeConfiguraionSection.save}}"/> <waitForElementVisible selector="{{BraintreeConfiguraionSection.successfulMessage}}" stepKey="waitForSuccessfullyConfigured" time="10"/> </actionGroup> - - <actionGroup name="DisableBrainTree"> - <annotations> - <description>Disables the Braintree and BraintreePaypal configuration settings via the CLI.</description> - </annotations> - - <magentoCLI stepKey="disableBrainTree" command="config:set payment/braintree/active 0"/> - <magentoCLI stepKey="disableBrainTreePaypal" command="config:set payment/braintree_paypal/active 0"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/DisableBraintreeActionGroup.xml b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/DisableBraintreeActionGroup.xml new file mode 100644 index 0000000000000..9f8b7735fc067 --- /dev/null +++ b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/DisableBraintreeActionGroup.xml @@ -0,0 +1,19 @@ +<?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="DisableBraintreeActionGroup"> + <annotations> + <description>Disables the Braintree and BraintreePaypal configuration settings via the CLI.</description> + </annotations> + + <magentoCLI stepKey="disableBrainTree" command="config:set payment/braintree/active 0"/> + <magentoCLI stepKey="disableBrainTreePaypal" command="config:set payment/braintree_paypal/active 0"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/GoToAllUsersActionGroup.xml b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/GoToAllUsersActionGroup.xml new file mode 100644 index 0000000000000..f5cffbe81b509 --- /dev/null +++ b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/GoToAllUsersActionGroup.xml @@ -0,0 +1,21 @@ +<?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="GoToAllUsersActionGroup"> + <annotations> + <description>Navigate to the Users page via Backend Admin Side Menu. PLEASE NOTE: Use the amOnPage action instead.</description> + </annotations> + + <click selector="{{AdminCreateUserSection.system}}" stepKey="clickOnSystemIcon"/> + <waitForPageLoad stepKey="waitForSystemsPageToOpen"/> + <click selector="{{AdminCreateUserSection.allUsers}}" stepKey="clickToSelectUserRoles"/> + <waitForPageLoad stepKey="waitForUserRolesPageToOpen"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/GoToUserRolesActionGroup.xml b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/GoToUserRolesActionGroup.xml new file mode 100644 index 0000000000000..43bdb3cb02c0d --- /dev/null +++ b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/GoToUserRolesActionGroup.xml @@ -0,0 +1,21 @@ +<?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="GoToUserRolesActionGroup"> + <annotations> + <description>Navigate to the User Roles page via Backend Admin Side Menu. PLEASE NOTE: Use the amOnPage action instead.</description> + </annotations> + + <click selector="#menu-magento-backend-system" stepKey="clickOnSystemIcon"/> + <waitForPageLoad stepKey="waitForSystemsPageToOpen"/> + <click selector="//span[contains(text(), 'User Roles')]" stepKey="clickToSelectUserRoles"/> + <waitForPageLoad stepKey="waitForUserRolesPageToOpen"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest1.xml b/app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest1.xml index 2594d245f9ff0..1e134b604d497 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest1.xml +++ b/app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest1.xml @@ -42,14 +42,14 @@ <actionGroup ref="ConfigureBraintree" stepKey="configureBraintree"/> <!--Create New Role--> - <actionGroup ref="GoToUserRoles" stepKey="GoToUserRoles"/> + <actionGroup ref="GoToUserRolesActionGroup" stepKey="GoToUserRoles"/> <waitForPageLoad stepKey="waitForAllRoles" time="15"/> - <actionGroup ref="AdminCreateNewRole" stepKey="AdminCreateNewRole"/> + <actionGroup ref="AdminCreateNewRoleActionGroup" stepKey="AdminCreateNewRole"/> <!--Create new admin user--> - <actionGroup ref="GoToAllUsers" stepKey="GoToAllUsers"/> + <actionGroup ref="GoToAllUsersActionGroup" stepKey="GoToAllUsers"/> <waitForPageLoad stepKey="waitForUsers" time="15"/> - <actionGroup ref="AdminCreateUserAction" stepKey="AdminCreateNewUser"/> + <actionGroup ref="AdminCreateUserActionGroup" stepKey="AdminCreateNewUser"/> <!--SignOut--> <actionGroup ref="logout" stepKey="signOutFromAdmin"/> @@ -88,7 +88,7 @@ <after> <!-- Disable BrainTree --> - <actionGroup ref="DisableBrainTree" stepKey="disableBrainTree"/> + <actionGroup ref="DisableBraintreeActionGroup" stepKey="disableBrainTree"/> <!--SignOut--> <actionGroup ref="SignOut" stepKey="signOutFromNewUser"/> @@ -101,11 +101,11 @@ <deleteData stepKey="deleteCustomer" createDataKey="createCustomer"/> <!--Delete User --> - <actionGroup ref="GoToAllUsers" stepKey="GoBackToAllUsers"/> + <actionGroup ref="GoToAllUsersActionGroup" stepKey="GoBackToAllUsers"/> <actionGroup ref="AdminDeleteNewUserActionGroup" stepKey="AdminDeleteUserActionGroup"/> <!--Delete Role--> - <actionGroup ref="GoToUserRoles" stepKey="GoBackToUserRoles"/> + <actionGroup ref="GoToUserRolesActionGroup" stepKey="GoBackToUserRoles"/> <actionGroup ref="AdminDeleteRoleActionGroup" stepKey="AdminDeleteRoleActionGroup"/> </after> </test> From 236988709f6db007988ca274bfbf837c2b609bb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 12:51:34 +0100 Subject: [PATCH 111/586] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- ...dBundleOptionWithOneProductActionGroup.xml | 26 +++ ...BundleOptionWithSixProductsActionGroup.xml | 55 ++++++ ...undleOptionWithTreeProductsActionGroup.xml | 31 +++ ...BundleOptionWithTwoProductsActionGroup.xml | 48 +++++ ...AdminCreateApiBundleProductActionGroup.xml | 184 ------------------ ...eateApiDynamicBundleProductActionGroup.xml | 65 +++++++ ...BundleProductAllOptionTypesActionGroup.xml | 74 +++++++ ...CreateApiFixedBundleProductActionGroup.xml | 65 +++++++ ...AncillaryPrepBundleProductActionGroup.xml} | 19 +- ...edFieldsInBundleProductFormActionGroup.xml | 23 +++ .../CreateBasicBundleProductActionGroup.xml | 29 +++ .../CreateBundleProductActionGroup.xml | 162 --------------- .../DeleteBundleOptionByIndexActionGroup.xml | 23 +++ .../FillMainBundleProductFormActionGroup.xml | 23 +++ .../FindProductToEditActionGroup.xml | 24 +++ ...leProductFromCategoryToCartActionGroup.xml | 27 +++ ...dleProductFromProductToCartActionGroup.xml | 24 +++ ...roductToCartWithMultiOptionActionGroup.xml | 22 +++ ...CategoryBundleProductToCartActionGroup.xml | 30 +++ .../StorefrontProductCartActionGroup.xml | 77 -------- ...ewBundleProductInAdminGridActionGroup.xml} | 31 +-- .../Mftf/Test/AdminAddBundleItemsTest.xml | 2 +- ...CreateAndEditBundleProductSettingsTest.xml | 14 +- .../Mftf/Test/AdminDeleteABundleProduct.xml | 2 +- .../AdminFilterProductListByBundleProduct.xml | 2 +- .../Test/AdminMassDeleteBundleProducts.xml | 2 +- .../Test/AdminProductBundleCreationTest.xml | 2 +- .../Test/BundleProductFixedPricingTest.xml | 2 +- .../BundleProductWithTierPriceInCartTest.xml | 6 +- ...urrencyChangingBundleProductInCartTest.xml | 4 +- .../EnableDisableBundleProductStatusTest.xml | 2 +- .../MassEnableDisableBundleProductsTest.xml | 2 +- .../StorefrontAddBundleOptionsToCartTest.xml | 6 +- .../Mftf/Test/StorefrontBundleCartTest.xml | 16 +- .../StorefrontBundleProductDetailsTest.xml | 2 +- ...undleProductShownInCategoryListAndGrid.xml | 2 +- ...tCustomerSelectAndSetBundleOptionsTest.xml | 8 +- ...ontGoToDetailsPageWhenAddingToCartTest.xml | 2 +- .../Mftf/Test/SearchEntityResultsTest.xml | 2 +- ...inCartRulesAppliedForProductInCartTest.xml | 2 +- 40 files changed, 632 insertions(+), 510 deletions(-) create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/AddBundleOptionWithOneProductActionGroup.xml create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/AddBundleOptionWithSixProductsActionGroup.xml create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/AddBundleOptionWithTreeProductsActionGroup.xml create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/AddBundleOptionWithTwoProductsActionGroup.xml delete mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminCreateApiBundleProductActionGroup.xml create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminCreateApiDynamicBundleProductActionGroup.xml create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminCreateApiDynamicBundleProductAllOptionTypesActionGroup.xml create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminCreateApiFixedBundleProductActionGroup.xml rename app/code/Magento/Bundle/Test/Mftf/ActionGroup/{EnableDisableProductActionGroup.xml => AncillaryPrepBundleProductActionGroup.xml} (51%) create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/CheckRequiredFieldsInBundleProductFormActionGroup.xml create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/CreateBasicBundleProductActionGroup.xml delete mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/CreateBundleProductActionGroup.xml create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/DeleteBundleOptionByIndexActionGroup.xml create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/FillMainBundleProductFormActionGroup.xml create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/FindProductToEditActionGroup.xml create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontAddBundleProductFromCategoryToCartActionGroup.xml create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontAddBundleProductFromProductToCartActionGroup.xml create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontAddBundleProductFromProductToCartWithMultiOptionActionGroup.xml create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontAddCategoryBundleProductToCartActionGroup.xml delete mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontProductCartActionGroup.xml rename app/code/Magento/Bundle/Test/Mftf/ActionGroup/{AdminBundleProductActionGroup.xml => ViewBundleProductInAdminGridActionGroup.xml} (50%) diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AddBundleOptionWithOneProductActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AddBundleOptionWithOneProductActionGroup.xml new file mode 100644 index 0000000000000..7c60cde4e20d3 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AddBundleOptionWithOneProductActionGroup.xml @@ -0,0 +1,26 @@ +<?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="AddBundleOptionWithOneProductActionGroup" extends="AddBundleOptionWithTwoProductsActionGroup"> + <annotations> + <description>Requires Navigation to the Product Creation page. Adds Bundle Option with One Product as specified in arguments. 'x' refers to Bundle option number. 'n' refers to the first number after x.</description> + </annotations> + + <remove keyForRemoval="openProductFilters2"/> + <remove keyForRemoval="fillProductSkuFilter2"/> + <remove keyForRemoval="clickApplyFilters2"/> + <remove keyForRemoval="waitForFilteredGridLoad2"/> + <remove keyForRemoval="selectProduct2"/> + <remove keyForRemoval="selectProduct2"/> + <remove keyForRemoval="fillQuantity1"/> + <remove keyForRemoval="fillQuantity2"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="1" stepKey="fillQuantity" after="clickAddButton1"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AddBundleOptionWithSixProductsActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AddBundleOptionWithSixProductsActionGroup.xml new file mode 100644 index 0000000000000..9fd89bbbfe6d5 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AddBundleOptionWithSixProductsActionGroup.xml @@ -0,0 +1,55 @@ +<?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="AddBundleOptionWithSixProductsActionGroup" extends="AddBundleOptionWithTwoProductsActionGroup"> + <annotations> + <description>Requires Navigation to Product Creation page. Adds Bundle Option with Six Products as specified in arguments. 'x' refers to Bundle option number. 'n' refers to the first number after x.</description> + </annotations> + <arguments> + <argument name="prodTreeSku" type="string"/> + <argument name="prodFourSku" type="string"/> + <argument name="prodFiveSku" type="string"/> + <argument name="prodSixSku" type="string"/> + </arguments> + + <remove keyForRemoval="fillQuantity1"/> + <remove keyForRemoval="fillQuantity2"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters3" after="selectProduct2"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters3" after="clickClearFilters3"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodTreeSku}}" stepKey="fillProductSkuFilter3" after="openProductFilters3"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters3" after="fillProductSkuFilter3"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad3" time="30" after="clickApplyFilters3"/> + <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct3" after="waitForFilteredGridLoad3"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters4" after="selectProduct3"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters4" after="clickClearFilters4"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodFourSku}}" stepKey="fillProductSkuFilter4" after="openProductFilters4"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters4" after="fillProductSkuFilter4"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad4" time="30" after="clickApplyFilters4"/> + <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct4" after="clickApplyFilters4"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters5" after="selectProduct4"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters5" after="clickClearFilters5"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodFiveSku}}" stepKey="fillProductSkuFilter5" after="openProductFilters5"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters5" after="fillProductSkuFilter5"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad5" time="30" after="clickApplyFilters5"/> + <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct5" after="waitForFilteredGridLoad5"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters6" after="selectProduct5"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters6" after="clickClearFilters6"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodSixSku}}" stepKey="fillProductSkuFilter6" after="openProductFilters6"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters6" after="fillProductSkuFilter6"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad6" time="30" after="clickApplyFilters6"/> + <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct6" after="waitForFilteredGridLoad6"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="2" stepKey="fillQuantity1" after="clickAddButton1"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '1')}}" userInput="2" stepKey="fillQuantity2" after="fillQuantity1"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '2')}}" userInput="2" stepKey="fillQuantity3" after="fillQuantity2"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '3')}}" userInput="2" stepKey="fillQuantity4" after="fillQuantity3"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '4')}}" userInput="2" stepKey="fillQuantity5" after="fillQuantity4"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '5')}}" userInput="2" stepKey="fillQuantity6" after="fillQuantity5"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AddBundleOptionWithTreeProductsActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AddBundleOptionWithTreeProductsActionGroup.xml new file mode 100644 index 0000000000000..085ee47b89e0e --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AddBundleOptionWithTreeProductsActionGroup.xml @@ -0,0 +1,31 @@ +<?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="AddBundleOptionWithThreeProductsActionGroup" extends="AddBundleOptionWithTwoProductsActionGroup"> + <annotations> + <description>Requires Navigation to the Product Creation page. Adds Bundle Option with Three Products using the provided arguments. 'x' refers to Bundle option number. 'n' refers to the first number after x.</description> + </annotations> + <arguments> + <argument name="prodTreeSku" type="string"/> + </arguments> + + <remove keyForRemoval="fillQuantity1"/> + <remove keyForRemoval="fillQuantity2"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters3" after="selectProduct2"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters3" after="clickClearFilters3"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodTreeSku}}" stepKey="fillProductSkuFilter3" after="openProductFilters3"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters3" after="fillProductSkuFilter3"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad3" time="30" after="clickApplyFilters3"/> + <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct3" after="waitForFilteredGridLoad3"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="1" stepKey="fillQuantity1" after="clickAddButton1"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '1')}}" userInput="1" stepKey="fillQuantity2" after="fillQuantity1"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '2')}}" userInput="1" stepKey="fillQuantity3" after="fillQuantity2"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AddBundleOptionWithTwoProductsActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AddBundleOptionWithTwoProductsActionGroup.xml new file mode 100644 index 0000000000000..f54704de9dbd9 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AddBundleOptionWithTwoProductsActionGroup.xml @@ -0,0 +1,48 @@ +<?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="AddBundleOptionWithTwoProductsActionGroup"> + <annotations> + <description>Requires Navigation to the Product Creation page. Adds Bundle Option with Two Products using the provided arguments. 'x' refers to Bundle option number. 'n' refers to the first number after x.</description> + </annotations> + <arguments> + <argument name="x" type="string"/> + <argument name="n" type="string"/> + <argument name="prodOneSku" type="string"/> + <argument name="prodTwoSku" type="string"/> + <argument name="optionTitle" type="string"/> + <argument name="inputType" type="string"/> + </arguments> + + <conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/> + <scrollTo selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" stepKey="scrollUpABit"/> + <click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="clickAddOption"/> + <waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle(x)}}" stepKey="waitForOptions"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle(x)}}" userInput="{{optionTitle}}" stepKey="fillTitle"/> + <selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType(x)}}" userInput="{{inputType}}" stepKey="selectType"/> + <waitForElementVisible selector="{{AdminProductFormBundleSection.nthAddProductsToOption(n)}}" stepKey="waitForAddBtn"/> + <click selector="{{AdminProductFormBundleSection.nthAddProductsToOption(n)}}" stepKey="clickAdd"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters1"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters1"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodOneSku}}" stepKey="fillProductSkuFilter1"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters1"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad1" time="30"/> + <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct1"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters2"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters2"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodTwoSku}}" stepKey="fillProductSkuFilter2"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters2"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad2" time="30"/> + <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct2"/> + <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddButton1"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="50" stepKey="fillQuantity1"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '1')}}" userInput="50" stepKey="fillQuantity2"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminCreateApiBundleProductActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminCreateApiBundleProductActionGroup.xml deleted file mode 100644 index 8993a936475b4..0000000000000 --- a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminCreateApiBundleProductActionGroup.xml +++ /dev/null @@ -1,184 +0,0 @@ -<?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="AdminCreateApiDynamicBundleProductActionGroup"> - <annotations> - <description>Creates 4 products with varying prices. Creates the bundle product with specified name. Adds the multiple select and checkbox options and 4 links to the created products. Uses the 'ApiBundleProduct' entity.</description> - </annotations> - <arguments> - <argument name="productName" defaultValue="Api Dynamic Bundle Product" type="string"/> - </arguments> - - <!--Create 4 simple products--> - <createData entity="SimpleProduct2" stepKey="simpleProduct1"> - <field key="price">4.99</field> - </createData> - <createData entity="SimpleProduct2" stepKey="simpleProduct2"> - <field key="price">2.89</field> - </createData> - <createData entity="SimpleProduct2" stepKey="simpleProduct3"> - <field key="price">7.33</field> - </createData> - <createData entity="SimpleProduct2" stepKey="simpleProduct4"> - <field key="price">18.25</field> - </createData> - - <!-- Create the bundle product based --> - <createData entity="ApiBundleProduct" stepKey="createBundleProduct"> - <field key="name">{{productName}}</field> - </createData> - <createData entity="MultipleSelectOption" stepKey="createBundleOption1_1"> - <requiredEntity createDataKey="createBundleProduct"/> - <field key="required">false</field> - </createData> - <createData entity="CheckboxOption" stepKey="createBundleOption1_2"> - <requiredEntity createDataKey="createBundleProduct"/> - </createData> - <createData entity="ApiBundleLink" stepKey="linkOptionToProduct"> - <requiredEntity createDataKey="createBundleProduct"/> - <requiredEntity createDataKey="createBundleOption1_1"/> - <requiredEntity createDataKey="simpleProduct1"/> - </createData> - <createData entity="ApiBundleLink" stepKey="linkOptionToProduct2"> - <requiredEntity createDataKey="createBundleProduct"/> - <requiredEntity createDataKey="createBundleOption1_1"/> - <requiredEntity createDataKey="simpleProduct2"/> - </createData> - <createData entity="ApiBundleLink" stepKey="linkOptionToProduct3"> - <requiredEntity createDataKey="createBundleProduct"/> - <requiredEntity createDataKey="createBundleOption1_2"/> - <requiredEntity createDataKey="simpleProduct3"/> - </createData> - <createData entity="ApiBundleLink" stepKey="linkOptionToProduct4"> - <requiredEntity createDataKey="createBundleProduct"/> - <requiredEntity createDataKey="createBundleOption1_2"/> - <requiredEntity createDataKey="simpleProduct4"/> - </createData> - </actionGroup> - - <actionGroup name="AdminCreateApiFixedBundleProductActionGroup"> - <annotations> - <description>Creates 4 products with varying prices. Creates the bundle product with specified name. Adds the multiple select and checkbox options and 4 links to the created products. Uses the 'ApiFixedBundleProduct' entity.</description> - </annotations> - <arguments> - <argument name="productName" defaultValue="Api Fixed Bundle Product" type="string"/> - </arguments> - - <!--Create 4 simple products--> - <createData entity="SimpleProduct2" stepKey="simpleProduct1"> - <field key="price">4.99</field> - </createData> - <createData entity="SimpleProduct2" stepKey="simpleProduct2"> - <field key="price">2.89</field> - </createData> - <createData entity="SimpleProduct2" stepKey="simpleProduct3"> - <field key="price">7.33</field> - </createData> - <createData entity="SimpleProduct2" stepKey="simpleProduct4"> - <field key="price">18.25</field> - </createData> - - <!-- Create the bundle product based --> - <createData entity="ApiFixedBundleProduct" stepKey="createBundleProduct"> - <field key="name">{{productName}}</field> - </createData> - <createData entity="MultipleSelectOption" stepKey="createBundleOption1_1"> - <requiredEntity createDataKey="createBundleProduct"/> - <field key="required">false</field> - </createData> - <createData entity="CheckboxOption" stepKey="createBundleOption1_2"> - <requiredEntity createDataKey="createBundleProduct"/> - </createData> - <createData entity="ApiBundleLink" stepKey="linkOptionToProduct"> - <requiredEntity createDataKey="createBundleProduct"/> - <requiredEntity createDataKey="createBundleOption1_1"/> - <requiredEntity createDataKey="simpleProduct1"/> - </createData> - <createData entity="ApiBundleLink" stepKey="linkOptionToProduct2"> - <requiredEntity createDataKey="createBundleProduct"/> - <requiredEntity createDataKey="createBundleOption1_1"/> - <requiredEntity createDataKey="simpleProduct2"/> - </createData> - <createData entity="ApiBundleLink" stepKey="linkOptionToProduct3"> - <requiredEntity createDataKey="createBundleProduct"/> - <requiredEntity createDataKey="createBundleOption1_2"/> - <requiredEntity createDataKey="simpleProduct3"/> - </createData> - <createData entity="ApiBundleLink" stepKey="linkOptionToProduct4"> - <requiredEntity createDataKey="createBundleProduct"/> - <requiredEntity createDataKey="createBundleOption1_2"/> - <requiredEntity createDataKey="simpleProduct4"/> - </createData> - </actionGroup> - - <actionGroup name="AdminCreateApiDynamicBundleProductAllOptionTypesActionGroup"> - <annotations> - <description>Creates 3 products with varying prices. Creates the dynamic bundle product with specified name. Adds the multiple select, checkbox options and links to the created products. Uses the 'ApiBundleProduct' entity.</description> - </annotations> - <arguments> - <argument name="productName" defaultValue="Api Dynamic Bundle Product" type="string"/> - </arguments> - - <!-- Create simple products --> - <createData entity="SimpleProduct2" stepKey="simpleProduct1"> - <field key="price">10</field> - </createData> - <createData entity="SimpleProduct2" stepKey="simpleProduct2"> - <field key="price">20</field> - </createData> - - <!-- Create Bundle product --> - <createData entity="ApiBundleProduct" stepKey="createBundleProduct"> - <field key="name">{{productName}}</field> - </createData> - <createData entity="DropDownBundleOption" stepKey="createDropDownBundleOption"> - <requiredEntity createDataKey="createBundleProduct"/> - <field key="title">Drop-down Option</field> - </createData> - <createData entity="RadioButtonsOption" stepKey="createBundleRadioButtonsOption"> - <requiredEntity createDataKey="createBundleProduct"/> - <field key="title">Radio Buttons Option</field> - </createData> - <createData entity="CheckboxOption" stepKey="createBundleCheckboxOption"> - <requiredEntity createDataKey="createBundleProduct"/> - <field key="title">Checkbox Option</field> - </createData> - <createData entity="ApiBundleLink" stepKey="linkCheckboxOptionToProduct1"> - <requiredEntity createDataKey="createBundleProduct"/> - <requiredEntity createDataKey="createBundleCheckboxOption"/> - <requiredEntity createDataKey="simpleProduct1"/> - </createData> - <createData entity="ApiBundleLink" stepKey="linkCheckboxOptionToProduct2"> - <requiredEntity createDataKey="createBundleProduct"/> - <requiredEntity createDataKey="createBundleCheckboxOption"/> - <requiredEntity createDataKey="simpleProduct2"/> - </createData> - <createData entity="ApiBundleLink" stepKey="linkDropDownOptionToProduct1"> - <requiredEntity createDataKey="createBundleProduct"/> - <requiredEntity createDataKey="createDropDownBundleOption"/> - <requiredEntity createDataKey="simpleProduct1"/> - </createData> - <createData entity="ApiBundleLink" stepKey="linkDropDownOptionToProduct2"> - <requiredEntity createDataKey="createBundleProduct"/> - <requiredEntity createDataKey="createDropDownBundleOption"/> - <requiredEntity createDataKey="simpleProduct2"/> - </createData> - <createData entity="ApiBundleLink" stepKey="linkRadioButtonsOptionToProduct1"> - <requiredEntity createDataKey="createBundleProduct"/> - <requiredEntity createDataKey="createBundleRadioButtonsOption"/> - <requiredEntity createDataKey="simpleProduct1"/> - </createData> - <createData entity="ApiBundleLink" stepKey="linkRadioButtonsOptionToProduct2"> - <requiredEntity createDataKey="createBundleProduct"/> - <requiredEntity createDataKey="createBundleRadioButtonsOption"/> - <requiredEntity createDataKey="simpleProduct2"/> - </createData> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminCreateApiDynamicBundleProductActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminCreateApiDynamicBundleProductActionGroup.xml new file mode 100644 index 0000000000000..7e17822710a18 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminCreateApiDynamicBundleProductActionGroup.xml @@ -0,0 +1,65 @@ +<?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="AdminCreateApiDynamicBundleProductActionGroup"> + <annotations> + <description>Creates 4 products with varying prices. Creates the bundle product with specified name. Adds the multiple select and checkbox options and 4 links to the created products. Uses the 'ApiBundleProduct' entity.</description> + </annotations> + <arguments> + <argument name="productName" defaultValue="Api Dynamic Bundle Product" type="string"/> + </arguments> + + <!--Create 4 simple products--> + <createData entity="SimpleProduct2" stepKey="simpleProduct1"> + <field key="price">4.99</field> + </createData> + <createData entity="SimpleProduct2" stepKey="simpleProduct2"> + <field key="price">2.89</field> + </createData> + <createData entity="SimpleProduct2" stepKey="simpleProduct3"> + <field key="price">7.33</field> + </createData> + <createData entity="SimpleProduct2" stepKey="simpleProduct4"> + <field key="price">18.25</field> + </createData> + + <!-- Create the bundle product based --> + <createData entity="ApiBundleProduct" stepKey="createBundleProduct"> + <field key="name">{{productName}}</field> + </createData> + <createData entity="MultipleSelectOption" stepKey="createBundleOption1_1"> + <requiredEntity createDataKey="createBundleProduct"/> + <field key="required">false</field> + </createData> + <createData entity="CheckboxOption" stepKey="createBundleOption1_2"> + <requiredEntity createDataKey="createBundleProduct"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkOptionToProduct"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createBundleOption1_1"/> + <requiredEntity createDataKey="simpleProduct1"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkOptionToProduct2"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createBundleOption1_1"/> + <requiredEntity createDataKey="simpleProduct2"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkOptionToProduct3"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createBundleOption1_2"/> + <requiredEntity createDataKey="simpleProduct3"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkOptionToProduct4"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createBundleOption1_2"/> + <requiredEntity createDataKey="simpleProduct4"/> + </createData> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminCreateApiDynamicBundleProductAllOptionTypesActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminCreateApiDynamicBundleProductAllOptionTypesActionGroup.xml new file mode 100644 index 0000000000000..c9f5c52c05736 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminCreateApiDynamicBundleProductAllOptionTypesActionGroup.xml @@ -0,0 +1,74 @@ +<?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="AdminCreateApiDynamicBundleProductAllOptionTypesActionGroup"> + <annotations> + <description>Creates 3 products with varying prices. Creates the dynamic bundle product with specified name. Adds the multiple select, checkbox options and links to the created products. Uses the 'ApiBundleProduct' entity.</description> + </annotations> + <arguments> + <argument name="productName" defaultValue="Api Dynamic Bundle Product" type="string"/> + </arguments> + + <!-- Create simple products --> + <createData entity="SimpleProduct2" stepKey="simpleProduct1"> + <field key="price">10</field> + </createData> + <createData entity="SimpleProduct2" stepKey="simpleProduct2"> + <field key="price">20</field> + </createData> + + <!-- Create Bundle product --> + <createData entity="ApiBundleProduct" stepKey="createBundleProduct"> + <field key="name">{{productName}}</field> + </createData> + <createData entity="DropDownBundleOption" stepKey="createDropDownBundleOption"> + <requiredEntity createDataKey="createBundleProduct"/> + <field key="title">Drop-down Option</field> + </createData> + <createData entity="RadioButtonsOption" stepKey="createBundleRadioButtonsOption"> + <requiredEntity createDataKey="createBundleProduct"/> + <field key="title">Radio Buttons Option</field> + </createData> + <createData entity="CheckboxOption" stepKey="createBundleCheckboxOption"> + <requiredEntity createDataKey="createBundleProduct"/> + <field key="title">Checkbox Option</field> + </createData> + <createData entity="ApiBundleLink" stepKey="linkCheckboxOptionToProduct1"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createBundleCheckboxOption"/> + <requiredEntity createDataKey="simpleProduct1"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkCheckboxOptionToProduct2"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createBundleCheckboxOption"/> + <requiredEntity createDataKey="simpleProduct2"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkDropDownOptionToProduct1"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createDropDownBundleOption"/> + <requiredEntity createDataKey="simpleProduct1"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkDropDownOptionToProduct2"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createDropDownBundleOption"/> + <requiredEntity createDataKey="simpleProduct2"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkRadioButtonsOptionToProduct1"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createBundleRadioButtonsOption"/> + <requiredEntity createDataKey="simpleProduct1"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkRadioButtonsOptionToProduct2"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createBundleRadioButtonsOption"/> + <requiredEntity createDataKey="simpleProduct2"/> + </createData> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminCreateApiFixedBundleProductActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminCreateApiFixedBundleProductActionGroup.xml new file mode 100644 index 0000000000000..13c31cf2e7127 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminCreateApiFixedBundleProductActionGroup.xml @@ -0,0 +1,65 @@ +<?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="AdminCreateApiFixedBundleProductActionGroup"> + <annotations> + <description>Creates 4 products with varying prices. Creates the bundle product with specified name. Adds the multiple select and checkbox options and 4 links to the created products. Uses the 'ApiFixedBundleProduct' entity.</description> + </annotations> + <arguments> + <argument name="productName" defaultValue="Api Fixed Bundle Product" type="string"/> + </arguments> + + <!--Create 4 simple products--> + <createData entity="SimpleProduct2" stepKey="simpleProduct1"> + <field key="price">4.99</field> + </createData> + <createData entity="SimpleProduct2" stepKey="simpleProduct2"> + <field key="price">2.89</field> + </createData> + <createData entity="SimpleProduct2" stepKey="simpleProduct3"> + <field key="price">7.33</field> + </createData> + <createData entity="SimpleProduct2" stepKey="simpleProduct4"> + <field key="price">18.25</field> + </createData> + + <!-- Create the bundle product based --> + <createData entity="ApiFixedBundleProduct" stepKey="createBundleProduct"> + <field key="name">{{productName}}</field> + </createData> + <createData entity="MultipleSelectOption" stepKey="createBundleOption1_1"> + <requiredEntity createDataKey="createBundleProduct"/> + <field key="required">false</field> + </createData> + <createData entity="CheckboxOption" stepKey="createBundleOption1_2"> + <requiredEntity createDataKey="createBundleProduct"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkOptionToProduct"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createBundleOption1_1"/> + <requiredEntity createDataKey="simpleProduct1"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkOptionToProduct2"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createBundleOption1_1"/> + <requiredEntity createDataKey="simpleProduct2"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkOptionToProduct3"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createBundleOption1_2"/> + <requiredEntity createDataKey="simpleProduct3"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkOptionToProduct4"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createBundleOption1_2"/> + <requiredEntity createDataKey="simpleProduct4"/> + </createData> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/EnableDisableProductActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AncillaryPrepBundleProductActionGroup.xml similarity index 51% rename from app/code/Magento/Bundle/Test/Mftf/ActionGroup/EnableDisableProductActionGroup.xml rename to app/code/Magento/Bundle/Test/Mftf/ActionGroup/AncillaryPrepBundleProductActionGroup.xml index 92d885485949c..99551742deca1 100644 --- a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/EnableDisableProductActionGroup.xml +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AncillaryPrepBundleProductActionGroup.xml @@ -7,8 +7,8 @@ --> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AncillaryPrepBundleProduct"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AncillaryPrepBundleProductActionGroup"> <annotations> <description>Requires Navigation to the Product Creation page. Fills out Name, Sku, and SEO information using the BundleProduct Data Entity. PLEASE NOTE: The Action Group values are Hardcoded.</description> </annotations> @@ -25,19 +25,4 @@ <!--Fill URL input--> <fillField userInput="{{BundleProduct.urlKey}}" selector="{{AdminProductFormBundleSection.urlKey}}" stepKey="FillsinSEOlinkExtension"/> </actionGroup> - - <!--Edit existing product by searching in product catalog--> - <actionGroup name="FindProductToEdit"> - <annotations> - <description>Clears the Backend Admin Grid Filters on the Backend Admin Product Grid page. Searches for the BundleProduct Data Entity. Then clicks on the first item in the Admin Grid. PLEASE NOTE: The Action Group values are Hardcoded.</description> - </annotations> - - <amOnPage url="{{ProductCatalogPage.url}}" stepKey="GoToProductCatalog"/> - <waitForPageLoad stepKey="WaitForCatalogProductPageToLoad"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <fillField userInput="{{BundleProduct.name}}" selector="#fulltext" stepKey="EnterProductNameInSearch"/> - <click stepKey="ClickSearch" selector="{{AdminProductFormBundleSection.searchButton}}"/> - <click stepKey="ClickOnProduct" selector="{{AdminProductFormBundleSection.firstCatalogProduct}}"/> - <waitForPageLoad stepKey="WaitForProductEditPageToLoad"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/CheckRequiredFieldsInBundleProductFormActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/CheckRequiredFieldsInBundleProductFormActionGroup.xml new file mode 100644 index 0000000000000..9575349ba3110 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/CheckRequiredFieldsInBundleProductFormActionGroup.xml @@ -0,0 +1,23 @@ +<?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="CheckRequiredFieldsInBundleProductFormActionGroup"> + <annotations> + <description>Clears the Name and SKU fields when adding a Product and then verifies that they are required after attempting to Save.</description> + </annotations> + + <clearField selector="{{AdminProductFormSection.productName}}" stepKey="clearProductSku"/> + <clearField selector="{{AdminProductFormSection.productSku}}" stepKey="clearProductName"/> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Product" stepKey="seeStillOnEditPage"/> + <see selector="{{AdminProductFormSection.fieldError('name')}}" userInput="This is a required field." stepKey="seeNameRequired"/> + <see selector="{{AdminProductFormSection.fieldError('sku')}}" userInput="This is a required field." stepKey="seeSkuRequired"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/CreateBasicBundleProductActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/CreateBasicBundleProductActionGroup.xml new file mode 100644 index 0000000000000..fd81b392db708 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/CreateBasicBundleProductActionGroup.xml @@ -0,0 +1,29 @@ +<?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="CreateBasicBundleProductActionGroup"> + <annotations> + <description>Requires Navigation to the Product Creation page. Fills out Name, Sku, and SEO information using the BundleProduct Data Entity. PLEASE NOTE: The Action Group values are Hardcoded.</description> + </annotations> + + <!--PreReq: Go to bundle product creation page--> + <!--Product name and SKU--> + <fillField selector="{{AdminProductFormBundleSection.productName}}" userInput="{{BundleProduct.name}}" stepKey="fillProductName"/> + <fillField selector="{{AdminProductFormBundleSection.productSku}}" userInput="{{BundleProduct.sku}}" stepKey="fillProductSku"/> + + <!--Trigger SEO drop down--> + <scrollTo selector="{{AdminProductFormBundleSection.seoDropdown}}" stepKey="scrollToSeoDropDown"/> + <conditionalClick selector="{{AdminProductFormBundleSection.seoDropdown}}" dependentSelector="{{AdminProductFormBundleSection.urlKey}}" visible="false" stepKey="openDropDownIfClosed"/> + <waitForPageLoad stepKey="waitForDropDownSEO"/> + + <!--Fill URL input--> + <fillField userInput="{{BundleProduct.urlKey}}" selector="{{AdminProductFormBundleSection.urlKey}}" stepKey="fillsInSeoLinkExtension"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/CreateBundleProductActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/CreateBundleProductActionGroup.xml deleted file mode 100644 index 33740c346155a..0000000000000 --- a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/CreateBundleProductActionGroup.xml +++ /dev/null @@ -1,162 +0,0 @@ -<?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="CreateBasicBundleProduct"> - <annotations> - <description>Requires Navigation to the Product Creation page. Fills out Name, Sku, and SEO information using the BundleProduct Data Entity. PLEASE NOTE: The Action Group values are Hardcoded.</description> - </annotations> - - <!--PreReq: Go to bundle product creation page--> - <!--Product name and SKU--> - <fillField selector="{{AdminProductFormBundleSection.productName}}" userInput="{{BundleProduct.name}}" stepKey="fillProductName"/> - <fillField selector="{{AdminProductFormBundleSection.productSku}}" userInput="{{BundleProduct.sku}}" stepKey="fillProductSku"/> - - <!--Trigger SEO drop down--> - <scrollTo selector="{{AdminProductFormBundleSection.seoDropdown}}" stepKey="scrollToSeoDropDown"/> - <conditionalClick selector="{{AdminProductFormBundleSection.seoDropdown}}" dependentSelector="{{AdminProductFormBundleSection.urlKey}}" visible="false" stepKey="openDropDownIfClosed"/> - <waitForPageLoad stepKey="waitForDropDownSEO"/> - - <!--Fill URL input--> - <fillField userInput="{{BundleProduct.urlKey}}" selector="{{AdminProductFormBundleSection.urlKey}}" stepKey="fillsInSeoLinkExtension"/> - </actionGroup> - - <actionGroup name="addBundleOptionWithTwoProducts"> - <annotations> - <description>Requires Navigation to the Product Creation page. Adds Bundle Option with Two Products using the provided arguments. 'x' refers to Bundle option number. 'n' refers to the first number after x.</description> - </annotations> - <arguments> - <argument name="x" type="string"/> - <argument name="n" type="string"/> - <argument name="prodOneSku" type="string"/> - <argument name="prodTwoSku" type="string"/> - <argument name="optionTitle" type="string"/> - <argument name="inputType" type="string"/> - </arguments> - - <conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/> - <scrollTo selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" stepKey="scrollUpABit"/> - <click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="clickAddOption"/> - <waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle(x)}}" stepKey="waitForOptions"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle(x)}}" userInput="{{optionTitle}}" stepKey="fillTitle"/> - <selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType(x)}}" userInput="{{inputType}}" stepKey="selectType"/> - <waitForElementVisible selector="{{AdminProductFormBundleSection.nthAddProductsToOption(n)}}" stepKey="waitForAddBtn"/> - <click selector="{{AdminProductFormBundleSection.nthAddProductsToOption(n)}}" stepKey="clickAdd"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters1"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters1"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodOneSku}}" stepKey="fillProductSkuFilter1"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters1"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad1" time="30"/> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct1"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters2"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters2"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodTwoSku}}" stepKey="fillProductSkuFilter2"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters2"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad2" time="30"/> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct2"/> - <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddButton1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="50" stepKey="fillQuantity1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '1')}}" userInput="50" stepKey="fillQuantity2"/> - </actionGroup> - - <actionGroup name="addBundleOptionWithOneProduct" extends="addBundleOptionWithTwoProducts"> - <annotations> - <description>Requires Navigation to the Product Creation page. Adds Bundle Option with One Product as specified in arguments. 'x' refers to Bundle option number. 'n' refers to the first number after x.</description> - </annotations> - - <remove keyForRemoval="openProductFilters2"/> - <remove keyForRemoval="fillProductSkuFilter2"/> - <remove keyForRemoval="clickApplyFilters2"/> - <remove keyForRemoval="waitForFilteredGridLoad2"/> - <remove keyForRemoval="selectProduct2"/> - <remove keyForRemoval="selectProduct2"/> - <remove keyForRemoval="fillQuantity1"/> - <remove keyForRemoval="fillQuantity2"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="1" stepKey="fillQuantity" after="clickAddButton1"/> - </actionGroup> - - <actionGroup name="addBundleOptionWithTreeProducts" extends="addBundleOptionWithTwoProducts"> - <annotations> - <description>Requires Navigation to the Product Creation page. Adds Bundle Option with Three Products using the provided arguments. 'x' refers to Bundle option number. 'n' refers to the first number after x.</description> - </annotations> - <arguments> - <argument name="prodTreeSku" type="string"/> - </arguments> - - <remove keyForRemoval="fillQuantity1"/> - <remove keyForRemoval="fillQuantity2"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters3" after="selectProduct2"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters3" after="clickClearFilters3"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodTreeSku}}" stepKey="fillProductSkuFilter3" after="openProductFilters3"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters3" after="fillProductSkuFilter3"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad3" time="30" after="clickApplyFilters3"/> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct3" after="waitForFilteredGridLoad3"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="1" stepKey="fillQuantity1" after="clickAddButton1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '1')}}" userInput="1" stepKey="fillQuantity2" after="fillQuantity1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '2')}}" userInput="1" stepKey="fillQuantity3" after="fillQuantity2"/> - </actionGroup> - - <actionGroup name="addBundleOptionWithSixProducts" extends="addBundleOptionWithTwoProducts"> - <annotations> - <description>Requires Navigation to Product Creation page. Adds Bundle Option with Six Products as specified in arguments. 'x' refers to Bundle option number. 'n' refers to the first number after x.</description> - </annotations> - <arguments> - <argument name="prodTreeSku" type="string"/> - <argument name="prodFourSku" type="string"/> - <argument name="prodFiveSku" type="string"/> - <argument name="prodSixSku" type="string"/> - </arguments> - - <remove keyForRemoval="fillQuantity1"/> - <remove keyForRemoval="fillQuantity2"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters3" after="selectProduct2"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters3" after="clickClearFilters3"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodTreeSku}}" stepKey="fillProductSkuFilter3" after="openProductFilters3"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters3" after="fillProductSkuFilter3"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad3" time="30" after="clickApplyFilters3"/> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct3" after="waitForFilteredGridLoad3"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters4" after="selectProduct3"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters4" after="clickClearFilters4"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodFourSku}}" stepKey="fillProductSkuFilter4" after="openProductFilters4"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters4" after="fillProductSkuFilter4"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad4" time="30" after="clickApplyFilters4"/> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct4" after="clickApplyFilters4"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters5" after="selectProduct4"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters5" after="clickClearFilters5"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodFiveSku}}" stepKey="fillProductSkuFilter5" after="openProductFilters5"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters5" after="fillProductSkuFilter5"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad5" time="30" after="clickApplyFilters5"/> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct5" after="waitForFilteredGridLoad5"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters6" after="selectProduct5"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters6" after="clickClearFilters6"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodSixSku}}" stepKey="fillProductSkuFilter6" after="openProductFilters6"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters6" after="fillProductSkuFilter6"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad6" time="30" after="clickApplyFilters6"/> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct6" after="waitForFilteredGridLoad6"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="2" stepKey="fillQuantity1" after="clickAddButton1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '1')}}" userInput="2" stepKey="fillQuantity2" after="fillQuantity1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '2')}}" userInput="2" stepKey="fillQuantity3" after="fillQuantity2"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '3')}}" userInput="2" stepKey="fillQuantity4" after="fillQuantity3"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '4')}}" userInput="2" stepKey="fillQuantity5" after="fillQuantity4"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '5')}}" userInput="2" stepKey="fillQuantity6" after="fillQuantity5"/> - </actionGroup> - - <actionGroup name="deleteBundleOptionByIndex"> - <annotations> - <description>Requires Navigation to Product Creation page. Removes any Bundle Option by index specified in arguments. 'deleteIndex' refers to Bundle option number.</description> - </annotations> - <arguments> - <argument name="deleteIndex" type="string"/> - </arguments> - - <conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/> - <scrollTo selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" stepKey="scrollUpABit"/> - <click selector="{{AdminProductFormBundleSection.deleteOption(deleteIndex)}}" stepKey="clickDeleteOption"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/DeleteBundleOptionByIndexActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/DeleteBundleOptionByIndexActionGroup.xml new file mode 100644 index 0000000000000..52a4897f8e354 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/DeleteBundleOptionByIndexActionGroup.xml @@ -0,0 +1,23 @@ +<?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="DeleteBundleOptionByIndexActionGroup"> + <annotations> + <description>Requires Navigation to Product Creation page. Removes any Bundle Option by index specified in arguments. 'deleteIndex' refers to Bundle option number.</description> + </annotations> + <arguments> + <argument name="deleteIndex" type="string"/> + </arguments> + + <conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/> + <scrollTo selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" stepKey="scrollUpABit"/> + <click selector="{{AdminProductFormBundleSection.deleteOption(deleteIndex)}}" stepKey="clickDeleteOption"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/FillMainBundleProductFormActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/FillMainBundleProductFormActionGroup.xml new file mode 100644 index 0000000000000..71baf0c450759 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/FillMainBundleProductFormActionGroup.xml @@ -0,0 +1,23 @@ +<?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="FillMainBundleProductFormActionGroup"> + <annotations> + <description>Fills the Name, SKU and Stock Status fields.</description> + </annotations> + <arguments> + <argument name="product" defaultValue="BundleProduct"/> + </arguments> + + <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductSku"/> + <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductName"/> + <selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{product.status}}" stepKey="selectStockStatus"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/FindProductToEditActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/FindProductToEditActionGroup.xml new file mode 100644 index 0000000000000..bd6dbb79489b3 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/FindProductToEditActionGroup.xml @@ -0,0 +1,24 @@ +<?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="FindProductToEditActionGroup"> + <annotations> + <description>Clears the Backend Admin Grid Filters on the Backend Admin Product Grid page. Searches for the BundleProduct Data Entity. Then clicks on the first item in the Admin Grid. PLEASE NOTE: The Action Group values are Hardcoded.</description> + </annotations> + + <amOnPage url="{{ProductCatalogPage.url}}" stepKey="GoToProductCatalog"/> + <waitForPageLoad stepKey="WaitForCatalogProductPageToLoad"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> + <fillField userInput="{{BundleProduct.name}}" selector="#fulltext" stepKey="EnterProductNameInSearch"/> + <click stepKey="ClickSearch" selector="{{AdminProductFormBundleSection.searchButton}}"/> + <click stepKey="ClickOnProduct" selector="{{AdminProductFormBundleSection.firstCatalogProduct}}"/> + <waitForPageLoad stepKey="WaitForProductEditPageToLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontAddBundleProductFromCategoryToCartActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontAddBundleProductFromCategoryToCartActionGroup.xml new file mode 100644 index 0000000000000..ccfa356881594 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontAddBundleProductFromCategoryToCartActionGroup.xml @@ -0,0 +1,27 @@ +<?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="StorefrontAddBundleProductFromCategoryToCartActionGroup"> + <annotations> + <description>Adds a Bundled Product to the Cart from the Product page. PLEASE NOTE: The Quantity selection is not available in the Action Group.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + </arguments> + + <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductTitleByName(productName)}}" stepKey="moveMouseOverProduct"/> + <click selector="{{StorefrontCategoryProductSection.ProductTitleByName(productName)}}" stepKey="openProductPage"/> + <waitForPageLoad time="30" stepKey="waitForBundleProductPageLoad"/> + <click selector="{{StorefrontBundledSection.addToCart}}" stepKey="clickCustomizeAndAddToCart"/> + <click selector="{{StorefrontBundledSection.addToCartConfigured}}" stepKey="clickAddBundleProductToCart"/> + <waitForElementVisible selector="{{StorefrontMinicartSection.productCount}}" stepKey="waitProductCount"/> + <see userInput="You added {{productName}} to your shopping cart." selector="{{StorefrontMessagesSection.success}}" stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontAddBundleProductFromProductToCartActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontAddBundleProductFromProductToCartActionGroup.xml new file mode 100644 index 0000000000000..cf4cfa4659264 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontAddBundleProductFromProductToCartActionGroup.xml @@ -0,0 +1,24 @@ +<?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="StorefrontAddBundleProductFromProductToCartActionGroup"> + <annotations> + <description>Adds a Bundled Product to the Cart from the Product page. PLEASE NOTE: The Quantity selection is not available in the Action Group.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + </arguments> + + <click selector="{{StorefrontBundledSection.addToCart}}" stepKey="clickCustomizeAndAddToCart"/> + <click selector="{{StorefrontBundledSection.addToCartConfigured}}" stepKey="clickAddBundleProductToCart"/> + <waitForElementVisible selector="{{StorefrontMinicartSection.productCount}}" stepKey="waitProductCount"/> + <see userInput="You added {{productName}} to your shopping cart." selector="{{StorefrontMessagesSection.success}}" stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontAddBundleProductFromProductToCartWithMultiOptionActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontAddBundleProductFromProductToCartWithMultiOptionActionGroup.xml new file mode 100644 index 0000000000000..49adf670b4c98 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontAddBundleProductFromProductToCartWithMultiOptionActionGroup.xml @@ -0,0 +1,22 @@ +<?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="StorefrontAddBundleProductFromProductToCartWithMultiOptionActionGroup" extends="StorefrontAddBundleProductFromProductToCartActionGroup"> + <annotations> + <description>Selects a Bundled Product option on the Bundled Product page. PLEASE NOTE: The Quantity selection is not available in the Action Group.</description> + </annotations> + <arguments> + <argument name="optionName" type="string"/> + <argument name="value" type="string"/> + </arguments> + + <selectOption selector="{{StorefrontBundledSection.multiselectOptionFourProducts(optionName)}}" userInput="{{value}}" stepKey="selectValue" before="clickAddBundleProductToCart"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontAddCategoryBundleProductToCartActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontAddCategoryBundleProductToCartActionGroup.xml new file mode 100644 index 0000000000000..bf0e7068fbbde --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontAddCategoryBundleProductToCartActionGroup.xml @@ -0,0 +1,30 @@ +<?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="StorefrontAddCategoryBundleProductToCartActionGroup"> + <annotations> + <description>Adds a Bundled Product to the Cart from the Category page.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="quantity" defaultValue="1" type="string"/> + </arguments> + + <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct"/> + <click selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="clickAddToCart"/> + <waitForPageLoad time="30" stepKey="waitForPageLoad1"/> + <click selector="{{StorefrontBundleProductActionSection.customizeAndAddToCartButton}}" stepKey="clickCustomizeAndAddToCart"/> + <waitForPageLoad time="30" stepKey="waitForPageLoad2"/> + <fillField selector="{{StorefrontBundleProductActionSection.quantityField}}" userInput="{{quantity}}" stepKey="fillBundleProductQuantity"/> + <click selector="{{StorefrontBundleProductActionSection.addToCartButton}}" stepKey="clickAddBundleProductToCart"/> + <waitForPageLoad time="30" stepKey="waitForPageLoad3"/> + <waitForText userInput="{{quantity}}" selector="{{StorefrontMinicartSection.productCount}}" time="30" stepKey="assertProductCount"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontProductCartActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontProductCartActionGroup.xml deleted file mode 100644 index b260068dedf7c..0000000000000 --- a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontProductCartActionGroup.xml +++ /dev/null @@ -1,77 +0,0 @@ -<?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"> - <!-- Add Bundle Product to Cart from the category page with specified quantity to cart --> - <actionGroup name="StorefrontAddCategoryBundleProductToCartActionGroup"> - <annotations> - <description>Adds a Bundled Product to the Cart from the Category page.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="quantity" defaultValue="1" type="string"/> - </arguments> - - <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct"/> - <click selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="clickAddToCart"/> - <waitForPageLoad time="30" stepKey="waitForPageLoad1"/> - <click selector="{{StorefrontBundleProductActionSection.customizeAndAddToCartButton}}" stepKey="clickCustomizeAndAddToCart"/> - <waitForPageLoad time="30" stepKey="waitForPageLoad2"/> - <fillField selector="{{StorefrontBundleProductActionSection.quantityField}}" userInput="{{quantity}}" stepKey="fillBundleProductQuantity"/> - <click selector="{{StorefrontBundleProductActionSection.addToCartButton}}" stepKey="clickAddBundleProductToCart"/> - <waitForPageLoad time="30" stepKey="waitForPageLoad3"/> - <waitForText userInput="{{quantity}}" selector="{{StorefrontMinicartSection.productCount}}" time="30" stepKey="assertProductCount"/> - </actionGroup> - - <!-- Add Bundle Product to Cart from the category page --> - <actionGroup name="StorefrontAddBundleProductFromCategoryToCartActionGroup"> - <annotations> - <description>Adds a Bundled Product to the Cart from the Product page. PLEASE NOTE: The Quantity selection is not available in the Action Group.</description> - </annotations> - <arguments> - <argument name="productName" type="string"/> - </arguments> - - <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductTitleByName(productName)}}" stepKey="moveMouseOverProduct"/> - <click selector="{{StorefrontCategoryProductSection.ProductTitleByName(productName)}}" stepKey="openProductPage"/> - <waitForPageLoad time="30" stepKey="waitForBundleProductPageLoad"/> - <click selector="{{StorefrontBundledSection.addToCart}}" stepKey="clickCustomizeAndAddToCart"/> - <click selector="{{StorefrontBundledSection.addToCartConfigured}}" stepKey="clickAddBundleProductToCart"/> - <waitForElementVisible selector="{{StorefrontMinicartSection.productCount}}" stepKey="waitProductCount"/> - <see userInput="You added {{productName}} to your shopping cart." selector="{{StorefrontMessagesSection.success}}" stepKey="seeSuccessMessage"/> - </actionGroup> - - <!-- Add Bundle Product to Cart from product Page--> - <actionGroup name="StorefrontAddBundleProductFromProductToCartActionGroup"> - <annotations> - <description>Adds a Bundled Product to the Cart from the Product page. PLEASE NOTE: The Quantity selection is not available in the Action Group.</description> - </annotations> - <arguments> - <argument name="productName" type="string"/> - </arguments> - - <click selector="{{StorefrontBundledSection.addToCart}}" stepKey="clickCustomizeAndAddToCart"/> - <click selector="{{StorefrontBundledSection.addToCartConfigured}}" stepKey="clickAddBundleProductToCart"/> - <waitForElementVisible selector="{{StorefrontMinicartSection.productCount}}" stepKey="waitProductCount"/> - <see userInput="You added {{productName}} to your shopping cart." selector="{{StorefrontMessagesSection.success}}" stepKey="seeSuccessMessage"/> - </actionGroup> - - <!-- Add Bundled Product to Cart with selected multiselect option--> - <actionGroup name="StorefrontAddBundleProductFromProductToCartWithMultiOption" extends="StorefrontAddBundleProductFromProductToCartActionGroup"> - <annotations> - <description>Selects a Bundled Product option on the Bundled Product page. PLEASE NOTE: The Quantity selection is not available in the Action Group.</description> - </annotations> - <arguments> - <argument name="optionName" type="string"/> - <argument name="value" type="string"/> - </arguments> - - <selectOption selector="{{StorefrontBundledSection.multiselectOptionFourProducts(optionName)}}" userInput="{{value}}" stepKey="selectValue" before="clickAddBundleProductToCart"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminBundleProductActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/ViewBundleProductInAdminGridActionGroup.xml similarity index 50% rename from app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminBundleProductActionGroup.xml rename to app/code/Magento/Bundle/Test/Mftf/ActionGroup/ViewBundleProductInAdminGridActionGroup.xml index e49126f4cf275..96179b49206c8 100644 --- a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminBundleProductActionGroup.xml +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/ViewBundleProductInAdminGridActionGroup.xml @@ -7,36 +7,7 @@ --> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <!--Fill main fields in create product form--> - <actionGroup name="fillMainBundleProductForm"> - <annotations> - <description>Fills the Name, SKU and Stock Status fields.</description> - </annotations> - <arguments> - <argument name="product" defaultValue="BundleProduct"/> - </arguments> - - <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductSku"/> - <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductName"/> - <selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{product.status}}" stepKey="selectStockStatus"/> - </actionGroup> - - <!--Check that required fields are actually required--> - <actionGroup name="checkRequiredFieldsInBundleProductForm"> - <annotations> - <description>Clears the Name and SKU fields when adding a Product and then verifies that they are required after attempting to Save.</description> - </annotations> - - <clearField selector="{{AdminProductFormSection.productName}}" stepKey="clearProductSku"/> - <clearField selector="{{AdminProductFormSection.productSku}}" stepKey="clearProductName"/> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Product" stepKey="seeStillOnEditPage"/> - <see selector="{{AdminProductFormSection.fieldError('name')}}" userInput="This is a required field." stepKey="seeNameRequired"/> - <see selector="{{AdminProductFormSection.fieldError('sku')}}" userInput="This is a required field." stepKey="seeSkuRequired"/> - </actionGroup> - - <!--Filter product grid and see expected product--> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="viewBundleProductInAdminGrid"> <annotations> <description>Clears the Grid Filters on the Catalog Grid page and applies Filter by Name and Sku. Then checks to see if the Product exists in the 1st row. Then clears the Grid Filters again for future Tests.</description> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml index 401d360a34c64..f2cd278451724 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml @@ -64,7 +64,7 @@ <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> <!--Fill out ancillary data on bundle product--> - <actionGroup ref="AncillaryPrepBundleProduct" stepKey="createBundledProductForTwoSimpleProducts"> + <actionGroup ref="AncillaryPrepBundleProductActionGroup" stepKey="createBundledProductForTwoSimpleProducts"> <argument name="bundleProduct" value="BundleProduct"/> </actionGroup> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminCreateAndEditBundleProductSettingsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminCreateAndEditBundleProductSettingsTest.xml index 42584a31651d7..2418668235262 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminCreateAndEditBundleProductSettingsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminCreateAndEditBundleProductSettingsTest.xml @@ -47,10 +47,10 @@ </actionGroup> <!-- Fill all main fields --> - <actionGroup ref="fillMainBundleProductForm" stepKey="fillMainProductFields"/> + <actionGroup ref="FillMainBundleProductFormActionGroup" stepKey="fillMainProductFields"/> <!-- Add the bundle option to the product --> - <actionGroup ref="addBundleOptionWithOneProduct" stepKey="addBundleOption"> + <actionGroup ref="AddBundleOptionWithOneProductActionGroup" stepKey="addBundleOption"> <argument name="x" value="0"/> <argument name="n" value="1"/> <argument name="prodOneSku" value="$$createSimpleProduct.sku$$"/> @@ -189,10 +189,10 @@ </actionGroup> <!-- Fill all main fields --> - <actionGroup ref="fillMainBundleProductForm" stepKey="fillMainProductFields"/> + <actionGroup ref="FillMainBundleProductFormActionGroup" stepKey="fillMainProductFields"/> <!-- Add first bundle option to the product --> - <actionGroup ref="addBundleOptionWithTwoProducts" stepKey="addFirstBundleOption"> + <actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addFirstBundleOption"> <argument name="x" value="0"/> <argument name="n" value="1"/> <argument name="prodOneSku" value="$$createFirstSimpleProduct.sku$$"/> @@ -202,7 +202,7 @@ </actionGroup> <!-- Add second bundle option to the product --> - <actionGroup ref="addBundleOptionWithTwoProducts" stepKey="addSecondBundleOption"> + <actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addSecondBundleOption"> <argument name="x" value="1"/> <argument name="n" value="2"/> <argument name="prodOneSku" value="$$createFirstSimpleProduct.sku$$"/> @@ -212,7 +212,7 @@ </actionGroup> <!-- Add third bundle option to the product --> - <actionGroup ref="addBundleOptionWithTwoProducts" stepKey="addThirdBundleOption"> + <actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addThirdBundleOption"> <argument name="x" value="2"/> <argument name="n" value="3"/> <argument name="prodOneSku" value="$$createFirstSimpleProduct.sku$$"/> @@ -238,7 +238,7 @@ </actionGroup> <!-- Remove second option --> - <actionGroup ref="deleteBundleOptionByIndex" stepKey="deleteSecondOption"> + <actionGroup ref="DeleteBundleOptionByIndexActionGroup" stepKey="deleteSecondOption"> <argument name="deleteIndex" value="1"/> </actionGroup> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteABundleProduct.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteABundleProduct.xml index 86db6f372b5f8..0b91141f9369a 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteABundleProduct.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteABundleProduct.xml @@ -53,7 +53,7 @@ <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> <!--Fill out ancillary data on bundle product--> - <actionGroup ref="AncillaryPrepBundleProduct" stepKey="createBundledProductForTwoSimpleProducts"/> + <actionGroup ref="AncillaryPrepBundleProductActionGroup" stepKey="createBundledProductForTwoSimpleProducts"/> <!--Save the product--> <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminFilterProductListByBundleProduct.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminFilterProductListByBundleProduct.xml index 40a6e1b75c60a..bb1893f69d785 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminFilterProductListByBundleProduct.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminFilterProductListByBundleProduct.xml @@ -53,7 +53,7 @@ <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> <!--Fill out ancillary data on bundle product--> - <actionGroup ref="AncillaryPrepBundleProduct" stepKey="createBundledProductForTwoSimpleProducts"/> + <actionGroup ref="AncillaryPrepBundleProductActionGroup" stepKey="createBundledProductForTwoSimpleProducts"/> <!--Save the product--> <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProducts.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProducts.xml index 2f891fcc8f169..16a109032556b 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProducts.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProducts.xml @@ -61,7 +61,7 @@ <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> <!--Fill out ancillary data on bundle product--> - <actionGroup ref="AncillaryPrepBundleProduct" stepKey="createBundledProductForTwoSimpleProducts"> + <actionGroup ref="AncillaryPrepBundleProductActionGroup" stepKey="createBundledProductForTwoSimpleProducts"> <argument name="bundleProduct" value="BundleProduct"/> </actionGroup> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminProductBundleCreationTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminProductBundleCreationTest.xml index 1f46e1fc9f0b1..634d6bcf53547 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminProductBundleCreationTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminProductBundleCreationTest.xml @@ -61,7 +61,7 @@ <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> <!--Create a bundle product with ancillary data--> - <actionGroup ref="CreateBasicBundleProduct" stepKey="createBundledProduct"> + <actionGroup ref="CreateBasicBundleProductActionGroup" stepKey="createBundledProduct"> <argument name="bundleProduct" value="BundleProduct"/> </actionGroup> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductFixedPricingTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductFixedPricingTest.xml index c922b981aecd9..08763ea67da00 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductFixedPricingTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductFixedPricingTest.xml @@ -63,7 +63,7 @@ <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> <!--Fill out ancillary data on bundle product--> - <actionGroup ref="AncillaryPrepBundleProduct" stepKey="createBundledProductForTwoSimpleProducts"> + <actionGroup ref="AncillaryPrepBundleProductActionGroup" stepKey="createBundledProductForTwoSimpleProducts"> <argument name="bundleProduct" value="BundleProduct"/> </actionGroup> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductWithTierPriceInCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductWithTierPriceInCartTest.xml index 46c6114637af6..1536eadfe1329 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductWithTierPriceInCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductWithTierPriceInCartTest.xml @@ -37,8 +37,8 @@ </after> <amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage"/> <waitForPageLoad stepKey="waitForBundleProductCreatePageToLoad"/> - <actionGroup ref="fillMainBundleProductForm" stepKey="fillMainFieldsForBundle"/> - <actionGroup ref="addBundleOptionWithOneProduct" stepKey="addBundleOption1"> + <actionGroup ref="FillMainBundleProductFormActionGroup" stepKey="fillMainFieldsForBundle"/> + <actionGroup ref="AddBundleOptionWithOneProductActionGroup" stepKey="addBundleOption1"> <argument name="x" value="0"/> <argument name="n" value="1"/> <argument name="prodOneSku" value="$$simpleProduct1.sku$$"/> @@ -46,7 +46,7 @@ <argument name="optionTitle" value="Option1"/> <argument name="inputType" value="checkbox"/> </actionGroup> - <actionGroup ref="addBundleOptionWithOneProduct" stepKey="addBundleOption2"> + <actionGroup ref="AddBundleOptionWithOneProductActionGroup" stepKey="addBundleOption2"> <argument name="x" value="1"/> <argument name="n" value="2"/> <argument name="prodOneSku" value="$$simpleProduct2.sku$$"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/CurrencyChangingBundleProductInCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/CurrencyChangingBundleProductInCartTest.xml index ded8bb3c83337..42d8ab522787b 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/CurrencyChangingBundleProductInCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/CurrencyChangingBundleProductInCartTest.xml @@ -46,9 +46,9 @@ <!--Go to bundle product creation page--> <amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage"/> <waitForPageLoad stepKey="waitForBundleProductCreatePageToLoad"/> - <actionGroup ref="fillMainBundleProductForm" stepKey="fillMainFieldsForBundle"/> + <actionGroup ref="FillMainBundleProductFormActionGroup" stepKey="fillMainFieldsForBundle"/> <!-- Add Option, a "Radio Buttons" type option --> - <actionGroup ref="addBundleOptionWithTwoProducts" stepKey="addBundleOptionWithTwoProducts2"> + <actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addBundleOptionWithTwoProducts2"> <argument name="x" value="0"/> <argument name="n" value="1"/> <argument name="prodOneSku" value="$$simpleProduct1.sku$$"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/EnableDisableBundleProductStatusTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/EnableDisableBundleProductStatusTest.xml index 0cfd1f99a8ce0..16e64c5584450 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/EnableDisableBundleProductStatusTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/EnableDisableBundleProductStatusTest.xml @@ -59,7 +59,7 @@ <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> <!--Fill out ancillary data on bundle product--> - <actionGroup ref="AncillaryPrepBundleProduct" stepKey="createBundledProductForTwoSimpleProducts"> + <actionGroup ref="AncillaryPrepBundleProductActionGroup" stepKey="createBundledProductForTwoSimpleProducts"> <argument name="bundleProduct" value="BundleProduct"/> </actionGroup> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml index ff192538637ef..713262e6ada01 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml @@ -60,7 +60,7 @@ <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> - <actionGroup ref="AncillaryPrepBundleProduct" stepKey="createBundledProductForTwoSimpleProducts"/> + <actionGroup ref="AncillaryPrepBundleProductActionGroup" stepKey="createBundledProductForTwoSimpleProducts"/> <!--Save the product--> <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleOptionsToCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleOptionsToCartTest.xml index a1630128638d9..fe20044e9ae2a 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleOptionsToCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleOptionsToCartTest.xml @@ -62,7 +62,7 @@ </actionGroup> <!-- Add Option One, a "Checkbox" type option, with tree products --> - <actionGroup ref="addBundleOptionWithTreeProducts" stepKey="addBundleOptionWithTreeProducts"> + <actionGroup ref="AddBundleOptionWithThreeProductsActionGroup" stepKey="addBundleOptionWithTreeProducts"> <argument name="x" value="0"/> <argument name="n" value="1"/> <argument name="prodOneSku" value="$$simpleProduct1.sku$$"/> @@ -73,7 +73,7 @@ </actionGroup> <!-- Add Option Two, a "Radio Buttons" type option, with one product --> - <actionGroup ref="addBundleOptionWithOneProduct" stepKey="addBundleOptionWithOneProduct"> + <actionGroup ref="AddBundleOptionWithOneProductActionGroup" stepKey="addBundleOptionWithOneProduct"> <argument name="x" value="1"/> <argument name="n" value="2"/> <argument name="prodOneSku" value="$$simpleProduct4.sku$$"/> @@ -83,7 +83,7 @@ </actionGroup> <!-- Add Option Tree, a "Checkbox" type option, with six products --> - <actionGroup ref="addBundleOptionWithSixProducts" stepKey="addBundleOptionWithSixProducts"> + <actionGroup ref="AddBundleOptionWithSixProductsActionGroup" stepKey="addBundleOptionWithSixProducts"> <argument name="x" value="2"/> <argument name="n" value="3"/> <argument name="prodOneSku" value="$$simpleProduct5.sku$$"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleCartTest.xml index 695c3a8bf7dbb..4c2a25977b5b4 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleCartTest.xml @@ -40,7 +40,7 @@ </actionGroup> <!-- Add Option One, a "Drop-down" type option --> - <actionGroup ref="addBundleOptionWithTwoProducts" stepKey="addBundleOptionWithTwoProducts1"> + <actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addBundleOptionWithTwoProducts1"> <argument name="x" value="0"/> <argument name="n" value="1"/> <argument name="prodOneSku" value="$$simpleProduct1.sku$$"/> @@ -50,7 +50,7 @@ </actionGroup> <!-- Add Option Two, a "Radio Buttons" type option --> - <actionGroup ref="addBundleOptionWithTwoProducts" stepKey="addBundleOptionWithTwoProducts2"> + <actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addBundleOptionWithTwoProducts2"> <argument name="x" value="1"/> <argument name="n" value="2"/> <argument name="prodOneSku" value="$$simpleProduct1.sku$$"/> @@ -60,7 +60,7 @@ </actionGroup> <!-- Add Option Three, a "Checkbox" type option --> - <actionGroup ref="addBundleOptionWithTwoProducts" stepKey="addBundleOptionWithTwoProducts3"> + <actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addBundleOptionWithTwoProducts3"> <argument name="x" value="2"/> <argument name="n" value="3"/> <argument name="prodOneSku" value="$$simpleProduct1.sku$$"/> @@ -70,7 +70,7 @@ </actionGroup> <!-- Add Option Four, a "Multi Select" type option --> - <actionGroup ref="addBundleOptionWithTwoProducts" stepKey="addBundleOptionWithTwoProducts4"> + <actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addBundleOptionWithTwoProducts4"> <argument name="x" value="3"/> <argument name="n" value="4"/> <argument name="prodOneSku" value="$$simpleProduct1.sku$$"/> @@ -157,7 +157,7 @@ </actionGroup> <!-- Add Option One, a "Drop-down" type option --> - <actionGroup ref="addBundleOptionWithTwoProducts" stepKey="addBundleOptionWithTwoProducts1"> + <actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addBundleOptionWithTwoProducts1"> <argument name="x" value="0"/> <argument name="n" value="1"/> <argument name="prodOneSku" value="$$simpleProduct1.sku$$"/> @@ -167,7 +167,7 @@ </actionGroup> <!-- Add Option Two, a "Radio Buttons" type option --> - <actionGroup ref="addBundleOptionWithTwoProducts" stepKey="addBundleOptionWithTwoProducts2"> + <actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addBundleOptionWithTwoProducts2"> <argument name="x" value="1"/> <argument name="n" value="2"/> <argument name="prodOneSku" value="$$simpleProduct1.sku$$"/> @@ -177,7 +177,7 @@ </actionGroup> <!-- Add Option Three, a "Checkbox" type option --> - <actionGroup ref="addBundleOptionWithTwoProducts" stepKey="addBundleOptionWithTwoProducts3"> + <actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addBundleOptionWithTwoProducts3"> <argument name="x" value="2"/> <argument name="n" value="3"/> <argument name="prodOneSku" value="$$simpleProduct1.sku$$"/> @@ -187,7 +187,7 @@ </actionGroup> <!-- Add Option Four, a "Multi Select" type option --> - <actionGroup ref="addBundleOptionWithTwoProducts" stepKey="addBundleOptionWithTwoProducts4"> + <actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addBundleOptionWithTwoProducts4"> <argument name="x" value="3"/> <argument name="n" value="4"/> <argument name="prodOneSku" value="$$simpleProduct1.sku$$"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml index d7394b2dbf32e..2b77e8c5ae338 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml @@ -68,7 +68,7 @@ <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> <!--Create a basic bundle product--> - <actionGroup ref="CreateBasicBundleProduct" stepKey="createBundledProductForTwoSimpleProducts"> + <actionGroup ref="CreateBasicBundleProductActionGroup" stepKey="createBundledProductForTwoSimpleProducts"> <argument name="bundleProduct" value="BundleProduct"/> </actionGroup> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductShownInCategoryListAndGrid.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductShownInCategoryListAndGrid.xml index 88db5b64fa42d..fdaeeb7e2955d 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductShownInCategoryListAndGrid.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductShownInCategoryListAndGrid.xml @@ -70,7 +70,7 @@ <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> - <actionGroup ref="AncillaryPrepBundleProduct" stepKey="createBundledProductForTwoSimpleProducts"/> + <actionGroup ref="AncillaryPrepBundleProductActionGroup" stepKey="createBundledProductForTwoSimpleProducts"/> <!--Save the product--> <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSelectAndSetBundleOptionsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSelectAndSetBundleOptionsTest.xml index 5e6e891541420..2b322b3e7e200 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSelectAndSetBundleOptionsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSelectAndSetBundleOptionsTest.xml @@ -44,7 +44,7 @@ </actionGroup> <!-- Add Option One, a "Drop-down" type option --> - <actionGroup ref="addBundleOptionWithTwoProducts" stepKey="addBundleOptionWithTwoProducts1"> + <actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addBundleOptionWithTwoProducts1"> <argument name="x" value="0"/> <argument name="n" value="1"/> <argument name="prodOneSku" value="$$simpleProduct1.sku$$"/> @@ -56,7 +56,7 @@ <checkOption selector="{{AdminProductFormBundleSection.userDefinedQuantity('0', '1')}}" stepKey="userDefinedQuantitiyOption0Product1"/> <!-- Add Option Two, a "Radio Buttons" type option --> - <actionGroup ref="addBundleOptionWithTwoProducts" stepKey="addBundleOptionWithTwoProducts2"> + <actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addBundleOptionWithTwoProducts2"> <argument name="x" value="1"/> <argument name="n" value="2"/> <argument name="prodOneSku" value="$$simpleProduct1.sku$$"/> @@ -68,7 +68,7 @@ <checkOption selector="{{AdminProductFormBundleSection.userDefinedQuantity('1', '1')}}" stepKey="userDefinedQuantitiyOption1Product1"/> <!-- Add Option Three, a "Checkbox" type option --> - <actionGroup ref="addBundleOptionWithTwoProducts" stepKey="addBundleOptionWithTwoProducts3"> + <actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addBundleOptionWithTwoProducts3"> <argument name="x" value="2"/> <argument name="n" value="3"/> <argument name="prodOneSku" value="$$simpleProduct1.sku$$"/> @@ -78,7 +78,7 @@ </actionGroup> <!-- Add Option Four, a "Multi Select" type option --> - <actionGroup ref="addBundleOptionWithTwoProducts" stepKey="addBundleOptionWithTwoProducts4"> + <actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addBundleOptionWithTwoProducts4"> <argument name="x" value="3"/> <argument name="n" value="4"/> <argument name="prodOneSku" value="$$simpleProduct1.sku$$"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml index ccd6a58223b3c..cc7711e99ff1a 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml @@ -59,7 +59,7 @@ <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> - <actionGroup ref="AncillaryPrepBundleProduct" stepKey="createBundledProductForTwoSimpleProducts"/> + <actionGroup ref="AncillaryPrepBundleProductActionGroup" stepKey="createBundledProductForTwoSimpleProducts"/> <!--Save the product--> <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml index 3b60e4b09de28..f360e746a7481 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml @@ -593,7 +593,7 @@ <argument name="productName" value="$createBundleProduct.name$"/> <argument name="productUrlKey" value="$createBundleProduct.custom_attributes[url_key]$"/> </actionGroup> - <actionGroup ref="StorefrontAddBundleProductFromProductToCartWithMultiOption" stepKey="addProductToCart"> + <actionGroup ref="StorefrontAddBundleProductFromProductToCartWithMultiOptionActionGroup" stepKey="addProductToCart"> <argument name="productName" value="$createBundleProduct.name$"/> <argument name="optionName" value="$createBundleOption1_1.name$"/> <argument name="value" value="$simpleProduct1.name$"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml index ab085dc5ae137..ec22c1fe489ee 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml @@ -73,7 +73,7 @@ <click selector="{{AdminProductFormBundleSection.categoriesLabel}}" stepKey="clickOnCategoriesLabelToCloseOptions"/> <!-- Add option, a "Radio Buttons" type option, with one product and set fixed price 200--> - <actionGroup ref="addBundleOptionWithOneProduct" stepKey="addBundleOptionWithOneProduct"> + <actionGroup ref="AddBundleOptionWithOneProductActionGroup" stepKey="addBundleOptionWithOneProduct"> <argument name="x" value="0"/> <argument name="n" value="1"/> <argument name="prodOneSku" value="$$simpleProduct.sku$$"/> From a12c1b46576a64595cd366395e8445b100221090 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 13:00:30 +0100 Subject: [PATCH 112/586] FIX: Issues when building the project (use global AdmincreateUserActionGroup instead of local one. --- .../AdminCreateUserActionGroup.xml | 36 ------------------- ...AnAdminOrderUsingBraintreePaymentTest1.xml | 9 ++--- 2 files changed, 5 insertions(+), 40 deletions(-) delete mode 100644 app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminCreateUserActionGroup.xml diff --git a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminCreateUserActionGroup.xml b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminCreateUserActionGroup.xml deleted file mode 100644 index 82491f6362573..0000000000000 --- a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminCreateUserActionGroup.xml +++ /dev/null @@ -1,36 +0,0 @@ -<?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="AdminCreateUserAction"> - <annotations> - <description>Creates a User using the NewAdmin User Entity and User Role Entity. PLEASE NOTE: The Action Group values are Hardcoded.</description> - </annotations> - - <click selector="{{AdminCreateUserSection.create}}" stepKey="clickToCreateNewUser"/> - <waitForPageLoad stepKey="waitForNewUserPageLoad" time="10"/> - <fillField selector="{{AdminCreateUserSection.usernameTextField}}" userInput="{{NewAdmin.username}}" stepKey="enterUserName"/> - <fillField selector="{{AdminCreateUserSection.firstNameTextField}}" userInput="{{NewAdmin.firstName}}" stepKey="enterFirstName"/> - <fillField selector="{{AdminCreateUserSection.lastNameTextField}}" userInput="{{NewAdmin.lastName}}" stepKey="enterLastName"/> - <fillField selector="{{AdminCreateUserSection.emailTextField}}" userInput="{{NewAdmin.email}}" stepKey="enterEmail"/> - <fillField selector="{{AdminCreateUserSection.passwordTextField}}" userInput="{{NewAdmin.password}}" stepKey="enterPassword"/> - <fillField selector="{{AdminCreateUserSection.pwConfirmationTextField}}" userInput="{{NewAdmin.password}}" stepKey="confirmPassword"/> - <fillField selector="{{AdminCreateUserSection.currentPasswordField}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="enterCurrentPassword"/> - <scrollToTopOfPage stepKey="scrollToTopOfPage"/> - <click selector="{{AdminCreateUserSection.userRoleTab}}" stepKey="clickUserRole"/> - <waitForAjaxLoad stepKey="waitForRoles" time="5"/> - <fillField selector="{{AdminCreateRoleSection.roleNameFilterTextField}}" userInput="{{role.name}}" stepKey="filterRole"/> - <click selector="{{AdminCreateRoleSection.searchButton}}" stepKey="clickSearch"/> - <waitForPageLoad stepKey="waitForSearch" time="10"/> - <click selector="{{AdminCreateRoleSection.searchResultFirstRow}}" stepKey="selectRole"/> - <click selector="{{AdminCreateUserSection.saveButton}}" stepKey="clickSaveUser"/> - <waitForPageLoad stepKey="waitForSaveUser" time="10"/> - <see userInput="You saved the user." stepKey="seeSuccessMessage"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest1.xml b/app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest1.xml index 1e134b604d497..67081ca08d97a 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest1.xml +++ b/app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest1.xml @@ -21,8 +21,6 @@ <issueId value="MQE-1576"/> </skip> </annotations> - - <before> <!--Login As Admin--> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> @@ -39,7 +37,7 @@ <!--Configure Braintree--> - <actionGroup ref="ConfigureBraintree" stepKey="configureBraintree"/> + <actionGroup ref="ConfigureBraintreeActionGroup" stepKey="configureBraintree"/> <!--Create New Role--> <actionGroup ref="GoToUserRolesActionGroup" stepKey="GoToUserRoles"/> @@ -49,7 +47,10 @@ <!--Create new admin user--> <actionGroup ref="GoToAllUsersActionGroup" stepKey="GoToAllUsers"/> <waitForPageLoad stepKey="waitForUsers" time="15"/> - <actionGroup ref="AdminCreateUserActionGroup" stepKey="AdminCreateNewUser"/> + <actionGroup ref="AdminCreateUserActionGroup" stepKey="AdminCreateNewUser"> + <argument name="role" value="role"/> + <argument name="User" value="NewAdmin"/> + </actionGroup> <!--SignOut--> <actionGroup ref="logout" stepKey="signOutFromAdmin"/> From 96e4a24e00895aa3f58e81cacd6e8dbac4b5cb5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 13:03:02 +0100 Subject: [PATCH 113/586] FIX: Issues when building the project (missing rename) --- .../Test/Mftf/ActionGroup/CreateDatabaseBackupActionGroup.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateDatabaseBackupActionGroup.xml b/app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateDatabaseBackupActionGroup.xml index 5d4e4a19509ea..171bdb88dc428 100644 --- a/app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateDatabaseBackupActionGroup.xml +++ b/app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateDatabaseBackupActionGroup.xml @@ -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="createDatabaseBackup"> + <actionGroup name="CreateDatabaseBackupActionGroup"> <annotations> <description>Creates a Database Backup using provided Backup Entity.</description> </annotations> From 2e810cf830cd285085653c74861c277579b1455b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 13:15:41 +0100 Subject: [PATCH 114/586] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- ...listIsPersistedUnderLongTermCookieTest.xml | 8 +- ...sertCustomerWishlistIsEmptyActionGroup.xml | 15 ++ ...ddCategoryProductToWishlistActionGroup.xml | 25 ++++ ...artFromWishlistUsingSidebarActionGroup.xml | 23 +++ ...ustomerAddProductToWishlistActionGroup.xml | 25 ++++ ...tomerCheckProductInWishlistActionGroup.xml | 25 ++++ ...eckProductInWishlistSidebarActionGroup.xml | 24 +++ ...stomerEditProductInWishlistActionGroup.xml | 28 ++++ ...uctFromWishlistUsingSidebarActionGroup.xml | 23 +++ ...efrontCustomerShareWishlistActionGroup.xml | 22 +++ .../StorefrontCustomerWishlistActionGroup.xml | 138 ------------------ .../Mftf/Test/EndToEndB2CLoggedInUserTest.xml | 8 +- ...uctsToCartFromWishlistUsingSidebarTest.xml | 4 +- ...teBundleDynamicProductFromWishlistTest.xml | 4 +- ...leteBundleFixedProductFromWishlistTest.xml | 2 +- ...eteConfigurableProductFromWishlistTest.xml | 2 +- ...veProductsFromWishlistUsingSidebarTest.xml | 4 +- .../Test/StorefrontUpdateWishlistTest.xml | 4 +- .../Test/WishListWithDisabledProductTest.xml | 4 +- 19 files changed, 230 insertions(+), 158 deletions(-) create mode 100644 app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontAssertCustomerWishlistIsEmptyActionGroup.xml create mode 100644 app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerAddCategoryProductToWishlistActionGroup.xml create mode 100644 app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerAddProductToCartFromWishlistUsingSidebarActionGroup.xml create mode 100644 app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerAddProductToWishlistActionGroup.xml create mode 100644 app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerCheckProductInWishlistActionGroup.xml create mode 100644 app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerCheckProductInWishlistSidebarActionGroup.xml create mode 100644 app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerEditProductInWishlistActionGroup.xml create mode 100644 app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerRemoveProductFromWishlistUsingSidebarActionGroup.xml create mode 100644 app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerShareWishlistActionGroup.xml delete mode 100644 app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerWishlistActionGroup.xml diff --git a/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyThatInformationAboutViewingComparisonWishlistIsPersistedUnderLongTermCookieTest.xml b/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyThatInformationAboutViewingComparisonWishlistIsPersistedUnderLongTermCookieTest.xml index dc6f87bef0ba8..0b9938d18d11f 100644 --- a/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyThatInformationAboutViewingComparisonWishlistIsPersistedUnderLongTermCookieTest.xml +++ b/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyThatInformationAboutViewingComparisonWishlistIsPersistedUnderLongTermCookieTest.xml @@ -95,10 +95,10 @@ </actionGroup> <!--The My Wishlist widget displays Simple Product 1 and Simple Product 2--> <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="openCategoryPageToCheckProductsInWishlistSidebar"/> - <actionGroup ref="StorefrontCustomerCheckProductInWishlistSidebar" stepKey="checkSimpleProductInWishlistSidebar"> + <actionGroup ref="StorefrontCustomerCheckProductInWishlistSidebarActionGroup" stepKey="checkSimpleProductInWishlistSidebar"> <argument name="productVar" value="$$createSimpleProduct$$"/> </actionGroup> - <actionGroup ref="StorefrontCustomerCheckProductInWishlistSidebar" stepKey="checkSecondSimpleProductInWishlistSidebar"> + <actionGroup ref="StorefrontCustomerCheckProductInWishlistSidebarActionGroup" stepKey="checkSecondSimpleProductInWishlistSidebar"> <argument name="productVar" value="$$createSecondSimpleProduct$$"/> </actionGroup> @@ -150,7 +150,7 @@ <actionGroup ref="StorefrontAssertProductInRecentlyViewedWidgetActionGroup" stepKey="checkSimpleProductInRecentlyViewedWidgetAfterLogout"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> - <actionGroup ref="StorefrontCustomerCheckProductInWishlistSidebar" stepKey="checkSimpleProductInWishlistSidebarAfterLogout"> + <actionGroup ref="StorefrontCustomerCheckProductInWishlistSidebarActionGroup" stepKey="checkSimpleProductInWishlistSidebarAfterLogout"> <argument name="productVar" value="$$createSimpleProduct$$"/> </actionGroup> <actionGroup ref="StorefrontAssertProductInRecentlyComparedWidgetActionGroup" stepKey="checkSimpleProductInRecentlyComparedWidgetAfterLogout"> @@ -177,7 +177,7 @@ <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="openCategoryPageToCheckWidgets"/> <see userInput="Welcome, $$createCustomer.firstname$$ $$createCustomer.lastname$$!" selector="{{StorefrontPanelHeaderSection.WelcomeMessage}}" stepKey="checkWelcomeMessageAfterLogin"/> - <actionGroup ref="StorefrontCustomerCheckProductInWishlistSidebar" stepKey="checkSimpleProductNameInWishlistSidebarAfterLogin"> + <actionGroup ref="StorefrontCustomerCheckProductInWishlistSidebarActionGroup" stepKey="checkSimpleProductNameInWishlistSidebarAfterLogin"> <argument name="productVar" value="$$createSimpleProduct$$"/> </actionGroup> <actionGroup ref="StorefrontAssertProductInRecentlyViewedWidgetActionGroup" stepKey="checkSimpleProductInRecentlyViewedWidgetAfterLogin"> diff --git a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontAssertCustomerWishlistIsEmptyActionGroup.xml b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontAssertCustomerWishlistIsEmptyActionGroup.xml new file mode 100644 index 0000000000000..fad33a405c5e4 --- /dev/null +++ b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontAssertCustomerWishlistIsEmptyActionGroup.xml @@ -0,0 +1,15 @@ +<?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="StorefrontAssertCustomerWishlistIsEmptyActionGroup"> + <dontSeeElement selector="{{StorefrontCustomerWishlistProductSection.pager}}" stepKey="checkThatPagerIsAbsent"/> + <see selector="{{StorefrontCustomerWishlistProductSection.wishlistEmpty}}" userInput="You have no items in your wish list." stepKey="checkNoItemsMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerAddCategoryProductToWishlistActionGroup.xml b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerAddCategoryProductToWishlistActionGroup.xml new file mode 100644 index 0000000000000..336841901a7ec --- /dev/null +++ b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerAddCategoryProductToWishlistActionGroup.xml @@ -0,0 +1,25 @@ +<?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="StorefrontCustomerAddCategoryProductToWishlistActionGroup"> + <annotations> + <description>Adds the provided Product to the Wish List from a Storefront Category page. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="productVar"/> + </arguments> + + <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(productVar.name)}}" stepKey="addCategoryProductToWishlistMoveMouseOverProduct"/> + <click selector="{{StorefrontCategoryProductSection.ProductAddToWishlistByName(productVar.name)}}" stepKey="addCategoryProductToWishlistClickAddProductToWishlist"/> + <waitForElement selector="{{StorefrontCustomerWishlistSection.successMsg}}" time="30" stepKey="addCategoryProductToWishlistWaitForSuccessMessage"/> + <see selector="{{StorefrontCustomerWishlistSection.successMsg}}" userInput="{{productVar.name}} has been added to your Wish List." stepKey="addCategoryProductToWishlistSeeProductNameAddedToWishlist"/> + <seeCurrentUrlMatches regex="~/wishlist_id/\d+/$~" stepKey="seeCurrentUrlMatches"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerAddProductToCartFromWishlistUsingSidebarActionGroup.xml b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerAddProductToCartFromWishlistUsingSidebarActionGroup.xml new file mode 100644 index 0000000000000..a28a80c57fb67 --- /dev/null +++ b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerAddProductToCartFromWishlistUsingSidebarActionGroup.xml @@ -0,0 +1,23 @@ +<?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="StorefrontCustomerAddProductToCartFromWishlistUsingSidebarActionGroup"> + <annotations> + <description>Add the provided Product to the Cart from the Wish List side bar menu. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <click selector="{{StorefrontCustomerWishlistSidebarSection.ProductAddToCartByName(product.name)}}" stepKey="AddProductToCartFromWishlistUsingSidebarClickAddToCartFromWishlist"/> + <waitForElement selector="{{StorefrontCategoryMainSection.SuccessMsg}}" time="30" stepKey="AddProductToCartFromWishlistUsingSidebarWaitForSuccessMessage"/> + <see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="You added {{product.name}} to your shopping cart." stepKey="AddProductToCartFromWishlistUsingSidebarSeeProductNameAddedToCartFromWishlist"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerAddProductToWishlistActionGroup.xml b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerAddProductToWishlistActionGroup.xml new file mode 100644 index 0000000000000..69d8365096999 --- /dev/null +++ b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerAddProductToWishlistActionGroup.xml @@ -0,0 +1,25 @@ +<?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="StorefrontCustomerAddProductToWishlistActionGroup"> + <annotations> + <description>Adds the provided Product to the Wish List from the Storefront Product page. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="productVar"/> + </arguments> + + <waitForElementVisible selector="{{StorefrontProductInfoMainSection.productAddToWishlist}}" stepKey="WaitForWishList" time="30"/> + <click selector="{{StorefrontProductInfoMainSection.productAddToWishlist}}" stepKey="addProductToWishlistClickAddToWishlist"/> + <waitForElement selector="{{StorefrontCustomerWishlistSection.successMsg}}" time="30" stepKey="addProductToWishlistWaitForSuccessMessage"/> + <see selector="{{StorefrontCustomerWishlistSection.successMsg}}" userInput="{{productVar.name}} has been added to your Wish List. Click here to continue shopping." stepKey="addProductToWishlistSeeProductNameAddedToWishlist"/> + <seeCurrentUrlMatches regex="~/wishlist_id/\d+/$~" stepKey="seeCurrentUrlMatches"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerCheckProductInWishlistActionGroup.xml b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerCheckProductInWishlistActionGroup.xml new file mode 100644 index 0000000000000..7380ee2172532 --- /dev/null +++ b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerCheckProductInWishlistActionGroup.xml @@ -0,0 +1,25 @@ +<?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="StorefrontCustomerCheckProductInWishlistActionGroup"> + <annotations> + <description>Validates that the provided Product details (Price and Name) are present in the Storefront Customer Dashboard Wish List.</description> + </annotations> + <arguments> + <argument name="productVar"/> + </arguments> + + <waitForElement selector="{{StorefrontCustomerWishlistProductSection.ProductTitleByName(productVar.name)}}" time="30" stepKey="assertWishlistProductName"/> + <see userInput="${{productVar.price}}.00" selector="{{StorefrontCustomerWishlistProductSection.ProductPriceByName(productVar.name)}}" stepKey="AssertWishlistProductPrice"/> + <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName(productVar.name)}}" stepKey="wishlistMoveMouseOverProduct"/> + <seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductAddToCartByName(productVar.name)}}" stepKey="AssertWishlistAddToCart"/> + <seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductImageByName(productVar.name)}}" stepKey="AssertWishlistProductImage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerCheckProductInWishlistSidebarActionGroup.xml b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerCheckProductInWishlistSidebarActionGroup.xml new file mode 100644 index 0000000000000..04277897c0cb2 --- /dev/null +++ b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerCheckProductInWishlistSidebarActionGroup.xml @@ -0,0 +1,24 @@ +<?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="StorefrontCustomerCheckProductInWishlistSidebarActionGroup"> + <annotations> + <description>Validates that the provided Product details (Name) are present in the Wish List side bar menu.</description> + </annotations> + <arguments> + <argument name="productVar"/> + </arguments> + + <waitForElement selector="{{StorefrontCustomerWishlistSidebarSection.ProductTitleByName(productVar.name)}}" time="30" stepKey="assertWishlistSidebarProductName"/> + <see userInput="${{productVar.price}}.00" selector="{{StorefrontCustomerWishlistSidebarSection.ProductPriceByName(productVar.name)}}" stepKey="AssertWishlistSidebarProductPrice"/> + <seeElement selector="{{StorefrontCustomerWishlistSidebarSection.ProductAddToCartByName(productVar.name)}}" stepKey="AssertWishlistSidebarAddToCart"/> + <seeElement selector="{{StorefrontCustomerWishlistSidebarSection.ProductImageByName(productVar.name)}}" stepKey="AssertWishlistSidebarProductImage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerEditProductInWishlistActionGroup.xml b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerEditProductInWishlistActionGroup.xml new file mode 100644 index 0000000000000..f4fe023411e67 --- /dev/null +++ b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerEditProductInWishlistActionGroup.xml @@ -0,0 +1,28 @@ +<?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="StorefrontCustomerEditProductInWishlistActionGroup"> + <annotations> + <description>Edits the provided Product on the Storefront Wish List page. Fills in the provided Description and Quantity. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="description" type="string"/> + <argument name="quantity" type="string"/> + </arguments> + + <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName(product.name)}}" stepKey="mouseOverOnProduct"/> + <fillField selector="{{StorefrontCustomerWishlistProductSection.ProductDescription(product.name)}}" userInput="{{description}}" stepKey="fillDescription"/> + <fillField selector="{{StorefrontCustomerWishlistProductSection.ProductQuantity(product.name)}}" userInput="{{quantity}}" stepKey="fillQuantity"/> + <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductAddAllToCart}}" stepKey="mouseOver"/> + <click selector="{{StorefrontCustomerWishlistProductSection.ProductUpdateWishList}}" stepKey="submitUpdateWishlist"/> + <see selector="{{StorefrontCustomerWishlistProductSection.ProductSuccessUpdateMessage}}" userInput="{{product.name}} has been updated in your Wish List." stepKey="successMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerRemoveProductFromWishlistUsingSidebarActionGroup.xml b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerRemoveProductFromWishlistUsingSidebarActionGroup.xml new file mode 100644 index 0000000000000..a563e57c25230 --- /dev/null +++ b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerRemoveProductFromWishlistUsingSidebarActionGroup.xml @@ -0,0 +1,23 @@ +<?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="StorefrontCustomerRemoveProductFromWishlistUsingSidebarActionGroup"> + <annotations> + <description>Removes the provided Product from the Wish List side bar menu. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <click selector="{{StorefrontCustomerWishlistSidebarSection.ProductRemoveByName(product.name)}}" stepKey="RemoveProductFromWishlistUsingSidebarClickRemoveItemFromWishlist"/> + <waitForElement selector="{{StorefrontCategoryMainSection.SuccessMsg}}" time="30" stepKey="RemoveProductFromWishlistUsingSidebarWaitForSuccessMessage"/> + <see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="{{product.name}} has been removed from your Wish List." stepKey="RemoveProductFromWishlistUsingSidebarSeeProductNameRemovedFromWishlist"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerShareWishlistActionGroup.xml b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerShareWishlistActionGroup.xml new file mode 100644 index 0000000000000..1f7ac9fc85f50 --- /dev/null +++ b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerShareWishlistActionGroup.xml @@ -0,0 +1,22 @@ +<?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="StorefrontCustomerShareWishlistActionGroup"> + <annotations> + <description>Shares the Wish List from the Storefront Wish List page. PLEASE NOTE: The details for sharing are Hardcoded using 'Wishlist'.</description> + </annotations> + + <click selector="{{StorefrontCustomerWishlistProductSection.productShareWishList}}" stepKey="clickMyWishListButton"/> + <fillField userInput="{{Wishlist.shareInfo_emails}}" selector="{{StorefrontCustomerWishlistShareSection.ProductShareWishlistEmail}}" stepKey="fillEmailsForShare"/> + <fillField userInput="{{Wishlist.shareInfo_message}}" selector="{{StorefrontCustomerWishlistShareSection.ProductShareWishlistTextMessage}}" stepKey="fillShareMessage"/> + <click selector="{{StorefrontCustomerWishlistShareSection.ProductShareWishlistButton}}" stepKey="sendWishlist"/> + <see selector="{{StorefrontCustomerWishlistProductSection.productSuccessShareMessage}}" userInput="Your wish list has been shared." stepKey="successMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerWishlistActionGroup.xml b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerWishlistActionGroup.xml deleted file mode 100644 index 4c1c088c102cd..0000000000000 --- a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerWishlistActionGroup.xml +++ /dev/null @@ -1,138 +0,0 @@ -<?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"> - <!-- Add Product to wishlist from the category page and check message --> - <actionGroup name="StorefrontCustomerAddCategoryProductToWishlistActionGroup"> - <annotations> - <description>Adds the provided Product to the Wish List from a Storefront Category page. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="productVar"/> - </arguments> - - <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(productVar.name)}}" stepKey="addCategoryProductToWishlistMoveMouseOverProduct"/> - <click selector="{{StorefrontCategoryProductSection.ProductAddToWishlistByName(productVar.name)}}" stepKey="addCategoryProductToWishlistClickAddProductToWishlist"/> - <waitForElement selector="{{StorefrontCustomerWishlistSection.successMsg}}" time="30" stepKey="addCategoryProductToWishlistWaitForSuccessMessage"/> - <see selector="{{StorefrontCustomerWishlistSection.successMsg}}" userInput="{{productVar.name}} has been added to your Wish List." stepKey="addCategoryProductToWishlistSeeProductNameAddedToWishlist"/> - <seeCurrentUrlMatches regex="~/wishlist_id/\d+/$~" stepKey="seeCurrentUrlMatches"/> - </actionGroup> - - <!-- Add Product to wishlist from the product page and check message --> - <actionGroup name="StorefrontCustomerAddProductToWishlistActionGroup"> - <annotations> - <description>Adds the provided Product to the Wish List from the Storefront Product page. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="productVar"/> - </arguments> - - <waitForElementVisible selector="{{StorefrontProductInfoMainSection.productAddToWishlist}}" stepKey="WaitForWishList" time="30"/> - <click selector="{{StorefrontProductInfoMainSection.productAddToWishlist}}" stepKey="addProductToWishlistClickAddToWishlist"/> - <waitForElement selector="{{StorefrontCustomerWishlistSection.successMsg}}" time="30" stepKey="addProductToWishlistWaitForSuccessMessage"/> - <see selector="{{StorefrontCustomerWishlistSection.successMsg}}" userInput="{{productVar.name}} has been added to your Wish List. Click here to continue shopping." stepKey="addProductToWishlistSeeProductNameAddedToWishlist"/> - <seeCurrentUrlMatches regex="~/wishlist_id/\d+/$~" stepKey="seeCurrentUrlMatches"/> - </actionGroup> - - <!-- Check product in wishlist --> - <actionGroup name="StorefrontCustomerCheckProductInWishlist"> - <annotations> - <description>Validates that the provided Product details (Price and Name) are present in the Storefront Customer Dashboard Wish List.</description> - </annotations> - <arguments> - <argument name="productVar"/> - </arguments> - - <waitForElement selector="{{StorefrontCustomerWishlistProductSection.ProductTitleByName(productVar.name)}}" time="30" stepKey="assertWishlistProductName"/> - <see userInput="${{productVar.price}}.00" selector="{{StorefrontCustomerWishlistProductSection.ProductPriceByName(productVar.name)}}" stepKey="AssertWishlistProductPrice"/> - <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName(productVar.name)}}" stepKey="wishlistMoveMouseOverProduct"/> - <seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductAddToCartByName(productVar.name)}}" stepKey="AssertWishlistAddToCart"/> - <seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductImageByName(productVar.name)}}" stepKey="AssertWishlistProductImage"/> - </actionGroup> - - <!-- Check product in wishlist sidebar --> - <actionGroup name="StorefrontCustomerCheckProductInWishlistSidebar"> - <annotations> - <description>Validates that the provided Product details (Name) are present in the Wish List side bar menu.</description> - </annotations> - <arguments> - <argument name="productVar"/> - </arguments> - - <waitForElement selector="{{StorefrontCustomerWishlistSidebarSection.ProductTitleByName(productVar.name)}}" time="30" stepKey="assertWishlistSidebarProductName"/> - <see userInput="${{productVar.price}}.00" selector="{{StorefrontCustomerWishlistSidebarSection.ProductPriceByName(productVar.name)}}" stepKey="AssertWishlistSidebarProductPrice"/> - <seeElement selector="{{StorefrontCustomerWishlistSidebarSection.ProductAddToCartByName(productVar.name)}}" stepKey="AssertWishlistSidebarAddToCart"/> - <seeElement selector="{{StorefrontCustomerWishlistSidebarSection.ProductImageByName(productVar.name)}}" stepKey="AssertWishlistSidebarProductImage"/> - </actionGroup> - - <!--Remove a product from the wishlist using the sidebar --> - <actionGroup name="StorefrontCustomerRemoveProductFromWishlistUsingSidebar"> - <annotations> - <description>Removes the provided Product from the Wish List side bar menu. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <click selector="{{StorefrontCustomerWishlistSidebarSection.ProductRemoveByName(product.name)}}" stepKey="RemoveProductFromWishlistUsingSidebarClickRemoveItemFromWishlist"/> - <waitForElement selector="{{StorefrontCategoryMainSection.SuccessMsg}}" time="30" stepKey="RemoveProductFromWishlistUsingSidebarWaitForSuccessMessage"/> - <see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="{{product.name}} has been removed from your Wish List." stepKey="RemoveProductFromWishlistUsingSidebarSeeProductNameRemovedFromWishlist"/> - </actionGroup> - - <!--Add a product to the cart from the wishlist using the sidebar --> - <actionGroup name="StorefrontCustomerAddProductToCartFromWishlistUsingSidebar"> - <annotations> - <description>Add the provided Product to the Cart from the Wish List side bar menu. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <click selector="{{StorefrontCustomerWishlistSidebarSection.ProductAddToCartByName(product.name)}}" stepKey="AddProductToCartFromWishlistUsingSidebarClickAddToCartFromWishlist"/> - <waitForElement selector="{{StorefrontCategoryMainSection.SuccessMsg}}" time="30" stepKey="AddProductToCartFromWishlistUsingSidebarWaitForSuccessMessage"/> - <see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="You added {{product.name}} to your shopping cart." stepKey="AddProductToCartFromWishlistUsingSidebarSeeProductNameAddedToCartFromWishlist"/> - </actionGroup> - - <actionGroup name="StorefrontCustomerEditProductInWishlist"> - <annotations> - <description>Edits the provided Product on the Storefront Wish List page. Fills in the provided Description and Quantity. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="description" type="string"/> - <argument name="quantity" type="string"/> - </arguments> - - <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName(product.name)}}" stepKey="mouseOverOnProduct"/> - <fillField selector="{{StorefrontCustomerWishlistProductSection.ProductDescription(product.name)}}" userInput="{{description}}" stepKey="fillDescription"/> - <fillField selector="{{StorefrontCustomerWishlistProductSection.ProductQuantity(product.name)}}" userInput="{{quantity}}" stepKey="fillQuantity"/> - <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductAddAllToCart}}" stepKey="mouseOver"/> - <click selector="{{StorefrontCustomerWishlistProductSection.ProductUpdateWishList}}" stepKey="submitUpdateWishlist"/> - <see selector="{{StorefrontCustomerWishlistProductSection.ProductSuccessUpdateMessage}}" userInput="{{product.name}} has been updated in your Wish List." stepKey="successMessage"/> - </actionGroup> - - <!-- Share wishlist --> - <actionGroup name="StorefrontCustomerShareWishlistActionGroup"> - <annotations> - <description>Shares the Wish List from the Storefront Wish List page. PLEASE NOTE: The details for sharing are Hardcoded using 'Wishlist'.</description> - </annotations> - - <click selector="{{StorefrontCustomerWishlistProductSection.productShareWishList}}" stepKey="clickMyWishListButton"/> - <fillField userInput="{{Wishlist.shareInfo_emails}}" selector="{{StorefrontCustomerWishlistShareSection.ProductShareWishlistEmail}}" stepKey="fillEmailsForShare"/> - <fillField userInput="{{Wishlist.shareInfo_message}}" selector="{{StorefrontCustomerWishlistShareSection.ProductShareWishlistTextMessage}}" stepKey="fillShareMessage"/> - <click selector="{{StorefrontCustomerWishlistShareSection.ProductShareWishlistButton}}" stepKey="sendWishlist"/> - <see selector="{{StorefrontCustomerWishlistProductSection.productSuccessShareMessage}}" userInput="Your wish list has been shared." stepKey="successMessage"/> - </actionGroup> - - <!-- Check that wishlist is empty --> - <actionGroup name="StorefrontAssertCustomerWishlistIsEmpty"> - <dontSeeElement selector="{{StorefrontCustomerWishlistProductSection.pager}}" stepKey="checkThatPagerIsAbsent"/> - <see selector="{{StorefrontCustomerWishlistProductSection.wishlistEmpty}}" userInput="You have no items in your wish list." stepKey="checkNoItemsMessage"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml index 7eb42d1fbfed9..d5a5fccb30be3 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml @@ -17,10 +17,10 @@ <actionGroup ref="StorefrontCustomerAddCategoryProductToWishlistActionGroup" after="wishlistGotoCategory1" stepKey="wishlistAddSimpleProduct1ToWishlist"> <argument name="productVar" value="$$createSimpleProduct1$$"/> </actionGroup> - <actionGroup ref="StorefrontCustomerCheckProductInWishlist" after="wishlistAddSimpleProduct1ToWishlist" stepKey="wishlistCheckSimpleProduct1InWishlist"> + <actionGroup ref="StorefrontCustomerCheckProductInWishlistActionGroup" after="wishlistAddSimpleProduct1ToWishlist" stepKey="wishlistCheckSimpleProduct1InWishlist"> <argument name="productVar" value="$$createSimpleProduct1$$"/> </actionGroup> - <actionGroup ref="StorefrontCustomerCheckProductInWishlistSidebar" after="wishlistCheckSimpleProduct1InWishlist" stepKey="wishlistCheckSimpleProduct1InWishlistSidebar"> + <actionGroup ref="StorefrontCustomerCheckProductInWishlistSidebarActionGroup" after="wishlistCheckSimpleProduct1InWishlist" stepKey="wishlistCheckSimpleProduct1InWishlistSidebar"> <argument name="productVar" value="$$createSimpleProduct1$$"/> </actionGroup> @@ -31,10 +31,10 @@ <actionGroup ref="StorefrontCustomerAddProductToWishlistActionGroup" after="wishlistClickSimpleProduct2" stepKey="wishlistAddSimpleProduct2ToWishlist"> <argument name="productVar" value="$$createSimpleProduct2$$"/> </actionGroup> - <actionGroup ref="StorefrontCustomerCheckProductInWishlist" after="wishlistAddSimpleProduct2ToWishlist" stepKey="wishlistCheckSimpleProduct2InWishlist"> + <actionGroup ref="StorefrontCustomerCheckProductInWishlistActionGroup" after="wishlistAddSimpleProduct2ToWishlist" stepKey="wishlistCheckSimpleProduct2InWishlist"> <argument name="productVar" value="$$createSimpleProduct2$$"/> </actionGroup> - <actionGroup ref="StorefrontCustomerCheckProductInWishlistSidebar" after="wishlistCheckSimpleProduct2InWishlist" stepKey="wishlistCheckSimpleProduct2InWishlistSidebar"> + <actionGroup ref="StorefrontCustomerCheckProductInWishlistSidebarActionGroup" after="wishlistCheckSimpleProduct2InWishlist" stepKey="wishlistCheckSimpleProduct2InWishlistSidebar"> <argument name="productVar" value="$$createSimpleProduct2$$"/> </actionGroup> <comment userInput="End of adding products to wishlist" after="wishlistCheckSimpleProduct2InWishlistSidebar" stepKey="endOfAddingProductsToWishlist" /> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddProductsToCartFromWishlistUsingSidebarTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddProductsToCartFromWishlistUsingSidebarTest.xml index 82c53bc343e51..7240313e8d980 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddProductsToCartFromWishlistUsingSidebarTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddProductsToCartFromWishlistUsingSidebarTest.xml @@ -53,10 +53,10 @@ <!--Add product to the cart from the Wishlist using the sidebar from the second category page--> <amOnPage url="{{StorefrontCategoryPage.url($$categorySecond.name$$)}}" stepKey="navigateToCategorySecondPage"/> <actionGroup ref="StorefrontSwitchCategoryViewToListMode" stepKey="switchCategoryViewToListMode"/> - <actionGroup ref="StorefrontCustomerCheckProductInWishlistSidebar" stepKey="checkSimpleProduct1InWishlistSidebar"> + <actionGroup ref="StorefrontCustomerCheckProductInWishlistSidebarActionGroup" stepKey="checkSimpleProduct1InWishlistSidebar"> <argument name="productVar" value="$$simpleProduct1$$"/> </actionGroup> - <actionGroup ref="StorefrontCustomerAddProductToCartFromWishlistUsingSidebar" stepKey="addProduct1ToCartFromWishlistUsingSidebar"> + <actionGroup ref="StorefrontCustomerAddProductToCartFromWishlistUsingSidebarActionGroup" stepKey="addProduct1ToCartFromWishlistUsingSidebar"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <!--Check that a customer on the same page as before--> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteBundleDynamicProductFromWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteBundleDynamicProductFromWishlistTest.xml index ae65a4171d883..3d190a039920a 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteBundleDynamicProductFromWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteBundleDynamicProductFromWishlistTest.xml @@ -74,7 +74,7 @@ <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openProductFromCategory"> <argument name="productUrlKey" value="$$createBundleProduct.custom_attributes[url_key]$$"/> </actionGroup> - + <!-- Add created product to Wishlist according to dataset and assert add product to wishlist success message --> <actionGroup ref="StorefrontCustomerAddProductToWishlistActionGroup" stepKey="addProductToWishlist"> <argument name="productVar" value="$$createBundleProduct$$"/> @@ -90,6 +90,6 @@ <click selector="{{StorefrontCustomerWishlistProductSection.removeProduct}}" stepKey="clickRemoveButton"/> <!-- Assert Wishlist is empty --> - <actionGroup ref="StorefrontAssertCustomerWishlistIsEmpty" stepKey="assertWishlistIsEmpty"/> + <actionGroup ref="StorefrontAssertCustomerWishlistIsEmptyActionGroup" stepKey="assertWishlistIsEmpty"/> </test> </tests> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteBundleFixedProductFromWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteBundleFixedProductFromWishlistTest.xml index a0bff949f00f5..cdd86bfecccc8 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteBundleFixedProductFromWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteBundleFixedProductFromWishlistTest.xml @@ -83,6 +83,6 @@ <click selector="{{StorefrontCustomerWishlistProductSection.removeProduct}}" stepKey="clickRemoveButton"/> <!-- Assert Wishlist is empty --> - <actionGroup ref="StorefrontAssertCustomerWishlistIsEmpty" stepKey="assertWishlistIsEmpty"/> + <actionGroup ref="StorefrontAssertCustomerWishlistIsEmptyActionGroup" stepKey="assertWishlistIsEmpty"/> </test> </tests> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteConfigurableProductFromWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteConfigurableProductFromWishlistTest.xml index ee66825878728..6a718ebdfcf0f 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteConfigurableProductFromWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteConfigurableProductFromWishlistTest.xml @@ -145,6 +145,6 @@ <click selector="{{StorefrontCustomerWishlistProductSection.removeProduct}}" stepKey="clickRemoveButton"/> <!-- Assert Wishlist is empty --> - <actionGroup ref="StorefrontAssertCustomerWishlistIsEmpty" stepKey="assertWishlistIsEmpty"/> + <actionGroup ref="StorefrontAssertCustomerWishlistIsEmptyActionGroup" stepKey="assertWishlistIsEmpty"/> </test> </tests> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontRemoveProductsFromWishlistUsingSidebarTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontRemoveProductsFromWishlistUsingSidebarTest.xml index 6c73cb6708ae4..4c44f9b72e86c 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontRemoveProductsFromWishlistUsingSidebarTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontRemoveProductsFromWishlistUsingSidebarTest.xml @@ -54,10 +54,10 @@ <!--Remove product from the Wishlist using the sidebar from the second category page--> <amOnPage url="{{StorefrontCategoryPage.url($$categorySecond.name$$)}}" stepKey="navigateToCategorySecondPage"/> <actionGroup ref="StorefrontSwitchCategoryViewToListMode" stepKey="switchCategoryViewToListMode"/> - <actionGroup ref="StorefrontCustomerCheckProductInWishlistSidebar" stepKey="checkSimpleProduct1InWishlistSidebar"> + <actionGroup ref="StorefrontCustomerCheckProductInWishlistSidebarActionGroup" stepKey="checkSimpleProduct1InWishlistSidebar"> <argument name="productVar" value="$$simpleProduct1$$"/> </actionGroup> - <actionGroup ref="StorefrontCustomerRemoveProductFromWishlistUsingSidebar" stepKey="removeProduct1FromWishlistUsingSidebar"> + <actionGroup ref="StorefrontCustomerRemoveProductFromWishlistUsingSidebarActionGroup" stepKey="removeProduct1FromWishlistUsingSidebar"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <!--Check that a customer on the same page as before--> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontUpdateWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontUpdateWishlistTest.xml index b8a84a327b58f..08698658588ae 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontUpdateWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontUpdateWishlistTest.xml @@ -43,11 +43,11 @@ <argument name="productVar" value="$$product$$"/> </actionGroup> - <actionGroup ref="StorefrontCustomerCheckProductInWishlist" stepKey="checkProductInWishlist"> + <actionGroup ref="StorefrontCustomerCheckProductInWishlistActionGroup" stepKey="checkProductInWishlist"> <argument name="productVar" value="$$product$$"/> </actionGroup> - <actionGroup ref="StorefrontCustomerEditProductInWishlist" stepKey="updateProductInWishlist"> + <actionGroup ref="StorefrontCustomerEditProductInWishlistActionGroup" stepKey="updateProductInWishlist"> <argument name="product" value="$$product$$"/> <argument name="description" value="some text"/> <argument name="quantity" value="2"/> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/WishListWithDisabledProductTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/WishListWithDisabledProductTest.xml index af216c139e7fe..aca3ebbc6b48c 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/WishListWithDisabledProductTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/WishListWithDisabledProductTest.xml @@ -35,7 +35,7 @@ <actionGroup ref="StorefrontCustomerAddProductToWishlistActionGroup" stepKey="addProductToWishlist"> <argument name="productVar" value="$$createProduct$$"/> </actionGroup> - <actionGroup ref="StorefrontCustomerCheckProductInWishlist" stepKey="checkProductInWishlist"> + <actionGroup ref="StorefrontCustomerCheckProductInWishlistActionGroup" stepKey="checkProductInWishlist"> <argument name="productVar" value="$$createProduct$$"/> </actionGroup> <openNewTab stepKey="openNewTab"/> @@ -45,6 +45,6 @@ <actionGroup ref="saveProductForm" stepKey="saveProduct"/> <closeTab stepKey="closeSecondTab"/> <reloadPage stepKey="refreshPage"/> - <actionGroup ref="StorefrontAssertCustomerWishlistIsEmpty" stepKey="checkProductIsAbsentInWishlistIsEmpty"/> + <actionGroup ref="StorefrontAssertCustomerWishlistIsEmptyActionGroup" stepKey="checkProductIsAbsentInWishlistIsEmpty"/> </test> </tests> From b17b871c9990bc99ae77d1c878173b9ecd8db929 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 13:58:12 +0100 Subject: [PATCH 115/586] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- ...ctedUserAddCategoryFromProductPageTest.xml | 6 +-- .../AdminAddNewUserRoleActionGroup.xml | 7 --- ...serRoleWithCustomRoleScopesActionGroup.xml | 17 +++++++ .../AdminAddRestrictedRoleActionGroup.xml | 22 ++++++++++ .../AdminCreateRoleActionGroup.xml | 44 ------------------- .../AdminCreateUserActionGroup.xml | 30 ------------- .../AdminCreateUserWithApiRoleActionGroup.xml | 14 ++++++ .../AdminCreateUserWithRoleActionGroup.xml | 36 +++++++++++++++ .../AdminDeleteCreatedRoleActionGroup.xml | 3 -- .../AdminDeleteCreatedUserActionGroup.xml | 19 +------- .../AdminDeleteCustomUserActionGroup.xml | 33 ++++++++++++++ .../AdminDeleteNewUserActionGroup.xml | 27 ++++++++++++ .../AdminDeleteRoleByRoleNameActionGroup.xml | 14 ++++++ .../AdminDeleteUserActionGroup.xml | 23 ---------- ...minFillUserRoleRequiredDataActionGroup.xml | 20 +++++++++ 15 files changed, 187 insertions(+), 128 deletions(-) create mode 100644 app/code/Magento/User/Test/Mftf/ActionGroup/AdminAddNewUserRoleWithCustomRoleScopesActionGroup.xml create mode 100644 app/code/Magento/User/Test/Mftf/ActionGroup/AdminAddRestrictedRoleActionGroup.xml create mode 100644 app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserWithApiRoleActionGroup.xml create mode 100644 app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserWithRoleActionGroup.xml create mode 100644 app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteCustomUserActionGroup.xml create mode 100644 app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteNewUserActionGroup.xml create mode 100644 app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteRoleByRoleNameActionGroup.xml create mode 100644 app/code/Magento/User/Test/Mftf/ActionGroup/AdminFillUserRoleRequiredDataActionGroup.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRestrictedUserAddCategoryFromProductPageTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRestrictedUserAddCategoryFromProductPageTest.xml index 7b5455951fb27..da93db7ac8e17 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRestrictedUserAddCategoryFromProductPageTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRestrictedUserAddCategoryFromProductPageTest.xml @@ -51,16 +51,16 @@ </after> <!--Create user role--> <comment userInput="Create user role" stepKey="commentCreateUserRole"/> - <actionGroup ref="AdminFillUserRoleRequiredData" stepKey="fillUserRoleRequiredData"> + <actionGroup ref="AdminFillUserRoleRequiredDataActionGroup" stepKey="fillUserRoleRequiredData"> <argument name="User" value="adminRole"/> <argument name="restrictedRole" value="Stores"/> </actionGroup> <click selector="{{AdminEditRoleInfoSection.roleResourcesTab}}" stepKey="clickRoleResourcesTab" /> - <actionGroup ref="AdminAddRestrictedRole" stepKey="addRestrictedRoleStores"> + <actionGroup ref="AdminAddRestrictedRoleActionGroup" stepKey="addRestrictedRoleStores"> <argument name="User" value="adminRole"/> <argument name="restrictedRole" value="Stores"/> </actionGroup> - <actionGroup ref="AdminAddRestrictedRole" stepKey="addRestrictedRoleProducts"> + <actionGroup ref="AdminAddRestrictedRoleActionGroup" stepKey="addRestrictedRoleProducts"> <argument name="User" value="adminRole"/> <argument name="restrictedRole" value="Products"/> </actionGroup> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminAddNewUserRoleActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminAddNewUserRoleActionGroup.xml index 175f6203350c7..28cbaba4b8241 100644 --- a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminAddNewUserRoleActionGroup.xml +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminAddNewUserRoleActionGroup.xml @@ -38,11 +38,4 @@ <waitForPageLoad stepKey="waitForSaving"/> <see userInput="You saved the role." selector="{{AdminMessagesSection.success}}" stepKey="seeMessage"/> </actionGroup> - - <actionGroup name="AdminAddNewUserRoleWithCustomRoleScopes" extends="AdminAddNewUserRoleActionGroup"> - <arguments> - <argument name="customWebsiteName" type="string"/> - </arguments> - <checkOption selector="{{AdminCreateRoleSection.selectWebsite(customWebsiteName)}}" stepKey="checkWebsite" after="selectRoleResources"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminAddNewUserRoleWithCustomRoleScopesActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminAddNewUserRoleWithCustomRoleScopesActionGroup.xml new file mode 100644 index 0000000000000..142ed8af09fcf --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminAddNewUserRoleWithCustomRoleScopesActionGroup.xml @@ -0,0 +1,17 @@ +<?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="AdminAddNewUserRoleWithCustomRoleScopesActionGroup" extends="AdminAddNewUserRoleActionGroup"> + <arguments> + <argument name="customWebsiteName" type="string"/> + </arguments> + <checkOption selector="{{AdminCreateRoleSection.selectWebsite(customWebsiteName)}}" stepKey="checkWebsite" after="selectRoleResources"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminAddRestrictedRoleActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminAddRestrictedRoleActionGroup.xml new file mode 100644 index 0000000000000..37f06b8c14ad8 --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminAddRestrictedRoleActionGroup.xml @@ -0,0 +1,22 @@ +<?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="AdminAddRestrictedRoleActionGroup" extends="AdminCreateRoleActionGroup"> + <remove keyForRemoval="navigateToNewRole"/> + <remove keyForRemoval="waitForPageLoad1"/> + <remove keyForRemoval="fillRoleName"/> + <remove keyForRemoval="enterPassword"/> + <remove keyForRemoval="clickRoleResourcesTab"/> + <remove keyForRemoval="waitForScopeSelection"/> + <remove keyForRemoval="clickSaveRoleButton"/> + <remove keyForRemoval="waitForPageLoad2"/> + <scrollTo selector="{{AdminEditRoleInfoSection.blockName('restrictedRole')}}" x="0" y="-100" stepKey="scrollToResourceElement" after="selectResourceAccessCustom"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateRoleActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateRoleActionGroup.xml index 9e8262d5564fb..15deee5fbd049 100644 --- a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateRoleActionGroup.xml +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateRoleActionGroup.xml @@ -29,48 +29,4 @@ <click selector="{{AdminEditRoleInfoSection.saveButton}}" stepKey="clickSaveRoleButton"/> <waitForPageLoad stepKey="waitForPageLoad2"/> </actionGroup> - - <actionGroup name="AdminFillUserRoleRequiredData" extends="AdminCreateRoleActionGroup"> - <remove keyForRemoval="clickRoleResourcesTab"/> - <remove keyForRemoval="waitForScopeSelection"/> - <remove keyForRemoval="selectResourceAccessCustom"/> - <remove keyForRemoval="waitForElementVisible"/> - <remove keyForRemoval="clickContentBlockCheckbox"/> - <remove keyForRemoval="clickSaveRoleButton"/> - <remove keyForRemoval="waitForPageLoad2"/> - </actionGroup> - <actionGroup name="AdminAddRestrictedRole" extends="AdminCreateRoleActionGroup"> - <remove keyForRemoval="navigateToNewRole"/> - <remove keyForRemoval="waitForPageLoad1"/> - <remove keyForRemoval="fillRoleName"/> - <remove keyForRemoval="enterPassword"/> - <remove keyForRemoval="clickRoleResourcesTab"/> - <remove keyForRemoval="waitForScopeSelection"/> - <remove keyForRemoval="clickSaveRoleButton"/> - <remove keyForRemoval="waitForPageLoad2"/> - <scrollTo selector="{{AdminEditRoleInfoSection.blockName('restrictedRole')}}" x="0" y="-100" stepKey="scrollToResourceElement" after="selectResourceAccessCustom"/> - </actionGroup> - - <!--Create new role--> - <actionGroup name="AdminCreateRole"> - <annotations> - <description>Clicks on 'Add New Role'. Fills in the provided details (Role, Resource, Scope and Websites). Clicks on Save. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="role" type="string" defaultValue=""/> - <argument name="resource" type="string" defaultValue="All"/> - <argument name="scope" type="string" defaultValue="Custom"/> - <argument name="websites" type="string" defaultValue="Main Website"/> - </arguments> - - <click selector="{{AdminCreateRoleSection.create}}" stepKey="clickToAddNewRole"/> - <fillField selector="{{AdminCreateRoleSection.name}}" userInput="{{role.name}}" stepKey="setRoleName"/> - <fillField stepKey="setPassword" selector="{{AdminCreateRoleSection.password}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/> - <click selector="{{AdminCreateRoleSection.roleResources}}" stepKey="clickToOpenRoleResources"/> - <waitForPageLoad stepKey="waitForRoleResourcePage" time="5"/> - <click stepKey="checkSales" selector="//a[text()='Sales']"/> - <click selector="{{AdminCreateRoleSection.save}}" stepKey="clickToSaveRole"/> - <waitForPageLoad stepKey="waitForPageLoad" time="10"/> - <see userInput="You saved the role." stepKey="seeSuccessMessage"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserActionGroup.xml index 2738ef9f1cb3f..8abb4e9224b0a 100644 --- a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserActionGroup.xml +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserActionGroup.xml @@ -37,34 +37,4 @@ <waitForPageLoad stepKey="waitForPageLoad2"/> <see userInput="You saved the user." stepKey="seeSuccessMessage"/> </actionGroup> - - <!--Create new user with role--> - <actionGroup name="AdminCreateUserWithRoleActionGroup"> - <annotations> - <description>Goes to the Admin Users grid page. Clicks on Create User. Fills in the provided Role and User.</description> - </annotations> - <arguments> - <argument name="role"/> - <argument name="user" defaultValue="newAdmin"/> - </arguments> - - <amOnPage url="{{AdminNewUserPage.url}}" stepKey="navigateToNewUser"/> - <waitForPageLoad stepKey="waitForUsersPage"/> - <fillField selector="{{AdminCreateUserSection.usernameTextField}}" userInput="{{user.username}}" stepKey="enterUserName"/> - <fillField selector="{{AdminCreateUserSection.firstNameTextField}}" userInput="{{user.firstName}}" stepKey="enterFirstName"/> - <fillField selector="{{AdminCreateUserSection.lastNameTextField}}" userInput="{{user.lastName}}" stepKey="enterLastName"/> - <fillField selector="{{AdminCreateUserSection.emailTextField}}" userInput="{{user.username}}@magento.com" stepKey="enterEmail"/> - <fillField selector="{{AdminCreateUserSection.passwordTextField}}" userInput="{{user.password}}" stepKey="enterPassword"/> - <fillField selector="{{AdminCreateUserSection.pwConfirmationTextField}}" userInput="{{user.password}}" stepKey="confirmPassword"/> - <fillField selector="{{AdminCreateUserSection.currentPasswordField}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="enterCurrentPassword"/> - <scrollToTopOfPage stepKey="scrollToTopOfPage"/> - <click stepKey="clickUserRole" selector="{{AdminCreateUserSection.userRoleTab}}"/> - <click stepKey="chooseRole" selector="{{AdminStoreSection.createdRoleInUserPage(role.name)}}"/> - <click selector="{{AdminCreateUserSection.saveButton}}" stepKey="clickSaveUser"/> - <waitForPageLoad stepKey="waitForSaveTheUser"/> - <see userInput="You saved the user." stepKey="seeSuccessMessage"/> - </actionGroup> - <actionGroup name="AdminCreateUserWithApiRoleActionGroup" extends="AdminCreateUserWithRoleActionGroup"> - <click stepKey="chooseRole" selector="{{AdminCreateUserSection.createdRoleInUserPage(role.rolename)}}"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserWithApiRoleActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserWithApiRoleActionGroup.xml new file mode 100644 index 0000000000000..d3f7278765d47 --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserWithApiRoleActionGroup.xml @@ -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="AdminCreateUserWithApiRoleActionGroup" extends="AdminCreateUserWithRoleActionGroup"> + <click stepKey="chooseRole" selector="{{AdminCreateUserSection.createdRoleInUserPage(role.rolename)}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserWithRoleActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserWithRoleActionGroup.xml new file mode 100644 index 0000000000000..dd4f181204040 --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserWithRoleActionGroup.xml @@ -0,0 +1,36 @@ +<?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="AdminCreateUserWithRoleActionGroup"> + <annotations> + <description>Goes to the Admin Users grid page. Clicks on Create User. Fills in the provided Role and User.</description> + </annotations> + <arguments> + <argument name="role"/> + <argument name="user" defaultValue="newAdmin"/> + </arguments> + + <amOnPage url="{{AdminNewUserPage.url}}" stepKey="navigateToNewUser"/> + <waitForPageLoad stepKey="waitForUsersPage"/> + <fillField selector="{{AdminCreateUserSection.usernameTextField}}" userInput="{{user.username}}" stepKey="enterUserName"/> + <fillField selector="{{AdminCreateUserSection.firstNameTextField}}" userInput="{{user.firstName}}" stepKey="enterFirstName"/> + <fillField selector="{{AdminCreateUserSection.lastNameTextField}}" userInput="{{user.lastName}}" stepKey="enterLastName"/> + <fillField selector="{{AdminCreateUserSection.emailTextField}}" userInput="{{user.username}}@magento.com" stepKey="enterEmail"/> + <fillField selector="{{AdminCreateUserSection.passwordTextField}}" userInput="{{user.password}}" stepKey="enterPassword"/> + <fillField selector="{{AdminCreateUserSection.pwConfirmationTextField}}" userInput="{{user.password}}" stepKey="confirmPassword"/> + <fillField selector="{{AdminCreateUserSection.currentPasswordField}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="enterCurrentPassword"/> + <scrollToTopOfPage stepKey="scrollToTopOfPage"/> + <click stepKey="clickUserRole" selector="{{AdminCreateUserSection.userRoleTab}}"/> + <click stepKey="chooseRole" selector="{{AdminStoreSection.createdRoleInUserPage(role.name)}}"/> + <click selector="{{AdminCreateUserSection.saveButton}}" stepKey="clickSaveUser"/> + <waitForPageLoad stepKey="waitForSaveTheUser"/> + <see userInput="You saved the user." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteCreatedRoleActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteCreatedRoleActionGroup.xml index c1659610feda5..813e22df227c8 100644 --- a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteCreatedRoleActionGroup.xml +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteCreatedRoleActionGroup.xml @@ -21,7 +21,4 @@ <waitForPageLoad stepKey="waitForPageLoad"/> <see stepKey="seeSuccessMessage" userInput="You deleted the role."/> </actionGroup> - <actionGroup name="AdminDeleteRoleByRoleNameActionGroup" extends="AdminDeleteCreatedRoleActionGroup"> - <click stepKey="clickToAddNewRole" selector="{{AdminDeleteRoleSection.role(role.rolename)}}"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteCreatedUserActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteCreatedUserActionGroup.xml index 6be5e80ec3e30..0939626660ad0 100644 --- a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteCreatedUserActionGroup.xml +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteCreatedUserActionGroup.xml @@ -15,7 +15,7 @@ <arguments> <argument name="user"/> </arguments> - + <amOnPage stepKey="amOnAdminUsersPage" url="{{AdminUsersPage.url}}"/> <click stepKey="openTheUser" selector="{{AdminDeleteUserSection.role(user.username)}}"/> <waitForPageLoad stepKey="waitForSingleUserPageToLoad"/> @@ -26,21 +26,4 @@ <click stepKey="clickToConfirm" selector="{{AdminDeleteUserSection.confirm}}"/> <see stepKey="seeDeleteMessageForUser" userInput="You deleted the user."/> </actionGroup> - <!--Delete User--> - <actionGroup name="AdminDeleteNewUserActionGroup"> - <annotations> - <description>Deletes a User that contains the name 'John'. PLEASE NOTE: The Action Group values are Hardcoded.</description> - </annotations> - <arguments> - <argument name="userName" type="string" defaultValue="John"/> - </arguments> - <click stepKey="clickOnUser" selector="{{AdminDeleteUserSection.theUser(userName)}}"/> - <fillField stepKey="typeCurrentPassword" selector="{{AdminDeleteUserSection.password}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/> - <scrollToTopOfPage stepKey="scrollToTop"/> - <click stepKey="clickToDeleteUser" selector="{{AdminDeleteUserSection.delete}}"/> - <waitForPageLoad stepKey="waitForDeletePopupOpen" time="5"/> - <click stepKey="clickToConfirm" selector="{{AdminDeleteUserSection.confirm}}"/> - <waitForPageLoad stepKey="waitForPageLoad" time="10"/> - <see userInput="You deleted the user." stepKey="seeSuccessMessage" /> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteCustomUserActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteCustomUserActionGroup.xml new file mode 100644 index 0000000000000..598d95b8d562c --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteCustomUserActionGroup.xml @@ -0,0 +1,33 @@ +<?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="AdminDeleteCustomUserActionGroup"> + <annotations> + <description>Goes to the Admin Users grid page. Deletes the provided User. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="user"/> + </arguments> + + <amOnPage url="{{AdminUsersPage.url}}" stepKey="navigateToUserGrid"/> + <fillField selector="{{AdminUserGridSection.usernameFilterTextField}}" userInput="{{user.username}}" stepKey="enterUserName"/> + <click selector="{{AdminUserGridSection.searchButton}}" stepKey="clickSearch"/> + <waitForPageLoad stepKey="waitForGridToLoad"/> + <see selector="{{AdminUserGridSection.usernameInFirstRow}}" userInput="{{user.username}}" stepKey="seeUser"/> + <click selector="{{AdminUserGridSection.searchResultFirstRow}}" stepKey="openUserEdit"/> + <waitForPageLoad stepKey="waitForUserEditPageLoad"/> + <fillField selector="{{AdminEditUserSection.currentPasswordField}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="enterThePassword"/> + <click selector="{{AdminMainActionsSection.delete}}" stepKey="deleteUser"/> + <waitForElementVisible selector="{{AdminConfirmationModalSection.message}}" stepKey="waitForConfirmModal"/> + <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmDelete"/> + <waitForPageLoad stepKey="waitForSave"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You deleted the user." stepKey="seeUserDeleteMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteNewUserActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteNewUserActionGroup.xml new file mode 100644 index 0000000000000..a4e5492f8e3e6 --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteNewUserActionGroup.xml @@ -0,0 +1,27 @@ +<?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="AdminDeleteNewUserActionGroup"> + <annotations> + <description>Deletes a User that contains the name 'John'. PLEASE NOTE: The Action Group values are Hardcoded.</description> + </annotations> + <arguments> + <argument name="userName" type="string" defaultValue="John"/> + </arguments> + <click stepKey="clickOnUser" selector="{{AdminDeleteUserSection.theUser(userName)}}"/> + <fillField stepKey="typeCurrentPassword" selector="{{AdminDeleteUserSection.password}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/> + <scrollToTopOfPage stepKey="scrollToTop"/> + <click stepKey="clickToDeleteUser" selector="{{AdminDeleteUserSection.delete}}"/> + <waitForPageLoad stepKey="waitForDeletePopupOpen" time="5"/> + <click stepKey="clickToConfirm" selector="{{AdminDeleteUserSection.confirm}}"/> + <waitForPageLoad stepKey="waitForPageLoad" time="10"/> + <see userInput="You deleted the user." stepKey="seeSuccessMessage" /> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteRoleByRoleNameActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteRoleByRoleNameActionGroup.xml new file mode 100644 index 0000000000000..82602c007586c --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteRoleByRoleNameActionGroup.xml @@ -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="AdminDeleteRoleByRoleNameActionGroup" extends="AdminDeleteCreatedRoleActionGroup"> + <click stepKey="clickToAddNewRole" selector="{{AdminDeleteRoleSection.role(role.rolename)}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteUserActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteUserActionGroup.xml index 084f60dcf8542..67075eb52a678 100644 --- a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteUserActionGroup.xml +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteUserActionGroup.xml @@ -27,27 +27,4 @@ <waitForPageLoad stepKey="waitForPageLoad"/> <see stepKey="seeDeleteMessageForUser" userInput="You deleted the user."/> </actionGroup> - - <actionGroup name="AdminDeleteCustomUserActionGroup"> - <annotations> - <description>Goes to the Admin Users grid page. Deletes the provided User. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="user"/> - </arguments> - - <amOnPage url="{{AdminUsersPage.url}}" stepKey="navigateToUserGrid"/> - <fillField selector="{{AdminUserGridSection.usernameFilterTextField}}" userInput="{{user.username}}" stepKey="enterUserName"/> - <click selector="{{AdminUserGridSection.searchButton}}" stepKey="clickSearch"/> - <waitForPageLoad stepKey="waitForGridToLoad"/> - <see selector="{{AdminUserGridSection.usernameInFirstRow}}" userInput="{{user.username}}" stepKey="seeUser"/> - <click selector="{{AdminUserGridSection.searchResultFirstRow}}" stepKey="openUserEdit"/> - <waitForPageLoad stepKey="waitForUserEditPageLoad"/> - <fillField selector="{{AdminEditUserSection.currentPasswordField}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="enterThePassword"/> - <click selector="{{AdminMainActionsSection.delete}}" stepKey="deleteUser"/> - <waitForElementVisible selector="{{AdminConfirmationModalSection.message}}" stepKey="waitForConfirmModal"/> - <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmDelete"/> - <waitForPageLoad stepKey="waitForSave"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You deleted the user." stepKey="seeUserDeleteMessage"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminFillUserRoleRequiredDataActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminFillUserRoleRequiredDataActionGroup.xml new file mode 100644 index 0000000000000..236db105fad14 --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminFillUserRoleRequiredDataActionGroup.xml @@ -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="AdminFillUserRoleRequiredDataActionGroup" extends="AdminCreateRoleActionGroup"> + <remove keyForRemoval="clickRoleResourcesTab"/> + <remove keyForRemoval="waitForScopeSelection"/> + <remove keyForRemoval="selectResourceAccessCustom"/> + <remove keyForRemoval="waitForElementVisible"/> + <remove keyForRemoval="clickContentBlockCheckbox"/> + <remove keyForRemoval="clickSaveRoleButton"/> + <remove keyForRemoval="waitForPageLoad2"/> + </actionGroup> +</actionGroups> From d0771dc3ab7e57c8efcfbc4cbe1d616239b3ef16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 14:18:57 +0100 Subject: [PATCH 116/586] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- .../AdminAddCustomUrlRewriteActionGroup.xml | 38 ++++++ ...dminAddUrlRewriteForProductActionGroup.xml | 34 +++++ .../AdminDeleteUrlRewriteActionGroup.xml | 35 +++++ ...chAndSelectUrlRewriteInGridActionGroup.xml | 29 ++++ .../AdminSearchByRequestPathActionGroup.xml | 32 +++++ ...dminSearchDeletedUrlRewriteActionGroup.xml | 28 ++++ ...earchUrlRewriteProductBySkuActionGroup.xml | 29 ++++ ...AdminUpdateCustomUrlRewriteActionGroup.xml | 32 +++++ .../AdminUpdateUrlRewriteActionGroup.xml | 31 +++++ .../AdminUrlRewriteActionGroup.xml | 97 +------------- .../AdminUrlRewriteGridActionGroup.xml | 126 ------------------ ...tPageByUrlRewriteIsNotFoundActionGroup.xml | 23 ++++ ...tStorefrontProductRedirectActionGroup.xml} | 21 +-- ...torefrontUrlRewriteRedirectActionGroup.xml | 25 ++++ ...ateURLRewriteWhenCategoryIsDeletedTest.xml | 12 +- ...CategoryUrlRewriteAndAddNoRedirectTest.xml | 4 +- ...yUrlRewriteAndAddPermanentRedirectTest.xml | 6 +- ...yUrlRewriteAndAddTemporaryRedirectTest.xml | 6 +- ...eUrlRewriteAndAddPermanentRedirectTest.xml | 8 +- ...eUrlRewriteAndAddTemporaryRedirectTest.xml | 8 +- ...yUrlRewriteAndAddPermanentRedirectTest.xml | 12 +- ...tUrlRewriteAndAddTemporaryRedirectTest.xml | 12 +- ...eProductURLRewriteAndAddNoRedirectTest.xml | 10 +- ...ithCategoryAndAddTemporaryRedirectTest.xml | 12 +- ...tUrLRewriteAndAddPermanentRedirectTest.xml | 10 +- ...tUrLRewriteAndAddTemporaryRedirectTest.xml | 10 +- ...SeveralWebsitesAndCheckURLRewritesTest.xml | 6 +- .../Test/AdminDeleteCustomUrlRewriteTest.xml | 8 +- ...CreateUrlRewriteForCustomStoreViewTest.xml | 6 +- ...oryUrlRewriteAndAddAspxRequestPathTest.xml | 8 +- ...CategoryUrlRewriteAndAddNoRedirectTest.xml | 8 +- ...yUrlRewriteAndAddPermanentRedirectTest.xml | 8 +- ...yUrlRewriteAndAddTemporaryRedirectTest.xml | 8 +- ...inUpdateCustomURLRewritesPermanentTest.xml | 10 +- ...inUpdateCustomURLRewritesTemporaryTest.xml | 12 +- ...tUrlRewriteAndAddTemporaryRedirectTest.xml | 6 +- 36 files changed, 435 insertions(+), 335 deletions(-) create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminAddCustomUrlRewriteActionGroup.xml create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminAddUrlRewriteForProductActionGroup.xml create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminDeleteUrlRewriteActionGroup.xml create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSearchAndSelectUrlRewriteInGridActionGroup.xml create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSearchByRequestPathActionGroup.xml create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSearchDeletedUrlRewriteActionGroup.xml create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSearchUrlRewriteProductBySkuActionGroup.xml create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUpdateCustomUrlRewriteActionGroup.xml create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUpdateUrlRewriteActionGroup.xml delete mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUrlRewriteGridActionGroup.xml create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AssertPageByUrlRewriteIsNotFoundActionGroup.xml rename app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/{StorefrontUrlRewriteRedirectActionGroup.xml => AssertStorefrontProductRedirectActionGroup.xml} (52%) create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AssertStorefrontUrlRewriteRedirectActionGroup.xml diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminAddCustomUrlRewriteActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminAddCustomUrlRewriteActionGroup.xml new file mode 100644 index 0000000000000..d4bcb5bbb414f --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminAddCustomUrlRewriteActionGroup.xml @@ -0,0 +1,38 @@ +<?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="AdminAddCustomUrlRewriteActionGroup"> + <annotations> + <description>Goes to the Admin URL Rewrite edit page. Adds the provided Custom URL Rewrite details. Clicks on Save. Validates that the Success Message is present.</description> + </annotations> + <arguments> + <argument name="customUrlRewriteValue" type="string"/> + <argument name="storeValue" type="string"/> + <argument name="requestPath" type="string"/> + <argument name="targetPath" type="string"/> + <argument name="redirectTypeValue" type="string"/> + <argument name="description" type="string"/> + </arguments> + + <amOnPage url="{{AdminUrlRewriteEditPage.url}}" stepKey="openUrlRewriteEditPage"/> + <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad" after="openUrlRewriteEditPage"/> + <click selector="{{AdminUrlRewriteEditSection.createCustomUrlRewrite}}" stepKey="clickOnCustonUrlRewrite"/> + <click selector="{{AdminUrlRewriteEditSection.createCustomUrlRewriteValue('customUrlRewriteValue')}}" stepKey="selectCustom"/> + <click selector="{{AdminUrlRewriteEditSection.store}}" stepKey="clickOnStore"/> + <click selector="{{AdminUrlRewriteEditSection.storeValue('storeValue')}}" stepKey="clickOnStoreValue"/> + <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPath"/> + <fillField selector="{{AdminUrlRewriteEditSection.targetPath}}" userInput="{{targetPath}}" stepKey="fillTargetPath"/> + <click selector="{{AdminUrlRewriteEditSection.redirectType}}" stepKey="selectRedirectType"/> + <click selector="{{AdminUrlRewriteEditSection.redirectTypeValue('redirectTypeValue')}}" stepKey="selectRedirectTypeValue"/> + <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescription"/> + <click selector="{{AdminUrlRewriteEditSection.saveButton}}" stepKey="clickOnSaveButton"/> + <seeElement selector="{{AdminUrlRewriteIndexSection.successMessage}}" stepKey="seeSuccessSaveMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminAddUrlRewriteForProductActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminAddUrlRewriteForProductActionGroup.xml new file mode 100644 index 0000000000000..51436fc5de584 --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminAddUrlRewriteForProductActionGroup.xml @@ -0,0 +1,34 @@ +<?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="AdminAddUrlRewriteForProductActionGroup"> + <annotations> + <description>Adds the provided URL Rewrite details for a Product.</description> + </annotations> + <arguments> + <argument name="storeValue" type="string"/> + <argument name="requestPath" type="string"/> + <argument name="redirectTypeValue" type="string"/> + <argument name="description" type="string"/> + </arguments> + + <waitForElementVisible selector="{{AdminUrlRewriteProductSection.skipCategoryButton}}" stepKey="waitForSkipCategoryButton"/> + <click selector="{{AdminUrlRewriteProductSection.skipCategoryButton}}" stepKey="clickOnSkipCategoryButton"/> + <waitForPageLoad stepKey="waitForProductPageToLoad"/> + <click selector="{{AdminUrlRewriteEditSection.store}}" stepKey="clickOnStore"/> + <click selector="{{AdminUrlRewriteEditSection.storeValue('storeValue')}}" stepKey="clickOnStoreValue"/> + <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPath"/> + <click selector="{{AdminUrlRewriteEditSection.redirectType}}" stepKey="selectRedirectType"/> + <click selector="{{AdminUrlRewriteEditSection.redirectTypeValue('redirectTypeValue')}}" stepKey="clickOnRedirectTypeValue"/> + <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescription"/> + <click selector="{{AdminUrlRewriteEditSection.saveButton}}" stepKey="clickOnSaveButton"/> + <seeElement selector="{{AdminUrlRewriteIndexSection.successMessage}}" stepKey="seeSuccessSaveMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminDeleteUrlRewriteActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminDeleteUrlRewriteActionGroup.xml new file mode 100644 index 0000000000000..bc3953c4dedd4 --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminDeleteUrlRewriteActionGroup.xml @@ -0,0 +1,35 @@ +<?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="AdminDeleteUrlRewriteActionGroup"> + <annotations> + <description>Goes to the Admin URL Rewrite grid page. Deletes the provided Request Path. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="requestPath" type="string"/> + </arguments> + + <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="openUrlRewriteEditPage"/> + <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad"/> + <click selector="{{AdminUrlRewriteIndexSection.resetButton}}" stepKey="clickOnResetButton"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="{{requestPath}}" stepKey="fillRedirectPathFilter"/> + <click selector="{{AdminUrlRewriteIndexSection.searchButton}}" stepKey="clickOnSearchButton"/> + <waitForPageLoad stepKey="waitForPageToLoad1"/> + <click selector="{{AdminUrlRewriteIndexSection.editButton('1')}}" stepKey="clickOnEditButton"/> + <waitForPageLoad stepKey="waitForEditPageToLoad"/> + <click selector="{{AdminUrlRewriteEditSection.deleteButton}}" stepKey="clickOnDeleteButton"/> + <waitForPageLoad stepKey="waitForPageToLoad2"/> + <waitForElementVisible selector="{{AdminUrlRewriteEditSection.okButton}}" stepKey="waitForOkButtonToVisible"/> + <click selector="{{AdminUrlRewriteEditSection.okButton}}" stepKey="clickOnOkButton"/> + <waitForPageLoad stepKey="waitForPageToLoad3"/> + <see selector="{{AdminUrlRewriteIndexSection.successMessage}}" userInput="You deleted the URL rewrite." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSearchAndSelectUrlRewriteInGridActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSearchAndSelectUrlRewriteInGridActionGroup.xml new file mode 100644 index 0000000000000..f2f114f01cc9e --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSearchAndSelectUrlRewriteInGridActionGroup.xml @@ -0,0 +1,29 @@ +<?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="AdminSearchAndSelectUrlRewriteInGridActionGroup"> + <annotations> + <description>Goes to the Admin URL Rewrite grid page. Searches the grid for the provided Request Path. Clicks on Edit.</description> + </annotations> + <arguments> + <argument name="requestPath" type="string"/> + </arguments> + + <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="openUrlRewriteEditPage"/> + <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad"/> + <click selector="{{AdminUrlRewriteIndexSection.resetButton}}" stepKey="clickOnResetButton"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="{{requestPath}}" stepKey="fillRedirectPathFilter"/> + <click selector="{{AdminUrlRewriteIndexSection.searchButton}}" stepKey="clickOnSearchButton"/> + <waitForPageLoad stepKey="waitForPageToLoad1"/> + <click selector="{{AdminUrlRewriteIndexSection.editButton('1')}}" stepKey="clickOnEditButton"/> + <waitForPageLoad stepKey="waitForEditPageToLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSearchByRequestPathActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSearchByRequestPathActionGroup.xml new file mode 100644 index 0000000000000..99ac4ea160f82 --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSearchByRequestPathActionGroup.xml @@ -0,0 +1,32 @@ +<?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="AdminSearchByRequestPathActionGroup"> + <annotations> + <description>Goes to the Admin URL Rewrite grid page. Searches the grid based on the provided Redirect Path. Validates that the provided Redirect Path, Type and Target Path are present and correct in the grid.</description> + </annotations> + <arguments> + <argument name="redirectPath" type="string"/> + <argument name="redirectType" type="string"/> + <argument name="targetPath" type="string"/> + </arguments> + + <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="openUrlRewriteEditPage"/> + <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad"/> + <click selector="{{AdminUrlRewriteIndexSection.resetButton}}" stepKey="clickOnResetButton"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="{{redirectPath}}" stepKey="fillRedirectPathFilter"/> + <click selector="{{AdminUrlRewriteIndexSection.searchButton}}" stepKey="clickOnSearchButton"/> + <waitForPageLoad stepKey="waitForPageToLoad1"/> + <see selector="{{AdminUrlRewriteIndexSection.requestPathColumn('1')}}" userInput="{{redirectPath}}" stepKey="seeTheRedirectPathForOldUrl"/> + <see selector="{{AdminUrlRewriteIndexSection.targetPathColumn('1')}}" userInput="{{targetPath}}" stepKey="seeTheTargetPath"/> + <see selector="{{AdminUrlRewriteIndexSection.redirectTypeColumn('1')}}" userInput="{{redirectType}}" stepKey="seeTheRedirectTypeForOldUrl"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSearchDeletedUrlRewriteActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSearchDeletedUrlRewriteActionGroup.xml new file mode 100644 index 0000000000000..2d7178f72f407 --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSearchDeletedUrlRewriteActionGroup.xml @@ -0,0 +1,28 @@ +<?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="AdminSearchDeletedUrlRewriteActionGroup"> + <annotations> + <description>Goes to the Admin URL Rewrite grid page. Searches the grid for the provided Request Path. Validates that it does NOT appear in the grid.</description> + </annotations> + <arguments> + <argument name="requestPath" type="string"/> + </arguments> + + <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="openUrlRewriteEditPage"/> + <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad"/> + <click selector="{{AdminUrlRewriteIndexSection.resetButton}}" stepKey="clickOnResetButton"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="{{requestPath}}" stepKey="fillRedirectPathFilter"/> + <click selector="{{AdminUrlRewriteIndexSection.searchButton}}" stepKey="clickOnSearchButton"/> + <waitForPageLoad stepKey="waitForPageToLoad1"/> + <see selector="{{AdminUrlRewriteIndexSection.emptyRecords}}" userInput="We couldn't find any records." stepKey="seeEmptyRecordMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSearchUrlRewriteProductBySkuActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSearchUrlRewriteProductBySkuActionGroup.xml new file mode 100644 index 0000000000000..d77621ccd768f --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSearchUrlRewriteProductBySkuActionGroup.xml @@ -0,0 +1,29 @@ +<?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="AdminSearchUrlRewriteProductBySkuActionGroup"> + <annotations> + <description>Goes to the Admin URL Rewrite grid page. Searches the grid based on the provided Product SKU. Clicks on the 1st row in the grid.</description> + </annotations> + <arguments> + <argument name="productSku" type="string"/> + </arguments> + + <amOnPage url="{{AdminUrlRewriteProductPage.url}}" stepKey="openUrlRewriteProductPage"/> + <waitForPageLoad stepKey="waitForUrlRewriteProductPageToLoad"/> + <click selector="{{AdminUrlRewriteProductSection.resetFilter}}" stepKey="clickOnResetFilter"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <fillField selector="{{AdminUrlRewriteProductSection.skuFilter}}" userInput="{{productSku}}" stepKey="fillProductSkuFilter"/> + <click selector="{{AdminUrlRewriteProductSection.searchFilter}}" stepKey="clickOnSearchFilter"/> + <waitForPageLoad stepKey="waitForProductToLoad"/> + <click selector="{{AdminUrlRewriteProductSection.productRow}}" stepKey="clickOnFirstRow"/> + <waitForPageLoad stepKey="waitForProductCategoryPageToLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUpdateCustomUrlRewriteActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUpdateCustomUrlRewriteActionGroup.xml new file mode 100644 index 0000000000000..0d0c754fe076e --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUpdateCustomUrlRewriteActionGroup.xml @@ -0,0 +1,32 @@ +<?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="AdminUpdateCustomUrlRewriteActionGroup"> + <annotations> + <description>Updates the Custom URL Rewrite fields with the provided details.</description> + </annotations> + <arguments> + <argument name="storeValue" type="string"/> + <argument name="requestPath" type="string"/> + <argument name="targetPath" type="string"/> + <argument name="redirectTypeValue" type="string"/> + <argument name="description" type="string"/> + </arguments> + + <click selector="{{AdminUrlRewriteEditSection.store}}" stepKey="clickOnStore"/> + <click selector="{{AdminUrlRewriteEditSection.storeValue('storeValue')}}" stepKey="clickOnStoreValue"/> + <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPath"/> + <fillField selector="{{AdminUrlRewriteEditSection.targetPath}}" userInput="{{targetPath}}" stepKey="fillTargetPath"/> + <selectOption selector="{{AdminUrlRewriteEditSection.redirectType}}" userInput="{{redirectTypeValue}}" stepKey="selectRedirectTypeValue"/> + <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescription"/> + <click selector="{{AdminUrlRewriteEditSection.saveButton}}" stepKey="clickOnSaveButton"/> + <seeElement selector="{{AdminUrlRewriteIndexSection.successMessage}}" stepKey="seeSuccessSaveMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUpdateUrlRewriteActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUpdateUrlRewriteActionGroup.xml new file mode 100644 index 0000000000000..4b884448a7653 --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUpdateUrlRewriteActionGroup.xml @@ -0,0 +1,31 @@ +<?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="AdminUpdateUrlRewriteActionGroup"> + <annotations> + <description>Updates the URL Rewrite fields with the provided details.</description> + </annotations> + <arguments> + <argument name="storeValue" type="string"/> + <argument name="requestPath" type="string"/> + <argument name="redirectTypeValue" type="string"/> + <argument name="description" type="string"/> + </arguments> + + <click selector="{{AdminUrlRewriteEditSection.store}}" stepKey="clickOnStore"/> + <click selector="{{AdminUrlRewriteEditSection.storeValue(storeValue)}}" stepKey="clickOnStoreValue"/> + <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPath"/> + <click selector="{{AdminUrlRewriteEditSection.redirectType}}" stepKey="selectRedirectType"/> + <click selector="{{AdminUrlRewriteEditSection.redirectTypeValue(redirectTypeValue)}}" stepKey="selectRedirectTypeValue"/> + <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescription"/> + <click selector="{{AdminUrlRewriteEditSection.saveButton}}" stepKey="clickOnSaveButton"/> + <seeElement selector="{{AdminUrlRewriteIndexSection.successMessage}}" stepKey="seeSuccessSaveMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUrlRewriteActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUrlRewriteActionGroup.xml index 4f89c9389c32b..55f18ae5a0187 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUrlRewriteActionGroup.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUrlRewriteActionGroup.xml @@ -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="AdminAddUrlRewrite"> + <actionGroup name="AdminAddUrlRewriteActionGroup"> <annotations> <description>Goes to the Admin Add URL Rewrite edit page. Fills in the provided URL details. Clicks on Save. Validates that the Success Message is present.</description> </annotations> @@ -35,99 +35,4 @@ <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/> <see selector="{{AdminMessagesSection.success}}" userInput="The URL Rewrite has been saved." stepKey="seeSuccessMessage"/> </actionGroup> - - <actionGroup name="AdminAddUrlRewriteForProduct"> - <annotations> - <description>Adds the provided URL Rewrite details for a Product.</description> - </annotations> - <arguments> - <argument name="storeValue" type="string"/> - <argument name="requestPath" type="string"/> - <argument name="redirectTypeValue" type="string"/> - <argument name="description" type="string"/> - </arguments> - - <waitForElementVisible selector="{{AdminUrlRewriteProductSection.skipCategoryButton}}" stepKey="waitForSkipCategoryButton"/> - <click selector="{{AdminUrlRewriteProductSection.skipCategoryButton}}" stepKey="clickOnSkipCategoryButton"/> - <waitForPageLoad stepKey="waitForProductPageToLoad"/> - <click selector="{{AdminUrlRewriteEditSection.store}}" stepKey="clickOnStore"/> - <click selector="{{AdminUrlRewriteEditSection.storeValue('storeValue')}}" stepKey="clickOnStoreValue"/> - <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPath"/> - <click selector="{{AdminUrlRewriteEditSection.redirectType}}" stepKey="selectRedirectType"/> - <click selector="{{AdminUrlRewriteEditSection.redirectTypeValue('redirectTypeValue')}}" stepKey="clickOnRedirectTypeValue"/> - <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescription"/> - <click selector="{{AdminUrlRewriteEditSection.saveButton}}" stepKey="clickOnSaveButton"/> - <seeElement selector="{{AdminUrlRewriteIndexSection.successMessage}}" stepKey="seeSuccessSaveMessage"/> - </actionGroup> - - <actionGroup name="AdminAddCustomUrlRewrite"> - <annotations> - <description>Goes to the Admin URL Rewrite edit page. Adds the provided Custom URL Rewrite details. Clicks on Save. Validates that the Success Message is present.</description> - </annotations> - <arguments> - <argument name="customUrlRewriteValue" type="string"/> - <argument name="storeValue" type="string"/> - <argument name="requestPath" type="string"/> - <argument name="targetPath" type="string"/> - <argument name="redirectTypeValue" type="string"/> - <argument name="description" type="string"/> - </arguments> - - <amOnPage url="{{AdminUrlRewriteEditPage.url}}" stepKey="openUrlRewriteEditPage"/> - <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad" after="openUrlRewriteEditPage"/> - <click selector="{{AdminUrlRewriteEditSection.createCustomUrlRewrite}}" stepKey="clickOnCustonUrlRewrite"/> - <click selector="{{AdminUrlRewriteEditSection.createCustomUrlRewriteValue('customUrlRewriteValue')}}" stepKey="selectCustom"/> - <click selector="{{AdminUrlRewriteEditSection.store}}" stepKey="clickOnStore"/> - <click selector="{{AdminUrlRewriteEditSection.storeValue('storeValue')}}" stepKey="clickOnStoreValue"/> - <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPath"/> - <fillField selector="{{AdminUrlRewriteEditSection.targetPath}}" userInput="{{targetPath}}" stepKey="fillTargetPath"/> - <click selector="{{AdminUrlRewriteEditSection.redirectType}}" stepKey="selectRedirectType"/> - <click selector="{{AdminUrlRewriteEditSection.redirectTypeValue('redirectTypeValue')}}" stepKey="selectRedirectTypeValue"/> - <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescription"/> - <click selector="{{AdminUrlRewriteEditSection.saveButton}}" stepKey="clickOnSaveButton"/> - <seeElement selector="{{AdminUrlRewriteIndexSection.successMessage}}" stepKey="seeSuccessSaveMessage"/> - </actionGroup> - - <actionGroup name="AdminUpdateUrlRewrite"> - <annotations> - <description>Updates the URL Rewrite fields with the provided details.</description> - </annotations> - <arguments> - <argument name="storeValue" type="string"/> - <argument name="requestPath" type="string"/> - <argument name="redirectTypeValue" type="string"/> - <argument name="description" type="string"/> - </arguments> - - <click selector="{{AdminUrlRewriteEditSection.store}}" stepKey="clickOnStore"/> - <click selector="{{AdminUrlRewriteEditSection.storeValue(storeValue)}}" stepKey="clickOnStoreValue"/> - <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPath"/> - <click selector="{{AdminUrlRewriteEditSection.redirectType}}" stepKey="selectRedirectType"/> - <click selector="{{AdminUrlRewriteEditSection.redirectTypeValue(redirectTypeValue)}}" stepKey="selectRedirectTypeValue"/> - <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescription"/> - <click selector="{{AdminUrlRewriteEditSection.saveButton}}" stepKey="clickOnSaveButton"/> - <seeElement selector="{{AdminUrlRewriteIndexSection.successMessage}}" stepKey="seeSuccessSaveMessage"/> - </actionGroup> - - <actionGroup name="AdminUpdateCustomUrlRewrite"> - <annotations> - <description>Updates the Custom URL Rewrite fields with the provided details.</description> - </annotations> - <arguments> - <argument name="storeValue" type="string"/> - <argument name="requestPath" type="string"/> - <argument name="targetPath" type="string"/> - <argument name="redirectTypeValue" type="string"/> - <argument name="description" type="string"/> - </arguments> - - <click selector="{{AdminUrlRewriteEditSection.store}}" stepKey="clickOnStore"/> - <click selector="{{AdminUrlRewriteEditSection.storeValue('storeValue')}}" stepKey="clickOnStoreValue"/> - <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPath"/> - <fillField selector="{{AdminUrlRewriteEditSection.targetPath}}" userInput="{{targetPath}}" stepKey="fillTargetPath"/> - <selectOption selector="{{AdminUrlRewriteEditSection.redirectType}}" userInput="{{redirectTypeValue}}" stepKey="selectRedirectTypeValue"/> - <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescription"/> - <click selector="{{AdminUrlRewriteEditSection.saveButton}}" stepKey="clickOnSaveButton"/> - <seeElement selector="{{AdminUrlRewriteIndexSection.successMessage}}" stepKey="seeSuccessSaveMessage"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUrlRewriteGridActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUrlRewriteGridActionGroup.xml deleted file mode 100644 index 2a3f4446e2b74..0000000000000 --- a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUrlRewriteGridActionGroup.xml +++ /dev/null @@ -1,126 +0,0 @@ -<?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="AdminSearchByRequestPath"> - <annotations> - <description>Goes to the Admin URL Rewrite grid page. Searches the grid based on the provided Redirect Path. Validates that the provided Redirect Path, Type and Target Path are present and correct in the grid.</description> - </annotations> - <arguments> - <argument name="redirectPath" type="string"/> - <argument name="redirectType" type="string"/> - <argument name="targetPath" type="string"/> - </arguments> - - <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="openUrlRewriteEditPage"/> - <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad"/> - <click selector="{{AdminUrlRewriteIndexSection.resetButton}}" stepKey="clickOnResetButton"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> - <fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="{{redirectPath}}" stepKey="fillRedirectPathFilter"/> - <click selector="{{AdminUrlRewriteIndexSection.searchButton}}" stepKey="clickOnSearchButton"/> - <waitForPageLoad stepKey="waitForPageToLoad1"/> - <see selector="{{AdminUrlRewriteIndexSection.requestPathColumn('1')}}" userInput="{{redirectPath}}" stepKey="seeTheRedirectPathForOldUrl"/> - <see selector="{{AdminUrlRewriteIndexSection.targetPathColumn('1')}}" userInput="{{targetPath}}" stepKey="seeTheTargetPath"/> - <see selector="{{AdminUrlRewriteIndexSection.redirectTypeColumn('1')}}" userInput="{{redirectType}}" stepKey="seeTheRedirectTypeForOldUrl"/> - </actionGroup> - - <actionGroup name="AdminSearchUrlRewriteProductBySku"> - <annotations> - <description>Goes to the Admin URL Rewrite grid page. Searches the grid based on the provided Product SKU. Clicks on the 1st row in the grid.</description> - </annotations> - <arguments> - <argument name="productSku" type="string"/> - </arguments> - - <amOnPage url="{{AdminUrlRewriteProductPage.url}}" stepKey="openUrlRewriteProductPage"/> - <waitForPageLoad stepKey="waitForUrlRewriteProductPageToLoad"/> - <click selector="{{AdminUrlRewriteProductSection.resetFilter}}" stepKey="clickOnResetFilter"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> - <fillField selector="{{AdminUrlRewriteProductSection.skuFilter}}" userInput="{{productSku}}" stepKey="fillProductSkuFilter"/> - <click selector="{{AdminUrlRewriteProductSection.searchFilter}}" stepKey="clickOnSearchFilter"/> - <waitForPageLoad stepKey="waitForProductToLoad"/> - <click selector="{{AdminUrlRewriteProductSection.productRow}}" stepKey="clickOnFirstRow"/> - <waitForPageLoad stepKey="waitForProductCategoryPageToLoad"/> - </actionGroup> - - <actionGroup name="AdminSearchDeletedUrlRewrite"> - <annotations> - <description>Goes to the Admin URL Rewrite grid page. Searches the grid for the provided Request Path. Validates that it does NOT appear in the grid.</description> - </annotations> - <arguments> - <argument name="requestPath" type="string"/> - </arguments> - - <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="openUrlRewriteEditPage"/> - <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad"/> - <click selector="{{AdminUrlRewriteIndexSection.resetButton}}" stepKey="clickOnResetButton"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> - <fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="{{requestPath}}" stepKey="fillRedirectPathFilter"/> - <click selector="{{AdminUrlRewriteIndexSection.searchButton}}" stepKey="clickOnSearchButton"/> - <waitForPageLoad stepKey="waitForPageToLoad1"/> - <see selector="{{AdminUrlRewriteIndexSection.emptyRecords}}" userInput="We couldn't find any records." stepKey="seeEmptyRecordMessage"/> - </actionGroup> - - <actionGroup name="AdminDeleteUrlRewrite"> - <annotations> - <description>Goes to the Admin URL Rewrite grid page. Deletes the provided Request Path. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="requestPath" type="string"/> - </arguments> - - <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="openUrlRewriteEditPage"/> - <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad"/> - <click selector="{{AdminUrlRewriteIndexSection.resetButton}}" stepKey="clickOnResetButton"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> - <fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="{{requestPath}}" stepKey="fillRedirectPathFilter"/> - <click selector="{{AdminUrlRewriteIndexSection.searchButton}}" stepKey="clickOnSearchButton"/> - <waitForPageLoad stepKey="waitForPageToLoad1"/> - <click selector="{{AdminUrlRewriteIndexSection.editButton('1')}}" stepKey="clickOnEditButton"/> - <waitForPageLoad stepKey="waitForEditPageToLoad"/> - <click selector="{{AdminUrlRewriteEditSection.deleteButton}}" stepKey="clickOnDeleteButton"/> - <waitForPageLoad stepKey="waitForPageToLoad2"/> - <waitForElementVisible selector="{{AdminUrlRewriteEditSection.okButton}}" stepKey="waitForOkButtonToVisible"/> - <click selector="{{AdminUrlRewriteEditSection.okButton}}" stepKey="clickOnOkButton"/> - <waitForPageLoad stepKey="waitForPageToLoad3"/> - <see selector="{{AdminUrlRewriteIndexSection.successMessage}}" userInput="You deleted the URL rewrite." stepKey="seeSuccessMessage"/> - </actionGroup> - - <actionGroup name="AssertPageByUrlRewriteIsNotFound"> - <annotations> - <description>Validates that the provided Request Path does NOT exist on the Storefront. Validates that the 'Whoops' message is present and correct.</description> - </annotations> - <arguments> - <argument name="requestPath" type="string"/> - </arguments> - - <amOnPage url="{{requestPath}}" stepKey="amOnPage"/> - <waitForPageLoad stepKey="waitForStorefrontPageLoad"/> - <see userInput="Whoops, our bad..." stepKey="seeWhoops"/> - </actionGroup> - - <actionGroup name="AdminSearchAndSelectUrlRewriteInGrid"> - <annotations> - <description>Goes to the Admin URL Rewrite grid page. Searches the grid for the provided Request Path. Clicks on Edit.</description> - </annotations> - <arguments> - <argument name="requestPath" type="string"/> - </arguments> - - <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="openUrlRewriteEditPage"/> - <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad"/> - <click selector="{{AdminUrlRewriteIndexSection.resetButton}}" stepKey="clickOnResetButton"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> - <fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="{{requestPath}}" stepKey="fillRedirectPathFilter"/> - <click selector="{{AdminUrlRewriteIndexSection.searchButton}}" stepKey="clickOnSearchButton"/> - <waitForPageLoad stepKey="waitForPageToLoad1"/> - <click selector="{{AdminUrlRewriteIndexSection.editButton('1')}}" stepKey="clickOnEditButton"/> - <waitForPageLoad stepKey="waitForEditPageToLoad"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AssertPageByUrlRewriteIsNotFoundActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AssertPageByUrlRewriteIsNotFoundActionGroup.xml new file mode 100644 index 0000000000000..4188c86a58b81 --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AssertPageByUrlRewriteIsNotFoundActionGroup.xml @@ -0,0 +1,23 @@ +<?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="AssertPageByUrlRewriteIsNotFoundActionGroup"> + <annotations> + <description>Validates that the provided Request Path does NOT exist on the Storefront. Validates that the 'Whoops' message is present and correct.</description> + </annotations> + <arguments> + <argument name="requestPath" type="string"/> + </arguments> + + <amOnPage url="{{requestPath}}" stepKey="amOnPage"/> + <waitForPageLoad stepKey="waitForStorefrontPageLoad"/> + <see userInput="Whoops, our bad..." stepKey="seeWhoops"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/StorefrontUrlRewriteRedirectActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AssertStorefrontProductRedirectActionGroup.xml similarity index 52% rename from app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/StorefrontUrlRewriteRedirectActionGroup.xml rename to app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AssertStorefrontProductRedirectActionGroup.xml index 325045bccc869..8a41dc4e2a9b3 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/StorefrontUrlRewriteRedirectActionGroup.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AssertStorefrontProductRedirectActionGroup.xml @@ -7,23 +7,8 @@ --> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AssertStorefrontUrlRewriteRedirect"> - <annotations> - <description>Goes to the provided New URL. Validates that the redirect works and the provided Category is present.</description> - </annotations> - <arguments> - <argument name="category" type="string"/> - <argument name="newRequestPath" type="string"/> - </arguments> - - <amOnPage url="{{newRequestPath}}" stepKey="openCategoryInStorefront"/> - <waitForPageLoad stepKey="waitForCategoryPageToLoad"/> - <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(category)}}" stepKey="seeCategoryOnStoreNavigationBar"/> - <seeElement selector="{{StorefrontCategoryMainSection.CategoryTitle(category)}}" stepKey="seeCategoryInTitle"/> - </actionGroup> - - <actionGroup name="AssertStorefrontProductRedirect"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertStorefrontProductRedirectActionGroup"> <annotations> <description>Goes to the provided New Product URL. Validates that the redirect works and the provided Product is present and correct.</description> </annotations> @@ -32,7 +17,7 @@ <argument name="productSku" type="string"/> <argument name="productRequestPath" type="string"/> </arguments> - + <amOnPage url="{{productRequestPath}}" stepKey="openCategoryInStorefront"/> <waitForPageLoad stepKey="waitForCategoryPageToLoad"/> <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{productName}}" stepKey="seeProductNameInStoreFrontPage"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AssertStorefrontUrlRewriteRedirectActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AssertStorefrontUrlRewriteRedirectActionGroup.xml new file mode 100644 index 0000000000000..4d95c1a43876b --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AssertStorefrontUrlRewriteRedirectActionGroup.xml @@ -0,0 +1,25 @@ +<?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="AssertStorefrontUrlRewriteRedirectActionGroup"> + <annotations> + <description>Goes to the provided New URL. Validates that the redirect works and the provided Category is present.</description> + </annotations> + <arguments> + <argument name="category" type="string"/> + <argument name="newRequestPath" type="string"/> + </arguments> + + <amOnPage url="{{newRequestPath}}" stepKey="openCategoryInStorefront"/> + <waitForPageLoad stepKey="waitForCategoryPageToLoad"/> + <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(category)}}" stepKey="seeCategoryOnStoreNavigationBar"/> + <seeElement selector="{{StorefrontCategoryMainSection.CategoryTitle(category)}}" stepKey="seeCategoryInTitle"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminAutoUpdateURLRewriteWhenCategoryIsDeletedTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminAutoUpdateURLRewriteWhenCategoryIsDeletedTest.xml index 52d313b21f3e1..ef63478844b20 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminAutoUpdateURLRewriteWhenCategoryIsDeletedTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminAutoUpdateURLRewriteWhenCategoryIsDeletedTest.xml @@ -30,12 +30,12 @@ </after> <!--Filter and Select the created Product --> - <actionGroup ref="AdminSearchUrlRewriteProductBySku" stepKey="searchProduct"> + <actionGroup ref="AdminSearchUrlRewriteProductBySkuActionGroup" stepKey="searchProduct"> <argument name="productSku" value="$$createSimpleProduct.sku$$"/> </actionGroup> <!-- Update the Store, RequestPath, RedirectType and Description --> - <actionGroup ref="AdminAddUrlRewriteForProduct" stepKey="addUrlRewriteForProduct"> + <actionGroup ref="AdminAddUrlRewriteForProductActionGroup" stepKey="addUrlRewriteForProduct"> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="{{_defaultProduct.urlKey}}.html"/> <argument name="redirectTypeValue" value="Temporary (302)"/> @@ -52,22 +52,22 @@ <grabFromCurrentUrl stepKey="productId" regex="#\/([0-9]*)?\/$#"/> <!-- Assert Redirect path, Target Path and Redirect type in grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath"> <argument name="redirectPath" value="$$createSimpleProduct.name$$.html" /> <argument name="redirectType" value="No" /> <argument name="targetPath" value="catalog/product/view/id/{$productId}"/> </actionGroup> <!-- Assert Redirect path, Target Path and Redirect type in grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath1"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath1"> <argument name="redirectPath" value="{{_defaultProduct.urlKey}}.html" /> <argument name="redirectType" value="Temporary (302)"/> <argument name="targetPath" value="$$createSimpleProduct.name$$.html"/> </actionGroup> <!--Assert Category Url Redirect is not present --> - <actionGroup ref="AdminSearchDeletedUrlRewrite" stepKey="searchDeletedCategory"> + <actionGroup ref="AdminSearchDeletedUrlRewriteActionGroup" stepKey="searchDeletedCategory"> <argument name="requestPath" value="$$createCategory.name$$.html"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddNoRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddNoRedirectTest.xml index 85e9d7847d5ea..42dca0c22937f 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddNoRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddNoRedirectTest.xml @@ -27,7 +27,7 @@ </after> <!--Open Url Rewrite Index Page and update the Custom Url Rewrite, Store, Request Path, Redirect Type and Description --> - <actionGroup ref="AdminAddUrlRewrite" stepKey="addUrlRewrite"> + <actionGroup ref="AdminAddUrlRewriteActionGroup" stepKey="addUrlRewrite"> <argument name="category" value="$$category.name$$"/> <argument name="customUrlRewriteValue" value="For Category"/> <argument name="storeValue" value="Default Store View"/> @@ -43,7 +43,7 @@ <grabFromCurrentUrl stepKey="categoryId" regex="#\/([0-9]*)?\/$#"/> <!-- Assert Redirect path, Target Path and Redirect type in grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath"> <argument name="redirectPath" value="newrequestpath.html" /> <argument name="redirectType" value="No" /> <argument name="targetPath" value="catalog/category/view/id/{$categoryId}"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddPermanentRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddPermanentRedirectTest.xml index 477742e7e3618..867b3ee54161c 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddPermanentRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddPermanentRedirectTest.xml @@ -27,7 +27,7 @@ </after> <!--Open Url Rewrite Index Page and update the Custom Url Rewrite, Store, Request Path, Redirect Type and Description --> - <actionGroup ref="AdminAddUrlRewrite" stepKey="addUrlRewrite"> + <actionGroup ref="AdminAddUrlRewriteActionGroup" stepKey="addUrlRewrite"> <argument name="category" value="$$category.name$$"/> <argument name="customUrlRewriteValue" value="For Category"/> <argument name="storeValue" value="Default Store View"/> @@ -37,14 +37,14 @@ </actionGroup> <!-- Assert Redirect path, Target Path and Redirect type in grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath"> <argument name="redirectPath" value="newrequestpath.html" /> <argument name="redirectType" value="Permanent (301)" /> <argument name="targetPath" value="$$category.name_lwr$$.html"/> </actionGroup> <!--Assert Updated path directs to the category storefront --> - <actionGroup ref="AssertStorefrontUrlRewriteRedirect" stepKey="openStorefrontUrlRedirectPath"> + <actionGroup ref="AssertStorefrontUrlRewriteRedirectActionGroup" stepKey="openStorefrontUrlRedirectPath"> <argument name="category" value="$$category.name$$"/> <argument name="newRequestPath" value="newrequestpath.html"/> </actionGroup> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddTemporaryRedirectTest.xml index 2367c3d982d15..ab18add56aeb9 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddTemporaryRedirectTest.xml @@ -27,7 +27,7 @@ </after> <!--Open Url Rewrite Index Page and update the Custom Url Rewrite, Store, Request Path, Redirect Type and Description --> - <actionGroup ref="AdminAddUrlRewrite" stepKey="addUrlRewrite"> + <actionGroup ref="AdminAddUrlRewriteActionGroup" stepKey="addUrlRewrite"> <argument name="category" value="$$category.name$$"/> <argument name="customUrlRewriteValue" value="For Category"/> <argument name="storeValue" value="Default Store View"/> @@ -37,14 +37,14 @@ </actionGroup> <!-- Assert Redirect path, Target Path and Redirect type in grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath"> <argument name="redirectPath" value="newrequestpath.html" /> <argument name="redirectType" value="Temporary (302)" /> <argument name="targetPath" value="$$category.name_lwr$$.html"/> </actionGroup> <!--Assert Updated path directs to the category storefront --> - <actionGroup ref="AssertStorefrontUrlRewriteRedirect" stepKey="openStorefrontUrlRedirectPath"> + <actionGroup ref="AssertStorefrontUrlRewriteRedirectActionGroup" stepKey="openStorefrontUrlRedirectPath"> <argument name="category" value="$$category.name$$"/> <argument name="newRequestPath" value="newrequestpath.html"/> </actionGroup> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddPermanentRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddPermanentRedirectTest.xml index 358aa58aba0f7..882992da6b508 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddPermanentRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddPermanentRedirectTest.xml @@ -23,7 +23,7 @@ </before> <after> <deleteData createDataKey="createCMSPage" stepKey="deleteCMSPage"/> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite"> + <actionGroup ref="AdminDeleteUrlRewriteActionGroup" stepKey="deleteCustomUrlRewrite"> <argument name="requestPath" value="{{defaultCmsPage.title}}"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -36,7 +36,7 @@ <grabFromCurrentUrl stepKey="cmsId" regex="#\/([0-9]*)?\/$#"/> <!-- Open UrlRewrite Edit page and update the fields and fill the created CMS Page Target Path --> - <actionGroup ref="AdminAddCustomUrlRewrite" stepKey="addCustomUrlRewrite"> + <actionGroup ref="AdminAddCustomUrlRewriteActionGroup" stepKey="addCustomUrlRewrite"> <argument name="customUrlRewriteValue" value="Custom"/> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="{{defaultCmsPage.title}}"/> @@ -46,14 +46,14 @@ </actionGroup> <!-- Assert updated CMS page Url Rewrite in Grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath"> <argument name="redirectPath" value="{{defaultCmsPage.title}}" /> <argument name="redirectType" value="Permanent (301)" /> <argument name="targetPath" value="cms/page/view/page_id/{$cmsId}"/> </actionGroup> <!-- Assert initial CMS page Url Rewrite in Grid--> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath1"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath1"> <argument name="redirectPath" value="$$createCMSPage.identifier$$" /> <argument name="redirectType" value="No"/> <argument name="targetPath" value="cms/page/view/page_id/{$cmsId}"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddTemporaryRedirectTest.xml index e6ee9b484059d..4af547ad550d5 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddTemporaryRedirectTest.xml @@ -23,7 +23,7 @@ </before> <after> <deleteData createDataKey="createCMSPage" stepKey="deleteCMSPage"/> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite"> + <actionGroup ref="AdminDeleteUrlRewriteActionGroup" stepKey="deleteCustomUrlRewrite"> <argument name="requestPath" value="{{defaultCmsPage.title}}"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -36,7 +36,7 @@ <grabFromCurrentUrl stepKey="cmsId" regex="#\/([0-9]*)?\/$#"/> <!-- Open UrlRewrite Edit page and update the fields and fill the created CMS Page Target Path --> - <actionGroup ref="AdminAddCustomUrlRewrite" stepKey="addCustomUrlRewrite"> + <actionGroup ref="AdminAddCustomUrlRewriteActionGroup" stepKey="addCustomUrlRewrite"> <argument name="customUrlRewriteValue" value="Custom"/> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="{{defaultCmsPage.title}}"/> @@ -46,14 +46,14 @@ </actionGroup> <!-- Assert updated CMS page Url Rewrite in Grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath"> <argument name="redirectPath" value="{{defaultCmsPage.title}}" /> <argument name="redirectType" value="Temporary (302)" /> <argument name="targetPath" value="cms/page/view/page_id/{$cmsId}"/> </actionGroup> <!-- Assert initial CMS page Url Rewrite in Grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath1"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath1"> <argument name="redirectPath" value="$$createCMSPage.identifier$$" /> <argument name="redirectType" value="No"/> <argument name="targetPath" value="cms/page/view/page_id/{$cmsId}"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCategoryUrlRewriteAndAddPermanentRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCategoryUrlRewriteAndAddPermanentRedirectTest.xml index b123bc14cb1ed..b8c981dd772cb 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCategoryUrlRewriteAndAddPermanentRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCategoryUrlRewriteAndAddPermanentRedirectTest.xml @@ -23,7 +23,7 @@ </before> <after> <deleteData createDataKey="category" stepKey="deleteCategory"/> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite"> + <actionGroup ref="AdminDeleteUrlRewriteActionGroup" stepKey="deleteCustomUrlRewrite"> <argument name="requestPath" value="{{FirstLevelSubCat.name}}.html"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -36,7 +36,7 @@ <grabFromCurrentUrl stepKey="categoryId" regex="#\/([0-9]*)?\/$#"/> <!-- Open UrlRewrite Edit page and update the fields and fill the created category Target Path --> - <actionGroup ref="AdminAddCustomUrlRewrite" stepKey="addCustomUrlRewrite"> + <actionGroup ref="AdminAddCustomUrlRewriteActionGroup" stepKey="addCustomUrlRewrite"> <argument name="customUrlRewriteValue" value="Custom"/> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="{{FirstLevelSubCat.name}}.html"/> @@ -46,27 +46,27 @@ </actionGroup> <!-- Assert updated category Url Rewrite in grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByCategoryRequestPath"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByCategoryRequestPath"> <argument name="redirectPath" value="$$category.name$$.html" /> <argument name="redirectType" value="No" /> <argument name="targetPath" value="catalog/category/view/id/{$categoryId}"/> </actionGroup> <!--Assert initial category Url Rewrite in grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByNewRequestPath"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByNewRequestPath"> <argument name="redirectPath" value="{{FirstLevelSubCat.name}}.html" /> <argument name="redirectType" value="Permanent (301)" /> <argument name="targetPath" value="catalog/category/view/id/{$categoryId}"/> </actionGroup> <!-- Assert updated Category redirect in Store Front --> - <actionGroup ref="AssertStorefrontUrlRewriteRedirect" stepKey="verifyCategoryInStoreFront"> + <actionGroup ref="AssertStorefrontUrlRewriteRedirectActionGroup" stepKey="verifyCategoryInStoreFront"> <argument name="category" value="$$category.name$$"/> <argument name="newRequestPath" value="{{FirstLevelSubCat.name}}.html"/> </actionGroup> <!-- Assert initial Category redirect in Store Front --> - <actionGroup ref="AssertStorefrontUrlRewriteRedirect" stepKey="verifyCategoryInStoreFront1"> + <actionGroup ref="AssertStorefrontUrlRewriteRedirectActionGroup" stepKey="verifyCategoryInStoreFront1"> <argument name="category" value="$$category.name$$"/> <argument name="newRequestPath" value="catalog/category/view/id/{$categoryId}"/> </actionGroup> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomProductUrlRewriteAndAddTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomProductUrlRewriteAndAddTemporaryRedirectTest.xml index 711d5389b013b..b450c8d3c759d 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomProductUrlRewriteAndAddTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomProductUrlRewriteAndAddTemporaryRedirectTest.xml @@ -23,7 +23,7 @@ </before> <after> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite"> + <actionGroup ref="AdminDeleteUrlRewriteActionGroup" stepKey="deleteCustomUrlRewrite"> <argument name="requestPath" value="{{_defaultProduct.name}}.html"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -36,7 +36,7 @@ <grabFromCurrentUrl stepKey="productId" regex="#\/([0-9]*)?\/$#"/> <!-- Open UrlRewrite Edit page and update the fields and fill the created product Target Path --> - <actionGroup ref="AdminAddCustomUrlRewrite" stepKey="addCustomUrlRewrite"> + <actionGroup ref="AdminAddCustomUrlRewriteActionGroup" stepKey="addCustomUrlRewrite"> <argument name="customUrlRewriteValue" value="Custom"/> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="{{_defaultProduct.name}}.html"/> @@ -46,28 +46,28 @@ </actionGroup> <!--Assert updated product Url Rewrite in Grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath"> <argument name="redirectPath" value="{{_defaultProduct.name}}.html" /> <argument name="redirectType" value="Temporary (302)" /> <argument name="targetPath" value="catalog/product/view/id/{$productId}"/> </actionGroup> <!-- Assert initial product Url rewrite in grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath1"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath1"> <argument name="redirectPath" value="$$createProduct.name$$.html" /> <argument name="redirectType" value="No"/> <argument name="targetPath" value="catalog/product/view/id/{$productId}"/> </actionGroup> <!-- Assert updated product redirect in Store Front--> - <actionGroup ref="AssertStorefrontProductRedirect" stepKey="verifyProductInStoreFront"> + <actionGroup ref="AssertStorefrontProductRedirectActionGroup" stepKey="verifyProductInStoreFront"> <argument name="productName" value="$$createProduct.name$$"/> <argument name="productSku" value="$$createProduct.sku$$"/> <argument name="productRequestPath" value="{{_defaultProduct.name}}.html"/> </actionGroup> <!-- Assert initial product redirect in Store Front--> - <actionGroup ref="AssertStorefrontProductRedirect" stepKey="verifyProductInStoreFront1"> + <actionGroup ref="AssertStorefrontProductRedirectActionGroup" stepKey="verifyProductInStoreFront1"> <argument name="productName" value="$$createProduct.name$$"/> <argument name="productSku" value="$$createProduct.sku$$"/> <argument name="productRequestPath" value="$$createProduct.name$$.html"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteAndAddNoRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteAndAddNoRedirectTest.xml index f8d297c92a176..2cd10d3548cfb 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteAndAddNoRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteAndAddNoRedirectTest.xml @@ -27,12 +27,12 @@ </after> <!--Filter and Select the created Product --> - <actionGroup ref="AdminSearchUrlRewriteProductBySku" stepKey="searchProduct"> + <actionGroup ref="AdminSearchUrlRewriteProductBySkuActionGroup" stepKey="searchProduct"> <argument name="productSku" value="$$createSimpleProduct.sku$$"/> </actionGroup> <!-- Update the Store, RequestPath, RedirectType and Description --> - <actionGroup ref="AdminAddUrlRewriteForProduct" stepKey="addUrlRewrite"> + <actionGroup ref="AdminAddUrlRewriteForProductActionGroup" stepKey="addUrlRewrite"> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="{{_defaultProduct.urlKey}}.html"/> <argument name="redirectTypeValue" value="No"/> @@ -46,17 +46,17 @@ <grabFromCurrentUrl stepKey="productId" regex="#\/([0-9]*)?\/$#"/> <!--Assert Product Redirect --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath"> <argument name="redirectPath" value="{{_defaultProduct.urlKey}}.html" /> <argument name="redirectType" value="No" /> <argument name="targetPath" value="catalog/product/view/id/{$productId}"/> </actionGroup> <!-- Assert Redirect path, Target Path and Redirect type in grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath1"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath1"> <argument name="redirectPath" value="$$createSimpleProduct.name$$.html" /> <argument name="redirectType" value="No" /> <argument name="targetPath" value="catalog/product/view/id/{$productId}"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteWithCategoryAndAddTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteWithCategoryAndAddTemporaryRedirectTest.xml index ae18ab33ba6ce..82473fb13a33b 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteWithCategoryAndAddTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteWithCategoryAndAddTemporaryRedirectTest.xml @@ -31,12 +31,12 @@ </after> <!--Filter and Select the created Product --> - <actionGroup ref="AdminSearchUrlRewriteProductBySku" stepKey="searchProduct"> + <actionGroup ref="AdminSearchUrlRewriteProductBySkuActionGroup" stepKey="searchProduct"> <argument name="productSku" value="$$createSimpleProduct.sku$$"/> </actionGroup> <!-- Update the Store, RequestPath, RedirectType and Description --> - <actionGroup ref="AdminAddUrlRewriteForProduct" stepKey="addUrlRewrite"> + <actionGroup ref="AdminAddUrlRewriteForProductActionGroup" stepKey="addUrlRewrite"> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="{{FirstLevelSubCat.name_lwr}}/{{_defaultProduct.urlKey}}.html"/> <argument name="redirectTypeValue" value="Temporary (302)"/> @@ -44,7 +44,7 @@ </actionGroup> <!--Assert Product Redirect --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath"> <argument name="redirectPath" value="{{FirstLevelSubCat.name_lwr}}/{{_defaultProduct.urlKey}}.html" /> <argument name="redirectType" value="Temporary (302)" /> <argument name="targetPath" value="$$createSimpleProduct.name$$.html"/> @@ -57,7 +57,7 @@ <grabFromCurrentUrl stepKey="productId" regex="#\/([0-9]*)?\/$#"/> <!-- Assert Redirect path, Target Path and Redirect type in grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath1"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath1"> <argument name="redirectPath" value="$$createSimpleProduct.name$$.html" /> <argument name="redirectType" value="No" /> <argument name="targetPath" value="catalog/product/view/id/{$productId}"/> @@ -70,10 +70,10 @@ <grabFromCurrentUrl stepKey="categoryId" regex="#\/([0-9]*)?\/$#"/> <!-- Assert Redirect path, Target Path and Redirect type in grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath2"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath2"> <argument name="redirectPath" value="$$createCategory.name$$.html" /> <argument name="redirectType" value="No" /> <argument name="targetPath" value="catalog/category/view/id/{$categoryId}"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddPermanentRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddPermanentRedirectTest.xml index 66c586d4fe891..bfecd98eaa6be 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddPermanentRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddPermanentRedirectTest.xml @@ -26,12 +26,12 @@ </after> <!--Filter and Select the created Product --> - <actionGroup ref="AdminSearchUrlRewriteProductBySku" stepKey="searchProduct"> + <actionGroup ref="AdminSearchUrlRewriteProductBySkuActionGroup" stepKey="searchProduct"> <argument name="productSku" value="$$createSimpleProduct.sku$$"/> </actionGroup> <!-- Update the Store, RequestPath, RedirectType and Description --> - <actionGroup ref="AdminAddUrlRewriteForProduct" stepKey="addUrlRewrite"> + <actionGroup ref="AdminAddUrlRewriteForProductActionGroup" stepKey="addUrlRewrite"> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="{{_defaultProduct.urlKey}}.html"/> <argument name="redirectTypeValue" value="Permanent (301)"/> @@ -46,17 +46,17 @@ <!--Assert Product Redirect --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath"> <argument name="redirectPath" value="{{_defaultProduct.urlKey}}.html" /> <argument name="redirectType" value="Permanent (301)" /> <argument name="targetPath" value="$$createSimpleProduct.name$$.html"/> </actionGroup> <!-- Assert Redirect Path, Target Path and Redirect type in grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath1"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath1"> <argument name="redirectPath" value="$$createSimpleProduct.name$$.html" /> <argument name="redirectType" value="No" /> <argument name="targetPath" value="catalog/product/view/id/{$productId}"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddTemporaryRedirectTest.xml index 2d797a12bedf5..899564287757b 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddTemporaryRedirectTest.xml @@ -27,12 +27,12 @@ </after> <!--Filter and Select the created Product --> - <actionGroup ref="AdminSearchUrlRewriteProductBySku" stepKey="searchProduct"> + <actionGroup ref="AdminSearchUrlRewriteProductBySkuActionGroup" stepKey="searchProduct"> <argument name="productSku" value="$$createSimpleProduct.sku$$"/> </actionGroup> <!-- Update the Store, RequestPath, RedirectType and Description --> - <actionGroup ref="AdminAddUrlRewriteForProduct" stepKey="addUrlRewrite"> + <actionGroup ref="AdminAddUrlRewriteForProductActionGroup" stepKey="addUrlRewrite"> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="{{_defaultProduct.urlKey}}.html"/> <argument name="redirectTypeValue" value="Temporary (302)"/> @@ -46,17 +46,17 @@ <grabFromCurrentUrl stepKey="productId" regex="#\/([0-9]*)?\/$#"/> <!--Assert Product Redirect --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath"> <argument name="redirectPath" value="{{_defaultProduct.urlKey}}.html" /> <argument name="redirectType" value="Temporary (302)" /> <argument name="targetPath" value="$$createSimpleProduct.name$$.html"/> </actionGroup> <!-- Assert Redirect Path, Target Path and Redirect type in grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath1"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath1"> <argument name="redirectPath" value="$$createSimpleProduct.name$$.html" /> <argument name="redirectType" value="No" /> <argument name="targetPath" value="catalog/product/view/id/{$productId}"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductWithSeveralWebsitesAndCheckURLRewritesTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductWithSeveralWebsitesAndCheckURLRewritesTest.xml index 4dc5c85830076..96569378404e2 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductWithSeveralWebsitesAndCheckURLRewritesTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductWithSeveralWebsitesAndCheckURLRewritesTest.xml @@ -90,7 +90,7 @@ </actionGroup> <grabFromCurrentUrl stepKey="categoryId" regex="#\/([0-9]*)?\/$#"/> <!-- Open Url Rewrite page and verify new Redirect Path, RedirectType and Target Path for the grabbed category Id --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchPath"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchPath"> <argument name="redirectPath" value="$$category.name$$.html"/> <argument name="redirectType" value="No"/> <argument name="targetPath" value="catalog/category/view/id/{$categoryId}"/> @@ -104,7 +104,7 @@ </actionGroup> <grabFromCurrentUrl stepKey="productId" regex="#\/([0-9]*)?\/$#"/> <!-- Open Url Rewrite page and verify new Redirect Path, RedirectType and Target Path for the grabbed product Id --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchPath1"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchPath1"> <argument name="redirectPath" value="$$createProduct.name$$.html"/> <argument name="redirectType" value="No"/> <argument name="targetPath" value="catalog/product/view/id/{$productId}"/> @@ -112,4 +112,4 @@ <see selector="{{AdminUrlRewriteIndexSection.storeView('1')}}" userInput="{{customStore.name}}" stepKey="seeStoreValueForProductId"/> <see selector="{{AdminUrlRewriteIndexSection.storeView('1')}}" userInput="{{storeViewData.name}}" stepKey="seeStoreViewValueForProductId"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCustomUrlRewriteTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCustomUrlRewriteTest.xml index cf45931029778..288c32102c606 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCustomUrlRewriteTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCustomUrlRewriteTest.xml @@ -27,18 +27,18 @@ </after> <!--Delete created custom url rewrite and verify AssertUrlRewriteDeletedMessage--> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteUrlRewrite"> + <actionGroup ref="AdminDeleteUrlRewriteActionGroup" stepKey="deleteUrlRewrite"> <argument name="requestPath" value="$$urlRewrite.request_path$$"/> </actionGroup> <!--Search and verify AssertUrlRewriteNotInGrid--> - <actionGroup ref="AdminSearchDeletedUrlRewrite" stepKey="searchDeletedUrlRewriteInGrid"> + <actionGroup ref="AdminSearchDeletedUrlRewriteActionGroup" stepKey="searchDeletedUrlRewriteInGrid"> <argument name="requestPath" value="$$urlRewrite.request_path$$"/> </actionGroup> <!--Verify AssertPageByUrlRewriteIsNotFound--> - <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="amOnPage"> + <actionGroup ref="AssertPageByUrlRewriteIsNotFoundActionGroup" stepKey="amOnPage"> <argument name="requestPath" value="$$urlRewrite.request_path$$"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminProductCreateUrlRewriteForCustomStoreViewTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminProductCreateUrlRewriteForCustomStoreViewTest.xml index c6ee1a7da9602..26fdd28d004f3 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminProductCreateUrlRewriteForCustomStoreViewTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminProductCreateUrlRewriteForCustomStoreViewTest.xml @@ -67,7 +67,7 @@ <actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="onCategoryPage"> <argument name="category" value="$$createCategory$$"/> </actionGroup> - <actionGroup ref="AssertStorefrontUrlRewriteRedirect" stepKey="assertUrlCategoryOnDefaultStore"> + <actionGroup ref="AssertStorefrontUrlRewriteRedirectActionGroup" stepKey="assertUrlCategoryOnDefaultStore"> <argument name="category" value="$$createCategory.name$$"/> <argument name="newRequestPath" value="u1.html"/> </actionGroup> @@ -92,7 +92,7 @@ <argument name="storeView" value="customStore"/> </actionGroup> <!--Step 9. On Storefront Assert what URL Key for Category is changed and is correct for Custom Store View --> - <actionGroup ref="AssertStorefrontUrlRewriteRedirect" stepKey="assertUrlCategoryOnCustomStore"> + <actionGroup ref="AssertStorefrontUrlRewriteRedirectActionGroup" stepKey="assertUrlCategoryOnCustomStore"> <argument name="category" value="$$createCategory.name$$"/> <argument name="newRequestPath" value="u1.html"/> </actionGroup> @@ -105,7 +105,7 @@ <argument name="productUrl" value="$$createProduct.custom_attributes[url_key]$$"/> </actionGroup> <!--Step 11. On Storefront Assert what URL Key for product is changed and is correct for Custom Store View --> - <actionGroup ref="AssertStorefrontProductRedirect" stepKey="assertProductUrlRewriteInStoreFront"> + <actionGroup ref="AssertStorefrontProductRedirectActionGroup" stepKey="assertProductUrlRewriteInStoreFront"> <argument name="productName" value="$$createProductForUrlRewrite.name$$"/> <argument name="productSku" value="$$createProductForUrlRewrite.sku$$"/> <argument name="productRequestPath" value="u2.html"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddAspxRequestPathTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddAspxRequestPathTest.xml index 072753505223d..f03fa5b647df6 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddAspxRequestPathTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddAspxRequestPathTest.xml @@ -27,12 +27,12 @@ </after> <!-- Search and Select Edit option for created category in grid --> - <actionGroup ref="AdminSearchAndSelectUrlRewriteInGrid" stepKey="editUrlRewrite"> + <actionGroup ref="AdminSearchAndSelectUrlRewriteInGridActionGroup" stepKey="editUrlRewrite"> <argument name="requestPath" value="$$category.custom_attributes[url_key]$$.html"/> </actionGroup> <!-- Open UrlRewrite Edit page and update the fields --> - <actionGroup ref="AdminUpdateUrlRewrite" stepKey="updateCategoryUrlRewrite"> + <actionGroup ref="AdminUpdateUrlRewriteActionGroup" stepKey="updateCategoryUrlRewrite"> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="{{defaultUrlRewrite.request_path}}"/> <argument name="redirectTypeValue" value="Temporary (302)"/> @@ -46,14 +46,14 @@ <grabFromCurrentUrl stepKey="categoryId" regex="#\/([0-9]*)?\/$#"/> <!--Assert category Url Rewrite in grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByNewRequestPath"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByNewRequestPath"> <argument name="redirectPath" value="{{defaultUrlRewrite.request_path}}" /> <argument name="redirectType" value="Temporary (302)" /> <argument name="targetPath" value="catalog/category/view/id/{$categoryId}"/> </actionGroup> <!-- Assert category redirect in Store Front --> - <actionGroup ref="AssertStorefrontUrlRewriteRedirect" stepKey="verifyCategoryInStoreFront"> + <actionGroup ref="AssertStorefrontUrlRewriteRedirectActionGroup" stepKey="verifyCategoryInStoreFront"> <argument name="category" value="$$category.name$$"/> <argument name="newRequestPath" value="{{defaultUrlRewrite.request_path}}"/> </actionGroup> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddNoRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddNoRedirectTest.xml index 80b9dbe41bf59..30a61b49c204d 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddNoRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddNoRedirectTest.xml @@ -27,12 +27,12 @@ </after> <!-- Search and Select Edit option for created category in grid --> - <actionGroup ref="AdminSearchAndSelectUrlRewriteInGrid" stepKey="editUrlRewrite"> + <actionGroup ref="AdminSearchAndSelectUrlRewriteInGridActionGroup" stepKey="editUrlRewrite"> <argument name="requestPath" value="$$category.custom_attributes[url_key]$$.html"/> </actionGroup> <!-- Open UrlRewrite Edit page and update the fields --> - <actionGroup ref="AdminUpdateUrlRewrite" stepKey="updateCategoryUrlRewrite"> + <actionGroup ref="AdminUpdateUrlRewriteActionGroup" stepKey="updateCategoryUrlRewrite"> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="{{defaultUrlRewrite.request_path}}"/> <argument name="redirectTypeValue" value="No"/> @@ -46,14 +46,14 @@ <grabFromCurrentUrl stepKey="categoryId" regex="#\/([0-9]*)?\/$#"/> <!-- Assert category Url Rewrite in grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByNewRequestPath"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByNewRequestPath"> <argument name="redirectPath" value="{{defaultUrlRewrite.request_path}}" /> <argument name="redirectType" value="No" /> <argument name="targetPath" value="catalog/category/view/id/{$categoryId}"/> </actionGroup> <!-- Assert Category redirect in Store Front --> - <actionGroup ref="AssertStorefrontUrlRewriteRedirect" stepKey="verifyCategoryInStoreFront"> + <actionGroup ref="AssertStorefrontUrlRewriteRedirectActionGroup" stepKey="verifyCategoryInStoreFront"> <argument name="category" value="$$category.name$$"/> <argument name="newRequestPath" value="{{defaultUrlRewrite.request_path}}"/> </actionGroup> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddPermanentRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddPermanentRedirectTest.xml index be9fd1d83c8f1..430964d1f0a17 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddPermanentRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddPermanentRedirectTest.xml @@ -27,12 +27,12 @@ </after> <!-- Search and Select Edit option for created category in grid --> - <actionGroup ref="AdminSearchAndSelectUrlRewriteInGrid" stepKey="editUrlRewrite"> + <actionGroup ref="AdminSearchAndSelectUrlRewriteInGridActionGroup" stepKey="editUrlRewrite"> <argument name="requestPath" value="$$category.custom_attributes[url_key]$$.html"/> </actionGroup> <!-- Open UrlRewrite Edit page and update the fields --> - <actionGroup ref="AdminUpdateUrlRewrite" stepKey="updateCategoryUrlRewrite"> + <actionGroup ref="AdminUpdateUrlRewriteActionGroup" stepKey="updateCategoryUrlRewrite"> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="{{defaultUrlRewrite.request_path}}"/> <argument name="redirectTypeValue" value="Permanent (301)"/> @@ -46,14 +46,14 @@ <grabFromCurrentUrl stepKey="categoryId" regex="#\/([0-9]*)?\/$#"/> <!--Assert category Url Rewrite in grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByNewRequestPath"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByNewRequestPath"> <argument name="redirectPath" value="{{defaultUrlRewrite.request_path}}" /> <argument name="redirectType" value="Permanent (301)" /> <argument name="targetPath" value="catalog/category/view/id/{$categoryId}"/> </actionGroup> <!-- Assert category redirect in Store Front --> - <actionGroup ref="AssertStorefrontUrlRewriteRedirect" stepKey="verifyCategoryInStoreFront"> + <actionGroup ref="AssertStorefrontUrlRewriteRedirectActionGroup" stepKey="verifyCategoryInStoreFront"> <argument name="category" value="$$category.name$$"/> <argument name="newRequestPath" value="{{defaultUrlRewrite.request_path}}"/> </actionGroup> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddTemporaryRedirectTest.xml index 7e1b9acbc47ab..c37bfa15df92c 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddTemporaryRedirectTest.xml @@ -27,12 +27,12 @@ </after> <!-- Search and Select Edit option for created category in grid --> - <actionGroup ref="AdminSearchAndSelectUrlRewriteInGrid" stepKey="editUrlRewrite"> + <actionGroup ref="AdminSearchAndSelectUrlRewriteInGridActionGroup" stepKey="editUrlRewrite"> <argument name="requestPath" value="$$category.custom_attributes[url_key]$$.html"/> </actionGroup> <!-- Open UrlRewrite Edit page and update the fields --> - <actionGroup ref="AdminUpdateUrlRewrite" stepKey="updateCategoryUrlRewrite"> + <actionGroup ref="AdminUpdateUrlRewriteActionGroup" stepKey="updateCategoryUrlRewrite"> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="{{updateUrlRewrite.request_path}}"/> <argument name="redirectTypeValue" value="Temporary (302)"/> @@ -46,14 +46,14 @@ <grabFromCurrentUrl stepKey="categoryId" regex="#\/([0-9]*)?\/$#"/> <!--Assert category Url Rewrite in grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByNewRequestPath"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByNewRequestPath"> <argument name="redirectPath" value="{{updateUrlRewrite.request_path}}" /> <argument name="redirectType" value="Temporary (302)" /> <argument name="targetPath" value="catalog/category/view/id/{$categoryId}"/> </actionGroup> <!-- Assert category redirect in Store Front --> - <actionGroup ref="AssertStorefrontUrlRewriteRedirect" stepKey="verifyCategoryInStoreFront"> + <actionGroup ref="AssertStorefrontUrlRewriteRedirectActionGroup" stepKey="verifyCategoryInStoreFront"> <argument name="category" value="$$category.name$$"/> <argument name="newRequestPath" value="{{updateUrlRewrite.request_path}}"/> </actionGroup> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCustomURLRewritesPermanentTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCustomURLRewritesPermanentTest.xml index 8339eb63abef1..a07f7b8c0fe60 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCustomURLRewritesPermanentTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCustomURLRewritesPermanentTest.xml @@ -23,19 +23,19 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> </before> <after> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite"> + <actionGroup ref="AdminDeleteUrlRewriteActionGroup" stepKey="deleteCustomUrlRewrite"> <argument name="requestPath" value="{{customPermanentUrlRewrite.request_path}}"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> </after> <!--Search default custom url rewrite in grid--> - <actionGroup ref="AdminSearchAndSelectUrlRewriteInGrid" stepKey="searchUrlRewrite"> + <actionGroup ref="AdminSearchAndSelectUrlRewriteInGridActionGroup" stepKey="searchUrlRewrite"> <argument name="requestPath" value="$$urlRewrite.request_path$$"/> </actionGroup> <!--Update default custom url rewrite as per requirement and verify AssertUrlRewriteSaveMessage--> - <actionGroup ref="AdminUpdateCustomUrlRewrite" stepKey="updateUrlRewrite"> + <actionGroup ref="AdminUpdateCustomUrlRewriteActionGroup" stepKey="updateUrlRewrite"> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="{{customPermanentUrlRewrite.request_path}}"/> <argument name="targetPath" value="{{customPermanentUrlRewrite.target_path}}"/> @@ -44,7 +44,7 @@ </actionGroup> <!--Search and verify updated AssertUrlRewriteInGrid--> - <actionGroup ref="AdminSearchByRequestPath" stepKey="verifyUpdatedUrlRewriteInGrid"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="verifyUpdatedUrlRewriteInGrid"> <argument name="redirectPath" value="{{customPermanentUrlRewrite.request_path}}"/> <argument name="redirectType" value="{{customPermanentUrlRewrite.redirect_type_label}}"/> <argument name="targetPath" value="{{customPermanentUrlRewrite.target_path}}"/> @@ -55,4 +55,4 @@ <waitForPageLoad stepKey="waitForPageLoad"/> <seeInCurrentUrl url="{{customPermanentUrlRewrite.target_path}}" stepKey="seeAssertUrlRewrite"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCustomURLRewritesTemporaryTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCustomURLRewritesTemporaryTest.xml index 07d578cbbeca4..73720c3fb5459 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCustomURLRewritesTemporaryTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCustomURLRewritesTemporaryTest.xml @@ -25,7 +25,7 @@ </before> <after> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite"> + <actionGroup ref="AdminDeleteUrlRewriteActionGroup" stepKey="deleteCustomUrlRewrite"> <argument name="requestPath" value="{{customTemporaryUrlRewrite.request_path}}"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -38,12 +38,12 @@ <grabFromCurrentUrl stepKey="productId" regex="#\/([0-9]*)?\/$#"/> <!--Search default custom url rewrite in grid--> - <actionGroup ref="AdminSearchAndSelectUrlRewriteInGrid" stepKey="searchUrlRewrite"> + <actionGroup ref="AdminSearchAndSelectUrlRewriteInGridActionGroup" stepKey="searchUrlRewrite"> <argument name="requestPath" value="$$urlRewrite.request_path$$"/> </actionGroup> <!--Update default custom url rewrite as per requirement and verify AssertUrlRewriteSaveMessage--> - <actionGroup ref="AdminUpdateCustomUrlRewrite" stepKey="updateUrlRewrite"> + <actionGroup ref="AdminUpdateCustomUrlRewriteActionGroup" stepKey="updateUrlRewrite"> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="{{customTemporaryUrlRewrite.request_path}}"/> <argument name="targetPath" value="catalog/product/view/id/{$productId}"/> @@ -52,17 +52,17 @@ </actionGroup> <!--Search and verify AssertUrlRewriteInGrid--> - <actionGroup ref="AdminSearchByRequestPath" stepKey="verifyUpdatedUrlRewriteInGrid"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="verifyUpdatedUrlRewriteInGrid"> <argument name="redirectPath" value="{{customTemporaryUrlRewrite.request_path}}"/> <argument name="redirectType" value="{{customTemporaryUrlRewrite.redirect_type_label}}"/> <argument name="targetPath" value="catalog/product/view/id/{$productId}"/> </actionGroup> <!-- AssertUrlRewriteCustomSearchRedirect--> - <actionGroup ref="AssertStorefrontProductRedirect" stepKey="verifyProductInStoreFrontPage"> + <actionGroup ref="AssertStorefrontProductRedirectActionGroup" stepKey="verifyProductInStoreFrontPage"> <argument name="productName" value="$$createProduct.name$$"/> <argument name="productSku" value="$$createProduct.sku$$"/> <argument name="productRequestPath" value="$$createProduct.name$$.html"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateProductUrlRewriteAndAddTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateProductUrlRewriteAndAddTemporaryRedirectTest.xml index ea370d8419583..74f3a60f35cea 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateProductUrlRewriteAndAddTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateProductUrlRewriteAndAddTemporaryRedirectTest.xml @@ -27,12 +27,12 @@ </after> <!-- Search and Select Edit option for created product in grid --> - <actionGroup ref="AdminSearchAndSelectUrlRewriteInGrid" stepKey="editUrlRewrite"> + <actionGroup ref="AdminSearchAndSelectUrlRewriteInGridActionGroup" stepKey="editUrlRewrite"> <argument name="requestPath" value="$$createProduct.name$$"/> </actionGroup> <!-- Open UrlRewrite Edit page and update the fields --> - <actionGroup ref="AdminUpdateUrlRewrite" stepKey="updateCategoryUrlRewrite"> + <actionGroup ref="AdminUpdateUrlRewriteActionGroup" stepKey="updateCategoryUrlRewrite"> <argument name="storeValue" value="{{updateUrlRewrite.store}}"/> <argument name="requestPath" value="{{updateUrlRewrite.request_path}}"/> <argument name="redirectTypeValue" value="{{updateUrlRewrite.redirect_type_label}}"/> @@ -40,7 +40,7 @@ </actionGroup> <!-- Assert product Url Rewrite in StoreFront --> - <actionGroup ref="AssertStorefrontProductRedirect" stepKey="assertProductUrlRewriteInStoreFront"> + <actionGroup ref="AssertStorefrontProductRedirectActionGroup" stepKey="assertProductUrlRewriteInStoreFront"> <argument name="productName" value="$$createProduct.name$$"/> <argument name="productSku" value="$$createProduct.sku$$"/> <argument name="productRequestPath" value="{{updateUrlRewrite.request_path}}"/> From c6e7d1dd94d8ebba5e6a4110427a6e738ce41dec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 14:29:16 +0100 Subject: [PATCH 117/586] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- ...tualProductOutOfStockWithTierPriceTest.xml | 2 +- ...CustomOptionsSuiteAndImportOptionsTest.xml | 2 +- ...dPageNumberAfterSaveAndCloseActionTest.xml | 4 +- ...CustomizableOptionToProductWithSKUTest.xml | 2 +- ...ductGridFilteringByCustomAttributeTest.xml | 2 +- ...ctImageAssignmentForMultipleStoresTest.xml | 2 +- ...dminRemoveCustomOptionsFromProductTest.xml | 2 +- ...ToAssociateSimpleProductToWebsitesTest.xml | 2 +- ...chorIsVisibleOnViewportOnceClickedTest.xml | 4 +- ...ctCustomOptionsDifferentStoreViewsTest.xml | 4 +- ...ctWithCustomOptionsWithLongValuesTitle.xml | 2 +- .../Test/AdminDeleteCatalogPriceRuleTest.xml | 4 +- .../Mftf/Test/SearchEntityResultsTest.xml | 2 +- .../Mftf/Test/StorefrontGuestCheckoutTest.xml | 2 +- ...CheckResultsOfColorAndOtherFiltersTest.xml | 4 +- .../AdminConfigurableProductUpdateTest.xml | 2 +- ...reateConfigurableProductWithImagesTest.xml | 2 +- ...orefrontConfigurableProductDetailsTest.xml | 10 ++-- .../AdminCreateRetailCustomerGroupTest.xml | 2 +- .../AdminCreateTaxClassCustomerGroupTest.xml | 2 +- ...dminExactMatchSearchInCustomerGridTest.xml | 2 +- .../Mftf/Test/ChangeCustomerGroupTest.xml | 2 +- .../Test/SearchByEmailInCustomerGridTest.xml | 2 +- .../Test/AdminCreatingShippingLabelTest.xml | 2 +- .../AdminCheckDoubleImportOfProductsTest.xml | 4 +- ...lityDifferentStoreViewsAfterImportTest.xml | 4 +- ...utWhenCartPageIsOpenedInAnotherTabTest.xml | 4 +- .../Test/Mftf/Test/AdminCreateInvoiceTest.xml | 2 +- .../Test/AdminReorderWithCatalogPriceTest.xml | 4 +- .../CreateOrderFromEditCustomerPageTest.xml | 2 +- .../Test/Mftf/Test/EndToEndB2CAdminTest.xml | 20 +++---- ...inCartRulesAppliedForProductInCartTest.xml | 4 +- ...ductWithInvisibleIndividualProductTest.xml | 2 +- ...tImageColorWhenFilterByColorFilterTest.xml | 4 +- ...oductImagesMatchingProductSwatchesTest.xml | 4 +- ...DataGridDeleteCustomPerPageActionGroup.xml | 27 +++++++++ .../AdminDataGridFilterActionGroup.xml | 44 -------------- .../AdminDataGridPaginationActionGroup.xml | 57 ------------------- ...DataGridSelectCustomPerPageActionGroup.xml | 27 +++++++++ .../AdminDataGridSelectPerPageActionGroup.xml | 23 ++++++++ .../ClearFiltersAdminDataGridActionGroup.xml | 18 ++++++ ...tAdminDataGridToDefaultViewActionGroup.xml | 20 +++++++ ...earchAdminDataGridByKeywordActionGroup.xml | 23 ++++++++ ...tipleStoreviewsDuringProductImportTest.xml | 8 +-- ...AddMultipleStoreProductsToWishlistTest.xml | 4 +- 45 files changed, 204 insertions(+), 167 deletions(-) create mode 100644 app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridDeleteCustomPerPageActionGroup.xml delete mode 100644 app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridFilterActionGroup.xml delete mode 100644 app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridPaginationActionGroup.xml create mode 100644 app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridSelectCustomPerPageActionGroup.xml create mode 100644 app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridSelectPerPageActionGroup.xml create mode 100644 app/code/Magento/Ui/Test/Mftf/ActionGroup/ClearFiltersAdminDataGridActionGroup.xml create mode 100644 app/code/Magento/Ui/Test/Mftf/ActionGroup/ResetAdminDataGridToDefaultViewActionGroup.xml create mode 100644 app/code/Magento/Ui/Test/Mftf/ActionGroup/SearchAdminDataGridByKeywordActionGroup.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductOutOfStockWithTierPriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductOutOfStockWithTierPriceTest.xml index 0b929eaddc96e..42cd489e3dcff 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductOutOfStockWithTierPriceTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductOutOfStockWithTierPriceTest.xml @@ -27,7 +27,7 @@ <actionGroup ref="deleteProductBySku" stepKey="deleteVirtualProduct"> <argument name="sku" value="{{virtualProductOutOfStock.sku}}"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFilter"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/> <actionGroup ref="logout" stepKey="logout"/> </after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml index 23f772a395a7d..9aa7f451e9091 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml @@ -27,7 +27,7 @@ <actionGroup ref="deleteProductBySku" stepKey="deleteVirtualProduct"> <argument name="sku" value="{{virtualProductCustomImportOptions.sku}}"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="resetOrderFilter"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="resetOrderFilter"/> <actionGroup ref="logout" stepKey="logout"/> </after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminGridPageNumberAfterSaveAndCloseActionTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminGridPageNumberAfterSaveAndCloseActionTest.xml index eb4a561760070..991c70bb292a4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminGridPageNumberAfterSaveAndCloseActionTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminGridPageNumberAfterSaveAndCloseActionTest.xml @@ -40,7 +40,7 @@ <amOnPage url="{{ProductCatalogPage.url}}" stepKey="goToProductCatalog"/> <waitForPageLoad stepKey="waitForProductIndexPage"/> <click selector="{{AdminDataGridPaginationSection.previousPage}}" stepKey="clickPrevPageOrderGrid"/> - <actionGroup ref="adminDataGridDeleteCustomPerPage" stepKey="deleteCustomAddedPerPage"> + <actionGroup ref="AdminDataGridDeleteCustomPerPageActionGroup" stepKey="deleteCustomAddedPerPage"> <argument name="perPage" value="ProductPerPage.productCount"/> </actionGroup> <deleteData stepKey="deleteCategory1" createDataKey="category1"/> @@ -51,7 +51,7 @@ </after> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="goToProductCatalog"/> <waitForPageLoad stepKey="waitForProductIndexPage"/> - <actionGroup ref="adminDataGridSelectCustomPerPage" stepKey="select1OrderPerPage"> + <actionGroup ref="AdminDataGridSelectCustomPerPageActionGroup" stepKey="select1OrderPerPage"> <argument name="perPage" value="ProductPerPage.productCount"/> </actionGroup> <!--Go to the next page and edit the product--> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml index dfadfdf00481b..a941654db20a8 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml @@ -45,7 +45,7 @@ <actionGroup ref="deleteProductBySku" stepKey="deleteSecondProduct"> <argument name="sku" value="$$createFirstProduct.sku$$-1"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductGridFilter"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductGridFilter"/> <actionGroup ref="logout" stepKey="logoutOfAdmin"/> </after> <!--Change second product sku to first product sku--> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByCustomAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByCustomAttributeTest.xml index 72c270aad585c..a1548d870309e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByCustomAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByCustomAttributeTest.xml @@ -93,7 +93,7 @@ </after> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductGridFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductGridFilters"/> <!--Sort by custom attribute DESC using grabbed value--> <conditionalClick selector="{{AdminProductGridSection.columnHeader($$createDropdownAttribute.attribute[frontend_labels][0][label]$$)}}" dependentSelector="{{AdminProductGridSection.columnHeader($$createDropdownAttribute.attribute[frontend_labels][0][label]$$)}}" visible="true" stepKey="ascendSortByCustomAttribute"/> <waitForPageLoad stepKey="waitForProductGridLoad"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductImageAssignmentForMultipleStoresTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductImageAssignmentForMultipleStoresTest.xml index 8149bc34087fb..37bc5d5f222ae 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductImageAssignmentForMultipleStoresTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductImageAssignmentForMultipleStoresTest.xml @@ -50,7 +50,7 @@ <argument name="customStore" value="customStoreFR"/> </actionGroup> <!-- Clear Filter Store --> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="resetFiltersOnStorePage"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="resetFiltersOnStorePage"/> <!-- Delete Category and Simple Product --> <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveCustomOptionsFromProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveCustomOptionsFromProductTest.xml index b5f212d1144be..e8eb5915572a0 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveCustomOptionsFromProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveCustomOptionsFromProductTest.xml @@ -27,7 +27,7 @@ <after> <deleteData createDataKey="createProduct" stepKey="deleteProductWithOptions"/> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductFilter"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductFilter"/> <actionGroup ref="logout" stepKey="logout"/> </after> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminShouldBeAbleToAssociateSimpleProductToWebsitesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminShouldBeAbleToAssociateSimpleProductToWebsitesTest.xml index 061c30b224828..b0b94461e6405 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminShouldBeAbleToAssociateSimpleProductToWebsitesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminShouldBeAbleToAssociateSimpleProductToWebsitesTest.xml @@ -43,7 +43,7 @@ </actionGroup> <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="resetFiltersOnStoresIndexPage"/> <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPageToResetFilters"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFiltersOnProductIndexPage"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFiltersOnProductIndexPage"/> <actionGroup ref="logout" stepKey="logout"/> </after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontEnsureThatAccordionAnchorIsVisibleOnViewportOnceClickedTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontEnsureThatAccordionAnchorIsVisibleOnViewportOnceClickedTest.xml index 0f9f542a97d02..6ee5adb58a18d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontEnsureThatAccordionAnchorIsVisibleOnViewportOnceClickedTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontEnsureThatAccordionAnchorIsVisibleOnViewportOnceClickedTest.xml @@ -102,7 +102,7 @@ <!-- Go to Pending reviews page and clear filters --> <actionGroup ref="AdminOpenPendingReviewsPageActionGroup" stepKey="openReviewsPage"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilters"/> <!-- Moderate first product reviews: change review status from pending to approved, save --> <actionGroup ref="AdminOpenReviewByUserNicknameActionGroup" stepKey="openFirstCustomerReviews"/> @@ -110,7 +110,7 @@ <actionGroup ref="AdminSaveReviewActionGroup" stepKey="saveModeratedFirstReview"/> <!-- Moderate second product reviews: change review status from pending to approved, save --> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFilter"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/> <actionGroup ref="AdminOpenReviewByUserNicknameActionGroup" stepKey="openSecondCustomerReviews"/> <actionGroup ref="AdminChangeReviewStatusActionGroup" stepKey="changeSecondReviewStatus"/> <actionGroup ref="AdminSaveReviewActionGroup" stepKey="saveModeratedSecondReview"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml index a0670bdee54c7..e3dfd5a14bc55 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml @@ -63,12 +63,12 @@ <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView2"> <argument name="customStore" value="customStoreFR"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearWebsitesGridFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearWebsitesGridFilters"/> <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearOrdersGridFilter"/> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductsGridFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> <actionGroup ref="logout" stepKey="logout"/> <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogoutStorefront"/> </after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsWithLongValuesTitle.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsWithLongValuesTitle.xml index e9e23cf157a26..7a667ce9667d4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsWithLongValuesTitle.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsWithLongValuesTitle.xml @@ -100,7 +100,7 @@ <amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage"/> <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappearOnOrdersPage"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearGridFilter"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearGridFilter"/> <fillField selector="{{AdminOrdersGridSection.search}}" userInput="{$grabOrderNumber}" stepKey="fillOrderNum"/> <click selector="{{AdminOrdersGridSection.submitSearch}}" stepKey="submitSearchOrderNum"/> <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappearOnSearch"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml index 16fbca2697702..ccc3296b7bcc3 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml @@ -39,10 +39,10 @@ <actionGroup ref="deleteProductBySku" stepKey="deleteConfigurableProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductsGridFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> <amOnPage url="{{AdminCatalogPriceRuleGridPage.url}}" stepKey="goToCatalogRuleGridPage"/> <waitForPageLoad stepKey="waitForCatalogRuleGridPageLoaded"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearCatalogRuleGridFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearCatalogRuleGridFilters"/> <actionGroup ref="logout" stepKey="amOnLogoutPage"/> </after> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml index 3b60e4b09de28..9426e746ca0fa 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml @@ -380,7 +380,7 @@ <actionGroup ref="deleteProductBySku" stepKey="deleteProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductsGridFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> <actionGroup ref="logout" stepKey="logoutFromAdmin"/> </after> <amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToFrontPage"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutTest.xml index a0914cfc27138..a2007da317c00 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutTest.xml @@ -61,7 +61,7 @@ <amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage"/> <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappearOnOrdersPage"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearGridFilter"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearGridFilter"/> <fillField selector="{{AdminOrdersGridSection.search}}" userInput="{$grabOrderNumber}" stepKey="fillOrderNum"/> <click selector="{{AdminOrdersGridSection.submitSearch}}" stepKey="submitSearchOrderNum"/> <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappearOnSearch"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml index de0cca11235ea..1c5fcc5130611 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml @@ -89,7 +89,7 @@ <actionGroup ref="deleteAttributeSetByLabel" stepKey="deleteAttributeSet"> <argument name="label" value="mySet"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearAttributeSetsFilter"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearAttributeSetsFilter"/> <!-- Delete First attribute --> <actionGroup ref="OpenProductAttributeFromSearchResultInGridActionGroup" stepKey="openProductAttributeFromSearchResultInGrid"> <argument name="productAttributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> @@ -105,7 +105,7 @@ <argument name="productAttributeCode" value="$$createConfigProductAttribute2.attribute_code$$"/> </actionGroup> <!-- Clear filters --> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductAttributesFilter"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductAttributesFilter"/> <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearProductsGridFilter"/> <!-- Log out --> <actionGroup ref="logout" stepKey="logout"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest.xml index 7c6cd57097591..bad1f0dd32391 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest.xml @@ -40,7 +40,7 @@ <deleteData createDataKey="createProduct3" stepKey="deleteThirdProduct"/> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductList"/> <waitForPageLoad stepKey="waitForPageLoad"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductsGridFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> <actionGroup ref="logout" stepKey="logout"/> </after> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml index 9796c14f5519a..9133b61a777b0 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml @@ -84,7 +84,7 @@ <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" time="30" stepKey="waitForConfigurationModalOpen" after="clickCreateConfigurations"/> <!-- Show 100 attributes per page --> - <actionGroup ref="adminDataGridSelectPerPage" stepKey="selectNumberOfAttributesPerPage"> + <actionGroup ref="AdminDataGridSelectPerPageActionGroup" stepKey="selectNumberOfAttributesPerPage"> <argument name="perPage" value="100"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest.xml index 2f5ee036b1420..4ec46d4803793 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest.xml @@ -34,7 +34,7 @@ <actionGroup ref="deleteProductBySku" stepKey="deleteProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductsGridFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> <actionGroup ref="logout" stepKey="adminLogout"/> </after> @@ -79,7 +79,7 @@ <actionGroup ref="deleteProductBySku" stepKey="deleteProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductsGridFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> <actionGroup ref="logout" stepKey="adminLogout"/> </after> @@ -124,7 +124,7 @@ <actionGroup ref="deleteProductBySku" stepKey="deleteProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductsGridFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> <actionGroup ref="logout" stepKey="adminLogout"/> </after> @@ -166,7 +166,7 @@ <actionGroup ref="deleteProductBySku" stepKey="deleteProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductsGridFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> <actionGroup ref="logout" stepKey="adminLogout"/> </after> @@ -218,7 +218,7 @@ </actionGroup> <deleteData createDataKey="createFirstAttribute" stepKey="deleteFirstAttribute"/> <deleteData createDataKey="createSecondAttribute" stepKey="deleteSecondAttribute"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductsGridFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> <actionGroup ref="logout" stepKey="adminLogout"/> </after> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateRetailCustomerGroupTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateRetailCustomerGroupTest.xml index 4f1d88ffe99f5..6e08d98a53c56 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateRetailCustomerGroupTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateRetailCustomerGroupTest.xml @@ -26,7 +26,7 @@ <actionGroup ref="AdminDeleteCustomerGroupActionGroup" stepKey="deleteCustomerGroup"> <argument name="customerGroupName" value="{{CustomCustomerGroup.code}}"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilters"/> <actionGroup ref="logout" stepKey="logout"/> </after> <!-- Steps: 1. Log in to backend as admin user. diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateTaxClassCustomerGroupTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateTaxClassCustomerGroupTest.xml index 7d54ede7c1612..4b539ec350435 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateTaxClassCustomerGroupTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateTaxClassCustomerGroupTest.xml @@ -31,7 +31,7 @@ <actionGroup ref="AdminDeleteCustomerGroupActionGroup" stepKey="deleteCustomerGroup"> <argument name="customerGroupName" value="{{CustomCustomerGroup.code}}"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilters"/> <deleteData createDataKey="createCustomerTaxClass" stepKey="deleteCustomerTaxClass"/> <actionGroup ref="logout" stepKey="logout"/> </after> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminExactMatchSearchInCustomerGridTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminExactMatchSearchInCustomerGridTest.xml index 6a7aeab78bcde..d278b6c52d330 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminExactMatchSearchInCustomerGridTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminExactMatchSearchInCustomerGridTest.xml @@ -35,7 +35,7 @@ <!--Step 1: Go to Customers > All Customers--> <amOnPage url="{{AdminCustomerPage.url}}" stepKey="openCustomersGridPage"/> <!--Step 2: On Customers grid page search customer by keyword with quotes--> - <actionGroup ref="searchAdminDataGridByKeyword" stepKey="searchCustomer"> + <actionGroup ref="SearchAdminDataGridByKeywordActionGroup" stepKey="searchCustomer"> <argument name="keyword" value="$$createSecondCustomer.firstname$$"/> </actionGroup> <!--Step 3: Check if customer is placed in a first row and clear grid filter--> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/ChangeCustomerGroupTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/ChangeCustomerGroupTest.xml index e35a1ad61dc7c..d9b71e1e6e9ba 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/ChangeCustomerGroupTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/ChangeCustomerGroupTest.xml @@ -73,7 +73,7 @@ </annotations> <remove keyForRemoval="filterCustomer"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFilters" before="selectCustomer"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilters" before="selectCustomer"/> <actionGroup ref="AdminSelectAllCustomers" stepKey="selectCustomer"/> </test> </tests> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/SearchByEmailInCustomerGridTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/SearchByEmailInCustomerGridTest.xml index e16ec92e507e6..5cce64495bbd2 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/SearchByEmailInCustomerGridTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/SearchByEmailInCustomerGridTest.xml @@ -33,7 +33,7 @@ <!--Step 1: Go to Customers > All Customers--> <amOnPage url="{{AdminCustomerPage.url}}" stepKey="openCustomersGridPage"/> <!--Step 2: On Customers grid page search customer by keyword--> - <actionGroup ref="searchAdminDataGridByKeyword" stepKey="searchCustomer"> + <actionGroup ref="SearchAdminDataGridByKeywordActionGroup" stepKey="searchCustomer"> <argument name="keyword" value="$$createSecondCustomer.email$$"/> </actionGroup> <!--Step 3: Check if customer is placed in a first row and clear grid filter--> diff --git a/app/code/Magento/Fedex/Test/Mftf/Test/AdminCreatingShippingLabelTest.xml b/app/code/Magento/Fedex/Test/Mftf/Test/AdminCreatingShippingLabelTest.xml index 91a76383babd4..acecb62a2811d 100644 --- a/app/code/Magento/Fedex/Test/Mftf/Test/AdminCreatingShippingLabelTest.xml +++ b/app/code/Magento/Fedex/Test/Mftf/Test/AdminCreatingShippingLabelTest.xml @@ -104,7 +104,7 @@ <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/> <!--Open created order in admin--> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage"/> - <actionGroup ref="searchAdminDataGridByKeyword" stepKey="searchOrder"> + <actionGroup ref="SearchAdminDataGridByKeywordActionGroup" stepKey="searchOrder"> <argument name="keyword" value="$grabOrderNumber"/> </actionGroup> <click selector="{{AdminOrdersGridSection.firstRow}}" stepKey="clickOrderRow"/> diff --git a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminCheckDoubleImportOfProductsTest.xml b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminCheckDoubleImportOfProductsTest.xml index 909c6101fe53e..9a6e045cbcf1e 100644 --- a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminCheckDoubleImportOfProductsTest.xml +++ b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminCheckDoubleImportOfProductsTest.xml @@ -33,8 +33,8 @@ <after> <!-- Delete all imported products --> <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPage"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearGridFilter"/> - <actionGroup ref="adminDataGridSelectPerPage" stepKey="selectNumberOfProductsPerPage"> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearGridFilter"/> + <actionGroup ref="AdminDataGridSelectPerPageActionGroup" stepKey="selectNumberOfProductsPerPage"> <argument name="perPage" value="100"/> </actionGroup> <actionGroup ref="deleteProductsIfTheyExist" stepKey="deleteAllProducts"/> diff --git a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminProductVisibilityDifferentStoreViewsAfterImportTest.xml b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminProductVisibilityDifferentStoreViewsAfterImportTest.xml index 0a1423ece71e0..139bf0fdcf58a 100644 --- a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminProductVisibilityDifferentStoreViewsAfterImportTest.xml +++ b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminProductVisibilityDifferentStoreViewsAfterImportTest.xml @@ -34,8 +34,8 @@ <after> <!--Delete all imported products--> <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPage"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearGridFilter"/> - <actionGroup ref="adminDataGridSelectPerPage" stepKey="selectNumberOfProductsPerPage"> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearGridFilter"/> + <actionGroup ref="AdminDataGridSelectPerPageActionGroup" stepKey="selectNumberOfProductsPerPage"> <argument name="perPage" value="100"/> </actionGroup> <actionGroup ref="deleteProductsIfTheyExist" stepKey="deleteAllProducts"/> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontProcessMultishippingCheckoutWhenCartPageIsOpenedInAnotherTabTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontProcessMultishippingCheckoutWhenCartPageIsOpenedInAnotherTabTest.xml index fd79d4d954cd4..7bd16809d3805 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontProcessMultishippingCheckoutWhenCartPageIsOpenedInAnotherTabTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontProcessMultishippingCheckoutWhenCartPageIsOpenedInAnotherTabTest.xml @@ -105,11 +105,11 @@ <waitForPageLoad stepKey="waitForOrderPageLoad"/> <!-- Go to Admin > Sales > Orders --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage"/> - <actionGroup ref="searchAdminDataGridByKeyword" stepKey="searchFirstOrder"> + <actionGroup ref="SearchAdminDataGridByKeywordActionGroup" stepKey="searchFirstOrder"> <argument name="keyword" value="$grabFirstOrderId"/> </actionGroup> <seeElement selector="{{AdminOrdersGridSection.orderId({$grabFirstOrderId})}}" stepKey="seeAdminFirstOrder"/> - <actionGroup ref="searchAdminDataGridByKeyword" stepKey="searchSecondOrder"> + <actionGroup ref="SearchAdminDataGridByKeywordActionGroup" stepKey="searchSecondOrder"> <argument name="keyword" value="$grabSecondOrderId"/> </actionGroup> <seeElement selector="{{AdminOrdersGridSection.orderId({$grabSecondOrderId})}}" stepKey="seeAdminSecondOrder"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoiceTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoiceTest.xml index a90fe5c49f032..3ebc4240ac527 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoiceTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoiceTest.xml @@ -63,7 +63,7 @@ <amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage"/> <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask3"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearGridFilter"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearGridFilter"/> <fillField selector="{{AdminOrdersGridSection.search}}" userInput="{$grabOrderNumber}" stepKey="searchOrderNum"/> <click selector="{{AdminOrdersGridSection.submitSearch}}" stepKey="submitSearch"/> <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask4"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml index 587b23e857c0c..efd7bae2c480a 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml @@ -48,9 +48,9 @@ <argument name="ruleName" value="{{CatalogRuleToPercent.name}}" /> </actionGroup> <!--Clear all filters in grid--> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="resetCatalogRuleGridFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="resetCatalogRuleGridFilters"/> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearGridFilter"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearGridFilter"/> <actionGroup ref="logout" stepKey="logout"/> </after> <!-- Login as admin --> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml index 9da5afffb48e5..22cca8248158e 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml @@ -88,7 +88,7 @@ <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteProductAttribute"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <amOnPage url="{{AdminCustomerPage.url}}" stepKey="openCustomerIndexPage"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearCustomerGridFilter"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearCustomerGridFilter"/> <actionGroup ref="logout" stepKey="logout"/> </after> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/EndToEndB2CAdminTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/EndToEndB2CAdminTest.xml index 0fdd8d8c35b32..2158755dbb307 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/EndToEndB2CAdminTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/EndToEndB2CAdminTest.xml @@ -168,10 +168,10 @@ <!--Search order grid by name--> <comment userInput="Admin searches order grid by name" stepKey="searchOrderGridComment" after="waitForOrderGridPageLoad"/> - <actionGroup ref="resetAdminDataGridToDefaultView" stepKey="setOrderGridToDefaultViewForSearch" after="searchOrderGridComment"/> + <actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="setOrderGridToDefaultViewForSearch" after="searchOrderGridComment"/> <!--@TODO use "Ship-to Name" when MQE-794 is fixed--> <see selector="{{AdminDataGridTableSection.column('Ship')}}" userInput="{{Simple_US_Customer.fullname}}" stepKey="seeNonFilterNameInShipNameColumn" after="setOrderGridToDefaultViewForSearch"/> - <actionGroup ref="searchAdminDataGridByKeyword" stepKey="searchOrderGridByNameKeyword" after="seeNonFilterNameInShipNameColumn"> + <actionGroup ref="SearchAdminDataGridByKeywordActionGroup" stepKey="searchOrderGridByNameKeyword" after="seeNonFilterNameInShipNameColumn"> <argument name="keyword" value="BillingAddressTX.fullname"/> </actionGroup> <dontSee selector="{{AdminDataGridTableSection.column('Ship')}}" userInput="{{Simple_US_Customer.fullname}}" stepKey="dontSeeNonFilterNameInShipNameColumn" after="searchOrderGridByNameKeyword"/> @@ -180,7 +180,7 @@ <!--Filter order grid--> <comment userInput="Admin filters order grid by 'Bill-to Name'" stepKey="filterOrderGridByNameComment" after="seeFilterNameInShipNameColumn"/> <!--Filter order grid by "Bill-to Name"--> - <actionGroup ref="resetAdminDataGridToDefaultView" stepKey="resetOrderGridForNameFilter" after="filterOrderGridByNameComment"/> + <actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="resetOrderGridForNameFilter" after="filterOrderGridByNameComment"/> <!--@TODO use "Bill-to Name" when MQE-794 is fixed--> <see selector="{{AdminDataGridTableSection.column('Bill')}}" userInput="{{BillingAddressTX.fullname}}" stepKey="seeNonFilterNameInColumn" after="resetOrderGridForNameFilter"/> <actionGroup ref="filterOrderGridByBillingName" stepKey="filterOrderGridByBillingName" after="seeNonFilterNameInColumn"> @@ -190,7 +190,7 @@ <see selector="{{AdminDataGridTableSection.column('Bill')}}" userInput="{{Simple_US_Customer.fullname}}" stepKey="seeFilterNameInColumn" after="dontSeeNonFilterNameInColumn"/> <!--Filter order grid by Grand Total (Base)--> <comment userInput="Admin filters order grid by 'Grand Total'" stepKey="filterOrderGridByTotalComment" after="seeFilterNameInColumn"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFilterBeforeTotalFilter" after="filterOrderGridByTotalComment"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilterBeforeTotalFilter" after="filterOrderGridByTotalComment"/> <see selector="{{AdminDataGridTableSection.column('Grand Total')}}" userInput="{{AdminOrderSimpleProduct.grandTotal}}" stepKey="seeLowerTotalInGrid" after="clearFilterBeforeTotalFilter"/> <actionGroup ref="filterOrderGridByBaseTotalRange" stepKey="filterOrderGridByTotal" after="seeLowerTotalInGrid"> <argument name="from" value="OrderGrandTotalFilterRange.from"/> @@ -200,7 +200,7 @@ <see selector="{{AdminDataGridTableSection.column('Grand Total')}}" userInput="{{AdminOrderSimpleConfigurableProduct.grandTotal}}" stepKey="seeExpectedTotalInGrid" after="dontSeeLowerTotalInGrid"/> <!--Filter order grid by purchase date--> <comment userInput="Admin filters order grid by 'Purchase Date'" stepKey="filterOrderGridByDateComment" after="seeExpectedTotalInGrid"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFilterBeforeOrderDateFilter" after="filterOrderGridByDateComment"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilterBeforeOrderDateFilter" after="filterOrderGridByDateComment"/> <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openOrderFilterForOrderDateFrom" after="clearFilterBeforeOrderDateFilter"/> <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('created_at[from]')}}" userInput="01/01/2018" stepKey="fillOrderDateFromFilter" after="openOrderFilterForOrderDateFrom"/> <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="applyFilterOrderDateFrom" after="fillOrderDateFromFilter"/> @@ -216,7 +216,7 @@ <dontSee selector="{{AdminDataGridTableSection.column('Bill')}}" userInput="{{BillingAddressTX.fullname}}" stepKey="dontSeeSecondOrderInGrid" after="dontSeeFirstOrderInGrid"/> <!--Filter order grid by status--> <comment userInput="Admin filters order grid by 'Status'" stepKey="filterOrderGridByStatusComment" after="dontSeeSecondOrderInGrid"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFilterBeforeStatusFilter" after="filterOrderGridByStatusComment"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilterBeforeStatusFilter" after="filterOrderGridByStatusComment"/> <actionGroup ref="filterOrderGridByStatus" stepKey="filterOrderGridByPendingStatus" after="clearFilterBeforeStatusFilter"> <argument name="status" value="OrderStatus.pending"/> </actionGroup> @@ -229,7 +229,7 @@ <dontSee selector="{{AdminDataGridTableSection.column('Status')}}" userInput="{{OrderStatus.pending}}" stepKey="dontSeePendingStatusInOrderGrid" after="seeClosedStatusInOrderGrid"/> <!--Sort order grid--> - <actionGroup ref="resetAdminDataGridToDefaultView" stepKey="resetOrderGridForSorting" after="dontSeePendingStatusInOrderGrid"/> + <actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="resetOrderGridForSorting" after="dontSeePendingStatusInOrderGrid"/> <!--Sort order grid by status--> <comment userInput="Admin sorts order grid by status" stepKey="sortOrderGridByStatusComment" after="resetOrderGridForSorting"/> <click selector="{{AdminDataGridTableSection.columnHeader('Status')}}" stepKey="clickStatusToSortAsc" after="sortOrderGridByStatusComment"/> @@ -239,9 +239,9 @@ <!--@TODO improve sort assertion and check price and date column when MQE-690 is resolved--> <!--Use paging on order grid--> - <actionGroup ref="resetAdminDataGridToDefaultView" stepKey="resetAdminGridBeforePaging" after="checkStatusSortOrderAsc"/> + <actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="resetAdminGridBeforePaging" after="checkStatusSortOrderAsc"/> <comment userInput="Admin uses paging on order grid" stepKey="usePagingOrderGridComment" after="resetAdminGridBeforePaging"/> - <actionGroup ref="adminDataGridSelectCustomPerPage" stepKey="select1OrderPerPage" after="usePagingOrderGridComment"> + <actionGroup ref="AdminDataGridSelectCustomPerPageActionGroup" stepKey="select1OrderPerPage" after="usePagingOrderGridComment"> <!--@TODO Change this to scalar when MQE-498 is implemented--> <argument name="perPage" value="Const.one"/> </actionGroup> @@ -250,7 +250,7 @@ <click selector="{{AdminDataGridPaginationSection.nextPage}}" stepKey="clickNextPageOrderGrid" after="seeOnFirstPageOrderGrid"/> <seeInField selector="{{AdminDataGridPaginationSection.currentPage}}" userInput="2" stepKey="seeOnSecondPageOrderGrid" after="clickNextPageOrderGrid"/> <seeNumberOfElements selector="{{AdminDataGridTableSection.rows}}" userInput="1" stepKey="see1RowOnSecondPage" after="seeOnSecondPageOrderGrid"/> - <actionGroup ref="adminDataGridSelectPerPage" stepKey="select50OrdersPerPage" after="see1RowOnSecondPage"> + <actionGroup ref="AdminDataGridSelectPerPageActionGroup" stepKey="select50OrdersPerPage" after="see1RowOnSecondPage"> <!--@TODO Change this to scalar when MQE-498 is implemented--> <argument name="perPage" value="Const.fifty"/> </actionGroup> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml index ab085dc5ae137..854ce67eef81a 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml @@ -39,12 +39,12 @@ <actionGroup ref="deleteProductBySku" stepKey="deleteBundleProduct"> <argument name="sku" value="{{BundleProduct.sku}}"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilters"/> <actionGroup ref="DeleteCartPriceRuleByName" stepKey="deleteCartPriceRule"> <argument name="ruleName" value="{{PriceRuleWithCondition.name}}"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFilters1"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilters1"/> <actionGroup ref="logout" stepKey="logout"/> </after> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToGroupedProductWithInvisibleIndividualProductTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToGroupedProductWithInvisibleIndividualProductTest.xml index 8900d838fb825..b90c8d5da0958 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToGroupedProductWithInvisibleIndividualProductTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToGroupedProductWithInvisibleIndividualProductTest.xml @@ -76,7 +76,7 @@ <actionGroup ref="AdminDeleteCartPriceRuleActionGroup" stepKey="deleteCartPriceRule"> <argument name="ruleName" value="TestSalesRule"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearGridFilter"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearGridFilter"/> <actionGroup ref="logout" stepKey="logout"/> </after> <!-- Start to create new cart price rule via Category conditions --> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontImageColorWhenFilterByColorFilterTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontImageColorWhenFilterByColorFilterTest.xml index 2928011662864..af75343613a3f 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontImageColorWhenFilterByColorFilterTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontImageColorWhenFilterByColorFilterTest.xml @@ -34,8 +34,8 @@ <argument name="ProductAttribute" value="visualSwatchAttribute"/> </actionGroup> <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPage"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearGridFilter"/> - <actionGroup ref="adminDataGridSelectPerPage" stepKey="selectNumberOfProductsPerPage"> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearGridFilter"/> + <actionGroup ref="AdminDataGridSelectPerPageActionGroup" stepKey="selectNumberOfProductsPerPage"> <argument name="perPage" value="100"/> </actionGroup> <actionGroup ref="deleteProductsIfTheyExist" stepKey="deleteAllProducts"/> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSeeProductImagesMatchingProductSwatchesTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSeeProductImagesMatchingProductSwatchesTest.xml index 1717b424e4597..1fc8c3b2d2727 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSeeProductImagesMatchingProductSwatchesTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSeeProductImagesMatchingProductSwatchesTest.xml @@ -29,11 +29,11 @@ <actionGroup ref="deleteProductAttribute" stepKey="deleteAttribute"> <argument name="ProductAttribute" value="VisualSwatchProductAttribute"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductAttributeGridFilter"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductAttributeGridFilter"/> <actionGroup ref="deleteAllDuplicateProductUsingProductGrid" stepKey="deleteAllChildrenProducts"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductGridFilter"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductGridFilter"/> <actionGroup ref="logout" stepKey="logout"/> </after> diff --git a/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridDeleteCustomPerPageActionGroup.xml b/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridDeleteCustomPerPageActionGroup.xml new file mode 100644 index 0000000000000..275aaac39a757 --- /dev/null +++ b/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridDeleteCustomPerPageActionGroup.xml @@ -0,0 +1,27 @@ +<?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="AdminDataGridDeleteCustomPerPageActionGroup"> + <annotations> + <description>Sets the provided custom 'per page' display setting on an Admin Grid page. Deletes the Items listed in a grid. Validates that the 'per page' count in NOT present.</description> + </annotations> + <arguments> + <argument name="perPage"/> + </arguments> + + <click selector="{{AdminDataGridPaginationSection.perPageDropdown}}" stepKey="clickPerPageDropdown1"/> + <click selector="{{AdminDataGridPaginationSection.perPageEditCustomValue(perPage)}}" stepKey="clickToEditCustomPerPage"/> + <waitForElementVisible selector="{{AdminDataGridPaginationSection.perPageDeleteCustomValue(perPage)}}" time="30" stepKey="waitForDeleteButtonVisible"/> + <click selector="{{AdminDataGridPaginationSection.perPageDeleteCustomValue(perPage)}}" stepKey="clickToDeleteCustomPerPage"/> + <waitForLoadingMaskToDisappear stepKey="waitForGridLoad"/> + <click selector="{{AdminDataGridPaginationSection.perPageDropdown}}" stepKey="clickPerPageDropdown"/> + <dontSeeElement selector="{{AdminDataGridPaginationSection.perPageDropDownItem(perPage)}}" stepKey="dontSeeDropDownItem"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridFilterActionGroup.xml b/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridFilterActionGroup.xml deleted file mode 100644 index 4c7b386a4cd00..0000000000000 --- a/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridFilterActionGroup.xml +++ /dev/null @@ -1,44 +0,0 @@ -<?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"> - <!--Search grid with keyword search--> - <actionGroup name="searchAdminDataGridByKeyword"> - <annotations> - <description>Fills 'Search by keyword' on an Admin Grid page. Clicks on Submit Search.</description> - </annotations> - <arguments> - <argument name="keyword"/> - </arguments> - - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> - <fillField selector="{{AdminDataGridHeaderSection.search}}" userInput="{{keyword}}" stepKey="fillKeywordSearchField"/> - <click selector="{{AdminDataGridHeaderSection.submitSearch}}" stepKey="clickKeywordSearch"/> - </actionGroup> - - <!--Reset data grid to default view--> - <actionGroup name="resetAdminDataGridToDefaultView"> - <annotations> - <description>Resets an Admin Grid page to the 'Default View'.</description> - </annotations> - - <click selector="{{AdminDataGridHeaderSection.bookmarkToggle}}" stepKey="openViewBookmarks"/> - <click selector="{{AdminDataGridHeaderSection.bookmarkOption('Default View')}}" stepKey="selectDefaultGridView"/> - <see selector="{{AdminDataGridHeaderSection.bookmarkToggle}}" userInput="Default View" stepKey="seeDefaultViewSelected"/> - </actionGroup> - - <!--Clear all filters in grid--> - <actionGroup name="clearFiltersAdminDataGrid"> - <annotations> - <description>Clicks on 'Clear Filters' on an Admin Grid page.</description> - </annotations> - - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridPaginationActionGroup.xml b/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridPaginationActionGroup.xml deleted file mode 100644 index 11c5ef039f3e4..0000000000000 --- a/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridPaginationActionGroup.xml +++ /dev/null @@ -1,57 +0,0 @@ -<?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="adminDataGridSelectPerPage"> - <annotations> - <description>Sets the provided preset 'per page' display setting on an Admin Grid page.</description> - </annotations> - <arguments> - <argument name="perPage" type="string"/> - </arguments> - - <click selector="{{AdminDataGridPaginationSection.perPageDropdown}}" stepKey="clickPerPageDropdown"/> - <click selector="{{AdminDataGridPaginationSection.perPageOption(perPage)}}" stepKey="selectCustomPerPage"/> - <waitForPageLoad stepKey="waitForGridLoad"/> - </actionGroup> - - <actionGroup name="adminDataGridSelectCustomPerPage"> - <annotations> - <description>Sets the provided custom 'per page' display setting on an Admin Grid page.</description> - </annotations> - <arguments> - <argument name="perPage"/> - </arguments> - - <click selector="{{AdminDataGridPaginationSection.perPageDropdown}}" stepKey="clickPerPageDropdown"/> - <click selector="{{AdminDataGridPaginationSection.perPageOption('Custom')}}" stepKey="selectCustomPerPage"/> - <waitForElementVisible selector="{{AdminDataGridPaginationSection.perPageInput}}" time="30" stepKey="waitForInputVisible"/> - <fillField selector="{{AdminDataGridPaginationSection.perPageInput}}" userInput="{{perPage}}" stepKey="fillCustomPerPage"/> - <click selector="{{AdminDataGridPaginationSection.perPageApplyInput}}" stepKey="applyCustomPerPage"/> - <waitForLoadingMaskToDisappear stepKey="waitForGridLoad"/> - <seeInField selector="{{AdminDataGridPaginationSection.perPageDropDownValue}}" userInput="{{perPage}}" stepKey="seePerPageValueInDropDown"/> - </actionGroup> - - <actionGroup name="adminDataGridDeleteCustomPerPage"> - <annotations> - <description>Sets the provided custom 'per page' display setting on an Admin Grid page. Deletes the Items listed in a grid. Validates that the 'per page' count in NOT present.</description> - </annotations> - <arguments> - <argument name="perPage"/> - </arguments> - - <click selector="{{AdminDataGridPaginationSection.perPageDropdown}}" stepKey="clickPerPageDropdown1"/> - <click selector="{{AdminDataGridPaginationSection.perPageEditCustomValue(perPage)}}" stepKey="clickToEditCustomPerPage"/> - <waitForElementVisible selector="{{AdminDataGridPaginationSection.perPageDeleteCustomValue(perPage)}}" time="30" stepKey="waitForDeleteButtonVisible"/> - <click selector="{{AdminDataGridPaginationSection.perPageDeleteCustomValue(perPage)}}" stepKey="clickToDeleteCustomPerPage"/> - <waitForLoadingMaskToDisappear stepKey="waitForGridLoad"/> - <click selector="{{AdminDataGridPaginationSection.perPageDropdown}}" stepKey="clickPerPageDropdown"/> - <dontSeeElement selector="{{AdminDataGridPaginationSection.perPageDropDownItem(perPage)}}" stepKey="dontSeeDropDownItem"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridSelectCustomPerPageActionGroup.xml b/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridSelectCustomPerPageActionGroup.xml new file mode 100644 index 0000000000000..0d9c80e086352 --- /dev/null +++ b/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridSelectCustomPerPageActionGroup.xml @@ -0,0 +1,27 @@ +<?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="AdminDataGridSelectCustomPerPageActionGroup"> + <annotations> + <description>Sets the provided custom 'per page' display setting on an Admin Grid page.</description> + </annotations> + <arguments> + <argument name="perPage"/> + </arguments> + + <click selector="{{AdminDataGridPaginationSection.perPageDropdown}}" stepKey="clickPerPageDropdown"/> + <click selector="{{AdminDataGridPaginationSection.perPageOption('Custom')}}" stepKey="selectCustomPerPage"/> + <waitForElementVisible selector="{{AdminDataGridPaginationSection.perPageInput}}" time="30" stepKey="waitForInputVisible"/> + <fillField selector="{{AdminDataGridPaginationSection.perPageInput}}" userInput="{{perPage}}" stepKey="fillCustomPerPage"/> + <click selector="{{AdminDataGridPaginationSection.perPageApplyInput}}" stepKey="applyCustomPerPage"/> + <waitForLoadingMaskToDisappear stepKey="waitForGridLoad"/> + <seeInField selector="{{AdminDataGridPaginationSection.perPageDropDownValue}}" userInput="{{perPage}}" stepKey="seePerPageValueInDropDown"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridSelectPerPageActionGroup.xml b/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridSelectPerPageActionGroup.xml new file mode 100644 index 0000000000000..df342602a62be --- /dev/null +++ b/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridSelectPerPageActionGroup.xml @@ -0,0 +1,23 @@ +<?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="AdminDataGridSelectPerPageActionGroup"> + <annotations> + <description>Sets the provided preset 'per page' display setting on an Admin Grid page.</description> + </annotations> + <arguments> + <argument name="perPage" type="string"/> + </arguments> + + <click selector="{{AdminDataGridPaginationSection.perPageDropdown}}" stepKey="clickPerPageDropdown"/> + <click selector="{{AdminDataGridPaginationSection.perPageOption(perPage)}}" stepKey="selectCustomPerPage"/> + <waitForPageLoad stepKey="waitForGridLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Ui/Test/Mftf/ActionGroup/ClearFiltersAdminDataGridActionGroup.xml b/app/code/Magento/Ui/Test/Mftf/ActionGroup/ClearFiltersAdminDataGridActionGroup.xml new file mode 100644 index 0000000000000..74b4a6c75ed2a --- /dev/null +++ b/app/code/Magento/Ui/Test/Mftf/ActionGroup/ClearFiltersAdminDataGridActionGroup.xml @@ -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="ClearFiltersAdminDataGridActionGroup"> + <annotations> + <description>Clicks on 'Clear Filters' on an Admin Grid page.</description> + </annotations> + + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Ui/Test/Mftf/ActionGroup/ResetAdminDataGridToDefaultViewActionGroup.xml b/app/code/Magento/Ui/Test/Mftf/ActionGroup/ResetAdminDataGridToDefaultViewActionGroup.xml new file mode 100644 index 0000000000000..a07e3c80623de --- /dev/null +++ b/app/code/Magento/Ui/Test/Mftf/ActionGroup/ResetAdminDataGridToDefaultViewActionGroup.xml @@ -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="ResetAdminDataGridToDefaultViewActionGroup"> + <annotations> + <description>Resets an Admin Grid page to the 'Default View'.</description> + </annotations> + + <click selector="{{AdminDataGridHeaderSection.bookmarkToggle}}" stepKey="openViewBookmarks"/> + <click selector="{{AdminDataGridHeaderSection.bookmarkOption('Default View')}}" stepKey="selectDefaultGridView"/> + <see selector="{{AdminDataGridHeaderSection.bookmarkToggle}}" userInput="Default View" stepKey="seeDefaultViewSelected"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Ui/Test/Mftf/ActionGroup/SearchAdminDataGridByKeywordActionGroup.xml b/app/code/Magento/Ui/Test/Mftf/ActionGroup/SearchAdminDataGridByKeywordActionGroup.xml new file mode 100644 index 0000000000000..4a59b1baa70d2 --- /dev/null +++ b/app/code/Magento/Ui/Test/Mftf/ActionGroup/SearchAdminDataGridByKeywordActionGroup.xml @@ -0,0 +1,23 @@ +<?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="SearchAdminDataGridByKeywordActionGroup"> + <annotations> + <description>Fills 'Search by keyword' on an Admin Grid page. Clicks on Submit Search.</description> + </annotations> + <arguments> + <argument name="keyword"/> + </arguments> + + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <fillField selector="{{AdminDataGridHeaderSection.search}}" userInput="{{keyword}}" stepKey="fillKeywordSearchField"/> + <click selector="{{AdminDataGridHeaderSection.submitSearch}}" stepKey="clickKeywordSearch"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTest.xml index 121fd7c736dcc..69954a2f60480 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTest.xml @@ -45,12 +45,12 @@ <actionGroup ref="AdminDeleteStoreViewIfExistsActionGroup" stepKey="deleteStoreViewNl"> <argument name="storeViewName" value="{{customStoreNLNotUnique.name}}"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearStoreFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearStoreFilters"/> <actionGroup ref="deleteProductByName" stepKey="deleteImportedProduct"> <argument name="sku" value="productformagetwo68980"/> <argument name="name" value="productformagetwo68980"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFiltersIfSet"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFiltersIfSet"/> <actionGroup ref="logout" stepKey="logout"/> </after> <actionGroup ref="switchCategoryStoreView" stepKey="switchToStoreViewEn"> @@ -169,12 +169,12 @@ <actionGroup ref="AdminDeleteStoreViewIfExistsActionGroup" stepKey="deleteStoreViewNl"> <argument name="storeViewName" value="{{customStoreNLNotUnique.name}}"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearStoreGridFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearStoreGridFilters"/> <actionGroup ref="deleteProductByName" stepKey="deleteImportedProduct"> <argument name="sku" value="productformagetwo68980"/> <argument name="name" value="productformagetwo68980"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFiltersIfSet"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFiltersIfSet"/> <actionGroup ref="logout" stepKey="logout"/> <magentoCLI command="config:set catalog/seo/generate_category_product_rewrites 1" stepKey="resetConfigurationSetting"/> <!--Flush cache--> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddMultipleStoreProductsToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddMultipleStoreProductsToWishlistTest.xml index aeb1d134d8e22..82021e75e0983 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddMultipleStoreProductsToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddMultipleStoreProductsToWishlistTest.xml @@ -42,11 +42,11 @@ <actionGroup ref="DeleteCustomStoreActionGroup" stepKey="deleteCustomStoreGroup"> <argument name="storeGroupName" value="$$storeGroup.group[name]$$"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearWebsitesGridFilter"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearWebsitesGridFilter"/> <!--Clear products filter--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductsFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsFilters"/> <!--Logout everywhere--> <actionGroup ref="logout" stepKey="adminLogout"/> <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> From 9b4c9c01ecbd439af8f3a7aef577f41de89c19b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 14:43:37 +0100 Subject: [PATCH 118/586] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- ...thOnlinePaymentIncludingTaxAndDiscount.xml | 2 +- .../Test/StorefrontCustomerCheckoutTest.xml | 4 +- ...StorefrontCheckTaxAddingValidVATIdTest.xml | 12 +- ...ValueWithFullDiscountUsingCartRuleTest.xml | 2 +- .../AddCustomTaxRateActionGroup.xml | 21 ++ .../AddNewTaxRateNoZipActionGroup.xml | 32 +++ .../ActionGroup/AddNewTaxRuleActionGroup.xml | 21 ++ .../AddProductTaxClassActionGroup.xml | 28 ++ .../AdminCustomerTaxClassActionGroup.xml | 25 +- .../Mftf/ActionGroup/AdminTaxActionGroup.xml | 264 ------------------ .../ChangeShippingTaxClassActionGroup.xml | 45 +++ ...ToDefaultTaxConfigurationUIActionGroup.xml | 55 ++++ .../DeleteCustomerTaxClassActionGroup.xml | 30 ++ .../DeleteProductTaxClassActionGroup.xml | 30 ++ .../EditTaxConfigurationByUIActionGroup.xml | 62 ++++ .../SetDefaultShippingTaxClassActionGroup.xml | 43 +++ .../Test/Mftf/Test/AdminTaxReportGridTest.xml | 12 +- .../Mftf/Test/CheckCreditMemoTotalsTest.xml | 2 +- .../Mftf/Test/StorefrontTaxQuoteCartTest.xml | 32 +-- .../Test/StorefrontTaxQuoteCheckoutTest.xml | 32 +-- 20 files changed, 418 insertions(+), 336 deletions(-) create mode 100644 app/code/Magento/Tax/Test/Mftf/ActionGroup/AddCustomTaxRateActionGroup.xml create mode 100644 app/code/Magento/Tax/Test/Mftf/ActionGroup/AddNewTaxRateNoZipActionGroup.xml create mode 100644 app/code/Magento/Tax/Test/Mftf/ActionGroup/AddNewTaxRuleActionGroup.xml create mode 100644 app/code/Magento/Tax/Test/Mftf/ActionGroup/AddProductTaxClassActionGroup.xml delete mode 100644 app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminTaxActionGroup.xml create mode 100644 app/code/Magento/Tax/Test/Mftf/ActionGroup/ChangeShippingTaxClassActionGroup.xml create mode 100644 app/code/Magento/Tax/Test/Mftf/ActionGroup/ChangeToDefaultTaxConfigurationUIActionGroup.xml create mode 100644 app/code/Magento/Tax/Test/Mftf/ActionGroup/DeleteCustomerTaxClassActionGroup.xml create mode 100644 app/code/Magento/Tax/Test/Mftf/ActionGroup/DeleteProductTaxClassActionGroup.xml create mode 100644 app/code/Magento/Tax/Test/Mftf/ActionGroup/EditTaxConfigurationByUIActionGroup.xml create mode 100644 app/code/Magento/Tax/Test/Mftf/ActionGroup/SetDefaultShippingTaxClassActionGroup.xml diff --git a/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml b/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml index 8f0ce4918b978..db87c727a3fee 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml +++ b/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml @@ -90,7 +90,7 @@ <see selector="{{AdminCartPriceRulesSection.messages}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> <!--Set Taxable Goods for Shipping Tax Class--> - <actionGroup ref="changeShippingTaxClass" stepKey="changeShippingTaxClass"/> + <actionGroup ref="ChangeShippingTaxClassActionGroup" stepKey="changeShippingTaxClass"/> <!--Adding Special price to product--> <amOnPage url="{{AdminProductEditPage.url($$simpleProduct.id$$)}}" stepKey="openAdminProductEditPage"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest.xml index 218ff959750d6..917a4ac58464f 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest.xml @@ -116,11 +116,11 @@ <fillField stepKey="fillRuleName" selector="{{AdminTaxRulesSection.ruleName}}" userInput="SampleRule"/> <!-- Add NY and CA tax rules --> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addNYTaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addNYTaxRate"> <argument name="taxCode" value="SimpleTaxNY"/> </actionGroup> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addCATaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addCATaxRate"> <argument name="taxCode" value="SimpleTaxCA"/> </actionGroup> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCheckTaxAddingValidVATIdTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCheckTaxAddingValidVATIdTest.xml index 8469126547eb1..4c35cdbdb7cbb 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCheckTaxAddingValidVATIdTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCheckTaxAddingValidVATIdTest.xml @@ -30,23 +30,23 @@ </before> <!--Add new tax rates. Go to tax rule page --> - <actionGroup ref="addNewTaxRuleActionGroup" stepKey="addFirstTaxRuleActionGroup"/> + <actionGroup ref="AddNewTaxRuleActionGroup" stepKey="addFirstTaxRuleActionGroup"/> <fillField stepKey="fillRuleName" selector="{{AdminTaxRulesSection.ruleName}}" userInput="{{TaxRule.name}}"/> <!-- Add NY and CA tax rules --> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addSimpleTaxUK"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addSimpleTaxUK"> <argument name="taxCode" value="SimpleTaxUK"/> </actionGroup> <click stepKey="clickSave" selector="{{AdminStoresMainActionsSection.saveButton}}"/> <waitForPageLoad stepKey="waitForNewTaxRuleCreated"/> <!-- Go to tax rule page to create second Tax Rule--> - <actionGroup ref="addNewTaxRuleActionGroup" stepKey="addSecondTaxRuleActionGroup"/> + <actionGroup ref="AddNewTaxRuleActionGroup" stepKey="addSecondTaxRuleActionGroup"/> <fillField stepKey="fillSecondRuleName" selector="{{AdminTaxRulesSection.ruleName}}" userInput="{{TaxRuleZeroRate.name}}"/> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addSimpleTaxUKZeroRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addSimpleTaxUKZeroRate"> <argument name="taxCode" value="SimpleTaxUKZeroRate"/> </actionGroup> - <actionGroup ref="addCustomerTaxClass" stepKey="addCustomerTaxClass"> + <actionGroup ref="AddCustomerTaxClassActionGroup" stepKey="addCustomerTaxClass"> <argument name="customerTaxClassName" value="UK_zero"/> </actionGroup> <click stepKey="disableDefaultProdTaxClass" selector="{{AdminTaxRulesSection.defaultCustomerTaxClass}}"/> @@ -138,7 +138,7 @@ <deleteData createDataKey="createProduct" stepKey="deleteSimpleProduct"/> <deleteData createDataKey="createCategory" stepKey="deleteCategoryFirst"/> - <actionGroup ref="deleteProductTaxClass" stepKey="deleteFirstProductTaxClass"> + <actionGroup ref="DeleteProductTaxClassActionGroup" stepKey="deleteFirstProductTaxClass"> <argument name="taxClassName" value="UK_zero"/> </actionGroup> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartTotalValueWithFullDiscountUsingCartRuleTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartTotalValueWithFullDiscountUsingCartRuleTest.xml index 903e79b2328bc..f12b8ea7ca331 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartTotalValueWithFullDiscountUsingCartRuleTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartTotalValueWithFullDiscountUsingCartRuleTest.xml @@ -39,7 +39,7 @@ <click stepKey="addNewTaxRate" selector="{{AdminGridMainControls.add}}"/> <fillField stepKey="fillRuleName" selector="{{AdminTaxRulesSection.ruleName}}" userInput="SampleRule"/> <!-- Add tax rule with 20% tax rate --> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addNYTaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addNYTaxRate"> <argument name="taxCode" value="SimpleTaxNYRate"/> </actionGroup> <click stepKey="clickSave" selector="{{AdminStoresMainActionsSection.saveButton}}"/> diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/AddCustomTaxRateActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AddCustomTaxRateActionGroup.xml new file mode 100644 index 0000000000000..97d59a51bb68e --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AddCustomTaxRateActionGroup.xml @@ -0,0 +1,21 @@ +<?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="AddCustomTaxRateActionGroup" extends="addNewTaxRateNoZip"> + <annotations> + <description>EXTENDS: addNewTaxRateNoZip. Removes 'fillZipCode' and 'fillRate'. Fills in the Zip Code and Rate. PLEASE NOTE: The values are Hardcoded.</description> + </annotations> + + <remove keyForRemoval="fillZipCode"/> + <remove keyForRemoval="fillRate"/> + <fillField stepKey="fillZipCode" selector="{{AdminTaxRulesSection.zipCode}}" userInput="US-NY-*-Rate 2" after="fillTaxIdentifier"/> + <fillField stepKey="fillRate" selector="{{AdminTaxRulesSection.rate}}" userInput="0" after="selectCountry"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/AddNewTaxRateNoZipActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AddNewTaxRateNoZipActionGroup.xml new file mode 100644 index 0000000000000..8a2945130c925 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AddNewTaxRateNoZipActionGroup.xml @@ -0,0 +1,32 @@ +<?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="AddNewTaxRateNoZipActionGroup"> + <annotations> + <description>Goes to the Admin Tax Rules grid page. Adds the provided Tax Code.</description> + </annotations> + <arguments> + <argument name="taxCode"/> + </arguments> + + <!-- Go to the tax rate page --> + <click stepKey="addNewTaxRate" selector="{{AdminTaxRulesSection.addNewTaxRate}}"/> + + <!-- Fill out a new tax rate --> + <fillField stepKey="fillTaxIdentifier" selector="{{AdminTaxRulesSection.taxIdentifier}}" userInput="{{taxCode.state}}-{{taxCode.rate}}"/> + <fillField stepKey="fillZipCode" selector="{{AdminTaxRulesSection.zipCode}}" userInput="{{taxCode.zip}}"/> + <selectOption stepKey="selectState" selector="{{AdminTaxRulesSection.state}}" userInput="{{taxCode.state}}"/> + <selectOption stepKey="selectCountry" selector="{{AdminTaxRulesSection.country}}" userInput="{{taxCode.country}}"/> + <fillField stepKey="fillRate" selector="{{AdminTaxRulesSection.rate}}" userInput="{{taxCode.rate}}"/> + + <!-- Save the tax rate --> + <click stepKey="saveTaxRate" selector="{{AdminTaxRulesSection.save}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/AddNewTaxRuleActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AddNewTaxRuleActionGroup.xml new file mode 100644 index 0000000000000..6bc7ef6f540c3 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AddNewTaxRuleActionGroup.xml @@ -0,0 +1,21 @@ +<?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="AddNewTaxRuleActionGroup"> + <annotations> + <description>Goes to the Admin Tax Rules grid page. Clicks on the Add New Tax Rule button.</description> + </annotations> + + <!-- Go to tax rule page --> + <amOnPage url="{{AdminTaxRuleGridPage.url}}" stepKey="goToTaxRulePage"/> + <waitForPageLoad stepKey="waitForTaxRatePage"/> + <click stepKey="addNewTaxRate" selector="{{AdminGridMainControls.add}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/AddProductTaxClassActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AddProductTaxClassActionGroup.xml new file mode 100644 index 0000000000000..943d05ee37504 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AddProductTaxClassActionGroup.xml @@ -0,0 +1,28 @@ +<?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="AddProductTaxClassActionGroup"> + <annotations> + <description>Adds the provided Product Tax Class to a Tax Rule. Clicks on Save.</description> + </annotations> + <arguments> + <argument name="prodTaxClassName" type="string"/> + </arguments> + + <!--Click Additional Settings--> + <click stepKey="clickAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> + <!--Click Product Add New Tax Class Button--> + <click stepKey="clickProdAddNewTaxClassBtn" selector="{{AdminTaxRulesSection.productAddNewTaxClass}}"/> + <!--Fill field--> + <fillField stepKey="fillProdNewTaxClass" selector="{{AdminTaxRulesSection.fieldProdNewTaxClass}}" userInput="{{prodTaxClassName}}"/> + <!-- Save Product tax rate --> + <click stepKey="saveProdTaxRate" selector="{{AdminTaxRulesSection.saveProdNewTaxClass}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminCustomerTaxClassActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminCustomerTaxClassActionGroup.xml index f711633e1e00b..d627448edf730 100644 --- a/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminCustomerTaxClassActionGroup.xml +++ b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminCustomerTaxClassActionGroup.xml @@ -9,14 +9,14 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <!--Add Customer Tax Class--> - <actionGroup name="addCustomerTaxClass"> + <actionGroup name="AddCustomerTaxClassActionGroup"> <annotations> <description>Adds the provided Customer Tax Class on the Admin Tax Rule creation/edit page.</description> </annotations> <arguments> <argument name="customerTaxClassName" type="string"/> </arguments> - + <!--Click Additional Settings--> <click stepKey="clickAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> <!--Click Product Add New Tax Class Button--> @@ -26,25 +26,4 @@ <!-- Save Product tax rate --> <click stepKey="saveProdTaxRate" selector="{{AdminTaxRulesSection.saveCustomerNewTaxClass}}"/> </actionGroup> - - <!--Delete Product Tax Class--> - <actionGroup name="deleteCustomerTaxClass"> - <annotations> - <description>Goes to the Admin New Tax Rule page. Deletes the provided Tax Class Name.</description> - </annotations> - <arguments> - <argument name="taxClassName" type="string"/> - </arguments> - - <!-- Go to tax rule page --> - <amOnPage url="{{AdminNewTaxRulePage.url}}" stepKey="goToNewTaxRulePage"/> - <waitForPageLoad stepKey="waitForTaxRatePage"/> - <click stepKey="clickAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> - <scrollTo stepKey="scrollToAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> - <moveMouseOver stepKey="hoverDeleteElement" selector="{{AdminTaxRulesSection.deleteTaxClassName(taxClassName)}}"/> - <click stepKey="deleteFirstTaxClass" selector="{{AdminTaxRulesSection.deleteTaxClass(taxClassName)}}"/> - <waitForElementVisible selector="{{AdminTaxRulesSection.popUpDialogOK}}" stepKey="waitForElementBecomeVisible"/> - <click stepKey="acceptPopUpDialog" selector="{{AdminTaxRulesSection.popUpDialogOK}}"/> - <waitForPageLoad stepKey="waitForProductTaxClassDeleted"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminTaxActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminTaxActionGroup.xml deleted file mode 100644 index e1674481b8bb9..0000000000000 --- a/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminTaxActionGroup.xml +++ /dev/null @@ -1,264 +0,0 @@ -<?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"> - <!-- Change the tax configuration to display in cart and checkout flow --> - <actionGroup name="editTaxConfigurationByUI"> - <annotations> - <description>Goes to the 'Configuration' page for 'Tax'. Enables the display of Taxes in the Storefront Shopping Cart and Checkout page.</description> - </annotations> - - <!-- navigate to the tax configuration page --> - <amOnPage url="{{AdminTaxConfigurationPage.url}}" stepKey="goToAdminTaxPage"/> - <waitForPageLoad stepKey="waitForTaxConfigLoad"/> - - <!-- change the default state to California --> - <scrollTo selector="#tax_defaults-head" x="0" y="-80" stepKey="scrollToTaxDefaults"/> - - <!-- conditionalClick twice to fix some flaky behavior --> - <conditionalClick stepKey="clickCalculationSettings" selector="{{AdminConfigureTaxSection.defaultDestination}}" dependentSelector="#tax_defaults" visible="false"/> - <conditionalClick stepKey="clickCalculationSettingsAgain" selector="{{AdminConfigureTaxSection.defaultDestination}}" dependentSelector="#tax_defaults" visible="false"/> - <uncheckOption stepKey="clickDefaultState" selector="{{AdminConfigureTaxSection.systemValueDefaultState}}"/> - <selectOption stepKey="selectDefaultState" selector="{{AdminConfigureTaxSection.dropdownDefaultState}}" userInput="California"/> - <fillField stepKey="fillDefaultPostCode" selector="{{AdminConfigureTaxSection.defaultPostCode}}" userInput="*"/> - - <!-- change the options for shopping cart display to show tax --> - <scrollTo selector="#tax_cart_display-head" x="0" y="-80" stepKey="scrollToTaxShoppingCartDisplay"/> - - <!-- conditionalClick twice to fix some flaky behavior --> - <conditionalClick stepKey="clickShoppingCartDisplaySettings" selector="{{AdminConfigureTaxSection.shoppingCartDisplay}}" dependentSelector="#tax_cart_display" visible="false"/> - <conditionalClick stepKey="clickShoppingCartDisplaySettingsAgain" selector="{{AdminConfigureTaxSection.shoppingCartDisplay}}" dependentSelector="#tax_cart_display" visible="false"/> - <uncheckOption stepKey="clickTaxTotalCart" selector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalCart}}"/> - <selectOption stepKey="selectTaxTotalCart" selector="{{AdminConfigureTaxSection.dropdownIncludeTaxTotalCart}}" userInput="Yes"/> - <uncheckOption stepKey="clickDisplayTaxSummaryCart" selector="{{AdminConfigureTaxSection.systemValueDisplayTaxSummaryCart}}"/> - <selectOption stepKey="selectDisplayTaxSummaryCart" selector="{{AdminConfigureTaxSection.dropdownDisplayTaxSummaryCart}}" userInput="Yes"/> - <uncheckOption stepKey="clickDisplayZeroTaxCart" selector="{{AdminConfigureTaxSection.systemValueDisplayZeroTaxCart}}"/> - <selectOption stepKey="selectDisplayZeroTaxCart" selector="{{AdminConfigureTaxSection.dropdownDisplayZeroTaxCart}}" userInput="Yes"/> - - <!-- change the options for orders, invoices, credit memos display to show tax --> - <scrollTo selector="#tax_sales_display-head" x="0" y="-80" stepKey="scrollToTaxSalesDisplay"/> - - <!-- conditionalClick twice to fix some flaky behavior --> - <conditionalClick stepKey="clickOrdersInvoicesCreditSales" selector="{{AdminConfigureTaxSection.ordersInvoicesCreditSales}}" dependentSelector="#tax_sales_display" visible="false"/> - <conditionalClick stepKey="clickOrdersInvoicesCreditSalesAgain" selector="{{AdminConfigureTaxSection.ordersInvoicesCreditSales}}" dependentSelector="#tax_sales_display" visible="false"/> - <uncheckOption stepKey="clickTaxTotalSales" selector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalSales}}"/> - <selectOption stepKey="selectTaxTotalSales" selector="{{AdminConfigureTaxSection.dropdownIncludeTaxTotalSales}}" userInput="Yes"/> - <uncheckOption stepKey="clickDisplayTaxSummarySales" selector="{{AdminConfigureTaxSection.systemValueDisplayTaxSummarySales}}"/> - <selectOption stepKey="selectDisplayTaxSummarySales" selector="{{AdminConfigureTaxSection.dropdownDisplayTaxSummarySales}}" userInput="Yes"/> - <uncheckOption stepKey="clickDisplayZeroTaxSales" selector="{{AdminConfigureTaxSection.systemValueDisplayZeroTaxSales}}"/> - <selectOption stepKey="selectDisplayZeroTaxSales" selector="{{AdminConfigureTaxSection.dropdownDisplayZeroTaxSales}}" userInput="Yes"/> - - <!-- Save the settings --> - <scrollToTopOfPage stepKey="scrollToTop"/> - <click stepKey="saveTaxOptions" selector="{{AdminCategoryMainActionsSection.SaveButton}}"/> - <waitForPageLoad stepKey="waitForTaxSaved"/> - <see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/> - </actionGroup> - - <actionGroup name="changeToDefaultTaxConfigurationUI"> - <annotations> - <description>Goes to the 'Configuration' page for 'Tax'. Set the Tax Configuration Settings to the Default values. Clicks on Save. Validates that the Success Message is present and correct.</description> - </annotations> - - <!-- navigate to the tax configuration page --> - <amOnPage url="{{AdminTaxConfigurationPage.url}}" stepKey="goToAdminTaxPage"/> - <waitForPageLoad stepKey="waitForTaxConfigLoad"/> - - <!-- change the default state to none --> - <!-- conditionalClick twice to fix some flaky behavior --> - <conditionalClick stepKey="clickCalculationSettings" selector="{{AdminConfigureTaxSection.defaultDestination}}" dependentSelector="{{AdminConfigureTaxSection.systemValueDefaultState}}" visible="false"/> - <conditionalClick stepKey="clickCalculationSettingsAgain" selector="{{AdminConfigureTaxSection.defaultDestination}}" dependentSelector="{{AdminConfigureTaxSection.systemValueDefaultState}}" visible="false"/> - <checkOption stepKey="clickDefaultState" selector="{{AdminConfigureTaxSection.systemValueDefaultState}}"/> - <selectOption stepKey="selectDefaultState" selector="{{AdminConfigureTaxSection.dropdownDefaultState}}" userInput="California"/> - <fillField stepKey="fillDefaultPostCode" selector="{{AdminConfigureTaxSection.defaultPostCode}}" userInput=""/> - - <!-- change the options for shopping cart display to not show tax --> - <!-- conditionalClick twice to fix some flaky behavior --> - <conditionalClick stepKey="clickShoppingCartDisplaySettings" selector="{{AdminConfigureTaxSection.shoppingCartDisplay}}" dependentSelector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalCart}}" visible="false"/> - <conditionalClick stepKey="clickShoppingCartDisplaySettingsAgain" selector="{{AdminConfigureTaxSection.shoppingCartDisplay}}" dependentSelector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalCart}}" visible="false"/> - <checkOption stepKey="clickTaxTotalCart" selector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalCart}}"/> - <selectOption stepKey="selectTaxTotalCart" selector="{{AdminConfigureTaxSection.dropdownIncludeTaxTotalCart}}" userInput="Yes"/> - <checkOption stepKey="clickDisplayTaxSummaryCart" selector="{{AdminConfigureTaxSection.systemValueDisplayTaxSummaryCart}}"/> - <selectOption stepKey="selectDisplayTaxSummaryCart" selector="{{AdminConfigureTaxSection.dropdownDisplayTaxSummaryCart}}" userInput="Yes"/> - <checkOption stepKey="clickDisplayZeroTaxCart" selector="{{AdminConfigureTaxSection.systemValueDisplayZeroTaxCart}}"/> - <selectOption stepKey="selectDisplayZeroTaxCart" selector="{{AdminConfigureTaxSection.dropdownDisplayZeroTaxCart}}" userInput="Yes"/> - - <!-- change the options for orders, invoices, credit memos display to not show tax --> - <!-- conditionalClick twice to fix some flaky behavior --> - <conditionalClick stepKey="clickOrdersInvoicesCreditSales" selector="{{AdminConfigureTaxSection.ordersInvoicesCreditSales}}" dependentSelector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalSales}}" visible="false"/> - <conditionalClick stepKey="clickOrdersInvoicesCreditSalesAgain" selector="{{AdminConfigureTaxSection.ordersInvoicesCreditSales}}" dependentSelector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalSales}}" visible="false"/> - <checkOption stepKey="clickTaxTotalSales" selector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalSales}}"/> - <selectOption stepKey="selectTaxTotalSales" selector="{{AdminConfigureTaxSection.dropdownIncludeTaxTotalSales}}" userInput="Yes"/> - <checkOption stepKey="clickDisplayTaxSummarySales" selector="{{AdminConfigureTaxSection.systemValueDisplayTaxSummarySales}}"/> - <selectOption stepKey="selectDisplayTaxSummarySales" selector="{{AdminConfigureTaxSection.dropdownDisplayTaxSummarySales}}" userInput="Yes"/> - <checkOption stepKey="clickDisplayZeroTaxSales" selector="{{AdminConfigureTaxSection.systemValueDisplayZeroTaxSales}}"/> - <selectOption stepKey="selectDisplayZeroTaxSales" selector="{{AdminConfigureTaxSection.dropdownDisplayZeroTaxSales}}" userInput="Yes"/> - - <!-- Save the settings --> - <scrollToTopOfPage stepKey="scrollToTop"/> - <click stepKey="saveTaxOptions" selector="{{AdminCategoryMainActionsSection.SaveButton}}"/> - <see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/> - </actionGroup> - - <actionGroup name="addCustomTaxRate" extends="addNewTaxRateNoZip"> - <annotations> - <description>EXTENDS: addNewTaxRateNoZip. Removes 'fillZipCode' and 'fillRate'. Fills in the Zip Code and Rate. PLEASE NOTE: The values are Hardcoded.</description> - </annotations> - - <remove keyForRemoval="fillZipCode"/> - <remove keyForRemoval="fillRate"/> - <fillField stepKey="fillZipCode" selector="{{AdminTaxRulesSection.zipCode}}" userInput="US-NY-*-Rate 2" after="fillTaxIdentifier"/> - <fillField stepKey="fillRate" selector="{{AdminTaxRulesSection.rate}}" userInput="0" after="selectCountry"/> - </actionGroup> - - <!-- Action group to add a tax rate when on a tax rule configuration page --> - <!-- Must already be on a tax rule configuration page or a new tax rule page --> - <actionGroup name="addNewTaxRateNoZip"> - <annotations> - <description>Goes to the Admin Tax Rules grid page. Adds the provided Tax Code.</description> - </annotations> - <arguments> - <argument name="taxCode"/> - </arguments> - - <!-- Go to the tax rate page --> - <click stepKey="addNewTaxRate" selector="{{AdminTaxRulesSection.addNewTaxRate}}"/> - - <!-- Fill out a new tax rate --> - <fillField stepKey="fillTaxIdentifier" selector="{{AdminTaxRulesSection.taxIdentifier}}" userInput="{{taxCode.state}}-{{taxCode.rate}}"/> - <fillField stepKey="fillZipCode" selector="{{AdminTaxRulesSection.zipCode}}" userInput="{{taxCode.zip}}"/> - <selectOption stepKey="selectState" selector="{{AdminTaxRulesSection.state}}" userInput="{{taxCode.state}}"/> - <selectOption stepKey="selectCountry" selector="{{AdminTaxRulesSection.country}}" userInput="{{taxCode.country}}"/> - <fillField stepKey="fillRate" selector="{{AdminTaxRulesSection.rate}}" userInput="{{taxCode.rate}}"/> - - <!-- Save the tax rate --> - <click stepKey="saveTaxRate" selector="{{AdminTaxRulesSection.save}}"/> - </actionGroup> - - <!--Set Tax Class for Shipping--> - <actionGroup name="changeShippingTaxClass"> - <annotations> - <description>Goes to the 'Configuration' page for 'Tax'. Sets the 'Tax Class for Shipping' configuration setting to 'Taxable Goods'. Clicks on Save. Validates that the Success Message is present and correct.</description> - </annotations> - - <!--Select Configuration menu from Store--> - <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES"/> - <waitForPageLoad stepKey="waitForConfiguration"/> - <click selector="{{AdminMenuSection.configuration}}" stepKey="clickOnConfigurations"/> - <waitForPageLoad stepKey="waitForSales"/> - - <!--Double click the same to fix flaky issue with redirection to Dashboard--> - <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES1"/> - <waitForPageLoad stepKey="waitForConfiguration1"/> - <click selector="{{AdminMenuSection.configuration}}" stepKey="clickOnConfigurations1"/> - <waitForPageLoad stepKey="waitForSales1" time="5"/> - - <!--Change default tax class for Shipping on Taxable Goods--> - <click selector="{{ConfigurationListSection.sales}}" stepKey="clickOnSales"/> - <waitForPageLoad stepKey="waitForPaymentMethods"/> - <click selector="{{AdminConfigureTaxSection.salesTax}}" stepKey="clickOnTax"/> - <waitForPageLoad stepKey="waitForTax"/> - <seeInCurrentUrl url="{{AdminTaxConfigurationPage.url}}" stepKey="adminTaxConfiguration"/> - <seeElement selector="{{AdminConfigureTaxSection.taxClasses}}" stepKey="taxClassSectionC"/> - <click selector="{{AdminConfigureTaxSection.taxClasses}}" stepKey="openTaxClassSection"/> - <click selector="{{AdminConfigureTaxSection.taxShippingClassSystem}}" stepKey="uncheckSystemValue"/> - <selectOption selector="{{AdminConfigureTaxSection.taxClassShipping}}" userInput="Taxable Goods" stepKey="setTaxClassForShipping"/> - - <!-- Save the settings --> - <scrollToTopOfPage stepKey="scrollToTop"/> - <click stepKey="saveTaxOptions" selector="{{AdminCategoryMainActionsSection.SaveButton}}"/> - <waitForPageLoad stepKey="waitForTaxSaved"/> - <see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/> - </actionGroup> - - <actionGroup name="setDefaultShippingTaxClass"> - <annotations> - <description>Goes to the 'Configuration' page via the Admin Side Menu. Sets the 'Tax Class for Shipping' to the System Default. Clicks on Save. Validates that the Success Message is present and correct.</description> - </annotations> - - <!--Select Configuration menu from Store--> - <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES"/> - <waitForPageLoad stepKey="waitForConfiguration"/> - <click selector="{{AdminMenuSection.configuration}}" stepKey="clickOnConfigurations"/> - <waitForPageLoad stepKey="waitForSales"/> - - <!--Double click the same to fix flaky issue with redirection to Dashboard--> - <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES1"/> - <waitForPageLoad stepKey="waitForConfiguration1"/> - <click selector="{{AdminMenuSection.configuration}}" stepKey="clickOnConfigurations1"/> - <waitForPageLoad stepKey="waitForSales1"/> - - <!--Change default tax class for Shipping on Taxable Goods--> - <click selector="{{ConfigurationListSection.sales}}" stepKey="clickOnSales"/> - <waitForPageLoad stepKey="waitForPaymentMethods"/> - <click selector="{{AdminConfigureTaxSection.salesTax}}" stepKey="clickOnTax"/> - <waitForPageLoad stepKey="waitForTax"/> - <seeElement selector="{{AdminConfigureTaxSection.taxClasses}}" stepKey="taxClassSectionC"/> - <click selector="{{AdminConfigureTaxSection.taxShippingClassSystem}}" stepKey="checkSystemDefaultValue"/> - <click selector="{{AdminConfigureTaxSection.taxClasses}}" stepKey="closeTaxClassSection"/> - - <!-- Save the settings --> - <scrollToTopOfPage stepKey="scrollToTop"/> - <click stepKey="saveTaxOptions" selector="{{AdminCategoryMainActionsSection.SaveButton}}"/> - <waitForPageLoad stepKey="waitForTaxSaved"/> - <see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/> - </actionGroup> - - <!--Add Product Tax Class--> - <actionGroup name="addProductTaxClass"> - <annotations> - <description>Adds the provided Product Tax Class to a Tax Rule. Clicks on Save.</description> - </annotations> - <arguments> - <argument name="prodTaxClassName" type="string"/> - </arguments> - - <!--Click Additional Settings--> - <click stepKey="clickAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> - <!--Click Product Add New Tax Class Button--> - <click stepKey="clickProdAddNewTaxClassBtn" selector="{{AdminTaxRulesSection.productAddNewTaxClass}}"/> - <!--Fill field--> - <fillField stepKey="fillProdNewTaxClass" selector="{{AdminTaxRulesSection.fieldProdNewTaxClass}}" userInput="{{prodTaxClassName}}"/> - <!-- Save Product tax rate --> - <click stepKey="saveProdTaxRate" selector="{{AdminTaxRulesSection.saveProdNewTaxClass}}"/> - </actionGroup> - - <!--Add New Tax Rule --> - <actionGroup name="addNewTaxRuleActionGroup"> - <annotations> - <description>Goes to the Admin Tax Rules grid page. Clicks on the Add New Tax Rule button.</description> - </annotations> - - <!-- Go to tax rule page --> - <amOnPage url="{{AdminTaxRuleGridPage.url}}" stepKey="goToTaxRulePage"/> - <waitForPageLoad stepKey="waitForTaxRatePage"/> - <click stepKey="addNewTaxRate" selector="{{AdminGridMainControls.add}}"/> - </actionGroup> - - <!--Delete Product Tax Class--> - <actionGroup name="deleteProductTaxClass"> - <annotations> - <description>Goes to the Admin Tax Rule creation page. Deletes the provided Tax Class.</description> - </annotations> - <arguments> - <argument name="taxClassName" type="string"/> - </arguments> - - <!-- Go to tax rule page --> - <amOnPage url="{{AdminNewTaxRulePage.url}}" stepKey="goToNewTaxRulePage"/> - <waitForPageLoad stepKey="waitForTaxRatePage"/> - <click stepKey="clickAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> - <scrollTo stepKey="scrollToAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> - <moveMouseOver stepKey="hoverDeleteElement" selector="{{AdminTaxRulesSection.deleteTaxClassName(taxClassName)}}"/> - <click stepKey="deleteFirstTaxClass" selector="{{AdminTaxRulesSection.deleteTaxClass(taxClassName)}}"/> - <waitForElementVisible selector="{{AdminTaxRulesSection.popUpDialogOK}}" stepKey="waitForElementBecomeVisible"/> - <click stepKey="acceptPopUpDialog" selector="{{AdminTaxRulesSection.popUpDialogOK}}"/> - <waitForPageLoad stepKey="waitForProductTaxClassDeleted"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/ChangeShippingTaxClassActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/ChangeShippingTaxClassActionGroup.xml new file mode 100644 index 0000000000000..8bd9136831890 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/ActionGroup/ChangeShippingTaxClassActionGroup.xml @@ -0,0 +1,45 @@ +<?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="ChangeShippingTaxClassActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'Tax'. Sets the 'Tax Class for Shipping' configuration setting to 'Taxable Goods'. Clicks on Save. Validates that the Success Message is present and correct.</description> + </annotations> + + <!--Select Configuration menu from Store--> + <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES"/> + <waitForPageLoad stepKey="waitForConfiguration"/> + <click selector="{{AdminMenuSection.configuration}}" stepKey="clickOnConfigurations"/> + <waitForPageLoad stepKey="waitForSales"/> + + <!--Double click the same to fix flaky issue with redirection to Dashboard--> + <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES1"/> + <waitForPageLoad stepKey="waitForConfiguration1"/> + <click selector="{{AdminMenuSection.configuration}}" stepKey="clickOnConfigurations1"/> + <waitForPageLoad stepKey="waitForSales1" time="5"/> + + <!--Change default tax class for Shipping on Taxable Goods--> + <click selector="{{ConfigurationListSection.sales}}" stepKey="clickOnSales"/> + <waitForPageLoad stepKey="waitForPaymentMethods"/> + <click selector="{{AdminConfigureTaxSection.salesTax}}" stepKey="clickOnTax"/> + <waitForPageLoad stepKey="waitForTax"/> + <seeInCurrentUrl url="{{AdminTaxConfigurationPage.url}}" stepKey="adminTaxConfiguration"/> + <seeElement selector="{{AdminConfigureTaxSection.taxClasses}}" stepKey="taxClassSectionC"/> + <click selector="{{AdminConfigureTaxSection.taxClasses}}" stepKey="openTaxClassSection"/> + <click selector="{{AdminConfigureTaxSection.taxShippingClassSystem}}" stepKey="uncheckSystemValue"/> + <selectOption selector="{{AdminConfigureTaxSection.taxClassShipping}}" userInput="Taxable Goods" stepKey="setTaxClassForShipping"/> + + <!-- Save the settings --> + <scrollToTopOfPage stepKey="scrollToTop"/> + <click stepKey="saveTaxOptions" selector="{{AdminCategoryMainActionsSection.SaveButton}}"/> + <waitForPageLoad stepKey="waitForTaxSaved"/> + <see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/ChangeToDefaultTaxConfigurationUIActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/ChangeToDefaultTaxConfigurationUIActionGroup.xml new file mode 100644 index 0000000000000..c93d4187cafa6 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/ActionGroup/ChangeToDefaultTaxConfigurationUIActionGroup.xml @@ -0,0 +1,55 @@ +<?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="ChangeToDefaultTaxConfigurationUIActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'Tax'. Set the Tax Configuration Settings to the Default values. Clicks on Save. Validates that the Success Message is present and correct.</description> + </annotations> + + <!-- navigate to the tax configuration page --> + <amOnPage url="{{AdminTaxConfigurationPage.url}}" stepKey="goToAdminTaxPage"/> + <waitForPageLoad stepKey="waitForTaxConfigLoad"/> + + <!-- change the default state to none --> + <!-- conditionalClick twice to fix some flaky behavior --> + <conditionalClick stepKey="clickCalculationSettings" selector="{{AdminConfigureTaxSection.defaultDestination}}" dependentSelector="{{AdminConfigureTaxSection.systemValueDefaultState}}" visible="false"/> + <conditionalClick stepKey="clickCalculationSettingsAgain" selector="{{AdminConfigureTaxSection.defaultDestination}}" dependentSelector="{{AdminConfigureTaxSection.systemValueDefaultState}}" visible="false"/> + <checkOption stepKey="clickDefaultState" selector="{{AdminConfigureTaxSection.systemValueDefaultState}}"/> + <selectOption stepKey="selectDefaultState" selector="{{AdminConfigureTaxSection.dropdownDefaultState}}" userInput="California"/> + <fillField stepKey="fillDefaultPostCode" selector="{{AdminConfigureTaxSection.defaultPostCode}}" userInput=""/> + + <!-- change the options for shopping cart display to not show tax --> + <!-- conditionalClick twice to fix some flaky behavior --> + <conditionalClick stepKey="clickShoppingCartDisplaySettings" selector="{{AdminConfigureTaxSection.shoppingCartDisplay}}" dependentSelector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalCart}}" visible="false"/> + <conditionalClick stepKey="clickShoppingCartDisplaySettingsAgain" selector="{{AdminConfigureTaxSection.shoppingCartDisplay}}" dependentSelector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalCart}}" visible="false"/> + <checkOption stepKey="clickTaxTotalCart" selector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalCart}}"/> + <selectOption stepKey="selectTaxTotalCart" selector="{{AdminConfigureTaxSection.dropdownIncludeTaxTotalCart}}" userInput="Yes"/> + <checkOption stepKey="clickDisplayTaxSummaryCart" selector="{{AdminConfigureTaxSection.systemValueDisplayTaxSummaryCart}}"/> + <selectOption stepKey="selectDisplayTaxSummaryCart" selector="{{AdminConfigureTaxSection.dropdownDisplayTaxSummaryCart}}" userInput="Yes"/> + <checkOption stepKey="clickDisplayZeroTaxCart" selector="{{AdminConfigureTaxSection.systemValueDisplayZeroTaxCart}}"/> + <selectOption stepKey="selectDisplayZeroTaxCart" selector="{{AdminConfigureTaxSection.dropdownDisplayZeroTaxCart}}" userInput="Yes"/> + + <!-- change the options for orders, invoices, credit memos display to not show tax --> + <!-- conditionalClick twice to fix some flaky behavior --> + <conditionalClick stepKey="clickOrdersInvoicesCreditSales" selector="{{AdminConfigureTaxSection.ordersInvoicesCreditSales}}" dependentSelector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalSales}}" visible="false"/> + <conditionalClick stepKey="clickOrdersInvoicesCreditSalesAgain" selector="{{AdminConfigureTaxSection.ordersInvoicesCreditSales}}" dependentSelector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalSales}}" visible="false"/> + <checkOption stepKey="clickTaxTotalSales" selector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalSales}}"/> + <selectOption stepKey="selectTaxTotalSales" selector="{{AdminConfigureTaxSection.dropdownIncludeTaxTotalSales}}" userInput="Yes"/> + <checkOption stepKey="clickDisplayTaxSummarySales" selector="{{AdminConfigureTaxSection.systemValueDisplayTaxSummarySales}}"/> + <selectOption stepKey="selectDisplayTaxSummarySales" selector="{{AdminConfigureTaxSection.dropdownDisplayTaxSummarySales}}" userInput="Yes"/> + <checkOption stepKey="clickDisplayZeroTaxSales" selector="{{AdminConfigureTaxSection.systemValueDisplayZeroTaxSales}}"/> + <selectOption stepKey="selectDisplayZeroTaxSales" selector="{{AdminConfigureTaxSection.dropdownDisplayZeroTaxSales}}" userInput="Yes"/> + + <!-- Save the settings --> + <scrollToTopOfPage stepKey="scrollToTop"/> + <click stepKey="saveTaxOptions" selector="{{AdminCategoryMainActionsSection.SaveButton}}"/> + <see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/DeleteCustomerTaxClassActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/DeleteCustomerTaxClassActionGroup.xml new file mode 100644 index 0000000000000..4507265cab1d0 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/ActionGroup/DeleteCustomerTaxClassActionGroup.xml @@ -0,0 +1,30 @@ +<?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="DeleteCustomerTaxClassActionGroup"> + <annotations> + <description>Goes to the Admin New Tax Rule page. Deletes the provided Tax Class Name.</description> + </annotations> + <arguments> + <argument name="taxClassName" type="string"/> + </arguments> + + <!-- Go to tax rule page --> + <amOnPage url="{{AdminNewTaxRulePage.url}}" stepKey="goToNewTaxRulePage"/> + <waitForPageLoad stepKey="waitForTaxRatePage"/> + <click stepKey="clickAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> + <scrollTo stepKey="scrollToAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> + <moveMouseOver stepKey="hoverDeleteElement" selector="{{AdminTaxRulesSection.deleteTaxClassName(taxClassName)}}"/> + <click stepKey="deleteFirstTaxClass" selector="{{AdminTaxRulesSection.deleteTaxClass(taxClassName)}}"/> + <waitForElementVisible selector="{{AdminTaxRulesSection.popUpDialogOK}}" stepKey="waitForElementBecomeVisible"/> + <click stepKey="acceptPopUpDialog" selector="{{AdminTaxRulesSection.popUpDialogOK}}"/> + <waitForPageLoad stepKey="waitForProductTaxClassDeleted"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/DeleteProductTaxClassActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/DeleteProductTaxClassActionGroup.xml new file mode 100644 index 0000000000000..b365f68318101 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/ActionGroup/DeleteProductTaxClassActionGroup.xml @@ -0,0 +1,30 @@ +<?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="DeleteProductTaxClassActionGroup"> + <annotations> + <description>Goes to the Admin Tax Rule creation page. Deletes the provided Tax Class.</description> + </annotations> + <arguments> + <argument name="taxClassName" type="string"/> + </arguments> + + <!-- Go to tax rule page --> + <amOnPage url="{{AdminNewTaxRulePage.url}}" stepKey="goToNewTaxRulePage"/> + <waitForPageLoad stepKey="waitForTaxRatePage"/> + <click stepKey="clickAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> + <scrollTo stepKey="scrollToAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> + <moveMouseOver stepKey="hoverDeleteElement" selector="{{AdminTaxRulesSection.deleteTaxClassName(taxClassName)}}"/> + <click stepKey="deleteFirstTaxClass" selector="{{AdminTaxRulesSection.deleteTaxClass(taxClassName)}}"/> + <waitForElementVisible selector="{{AdminTaxRulesSection.popUpDialogOK}}" stepKey="waitForElementBecomeVisible"/> + <click stepKey="acceptPopUpDialog" selector="{{AdminTaxRulesSection.popUpDialogOK}}"/> + <waitForPageLoad stepKey="waitForProductTaxClassDeleted"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/EditTaxConfigurationByUIActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/EditTaxConfigurationByUIActionGroup.xml new file mode 100644 index 0000000000000..da56a305d0e94 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/ActionGroup/EditTaxConfigurationByUIActionGroup.xml @@ -0,0 +1,62 @@ +<?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="EditTaxConfigurationByUIActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'Tax'. Enables the display of Taxes in the Storefront Shopping Cart and Checkout page.</description> + </annotations> + + <!-- navigate to the tax configuration page --> + <amOnPage url="{{AdminTaxConfigurationPage.url}}" stepKey="goToAdminTaxPage"/> + <waitForPageLoad stepKey="waitForTaxConfigLoad"/> + + <!-- change the default state to California --> + <scrollTo selector="#tax_defaults-head" x="0" y="-80" stepKey="scrollToTaxDefaults"/> + + <!-- conditionalClick twice to fix some flaky behavior --> + <conditionalClick stepKey="clickCalculationSettings" selector="{{AdminConfigureTaxSection.defaultDestination}}" dependentSelector="#tax_defaults" visible="false"/> + <conditionalClick stepKey="clickCalculationSettingsAgain" selector="{{AdminConfigureTaxSection.defaultDestination}}" dependentSelector="#tax_defaults" visible="false"/> + <uncheckOption stepKey="clickDefaultState" selector="{{AdminConfigureTaxSection.systemValueDefaultState}}"/> + <selectOption stepKey="selectDefaultState" selector="{{AdminConfigureTaxSection.dropdownDefaultState}}" userInput="California"/> + <fillField stepKey="fillDefaultPostCode" selector="{{AdminConfigureTaxSection.defaultPostCode}}" userInput="*"/> + + <!-- change the options for shopping cart display to show tax --> + <scrollTo selector="#tax_cart_display-head" x="0" y="-80" stepKey="scrollToTaxShoppingCartDisplay"/> + + <!-- conditionalClick twice to fix some flaky behavior --> + <conditionalClick stepKey="clickShoppingCartDisplaySettings" selector="{{AdminConfigureTaxSection.shoppingCartDisplay}}" dependentSelector="#tax_cart_display" visible="false"/> + <conditionalClick stepKey="clickShoppingCartDisplaySettingsAgain" selector="{{AdminConfigureTaxSection.shoppingCartDisplay}}" dependentSelector="#tax_cart_display" visible="false"/> + <uncheckOption stepKey="clickTaxTotalCart" selector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalCart}}"/> + <selectOption stepKey="selectTaxTotalCart" selector="{{AdminConfigureTaxSection.dropdownIncludeTaxTotalCart}}" userInput="Yes"/> + <uncheckOption stepKey="clickDisplayTaxSummaryCart" selector="{{AdminConfigureTaxSection.systemValueDisplayTaxSummaryCart}}"/> + <selectOption stepKey="selectDisplayTaxSummaryCart" selector="{{AdminConfigureTaxSection.dropdownDisplayTaxSummaryCart}}" userInput="Yes"/> + <uncheckOption stepKey="clickDisplayZeroTaxCart" selector="{{AdminConfigureTaxSection.systemValueDisplayZeroTaxCart}}"/> + <selectOption stepKey="selectDisplayZeroTaxCart" selector="{{AdminConfigureTaxSection.dropdownDisplayZeroTaxCart}}" userInput="Yes"/> + + <!-- change the options for orders, invoices, credit memos display to show tax --> + <scrollTo selector="#tax_sales_display-head" x="0" y="-80" stepKey="scrollToTaxSalesDisplay"/> + + <!-- conditionalClick twice to fix some flaky behavior --> + <conditionalClick stepKey="clickOrdersInvoicesCreditSales" selector="{{AdminConfigureTaxSection.ordersInvoicesCreditSales}}" dependentSelector="#tax_sales_display" visible="false"/> + <conditionalClick stepKey="clickOrdersInvoicesCreditSalesAgain" selector="{{AdminConfigureTaxSection.ordersInvoicesCreditSales}}" dependentSelector="#tax_sales_display" visible="false"/> + <uncheckOption stepKey="clickTaxTotalSales" selector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalSales}}"/> + <selectOption stepKey="selectTaxTotalSales" selector="{{AdminConfigureTaxSection.dropdownIncludeTaxTotalSales}}" userInput="Yes"/> + <uncheckOption stepKey="clickDisplayTaxSummarySales" selector="{{AdminConfigureTaxSection.systemValueDisplayTaxSummarySales}}"/> + <selectOption stepKey="selectDisplayTaxSummarySales" selector="{{AdminConfigureTaxSection.dropdownDisplayTaxSummarySales}}" userInput="Yes"/> + <uncheckOption stepKey="clickDisplayZeroTaxSales" selector="{{AdminConfigureTaxSection.systemValueDisplayZeroTaxSales}}"/> + <selectOption stepKey="selectDisplayZeroTaxSales" selector="{{AdminConfigureTaxSection.dropdownDisplayZeroTaxSales}}" userInput="Yes"/> + + <!-- Save the settings --> + <scrollToTopOfPage stepKey="scrollToTop"/> + <click stepKey="saveTaxOptions" selector="{{AdminCategoryMainActionsSection.SaveButton}}"/> + <waitForPageLoad stepKey="waitForTaxSaved"/> + <see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/SetDefaultShippingTaxClassActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/SetDefaultShippingTaxClassActionGroup.xml new file mode 100644 index 0000000000000..25e2b2d376151 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/ActionGroup/SetDefaultShippingTaxClassActionGroup.xml @@ -0,0 +1,43 @@ +<?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="SetDefaultShippingTaxClassActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page via the Admin Side Menu. Sets the 'Tax Class for Shipping' to the System Default. Clicks on Save. Validates that the Success Message is present and correct.</description> + </annotations> + + <!--Select Configuration menu from Store--> + <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES"/> + <waitForPageLoad stepKey="waitForConfiguration"/> + <click selector="{{AdminMenuSection.configuration}}" stepKey="clickOnConfigurations"/> + <waitForPageLoad stepKey="waitForSales"/> + + <!--Double click the same to fix flaky issue with redirection to Dashboard--> + <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES1"/> + <waitForPageLoad stepKey="waitForConfiguration1"/> + <click selector="{{AdminMenuSection.configuration}}" stepKey="clickOnConfigurations1"/> + <waitForPageLoad stepKey="waitForSales1"/> + + <!--Change default tax class for Shipping on Taxable Goods--> + <click selector="{{ConfigurationListSection.sales}}" stepKey="clickOnSales"/> + <waitForPageLoad stepKey="waitForPaymentMethods"/> + <click selector="{{AdminConfigureTaxSection.salesTax}}" stepKey="clickOnTax"/> + <waitForPageLoad stepKey="waitForTax"/> + <seeElement selector="{{AdminConfigureTaxSection.taxClasses}}" stepKey="taxClassSectionC"/> + <click selector="{{AdminConfigureTaxSection.taxShippingClassSystem}}" stepKey="checkSystemDefaultValue"/> + <click selector="{{AdminConfigureTaxSection.taxClasses}}" stepKey="closeTaxClassSection"/> + + <!-- Save the settings --> + <scrollToTopOfPage stepKey="scrollToTop"/> + <click stepKey="saveTaxOptions" selector="{{AdminCategoryMainActionsSection.SaveButton}}"/> + <waitForPageLoad stepKey="waitForTaxSaved"/> + <see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxReportGridTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxReportGridTest.xml index 628d189823a52..98f5401066063 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxReportGridTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxReportGridTest.xml @@ -25,11 +25,11 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!-- Go to tax rule page --> - <actionGroup ref="addNewTaxRuleActionGroup" stepKey="addFirstTaxRuleActionGroup"/> + <actionGroup ref="AddNewTaxRuleActionGroup" stepKey="addFirstTaxRuleActionGroup"/> <fillField stepKey="fillRuleName" selector="{{AdminTaxRulesSection.ruleName}}" userInput="TaxRule1"/> <!-- Add NY and CA tax rules --> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addNYTaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addNYTaxRate"> <argument name="taxCode" value="SimpleTaxWithZipCode"/> </actionGroup> @@ -43,10 +43,10 @@ <waitForPageLoad stepKey="waitForNewTaxRuleCreated"/> <!-- Go to tax rule page to create second Tax Rule--> - <actionGroup ref="addNewTaxRuleActionGroup" stepKey="addSecondTaxRuleActionGroup"/> + <actionGroup ref="AddNewTaxRuleActionGroup" stepKey="addSecondTaxRuleActionGroup"/> <fillField stepKey="fillSecondRuleName" selector="{{AdminTaxRulesSection.ruleName}}" userInput="TaxRule2"/> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addCATaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addCATaxRate"> <argument name="taxCode" value="SimpleSecondTaxWithZipCode"/> </actionGroup> @@ -211,11 +211,11 @@ <deleteData createDataKey="secondProduct" stepKey="deleteSecondProduct"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> - <actionGroup ref="deleteProductTaxClass" stepKey="deleteFirstProductTaxClass"> + <actionGroup ref="DeleteProductTaxClassActionGroup" stepKey="deleteFirstProductTaxClass"> <argument name="taxClassName" value="TaxClasses1"/> </actionGroup> - <actionGroup ref="deleteProductTaxClass" stepKey="deleteSecondProductTaxClass"> + <actionGroup ref="DeleteProductTaxClassActionGroup" stepKey="deleteSecondProductTaxClass"> <argument name="taxClassName" value="TaxClasses2"/> </actionGroup> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/CheckCreditMemoTotalsTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/CheckCreditMemoTotalsTest.xml index 38cc687ff53a4..1bc1134f58163 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/CheckCreditMemoTotalsTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/CheckCreditMemoTotalsTest.xml @@ -95,7 +95,7 @@ <argument name="name" value="{{SimpleTaxNY.state}}"/> <argument name="searchInput" value="{{AdminSecondaryGridSection.taxIdentifierSearch}}"/> </actionGroup> - <actionGroup ref="deleteProductTaxClass" stepKey="deleteFirstProductTaxClass"> + <actionGroup ref="DeleteProductTaxClassActionGroup" stepKey="deleteFirstProductTaxClass"> <argument name="taxClassName" value="NewTaxClass"/> </actionGroup> <!--logout--> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest.xml index 05ced7e61b3b7..33b82b3d0464f 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest.xml @@ -23,7 +23,7 @@ <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> <!-- Fill in rules to display tax in the cart --> - <actionGroup ref="editTaxConfigurationByUI" stepKey="fillDefaultTaxForms"/> + <actionGroup ref="EditTaxConfigurationByUIActionGroup" stepKey="fillDefaultTaxForms"/> <!-- Go to tax rule page --> <amOnPage url="{{AdminTaxRuleGridPage.url}}" stepKey="goToTaxRulePage"/> @@ -32,11 +32,11 @@ <fillField stepKey="fillRuleName" selector="{{AdminTaxRulesSection.ruleName}}" userInput="SampleRule"/> <!-- Add NY and CA tax rules --> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addNYTaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addNYTaxRate"> <argument name="taxCode" value="SimpleTaxNY"/> </actionGroup> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addCATaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addCATaxRate"> <argument name="taxCode" value="SimpleTaxCA"/> </actionGroup> @@ -76,7 +76,7 @@ </actionGroup> <!-- Ensure tax won't be shown in the cart --> - <actionGroup ref="changeToDefaultTaxConfigurationUI" stepKey="changeToDefaultTaxConfiguration"/> + <actionGroup ref="ChangeToDefaultTaxConfigurationUIActionGroup" stepKey="changeToDefaultTaxConfiguration"/> <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> <deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/> @@ -141,7 +141,7 @@ <createData entity="VirtualProduct" stepKey="virtualProduct1"/> <!-- Fill in rules to display tax in the cart --> - <actionGroup ref="editTaxConfigurationByUI" stepKey="fillDefaultTaxForms"/> + <actionGroup ref="EditTaxConfigurationByUIActionGroup" stepKey="fillDefaultTaxForms"/> <!-- Go to tax rule page --> <amOnPage url="{{AdminTaxRuleGridPage.url}}" stepKey="goToTaxRulePage"/> @@ -150,11 +150,11 @@ <fillField stepKey="fillRuleName" selector="{{AdminTaxRulesSection.ruleName}}" userInput="SampleRule"/> <!-- Add NY and CA tax rules --> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addNYTaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addNYTaxRate"> <argument name="taxCode" value="SimpleTaxNY"/> </actionGroup> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addCATaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addCATaxRate"> <argument name="taxCode" value="SimpleTaxCA"/> </actionGroup> @@ -194,7 +194,7 @@ </actionGroup> <!-- Ensure tax won't be shown in the cart --> - <actionGroup ref="changeToDefaultTaxConfigurationUI" stepKey="changeToDefaultTaxConfiguration"/> + <actionGroup ref="ChangeToDefaultTaxConfigurationUIActionGroup" stepKey="changeToDefaultTaxConfiguration"/> <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> <deleteData createDataKey="virtualProduct1" stepKey="deleteVirtualProduct1"/> @@ -257,7 +257,7 @@ <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> <!-- Fill in rules to display tax in the cart --> - <actionGroup ref="editTaxConfigurationByUI" stepKey="fillDefaultTaxForms"/> + <actionGroup ref="EditTaxConfigurationByUIActionGroup" stepKey="fillDefaultTaxForms"/> <!-- Go to tax rule page --> <amOnPage url="{{AdminTaxRuleGridPage.url}}" stepKey="goToTaxRulePage"/> @@ -266,11 +266,11 @@ <fillField stepKey="fillRuleName" selector="{{AdminTaxRulesSection.ruleName}}" userInput="SampleRule"/> <!-- Add NY and CA tax rules --> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addNYTaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addNYTaxRate"> <argument name="taxCode" value="SimpleTaxNY"/> </actionGroup> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addCATaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addCATaxRate"> <argument name="taxCode" value="SimpleTaxCA"/> </actionGroup> @@ -301,7 +301,7 @@ </actionGroup> <!-- Ensure tax won't be shown in the cart --> - <actionGroup ref="changeToDefaultTaxConfigurationUI" stepKey="changeToDefaultTaxConfiguration"/> + <actionGroup ref="ChangeToDefaultTaxConfigurationUIActionGroup" stepKey="changeToDefaultTaxConfiguration"/> <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> <deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/> @@ -367,7 +367,7 @@ <createData entity="VirtualProduct" stepKey="virtualProduct1"/> <!-- Fill in rules to display tax in the cart --> - <actionGroup ref="editTaxConfigurationByUI" stepKey="fillDefaultTaxForms"/> + <actionGroup ref="EditTaxConfigurationByUIActionGroup" stepKey="fillDefaultTaxForms"/> <!-- Go to tax rule page --> <amOnPage url="{{AdminTaxRuleGridPage.url}}" stepKey="goToTaxRulePage"/> @@ -376,11 +376,11 @@ <fillField stepKey="fillRuleName" selector="{{AdminTaxRulesSection.ruleName}}" userInput="SampleRule"/> <!-- Add NY and CA tax rules --> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addNYTaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addNYTaxRate"> <argument name="taxCode" value="SimpleTaxNY"/> </actionGroup> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addCATaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addCATaxRate"> <argument name="taxCode" value="SimpleTaxCA"/> </actionGroup> @@ -411,7 +411,7 @@ </actionGroup> <!-- Ensure tax won't be shown in the cart --> - <actionGroup ref="changeToDefaultTaxConfigurationUI" stepKey="changeToDefaultTaxConfiguration"/> + <actionGroup ref="ChangeToDefaultTaxConfigurationUIActionGroup" stepKey="changeToDefaultTaxConfiguration"/> <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> <deleteData createDataKey="virtualProduct1" stepKey="deleteVirtualProduct1"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest.xml index e7bf08257ea69..e0e411a04d484 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest.xml @@ -23,7 +23,7 @@ <createData entity="VirtualProduct" stepKey="virtualProduct1"/> <!-- Fill in rules to display tax in the cart --> - <actionGroup ref="editTaxConfigurationByUI" stepKey="fillDefaultTaxForms"/> + <actionGroup ref="EditTaxConfigurationByUIActionGroup" stepKey="fillDefaultTaxForms"/> <!-- Go to tax rule page --> <amOnPage url="{{AdminTaxRuleGridPage.url}}" stepKey="goToTaxRulePage"/> @@ -32,11 +32,11 @@ <fillField stepKey="fillRuleName" selector="{{AdminTaxRulesSection.ruleName}}" userInput="SampleRule"/> <!-- Add NY and CA tax rules --> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addNYTaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addNYTaxRate"> <argument name="taxCode" value="SimpleTaxNY"/> </actionGroup> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addCATaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addCATaxRate"> <argument name="taxCode" value="SimpleTaxCA"/> </actionGroup> @@ -67,7 +67,7 @@ </actionGroup> <!-- Ensure tax won't be shown in the cart --> - <actionGroup ref="changeToDefaultTaxConfigurationUI" stepKey="changeToDefaultTaxConfiguration"/> + <actionGroup ref="ChangeToDefaultTaxConfigurationUIActionGroup" stepKey="changeToDefaultTaxConfiguration"/> <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> <deleteData createDataKey="virtualProduct1" stepKey="deleteVirtualProduct1"/> @@ -127,7 +127,7 @@ <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> <!-- Fill in rules to display tax in the cart --> - <actionGroup ref="editTaxConfigurationByUI" stepKey="fillDefaultTaxForms"/> + <actionGroup ref="EditTaxConfigurationByUIActionGroup" stepKey="fillDefaultTaxForms"/> <!-- Go to tax rule page --> <amOnPage url="{{AdminTaxRuleGridPage.url}}" stepKey="goToTaxRulePage"/> @@ -136,11 +136,11 @@ <fillField stepKey="fillRuleName" selector="{{AdminTaxRulesSection.ruleName}}" userInput="SampleRule"/> <!-- Add NY and CA tax rules --> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addNYTaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addNYTaxRate"> <argument name="taxCode" value="SimpleTaxNY"/> </actionGroup> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addCATaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addCATaxRate"> <argument name="taxCode" value="SimpleTaxCA"/> </actionGroup> @@ -180,7 +180,7 @@ </actionGroup> <!-- Ensure tax won't be shown in the cart --> - <actionGroup ref="changeToDefaultTaxConfigurationUI" stepKey="changeToDefaultTaxConfiguration"/> + <actionGroup ref="ChangeToDefaultTaxConfigurationUIActionGroup" stepKey="changeToDefaultTaxConfiguration"/> <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> <deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/> @@ -247,7 +247,7 @@ <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> <!-- Fill in rules to display tax in the cart --> - <actionGroup ref="editTaxConfigurationByUI" stepKey="fillDefaultTaxForms"/> + <actionGroup ref="EditTaxConfigurationByUIActionGroup" stepKey="fillDefaultTaxForms"/> <!-- Go to tax rule page --> <amOnPage url="{{AdminTaxRuleGridPage.url}}" stepKey="goToTaxRulePage"/> @@ -256,11 +256,11 @@ <fillField stepKey="fillRuleName" selector="{{AdminTaxRulesSection.ruleName}}" userInput="SampleRule"/> <!-- Add NY and CA tax rules --> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addNYTaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addNYTaxRate"> <argument name="taxCode" value="SimpleTaxNY"/> </actionGroup> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addCATaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addCATaxRate"> <argument name="taxCode" value="SimpleTaxCA"/> </actionGroup> @@ -291,7 +291,7 @@ </actionGroup> <!-- Ensure tax won't be shown in the cart --> - <actionGroup ref="changeToDefaultTaxConfigurationUI" stepKey="changeToDefaultTaxConfiguration"/> + <actionGroup ref="ChangeToDefaultTaxConfigurationUIActionGroup" stepKey="changeToDefaultTaxConfiguration"/> <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> <deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/> @@ -362,7 +362,7 @@ <createData entity="VirtualProduct" stepKey="virtualProduct1"/> <!-- Fill in rules to display tax in the cart --> - <actionGroup ref="editTaxConfigurationByUI" stepKey="fillDefaultTaxForms"/> + <actionGroup ref="EditTaxConfigurationByUIActionGroup" stepKey="fillDefaultTaxForms"/> <!-- Go to tax rule page --> <amOnPage url="{{AdminTaxRuleGridPage.url}}" stepKey="goToTaxRulePage"/> @@ -371,11 +371,11 @@ <fillField stepKey="fillRuleName" selector="{{AdminTaxRulesSection.ruleName}}" userInput="SampleRule"/> <!-- Add NY and CA tax rules --> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addNYTaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addNYTaxRate"> <argument name="taxCode" value="SimpleTaxNY"/> </actionGroup> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addCATaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addCATaxRate"> <argument name="taxCode" value="SimpleTaxCA"/> </actionGroup> @@ -415,7 +415,7 @@ </actionGroup> <!-- Ensure tax won't be shown in the cart --> - <actionGroup ref="changeToDefaultTaxConfigurationUI" stepKey="changeToDefaultTaxConfiguration"/> + <actionGroup ref="ChangeToDefaultTaxConfigurationUIActionGroup" stepKey="changeToDefaultTaxConfiguration"/> <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> <deleteData createDataKey="virtualProduct1" stepKey="deleteVirtualProduct1"/> From 31a2890341cce1c66ace8d808288a5ca309129c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 14:59:57 +0100 Subject: [PATCH 119/586] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- .../AddSwatchToProductActionGroup.xml | 132 ------------------ .../AddTextSwatchToProductActionGroup.xml | 46 ++++++ .../AddVisualSwatchToProductActionGroup.xml | 66 +++++++++ ...ProductWithStorefrontConfigActionGroup.xml | 31 ++++ ...torefrontPreviewImageConfigActionGroup.xml | 19 +++ ...dSwatchOptionAndFillFieldsActionGroup.xml} | 10 -- ...inUpdateProductPreviewImageActionGroup.xml | 17 +++ ...AssertStorefrontSwatchColorActionGroup.xml | 26 ++++ .../AssertSwatchColorActionGroup.xml | 26 ++++ .../ActionGroup/ColorPickerActionGroup.xml | 68 --------- .../OpenSwatchMenuByIndexActionGroup.xml | 22 +++ .../SetColorPickerByHexActionGroup.xml | 24 ++++ ...roductWithSwatchesToTheCartActionGroup.xml | 21 +++ ...rontAssertSwatchOptionPriceActionGroup.xml | 19 +++ .../StorefrontProductActionGroup.xml | 34 ----- ...ctSwatchOptionOnProductPageActionGroup.xml | 18 +++ ...nOnProductPageAndCheckImageActionGroup.xml | 17 +++ ...gurableProductWithSwatchesActionGroup.xml} | 18 +-- .../Mftf/Test/AdminCreateImageSwatchTest.xml | 6 +- .../Mftf/Test/AdminCreateVisualSwatchTest.xml | 24 ++-- ...ateVisualSwatchWithNonValidOptionsTest.xml | 14 +- .../Test/AdminDisablingSwatchTooltipsTest.xml | 8 +- ...uctWithAttributesImagesAndSwatchesTest.xml | 6 +- ...figurableProductSwatchMinimumPriceTest.xml | 6 +- ...nChangeProductOptionsUsingSwatchesTest.xml | 2 +- .../StorefrontFilterByImageSwatchTest.xml | 4 +- .../StorefrontFilterByVisualSwatchTest.xml | 8 +- ...oductImagesMatchingProductSwatchesTest.xml | 4 +- 28 files changed, 396 insertions(+), 300 deletions(-) delete mode 100644 app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddSwatchToProductActionGroup.xml create mode 100644 app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddTextSwatchToProductActionGroup.xml create mode 100644 app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddVisualSwatchToProductActionGroup.xml create mode 100644 app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddVisualSwatchToProductWithStorefrontConfigActionGroup.xml create mode 100644 app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddVisualSwatchWithProductWithStorefrontPreviewImageConfigActionGroup.xml rename app/code/Magento/Swatches/Test/Mftf/ActionGroup/{AdminEditPropertiesTabForSwatchProductAtributeActionGroup.xml => AdminAddSwatchOptionAndFillFieldsActionGroup.xml} (72%) create mode 100644 app/code/Magento/Swatches/Test/Mftf/ActionGroup/AdminUpdateProductPreviewImageActionGroup.xml create mode 100644 app/code/Magento/Swatches/Test/Mftf/ActionGroup/AssertStorefrontSwatchColorActionGroup.xml create mode 100644 app/code/Magento/Swatches/Test/Mftf/ActionGroup/AssertSwatchColorActionGroup.xml delete mode 100644 app/code/Magento/Swatches/Test/Mftf/ActionGroup/ColorPickerActionGroup.xml create mode 100644 app/code/Magento/Swatches/Test/Mftf/ActionGroup/OpenSwatchMenuByIndexActionGroup.xml create mode 100644 app/code/Magento/Swatches/Test/Mftf/ActionGroup/SetColorPickerByHexActionGroup.xml create mode 100644 app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontAddProductWithSwatchesToTheCartActionGroup.xml create mode 100644 app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontAssertSwatchOptionPriceActionGroup.xml delete mode 100644 app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontProductActionGroup.xml create mode 100644 app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontSelectSwatchOptionOnProductPageActionGroup.xml create mode 100644 app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontSelectSwatchOptionOnProductPageAndCheckImageActionGroup.xml rename app/code/Magento/Swatches/Test/Mftf/ActionGroup/{StorefrontAddProductWithSwatchAttributeToTheCartActionGroup.xml => StorefrontUpdateCartConfigurableProductWithSwatchesActionGroup.xml} (54%) diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddSwatchToProductActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddSwatchToProductActionGroup.xml deleted file mode 100644 index 4a67c0dfbe8e4..0000000000000 --- a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddSwatchToProductActionGroup.xml +++ /dev/null @@ -1,132 +0,0 @@ -<?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="AddVisualSwatchToProductActionGroup"> - <annotations> - <description>Adds the provided Visual Swatch Attribute and Options (2) to a Product on the Admin Product creation/edit page. Clicks on Save. Validates that the Success Message is present.</description> - </annotations> - <arguments> - <argument name="attribute" defaultValue="visualSwatchAttribute"/> - <argument name="option1" defaultValue="visualSwatchOption1"/> - <argument name="option2" defaultValue="visualSwatchOption2"/> - </arguments> - - <seeInCurrentUrl url="{{ProductCatalogPage.url}}" stepKey="seeOnProductEditPage"/> - <conditionalClick selector="{{AdminProductFormConfigurationsSection.sectionHeader}}" dependentSelector="{{AdminProductFormConfigurationsSection.createConfigurations}}" visible="false" stepKey="openConfigurationSection"/> - <click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="openConfigurationPanel"/> - <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" stepKey="waitForSlideOut"/> - <click selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" stepKey="clickCreateNewAttribute"/> - <waitForPageLoad stepKey="waitForIFrame"/> - - <switchToIFrame selector="{{AdminNewAttributePanel.newAttributeIFrame}}" stepKey="switchToNewAttributeIFrame"/> - <fillField selector="{{AdminNewAttributePanel.defaultLabel}}" userInput="{{attribute.default_label}}" stepKey="fillDefaultLabel"/> - <selectOption selector="{{AdminNewAttributePanel.inputType}}" userInput="{{attribute.input_type}}" stepKey="selectInputType"/> - <!--Add swatch options--> - <click selector="{{AdminNewAttributePanel.addVisualSwatchOption}}" stepKey="clickAddSwatch1"/> - <waitForElementVisible selector="{{AdminNewAttributePanel.visualSwatchOptionAdminValue('0')}}" stepKey="waitForOption1Row"/> - <fillField selector="{{AdminNewAttributePanel.visualSwatchOptionAdminValue('0')}}" userInput="{{option1.admin_label}}" stepKey="fillAdminLabel1"/> - <fillField selector="{{AdminNewAttributePanel.visualSwatchOptionDefaultStoreValue('0')}}" userInput="{{option1.default_label}}" stepKey="fillDefaultStoreLabel1"/> - <click selector="{{AdminNewAttributePanel.addVisualSwatchOption}}" stepKey="clickAddSwatch2"/> - <waitForElementVisible selector="{{AdminNewAttributePanel.visualSwatchOptionAdminValue('1')}}" stepKey="waitForOption2Row"/> - <fillField selector="{{AdminNewAttributePanel.visualSwatchOptionAdminValue('1')}}" userInput="{{option2.admin_label}}" stepKey="fillAdminLabel2"/> - <fillField selector="{{AdminNewAttributePanel.visualSwatchOptionDefaultStoreValue('1')}}" userInput="{{option2.default_label}}" stepKey="fillDefaultStoreLabel2"/> - - <!--Save attribute--> - <click selector="{{AdminNewAttributePanel.saveAttribute}}" stepKey="clickOnNewAttributePanel"/> - <waitForPageLoad stepKey="waitForSaveAttribute"/> - <switchToIFrame stepKey="switchOutOfIFrame"/> - - <!--Find attribute in grid and select--> - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingFilters"/> - <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="clickOnFilters"/> - <fillField selector="{{AdminDataGridHeaderSection.attributeCodeFilterInput}}" userInput="{{attribute.default_label}}" stepKey="fillFilterAttributeCodeField"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFiltersButton"/> - <click selector="{{AdminDataGridTableSection.rowCheckbox('1')}}" stepKey="clickOnFirstCheckbox"/> - - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextStep1"/> - - <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(attribute.default_label)}}" stepKey="clickSelectAll"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextStep2"/> - - <click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickOnApplySingleQuantityToEachSku"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="100" stepKey="enterAttributeQuantity"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextStep3"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="generateProducts"/> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct"/> - <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> - <seeElement selector="{{AdminMessagesSection.success}}" stepKey="seeSaveProductMessage"/> - </actionGroup> - - <actionGroup name="AddVisualSwatchToProductWithStorefrontConfigActionGroup" extends="AddVisualSwatchToProductActionGroup"> - <annotations> - <description>EXTENDS: AddVisualSwatchToProductActionGroup. Add the provided Visual Swatch Attribute and Options (2) to a Product with Storefront Configurations.</description> - </annotations> - <arguments> - <argument name="attribute" defaultValue="visualSwatchAttribute"/> - <argument name="option1" defaultValue="visualSwatchOption1"/> - <argument name="option2" defaultValue="visualSwatchOption2"/> - </arguments> - - <!-- Go to Storefront Properties tab --> - <click selector="{{AdminNewAttributePanel.storefrontPropertiesTab}}" stepKey="goToStorefrontPropertiesTab" after="fillDefaultStoreLabel2"/> - <waitForElementVisible selector="{{AdminNewAttributePanel.storefrontPropertiesTitle}}" stepKey="waitTabLoad" after="goToStorefrontPropertiesTab"/> - <selectOption selector="{{AdminNewAttributePanel.useInSearch}}" stepKey="switchOnUsInSearch" userInput="Yes" after="waitTabLoad"/> - <selectOption selector="{{AdminNewAttributePanel.visibleInAdvancedSearch}}" stepKey="switchOnVisibleInAdvancedSearch" userInput="Yes" after="switchOnUsInSearch"/> - <selectOption selector="{{AdminNewAttributePanel.comparableOnStorefront}}" stepKey="switchOnComparableOnStorefront" userInput="Yes" after="switchOnVisibleInAdvancedSearch"/> - <selectOption selector="{{AdminNewAttributePanel.useInLayeredNavigation}}" stepKey="selectUseInLayer" userInput="Filterable (with results)" after="switchOnComparableOnStorefront"/> - <selectOption selector="{{AdminNewAttributePanel.visibleOnCatalogPagesOnStorefront}}" stepKey="switchOnVisibleOnCatalogPagesOnStorefront" userInput="Yes" after="selectUseInLayer"/> - <selectOption selector="{{AdminNewAttributePanel.useInProductListing}}" stepKey="switchOnUsedInProductListing" userInput="Yes" after="switchOnVisibleOnCatalogPagesOnStorefront"/> - </actionGroup> - - <actionGroup name="AddVisualSwatchWithProductWithStorefrontPreviewImageConfigActionGroup" extends="AddVisualSwatchToProductActionGroup"> - <selectOption selector="{{AdminNewAttributePanel.updateProductPreviewImage}}" userInput="Yes" stepKey="selectUpdatePreviewImage" after="selectInputType"/> - <click selector="{{AdminNewAttributePanel.storefrontPropertiesTab}}" stepKey="goToStorefrontPropertiesTab" after="fillDefaultStoreLabel2"/> - <waitForElementVisible selector="{{AdminNewAttributePanel.storefrontPropertiesTitle}}" after="goToStorefrontPropertiesTab" stepKey="waitTabLoad"/> - <selectOption selector="{{AdminNewAttributePanel.useInLayeredNavigation}}" userInput="Filterable (with results)" stepKey="selectUseInLayer" after="waitTabLoad"/> - <selectOption selector="{{AdminNewAttributePanel.useInProductListing}}" userInput="Yes" stepKey="switchOnUsedInProductListing" after="selectUseInLayer"/> - <selectOption selector="{{AdminNewAttributePanel.usedForStoringInProductListing}}" userInput="Yes" stepKey="switchOnUsedForStoringInProductListing" after="switchOnUsedInProductListing"/> - </actionGroup> - - <actionGroup name="AddTextSwatchToProductActionGroup"> - <annotations> - <description>Add text swatch property attribute.</description> - </annotations> - <arguments> - <argument name="attributeName" defaultValue="{{textSwatchAttribute.default_label}}" type="string"/> - <argument name="attributeCode" defaultValue="{{textSwatchAttribute.attribute_code}}" type="string"/> - <argument name="option1" defaultValue="textSwatchOption1" type="string"/> - <argument name="option2" defaultValue="textSwatchOption2" type="string"/> - <argument name="option3" defaultValue="textSwatchOption3" type="string"/> - <argument name="usedInProductListing" defaultValue="No" type="string"/> - </arguments> - - <amOnPage url="{{ProductAttributePage.url}}" stepKey="goToNewProductAttributePage"/> - <waitForPageLoad stepKey="waitForNewProductAttributePage"/> - <fillField selector="{{AttributePropertiesSection.DefaultLabel}}" userInput="{{attributeName}}" stepKey="fillDefaultLabel"/> - <selectOption selector="{{AttributePropertiesSection.InputType}}" userInput="{{textSwatchAttribute.input_type}}" stepKey="selectInputType"/> - <click selector="{{AdminManageSwatchSection.addSwatchText}}" stepKey="clickAddSwatch1"/> - <fillField selector="{{AdminManageSwatchSection.swatchTextByIndex('0')}}" userInput="{{option1}}" stepKey="fillSwatch1"/> - <fillField selector="{{AdminManageSwatchSection.swatchAdminDescriptionByIndex('0')}}" userInput="{{option1}}" stepKey="fillSwatch1Description"/> - <click selector="{{AdminManageSwatchSection.addSwatchText}}" stepKey="clickAddSwatch2"/> - <fillField selector="{{AdminManageSwatchSection.swatchTextByIndex('1')}}" userInput="{{option2}}" stepKey="fillSwatch2"/> - <fillField selector="{{AdminManageSwatchSection.swatchAdminDescriptionByIndex('1')}}" userInput="{{option2}}" stepKey="fillSwatch2Description"/> - <click selector="{{AdminManageSwatchSection.addSwatchText}}" stepKey="clickAddSwatch3"/> - <fillField selector="{{AdminManageSwatchSection.swatchTextByIndex('2')}}" userInput="{{option3}}" stepKey="fillSwatch3"/> - <fillField selector="{{AdminManageSwatchSection.swatchAdminDescriptionByIndex('2')}}" userInput="{{option3}}" stepKey="fillSwatch3Description"/> - <click selector="{{AttributePropertiesSection.AdvancedProperties}}" stepKey="expandAdvancedProperties"/> - <selectOption selector="{{AttributePropertiesSection.Scope}}" userInput="1" stepKey="selectGlobalScope"/> - <fillField selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" userInput="{{attributeCode}}" stepKey="fillAttributeCodeField"/> - <scrollToTopOfPage stepKey="scrollToTabs"/> - <click selector="{{StorefrontPropertiesSection.StoreFrontPropertiesTab}}" stepKey="clickStorefrontPropertiesTab"/> - <waitForElementVisible selector="{{AdvancedAttributePropertiesSection.UseInProductListing}}" stepKey="waitForTabSwitch"/> - <selectOption selector="{{AdvancedAttributePropertiesSection.UseInProductListing}}" userInput="{{usedInProductListing}}" stepKey="useInProductListing"/> - <click selector="{{AttributePropertiesSection.SaveAndEdit}}" stepKey="clickSave"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddTextSwatchToProductActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddTextSwatchToProductActionGroup.xml new file mode 100644 index 0000000000000..97a391137d8e3 --- /dev/null +++ b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddTextSwatchToProductActionGroup.xml @@ -0,0 +1,46 @@ +<?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="AddTextSwatchToProductActionGroup"> + <annotations> + <description>Add text swatch property attribute.</description> + </annotations> + <arguments> + <argument name="attributeName" defaultValue="{{textSwatchAttribute.default_label}}" type="string"/> + <argument name="attributeCode" defaultValue="{{textSwatchAttribute.attribute_code}}" type="string"/> + <argument name="option1" defaultValue="textSwatchOption1" type="string"/> + <argument name="option2" defaultValue="textSwatchOption2" type="string"/> + <argument name="option3" defaultValue="textSwatchOption3" type="string"/> + <argument name="usedInProductListing" defaultValue="No" type="string"/> + </arguments> + + <amOnPage url="{{ProductAttributePage.url}}" stepKey="goToNewProductAttributePage"/> + <waitForPageLoad stepKey="waitForNewProductAttributePage"/> + <fillField selector="{{AttributePropertiesSection.DefaultLabel}}" userInput="{{attributeName}}" stepKey="fillDefaultLabel"/> + <selectOption selector="{{AttributePropertiesSection.InputType}}" userInput="{{textSwatchAttribute.input_type}}" stepKey="selectInputType"/> + <click selector="{{AdminManageSwatchSection.addSwatchText}}" stepKey="clickAddSwatch1"/> + <fillField selector="{{AdminManageSwatchSection.swatchTextByIndex('0')}}" userInput="{{option1}}" stepKey="fillSwatch1"/> + <fillField selector="{{AdminManageSwatchSection.swatchAdminDescriptionByIndex('0')}}" userInput="{{option1}}" stepKey="fillSwatch1Description"/> + <click selector="{{AdminManageSwatchSection.addSwatchText}}" stepKey="clickAddSwatch2"/> + <fillField selector="{{AdminManageSwatchSection.swatchTextByIndex('1')}}" userInput="{{option2}}" stepKey="fillSwatch2"/> + <fillField selector="{{AdminManageSwatchSection.swatchAdminDescriptionByIndex('1')}}" userInput="{{option2}}" stepKey="fillSwatch2Description"/> + <click selector="{{AdminManageSwatchSection.addSwatchText}}" stepKey="clickAddSwatch3"/> + <fillField selector="{{AdminManageSwatchSection.swatchTextByIndex('2')}}" userInput="{{option3}}" stepKey="fillSwatch3"/> + <fillField selector="{{AdminManageSwatchSection.swatchAdminDescriptionByIndex('2')}}" userInput="{{option3}}" stepKey="fillSwatch3Description"/> + <click selector="{{AttributePropertiesSection.AdvancedProperties}}" stepKey="expandAdvancedProperties"/> + <selectOption selector="{{AttributePropertiesSection.Scope}}" userInput="1" stepKey="selectGlobalScope"/> + <fillField selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" userInput="{{attributeCode}}" stepKey="fillAttributeCodeField"/> + <scrollToTopOfPage stepKey="scrollToTabs"/> + <click selector="{{StorefrontPropertiesSection.StoreFrontPropertiesTab}}" stepKey="clickStorefrontPropertiesTab"/> + <waitForElementVisible selector="{{AdvancedAttributePropertiesSection.UseInProductListing}}" stepKey="waitForTabSwitch"/> + <selectOption selector="{{AdvancedAttributePropertiesSection.UseInProductListing}}" userInput="{{usedInProductListing}}" stepKey="useInProductListing"/> + <click selector="{{AttributePropertiesSection.SaveAndEdit}}" stepKey="clickSave"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddVisualSwatchToProductActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddVisualSwatchToProductActionGroup.xml new file mode 100644 index 0000000000000..670c343b609cf --- /dev/null +++ b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddVisualSwatchToProductActionGroup.xml @@ -0,0 +1,66 @@ +<?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="AddVisualSwatchToProductActionGroup"> + <annotations> + <description>Adds the provided Visual Swatch Attribute and Options (2) to a Product on the Admin Product creation/edit page. Clicks on Save. Validates that the Success Message is present.</description> + </annotations> + <arguments> + <argument name="attribute" defaultValue="visualSwatchAttribute"/> + <argument name="option1" defaultValue="visualSwatchOption1"/> + <argument name="option2" defaultValue="visualSwatchOption2"/> + </arguments> + + <seeInCurrentUrl url="{{ProductCatalogPage.url}}" stepKey="seeOnProductEditPage"/> + <conditionalClick selector="{{AdminProductFormConfigurationsSection.sectionHeader}}" dependentSelector="{{AdminProductFormConfigurationsSection.createConfigurations}}" visible="false" stepKey="openConfigurationSection"/> + <click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="openConfigurationPanel"/> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" stepKey="waitForSlideOut"/> + <click selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" stepKey="clickCreateNewAttribute"/> + <waitForPageLoad stepKey="waitForIFrame"/> + + <switchToIFrame selector="{{AdminNewAttributePanel.newAttributeIFrame}}" stepKey="switchToNewAttributeIFrame"/> + <fillField selector="{{AdminNewAttributePanel.defaultLabel}}" userInput="{{attribute.default_label}}" stepKey="fillDefaultLabel"/> + <selectOption selector="{{AdminNewAttributePanel.inputType}}" userInput="{{attribute.input_type}}" stepKey="selectInputType"/> + <!--Add swatch options--> + <click selector="{{AdminNewAttributePanel.addVisualSwatchOption}}" stepKey="clickAddSwatch1"/> + <waitForElementVisible selector="{{AdminNewAttributePanel.visualSwatchOptionAdminValue('0')}}" stepKey="waitForOption1Row"/> + <fillField selector="{{AdminNewAttributePanel.visualSwatchOptionAdminValue('0')}}" userInput="{{option1.admin_label}}" stepKey="fillAdminLabel1"/> + <fillField selector="{{AdminNewAttributePanel.visualSwatchOptionDefaultStoreValue('0')}}" userInput="{{option1.default_label}}" stepKey="fillDefaultStoreLabel1"/> + <click selector="{{AdminNewAttributePanel.addVisualSwatchOption}}" stepKey="clickAddSwatch2"/> + <waitForElementVisible selector="{{AdminNewAttributePanel.visualSwatchOptionAdminValue('1')}}" stepKey="waitForOption2Row"/> + <fillField selector="{{AdminNewAttributePanel.visualSwatchOptionAdminValue('1')}}" userInput="{{option2.admin_label}}" stepKey="fillAdminLabel2"/> + <fillField selector="{{AdminNewAttributePanel.visualSwatchOptionDefaultStoreValue('1')}}" userInput="{{option2.default_label}}" stepKey="fillDefaultStoreLabel2"/> + + <!--Save attribute--> + <click selector="{{AdminNewAttributePanel.saveAttribute}}" stepKey="clickOnNewAttributePanel"/> + <waitForPageLoad stepKey="waitForSaveAttribute"/> + <switchToIFrame stepKey="switchOutOfIFrame"/> + + <!--Find attribute in grid and select--> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingFilters"/> + <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="clickOnFilters"/> + <fillField selector="{{AdminDataGridHeaderSection.attributeCodeFilterInput}}" userInput="{{attribute.default_label}}" stepKey="fillFilterAttributeCodeField"/> + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFiltersButton"/> + <click selector="{{AdminDataGridTableSection.rowCheckbox('1')}}" stepKey="clickOnFirstCheckbox"/> + + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextStep1"/> + + <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(attribute.default_label)}}" stepKey="clickSelectAll"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextStep2"/> + + <click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickOnApplySingleQuantityToEachSku"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="100" stepKey="enterAttributeQuantity"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextStep3"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="generateProducts"/> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> + <seeElement selector="{{AdminMessagesSection.success}}" stepKey="seeSaveProductMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddVisualSwatchToProductWithStorefrontConfigActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddVisualSwatchToProductWithStorefrontConfigActionGroup.xml new file mode 100644 index 0000000000000..71ce5ebd7df30 --- /dev/null +++ b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddVisualSwatchToProductWithStorefrontConfigActionGroup.xml @@ -0,0 +1,31 @@ +<?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="AddVisualSwatchToProductWithStorefrontConfigActionGroup" extends="AddVisualSwatchToProductActionGroup"> + <annotations> + <description>EXTENDS: AddVisualSwatchToProductActionGroup. Add the provided Visual Swatch Attribute and Options (2) to a Product with Storefront Configurations.</description> + </annotations> + <arguments> + <argument name="attribute" defaultValue="visualSwatchAttribute"/> + <argument name="option1" defaultValue="visualSwatchOption1"/> + <argument name="option2" defaultValue="visualSwatchOption2"/> + </arguments> + + <!-- Go to Storefront Properties tab --> + <click selector="{{AdminNewAttributePanel.storefrontPropertiesTab}}" stepKey="goToStorefrontPropertiesTab" after="fillDefaultStoreLabel2"/> + <waitForElementVisible selector="{{AdminNewAttributePanel.storefrontPropertiesTitle}}" stepKey="waitTabLoad" after="goToStorefrontPropertiesTab"/> + <selectOption selector="{{AdminNewAttributePanel.useInSearch}}" stepKey="switchOnUsInSearch" userInput="Yes" after="waitTabLoad"/> + <selectOption selector="{{AdminNewAttributePanel.visibleInAdvancedSearch}}" stepKey="switchOnVisibleInAdvancedSearch" userInput="Yes" after="switchOnUsInSearch"/> + <selectOption selector="{{AdminNewAttributePanel.comparableOnStorefront}}" stepKey="switchOnComparableOnStorefront" userInput="Yes" after="switchOnVisibleInAdvancedSearch"/> + <selectOption selector="{{AdminNewAttributePanel.useInLayeredNavigation}}" stepKey="selectUseInLayer" userInput="Filterable (with results)" after="switchOnComparableOnStorefront"/> + <selectOption selector="{{AdminNewAttributePanel.visibleOnCatalogPagesOnStorefront}}" stepKey="switchOnVisibleOnCatalogPagesOnStorefront" userInput="Yes" after="selectUseInLayer"/> + <selectOption selector="{{AdminNewAttributePanel.useInProductListing}}" stepKey="switchOnUsedInProductListing" userInput="Yes" after="switchOnVisibleOnCatalogPagesOnStorefront"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddVisualSwatchWithProductWithStorefrontPreviewImageConfigActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddVisualSwatchWithProductWithStorefrontPreviewImageConfigActionGroup.xml new file mode 100644 index 0000000000000..64c298bdcb16c --- /dev/null +++ b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddVisualSwatchWithProductWithStorefrontPreviewImageConfigActionGroup.xml @@ -0,0 +1,19 @@ +<?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="AddVisualSwatchWithProductWithStorefrontPreviewImageConfigActionGroup" extends="AddVisualSwatchToProductActionGroup"> + <selectOption selector="{{AdminNewAttributePanel.updateProductPreviewImage}}" userInput="Yes" stepKey="selectUpdatePreviewImage" after="selectInputType"/> + <click selector="{{AdminNewAttributePanel.storefrontPropertiesTab}}" stepKey="goToStorefrontPropertiesTab" after="fillDefaultStoreLabel2"/> + <waitForElementVisible selector="{{AdminNewAttributePanel.storefrontPropertiesTitle}}" after="goToStorefrontPropertiesTab" stepKey="waitTabLoad"/> + <selectOption selector="{{AdminNewAttributePanel.useInLayeredNavigation}}" userInput="Filterable (with results)" stepKey="selectUseInLayer" after="waitTabLoad"/> + <selectOption selector="{{AdminNewAttributePanel.useInProductListing}}" userInput="Yes" stepKey="switchOnUsedInProductListing" after="selectUseInLayer"/> + <selectOption selector="{{AdminNewAttributePanel.usedForStoringInProductListing}}" userInput="Yes" stepKey="switchOnUsedForStoringInProductListing" after="switchOnUsedInProductListing"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AdminEditPropertiesTabForSwatchProductAtributeActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AdminAddSwatchOptionAndFillFieldsActionGroup.xml similarity index 72% rename from app/code/Magento/Swatches/Test/Mftf/ActionGroup/AdminEditPropertiesTabForSwatchProductAtributeActionGroup.xml rename to app/code/Magento/Swatches/Test/Mftf/ActionGroup/AdminAddSwatchOptionAndFillFieldsActionGroup.xml index 05ab5a53468a2..f31753438569c 100644 --- a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AdminEditPropertiesTabForSwatchProductAtributeActionGroup.xml +++ b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AdminAddSwatchOptionAndFillFieldsActionGroup.xml @@ -8,7 +8,6 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <!--You are on ProductAttributePage--> <!--Add new swatch options and fill fields for product attribute --> <actionGroup name="AdminAddSwatchOptionAndFillFieldsActionGroup"> @@ -20,13 +19,4 @@ <fillField selector="{{AdminNewAttributePanel.lastVisualSwatchOptionAdminValue}}" userInput="{{swatchOption.admin_label}}" stepKey="fillAdminLabel"/> <fillField selector="{{AdminNewAttributePanel.lastVisualSwatchOptionDefaultStoreValue}}" userInput="{{swatchOption.default_label}}" stepKey="fillDefaultStoreLabel"/> </actionGroup> - - <!--You are on ProductAttributePage--> - <!--Select value for option "Update Product Preview Image"--> - <actionGroup name="AdminUpdateProductPreviewImageActionGroup"> - <arguments> - <argument name="value" type="string" defaultValue="Yes"/> - </arguments> - <selectOption selector="{{AttributePropertiesSection.UpdateProductPreviewImage}}" userInput="{{value}}" stepKey="setUpdateProductPreviewImage"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AdminUpdateProductPreviewImageActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AdminUpdateProductPreviewImageActionGroup.xml new file mode 100644 index 0000000000000..34d053a47a00f --- /dev/null +++ b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AdminUpdateProductPreviewImageActionGroup.xml @@ -0,0 +1,17 @@ +<?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="AdminUpdateProductPreviewImageActionGroup"> + <arguments> + <argument name="value" type="string" defaultValue="Yes"/> + </arguments> + <selectOption selector="{{AttributePropertiesSection.UpdateProductPreviewImage}}" userInput="{{value}}" stepKey="setUpdateProductPreviewImage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AssertStorefrontSwatchColorActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AssertStorefrontSwatchColorActionGroup.xml new file mode 100644 index 0000000000000..b48494a85ae2c --- /dev/null +++ b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AssertStorefrontSwatchColorActionGroup.xml @@ -0,0 +1,26 @@ +<?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="AssertStorefrontSwatchColorActionGroup"> + <annotations> + <description>Validates that the Storefront Product has the provided Swatch with the provided Color.</description> + </annotations> + <arguments> + <argument name="nthSwatch" type="string" defaultValue="1"/> + <argument name="expectedRgb" type="string" defaultValue="rgb(231, 77, 60)"/> + </arguments> + + <grabAttributeFrom selector="{{StorefrontProductInfoMainSection.nthSwatchOption(nthSwatch)}}" userInput="style" stepKey="grabStyle1"/> + <assertEquals stepKey="assertStyle1"> + <actualResult type="string">{$grabStyle1}</actualResult> + <expectedResult type="string">background: center center no-repeat {{expectedRgb}};</expectedResult> + </assertEquals> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AssertSwatchColorActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AssertSwatchColorActionGroup.xml new file mode 100644 index 0000000000000..f978afd7d2ca0 --- /dev/null +++ b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AssertSwatchColorActionGroup.xml @@ -0,0 +1,26 @@ +<?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="AssertSwatchColorActionGroup"> + <annotations> + <description>Validates that the provided Color Picker contains the provided Style.</description> + </annotations> + <arguments> + <argument name="nthSwatch" type="string" defaultValue="1"/> + <argument name="expectedStyle" type="string" defaultValue="background: rgb(0, 0, 0);"/> + </arguments> + + <grabAttributeFrom selector="{{AdminManageSwatchSection.nthSwatch(nthSwatch)}}" userInput="style" stepKey="grabStyle1"/> + <assertEquals stepKey="assertStyle1"> + <actualResult type="string">{$grabStyle1}</actualResult> + <expectedResult type="string">{{expectedStyle}}</expectedResult> + </assertEquals> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/ColorPickerActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/ColorPickerActionGroup.xml deleted file mode 100644 index 7cad0048261eb..0000000000000 --- a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/ColorPickerActionGroup.xml +++ /dev/null @@ -1,68 +0,0 @@ -<?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="setColorPickerByHex"> - <annotations> - <description>Sets the provided HEX value in the provided Color Picker.</description> - </annotations> - <arguments> - <argument name="nthColorPicker" type="string" defaultValue="1"/> - <argument name="hexColor" type="string" defaultValue="e74c3c"/> - </arguments> - - <!-- This 6x backspace stuff is some magic that is necessary to interact with this field correctly --> - <pressKey selector="{{AdminColorPickerSection.hexByIndex(nthColorPicker)}}" parameterArray="[\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,'{{hexColor}}']" stepKey="fillHex1"/> - <click selector="{{AdminColorPickerSection.submitByIndex(nthColorPicker)}}" stepKey="submitColor1"/> - </actionGroup> - - <actionGroup name="assertSwatchColor"> - <annotations> - <description>Validates that the provided Color Picker contains the provided Style.</description> - </annotations> - <arguments> - <argument name="nthSwatch" type="string" defaultValue="1"/> - <argument name="expectedStyle" type="string" defaultValue="background: rgb(0, 0, 0);"/> - </arguments> - - <grabAttributeFrom selector="{{AdminManageSwatchSection.nthSwatch(nthSwatch)}}" userInput="style" stepKey="grabStyle1"/> - <assertEquals stepKey="assertStyle1"> - <actualResult type="string">{$grabStyle1}</actualResult> - <expectedResult type="string">{{expectedStyle}}</expectedResult> - </assertEquals> - </actionGroup> - - <actionGroup name="assertStorefrontSwatchColor"> - <annotations> - <description>Validates that the Storefront Product has the provided Swatch with the provided Color.</description> - </annotations> - <arguments> - <argument name="nthSwatch" type="string" defaultValue="1"/> - <argument name="expectedRgb" type="string" defaultValue="rgb(231, 77, 60)"/> - </arguments> - - <grabAttributeFrom selector="{{StorefrontProductInfoMainSection.nthSwatchOption(nthSwatch)}}" userInput="style" stepKey="grabStyle1"/> - <assertEquals stepKey="assertStyle1"> - <actualResult type="string">{$grabStyle1}</actualResult> - <expectedResult type="string">background: center center no-repeat {{expectedRgb}};</expectedResult> - </assertEquals> - </actionGroup> - - <actionGroup name="openSwatchMenuByIndex"> - <annotations> - <description>Options the Swatch Menu based on the provided Index.</description> - </annotations> - <arguments> - <argument name="index" type="string" defaultValue="0"/> - </arguments> - - <!-- I had to use executeJS to perform the click to get around the use of CSS ::before and ::after --> - <executeJS function="jQuery('#swatch_window_option_option_{{index}}').click()" stepKey="clickSwatch1"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/OpenSwatchMenuByIndexActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/OpenSwatchMenuByIndexActionGroup.xml new file mode 100644 index 0000000000000..b721596789f92 --- /dev/null +++ b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/OpenSwatchMenuByIndexActionGroup.xml @@ -0,0 +1,22 @@ +<?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="OpenSwatchMenuByIndexActionGroup"> + <annotations> + <description>Options the Swatch Menu based on the provided Index.</description> + </annotations> + <arguments> + <argument name="index" type="string" defaultValue="0"/> + </arguments> + + <!-- I had to use executeJS to perform the click to get around the use of CSS ::before and ::after --> + <executeJS function="jQuery('#swatch_window_option_option_{{index}}').click()" stepKey="clickSwatch1"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/SetColorPickerByHexActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/SetColorPickerByHexActionGroup.xml new file mode 100644 index 0000000000000..396c1cc87c5c4 --- /dev/null +++ b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/SetColorPickerByHexActionGroup.xml @@ -0,0 +1,24 @@ +<?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="SetColorPickerByHexActionGroup"> + <annotations> + <description>Sets the provided HEX value in the provided Color Picker.</description> + </annotations> + <arguments> + <argument name="nthColorPicker" type="string" defaultValue="1"/> + <argument name="hexColor" type="string" defaultValue="e74c3c"/> + </arguments> + + <!-- This 6x backspace stuff is some magic that is necessary to interact with this field correctly --> + <pressKey selector="{{AdminColorPickerSection.hexByIndex(nthColorPicker)}}" parameterArray="[\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,'{{hexColor}}']" stepKey="fillHex1"/> + <click selector="{{AdminColorPickerSection.submitByIndex(nthColorPicker)}}" stepKey="submitColor1"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontAddProductWithSwatchesToTheCartActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontAddProductWithSwatchesToTheCartActionGroup.xml new file mode 100644 index 0000000000000..64933e184a86d --- /dev/null +++ b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontAddProductWithSwatchesToTheCartActionGroup.xml @@ -0,0 +1,21 @@ +<?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"> + <!-- Add Configurable Product with Swatch attribute to the cart --> + <actionGroup name="StorefrontAddProductWithSwatchesToTheCartActionGroup" extends="StorefrontAddProductToCartWithQtyActionGroup"> + <arguments> + <argument name="product"/> + <argument name="productOption" type="string"/> + </arguments> + <remove keyForRemoval="seeSuccessSaveMessage"/> + <click selector="{{StorefrontProductInfoMainSection.visualSwatchOption(productOption)}}" after="waitForStorefrontProductPageLoad" stepKey="clickSelectOption"/> + <see selector="{{StorefrontMessagesSection.success}}" userInput="You added {{product.name}} to your shopping cart." after="waitForSuccessMessage" stepKey="seeAddToCartSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontAssertSwatchOptionPriceActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontAssertSwatchOptionPriceActionGroup.xml new file mode 100644 index 0000000000000..b4a3708c15659 --- /dev/null +++ b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontAssertSwatchOptionPriceActionGroup.xml @@ -0,0 +1,19 @@ +<?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="StorefrontAssertSwatchOptionPriceActionGroup"> + <arguments> + <argument name="optionName" type="string"/> + <argument name="optionPrice" type="string"/> + </arguments> + <click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel(optionName)}}" stepKey="clickOnOption"/> + <see userInput="{{optionPrice}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="seeOptionPrice"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontProductActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontProductActionGroup.xml deleted file mode 100644 index 6ca0c220778d6..0000000000000 --- a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontProductActionGroup.xml +++ /dev/null @@ -1,34 +0,0 @@ -<?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"> - <!--Click a swatch option on product page--> - <actionGroup name="StorefrontSelectSwatchOptionOnProductPage"> - <arguments> - <argument name="optionName" type="string"/> - </arguments> - <click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel(optionName)}}" stepKey="clickSwatchOption"/> - </actionGroup> - <actionGroup name="StorefrontAssertSwatchOptionPrice"> - <arguments> - <argument name="optionName" type="string"/> - <argument name="optionPrice" type="string"/> - </arguments> - <click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel(optionName)}}" stepKey="clickOnOption"/> - <see userInput="{{optionPrice}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="seeOptionPrice"/> - </actionGroup> - - <!--Click a swatch option on product page and check active image--> - <actionGroup name="StorefrontSelectSwatchOptionOnProductPageAndCheckImage" extends="StorefrontSelectSwatchOptionOnProductPage"> - <arguments> - <argument name="fileName" type="string" defaultValue="magento-logo"/> - </arguments> - <seeElement selector="{{StorefrontProductMediaSection.productImageActive(fileName)}}" stepKey="seeActiveImageDefault"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontSelectSwatchOptionOnProductPageActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontSelectSwatchOptionOnProductPageActionGroup.xml new file mode 100644 index 0000000000000..53c4adb5e1ab3 --- /dev/null +++ b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontSelectSwatchOptionOnProductPageActionGroup.xml @@ -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"> + <!--Click a swatch option on product page--> + <actionGroup name="StorefrontSelectSwatchOptionOnProductPageActionGroup"> + <arguments> + <argument name="optionName" type="string"/> + </arguments> + <click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel(optionName)}}" stepKey="clickSwatchOption"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontSelectSwatchOptionOnProductPageAndCheckImageActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontSelectSwatchOptionOnProductPageAndCheckImageActionGroup.xml new file mode 100644 index 0000000000000..67fd0178be9fa --- /dev/null +++ b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontSelectSwatchOptionOnProductPageAndCheckImageActionGroup.xml @@ -0,0 +1,17 @@ +<?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="StorefrontSelectSwatchOptionOnProductPageAndCheckImageActionGroup" extends="StorefrontSelectSwatchOptionOnProductPageActionGroup"> + <arguments> + <argument name="fileName" type="string" defaultValue="magento-logo"/> + </arguments> + <seeElement selector="{{StorefrontProductMediaSection.productImageActive(fileName)}}" stepKey="seeActiveImageDefault"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontAddProductWithSwatchAttributeToTheCartActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontUpdateCartConfigurableProductWithSwatchesActionGroup.xml similarity index 54% rename from app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontAddProductWithSwatchAttributeToTheCartActionGroup.xml rename to app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontUpdateCartConfigurableProductWithSwatchesActionGroup.xml index 9bd58bff69e5a..2a4f7fd2db62d 100644 --- a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontAddProductWithSwatchAttributeToTheCartActionGroup.xml +++ b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontUpdateCartConfigurableProductWithSwatchesActionGroup.xml @@ -7,20 +7,8 @@ --> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <!-- Add Configurable Product with Swatch attribute to the cart --> - <actionGroup name="StorefrontAddProductWithSwatchesToTheCartActionGroup" extends="StorefrontAddProductToCartWithQtyActionGroup"> - <arguments> - <argument name="product"/> - <argument name="productOption" type="string"/> - </arguments> - <remove keyForRemoval="seeSuccessSaveMessage"/> - <click selector="{{StorefrontProductInfoMainSection.visualSwatchOption(productOption)}}" after="waitForStorefrontProductPageLoad" stepKey="clickSelectOption"/> - <see selector="{{StorefrontMessagesSection.success}}" userInput="You added {{product.name}} to your shopping cart." after="waitForSuccessMessage" stepKey="seeAddToCartSuccessMessage"/> - </actionGroup> - - <!-- Update Configurable Product with Swatch attribute in the cart --> - <actionGroup name="StorefrontUpdateCartConfigurableProductWithSwatches"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontUpdateCartConfigurableProductWithSwatchesActionGroup"> <arguments> <argument name="product"/> <argument name="productOption" type="string"/> @@ -32,4 +20,4 @@ <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/> <see selector="{{StorefrontMessagesSection.success}}" userInput="{{product.name}} was updated in your shopping cart." stepKey="assertSuccessMessage"/> </actionGroup> -</actionGroups> \ No newline at end of file +</actionGroups> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateImageSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateImageSwatchTest.xml index 0e294153e881e..97d8b9075c014 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateImageSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateImageSwatchTest.xml @@ -40,7 +40,7 @@ <!-- Set swatch image #1 --> <click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSwatch1"/> - <actionGroup ref="openSwatchMenuByIndex" stepKey="clickSwatch1"> + <actionGroup ref="OpenSwatchMenuByIndexActionGroup" stepKey="clickSwatch1"> <argument name="index" value="0"/> </actionGroup> <click selector="{{AdminManageSwatchSection.nthUploadFile('1')}}" stepKey="clickUploadFile1"/> @@ -49,7 +49,7 @@ <!-- Set swatch image #2 --> <click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSwatch2"/> - <actionGroup ref="openSwatchMenuByIndex" stepKey="clickSwatch2"> + <actionGroup ref="OpenSwatchMenuByIndexActionGroup" stepKey="clickSwatch2"> <argument name="index" value="1"/> </actionGroup> <click selector="{{AdminManageSwatchSection.nthUploadFile('2')}}" stepKey="clickUploadFile2"/> @@ -58,7 +58,7 @@ <!-- Set swatch image #3 --> <click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSwatch3"/> - <actionGroup ref="openSwatchMenuByIndex" stepKey="clickSwatch3"> + <actionGroup ref="OpenSwatchMenuByIndexActionGroup" stepKey="clickSwatch3"> <argument name="index" value="2"/> </actionGroup> <click selector="{{AdminManageSwatchSection.nthUploadFile('3')}}" stepKey="clickUploadFile3"/> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateVisualSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateVisualSwatchTest.xml index 65f0e2b09b82a..1c8e86b3765d4 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateVisualSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateVisualSwatchTest.xml @@ -50,33 +50,33 @@ <!-- Set swatch #1 using the color picker --> <click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSwatch1"/> - <actionGroup ref="openSwatchMenuByIndex" stepKey="clickSwatch1"> + <actionGroup ref="OpenSwatchMenuByIndexActionGroup" stepKey="clickSwatch1"> <argument name="index" value="0"/> </actionGroup> <click selector="{{AdminManageSwatchSection.nthChooseColor('1')}}" stepKey="clickChooseColor1"/> - <actionGroup ref="setColorPickerByHex" stepKey="fillHex1"> + <actionGroup ref="SetColorPickerByHexActionGroup" stepKey="fillHex1"> <argument name="nthColorPicker" value="1"/> <argument name="hexColor" value="e74c3c"/> </actionGroup> <fillField selector="{{AdminManageSwatchSection.adminInputByIndex('0')}}" userInput="red" stepKey="fillAdmin1"/> <!-- Set swatch #2 using the color picker --> <click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSwatch2"/> - <actionGroup ref="openSwatchMenuByIndex" stepKey="clickSwatch2"> + <actionGroup ref="OpenSwatchMenuByIndexActionGroup" stepKey="clickSwatch2"> <argument name="index" value="1"/> </actionGroup> <click selector="{{AdminManageSwatchSection.nthChooseColor('2')}}" stepKey="clickChooseColor2"/> - <actionGroup ref="setColorPickerByHex" stepKey="fillHex2"> + <actionGroup ref="SetColorPickerByHexActionGroup" stepKey="fillHex2"> <argument name="nthColorPicker" value="2"/> <argument name="hexColor" value="2ecc71"/> </actionGroup> <fillField selector="{{AdminManageSwatchSection.adminInputByIndex('1')}}" userInput="green" stepKey="fillAdmin2"/> <!-- Set swatch #3 using the color picker --> <click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSwatch3"/> - <actionGroup ref="openSwatchMenuByIndex" stepKey="clickSwatch3"> + <actionGroup ref="OpenSwatchMenuByIndexActionGroup" stepKey="clickSwatch3"> <argument name="index" value="2"/> </actionGroup> <click selector="{{AdminManageSwatchSection.nthChooseColor('3')}}" stepKey="clickChooseColor3"/> - <actionGroup ref="setColorPickerByHex" stepKey="fillHex3"> + <actionGroup ref="SetColorPickerByHexActionGroup" stepKey="fillHex3"> <argument name="nthColorPicker" value="3"/> <argument name="hexColor" value="3498db"/> </actionGroup> @@ -88,15 +88,15 @@ <waitForElementVisible selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccess"/> <!-- Assert that the Save was successful after round trip to server --> - <actionGroup ref="assertSwatchColor" stepKey="assertSwatch1"> + <actionGroup ref="AssertSwatchColorActionGroup" stepKey="assertSwatch1"> <argument name="nthSwatch" value="1"/> <argument name="expectedStyle" value="background: rgb(231, 77, 60);"/> </actionGroup> - <actionGroup ref="assertSwatchColor" stepKey="assertSwatch2"> + <actionGroup ref="AssertSwatchColorActionGroup" stepKey="assertSwatch2"> <argument name="nthSwatch" value="2"/> <argument name="expectedStyle" value="background: rgb(46, 204, 112);"/> </actionGroup> - <actionGroup ref="assertSwatchColor" stepKey="assertSwatch3"> + <actionGroup ref="AssertSwatchColorActionGroup" stepKey="assertSwatch3"> <argument name="nthSwatch" value="3"/> <argument name="expectedStyle" value="background: rgb(52, 152, 219);"/> </actionGroup> @@ -143,15 +143,15 @@ <waitForPageLoad stepKey="waitForProductPage"/> <!-- Verify that the storefront shows the swatches too --> - <actionGroup ref="assertStorefrontSwatchColor" stepKey="assertSwatch4"> + <actionGroup ref="AssertStorefrontSwatchColorActionGroup" stepKey="assertSwatch4"> <argument name="nthSwatch" value="1"/> <argument name="expectedRgb" value="rgb(231, 77, 60)"/> </actionGroup> - <actionGroup ref="assertStorefrontSwatchColor" stepKey="assertSwatch5"> + <actionGroup ref="AssertStorefrontSwatchColorActionGroup" stepKey="assertSwatch5"> <argument name="nthSwatch" value="2"/> <argument name="expectedRgb" value="rgb(46, 204, 112)"/> </actionGroup> - <actionGroup ref="assertStorefrontSwatchColor" stepKey="assertSwatch6"> + <actionGroup ref="AssertStorefrontSwatchColorActionGroup" stepKey="assertSwatch6"> <argument name="nthSwatch" value="3"/> <argument name="expectedRgb" value="rgb(52, 152, 219)"/> </actionGroup> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateVisualSwatchWithNonValidOptionsTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateVisualSwatchWithNonValidOptionsTest.xml index b03f771875957..b69d48384aed8 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateVisualSwatchWithNonValidOptionsTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateVisualSwatchWithNonValidOptionsTest.xml @@ -47,11 +47,11 @@ <!-- Add new swatch option without label --> <click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSwatch1"/> - <actionGroup ref="openSwatchMenuByIndex" stepKey="clickSwatch1"> + <actionGroup ref="OpenSwatchMenuByIndexActionGroup" stepKey="clickSwatch1"> <argument name="index" value="0"/> </actionGroup> <click selector="{{AdminManageSwatchSection.nthChooseColor('1')}}" stepKey="clickChooseColor1"/> - <actionGroup ref="setColorPickerByHex" stepKey="fillHex1"> + <actionGroup ref="SetColorPickerByHexActionGroup" stepKey="fillHex1"> <argument name="nthColorPicker" value="1"/> <argument name="hexColor" value="ff0000"/> </actionGroup> @@ -66,11 +66,11 @@ <!-- Add 2 additional new swatch options --> <click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSwatch2"/> - <actionGroup ref="openSwatchMenuByIndex" stepKey="clickSwatch2"> + <actionGroup ref="OpenSwatchMenuByIndexActionGroup" stepKey="clickSwatch2"> <argument name="index" value="1"/> </actionGroup> <click selector="{{AdminManageSwatchSection.nthChooseColor('2')}}" stepKey="clickChooseColor2"/> - <actionGroup ref="setColorPickerByHex" stepKey="fillHex2"> + <actionGroup ref="SetColorPickerByHexActionGroup" stepKey="fillHex2"> <argument name="nthColorPicker" value="2"/> <argument name="hexColor" value="00ff00"/> </actionGroup> @@ -78,11 +78,11 @@ userInput="green" stepKey="fillAdmin2"/> <click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSwatch3"/> - <actionGroup ref="openSwatchMenuByIndex" stepKey="clickSwatch3"> + <actionGroup ref="OpenSwatchMenuByIndexActionGroup" stepKey="clickSwatch3"> <argument name="index" value="2"/> </actionGroup> <click selector="{{AdminManageSwatchSection.nthChooseColor('3')}}" stepKey="clickChooseColor3"/> - <actionGroup ref="setColorPickerByHex" stepKey="fillHex3"> + <actionGroup ref="SetColorPickerByHexActionGroup" stepKey="fillHex3"> <argument name="nthColorPicker" value="3"/> <argument name="hexColor" value="0000ff"/> </actionGroup> @@ -109,4 +109,4 @@ <!-- Check attribute data --> <seeCheckboxIsChecked selector="{{AdminManageSwatchSection.nthIsDefault('2')}}" stepKey="CheckDefaultOption"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/AdminDisablingSwatchTooltipsTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/AdminDisablingSwatchTooltipsTest.xml index 2ffc61614bd1d..b44c04d2c1b46 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/AdminDisablingSwatchTooltipsTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/AdminDisablingSwatchTooltipsTest.xml @@ -61,11 +61,11 @@ <!-- Set swatch using the color picker --> <click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSwatch1"/> - <actionGroup ref="openSwatchMenuByIndex" stepKey="clickSwatch1"> + <actionGroup ref="OpenSwatchMenuByIndexActionGroup" stepKey="clickSwatch1"> <argument name="index" value="0"/> </actionGroup> <click selector="{{AdminManageSwatchSection.nthChooseColor('1')}}" stepKey="clickChooseColor1"/> - <actionGroup ref="setColorPickerByHex" stepKey="fillHex1"> + <actionGroup ref="SetColorPickerByHexActionGroup" stepKey="fillHex1"> <argument name="nthColorPicker" value="1"/> <argument name="hexColor" value="e74c3c"/> </actionGroup> @@ -77,7 +77,7 @@ <waitForElementVisible selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccess"/> <!-- Assert that the Save was successful after round trip to server --> - <actionGroup ref="assertSwatchColor" stepKey="assertSwatchAdmin"> + <actionGroup ref="AssertSwatchColorActionGroup" stepKey="assertSwatchAdmin"> <argument name="nthSwatch" value="1"/> <argument name="expectedStyle" value="background: rgb(231, 77, 60);"/> </actionGroup> @@ -137,7 +137,7 @@ <waitForPageLoad stepKey="waitForProductPage"/> <!-- Verify that the storefront shows the swatches too --> - <actionGroup ref="assertStorefrontSwatchColor" stepKey="assertSwatchStorefront"> + <actionGroup ref="AssertStorefrontSwatchColorActionGroup" stepKey="assertSwatchStorefront"> <argument name="nthSwatch" value="1"/> <argument name="expectedRgb" value="rgb(231, 77, 60)"/> </actionGroup> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml index f94314fe94806..cb66b811abad5 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml @@ -33,18 +33,18 @@ <!-- Add a few Swatches and add images to Manage Swatch (Values of Your Attribute) 1. Set swatch #1 using the color picker --> <click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddFirstSwatch"/> - <actionGroup ref="openSwatchMenuByIndex" stepKey="clickFirstSwatch"> + <actionGroup ref="OpenSwatchMenuByIndexActionGroup" stepKey="clickFirstSwatch"> <argument name="index" value="0"/> </actionGroup> <click selector="{{AdminManageSwatchSection.nthChooseColor('1')}}" stepKey="clickChooseColor"/> - <actionGroup ref="setColorPickerByHex" stepKey="fillFirstHex"> + <actionGroup ref="SetColorPickerByHexActionGroup" stepKey="fillFirstHex"> <argument name="nthColorPicker" value="1"/> <argument name="hexColor" value="e74c3c"/> </actionGroup> <fillField selector="{{AdminManageSwatchSection.adminInputByIndex('0')}}" userInput="red" stepKey="fillFirstAdminField"/> <!-- Set swatch #2 using upload file --> <click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSecondSwatch"/> - <actionGroup ref="openSwatchMenuByIndex" stepKey="clickSwatch2"> + <actionGroup ref="OpenSwatchMenuByIndexActionGroup" stepKey="clickSwatch2"> <argument name="index" value="1"/> </actionGroup> <click selector="{{AdminManageSwatchSection.nthUploadFile('2')}}" stepKey="clickUploadFile2"/> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontConfigurableProductSwatchMinimumPriceTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontConfigurableProductSwatchMinimumPriceTest.xml index 0a98e7a721c17..085aa89210c08 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontConfigurableProductSwatchMinimumPriceTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontConfigurableProductSwatchMinimumPriceTest.xml @@ -126,19 +126,19 @@ </actionGroup> <!--Verify that Black option's minimum price is 16--> - <actionGroup ref="StorefrontAssertSwatchOptionPrice" stepKey="assertMinimumPriceForBlackOption"> + <actionGroup ref="StorefrontAssertSwatchOptionPriceActionGroup" stepKey="assertMinimumPriceForBlackOption"> <argument name="optionName" value="Black"/> <argument name="optionPrice" value="10.00"/> </actionGroup> <!--Verify that White option's minimum price is 16--> - <actionGroup ref="StorefrontAssertSwatchOptionPrice" stepKey="assertMinimumPriceForWhiteOption"> + <actionGroup ref="StorefrontAssertSwatchOptionPriceActionGroup" stepKey="assertMinimumPriceForWhiteOption"> <argument name="optionName" value="White"/> <argument name="optionPrice" value="13.00"/> </actionGroup> <!--Verify that Blue option's minimum price is 16--> - <actionGroup ref="StorefrontAssertSwatchOptionPrice" stepKey="assertMinimumPriceForBlueOption"> + <actionGroup ref="StorefrontAssertSwatchOptionPriceActionGroup" stepKey="assertMinimumPriceForBlueOption"> <argument name="optionName" value="Blue"/> <argument name="optionPrice" value="16.00"/> </actionGroup> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontCustomerCanChangeProductOptionsUsingSwatchesTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontCustomerCanChangeProductOptionsUsingSwatchesTest.xml index f5bcccd4aa9b2..32e447f6463c0 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontCustomerCanChangeProductOptionsUsingSwatchesTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontCustomerCanChangeProductOptionsUsingSwatchesTest.xml @@ -45,7 +45,7 @@ <!-- Go to shopping cart and update option of configurable product --> <amOnPage url="{{CheckoutCartPage.url}}" stepKey="openShoppingCartPage"/> - <actionGroup ref="StorefrontUpdateCartConfigurableProductWithSwatches" stepKey="updateConfigurableProductInTheCart"> + <actionGroup ref="StorefrontUpdateCartConfigurableProductWithSwatchesActionGroup" stepKey="updateConfigurableProductInTheCart"> <argument name="product" value="_defaultProduct"/> <argument name="productOption" value="e74d3c"/> </actionGroup> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByImageSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByImageSwatchTest.xml index c9602ddcd127c..adc230335576a 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByImageSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByImageSwatchTest.xml @@ -49,7 +49,7 @@ <!-- Set swatch #1 image using file upload --> <click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSwatch1"/> - <actionGroup ref="openSwatchMenuByIndex" stepKey="clickSwatch1"> + <actionGroup ref="OpenSwatchMenuByIndexActionGroup" stepKey="clickSwatch1"> <argument name="index" value="0"/> </actionGroup> <click selector="{{AdminManageSwatchSection.nthUploadFile('1')}}" stepKey="clickUploadFile1"/> @@ -58,7 +58,7 @@ <!-- Set swatch #2 image using the file upload --> <click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSwatch2"/> - <actionGroup ref="openSwatchMenuByIndex" stepKey="clickSwatch2"> + <actionGroup ref="OpenSwatchMenuByIndexActionGroup" stepKey="clickSwatch2"> <argument name="index" value="1"/> </actionGroup> <click selector="{{AdminManageSwatchSection.nthUploadFile('2')}}" stepKey="clickUploadFile2"/> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByVisualSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByVisualSwatchTest.xml index fd38c48919416..2467935795724 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByVisualSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByVisualSwatchTest.xml @@ -43,11 +43,11 @@ <!-- Set swatch #1 using the color picker --> <click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSwatch1"/> - <actionGroup ref="openSwatchMenuByIndex" stepKey="clickSwatch1"> + <actionGroup ref="OpenSwatchMenuByIndexActionGroup" stepKey="clickSwatch1"> <argument name="index" value="0"/> </actionGroup> <click selector="{{AdminManageSwatchSection.nthChooseColor('1')}}" stepKey="clickChooseColor1"/> - <actionGroup ref="setColorPickerByHex" stepKey="fillHex1"> + <actionGroup ref="SetColorPickerByHexActionGroup" stepKey="fillHex1"> <argument name="nthColorPicker" value="1"/> <argument name="hexColor" value="e74c3c"/> </actionGroup> @@ -55,11 +55,11 @@ <!-- Set swatch #2 using the color picker --> <click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSwatch2"/> - <actionGroup ref="openSwatchMenuByIndex" stepKey="clickSwatch2"> + <actionGroup ref="OpenSwatchMenuByIndexActionGroup" stepKey="clickSwatch2"> <argument name="index" value="1"/> </actionGroup> <click selector="{{AdminManageSwatchSection.nthChooseColor('2')}}" stepKey="clickChooseColor2"/> - <actionGroup ref="setColorPickerByHex" stepKey="fillHex2"> + <actionGroup ref="SetColorPickerByHexActionGroup" stepKey="fillHex2"> <argument name="nthColorPicker" value="2"/> <argument name="hexColor" value="3498db"/> </actionGroup> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSeeProductImagesMatchingProductSwatchesTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSeeProductImagesMatchingProductSwatchesTest.xml index 1717b424e4597..8700cb34a8cdb 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSeeProductImagesMatchingProductSwatchesTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSeeProductImagesMatchingProductSwatchesTest.xml @@ -100,7 +100,7 @@ <actionGroup ref="StorefrontAssertActiveProductImage" stepKey="StorefrontAssertActiveProductImage"/> <!--Click a swatch and expect to see the image from the swatch from the configurable product --> - <actionGroup ref="StorefrontSelectSwatchOptionOnProductPageAndCheckImage" stepKey="clickSwatchOption"> + <actionGroup ref="StorefrontSelectSwatchOptionOnProductPageAndCheckImageActionGroup" stepKey="clickSwatchOption"> <argument name="optionName" value="{{visualSwatchOption1.default_label}}"/> <argument name="fileName" value="{{TestImageAdobe.filename}}"/> </actionGroup> @@ -109,7 +109,7 @@ <argument name="fileName" value="{{TestImageNew.filename}}"/> </actionGroup> - <actionGroup ref="StorefrontSelectSwatchOptionOnProductPageAndCheckImage" stepKey="clickOnSwatchOption2"> + <actionGroup ref="StorefrontSelectSwatchOptionOnProductPageAndCheckImageActionGroup" stepKey="clickOnSwatchOption2"> <argument name="optionName" value="{{visualSwatchOption2.default_label}}"/> <argument name="fileName" value="{{ImageUpload3.filename}}"/> </actionGroup> From a3b18e16acc2baf30e6576bc1c08e84a74192bdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 15:24:57 +0100 Subject: [PATCH 120/586] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- ...iveFlatCategoryAndUpdateAsInactiveTest.xml | 4 +- .../AdminCreateInactiveFlatCategoryTest.xml | 4 +- ...inCreateInactiveInMenuFlatCategoryTest.xml | 4 +- ...inUpdateFlatCategoryAndAddProductsTest.xml | 6 +- ...ateFlatCategoryIncludeInNavigationTest.xml | 6 +- ...dateFlatCategoryNameAndDescriptionTest.xml | 6 +- ...rifyDataOverridingOnStoreViewLevelTest.xml | 2 +- ...rifyDataOverridingOnStoreViewLevelTest.xml | 2 +- ...ddCustomWebSiteToStoreGroupActionGroup.xml | 34 ++++++ .../AdminCreateNewStoreGroupActionGroup.xml | 102 ------------------ .../AdminCreateStoreViewActionGroup.xml | 58 ---------- .../AdminCreateStoreViewSaveActionGroup.xml | 20 ++++ ...CreateStoreViewWithoutCheckActionGroup.xml | 19 ++++ .../AdminCreateWebsiteActionGroup.xml | 52 --------- .../AdminDeleteStoreViewActionGroup.xml | 79 -------------- ...dminDeleteStoreViewIfExistsActionGroup.xml | 34 ++++++ .../AdminGetWebsiteIdActionGroup.xml | 28 +++++ .../AdminSearchStoreViewByNameActionGroup.xml | 24 +++++ .../AdminStoreGroupCreateActionGroup.xml | 24 ----- .../AdminSwitchStoreViewActionGroup.xml | 11 +- .../AdminSwitchToAllStoreViewActionGroup.xml | 19 ++++ .../AssertDefaultStoreViewActionGroup.xml | 20 ++++ .../AssertStoreNotInGridActionGroup.xml | 27 +++++ .../AssertStoreViewNotInGridActionGroup.xml | 27 +++++ .../AssertWebsiteFormActionGroup.xml | 27 +++++ .../AssertWebsiteInGridActionGroup.xml | 27 +++++ .../ChangeDefaultStoreViewActionGroup.xml | 26 +++++ .../CreateCustomStoreActionGroup.xml | 32 ++++++ .../CreateCustomStoreViewActionGroup.xml | 22 ---- .../CreateStoreViewActionGroup.xml | 32 ++++++ .../DeleteCustomStoreActionGroup.xml | 39 ------- ...CustomStoreBackupEnabledYesActionGroup.xml | 32 ++++++ ...omStoreViewBackupEnabledYesActionGroup.xml | 34 ++++++ ...reGroupAcceptWarningMessageActionGroup.xml | 2 +- .../ActionGroup/EditStoreGroupActionGroup.xml | 28 +++++ ...oAdminContentManagementPageActionGroup.xml | 19 ++++ .../SaveStoreConfigurationActionGroup.xml | 21 ++++ ...rationAndValidateFieldErrorActionGroup.xml | 28 +++++ ...frontSwitchDefaultStoreViewActionGroup.xml | 19 ++++ .../StorefrontSwitchStoreViewActionGroup.xml | 11 +- ...EnabledVerifyAbsenceOfDeleteButtonTest.xml | 4 +- ...tusEnabledVerifyBackendAndFrontendTest.xml | 4 +- ...NewLocalizedStoreViewStatusEnabledTest.xml | 4 +- ...ithCustomWebsiteAndDefaultCategoryTest.xml | 8 +- ...upWithCustomWebsiteAndRootCategoryTest.xml | 8 +- ...thDefaultWebsiteAndDefaultCategoryTest.xml | 6 +- ...usDisabledVerifyBackendAndFrontendTest.xml | 6 +- ...tusEnabledVerifyBackendAndFrontendTest.xml | 4 +- .../Test/Mftf/Test/AdminCreateWebsiteTest.xml | 4 +- .../Mftf/Test/AdminDeleteStoreGroupTest.xml | 4 +- .../Mftf/Test/AdminDeleteStoreViewTest.xml | 2 +- ...inMoveStoreToOtherGroupSameWebsiteTest.xml | 4 +- ...pAcceptAlertAndVerifyStoreViewFormTest.xml | 4 +- ...teStoreGroupAndVerifyStoreViewFormTest.xml | 4 +- .../Mftf/Test/AdminUpdateStoreViewTest.xml | 4 +- .../Test/Mftf/Test/AdminUpdateWebsiteTest.xml | 8 +- ...dFilterDeleteAndVerifyErrorMessageTest.xml | 4 +- ...SeveralWebsitesAndCheckURLRewritesTest.xml | 4 +- 58 files changed, 640 insertions(+), 457 deletions(-) create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/AdminAddCustomWebSiteToStoreGroupActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateStoreViewSaveActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateStoreViewWithoutCheckActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/AdminDeleteStoreViewIfExistsActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/AdminGetWebsiteIdActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/AdminSearchStoreViewByNameActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/AdminSwitchToAllStoreViewActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/AssertDefaultStoreViewActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/AssertStoreNotInGridActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/AssertStoreViewNotInGridActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/AssertWebsiteFormActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/AssertWebsiteInGridActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/ChangeDefaultStoreViewActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/CreateCustomStoreActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/CreateStoreViewActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/DeleteCustomStoreBackupEnabledYesActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/DeleteCustomStoreViewBackupEnabledYesActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/EditStoreGroupActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/NavigateToAdminContentManagementPageActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/SaveStoreConfigurationActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/SaveStoreConfigurationAndValidateFieldErrorActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/StorefrontSwitchDefaultStoreViewActionGroup.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryAndUpdateAsInactiveTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryAndUpdateAsInactiveTest.xml index 21b3dba7140c0..b0e6fe87be918 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryAndUpdateAsInactiveTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryAndUpdateAsInactiveTest.xml @@ -23,11 +23,11 @@ <!--Create category--> <createData entity="CatNotActive" stepKey="createCategory"/> <!-- Create First StoreView --> - <actionGroup ref="CreateStoreView" stepKey="createCustomStoreViewEn"> + <actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewEn"> <argument name="storeView" value="customStoreEN"/> </actionGroup> <!-- Create Second StoreView --> - <actionGroup ref="CreateStoreView" stepKey="createCustomStoreViewFr"> + <actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewFr"> <argument name="storeView" value="customStoreFR"/> </actionGroup> <!--Run full reindex and clear caches --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryTest.xml index aa3dba85dfadf..7de37b9cb77ef 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryTest.xml @@ -23,11 +23,11 @@ <!--Create category--> <createData entity="SimpleSubCategory" stepKey="createCategory"/> <!-- Create First StoreView --> - <actionGroup ref="CreateStoreView" stepKey="createCustomStoreViewEn"> + <actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewEn"> <argument name="storeView" value="customStoreEN"/> </actionGroup> <!-- Create Second StoreView --> - <actionGroup ref="CreateStoreView" stepKey="createCustomStoreViewFr"> + <actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewFr"> <argument name="storeView" value="customStoreFR"/> </actionGroup> <!--Run full reindex and clear caches --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveInMenuFlatCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveInMenuFlatCategoryTest.xml index 37417cd7fdb85..c7aba1fe8376f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveInMenuFlatCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveInMenuFlatCategoryTest.xml @@ -23,11 +23,11 @@ <!--Create category--> <createData entity="SimpleSubCategory" stepKey="category"/> <!-- Create First StoreView --> - <actionGroup ref="CreateStoreView" stepKey="createCustomStoreViewEn"> + <actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewEn"> <argument name="storeView" value="customStoreEN"/> </actionGroup> <!-- Create Second StoreView --> - <actionGroup ref="CreateStoreView" stepKey="createCustomStoreViewFr"> + <actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewFr"> <argument name="storeView" value="customStoreFR"/> </actionGroup> <!--Run full reindex and clear caches --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryAndAddProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryAndAddProductsTest.xml index 8872ea98eb504..cebf67ae2ebcf 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryAndAddProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryAndAddProductsTest.xml @@ -24,11 +24,11 @@ <!-- Create category --> <createData entity="defaultSimpleProduct" stepKey="createSimpleProduct"/> <!-- Create First StoreView --> - <actionGroup ref="CreateStoreView" stepKey="createCustomStoreViewEn"> + <actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewEn"> <argument name="storeView" value="customStoreEN"/> </actionGroup> <!-- Create Second StoreView --> - <actionGroup ref="CreateStoreView" stepKey="createCustomStoreViewFr"> + <actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewFr"> <argument name="storeView" value="customStoreFR"/> </actionGroup> <!--Run full reindex and clear caches --> @@ -100,4 +100,4 @@ <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$category.name$$)}}" stepKey="seeCategoryOnNavigation1"/> <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{defaultSimpleProduct.name}}" stepKey="seeProductName"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryIncludeInNavigationTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryIncludeInNavigationTest.xml index 5527303370623..d7ce22bdc0097 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryIncludeInNavigationTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryIncludeInNavigationTest.xml @@ -22,11 +22,11 @@ <!--Create category--> <createData entity="CatNotIncludeInMenu" stepKey="createCategory"/> <!-- Create First StoreView --> - <actionGroup ref="CreateStoreView" stepKey="createCustomStoreViewEn"> + <actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewEn"> <argument name="storeView" value="customStoreEN"/> </actionGroup> <!-- Create Second StoreView --> - <actionGroup ref="CreateStoreView" stepKey="createCustomStoreViewFr"> + <actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewFr"> <argument name="storeView" value="customStoreFR"/> </actionGroup> <!--Run full reindex and clear caches --> @@ -88,4 +88,4 @@ <waitForPageLoad stepKey="waitForSecondstoreView"/> <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="seeCategoryOnNavigation1"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryNameAndDescriptionTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryNameAndDescriptionTest.xml index fcbc0cb205268..2b14973d6ce32 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryNameAndDescriptionTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryNameAndDescriptionTest.xml @@ -23,11 +23,11 @@ <!--Create category--> <createData entity="_defaultCategory" stepKey="createCategory"/> <!-- Create First StoreView --> - <actionGroup ref="CreateStoreView" stepKey="createCustomStoreViewEn"> + <actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewEn"> <argument name="storeView" value="customStoreEN"/> </actionGroup> <!-- Create Second StoreView --> - <actionGroup ref="CreateStoreView" stepKey="createCustomStoreViewFr"> + <actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewFr"> <argument name="storeView" value="customStoreFR"/> </actionGroup> <!--Run full reindex and clear caches --> @@ -99,4 +99,4 @@ <click selector="{{AdminCategoryContentSection.sectionHeader}}" stepKey="selectContent1"/> <seeInField selector="{{AdminCategoryContentSection.description}}" userInput="Updated category Description Fields" stepKey="seeUpdatedDescription"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml index 80f0c8ad10ede..6f84ab06c407e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="CreateStoreView" stepKey="createCustomStoreViewFr"> + <actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewFr"> <argument name="storeView" value="customStoreFR"/> </actionGroup> <createData entity="SimpleSubCategory" stepKey="initialCategoryEntity"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml index f698b3d89ffe9..f65ee96c94b40 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="CreateStoreView" stepKey="createCustomStoreViewFr"> + <actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewFr"> <argument name="storeView" value="customStoreFR"/> </actionGroup> <createData entity="SimpleSubCategory" stepKey="initialCategoryEntity"/> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminAddCustomWebSiteToStoreGroupActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminAddCustomWebSiteToStoreGroupActionGroup.xml new file mode 100644 index 0000000000000..cee37d22e7970 --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminAddCustomWebSiteToStoreGroupActionGroup.xml @@ -0,0 +1,34 @@ +<?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="AdminAddCustomWebSiteToStoreGroupActionGroup"> + <annotations> + <description>Goes to the Admin Stores grid page. Searches the grid for the provided Store Group. Edits the Store. Adds the provided Website to the Store. Clicks on Save. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="storeGroup" defaultValue="customStoreGroup"/> + <argument name="website" defaultValue="customWebsite"/> + </arguments> + + <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> + <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> + <fillField userInput="{{storeGroup.name}}" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="fillSearchStoreGroupField"/> + <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> + <see userInput="{{storeGroup.name}}" selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="verifyThatCorrectStoreGroupFound"/> + <click selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="clickEditExistingStoreRow"/> + <waitForPageLoad stepKey="waitForStoreGroupPageLoad"/> + <selectOption selector="{{AdminNewStoreGroupSection.storeGrpWebsiteDropdown}}" userInput="{{website.name}}" stepKey="selectWebsite"/> + <selectOption selector="{{AdminNewStoreGroupSection.storeRootCategoryDropdown}}" userInput="Default Category" stepKey="chooseRootCategory"/> + <click selector="{{AdminNewStoreGroupActionsSection.saveButton}}" stepKey="clickSaveStoreGroup"/> + <conditionalClick selector="{{AdminNewStoreGroupSection.acceptNewStoreGroupCreation}}" dependentSelector="{{AdminNewStoreGroupSection.acceptNewStoreGroupCreation}}" visible="true" stepKey="clickAcceptNewStoreGroupCreationButton"/> + <waitForElementVisible selector="{{AdminStoresGridSection.storeFilterTextField}}" stepKey="waitForPageReload"/> + <see userInput="You saved the store." stepKey="seeSavedMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateNewStoreGroupActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateNewStoreGroupActionGroup.xml index 4c00071da6b61..f1071f2743683 100644 --- a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateNewStoreGroupActionGroup.xml +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateNewStoreGroupActionGroup.xml @@ -31,106 +31,4 @@ <waitForElementVisible selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="waitForStoreGridReload"/> <see userInput="You saved the store." stepKey="seeSavedMessage"/> </actionGroup> - - <actionGroup name="CreateCustomStore"> - <annotations> - <description>Goes to the Admin Stores grid page. Clicks on 'Create Store'. Fills in the provided Details (Website, Store Group Name and Store Group Code). Clicks on Save. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="website" type="string"/> - <argument name="store" type="string"/> - <argument name="rootCategory" type="string"/> - </arguments> - - <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> - <waitForPageLoad stepKey="waitForSystemStorePage"/> - <click selector="{{AdminStoresMainActionsSection.createStoreButton}}" stepKey="selectCreateStore"/> - <selectOption userInput="{{website}}" selector="{{AdminNewStoreGroupSection.storeGrpWebsiteDropdown}}" stepKey="selectMainWebsite"/> - <fillField userInput="{{store}}" selector="{{AdminNewStoreGroupSection.storeGrpNameTextField}}" stepKey="fillStoreName"/> - <fillField userInput="{{store}}" selector="{{AdminNewStoreGroupSection.storeGrpCodeTextField}}" stepKey="fillStoreCode"/> - <selectOption userInput="{{rootCategory}}" selector="{{AdminNewStoreGroupSection.storeRootCategoryDropdown}}" stepKey="selectStoreStatus"/> - <click selector="{{AdminStoreGroupActionsSection.saveButton}}" stepKey="clickSaveStoreGroup"/> - <waitForElementVisible selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="waitForStoreGridReload"/> - <see userInput="You saved the store." stepKey="seeSavedMessage"/> - </actionGroup> - - <actionGroup name="AssertStoreGroupInGrid"> - <annotations> - <description>Goes to the Admin Stores grid page. Searches for the provided Store Group Name. Validates that the provided Store Group Name is present in the grid.</description> - </annotations> - <arguments> - <argument name="storeGroupName" type="string"/> - </arguments> - - <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> - <waitForPageLoad stepKey="waitForAdminSystemStorePageLoad"/> - <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> - <fillField userInput="{{storeGroupName}}" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="fillSearchStoreGroupField"/> - <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> - <waitForPageLoad stepKey="waitForStoreToLoad"/> - <see selector="{{AdminStoresGridSection.nthRow('1')}}" userInput="{{storeGroupName}}" stepKey="seeAssertStoreGroupInGridMessage"/> - </actionGroup> - - <actionGroup name="EditStoreGroupActionGroup"> - <annotations> - <description>Edit store group.</description> - </annotations> - <arguments> - <argument name="storeGroupName" type="string"/> - </arguments> - <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> - <waitForPageLoad stepKey="waitForAdminSystemStorePageLoad"/> - <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> - <waitForPageLoad stepKey="waitForResetResult"/> - <fillField userInput="{{storeGroupName}}" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="fillStoreGroupFilter"/> - <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> - <waitForPageLoad stepKey="waitForSearchResult"/> - <click selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="clicksStoreGroupName"/> - <waitForPageLoad stepKey="waitForStorePageToLoad"/> - </actionGroup> - - <actionGroup name="ChangeDefaultStoreViewActionGroup" extends="EditStoreGroupActionGroup"> - <annotations> - <description>Change the default store view for provided store group.</description> - </annotations> - <arguments> - <argument name="storeViewName" type="string"/> - </arguments> - <selectOption selector="{{AdminEditStoreGroupSection.defaultStoreView}}" userInput="{{storeViewName}}" stepKey="changeDefaultStoreView" after="waitForStorePageToLoad"/> - <click selector="{{AdminStoreGroupActionsSection.saveButton}}" stepKey="clickSaveStoreGroup"/> - <waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitForModal"/> - <see selector="{{AdminConfirmationModalSection.title}}" userInput="Warning message" stepKey="seeWarningAboutTakingALongTimeToComplete"/> - <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmModal"/> - <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="seeForSuccessMessage"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You saved the store." stepKey="seeSuccessMessage"/> - </actionGroup> - - <actionGroup name="AssertDefaultStoreViewActionGroup" extends="EditStoreGroupActionGroup"> - <annotations> - <description>Asserts that the provided store view is default in provided store group.</description> - </annotations> - <arguments> - <argument name="storeViewName" type="string"/> - </arguments> - <seeOptionIsSelected selector="{{AdminEditStoreGroupSection.defaultStoreView}}" userInput="{{storeViewName}}" stepKey="assertDefaultStoreView" after="waitForStorePageToLoad"/> - </actionGroup> - - <actionGroup name="AssertStoreGroupForm"> - <annotations> - <description>Clicks on the 1st Store in the 'Stores' grid. Validates that the provided Details (Website, Store Group Name, Store Group Code and Root Category) are present and correct.</description> - </annotations> - <arguments> - <argument name="website" type="string"/> - <argument name="storeGroupName" type="string"/> - <argument name="storeGroupCode" type="string"/> - <argument name="rootCategory" type="string"/> - </arguments> - - <click selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="clickEditExistingStoreRow"/> - <waitForPageLoad stepKey="waitTillAdminSystemStoreGroupPage"/> - <seeInField selector="{{AdminNewStoreGroupSection.storeGrpWebsiteDropdown}}" userInput="{{website}}" stepKey="seeAssertWebsite"/> - <seeInField selector="{{AdminNewStoreGroupSection.storeGrpNameTextField}}" userInput="{{storeGroupName}}" stepKey="seeAssertStoreGroupName"/> - <seeInField selector="{{AdminNewStoreGroupSection.storeGrpCodeTextField}}" userInput="{{storeGroupCode}}" stepKey="seeAssertStoreGroupCode"/> - <seeInField selector="{{AdminNewStoreGroupSection.storeRootCategoryDropdown}}" userInput="{{rootCategory}}" stepKey="seeAssertRootCategory"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateStoreViewActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateStoreViewActionGroup.xml index 0faf93d4bde14..7df225368779b 100644 --- a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateStoreViewActionGroup.xml +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateStoreViewActionGroup.xml @@ -33,62 +33,4 @@ <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForPageReload"/> <see selector="{{AdminMessagesSection.success}}" userInput="You saved the store view." stepKey="seeSavedMessage"/> </actionGroup> - - <actionGroup name="AdminCreateStoreViewWithoutCheckActionGroup" extends="AdminCreateStoreViewActionGroup"> - <annotations> - <description>EXTENDS: AdminCreateStoreViewActionGroup. Removes 'waitForPageReload' and 'seeSavedMessage'.</description> - </annotations> - - <remove keyForRemoval="waitForPageReload"/> - <remove keyForRemoval="seeSavedMessage"/> - </actionGroup> - - <!--Save the Store view--> - <actionGroup name="AdminCreateStoreViewActionSaveGroup"> - <annotations> - <description>Validates that the Success Message is present and correct.</description> - </annotations> - - <waitForLoadingMaskToDisappear stepKey="waitForGridLoad"/> - <waitForElementVisible selector="{{AdminStoresGridSection.websiteFilterTextField}}" stepKey="waitForStoreGridToReload2"/> - <see userInput="You saved the store view." stepKey="seeSavedMessage"/> - </actionGroup> - - <actionGroup name="navigateToAdminContentManagementPage"> - <annotations> - <description>Goes to the 'Configuration' page for 'Content Management'.</description> - </annotations> - - <amOnPage url="{{AdminContentManagementPage.url}}" stepKey="navigateToConfigurationPage"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - </actionGroup> - - <actionGroup name="saveStoreConfiguration"> - <annotations> - <description>Clicks on the Save button.</description> - </annotations> - - <comment userInput="saveStoreConfiguration" stepKey="comment"/> - <waitForElementVisible selector="{{StoreConfigSection.Save}}" stepKey="waitForSaveButton"/> - <click selector="{{StoreConfigSection.Save}}" stepKey="clickSaveButton"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - </actionGroup> - - <actionGroup name="saveStoreConfigurationAndValidateFieldError"> - <annotations> - <description>Clicks on Save. Validates that the fields are required.</description> - </annotations> - <arguments> - <argument name="inputFieldError" type="string"/> - <argument name="errorMessageSelector" type="string"/> - <argument name="errorMessage" type="string"/> - </arguments> - - <comment userInput="saveStoreConfigurationAndValidateFieldError" stepKey="comment"/> - <waitForElementVisible selector="{{StoreConfigSection.Save}}" stepKey="waitForSaveButton"/> - <click selector="{{StoreConfigSection.Save}}" stepKey="clickSaveButton"/> - <waitForElement selector="{{inputFieldError}}" stepKey="waitForErrorField"/> - <waitForElementVisible selector="{{errorMessageSelector}}" stepKey="waitForErrorMessage"/> - <see selector="{{errorMessageSelector}}" userInput="{{errorMessage}}" stepKey="seeErrorMessage"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateStoreViewSaveActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateStoreViewSaveActionGroup.xml new file mode 100644 index 0000000000000..0d1a2bd5319df --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateStoreViewSaveActionGroup.xml @@ -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="AdminCreateStoreViewSaveActionGroup"> + <annotations> + <description>Validates that the Success Message is present and correct.</description> + </annotations> + + <waitForLoadingMaskToDisappear stepKey="waitForGridLoad"/> + <waitForElementVisible selector="{{AdminStoresGridSection.websiteFilterTextField}}" stepKey="waitForStoreGridToReload2"/> + <see userInput="You saved the store view." stepKey="seeSavedMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateStoreViewWithoutCheckActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateStoreViewWithoutCheckActionGroup.xml new file mode 100644 index 0000000000000..c6837dc55b34e --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateStoreViewWithoutCheckActionGroup.xml @@ -0,0 +1,19 @@ +<?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="AdminCreateStoreViewWithoutCheckActionGroup" extends="AdminCreateStoreViewActionGroup"> + <annotations> + <description>EXTENDS: AdminCreateStoreViewActionGroup. Removes 'waitForPageReload' and 'seeSavedMessage'.</description> + </annotations> + + <remove keyForRemoval="waitForPageReload"/> + <remove keyForRemoval="seeSavedMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateWebsiteActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateWebsiteActionGroup.xml index 6a2f601754c41..19be38d130ace 100644 --- a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateWebsiteActionGroup.xml +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateWebsiteActionGroup.xml @@ -28,56 +28,4 @@ <waitForElementVisible selector="{{AdminStoresGridSection.websiteFilterTextField}}" stepKey="waitForStoreGridToReload"/> <see userInput="You saved the website." stepKey="seeSavedMessage"/> </actionGroup> - - <actionGroup name="AdminGetWebsiteIdActionGroup"> - <!--Get Website_id--> - <annotations> - <description>Goes to the Admin Stores grid page. Filters the grid for the provided Website. Grabs the Website ID from the URL.</description> - </annotations> - <arguments> - <argument name="website"/> - </arguments> - - <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnTheStorePage"/> - <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters"/> - <fillField selector="{{AdminStoresGridSection.websiteFilterTextField}}" userInput="{{website.name}}" stepKey="fillSearchWebsiteField"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFilters"/> - <see selector="{{AdminStoresGridSection.websiteNameInFirstRow}}" userInput="{{website.name}}" stepKey="verifyThatCorrectWebsiteFound"/> - <click selector="{{AdminStoresGridSection.websiteNameInFirstRow}}" stepKey="clickEditExistingWebsite"/> - <grabFromCurrentUrl regex="~(\d+)/~" stepKey="grabFromCurrentUrl"/> - </actionGroup> - - <actionGroup name="AssertWebsiteInGrid"> - <annotations> - <description>Goes to the Admin Stores grid page. Searches the grid for the provided Website Name. Validates that the Website appears in the grid.</description> - </annotations> - <arguments> - <argument name="websiteName" type="string"/> - </arguments> - - <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> - <waitForPageLoad stepKey="waitForAdminSystemStorePageLoad"/> - <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> - <fillField userInput="{{websiteName}}" selector="{{AdminStoresGridSection.websiteFilterTextField}}" stepKey="fillWebsiteField"/> - <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> - <waitForPageLoad stepKey="waitForStoreToLoad"/> - <seeElement selector="{{AdminStoresGridSection.websiteName(websiteName)}}" stepKey="seeAssertWebsiteInGrid"/> - </actionGroup> - - <actionGroup name="AssertWebsiteForm"> - <annotations> - <description>Clicks on the provided Website Name in the Admin Stores grid. Validates that the URL, Website Name/Code are present and correct.</description> - </annotations> - <arguments> - <argument name="websiteName" type="string"/> - <argument name="websiteCode" type="string"/> - </arguments> - - <click selector="{{AdminStoresGridSection.websiteName(websiteName)}}" stepKey="clickWebsiteFirstRowInGrid"/> - <waitForPageLoad stepKey="waitTillWebsiteFormPageIsOpened"/> - <grabFromCurrentUrl regex="~(\d+)/~" stepKey="grabWebsiteIdFromCurrentUrl"/> - <seeInCurrentUrl url="/system_store/editWebsite/website_id/{$grabWebsiteIdFromCurrentUrl}" stepKey="seeWebsiteId"/> - <seeInField selector="{{AdminNewWebsiteSection.name}}" userInput="{{websiteName}}" stepKey="seeAssertWebsiteName"/> - <seeInField selector="{{AdminNewWebsiteSection.code}}" userInput="{{websiteCode}}" stepKey="seeAssertWebsiteCode"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminDeleteStoreViewActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminDeleteStoreViewActionGroup.xml index 7ac300e3ab804..520a80bcbc328 100644 --- a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminDeleteStoreViewActionGroup.xml +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminDeleteStoreViewActionGroup.xml @@ -32,83 +32,4 @@ <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitSuccessMessageAppears"/> <see selector="{{AdminMessagesSection.success}}" userInput="You deleted the store view." stepKey="seeDeleteMessage"/> </actionGroup> - - <actionGroup name="DeleteCustomStoreViewBackupEnabledYesActionGroup"> - <annotations> - <description>Goes to the Admin Stores grid page. Deleted the provided Store while creating a Backup. Validates that the Success Messages (Delete/Backup) are present and correct.</description> - </annotations> - <arguments> - <argument name="storeViewName" type="string"/> - </arguments> - - <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> - <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> - <fillField userInput="{{storeViewName}}" selector="{{AdminStoresGridSection.storeFilterTextField}}" stepKey="fillSearchStoreViewField"/> - <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> - <click selector="{{AdminStoresGridSection.storeNameInFirstRow}}" stepKey="clickEditExistingStoreViewRow"/> - <waitForPageLoad stepKey="waitForStoreToLoad"/> - <click selector="{{AdminNewStoreViewActionsSection.delete}}" stepKey="clickDeleteStoreViewButtonOnEditStorePage"/> - <selectOption userInput="Yes" selector="{{AdminStoreBackupOptionsSection.createBackupSelect}}" stepKey="setCreateDbBackupToYes"/> - <click selector="{{AdminNewStoreViewActionsSection.delete}}" stepKey="clickDeleteStoreViewButtonOnDeleteStorePage"/> - <waitForElementVisible selector="{{AdminConfirmationModalSection.title}}" stepKey="waitingForWarningModal"/> - <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmStoreViewDelete"/> - <waitForPageLoad stepKey="waitForSuccessMessage"/> - <see selector="{{AdminStoresGridSection.successMessage}}" userInput="The database was backed up." stepKey="seeAssertDatabaseBackedUpMessage"/> - <see selector="{{AdminStoresGridSection.successMessage}}" userInput="You deleted the store view." stepKey="seeAssertSuccessDeleteStoreViewMessage"/> - </actionGroup> - - <actionGroup name="AssertStoreViewNotInGrid"> - <annotations> - <description>Goes to the Admin Stores grid page. Searches the grid for the provided Store View name. Validates that it does NOT appear in the grid.</description> - </annotations> - <arguments> - <argument name="storeViewName" type="string"/> - </arguments> - - <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> - <waitForPageLoad stepKey="waitForAdminSystemStorePageLoad"/> - <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> - <fillField userInput="{{storeViewName}}" selector="{{AdminStoresGridSection.storeFilterTextField}}" stepKey="fillSearchStoreViewField"/> - <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> - <waitForPageLoad stepKey="waitForStoreToLoad"/> - <see selector="{{AdminStoresGridSection.emptyText}}" userInput="We couldn't find any records." stepKey="seeAssertStoreViewNotInGridMessage"/> - </actionGroup> - - <actionGroup name="AdminSearchStoreViewByNameActionGroup"> - <annotations> - <description>Goes to the Admin Stores grid page. Clears filters and search by store view name.</description> - </annotations> - <arguments> - <argument name="storeViewName" type="string"/> - </arguments> - - <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> - <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="resetSearchFilter"/> - <fillField selector="{{AdminStoresGridSection.storeFilterTextField}}" userInput="{{storeViewName}}" stepKey="fillSearchStoreViewField"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearchButton"/> - </actionGroup> - - <actionGroup name="AdminDeleteStoreViewIfExistsActionGroup" extends="AdminSearchStoreViewByNameActionGroup"> - <annotations> - <description>EXTENDS: AdminSearchStoreViewByNameActionGroup. Goes to the Admin Stores grid page. Deletes the provided Store (if exists) without creating a Backup. Validates that the Success Message is present and correct.</description> - </annotations> - - <executeInSelenium function="function($webdriver) use ($I) { - $items = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::cssSelector('.col-store_title>a')); - if(!empty($items)) { - $I->click('.col-store_title>a'); - $I->waitForPageLoad(10); - $I->click('#delete'); - $I->waitForPageLoad(30); - $I->selectOption('select#store_create_backup', 'No'); - $I->click('#delete'); - $I->waitForPageLoad(30); - $I->waitForElementVisible('aside.confirm .modal-title', 10); - $I->click('aside.confirm .modal-footer button.action-accept'); - $I->waitForPageLoad(60); - $I->waitForElementVisible('#messages div.message-success', 10); - $I->see('You deleted the store view.', '#messages div.message-success'); - } - }" after="clickSearchButton" stepKey="deleteStoreViewIfExists"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminDeleteStoreViewIfExistsActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminDeleteStoreViewIfExistsActionGroup.xml new file mode 100644 index 0000000000000..6ebf72a893c04 --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminDeleteStoreViewIfExistsActionGroup.xml @@ -0,0 +1,34 @@ +<?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="AdminDeleteStoreViewIfExistsActionGroup" extends="AdminSearchStoreViewByNameActionGroup"> + <annotations> + <description>EXTENDS: AdminSearchStoreViewByNameActionGroup. Goes to the Admin Stores grid page. Deletes the provided Store (if exists) without creating a Backup. Validates that the Success Message is present and correct.</description> + </annotations> + + <executeInSelenium function="function($webdriver) use ($I) { + $items = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::cssSelector('.col-store_title>a')); + if(!empty($items)) { + $I->click('.col-store_title>a'); + $I->waitForPageLoad(10); + $I->click('#delete'); + $I->waitForPageLoad(30); + $I->selectOption('select#store_create_backup', 'No'); + $I->click('#delete'); + $I->waitForPageLoad(30); + $I->waitForElementVisible('aside.confirm .modal-title', 10); + $I->click('aside.confirm .modal-footer button.action-accept'); + $I->waitForPageLoad(60); + $I->waitForElementVisible('#messages div.message-success', 10); + $I->see('You deleted the store view.', '#messages div.message-success'); + } + }" after="clickSearchButton" stepKey="deleteStoreViewIfExists"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminGetWebsiteIdActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminGetWebsiteIdActionGroup.xml new file mode 100644 index 0000000000000..9e58643981506 --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminGetWebsiteIdActionGroup.xml @@ -0,0 +1,28 @@ +<?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="AdminGetWebsiteIdActionGroup"> + <!--Get Website_id--> + <annotations> + <description>Goes to the Admin Stores grid page. Filters the grid for the provided Website. Grabs the Website ID from the URL.</description> + </annotations> + <arguments> + <argument name="website"/> + </arguments> + + <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnTheStorePage"/> + <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters"/> + <fillField selector="{{AdminStoresGridSection.websiteFilterTextField}}" userInput="{{website.name}}" stepKey="fillSearchWebsiteField"/> + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFilters"/> + <see selector="{{AdminStoresGridSection.websiteNameInFirstRow}}" userInput="{{website.name}}" stepKey="verifyThatCorrectWebsiteFound"/> + <click selector="{{AdminStoresGridSection.websiteNameInFirstRow}}" stepKey="clickEditExistingWebsite"/> + <grabFromCurrentUrl regex="~(\d+)/~" stepKey="grabFromCurrentUrl"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminSearchStoreViewByNameActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminSearchStoreViewByNameActionGroup.xml new file mode 100644 index 0000000000000..cb8c798a7eaed --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminSearchStoreViewByNameActionGroup.xml @@ -0,0 +1,24 @@ +<?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="AdminSearchStoreViewByNameActionGroup"> + <annotations> + <description>Goes to the Admin Stores grid page. Clears filters and search by store view name.</description> + </annotations> + <arguments> + <argument name="storeViewName" type="string"/> + </arguments> + + <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> + <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="resetSearchFilter"/> + <fillField selector="{{AdminStoresGridSection.storeFilterTextField}}" userInput="{{storeViewName}}" stepKey="fillSearchStoreViewField"/> + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearchButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminStoreGroupCreateActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminStoreGroupCreateActionGroup.xml index 8afa8df4a5e3d..4da1208717f90 100644 --- a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminStoreGroupCreateActionGroup.xml +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminStoreGroupCreateActionGroup.xml @@ -28,28 +28,4 @@ <waitForElementVisible selector="{{AdminStoresGridSection.storeFilterTextField}}" stepKey="waitForPageReload"/> <see userInput="You saved the store." stepKey="seeSavedMessage"/> </actionGroup> - - <actionGroup name="AdminAddCustomWebSiteToStoreGroup"> - <annotations> - <description>Goes to the Admin Stores grid page. Searches the grid for the provided Store Group. Edits the Store. Adds the provided Website to the Store. Clicks on Save. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="storeGroup" defaultValue="customStoreGroup"/> - <argument name="website" defaultValue="customWebsite"/> - </arguments> - - <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> - <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> - <fillField userInput="{{storeGroup.name}}" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="fillSearchStoreGroupField"/> - <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> - <see userInput="{{storeGroup.name}}" selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="verifyThatCorrectStoreGroupFound"/> - <click selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="clickEditExistingStoreRow"/> - <waitForPageLoad stepKey="waitForStoreGroupPageLoad"/> - <selectOption selector="{{AdminNewStoreGroupSection.storeGrpWebsiteDropdown}}" userInput="{{website.name}}" stepKey="selectWebsite"/> - <selectOption selector="{{AdminNewStoreGroupSection.storeRootCategoryDropdown}}" userInput="Default Category" stepKey="chooseRootCategory"/> - <click selector="{{AdminNewStoreGroupActionsSection.saveButton}}" stepKey="clickSaveStoreGroup"/> - <conditionalClick selector="{{AdminNewStoreGroupSection.acceptNewStoreGroupCreation}}" dependentSelector="{{AdminNewStoreGroupSection.acceptNewStoreGroupCreation}}" visible="true" stepKey="clickAcceptNewStoreGroupCreationButton"/> - <waitForElementVisible selector="{{AdminStoresGridSection.storeFilterTextField}}" stepKey="waitForPageReload"/> - <see userInput="You saved the store." stepKey="seeSavedMessage"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminSwitchStoreViewActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminSwitchStoreViewActionGroup.xml index 22b5d22c2fcc9..13e9beff9745b 100644 --- a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminSwitchStoreViewActionGroup.xml +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminSwitchStoreViewActionGroup.xml @@ -15,7 +15,7 @@ <arguments> <argument name="storeView" defaultValue="customStore.name"/> </arguments> - + <click selector="{{AdminMainActionsSection.storeViewDropdown}}" stepKey="clickStoreViewSwitchDropdown"/> <waitForElementVisible selector="{{AdminMainActionsSection.storeViewByName('Default Store View')}}" stepKey="waitForStoreViewsAreVisible"/> <click selector="{{AdminMainActionsSection.storeViewByName(storeView)}}" stepKey="clickStoreViewByName"/> @@ -25,13 +25,4 @@ <scrollToTopOfPage stepKey="scrollToStoreSwitcher"/> <see userInput="{{storeView}}" selector="{{AdminMainActionsSection.storeSwitcher}}" stepKey="seeNewStoreViewName"/> </actionGroup> - - <actionGroup name="AdminSwitchToAllStoreViewActionGroup" extends="AdminSwitchStoreViewActionGroup"> - <annotations> - <description>EXTENDS: AdminSwitchStoreViewActionGroup. Clicks on the 'All Store Views' drop down menu. Validates that the 'All Store Views' options is present and correct.</description> - </annotations> - - <click selector="{{AdminMainActionsSection.allStoreViews}}" stepKey="clickStoreViewByName" after="waitForStoreViewsAreVisible"/> - <see selector="{{AdminMainActionsSection.storeSwitcher}}" userInput="All Store Views" stepKey="seeNewStoreViewName" after="waitForStoreViewSwitched"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminSwitchToAllStoreViewActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminSwitchToAllStoreViewActionGroup.xml new file mode 100644 index 0000000000000..fe56aa128dd7e --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminSwitchToAllStoreViewActionGroup.xml @@ -0,0 +1,19 @@ +<?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="AdminSwitchToAllStoreViewActionGroup" extends="AdminSwitchStoreViewActionGroup"> + <annotations> + <description>EXTENDS: AdminSwitchStoreViewActionGroup. Clicks on the 'All Store Views' drop down menu. Validates that the 'All Store Views' options is present and correct.</description> + </annotations> + + <click selector="{{AdminMainActionsSection.allStoreViews}}" stepKey="clickStoreViewByName" after="waitForStoreViewsAreVisible"/> + <see selector="{{AdminMainActionsSection.storeSwitcher}}" userInput="All Store Views" stepKey="seeNewStoreViewName" after="waitForStoreViewSwitched"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertDefaultStoreViewActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertDefaultStoreViewActionGroup.xml new file mode 100644 index 0000000000000..e899241cfdd1f --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertDefaultStoreViewActionGroup.xml @@ -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="AssertDefaultStoreViewActionGroup" extends="EditStoreGroupActionGroup"> + <annotations> + <description>Asserts that the provided store view is default in provided store group.</description> + </annotations> + <arguments> + <argument name="storeViewName" type="string"/> + </arguments> + <seeOptionIsSelected selector="{{AdminEditStoreGroupSection.defaultStoreView}}" userInput="{{storeViewName}}" stepKey="assertDefaultStoreView" after="waitForStorePageToLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertStoreNotInGridActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertStoreNotInGridActionGroup.xml new file mode 100644 index 0000000000000..3c9ebe0daa14e --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertStoreNotInGridActionGroup.xml @@ -0,0 +1,27 @@ +<?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="AssertStoreNotInGridActionGroup"> + <annotations> + <description>Goes to the Admin Stores grid page. Validates that the provided Store Group Name is NOT present in the grid.</description> + </annotations> + <arguments> + <argument name="storeGroupName" type="string"/> + </arguments> + + <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> + <waitForPageLoad stepKey="waitForAdminSystemStorePageLoad"/> + <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> + <fillField userInput="{{storeGroupName}}" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="fillSearchStoreGroupField"/> + <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> + <waitForPageLoad stepKey="waitForStoreToLoad"/> + <see selector="{{AdminStoresGridSection.emptyText}}" userInput="We couldn't find any records." stepKey="seeAssertStoreGroupNotInGridMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertStoreViewNotInGridActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertStoreViewNotInGridActionGroup.xml new file mode 100644 index 0000000000000..b258f2e826200 --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertStoreViewNotInGridActionGroup.xml @@ -0,0 +1,27 @@ +<?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="AssertStoreViewNotInGridActionGroup"> + <annotations> + <description>Goes to the Admin Stores grid page. Searches the grid for the provided Store View name. Validates that it does NOT appear in the grid.</description> + </annotations> + <arguments> + <argument name="storeViewName" type="string"/> + </arguments> + + <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> + <waitForPageLoad stepKey="waitForAdminSystemStorePageLoad"/> + <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> + <fillField userInput="{{storeViewName}}" selector="{{AdminStoresGridSection.storeFilterTextField}}" stepKey="fillSearchStoreViewField"/> + <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> + <waitForPageLoad stepKey="waitForStoreToLoad"/> + <see selector="{{AdminStoresGridSection.emptyText}}" userInput="We couldn't find any records." stepKey="seeAssertStoreViewNotInGridMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertWebsiteFormActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertWebsiteFormActionGroup.xml new file mode 100644 index 0000000000000..3738d975e5131 --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertWebsiteFormActionGroup.xml @@ -0,0 +1,27 @@ +<?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="AssertWebsiteFormActionGroup"> + <annotations> + <description>Clicks on the provided Website Name in the Admin Stores grid. Validates that the URL, Website Name/Code are present and correct.</description> + </annotations> + <arguments> + <argument name="websiteName" type="string"/> + <argument name="websiteCode" type="string"/> + </arguments> + + <click selector="{{AdminStoresGridSection.websiteName(websiteName)}}" stepKey="clickWebsiteFirstRowInGrid"/> + <waitForPageLoad stepKey="waitTillWebsiteFormPageIsOpened"/> + <grabFromCurrentUrl regex="~(\d+)/~" stepKey="grabWebsiteIdFromCurrentUrl"/> + <seeInCurrentUrl url="/system_store/editWebsite/website_id/{$grabWebsiteIdFromCurrentUrl}" stepKey="seeWebsiteId"/> + <seeInField selector="{{AdminNewWebsiteSection.name}}" userInput="{{websiteName}}" stepKey="seeAssertWebsiteName"/> + <seeInField selector="{{AdminNewWebsiteSection.code}}" userInput="{{websiteCode}}" stepKey="seeAssertWebsiteCode"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertWebsiteInGridActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertWebsiteInGridActionGroup.xml new file mode 100644 index 0000000000000..0835e3bc330b0 --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertWebsiteInGridActionGroup.xml @@ -0,0 +1,27 @@ +<?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="AssertWebsiteInGridActionGroup"> + <annotations> + <description>Goes to the Admin Stores grid page. Searches the grid for the provided Website Name. Validates that the Website appears in the grid.</description> + </annotations> + <arguments> + <argument name="websiteName" type="string"/> + </arguments> + + <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> + <waitForPageLoad stepKey="waitForAdminSystemStorePageLoad"/> + <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> + <fillField userInput="{{websiteName}}" selector="{{AdminStoresGridSection.websiteFilterTextField}}" stepKey="fillWebsiteField"/> + <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> + <waitForPageLoad stepKey="waitForStoreToLoad"/> + <seeElement selector="{{AdminStoresGridSection.websiteName(websiteName)}}" stepKey="seeAssertWebsiteInGrid"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/ChangeDefaultStoreViewActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/ChangeDefaultStoreViewActionGroup.xml new file mode 100644 index 0000000000000..40ebb95e9cdb2 --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/ChangeDefaultStoreViewActionGroup.xml @@ -0,0 +1,26 @@ +<?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="ChangeDefaultStoreViewActionGroup" extends="EditStoreGroupActionGroup"> + <annotations> + <description>Change the default store view for provided store group.</description> + </annotations> + <arguments> + <argument name="storeViewName" type="string"/> + </arguments> + <selectOption selector="{{AdminEditStoreGroupSection.defaultStoreView}}" userInput="{{storeViewName}}" stepKey="changeDefaultStoreView" after="waitForStorePageToLoad"/> + <click selector="{{AdminStoreGroupActionsSection.saveButton}}" stepKey="clickSaveStoreGroup"/> + <waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitForModal"/> + <see selector="{{AdminConfirmationModalSection.title}}" userInput="Warning message" stepKey="seeWarningAboutTakingALongTimeToComplete"/> + <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmModal"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="seeForSuccessMessage"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You saved the store." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/CreateCustomStoreActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/CreateCustomStoreActionGroup.xml new file mode 100644 index 0000000000000..627b8f0b096a1 --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/CreateCustomStoreActionGroup.xml @@ -0,0 +1,32 @@ +<?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="CreateCustomStoreActionGroup"> + <annotations> + <description>Goes to the Admin Stores grid page. Clicks on 'Create Store'. Fills in the provided Details (Website, Store Group Name and Store Group Code). Clicks on Save. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="website" type="string"/> + <argument name="store" type="string"/> + <argument name="rootCategory" type="string"/> + </arguments> + + <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> + <waitForPageLoad stepKey="waitForSystemStorePage"/> + <click selector="{{AdminStoresMainActionsSection.createStoreButton}}" stepKey="selectCreateStore"/> + <selectOption userInput="{{website}}" selector="{{AdminNewStoreGroupSection.storeGrpWebsiteDropdown}}" stepKey="selectMainWebsite"/> + <fillField userInput="{{store}}" selector="{{AdminNewStoreGroupSection.storeGrpNameTextField}}" stepKey="fillStoreName"/> + <fillField userInput="{{store}}" selector="{{AdminNewStoreGroupSection.storeGrpCodeTextField}}" stepKey="fillStoreCode"/> + <selectOption userInput="{{rootCategory}}" selector="{{AdminNewStoreGroupSection.storeRootCategoryDropdown}}" stepKey="selectStoreStatus"/> + <click selector="{{AdminStoreGroupActionsSection.saveButton}}" stepKey="clickSaveStoreGroup"/> + <waitForElementVisible selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="waitForStoreGridReload"/> + <see userInput="You saved the store." stepKey="seeSavedMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/CreateCustomStoreViewActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/CreateCustomStoreViewActionGroup.xml index 290d0ad623bad..cf57afc5f7439 100644 --- a/app/code/Magento/Store/Test/Mftf/ActionGroup/CreateCustomStoreViewActionGroup.xml +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/CreateCustomStoreViewActionGroup.xml @@ -26,26 +26,4 @@ <waitForPageLoad stepKey="waitForPageLoad2"/> <conditionalClick selector="{{AdminNewStoreSection.acceptNewStoreViewCreation}}" dependentSelector="{{AdminNewStoreSection.acceptNewStoreViewCreation}}" visible="true" stepKey="clickAcceptNewStoreViewCreationButton"/> </actionGroup> - - <actionGroup name="CreateStoreView"> - <annotations> - <description>Goes to the Admin Store Views creation page. Fills in the provided Store View, Store Group Name and Store View Status. Clicks on Save. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="storeView" defaultValue="customStore"/> - <argument name="storeGroupName" defaultValue="_defaultStoreGroup.name"/> - <argument name="storeViewStatus" defaultValue="_defaultStore.is_active"/> - </arguments> - - <amOnPage url="{{AdminSystemStoreViewPage.url}}" stepKey="amOnAdminSystemStoreViewPage"/> - <waitForPageLoad stepKey="waitForProductPageLoad"/> - <selectOption userInput="{{storeGroupName}}" selector="{{AdminNewStoreSection.storeGrpDropdown}}" stepKey="selectStoreGroup"/> - <fillField userInput="{{storeView.name}}" selector="{{AdminNewStoreSection.storeNameTextField}}" stepKey="fillStoreViewName"/> - <fillField userInput="{{storeView.code}}" selector="{{AdminNewStoreSection.storeCodeTextField}}" stepKey="fillStoreViewCode"/> - <selectOption userInput="{{storeViewStatus}}" selector="{{AdminNewStoreSection.statusDropdown}}" stepKey="selectStoreViewStatus"/> - <click selector="{{AdminStoresMainActionsSection.saveButton}}" stepKey="clickSaveStoreViewButton"/> - <waitForElementVisible selector="{{AdminNewStoreSection.acceptNewStoreViewCreation}}" stepKey="waitForAcceptNewStoreViewCreationButton"/> - <conditionalClick selector="{{AdminNewStoreSection.acceptNewStoreViewCreation}}" dependentSelector="{{AdminNewStoreSection.acceptNewStoreViewCreation}}" visible="true" stepKey="clickAcceptNewStoreViewCreationButton"/> - <see userInput="You saved the store view." stepKey="seeSavedMessage"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/CreateStoreViewActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/CreateStoreViewActionGroup.xml new file mode 100644 index 0000000000000..916048e33ea44 --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/CreateStoreViewActionGroup.xml @@ -0,0 +1,32 @@ +<?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="CreateStoreViewActionGroup"> + <annotations> + <description>Goes to the Admin Store Views creation page. Fills in the provided Store View, Store Group Name and Store View Status. Clicks on Save. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="storeView" defaultValue="customStore"/> + <argument name="storeGroupName" defaultValue="_defaultStoreGroup.name"/> + <argument name="storeViewStatus" defaultValue="_defaultStore.is_active"/> + </arguments> + + <amOnPage url="{{AdminSystemStoreViewPage.url}}" stepKey="amOnAdminSystemStoreViewPage"/> + <waitForPageLoad stepKey="waitForProductPageLoad"/> + <selectOption userInput="{{storeGroupName}}" selector="{{AdminNewStoreSection.storeGrpDropdown}}" stepKey="selectStoreGroup"/> + <fillField userInput="{{storeView.name}}" selector="{{AdminNewStoreSection.storeNameTextField}}" stepKey="fillStoreViewName"/> + <fillField userInput="{{storeView.code}}" selector="{{AdminNewStoreSection.storeCodeTextField}}" stepKey="fillStoreViewCode"/> + <selectOption userInput="{{storeViewStatus}}" selector="{{AdminNewStoreSection.statusDropdown}}" stepKey="selectStoreViewStatus"/> + <click selector="{{AdminStoresMainActionsSection.saveButton}}" stepKey="clickSaveStoreViewButton"/> + <waitForElementVisible selector="{{AdminNewStoreSection.acceptNewStoreViewCreation}}" stepKey="waitForAcceptNewStoreViewCreationButton"/> + <conditionalClick selector="{{AdminNewStoreSection.acceptNewStoreViewCreation}}" dependentSelector="{{AdminNewStoreSection.acceptNewStoreViewCreation}}" visible="true" stepKey="clickAcceptNewStoreViewCreationButton"/> + <see userInput="You saved the store view." stepKey="seeSavedMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/DeleteCustomStoreActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/DeleteCustomStoreActionGroup.xml index a4d4374704291..848fd5cf49d07 100644 --- a/app/code/Magento/Store/Test/Mftf/ActionGroup/DeleteCustomStoreActionGroup.xml +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/DeleteCustomStoreActionGroup.xml @@ -29,43 +29,4 @@ <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/> <see selector="{{AdminMessagesSection.success}}" userInput="You deleted the store." stepKey="seeSuccessMessage"/> </actionGroup> - - <actionGroup name="DeleteCustomStoreBackupEnabledYesActionGroup"> - <annotations> - <description>Goes to the Admin Stores grid page. Deletes the provided Store Group Name while creating a DB backup. Validates that the Success Messages are present and correct.</description> - </annotations> - <arguments> - <argument name="storeGroupName" type="string"/> - </arguments> - - <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> - <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> - <fillField userInput="{{storeGroupName}}" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="fillSearchStoreGroupField"/> - <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> - <see userInput="{{storeGroupName}}" selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="verifyThatCorrectStoreGroupFound"/> - <click selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="clickEditExistingStoreRow"/> - <waitForPageLoad stepKey="waitForStoreToLoad"/> - <click selector="{{AdminStoresMainActionsSection.deleteButton}}" stepKey="clickDeleteStoreGroupButtonOnEditStorePage"/> - <selectOption userInput="Yes" selector="{{AdminStoresDeleteStoreGroupSection.createDbBackup}}" stepKey="setCreateDbBackupToNo"/> - <click selector="{{AdminStoresDeleteStoreGroupSection.deleteStoreGroupButton}}" stepKey="clickDeleteStoreGroupButtonOnDeleteStorePage"/> - <see selector="{{AdminStoresGridSection.successMessage}}" userInput="The database was backed up." stepKey="seeAssertDatabaseBackedUpMessage"/> - <see selector="{{AdminStoresGridSection.successMessage}}" userInput="You deleted the store." stepKey="seeAssertSuccessDeleteStoreGroupMessage"/> - </actionGroup> - - <actionGroup name="AssertStoreNotInGrid"> - <annotations> - <description>Goes to the Admin Stores grid page. Validates that the provided Store Group Name is NOT present in the grid.</description> - </annotations> - <arguments> - <argument name="storeGroupName" type="string"/> - </arguments> - - <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> - <waitForPageLoad stepKey="waitForAdminSystemStorePageLoad"/> - <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> - <fillField userInput="{{storeGroupName}}" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="fillSearchStoreGroupField"/> - <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> - <waitForPageLoad stepKey="waitForStoreToLoad"/> - <see selector="{{AdminStoresGridSection.emptyText}}" userInput="We couldn't find any records." stepKey="seeAssertStoreGroupNotInGridMessage"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/DeleteCustomStoreBackupEnabledYesActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/DeleteCustomStoreBackupEnabledYesActionGroup.xml new file mode 100644 index 0000000000000..97fb6a83ab06f --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/DeleteCustomStoreBackupEnabledYesActionGroup.xml @@ -0,0 +1,32 @@ +<?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="DeleteCustomStoreBackupEnabledYesActionGroup"> + <annotations> + <description>Goes to the Admin Stores grid page. Deletes the provided Store Group Name while creating a DB backup. Validates that the Success Messages are present and correct.</description> + </annotations> + <arguments> + <argument name="storeGroupName" type="string"/> + </arguments> + + <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> + <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> + <fillField userInput="{{storeGroupName}}" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="fillSearchStoreGroupField"/> + <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> + <see userInput="{{storeGroupName}}" selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="verifyThatCorrectStoreGroupFound"/> + <click selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="clickEditExistingStoreRow"/> + <waitForPageLoad stepKey="waitForStoreToLoad"/> + <click selector="{{AdminStoresMainActionsSection.deleteButton}}" stepKey="clickDeleteStoreGroupButtonOnEditStorePage"/> + <selectOption userInput="Yes" selector="{{AdminStoresDeleteStoreGroupSection.createDbBackup}}" stepKey="setCreateDbBackupToNo"/> + <click selector="{{AdminStoresDeleteStoreGroupSection.deleteStoreGroupButton}}" stepKey="clickDeleteStoreGroupButtonOnDeleteStorePage"/> + <see selector="{{AdminStoresGridSection.successMessage}}" userInput="The database was backed up." stepKey="seeAssertDatabaseBackedUpMessage"/> + <see selector="{{AdminStoresGridSection.successMessage}}" userInput="You deleted the store." stepKey="seeAssertSuccessDeleteStoreGroupMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/DeleteCustomStoreViewBackupEnabledYesActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/DeleteCustomStoreViewBackupEnabledYesActionGroup.xml new file mode 100644 index 0000000000000..f670a4771ca5c --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/DeleteCustomStoreViewBackupEnabledYesActionGroup.xml @@ -0,0 +1,34 @@ +<?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="DeleteCustomStoreViewBackupEnabledYesActionGroup"> + <annotations> + <description>Goes to the Admin Stores grid page. Deleted the provided Store while creating a Backup. Validates that the Success Messages (Delete/Backup) are present and correct.</description> + </annotations> + <arguments> + <argument name="storeViewName" type="string"/> + </arguments> + + <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> + <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> + <fillField userInput="{{storeViewName}}" selector="{{AdminStoresGridSection.storeFilterTextField}}" stepKey="fillSearchStoreViewField"/> + <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> + <click selector="{{AdminStoresGridSection.storeNameInFirstRow}}" stepKey="clickEditExistingStoreViewRow"/> + <waitForPageLoad stepKey="waitForStoreToLoad"/> + <click selector="{{AdminNewStoreViewActionsSection.delete}}" stepKey="clickDeleteStoreViewButtonOnEditStorePage"/> + <selectOption userInput="Yes" selector="{{AdminStoreBackupOptionsSection.createBackupSelect}}" stepKey="setCreateDbBackupToYes"/> + <click selector="{{AdminNewStoreViewActionsSection.delete}}" stepKey="clickDeleteStoreViewButtonOnDeleteStorePage"/> + <waitForElementVisible selector="{{AdminConfirmationModalSection.title}}" stepKey="waitingForWarningModal"/> + <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmStoreViewDelete"/> + <waitForPageLoad stepKey="waitForSuccessMessage"/> + <see selector="{{AdminStoresGridSection.successMessage}}" userInput="The database was backed up." stepKey="seeAssertDatabaseBackedUpMessage"/> + <see selector="{{AdminStoresGridSection.successMessage}}" userInput="You deleted the store view." stepKey="seeAssertSuccessDeleteStoreViewMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/EditCustomStoreGroupAcceptWarningMessageActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/EditCustomStoreGroupAcceptWarningMessageActionGroup.xml index 5493ae7399ddd..1c2ae675573a8 100644 --- a/app/code/Magento/Store/Test/Mftf/ActionGroup/EditCustomStoreGroupAcceptWarningMessageActionGroup.xml +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/EditCustomStoreGroupAcceptWarningMessageActionGroup.xml @@ -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="EditCustomStoreGroupAcceptWarningMessageActionGroup" extends="CreateCustomStore"> + <actionGroup name="EditCustomStoreGroupAcceptWarningMessageActionGroup" extends="CreateCustomStoreActionGroup"> <!-- Admin creates new Store group --> <annotations> <description>EXTENDS: CreateCustomStore. Removes 'selectCreateStore'. Clicks on the 1st row. Clicks on Ok.</description> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/EditStoreGroupActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/EditStoreGroupActionGroup.xml new file mode 100644 index 0000000000000..7e2a0ac443d51 --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/EditStoreGroupActionGroup.xml @@ -0,0 +1,28 @@ +<?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="EditStoreGroupActionGroup"> + <annotations> + <description>Edit store group.</description> + </annotations> + <arguments> + <argument name="storeGroupName" type="string"/> + </arguments> + <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> + <waitForPageLoad stepKey="waitForAdminSystemStorePageLoad"/> + <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> + <waitForPageLoad stepKey="waitForResetResult"/> + <fillField userInput="{{storeGroupName}}" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="fillStoreGroupFilter"/> + <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> + <waitForPageLoad stepKey="waitForSearchResult"/> + <click selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="clicksStoreGroupName"/> + <waitForPageLoad stepKey="waitForStorePageToLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/NavigateToAdminContentManagementPageActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/NavigateToAdminContentManagementPageActionGroup.xml new file mode 100644 index 0000000000000..bf3a3b2f8509e --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/NavigateToAdminContentManagementPageActionGroup.xml @@ -0,0 +1,19 @@ +<?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="NavigateToAdminContentManagementPageActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'Content Management'.</description> + </annotations> + + <amOnPage url="{{AdminContentManagementPage.url}}" stepKey="navigateToConfigurationPage"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/SaveStoreConfigurationActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/SaveStoreConfigurationActionGroup.xml new file mode 100644 index 0000000000000..ce68b7a05b8d2 --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/SaveStoreConfigurationActionGroup.xml @@ -0,0 +1,21 @@ +<?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="SaveStoreConfigurationActionGroup"> + <annotations> + <description>Clicks on the Save button.</description> + </annotations> + + <comment userInput="saveStoreConfiguration" stepKey="comment"/> + <waitForElementVisible selector="{{StoreConfigSection.Save}}" stepKey="waitForSaveButton"/> + <click selector="{{StoreConfigSection.Save}}" stepKey="clickSaveButton"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/SaveStoreConfigurationAndValidateFieldErrorActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/SaveStoreConfigurationAndValidateFieldErrorActionGroup.xml new file mode 100644 index 0000000000000..82b591e8f92dc --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/SaveStoreConfigurationAndValidateFieldErrorActionGroup.xml @@ -0,0 +1,28 @@ +<?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="SaveStoreConfigurationAndValidateFieldErrorActionGroup"> + <annotations> + <description>Clicks on Save. Validates that the fields are required.</description> + </annotations> + <arguments> + <argument name="inputFieldError" type="string"/> + <argument name="errorMessageSelector" type="string"/> + <argument name="errorMessage" type="string"/> + </arguments> + + <comment userInput="saveStoreConfigurationAndValidateFieldError" stepKey="comment"/> + <waitForElementVisible selector="{{StoreConfigSection.Save}}" stepKey="waitForSaveButton"/> + <click selector="{{StoreConfigSection.Save}}" stepKey="clickSaveButton"/> + <waitForElement selector="{{inputFieldError}}" stepKey="waitForErrorField"/> + <waitForElementVisible selector="{{errorMessageSelector}}" stepKey="waitForErrorMessage"/> + <see selector="{{errorMessageSelector}}" userInput="{{errorMessage}}" stepKey="seeErrorMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/StorefrontSwitchDefaultStoreViewActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/StorefrontSwitchDefaultStoreViewActionGroup.xml new file mode 100644 index 0000000000000..e3b3cc7c1a9ff --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/StorefrontSwitchDefaultStoreViewActionGroup.xml @@ -0,0 +1,19 @@ +<?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="StorefrontSwitchDefaultStoreViewActionGroup" extends="StorefrontSwitchStoreViewActionGroup"> + <annotations> + <description>EXTENDS: StorefrontSwitchStoreViewActionGroup. Clicks on the Default Store View.</description> + </annotations> + + <remove keyForRemoval="clickSelectStoreView"/> + <click selector="{{StorefrontHeaderSection.storeViewOption('default')}}" stepKey="clickSelectDefaultStoreView" after="waitForStoreViewDropdown"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/StorefrontSwitchStoreViewActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/StorefrontSwitchStoreViewActionGroup.xml index 62ebdb6e8e9eb..9d8fb267910e1 100644 --- a/app/code/Magento/Store/Test/Mftf/ActionGroup/StorefrontSwitchStoreViewActionGroup.xml +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/StorefrontSwitchStoreViewActionGroup.xml @@ -15,19 +15,10 @@ <arguments> <argument name="storeView" defaultValue="customStore"/> </arguments> - + <click selector="{{StorefrontHeaderSection.storeViewSwitcher}}" stepKey="clickStoreViewSwitcher"/> <waitForElementVisible selector="{{StorefrontHeaderSection.storeViewDropdown}}" stepKey="waitForStoreViewDropdown"/> <click selector="{{StorefrontHeaderSection.storeViewOption(storeView.code)}}" stepKey="clickSelectStoreView"/> <waitForPageLoad stepKey="waitForPageLoad"/> </actionGroup> - - <actionGroup name="StorefrontSwitchDefaultStoreViewActionGroup" extends="StorefrontSwitchStoreViewActionGroup"> - <annotations> - <description>EXTENDS: StorefrontSwitchStoreViewActionGroup. Clicks on the Default Store View.</description> - </annotations> - - <remove keyForRemoval="clickSelectStoreView"/> - <click selector="{{StorefrontHeaderSection.storeViewOption('default')}}" stepKey="clickSelectDefaultStoreView" after="waitForStoreViewDropdown"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateCustomStoreViewStatusEnabledVerifyAbsenceOfDeleteButtonTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateCustomStoreViewStatusEnabledVerifyAbsenceOfDeleteButtonTest.xml index 7cd44d4d0ae88..5d4ac8de74680 100644 --- a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateCustomStoreViewStatusEnabledVerifyAbsenceOfDeleteButtonTest.xml +++ b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateCustomStoreViewStatusEnabledVerifyAbsenceOfDeleteButtonTest.xml @@ -39,7 +39,7 @@ </actionGroup> <!--Save the above store view and verify AssertStoreViewSuccessSaveMessage--> - <actionGroup ref="AdminCreateStoreViewActionSaveGroup" stepKey="verifyAssertStoreViewSuccessSaveMessage"/> + <actionGroup ref="AdminCreateStoreViewSaveActionGroup" stepKey="verifyAssertStoreViewSuccessSaveMessage"/> <!--Search store view(from above step) in grid--> <actionGroup ref="AssertStoreViewInGridActionGroup" stepKey="searchStoreViewInGrid"> @@ -56,4 +56,4 @@ <!--Go to store view form page and verify AssertStoreNoDeleteButton--> <dontSee selector="{{AdminNewStoreViewActionsSection.delete}}" stepKey="AssertStoreNoDeleteButton"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateCustomStoreViewStatusEnabledVerifyBackendAndFrontendTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateCustomStoreViewStatusEnabledVerifyBackendAndFrontendTest.xml index 18485abadc008..2ba8c675b3b2a 100644 --- a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateCustomStoreViewStatusEnabledVerifyBackendAndFrontendTest.xml +++ b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateCustomStoreViewStatusEnabledVerifyBackendAndFrontendTest.xml @@ -39,7 +39,7 @@ </actionGroup> <!--Save the above store view and verify AssertStoreViewSuccessSaveMessage--> - <actionGroup ref="AdminCreateStoreViewActionSaveGroup" stepKey="verifyAssertStoreViewSuccessSaveMessage"/> + <actionGroup ref="AdminCreateStoreViewSaveActionGroup" stepKey="verifyAssertStoreViewSuccessSaveMessage"/> <!--Search store view(from above step) in grid and verify AssertStoreInGrid--> <actionGroup ref="AssertStoreViewInGridActionGroup" stepKey="searchStoreViewInGrid"> @@ -66,4 +66,4 @@ <argument name="customStore" value="{{customStore.name}}"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateNewLocalizedStoreViewStatusEnabledTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateNewLocalizedStoreViewStatusEnabledTest.xml index 8e9fe1e71ceb4..6c60445107b28 100644 --- a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateNewLocalizedStoreViewStatusEnabledTest.xml +++ b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateNewLocalizedStoreViewStatusEnabledTest.xml @@ -33,11 +33,11 @@ </actionGroup> <!--Save the above store view and verify AssertStoreViewSuccessSaveMessage--> - <actionGroup ref="AdminCreateStoreViewActionSaveGroup" stepKey="verifyAssertStoreViewSuccessSaveMessage"/> + <actionGroup ref="AdminCreateStoreViewSaveActionGroup" stepKey="verifyAssertStoreViewSuccessSaveMessage"/> <!--Search store view(from above step) in grid and verify AssertStoreInGrid--> <actionGroup ref="AssertStoreViewInGridActionGroup" stepKey="searchStoreViewInGrid"> <argument name="storeViewName" value="{{storeViewGermany.name}}"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreGroupWithCustomWebsiteAndDefaultCategoryTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreGroupWithCustomWebsiteAndDefaultCategoryTest.xml index 8e8f31eaca865..4892556929f80 100644 --- a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreGroupWithCustomWebsiteAndDefaultCategoryTest.xml +++ b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreGroupWithCustomWebsiteAndDefaultCategoryTest.xml @@ -34,19 +34,19 @@ </after> <!--Create custom store group with custom website and default category and verify AssertStoreGroupSuccessSaveMessage--> - <actionGroup ref="CreateCustomStore" stepKey="createCustomStoreGroup"> + <actionGroup ref="CreateCustomStoreActionGroup" stepKey="createCustomStoreGroup"> <argument name="website" value="{{customWebsite.name}}"/> <argument name="store" value="{{customStoreGroup.name}}"/> <argument name="rootCategory" value="Default Category"/> </actionGroup> <!--Search created store group(from above step) in grid and verify AssertStoreGroupInGrid message--> - <actionGroup ref="AssertStoreGroupInGrid" stepKey="seeCreatedStoreGroupInGrid"> + <actionGroup ref="AssertStoreGroupInGridActionGroup" stepKey="seeCreatedStoreGroupInGrid"> <argument name="storeGroupName" value="{{customStoreGroup.name}}"/> </actionGroup> <!--Go to store group form page and verify AssertStoreGroupForm--> - <actionGroup ref="AssertStoreGroupForm" stepKey="seeCreatedStoreGroupForm"> + <actionGroup ref="AssertStoreGroupFormActionGroup" stepKey="seeCreatedStoreGroupForm"> <argument name="website" value="{{customWebsite.name}}"/> <argument name="storeGroupName" value="{{customStoreGroup.name}}"/> <argument name="storeGroupCode" value="{{customStoreGroup.code}}"/> @@ -55,4 +55,4 @@ <!--Also verify absence of delete button on store group form page(AssertStoreGroupNoDeleteButton)--> <dontSee selector="{{AdminStoresMainActionsSection.deleteButton}}" stepKey="AssertStoreGroupNoDeleteButton"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreGroupWithCustomWebsiteAndRootCategoryTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreGroupWithCustomWebsiteAndRootCategoryTest.xml index 18f9822145dec..27037f45f3835 100644 --- a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreGroupWithCustomWebsiteAndRootCategoryTest.xml +++ b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreGroupWithCustomWebsiteAndRootCategoryTest.xml @@ -42,23 +42,23 @@ </after> <!--Create custom store group with custom website and root category and verify AssertStoreGroupSuccessSaveMessage--> - <actionGroup ref="CreateCustomStore" stepKey="createCustomStoreGroup"> + <actionGroup ref="CreateCustomStoreActionGroup" stepKey="createCustomStoreGroup"> <argument name="website" value="{{customWebsite.name}}"/> <argument name="store" value="{{customStoreGroup.name}}"/> <argument name="rootCategory" value="$$rootCategory.name$$"/> </actionGroup> <!--Search created store group(from above step) in grid and verify AssertStoreGroupInGrid--> - <actionGroup ref="AssertStoreGroupInGrid" stepKey="seeCreatedStoreGroupInGrid"> + <actionGroup ref="AssertStoreGroupInGridActionGroup" stepKey="seeCreatedStoreGroupInGrid"> <argument name="storeGroupName" value="{{customStoreGroup.name}}"/> </actionGroup> <!--Go to store group form page and verify AssertStoreGroupForm and AssertStoreGroupOnStoreViewForm--> - <actionGroup ref="AssertStoreGroupForm" stepKey="seeCreatedStoreGroupInForm"> + <actionGroup ref="AssertStoreGroupFormActionGroup" stepKey="seeCreatedStoreGroupInForm"> <argument name="website" value="{{customWebsite.name}}"/> <argument name="storeGroupName" value="{{customStoreGroup.name}}"/> <argument name="storeGroupCode" value="{{customStoreGroup.code}}"/> <argument name="rootCategory" value="$$rootCategory.name$$"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreGroupWithDefaultWebsiteAndDefaultCategoryTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreGroupWithDefaultWebsiteAndDefaultCategoryTest.xml index ddc5d061c1db2..0db65501b4112 100644 --- a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreGroupWithDefaultWebsiteAndDefaultCategoryTest.xml +++ b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreGroupWithDefaultWebsiteAndDefaultCategoryTest.xml @@ -36,16 +36,16 @@ </actionGroup> <!--Search created store group(from above step) in grid and verify AssertStoreGroupInGrid--> - <actionGroup ref="AssertStoreGroupInGrid" stepKey="seeCreatedStoreGroupInGrid"> + <actionGroup ref="AssertStoreGroupInGridActionGroup" stepKey="seeCreatedStoreGroupInGrid"> <argument name="storeGroupName" value="{{SecondStoreGroupUnique.name}}"/> </actionGroup> <!--Go to store group form page and verify AssertStoreGroupForm and AssertStoreGroupOnStoreViewForm--> - <actionGroup ref="AssertStoreGroupForm" stepKey="seeCreatedStoreGroupForm"> + <actionGroup ref="AssertStoreGroupFormActionGroup" stepKey="seeCreatedStoreGroupForm"> <argument name="website" value="{{_defaultWebsite.name}}"/> <argument name="storeGroupName" value="{{SecondStoreGroupUnique.name}}"/> <argument name="storeGroupCode" value="{{SecondStoreGroupUnique.code}}"/> <argument name="rootCategory" value="Default Category"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreViewStatusDisabledVerifyBackendAndFrontendTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreViewStatusDisabledVerifyBackendAndFrontendTest.xml index 6ccab965b7727..2d8fbc72263d4 100644 --- a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreViewStatusDisabledVerifyBackendAndFrontendTest.xml +++ b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreViewStatusDisabledVerifyBackendAndFrontendTest.xml @@ -27,14 +27,14 @@ </after> <!--Create store view--> - <actionGroup ref="CreateStoreView" stepKey="createStoreView"> + <actionGroup ref="CreateStoreViewActionGroup" stepKey="createStoreView"> <argument name="storeView" value="storeViewDataDisabled"/> <argument name="storeGroupName" value="_defaultStoreGroup.name"/> <argument name="storeViewStatus" value="storeViewDataDisabled.is_active"/> </actionGroup> <!--Save the above store view and verify AssertStoreViewSuccessSaveMessage--> - <actionGroup ref="AdminCreateStoreViewActionSaveGroup" stepKey="verifyAssertStoreViewSuccessSaveMessage"/> + <actionGroup ref="AdminCreateStoreViewSaveActionGroup" stepKey="verifyAssertStoreViewSuccessSaveMessage"/> <!--Go to store configuration page and verify AssertStoreBackend--> <actionGroup ref="AssertStoreConfigurationBackendActionGroup" stepKey="verifyValuesOnStoreBackend"> @@ -46,4 +46,4 @@ <argument name="store" value="{{storeViewDataDisabled.name}"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreViewStatusEnabledVerifyBackendAndFrontendTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreViewStatusEnabledVerifyBackendAndFrontendTest.xml index c2f12bd2673f7..150e1082352cf 100644 --- a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreViewStatusEnabledVerifyBackendAndFrontendTest.xml +++ b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreViewStatusEnabledVerifyBackendAndFrontendTest.xml @@ -33,7 +33,7 @@ </actionGroup> <!--Save the above store view and verify AssertStoreViewSuccessSaveMessage--> - <actionGroup ref="AdminCreateStoreViewActionSaveGroup" stepKey="verifyAssertStoreViewSuccessSaveMessage"/> + <actionGroup ref="AdminCreateStoreViewSaveActionGroup" stepKey="verifyAssertStoreViewSuccessSaveMessage"/> <!--Go to store configuration page and verify AssertStoreBackend--> <actionGroup ref="AssertStoreConfigurationBackendActionGroup" stepKey="verifyValuesOnStoreBackend"> @@ -45,4 +45,4 @@ <argument name="store" value="{{storeViewData.name}}"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateWebsiteTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateWebsiteTest.xml index 29d96c3cb94c2..a8782acb1eb07 100644 --- a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateWebsiteTest.xml +++ b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateWebsiteTest.xml @@ -35,12 +35,12 @@ </actionGroup> <!--Search created website in grid and verify AssertWebsiteInGrid--> - <actionGroup ref="AssertWebsiteInGrid" stepKey="seeWebsiteInGrid"> + <actionGroup ref="AssertWebsiteInGridActionGroup" stepKey="seeWebsiteInGrid"> <argument name="websiteName" value="{{customWebsite.name}}"/> </actionGroup> <!--Verify website name and websitecode on website form (AssertWebsiteForm and AssertWebsiteOnStoreForm)--> - <actionGroup ref="AssertWebsiteForm" stepKey="seeWebsiteForm"> + <actionGroup ref="AssertWebsiteFormActionGroup" stepKey="seeWebsiteForm"> <argument name="websiteName" value="{{customWebsite.name}}"/> <argument name="websiteCode" value="{{customWebsite.code}}"/> </actionGroup> diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminDeleteStoreGroupTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminDeleteStoreGroupTest.xml index 652537f7864cd..185cf87531d9a 100644 --- a/app/code/Magento/Store/Test/Mftf/Test/AdminDeleteStoreGroupTest.xml +++ b/app/code/Magento/Store/Test/Mftf/Test/AdminDeleteStoreGroupTest.xml @@ -39,7 +39,7 @@ </actionGroup> <!--Verify deleted Store group is not present in grid and verify AssertStoreGroupNotInGrid message--> - <actionGroup ref="AssertStoreNotInGrid" stepKey="verifyDeletedStoreGroupNotInGrid"> + <actionGroup ref="AssertStoreNotInGridActionGroup" stepKey="verifyDeletedStoreGroupNotInGrid"> <argument name="storeGroupName" value="{{customStore.name}}"/> </actionGroup> @@ -52,4 +52,4 @@ <argument name="backup" value="WebSetupWizardBackup"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminDeleteStoreViewTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminDeleteStoreViewTest.xml index fc1dcb5ee1a24..df6fc391b2972 100644 --- a/app/code/Magento/Store/Test/Mftf/Test/AdminDeleteStoreViewTest.xml +++ b/app/code/Magento/Store/Test/Mftf/Test/AdminDeleteStoreViewTest.xml @@ -37,7 +37,7 @@ </actionGroup> <!--Verify deleted store view not present in grid and verify AssertStoreNotInGrid Message--> - <actionGroup ref="AssertStoreViewNotInGrid" stepKey="verifyDeletedStoreViewNotInGrid"> + <actionGroup ref="AssertStoreViewNotInGridActionGroup" stepKey="verifyDeletedStoreViewNotInGrid"> <argument name="storeViewName" value="{{storeViewData.name}}"/> </actionGroup> diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminMoveStoreToOtherGroupSameWebsiteTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminMoveStoreToOtherGroupSameWebsiteTest.xml index b86b99936dbe2..f1983dca53bf7 100644 --- a/app/code/Magento/Store/Test/Mftf/Test/AdminMoveStoreToOtherGroupSameWebsiteTest.xml +++ b/app/code/Magento/Store/Test/Mftf/Test/AdminMoveStoreToOtherGroupSameWebsiteTest.xml @@ -62,7 +62,7 @@ <argument name="storeDropdown" value="{{customStore.name}}"/> </actionGroup> <!--Save the above store view and verify AssertStoreViewSuccessSaveMessage--> - <actionGroup ref="AdminCreateStoreViewActionSaveGroup" stepKey="verifyAssertStoreViewSuccessSaveMessage"/> + <actionGroup ref="AdminCreateStoreViewSaveActionGroup" stepKey="verifyAssertStoreViewSuccessSaveMessage"/> <!--Search moved store view(from above step) in grid and verify AssertStoreInGrid--> <actionGroup ref="AssertStoreViewInGridActionGroup" stepKey="searchMovedStoreViewInGrid"> @@ -92,4 +92,4 @@ <argument name="storeView2" value="{{storeViewData2.name}}"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateStoreGroupAcceptAlertAndVerifyStoreViewFormTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateStoreGroupAcceptAlertAndVerifyStoreViewFormTest.xml index 9c84388d86f99..16f830224f7f4 100644 --- a/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateStoreGroupAcceptAlertAndVerifyStoreViewFormTest.xml +++ b/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateStoreGroupAcceptAlertAndVerifyStoreViewFormTest.xml @@ -31,7 +31,7 @@ <argument name="websiteCode" value="{{customWebsite.code}}"/> </actionGroup> <!--Create custom store group--> - <actionGroup ref="CreateCustomStore" stepKey="createCustomStoreGroup"> + <actionGroup ref="CreateCustomStoreActionGroup" stepKey="createCustomStoreGroup"> <argument name="website" value="{{_defaultWebsite.name}}"/> <argument name="store" value="{{staticStoreGroup.name}}"/> <argument name="rootCategory" value="Default Category"/> @@ -73,4 +73,4 @@ <argument name="rootCategory" value="$$rootCategory.name$$"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateStoreGroupAndVerifyStoreViewFormTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateStoreGroupAndVerifyStoreViewFormTest.xml index 3d85a34901434..ab204560f11c6 100644 --- a/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateStoreGroupAndVerifyStoreViewFormTest.xml +++ b/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateStoreGroupAndVerifyStoreViewFormTest.xml @@ -44,7 +44,7 @@ <click selector="{{AdminStoresGridSection.firstRow}}" stepKey="clickFirstRow"/> <waitForPageLoad stepKey="AdminSystemStoreGroupPageToOpen"/> <!--Update created Store group as per requirement--> - <actionGroup ref="CreateCustomStore" stepKey="createNewCustomStoreGroup"> + <actionGroup ref="CreateCustomStoreActionGroup" stepKey="createNewCustomStoreGroup"> <argument name="website" value="{{_defaultWebsite.name}}"/> <argument name="store" value="{{customStoreGroup.name}}"/> <argument name="rootCategory" value="Default Category"/> @@ -63,4 +63,4 @@ <argument name="rootCategory" value="Default Category"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateStoreViewTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateStoreViewTest.xml index 054ee789fbdc5..26dee6c632928 100644 --- a/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateStoreViewTest.xml +++ b/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateStoreViewTest.xml @@ -47,7 +47,7 @@ <argument name="customStore" value="SecondStoreUnique"/> </actionGroup> <!--Save the updated Store view and verify AssertStoreViewSuccessSaveMessage--> - <actionGroup ref="AdminCreateStoreViewActionSaveGroup" stepKey="verifyAssertStoreViewSuccessSaveMessage"> + <actionGroup ref="AdminCreateStoreViewSaveActionGroup" stepKey="verifyAssertStoreViewSuccessSaveMessage"> </actionGroup> <!--Search updated store view in grid and verify AssertStoreViewInGridMessage--> @@ -78,4 +78,4 @@ <see selector="{{StorefrontHeaderSection.storeViewDropdown}}" userInput="{{storeViewData.name}}" stepKey="seeAssertStoreViewOnStorefront"/> <see selector="{{StorefrontHeaderSection.storeViewDropdown}}" userInput="{{SecondStoreUnique.name}}" stepKey="seeAssertUpdatedStoreViewOnStorefront"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateWebsiteTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateWebsiteTest.xml index 6b666126569ae..5c4ecb87dda53 100644 --- a/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateWebsiteTest.xml +++ b/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateWebsiteTest.xml @@ -34,7 +34,7 @@ </after> <!--Search created custom website in grid--> - <actionGroup ref="AssertWebsiteInGrid" stepKey="seeWebsiteInGrid"> + <actionGroup ref="AssertWebsiteInGridActionGroup" stepKey="seeWebsiteInGrid"> <argument name="websiteName" value="{{customWebsite.name}}"/> </actionGroup> <click selector="{{AdminStoresGridSection.websiteName(customWebsite.name)}}" stepKey="clickWebsiteFirstRowInGrid"/> @@ -46,14 +46,14 @@ </actionGroup> <!--Search updated custom website(from above step) in grid and verify AssertWebsiteInGrid--> - <actionGroup ref="AssertWebsiteInGrid" stepKey="seeUpdatedWebsiteInGrid"> + <actionGroup ref="AssertWebsiteInGridActionGroup" stepKey="seeUpdatedWebsiteInGrid"> <argument name="websiteName" value="{{updateCustomWebsite.name}}"/> </actionGroup> <!--Verify updated website name and updated websitecode on website form (AssertWebsiteForm and AssertWebsiteOnStoreForm)--> - <actionGroup ref="AssertWebsiteForm" stepKey="seeUpdatedWebsiteForm"> + <actionGroup ref="AssertWebsiteFormActionGroup" stepKey="seeUpdatedWebsiteForm"> <argument name="websiteName" value="{{updateCustomWebsite.name}}"/> <argument name="websiteCode" value="{{updateCustomWebsite.code}}"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Ui/Test/Mftf/Test/AdminGridFilterDeleteAndVerifyErrorMessageTest.xml b/app/code/Magento/Ui/Test/Mftf/Test/AdminGridFilterDeleteAndVerifyErrorMessageTest.xml index e2c3b157c1059..b22618f40e5a8 100644 --- a/app/code/Magento/Ui/Test/Mftf/Test/AdminGridFilterDeleteAndVerifyErrorMessageTest.xml +++ b/app/code/Magento/Ui/Test/Mftf/Test/AdminGridFilterDeleteAndVerifyErrorMessageTest.xml @@ -32,7 +32,7 @@ <argument name="websiteCode" value="{{customWebsite.code}}"/> </actionGroup> <!-- Create second store --> - <actionGroup ref="CreateCustomStore" stepKey="createCustomStore"> + <actionGroup ref="CreateCustomStoreActionGroup" stepKey="createCustomStore"> <argument name="website" value="{{customWebsite.name}}"/> <argument name="store" value="{{customStoreGroup.name}}"/> <argument name="rootCategory" value="$$rootCategory.name$$"/> @@ -78,4 +78,4 @@ <argument name="errorMessage" value="Something went wrong with processing the default view and we have restored the filter to its original state."/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductWithSeveralWebsitesAndCheckURLRewritesTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductWithSeveralWebsitesAndCheckURLRewritesTest.xml index 4dc5c85830076..b2f63dbc39eab 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductWithSeveralWebsitesAndCheckURLRewritesTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductWithSeveralWebsitesAndCheckURLRewritesTest.xml @@ -51,7 +51,7 @@ </actionGroup> <!-- Create second store --> - <actionGroup ref="CreateCustomStore" stepKey="createCustomStore"> + <actionGroup ref="CreateCustomStoreActionGroup" stepKey="createCustomStore"> <argument name="website" value="{{_defaultWebsite.name}}"/> <argument name="store" value="{{customStoreGroup.name}}"/> <argument name="rootCategory" value="$$rootCategory.name$$"/> @@ -112,4 +112,4 @@ <see selector="{{AdminUrlRewriteIndexSection.storeView('1')}}" userInput="{{customStore.name}}" stepKey="seeStoreValueForProductId"/> <see selector="{{AdminUrlRewriteIndexSection.storeView('1')}}" userInput="{{storeViewData.name}}" stepKey="seeStoreViewValueForProductId"/> </test> -</tests> \ No newline at end of file +</tests> From 94c33b4e62ae6ddd4a23f94b097f41c5b1aa8138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 15:35:03 +0100 Subject: [PATCH 121/586] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- .../StorefrontUpdateSearchTermEntityTest.xml | 6 +-- .../AdminDeleteAllSearchTermsActionGroup.xml | 17 +++++++ .../AdminDeleteSearchTermActionGroup.xml | 21 +++++++++ .../AdminSearchTermActionGroup.xml | 47 ------------------- ...archTermFilterBySearchQueryActionGroup.xml | 27 +++++++++++ .../AdminMassDeleteSearchTermEntityTest.xml | 8 ++-- ...archSuggestionByProductDescriptionTest.xml | 8 ++-- ...erifySearchSuggestionByProductNameTest.xml | 4 +- ...uggestionByProductShortDescriptionTest.xml | 4 +- ...VerifySearchSuggestionByProductSkuTest.xml | 4 +- 10 files changed, 82 insertions(+), 64 deletions(-) create mode 100644 app/code/Magento/Search/Test/Mftf/ActionGroup/AdminDeleteAllSearchTermsActionGroup.xml create mode 100644 app/code/Magento/Search/Test/Mftf/ActionGroup/AdminDeleteSearchTermActionGroup.xml delete mode 100644 app/code/Magento/Search/Test/Mftf/ActionGroup/AdminSearchTermActionGroup.xml create mode 100644 app/code/Magento/Search/Test/Mftf/ActionGroup/AdminSearchTermFilterBySearchQueryActionGroup.xml diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontUpdateSearchTermEntityTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontUpdateSearchTermEntityTest.xml index 3ebb09f3c9c26..6c475ddc60a95 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontUpdateSearchTermEntityTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontUpdateSearchTermEntityTest.xml @@ -18,7 +18,7 @@ <group value="search"/> <group value="mtf_migrated"/> </annotations> - + <before> <createData entity="_defaultCategory" stepKey="createCategory1"/> <createData entity="SimpleProduct" stepKey="createProduct1"> @@ -44,7 +44,7 @@ <amOnPage url="{{AdminCatalogSearchTermIndexPage.url}}" stepKey="openAdminCatalogSearchTermIndexPage1"/> <waitForPageLoad stepKey="waitForPageLoad1"/> - <actionGroup ref="searchTermFilterBySearchQuery" stepKey="filterByFirstSearchQuery1"> + <actionGroup ref="AdminSearchTermFilterBySearchQueryActionGroup" stepKey="filterByFirstSearchQuery1"> <argument name="searchQuery" value="$$createProduct1.name$$"/> </actionGroup> @@ -58,7 +58,7 @@ <amOnPage url="{{AdminCatalogSearchTermIndexPage.url}}" stepKey="openAdminCatalogSearchTermIndexPage2"/> <waitForPageLoad stepKey="waitForPageLoad3"/> - <actionGroup ref="searchTermFilterBySearchQuery" stepKey="filterByFirstSearchQuery2"> + <actionGroup ref="AdminSearchTermFilterBySearchQueryActionGroup" stepKey="filterByFirstSearchQuery2"> <argument name="searchQuery" value="{{UpdatedSearchTermData1.query_text}}"/> </actionGroup> diff --git a/app/code/Magento/Search/Test/Mftf/ActionGroup/AdminDeleteAllSearchTermsActionGroup.xml b/app/code/Magento/Search/Test/Mftf/ActionGroup/AdminDeleteAllSearchTermsActionGroup.xml new file mode 100644 index 0000000000000..be01df1bcf5a7 --- /dev/null +++ b/app/code/Magento/Search/Test/Mftf/ActionGroup/AdminDeleteAllSearchTermsActionGroup.xml @@ -0,0 +1,17 @@ +<?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="AdminDeleteAllSearchTermsActionGroup"> + <selectOption userInput="selectAll" selector="{{AdminCatalogSearchTermIndexSection.selectMassActionCheckbox}}" stepKey="checkAllSearchTerms"/> + <selectOption selector="{{AdminCatalogSearchTermIndexSection.massActions}}" userInput="delete" stepKey="selectDeleteOption"/> + <click selector="{{AdminCatalogSearchTermIndexSection.submit}}" stepKey="clickSubmitButton"/> + <click selector="{{AdminCatalogSearchTermIndexSection.okButton}}" stepKey="clickOkButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Search/Test/Mftf/ActionGroup/AdminDeleteSearchTermActionGroup.xml b/app/code/Magento/Search/Test/Mftf/ActionGroup/AdminDeleteSearchTermActionGroup.xml new file mode 100644 index 0000000000000..2013dfcf0e3b2 --- /dev/null +++ b/app/code/Magento/Search/Test/Mftf/ActionGroup/AdminDeleteSearchTermActionGroup.xml @@ -0,0 +1,21 @@ +<?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="AdminDeleteSearchTermActionGroup"> + <annotations> + <description>Deletes the Search Terms in the Admin Search Term grid.</description> + </annotations> + + <selectOption selector="{{AdminCatalogSearchTermIndexSection.massActions}}" userInput="delete" stepKey="selectDeleteOption"/> + <click selector="{{AdminCatalogSearchTermIndexSection.submit}}" stepKey="clickSubmitButton"/> + <click selector="{{AdminCatalogSearchTermIndexSection.okButton}}" stepKey="clickOkButton"/> + <waitForElementVisible selector="{{AdminCatalogSearchTermMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Search/Test/Mftf/ActionGroup/AdminSearchTermActionGroup.xml b/app/code/Magento/Search/Test/Mftf/ActionGroup/AdminSearchTermActionGroup.xml deleted file mode 100644 index aeadf69050912..0000000000000 --- a/app/code/Magento/Search/Test/Mftf/ActionGroup/AdminSearchTermActionGroup.xml +++ /dev/null @@ -1,47 +0,0 @@ -<?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"> - <!-- Filter by search query and select --> - <actionGroup name="searchTermFilterBySearchQuery"> - <annotations> - <description>Fills in the provided Search Query on the Admin Search Term grid page.</description> - </annotations> - <arguments> - <argument name="searchQuery" type="string"/> - </arguments> - - <click selector="{{AdminCatalogSearchTermIndexSection.resetFilterButton}}" stepKey="clickOnResetButton"/> - <waitForPageLoad stepKey="waitForResetFilter"/> - <fillField selector="{{AdminCatalogSearchTermIndexSection.searchQuery}}" userInput="{{searchQuery}}" stepKey="fillSearchQuery"/> - <click selector="{{AdminCatalogSearchTermIndexSection.searchButton}}" stepKey="clickSearchButton"/> - <waitForPageLoad stepKey="waitForSearchResultLoad"/> - <checkOption selector="{{AdminCatalogSearchTermIndexSection.searchTermRowCheckboxBySearchQuery(searchQuery)}}" stepKey="checkCheckBox"/> - </actionGroup> - - <!-- Delete search term --> - <actionGroup name="deleteSearchTerm"> - <annotations> - <description>Deletes the Search Terms in the Admin Search Term grid.</description> - </annotations> - - <selectOption selector="{{AdminCatalogSearchTermIndexSection.massActions}}" userInput="delete" stepKey="selectDeleteOption"/> - <click selector="{{AdminCatalogSearchTermIndexSection.submit}}" stepKey="clickSubmitButton"/> - <click selector="{{AdminCatalogSearchTermIndexSection.okButton}}" stepKey="clickOkButton"/> - <waitForElementVisible selector="{{AdminCatalogSearchTermMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/> - </actionGroup> - - <!-- Delete all existing search terms --> - <actionGroup name="DeleteAllSearchTerms"> - <selectOption userInput="selectAll" selector="{{AdminCatalogSearchTermIndexSection.selectMassActionCheckbox}}" stepKey="checkAllSearchTerms"/> - <selectOption selector="{{AdminCatalogSearchTermIndexSection.massActions}}" userInput="delete" stepKey="selectDeleteOption"/> - <click selector="{{AdminCatalogSearchTermIndexSection.submit}}" stepKey="clickSubmitButton"/> - <click selector="{{AdminCatalogSearchTermIndexSection.okButton}}" stepKey="clickOkButton"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Search/Test/Mftf/ActionGroup/AdminSearchTermFilterBySearchQueryActionGroup.xml b/app/code/Magento/Search/Test/Mftf/ActionGroup/AdminSearchTermFilterBySearchQueryActionGroup.xml new file mode 100644 index 0000000000000..4536b0126b872 --- /dev/null +++ b/app/code/Magento/Search/Test/Mftf/ActionGroup/AdminSearchTermFilterBySearchQueryActionGroup.xml @@ -0,0 +1,27 @@ +<?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"> + <!-- Filter by search query and select --> + <actionGroup name="AdminSearchTermFilterBySearchQueryActionGroup"> + <annotations> + <description>Fills in the provided Search Query on the Admin Search Term grid page.</description> + </annotations> + <arguments> + <argument name="searchQuery" type="string"/> + </arguments> + + <click selector="{{AdminCatalogSearchTermIndexSection.resetFilterButton}}" stepKey="clickOnResetButton"/> + <waitForPageLoad stepKey="waitForResetFilter"/> + <fillField selector="{{AdminCatalogSearchTermIndexSection.searchQuery}}" userInput="{{searchQuery}}" stepKey="fillSearchQuery"/> + <click selector="{{AdminCatalogSearchTermIndexSection.searchButton}}" stepKey="clickSearchButton"/> + <waitForPageLoad stepKey="waitForSearchResultLoad"/> + <checkOption selector="{{AdminCatalogSearchTermIndexSection.searchTermRowCheckboxBySearchQuery(searchQuery)}}" stepKey="checkCheckBox"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Search/Test/Mftf/Test/AdminMassDeleteSearchTermEntityTest.xml b/app/code/Magento/Search/Test/Mftf/Test/AdminMassDeleteSearchTermEntityTest.xml index 67ccb51bf401e..37be694522b17 100644 --- a/app/code/Magento/Search/Test/Mftf/Test/AdminMassDeleteSearchTermEntityTest.xml +++ b/app/code/Magento/Search/Test/Mftf/Test/AdminMassDeleteSearchTermEntityTest.xml @@ -38,18 +38,18 @@ <waitForPageLoad stepKey="waitForAdminCatalogSearchTermIndexPageLoad"/> <!-- Select all created below search terms --> - <actionGroup ref="searchTermFilterBySearchQuery" stepKey="filterByFirstSearchQuery"> + <actionGroup ref="AdminSearchTermFilterBySearchQueryActionGroup" stepKey="filterByFirstSearchQuery"> <argument name="searchQuery" value="$$createFirstSearchTerm.query_text$$"/> </actionGroup> - <actionGroup ref="searchTermFilterBySearchQuery" stepKey="filterBySecondSearchQuery"> + <actionGroup ref="AdminSearchTermFilterBySearchQueryActionGroup" stepKey="filterBySecondSearchQuery"> <argument name="searchQuery" value="$$createSecondSearchTerm.query_text$$"/> </actionGroup> - <actionGroup ref="searchTermFilterBySearchQuery" stepKey="filterByThirdSearchQuery"> + <actionGroup ref="AdminSearchTermFilterBySearchQueryActionGroup" stepKey="filterByThirdSearchQuery"> <argument name="searchQuery" value="$$createThirdSearchTerm.query_text$$"/> </actionGroup> <!-- Delete created below search terms --> - <actionGroup ref="deleteSearchTerm" stepKey="deleteSearchTerms"/> + <actionGroup ref="AdminDeleteSearchTermActionGroup" stepKey="deleteSearchTerms"/> <!-- Assert search terms are absent on the search term page --> <actionGroup ref="AssertSearchTermNotInGrid" stepKey="assertFirstSearchTermNotInGrid"> diff --git a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductDescriptionTest.xml b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductDescriptionTest.xml index c5124ac9c74a1..261a029be995a 100644 --- a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductDescriptionTest.xml +++ b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductDescriptionTest.xml @@ -27,7 +27,7 @@ <waitForPageLoad stepKey="waitForAdminCatalogSearchTermIndexPageLoad"/> <!-- Delete all search terms --> <comment userInput="Delete all search terms" stepKey="deleteAllSearchTermsComment"/> - <actionGroup ref="DeleteAllSearchTerms" stepKey="deleteAllSearchTerms"/> + <actionGroup ref="AdminDeleteAllSearchTermsActionGroup" stepKey="deleteAllSearchTerms"/> <actionGroup ref="deleteAllProductsUsingProductGrid" stepKey="deleteAllProducts"/> <!-- Create product with description --> <comment userInput="Create product with description" stepKey="createProductWithDescriptionComment"/> @@ -47,12 +47,12 @@ <waitForPageLoad stepKey="waitForAdminCatalogSearchTermIndexPageLoad"/> <!-- Filter the search term --> <comment userInput="Filter search term" stepKey="filterSearchTermComment"/> - <actionGroup ref="searchTermFilterBySearchQuery" stepKey="filterByThirdSearchQuery"> + <actionGroup ref="AdminSearchTermFilterBySearchQueryActionGroup" stepKey="filterByThirdSearchQuery"> <argument name="searchQuery" value="{{ApiProductDescription.value}}"/> </actionGroup> <!-- Delete created below search terms --> <comment userInput="Delete created below search terms" stepKey="deleteCreatedBelowSearchTermsComment"/> - <actionGroup ref="deleteSearchTerm" stepKey="deleteSearchTerms"/> + <actionGroup ref="AdminDeleteSearchTermActionGroup" stepKey="deleteSearchTerms"/> <actionGroup ref="logout" stepKey="logout"/> </after> <!-- Go to storefront home page --> @@ -79,7 +79,7 @@ <waitForPageLoad stepKey="waitForAdminCatalogSearchTermIndexPageLoad"/> <!-- Filter the search term --> <comment userInput="Filter search term" stepKey="filterSearchTermComment2"/> - <actionGroup ref="searchTermFilterBySearchQuery" stepKey="filterByThirdSearchQuery"> + <actionGroup ref="AdminSearchTermFilterBySearchQueryActionGroup" stepKey="filterByThirdSearchQuery"> <argument name="searchQuery" value="{{ApiProductDescription.value}}"/> </actionGroup> <!-- Assert Search Term in grid --> diff --git a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductNameTest.xml b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductNameTest.xml index e49db08954e14..fc933c90341f9 100644 --- a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductNameTest.xml +++ b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductNameTest.xml @@ -38,11 +38,11 @@ <waitForPageLoad stepKey="waitForAdminCatalogSearchTermIndexPageLoad"/> <!--Filter the search term --> - <actionGroup ref="searchTermFilterBySearchQuery" stepKey="filterByThirdSearchQuery"> + <actionGroup ref="AdminSearchTermFilterBySearchQueryActionGroup" stepKey="filterByThirdSearchQuery"> <argument name="searchQuery" value="$$simpleProduct.name$$"/> </actionGroup> <!-- Delete created below search terms --> - <actionGroup ref="deleteSearchTerm" stepKey="deleteSearchTerms"/> + <actionGroup ref="AdminDeleteSearchTermActionGroup" stepKey="deleteSearchTerms"/> <actionGroup ref="logout" stepKey="logout"/> </after> diff --git a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductShortDescriptionTest.xml b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductShortDescriptionTest.xml index a1aa8be999aea..65472b9e10282 100644 --- a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductShortDescriptionTest.xml +++ b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductShortDescriptionTest.xml @@ -39,12 +39,12 @@ <waitForPageLoad stepKey="waitForAdminCatalogSearchTermIndexPageLoad"/> <!--Filter the search term --> - <actionGroup ref="searchTermFilterBySearchQuery" stepKey="filterByThirdSearchQuery"> + <actionGroup ref="AdminSearchTermFilterBySearchQueryActionGroup" stepKey="filterByThirdSearchQuery"> <argument name="searchQuery" value="{{ApiProductShortDescription.value}}"/> </actionGroup> <!-- Delete created below search terms --> - <actionGroup ref="deleteSearchTerm" stepKey="deleteSearchTerms"/> + <actionGroup ref="AdminDeleteSearchTermActionGroup" stepKey="deleteSearchTerms"/> <actionGroup ref="logout" stepKey="logout"/> </after> diff --git a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductSkuTest.xml b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductSkuTest.xml index 3a8443706c9c7..6e80823b78e0f 100644 --- a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductSkuTest.xml +++ b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductSkuTest.xml @@ -39,12 +39,12 @@ <waitForPageLoad stepKey="waitForAdminCatalogSearchTermIndexPageLoad"/> <!--Filter the search term --> - <actionGroup ref="searchTermFilterBySearchQuery" stepKey="filterByThirdSearchQuery"> + <actionGroup ref="AdminSearchTermFilterBySearchQueryActionGroup" stepKey="filterByThirdSearchQuery"> <argument name="searchQuery" value="$$simpleProduct.sku$$"/> </actionGroup> <!-- Delete created below search terms --> - <actionGroup ref="deleteSearchTerm" stepKey="deleteSearchTerms"/> + <actionGroup ref="AdminDeleteSearchTermActionGroup" stepKey="deleteSearchTerms"/> <actionGroup ref="logout" stepKey="logout"/> </after> From f2d3f07e423452964a55bc5038512241fa34bff3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 15:52:16 +0100 Subject: [PATCH 122/586] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- ...thOnlinePaymentIncludingTaxAndDiscount.xml | 2 +- .../AdminApplyCatalogRuleByCategoryTest.xml | 2 +- .../Test/AdminCreateCatalogPriceRuleTest.xml | 4 +- .../Test/AdminDeleteCatalogPriceRuleTest.xml | 2 +- .../StorefrontInactiveCatalogRuleTest.xml | 2 +- ...eForConfigurableProductWithOptionsTest.xml | 6 +- ...gRecalculationAfterCouponCodeAddedTest.xml | 2 +- ...SubtotalOrdersWithProcessingStatusTest.xml | 2 +- ...ConfigurableWithCatalogRuleAppliedTest.xml | 2 +- ...editMemoTotalAfterShippingDiscountTest.xml | 2 +- .../AdminCartPriceRuleActionGroup.xml | 80 --------- ...AdminCartPriceRuleNotInGridActionGroup.xml | 20 +++ .../AdminCreateCartPriceRuleActionGroup.xml | 162 ------------------ ...tionsSectionDiscountFieldsActionGroup.xml} | 27 --- ...eActionsSectionFreeShippingActionGroup.xml | 21 +++ ...ctionsSectionShippingAmountActionGroup.xml | 18 ++ ...tionsSectionSubsequentRulesActionGroup.xml | 18 ++ ...riceRuleActionsWithSubtotalActionGroup.xml | 38 ++++ ...eCartPriceRuleAndStayOnEditActionGroup.xml | 18 ++ ...RuleWithConditionIsCategoryActionGroup.xml | 34 ++++ ...CartPriceRuleWithConditionsActionGroup.xml | 46 +++++ ...CartPriceRuleWithCouponCodeActionGroup.xml | 28 +++ ...teMultiWebsiteCartPriceRuleActionGroup.xml | 23 +++ ...eteCartPriceRuleForRetailerActionGroup.xml | 24 +++ .../AdminFilterCartPriceRuleActionGroup.xml | 12 +- .../AdminInactiveCartPriceRuleActionGroup.xml | 18 ++ ...eCartPriceRuleSecondWebsiteActionGroup.xml | 25 +++ ...ectNotLoggedInCustomerGroupActionGroup.xml | 19 ++ ...SelectRetailerCustomerGroupActionGroup.xml | 19 ++ ...teConditionForCartPriceRuleActionGroup.xml | 34 ++++ ...onForActionsInCartPriceRuleActionGroup.xml | 37 ++++ .../StorefrontApplyCouponActionGroup.xml | 27 +++ .../StorefrontCancelCouponActionGroup.xml | 21 +++ ...torefrontCheckCouponAppliedActionGroup.xml | 24 +++ .../StorefrontSalesRuleActionGroup.xml | 76 -------- .../VerifyDiscountAmountActionGroup.xml | 32 ++++ ...inCartRulesAppliedForProductInCartTest.xml | 2 +- .../Mftf/Test/AdminCreateBuyXGetYFreeTest.xml | 2 +- ...inCreateCartPriceRuleEmptyFromDateTest.xml | 2 +- .../AdminCreateFixedAmountDiscountTest.xml | 2 +- ...CreateFixedAmountWholeCartDiscountTest.xml | 2 +- .../AdminCreatePercentOfProductPriceTest.xml | 2 +- ...PercentPriceAndVerifyDeleteMessageTest.xml | 4 +- ...artPriceRuleForConfigurableProductTest.xml | 4 +- .../Test/StorefrontCartPriceRuleCountry.xml | 2 +- .../Test/StorefrontCartPriceRulePostcode.xml | 2 +- .../Test/StorefrontCartPriceRuleQuantity.xml | 2 +- .../Test/StorefrontCartPriceRuleState.xml | 2 +- .../Test/StorefrontCartPriceRuleSubtotal.xml | 2 +- 49 files changed, 573 insertions(+), 384 deletions(-) delete mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleNotInGridActionGroup.xml rename app/code/Magento/SalesRule/Test/Mftf/ActionGroup/{AdminCreateCartPriceRuleActionsSectionActionGroup.xml => AdminCreateCartPriceRuleActionsSectionDiscountFieldsActionGroup.xml} (55%) create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsSectionFreeShippingActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsSectionShippingAmountActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsSectionSubsequentRulesActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsWithSubtotalActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleAndStayOnEditActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleWithConditionIsCategoryActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleWithConditionsActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleWithCouponCodeActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateMultiWebsiteCartPriceRuleActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminDeleteCartPriceRuleForRetailerActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminInactiveCartPriceRuleActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/CreateCartPriceRuleSecondWebsiteActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/SelectNotLoggedInCustomerGroupActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/SelectRetailerCustomerGroupActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/SetCartAttributeConditionForCartPriceRuleActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/SetConditionForActionsInCartPriceRuleActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontApplyCouponActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontCancelCouponActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontCheckCouponAppliedActionGroup.xml delete mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontSalesRuleActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/VerifyDiscountAmountActionGroup.xml diff --git a/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml b/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml index 8f0ce4918b978..98e075809b441 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml +++ b/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml @@ -81,7 +81,7 @@ <click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/> <fillField selector="{{AdminCartPriceRulesFormSection.ruleName}}" userInput="{{SimpleSalesRule.name}}" stepKey="fillRuleName"/> <selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="Main Website" stepKey="selectWebsites"/> - <actionGroup ref="selectRetailerCustomerGroup" stepKey="selectRetailerCustomerGroup"/> + <actionGroup ref="SelectRetailerCustomerGroupActionGroup" stepKey="selectRetailerCustomerGroup"/> <click selector="{{AdminCartPriceRulesFormSection.actionsHeader}}" stepKey="clickToExpandActions"/> <selectOption selector="{{AdminCartPriceRulesFormSection.apply}}" userInput="Percent of product price discount" stepKey="selectActionType"/> <fillField selector="{{AdminCartPriceRulesFormSection.discountAmount}}" userInput="10" stepKey="fillDiscountAmount"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleByCategoryTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleByCategoryTest.xml index ca534ec7f5375..d7d7da58c27fc 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleByCategoryTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleByCategoryTest.xml @@ -74,7 +74,7 @@ <selectOption selector="{{AdminNewCatalogPriceRuleActions.disregardRules}}" userInput="Yes" stepKey="discardSubsequentRules"/> <scrollToTopOfPage stepKey="scrollToTop"/> <waitForPageLoad stepKey="waitForApplied"/> - <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroup"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroup"/> <!-- 3. Save and apply the new catalog price rule --> <click selector="{{AdminNewCatalogPriceRule.saveAndApply}}" stepKey="saveAndApply"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest.xml index ee61af180d350..c8669f551c32e 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest.xml @@ -32,7 +32,7 @@ <!-- log in and create the price rule --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <actionGroup stepKey="createNewPriceRule" ref="newCatalogPriceRuleByUI"/> - <actionGroup stepKey="selectNotLoggedInCustomerGroup" ref="selectNotLoggedInCustomerGroup"/> + <actionGroup stepKey="selectNotLoggedInCustomerGroup" ref="SelectNotLoggedInCustomerGroupActionGroup"/> <click stepKey="saveAndApply" selector="{{AdminNewCatalogPriceRule.saveAndApply}}"/> <see stepKey="assertSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the rule."/> </before> @@ -173,7 +173,7 @@ <!-- Create a catalog rule for the NOT LOGGED IN customer group --> <actionGroup ref="newCatalogPriceRuleByUI" stepKey="createNewPriceRule"/> - <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroup"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroup"/> <click selector="{{AdminNewCatalogPriceRule.saveAndApply}}" stepKey="saveAndApply"/> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the rule." stepKey="assertSuccess"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml index 16fbca2697702..bd36c55d38f01 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml @@ -48,7 +48,7 @@ <!-- Create a catalog price rule --> <actionGroup ref="newCatalogPriceRuleByUI" stepKey="createNewPriceRule"/> - <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroup"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroup"/> <click selector="{{AdminNewCatalogPriceRule.saveAndApply}}" stepKey="saveAndApply"/> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the rule." stepKey="assertSuccess"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/StorefrontInactiveCatalogRuleTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/StorefrontInactiveCatalogRuleTest.xml index 08e59c6316411..7ff63fd11c194 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/StorefrontInactiveCatalogRuleTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/StorefrontInactiveCatalogRuleTest.xml @@ -25,7 +25,7 @@ <requiredEntity createDataKey="createCategory"/> </createData> <actionGroup stepKey="createNewPriceRule" ref="newCatalogPriceRuleByUI"/> - <actionGroup stepKey="selectLoggedInCustomers" ref="selectNotLoggedInCustomerGroup"/> + <actionGroup stepKey="selectLoggedInCustomers" ref="SelectNotLoggedInCustomerGroupActionGroup"/> <scrollToTopOfPage stepKey="scrollToTop"/> <click stepKey="setInactive" selector="{{AdminCategoryBasicFieldSection.enableCategoryLabel}}"/> <click selector="{{AdminNewCatalogPriceRule.saveAndApply}}" stepKey="saveAndApply"/> diff --git a/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithOptionsTest.xml b/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithOptionsTest.xml index e53e51c626aa9..920d839a1f2a0 100644 --- a/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithOptionsTest.xml +++ b/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithOptionsTest.xml @@ -129,7 +129,7 @@ <actionGroup ref="newCatalogPriceRuleByUI" stepKey="createFirstPriceRule"> <argument name="catalogRule" value="CatalogRuleToFixed"/> </actionGroup> - <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroupForFirstPriceRule"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroupForFirstPriceRule"/> <actionGroup ref="CreateCatalogPriceRuleConditionWithAttributeAndOptionActionGroup" stepKey="createFirstCatalogPriceRuleCondition"> <argument name="attributeName" value="$$createConfigProductAttribute.attribute[frontend_labels][0][label]$$"/> <argument name="targetSelectValue" value="$$createConfigProductAttributeFirstOption.option[store_labels][1][label]$$"/> @@ -143,7 +143,7 @@ <actionGroup ref="newCatalogPriceRuleByUI" stepKey="createSecondPriceRule"> <argument name="catalogRule" value="_defaultCatalogRule"/> </actionGroup> - <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroupForSecondPriceRule"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroupForSecondPriceRule"/> <actionGroup ref="CreateCatalogPriceRuleConditionWithAttributeAndOptionActionGroup" stepKey="createSecondCatalogPriceRuleCondition"> <argument name="attributeName" value="$$createConfigProductAttribute.attribute[frontend_labels][0][label]$$"/> <argument name="targetSelectValue" value="$$createConfigProductAttributeSecondOption.option[store_labels][1][label]$$"/> @@ -157,7 +157,7 @@ <actionGroup ref="newCatalogPriceRuleByUI" stepKey="createThirdPriceRule"> <argument name="catalogRule" value="CatalogRuleWithoutDiscount"/> </actionGroup> - <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroupForThirdPriceRule"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroupForThirdPriceRule"/> <actionGroup ref="CreateCatalogPriceRuleConditionWithAttributeAndOptionActionGroup" stepKey="createThirdCatalogPriceRuleCondition"> <argument name="attributeName" value="$$createConfigProductAttribute.attribute[frontend_labels][0][label]$$"/> <argument name="targetSelectValue" value="$$createConfigProductAttributeThirdOption.option[store_labels][1][label]$$"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml index 330a026bb9426..8a2990c5869c9 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml @@ -34,7 +34,7 @@ <createData entity="FreeShippingMethodsSettingConfig" stepKey="freeShippingMethodsSettingConfig"/> <createData entity="MinimumOrderAmount90" stepKey="minimumOrderAmount90"/> <magentoCLI command="cache:flush" stepKey="flushCache1"/> - <actionGroup ref="AdminCreateCartPriceRuleWithCouponCode" stepKey="createCartPriceRule"> + <actionGroup ref="AdminCreateCartPriceRuleWithCouponCodeActionGroup" stepKey="createCartPriceRule"> <argument name="ruleName" value="CatPriceRule"/> <argument name="couponCode" value="CatPriceRule.coupon_code"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml index 4b3e18fb31877..fe990c359b315 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml @@ -49,7 +49,7 @@ <click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/> <fillField selector="{{AdminCartPriceRulesFormSection.ruleName}}" userInput="{{ApiSalesRule.name}}" stepKey="fillRuleName"/> <selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="Main Website" stepKey="selectWebsite"/> - <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="chooseNotLoggedInCustomerGroup"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="chooseNotLoggedInCustomerGroup"/> <generateDate date="-1 day" format="m/d/Y" stepKey="yesterdayDate"/> <fillField selector="{{AdminCartPriceRulesFormSection.fromDate}}" userInput="{$yesterdayDate}" stepKey="fillFromDate"/> <selectOption selector="{{AdminCartPriceRulesFormSection.coupon}}" userInput="Specific Coupon" stepKey="selectCouponType"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml index bc8f3e49272b7..4dd8d03fa6ba3 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml @@ -136,7 +136,7 @@ <argument name="catalogRule" value="CatalogRuleByPercentWith96Amount" /> <argument name="productSku" value="$$createConfigChildProduct3.sku$$" /> </actionGroup> - <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroup"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroup"/> <click selector="{{AdminNewCatalogPriceRule.saveAndApply}}" stepKey="clickSaveAndApplyRules"/> <magentoCLI command="indexer:reindex" stepKey="reindex"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CreditMemoTotalAfterShippingDiscountTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CreditMemoTotalAfterShippingDiscountTest.xml index ec0f97e418c8c..edd5c9841fb6b 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/CreditMemoTotalAfterShippingDiscountTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/CreditMemoTotalAfterShippingDiscountTest.xml @@ -44,7 +44,7 @@ <click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/> <fillField selector="{{AdminCartPriceRulesFormSection.ruleName}}" userInput="{{ApiSalesRule.name}}" stepKey="fillRuleName"/> <selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="Main Website" stepKey="selectWebsite"/> - <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="chooseNotLoggedInCustomerGroup"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="chooseNotLoggedInCustomerGroup"/> <generateDate date="-1 day" format="m/d/Y" stepKey="yesterdayDate"/> <fillField selector="{{AdminCartPriceRulesFormSection.fromDate}}" userInput="{$yesterdayDate}" stepKey="fillFromDate"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleActionGroup.xml deleted file mode 100644 index 1bd4d743acdc5..0000000000000 --- a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleActionGroup.xml +++ /dev/null @@ -1,80 +0,0 @@ -<?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="selectNotLoggedInCustomerGroup"> - <annotations> - <description>Selects 'NOT LOGGED IN' from the 'Customer Groups' list (Magento 2 B2B). PLEASE NOTE: The value is Hardcoded.</description> - </annotations> - - <!-- This actionGroup was created to be merged from B2B because B2B has a very different form control here --> - <selectOption selector="{{AdminCartPriceRulesFormSection.customerGroups}}" userInput="NOT LOGGED IN" stepKey="selectCustomerGroup"/> - </actionGroup> - - <actionGroup name="selectRetailerCustomerGroup"> - <annotations> - <description>Selects 'Retailer' from the 'Customer Groups' list (Magento 2 B2B). PLEASE NOTE: The value is Hardcoded.</description> - </annotations> - - <!-- This actionGroup was created to be merged from B2B. Retailer Customer Group --> - <selectOption selector="{{AdminCartPriceRulesFormSection.customerGroups}}" userInput="Retailer" stepKey="selectRetailerCustomerGroup"/> - </actionGroup> - - <!--Set Subtotal condition for Customer Segment--> - <actionGroup name="SetCartAttributeConditionForCartPriceRuleActionGroup"> - <annotations> - <description>Sets the provided Cart Attribute Condition (Attribute Name, Operator Type and Value) on the Admin Cart Price Rule creation/edit page.</description> - </annotations> - <arguments> - <argument name="attributeName" type="string"/> - <argument name="operatorType" defaultValue="is" type="string"/> - <argument name="value" type="string"/> - </arguments> - - <scrollTo selector="{{AdminCartPriceRulesFormSection.conditionsHeader}}" stepKey="scrollToActionTab"/> - <conditionalClick selector="{{AdminCartPriceRulesFormSection.conditionsHeader}}" dependentSelector="{{AdminCartPriceRulesFormSection.conditionsHeaderOpen}}" visible="false" stepKey="openActionTab"/> - <click selector="{{AdminCartPriceRulesFormSection.conditions}}" stepKey="applyRuleForConditions"/> - <waitForPageLoad stepKey="waitForDropDownOpened"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.childAttribute}}" userInput="{{attributeName}}" stepKey="selectAttribute"/> - <waitForPageLoad stepKey="waitForOperatorOpened"/> - <click selector="{{AdminCartPriceRulesFormSection.condition('is')}}" stepKey="clickToChooseOption"/> - <selectOption userInput="{{operatorType}}" selector="{{AdminCartPriceRulesFormSection.conditionsOperator}}" stepKey="setOperatorType"/> - <click selector="{{AdminCartPriceRulesFormSection.condition('...')}}" stepKey="clickToChooseOption1"/> - <fillField userInput="{{value}}" selector="{{AdminCartPriceRulesFormSection.conditionsValue}}" stepKey="fillActionValue"/> - <click selector="{{AdminMainActionsSection.saveAndContinue}}" stepKey="clickSaveButton"/> - <see selector="{{AdminCartPriceRulesSection.messages}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> - </actionGroup> - - <actionGroup name="SetConditionForActionsInCartPriceRuleActionGroup"> - <annotations> - <description>Sets the provided Condition (Actions Aggregator/Value, Child Attribute and Action Value) for Actions on the Admin Cart Price Rule creation/edit page.</description> - </annotations> - <arguments> - <argument name="actionsAggregator" type="string" defaultValue="ANY"/> - <argument name="actionsValue" type="string" defaultValue="FALSE"/> - <argument name="childAttribute" type="string" defaultValue="Category"/> - <argument name="actionValue" type="string"/> - </arguments> - - <click selector="{{AdminCartPriceRulesFormSection.actionsHeader}}" stepKey="clickOnActionTab"/> - <click selector="{{AdminCartPriceRulesFormSection.condition('ALL')}}" stepKey="clickToChooseOption"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.actionsAggregator}}" userInput="{{actionsAggregator}}" stepKey="selectCondition"/> - <click selector="{{AdminCartPriceRulesFormSection.condition('TRUE')}}" stepKey="clickToChooseOption2"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.actionsValue}}" userInput="{{actionsValue}}" stepKey="selectCondition2"/> - <click selector="{{AdminCartPriceRulesFormSection.conditions}}" stepKey="selectActionConditions"/> - <waitForPageLoad stepKey="waitForDropDownOpened"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.childAttribute}}" userInput="{{childAttribute}}" stepKey="selectAttribute"/> - <waitForPageLoad stepKey="waitForOperatorOpened"/> - <click selector="{{AdminCartPriceRulesFormSection.condition('...')}}" stepKey="clickToChooseOption3"/> - <fillField selector="{{AdminCartPriceRulesFormSection.actionValue}}" userInput="{{actionValue}}" stepKey="fillActionValue"/> - <click selector="{{AdminCartPriceRulesFormSection.applyAction}}" stepKey="applyAction"/> - <click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveButton"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleNotInGridActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleNotInGridActionGroup.xml new file mode 100644 index 0000000000000..23d7daf03e9c3 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleNotInGridActionGroup.xml @@ -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="AdminCartPriceRuleNotInGridActionGroup" extends="AdminFilterCartPriceRuleActionGroup"> + <annotations> + <description>EXTENDS: AdminFilterCartPriceRuleActionGroup. Removes 'goToEditRulePage'. Validates that the Empty Grid message is present and correct.</description> + </annotations> + + <remove keyForRemoval="goToEditRulePage"/> + <waitForPageLoad stepKey="waitForStoreToLoad"/> + <see selector="{{AdminCartPriceRulesSection.emptyText}}" userInput="We couldn't find any records." stepKey="seeAssertCartPriceRuleIsNotPresentedInGrid"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionGroup.xml index 91ecaff7f83a6..57a2c17419532 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionGroup.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionGroup.xml @@ -28,166 +28,4 @@ <click selector="{{AdminCartPriceRulesFormSection.save}}" stepKey="clickSaveButton"/> <see selector="{{AdminCartPriceRulesFormSection.successMessage}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> </actionGroup> - - <actionGroup name="AdminCreateCartPriceRuleAndStayOnEditActionGroup" extends="AdminCreateCartPriceRuleActionGroup"> - <annotations> - <description>EXTENDS: AdminCreateCartPriceRuleActionGroup. Clicks on Save and Continue.</description> - </annotations> - - <click selector="{{AdminCartPriceRulesFormSection.saveAndContinue}}" stepKey="clickSaveButton"/> - </actionGroup> - - <actionGroup name="AdminCreateCartPriceRuleWithCouponCode" extends="AdminCreateCartPriceRuleActionGroup"> - <annotations> - <description>EXTENDS: AdminCreateCartPriceRuleActionGroup. Removes 'selectActionType' and 'fillDiscountAmount'. Adds the provided Coupon Code to a Cart Price Rule.</description> - </annotations> - <arguments> - <argument name="couponCode" defaultValue="_defaultCoupon.code"/> - </arguments> - - <remove keyForRemoval="selectActionType"/> - <remove keyForRemoval="fillDiscountAmount"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.coupon}}" userInput="Specific Coupon" stepKey="selectCouponType" after="fillRuleName"/> - <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.couponCode}}" stepKey="waitForElementVisible" after="selectCouponType"/> - <fillField selector="{{AdminCartPriceRulesFormSection.couponCode}}" userInput="{{couponCode}}" stepKey="fillCouponCode" after="waitForElementVisible"/> - <fillField selector="{{AdminCartPriceRulesFormSection.userPerCoupon}}" userInput="99" stepKey="fillUserPerCoupon" after="fillCouponCode"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.apply}}" userInput="Fixed amount discount for whole cart" stepKey="selectActionTypeToFixed" after="clickToExpandActions"/> - <fillField selector="{{AdminCartPriceRulesFormSection.discountAmount}}" userInput="1" stepKey="fillDiscountAmount" after="selectActionTypeToFixed"/> - </actionGroup> - - <!--Delete Cart price Rule for Retailer customer--> - <actionGroup name="AdminDeleteCartPriceRuleForRetailerActionGroup"> - <annotations> - <description>Goes to the Admin Cart Price Rules grid page. Removes the 1st Cart Price Rule in the Grid.</description> - </annotations> - - <amOnPage url="{{AdminCartPriceRulesPage.url}}" stepKey="goToCartPriceRules"/> - <waitForPageLoad stepKey="waitForCartPriceRules"/> - <fillField selector="{{AdminCartPriceRulesSection.filterByNameInput}}" userInput="{{SimpleSalesRule.name}}" stepKey="filterByName"/> - <click selector="{{AdminCartPriceRulesSection.searchButton}}" stepKey="doFilter"/> - <click selector="{{AdminCartPriceRulesSection.rowByIndex('1')}}" stepKey="goToEditRulePage"/> - <click selector="{{AdminCartPriceRulesFormSection.delete}}" stepKey="clickDeleteButton"/> - <click selector="{{AdminCartPriceRulesFormSection.modalAcceptButton}}" stepKey="confirmDelete"/> - </actionGroup> - - <actionGroup name="AdminCreateCartPriceRuleWithConditions" extends="AdminCreateCartPriceRuleActionGroup"> - <annotations> - <description>EXTENDS: AdminCreateCartPriceRuleActionGroup. Removes 'fillDiscountAmount'. Adds the 2 provided Conditions (Name, Rule, Rule to Change and Category Name) to a Cart Price Rule.</description> - </annotations> - <arguments> - <argument name="condition1" type="string" defaultValue="Products subselection"/> - <argument name="condition2" type="string" defaultValue="Category"/> - <argument name="ruleToChange1" type="string" defaultValue="is"/> - <argument name="rule1" type="string" defaultValue="equals or greater than"/> - <argument name="ruleToChange2" type="string" defaultValue="..."/> - <argument name="rule2" type="string" defaultValue="2"/> - <argument name="categoryName" type="string" defaultValue="_defaultCategory.name"/> - </arguments> - - <remove keyForRemoval="fillDiscountAmount"/> - - <!--Go to Conditions section--> - <click selector="{{AdminCartPriceRulesFormSection.conditionsHeader}}" stepKey="openConditionsSection" after="selectActionType"/> - <click selector="{{AdminCartPriceRulesFormSection.addCondition('1')}}" stepKey="addFirstCondition" after="openConditionsSection"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.ruleCondition('1')}}" userInput="{{condition1}}" stepKey="selectRule" after="addFirstCondition"/> - <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange1)}}" stepKey="waitForFirstRuleElement" after="selectRule"/> - <click selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange1)}}" stepKey="clickToChangeRule" after="waitForFirstRuleElement"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.ruleParameterSelect('1--1')}}" userInput="{{rule1}}" stepKey="selectRule1" after="clickToChangeRule"/> - <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange2)}}" stepKey="waitForSecondRuleElement" after="selectRule1"/> - <click selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange2)}}" stepKey="clickToChangeRule1" after="waitForSecondRuleElement"/> - <fillField selector="{{AdminCartPriceRulesFormSection.ruleParameterInput('1--1')}}" userInput="{{rule2}}" stepKey="fillRule" after="clickToChangeRule1"/> - <click selector="{{AdminCartPriceRulesFormSection.addCondition('1--1')}}" stepKey="addSecondCondition" after="fillRule"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.ruleCondition('1--1')}}" userInput="{{condition2}}" stepKey="selectSecondCondition" after="addSecondCondition"/> - <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange2)}}" stepKey="waitForThirdRuleElement" after="selectSecondCondition"/> - <click selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange2)}}" stepKey="addThirdCondition" after="waitForThirdRuleElement"/> - <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.openChooser('1--1--1')}}" stepKey="waitForForthRuleElement" after="addThirdCondition"/> - <click selector="{{AdminCartPriceRulesFormSection.openChooser('1--1--1')}}" stepKey="openChooser" after="waitForForthRuleElement"/> - <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.categoryCheckbox(categoryName)}}" stepKey="waitForCategoryVisible" after="openChooser"/> - <checkOption selector="{{AdminCartPriceRulesFormSection.categoryCheckbox(categoryName)}}" stepKey="checkCategoryName" after="waitForCategoryVisible"/> - </actionGroup> - <actionGroup name="AdminCreateCartPriceRuleActionsWithSubtotalActionGroup" extends="AdminCreateCartPriceRuleActionGroup"> - <annotations> - <description>EXTENDS: AdminCreateCartPriceRuleActionGroup. Removes 'fillDiscountAmount'. Adds sub total conditions for free shipping to a Cart Price Rule.</description> - </annotations> - <arguments> - <argument name="ruleName"/> - </arguments> - <remove keyForRemoval="fillDiscountAmount"/> - <!-- Expand the conditions section --> - <grabTextFrom selector="{{AdminCartPriceRulesFormSection.ruleName}}" after="fillRuleName" stepKey="getSubtotalRule"/> - <click selector="{{AdminCartPriceRulesFormSection.conditionsHeader}}" stepKey="openConditionsSection" after="selectActionType"/> - <click selector="{{AdminCartPriceRulesFormSection.addCondition('1')}}" after="openConditionsSection" stepKey="addFirstCondition"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.conditionSelect}}" userInput="{{ruleName.condition1}}" after="addFirstCondition" stepKey="selectCondition1"/> - <waitForPageLoad after="selectCondition1" stepKey="waitForConditionLoad"/> - <click selector="{{AdminCartPriceRulesFormSection.condition(ruleName.ruleToChange1)}}" after="waitForConditionLoad" stepKey="clickToChooseOption"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.conditionsOperator}}" userInput="{{ruleName.rule1}}" after="clickToChooseOption" stepKey="setOperatorType"/> - <click selector="{{AdminCartPriceRulesFormSection.targetEllipsis}}" after="setOperatorType" stepKey="clickEllipsis"/> - <fillField selector="{{AdminCartPriceRulesFormSection.ruleFieldByIndex('1--1')}}" userInput="{{ruleName.subtotal}}" after="clickEllipsis" stepKey="fillSubtotalParameter"/> - <click selector="{{AdminCartPriceRulesFormSection.addNewCondition('1')}}" after="fillSubtotalParameter" stepKey="clickOnTheAddNewCondition"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.conditionSelectDropdown('1')}}" userInput="{{ruleName.condition2}}" after="clickOnTheAddNewCondition" stepKey="selectSecondCondition"/> - <waitForPageLoad after="selectSecondCondition" stepKey="waitForConditionLoad2"/> - <click selector="{{AdminCartPriceRulesFormSection.targetEllipsis}}" after="waitForConditionLoad2" stepKey="clickEllipsis2"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.ruleFieldByIndex('1--2')}}" userInput="{{ruleName.shippingMethod}}" after="clickEllipsis2" stepKey="selectShippingMethod"/> - <click selector="{{AdminCartPriceRulesFormSection.applyToShippingAmount}}" after="selectShippingMethod" stepKey="clickApplyToShipping"/> - <click selector="{{AdminCartPriceRulesFormSection.discardSubsequentRules}}" after="clickApplyToShipping" stepKey="clickDiscardSubsequentRules"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.freeShipping}}" userInput="{{ruleName.simple_free_shipping}}" after="clickDiscardSubsequentRules" stepKey="selectForMatchingItemsOnly"/> - </actionGroup> - <actionGroup name="AdminCreateMultiWebsiteCartPriceRuleActionGroup" extends="AdminCreateCartPriceRuleActionGroup"> - <annotations> - <description>EXTENDS: AdminCreateCartPriceRuleActionGroup. Removes 'clickSaveButton' for the next data changing. Assign cart price rule to 2 websites instead of 1.</description> - </annotations> - <arguments> - <argument name="ruleName"/> - </arguments> - <remove keyForRemoval="clickSaveButton"/> - <remove keyForRemoval="seeSuccessMessage"/> - <remove keyForRemoval="selectWebsites"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" parameterArray="['FirstWebsite', 'SecondWebsite']" stepKey="selectWebsites" after="fillRuleName"/> - </actionGroup> - <actionGroup name="CreateCartPriceRuleSecondWebsiteActionGroup"> - <annotations> - <description>Goes to the Admin Cart Price Rule grid page. Clicks on Add New Rule. Fills the provided Rule (Name). Selects 'Second Website' from the 'Websites' menu.</description> - </annotations> - <arguments> - <argument name="ruleName"/> - </arguments> - - <amOnPage url="{{AdminCartPriceRulesPage.url}}" stepKey="amOnCartPriceList"/> - <waitForPageLoad stepKey="waitForPriceList"/> - <click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/> - <fillField selector="{{AdminCartPriceRulesFormSection.ruleName}}" userInput="{{ruleName.name}}" stepKey="fillRuleName"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="Second Website" stepKey="selectWebsites"/> - </actionGroup> - - <actionGroup name="AdminInactiveCartPriceRuleActionGroup" extends="AdminCreateCartPriceRuleActionGroup"> - <annotations> - <description>EXTENDS: AdminCreateCartPriceRuleActionGroup. Clicks on 'Active'.</description> - </annotations> - - <click selector="{{AdminCartPriceRulesFormSection.active}}" stepKey="clickActiveToDisable" after="fillRuleName"/> - </actionGroup> - - <actionGroup name="AdminCreateCartPriceRuleWithConditionIsCategoryActionGroup" extends="AdminCreateCartPriceRuleActionGroup"> - <annotations> - <description>EXTENDS: AdminCreateCartPriceRuleActionGroup. Sets the provide Condition (Actions Aggregator/Value, Child Attribute and Action Value) for Actions on the Admin Cart Price Rule creation/edit page.</description> - </annotations> - <arguments> - <argument name="actionsAggregator" type="string" defaultValue="ANY"/> - <argument name="actionsValue" type="string" defaultValue="FALSE"/> - <argument name="childAttribute" type="string" defaultValue="Category"/> - <argument name="actionValue" type="string" defaultValue="2"/> - </arguments> - <click selector="{{AdminCartPriceRulesFormSection.actionsHeader}}" after="fillDiscountAmount" stepKey="clickOnActionTab"/> - <click selector="{{AdminCartPriceRulesFormSection.condition('ALL')}}" after="clickOnActionTab" stepKey="clickToChooseFirstRuleConditionValue"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.actionsAggregator}}" userInput="{{actionsAggregator}}" after="clickToChooseFirstRuleConditionValue" stepKey="changeFirstRuleConditionValue"/> - <click selector="{{AdminCartPriceRulesFormSection.condition('TRUE')}}" after="changeFirstRuleConditionValue" stepKey="clickToChooseSecondRuleConditionValue"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.actionsValue}}" userInput="{{actionsValue}}" after="clickToChooseSecondRuleConditionValue" stepKey="changeSecondRuleConditionValue"/> - <click selector="{{AdminCartPriceRulesFormSection.conditions}}" after="changeSecondRuleConditionValue" stepKey="clickConditionDropDownMenu"/> - <waitForPageLoad stepKey="waitForDropDownOpened"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.childAttribute}}" userInput="{{childAttribute}}" after="clickConditionDropDownMenu" stepKey="selectConditionAttributeIsCategory"/> - <waitForPageLoad after="selectConditionAttributeIsCategory" stepKey="waitForOperatorOpened"/> - <click selector="{{AdminCartPriceRulesFormSection.condition('...')}}" after="waitForOperatorOpened" stepKey="clickToChooserIcon"/> - <fillField selector="{{AdminCartPriceRulesFormSection.actionValue}}" userInput="{{actionValue}}" after="clickToChooserIcon" stepKey="choseNeededCategoryFromCategoryGrid"/> - <click selector="{{AdminCartPriceRulesFormSection.applyAction}}" after="choseNeededCategoryFromCategoryGrid" stepKey="applyAction"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsSectionActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsSectionDiscountFieldsActionGroup.xml similarity index 55% rename from app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsSectionActionGroup.xml rename to app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsSectionDiscountFieldsActionGroup.xml index b30d2cfbb9204..00edcfc6f19ed 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsSectionActionGroup.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsSectionDiscountFieldsActionGroup.xml @@ -22,31 +22,4 @@ <fillField selector="{{AdminCartPriceRulesFormSection.maximumQtyDiscount}}" userInput="{{rule.maximumQtyDiscount}}" stepKey="fillMaximumQtyDiscount"/> <fillField selector="{{AdminCartPriceRulesFormSection.discountStep}}" userInput="{{rule.discount_step}}" stepKey="fillDiscountStep"/> </actionGroup> - - <actionGroup name="AdminCreateCartPriceRuleActionsSectionShippingAmountActionGroup"> - <annotations> - <description>Clicks on the 'Apply to Shipping Amount' toggle.</description> - </annotations> - - <click selector="{{AdminCartPriceRulesFormSection.applyToShippingAmount}}" stepKey="clickApplyToShipping"/> - </actionGroup> - - <actionGroup name="AdminCreateCartPriceRuleActionsSectionSubsequentRulesActionGroup"> - <annotations> - <description>Clicks on the 'Discard subsequent rules' toggle.</description> - </annotations> - - <click selector="{{AdminCartPriceRulesFormSection.discardSubsequentRules}}" stepKey="clickApplyToShipping"/> - </actionGroup> - - <actionGroup name="AdminCreateCartPriceRuleActionsSectionFreeShippingActionGroup"> - <annotations> - <description>Selects the provided option in the 'Free Shipping' dropdown menu.</description> - </annotations> - <arguments> - <argument name="freeShippingOption" type="string"/> - </arguments> - - <selectOption selector="{{AdminCartPriceRulesFormSection.freeShipping}}" userInput="{{freeShippingOption}}" stepKey="selectForMatchingItemsOnly"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsSectionFreeShippingActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsSectionFreeShippingActionGroup.xml new file mode 100644 index 0000000000000..d90261bf44fa9 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsSectionFreeShippingActionGroup.xml @@ -0,0 +1,21 @@ +<?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="AdminCreateCartPriceRuleActionsSectionFreeShippingActionGroup"> + <annotations> + <description>Selects the provided option in the 'Free Shipping' dropdown menu.</description> + </annotations> + <arguments> + <argument name="freeShippingOption" type="string"/> + </arguments> + + <selectOption selector="{{AdminCartPriceRulesFormSection.freeShipping}}" userInput="{{freeShippingOption}}" stepKey="selectForMatchingItemsOnly"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsSectionShippingAmountActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsSectionShippingAmountActionGroup.xml new file mode 100644 index 0000000000000..3af8a82601a08 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsSectionShippingAmountActionGroup.xml @@ -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="AdminCreateCartPriceRuleActionsSectionShippingAmountActionGroup"> + <annotations> + <description>Clicks on the 'Apply to Shipping Amount' toggle.</description> + </annotations> + + <click selector="{{AdminCartPriceRulesFormSection.applyToShippingAmount}}" stepKey="clickApplyToShipping"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsSectionSubsequentRulesActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsSectionSubsequentRulesActionGroup.xml new file mode 100644 index 0000000000000..15dc5af206572 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsSectionSubsequentRulesActionGroup.xml @@ -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="AdminCreateCartPriceRuleActionsSectionSubsequentRulesActionGroup"> + <annotations> + <description>Clicks on the 'Discard subsequent rules' toggle.</description> + </annotations> + + <click selector="{{AdminCartPriceRulesFormSection.discardSubsequentRules}}" stepKey="clickApplyToShipping"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsWithSubtotalActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsWithSubtotalActionGroup.xml new file mode 100644 index 0000000000000..b6836ab63fb10 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsWithSubtotalActionGroup.xml @@ -0,0 +1,38 @@ +<?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="AdminCreateCartPriceRuleActionsWithSubtotalActionGroup" extends="AdminCreateCartPriceRuleActionGroup"> + <annotations> + <description>EXTENDS: AdminCreateCartPriceRuleActionGroup. Removes 'fillDiscountAmount'. Adds sub total conditions for free shipping to a Cart Price Rule.</description> + </annotations> + <arguments> + <argument name="ruleName"/> + </arguments> + <remove keyForRemoval="fillDiscountAmount"/> + <!-- Expand the conditions section --> + <grabTextFrom selector="{{AdminCartPriceRulesFormSection.ruleName}}" after="fillRuleName" stepKey="getSubtotalRule"/> + <click selector="{{AdminCartPriceRulesFormSection.conditionsHeader}}" stepKey="openConditionsSection" after="selectActionType"/> + <click selector="{{AdminCartPriceRulesFormSection.addCondition('1')}}" after="openConditionsSection" stepKey="addFirstCondition"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.conditionSelect}}" userInput="{{ruleName.condition1}}" after="addFirstCondition" stepKey="selectCondition1"/> + <waitForPageLoad after="selectCondition1" stepKey="waitForConditionLoad"/> + <click selector="{{AdminCartPriceRulesFormSection.condition(ruleName.ruleToChange1)}}" after="waitForConditionLoad" stepKey="clickToChooseOption"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.conditionsOperator}}" userInput="{{ruleName.rule1}}" after="clickToChooseOption" stepKey="setOperatorType"/> + <click selector="{{AdminCartPriceRulesFormSection.targetEllipsis}}" after="setOperatorType" stepKey="clickEllipsis"/> + <fillField selector="{{AdminCartPriceRulesFormSection.ruleFieldByIndex('1--1')}}" userInput="{{ruleName.subtotal}}" after="clickEllipsis" stepKey="fillSubtotalParameter"/> + <click selector="{{AdminCartPriceRulesFormSection.addNewCondition('1')}}" after="fillSubtotalParameter" stepKey="clickOnTheAddNewCondition"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.conditionSelectDropdown('1')}}" userInput="{{ruleName.condition2}}" after="clickOnTheAddNewCondition" stepKey="selectSecondCondition"/> + <waitForPageLoad after="selectSecondCondition" stepKey="waitForConditionLoad2"/> + <click selector="{{AdminCartPriceRulesFormSection.targetEllipsis}}" after="waitForConditionLoad2" stepKey="clickEllipsis2"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.ruleFieldByIndex('1--2')}}" userInput="{{ruleName.shippingMethod}}" after="clickEllipsis2" stepKey="selectShippingMethod"/> + <click selector="{{AdminCartPriceRulesFormSection.applyToShippingAmount}}" after="selectShippingMethod" stepKey="clickApplyToShipping"/> + <click selector="{{AdminCartPriceRulesFormSection.discardSubsequentRules}}" after="clickApplyToShipping" stepKey="clickDiscardSubsequentRules"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.freeShipping}}" userInput="{{ruleName.simple_free_shipping}}" after="clickDiscardSubsequentRules" stepKey="selectForMatchingItemsOnly"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleAndStayOnEditActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleAndStayOnEditActionGroup.xml new file mode 100644 index 0000000000000..b61988b630f03 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleAndStayOnEditActionGroup.xml @@ -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="AdminCreateCartPriceRuleAndStayOnEditActionGroup" extends="AdminCreateCartPriceRuleActionGroup"> + <annotations> + <description>EXTENDS: AdminCreateCartPriceRuleActionGroup. Clicks on Save and Continue.</description> + </annotations> + + <click selector="{{AdminCartPriceRulesFormSection.saveAndContinue}}" stepKey="clickSaveButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleWithConditionIsCategoryActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleWithConditionIsCategoryActionGroup.xml new file mode 100644 index 0000000000000..7181ef586b2d8 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleWithConditionIsCategoryActionGroup.xml @@ -0,0 +1,34 @@ +<?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="AdminCreateCartPriceRuleWithConditionIsCategoryActionGroup" extends="AdminCreateCartPriceRuleActionGroup"> + <annotations> + <description>EXTENDS: AdminCreateCartPriceRuleActionGroup. Sets the provide Condition (Actions Aggregator/Value, Child Attribute and Action Value) for Actions on the Admin Cart Price Rule creation/edit page.</description> + </annotations> + <arguments> + <argument name="actionsAggregator" type="string" defaultValue="ANY"/> + <argument name="actionsValue" type="string" defaultValue="FALSE"/> + <argument name="childAttribute" type="string" defaultValue="Category"/> + <argument name="actionValue" type="string" defaultValue="2"/> + </arguments> + <click selector="{{AdminCartPriceRulesFormSection.actionsHeader}}" after="fillDiscountAmount" stepKey="clickOnActionTab"/> + <click selector="{{AdminCartPriceRulesFormSection.condition('ALL')}}" after="clickOnActionTab" stepKey="clickToChooseFirstRuleConditionValue"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.actionsAggregator}}" userInput="{{actionsAggregator}}" after="clickToChooseFirstRuleConditionValue" stepKey="changeFirstRuleConditionValue"/> + <click selector="{{AdminCartPriceRulesFormSection.condition('TRUE')}}" after="changeFirstRuleConditionValue" stepKey="clickToChooseSecondRuleConditionValue"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.actionsValue}}" userInput="{{actionsValue}}" after="clickToChooseSecondRuleConditionValue" stepKey="changeSecondRuleConditionValue"/> + <click selector="{{AdminCartPriceRulesFormSection.conditions}}" after="changeSecondRuleConditionValue" stepKey="clickConditionDropDownMenu"/> + <waitForPageLoad stepKey="waitForDropDownOpened"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.childAttribute}}" userInput="{{childAttribute}}" after="clickConditionDropDownMenu" stepKey="selectConditionAttributeIsCategory"/> + <waitForPageLoad after="selectConditionAttributeIsCategory" stepKey="waitForOperatorOpened"/> + <click selector="{{AdminCartPriceRulesFormSection.condition('...')}}" after="waitForOperatorOpened" stepKey="clickToChooserIcon"/> + <fillField selector="{{AdminCartPriceRulesFormSection.actionValue}}" userInput="{{actionValue}}" after="clickToChooserIcon" stepKey="choseNeededCategoryFromCategoryGrid"/> + <click selector="{{AdminCartPriceRulesFormSection.applyAction}}" after="choseNeededCategoryFromCategoryGrid" stepKey="applyAction"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleWithConditionsActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleWithConditionsActionGroup.xml new file mode 100644 index 0000000000000..db1bcde6677dc --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleWithConditionsActionGroup.xml @@ -0,0 +1,46 @@ +<?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="AdminCreateCartPriceRuleWithConditionsActionGroup" extends="AdminCreateCartPriceRuleActionGroup"> + <annotations> + <description>EXTENDS: AdminCreateCartPriceRuleActionGroup. Removes 'fillDiscountAmount'. Adds the 2 provided Conditions (Name, Rule, Rule to Change and Category Name) to a Cart Price Rule.</description> + </annotations> + <arguments> + <argument name="condition1" type="string" defaultValue="Products subselection"/> + <argument name="condition2" type="string" defaultValue="Category"/> + <argument name="ruleToChange1" type="string" defaultValue="is"/> + <argument name="rule1" type="string" defaultValue="equals or greater than"/> + <argument name="ruleToChange2" type="string" defaultValue="..."/> + <argument name="rule2" type="string" defaultValue="2"/> + <argument name="categoryName" type="string" defaultValue="_defaultCategory.name"/> + </arguments> + + <remove keyForRemoval="fillDiscountAmount"/> + + <!--Go to Conditions section--> + <click selector="{{AdminCartPriceRulesFormSection.conditionsHeader}}" stepKey="openConditionsSection" after="selectActionType"/> + <click selector="{{AdminCartPriceRulesFormSection.addCondition('1')}}" stepKey="addFirstCondition" after="openConditionsSection"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.ruleCondition('1')}}" userInput="{{condition1}}" stepKey="selectRule" after="addFirstCondition"/> + <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange1)}}" stepKey="waitForFirstRuleElement" after="selectRule"/> + <click selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange1)}}" stepKey="clickToChangeRule" after="waitForFirstRuleElement"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.ruleParameterSelect('1--1')}}" userInput="{{rule1}}" stepKey="selectRule1" after="clickToChangeRule"/> + <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange2)}}" stepKey="waitForSecondRuleElement" after="selectRule1"/> + <click selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange2)}}" stepKey="clickToChangeRule1" after="waitForSecondRuleElement"/> + <fillField selector="{{AdminCartPriceRulesFormSection.ruleParameterInput('1--1')}}" userInput="{{rule2}}" stepKey="fillRule" after="clickToChangeRule1"/> + <click selector="{{AdminCartPriceRulesFormSection.addCondition('1--1')}}" stepKey="addSecondCondition" after="fillRule"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.ruleCondition('1--1')}}" userInput="{{condition2}}" stepKey="selectSecondCondition" after="addSecondCondition"/> + <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange2)}}" stepKey="waitForThirdRuleElement" after="selectSecondCondition"/> + <click selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange2)}}" stepKey="addThirdCondition" after="waitForThirdRuleElement"/> + <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.openChooser('1--1--1')}}" stepKey="waitForForthRuleElement" after="addThirdCondition"/> + <click selector="{{AdminCartPriceRulesFormSection.openChooser('1--1--1')}}" stepKey="openChooser" after="waitForForthRuleElement"/> + <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.categoryCheckbox(categoryName)}}" stepKey="waitForCategoryVisible" after="openChooser"/> + <checkOption selector="{{AdminCartPriceRulesFormSection.categoryCheckbox(categoryName)}}" stepKey="checkCategoryName" after="waitForCategoryVisible"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleWithCouponCodeActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleWithCouponCodeActionGroup.xml new file mode 100644 index 0000000000000..51a45cf24784b --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleWithCouponCodeActionGroup.xml @@ -0,0 +1,28 @@ +<?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="AdminCreateCartPriceRuleWithCouponCodeActionGroup" extends="AdminCreateCartPriceRuleActionGroup"> + <annotations> + <description>EXTENDS: AdminCreateCartPriceRuleActionGroup. Removes 'selectActionType' and 'fillDiscountAmount'. Adds the provided Coupon Code to a Cart Price Rule.</description> + </annotations> + <arguments> + <argument name="couponCode" defaultValue="_defaultCoupon.code"/> + </arguments> + + <remove keyForRemoval="selectActionType"/> + <remove keyForRemoval="fillDiscountAmount"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.coupon}}" userInput="Specific Coupon" stepKey="selectCouponType" after="fillRuleName"/> + <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.couponCode}}" stepKey="waitForElementVisible" after="selectCouponType"/> + <fillField selector="{{AdminCartPriceRulesFormSection.couponCode}}" userInput="{{couponCode}}" stepKey="fillCouponCode" after="waitForElementVisible"/> + <fillField selector="{{AdminCartPriceRulesFormSection.userPerCoupon}}" userInput="99" stepKey="fillUserPerCoupon" after="fillCouponCode"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.apply}}" userInput="Fixed amount discount for whole cart" stepKey="selectActionTypeToFixed" after="clickToExpandActions"/> + <fillField selector="{{AdminCartPriceRulesFormSection.discountAmount}}" userInput="1" stepKey="fillDiscountAmount" after="selectActionTypeToFixed"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateMultiWebsiteCartPriceRuleActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateMultiWebsiteCartPriceRuleActionGroup.xml new file mode 100644 index 0000000000000..f04c76c190b81 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateMultiWebsiteCartPriceRuleActionGroup.xml @@ -0,0 +1,23 @@ +<?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="AdminCreateMultiWebsiteCartPriceRuleActionGroup" extends="AdminCreateCartPriceRuleActionGroup"> + <annotations> + <description>EXTENDS: AdminCreateCartPriceRuleActionGroup. Removes 'clickSaveButton' for the next data changing. Assign cart price rule to 2 websites instead of 1.</description> + </annotations> + <arguments> + <argument name="ruleName"/> + </arguments> + <remove keyForRemoval="clickSaveButton"/> + <remove keyForRemoval="seeSuccessMessage"/> + <remove keyForRemoval="selectWebsites"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" parameterArray="['FirstWebsite', 'SecondWebsite']" stepKey="selectWebsites" after="fillRuleName"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminDeleteCartPriceRuleForRetailerActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminDeleteCartPriceRuleForRetailerActionGroup.xml new file mode 100644 index 0000000000000..3f5d511ebfbe7 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminDeleteCartPriceRuleForRetailerActionGroup.xml @@ -0,0 +1,24 @@ +<?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="AdminDeleteCartPriceRuleForRetailerActionGroup"> + <annotations> + <description>Goes to the Admin Cart Price Rules grid page. Removes the 1st Cart Price Rule in the Grid.</description> + </annotations> + + <amOnPage url="{{AdminCartPriceRulesPage.url}}" stepKey="goToCartPriceRules"/> + <waitForPageLoad stepKey="waitForCartPriceRules"/> + <fillField selector="{{AdminCartPriceRulesSection.filterByNameInput}}" userInput="{{SimpleSalesRule.name}}" stepKey="filterByName"/> + <click selector="{{AdminCartPriceRulesSection.searchButton}}" stepKey="doFilter"/> + <click selector="{{AdminCartPriceRulesSection.rowByIndex('1')}}" stepKey="goToEditRulePage"/> + <click selector="{{AdminCartPriceRulesFormSection.delete}}" stepKey="clickDeleteButton"/> + <click selector="{{AdminCartPriceRulesFormSection.modalAcceptButton}}" stepKey="confirmDelete"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminFilterCartPriceRuleActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminFilterCartPriceRuleActionGroup.xml index 0f307b2dfe591..f939f9b5a81be 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminFilterCartPriceRuleActionGroup.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminFilterCartPriceRuleActionGroup.xml @@ -16,20 +16,10 @@ <arguments> <argument name="ruleName"/> </arguments> - + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> <fillField selector="{{AdminCartPriceRulesSection.filterByNameInput}}" userInput="{{ruleName}}" stepKey="filterByName"/> <click selector="{{AdminCartPriceRulesSection.searchButton}}" stepKey="doFilter"/> <click selector="{{AdminCartPriceRulesSection.rowByIndex('1')}}" stepKey="goToEditRulePage"/> </actionGroup> - - <actionGroup name="AdminCartPriceRuleNotInGridActionGroup" extends="AdminFilterCartPriceRuleActionGroup"> - <annotations> - <description>EXTENDS: AdminFilterCartPriceRuleActionGroup. Removes 'goToEditRulePage'. Validates that the Empty Grid message is present and correct.</description> - </annotations> - - <remove keyForRemoval="goToEditRulePage"/> - <waitForPageLoad stepKey="waitForStoreToLoad"/> - <see selector="{{AdminCartPriceRulesSection.emptyText}}" userInput="We couldn't find any records." stepKey="seeAssertCartPriceRuleIsNotPresentedInGrid"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminInactiveCartPriceRuleActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminInactiveCartPriceRuleActionGroup.xml new file mode 100644 index 0000000000000..dad1090d3af27 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminInactiveCartPriceRuleActionGroup.xml @@ -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="AdminInactiveCartPriceRuleActionGroup" extends="AdminCreateCartPriceRuleActionGroup"> + <annotations> + <description>EXTENDS: AdminCreateCartPriceRuleActionGroup. Clicks on 'Active'.</description> + </annotations> + + <click selector="{{AdminCartPriceRulesFormSection.active}}" stepKey="clickActiveToDisable" after="fillRuleName"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/CreateCartPriceRuleSecondWebsiteActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/CreateCartPriceRuleSecondWebsiteActionGroup.xml new file mode 100644 index 0000000000000..d291f2fb4e63d --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/CreateCartPriceRuleSecondWebsiteActionGroup.xml @@ -0,0 +1,25 @@ +<?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="CreateCartPriceRuleSecondWebsiteActionGroup"> + <annotations> + <description>Goes to the Admin Cart Price Rule grid page. Clicks on Add New Rule. Fills the provided Rule (Name). Selects 'Second Website' from the 'Websites' menu.</description> + </annotations> + <arguments> + <argument name="ruleName"/> + </arguments> + + <amOnPage url="{{AdminCartPriceRulesPage.url}}" stepKey="amOnCartPriceList"/> + <waitForPageLoad stepKey="waitForPriceList"/> + <click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/> + <fillField selector="{{AdminCartPriceRulesFormSection.ruleName}}" userInput="{{ruleName.name}}" stepKey="fillRuleName"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="Second Website" stepKey="selectWebsites"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/SelectNotLoggedInCustomerGroupActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/SelectNotLoggedInCustomerGroupActionGroup.xml new file mode 100644 index 0000000000000..4f5f50e128ae8 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/SelectNotLoggedInCustomerGroupActionGroup.xml @@ -0,0 +1,19 @@ +<?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="SelectNotLoggedInCustomerGroupActionGroup"> + <annotations> + <description>Selects 'NOT LOGGED IN' from the 'Customer Groups' list (Magento 2 B2B). PLEASE NOTE: The value is Hardcoded.</description> + </annotations> + + <!-- This actionGroup was created to be merged from B2B because B2B has a very different form control here --> + <selectOption selector="{{AdminCartPriceRulesFormSection.customerGroups}}" userInput="NOT LOGGED IN" stepKey="selectCustomerGroup"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/SelectRetailerCustomerGroupActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/SelectRetailerCustomerGroupActionGroup.xml new file mode 100644 index 0000000000000..8552189807470 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/SelectRetailerCustomerGroupActionGroup.xml @@ -0,0 +1,19 @@ +<?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="SelectRetailerCustomerGroupActionGroup"> + <annotations> + <description>Selects 'Retailer' from the 'Customer Groups' list (Magento 2 B2B). PLEASE NOTE: The value is Hardcoded.</description> + </annotations> + + <!-- This actionGroup was created to be merged from B2B. Retailer Customer Group --> + <selectOption selector="{{AdminCartPriceRulesFormSection.customerGroups}}" userInput="Retailer" stepKey="selectRetailerCustomerGroup"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/SetCartAttributeConditionForCartPriceRuleActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/SetCartAttributeConditionForCartPriceRuleActionGroup.xml new file mode 100644 index 0000000000000..466a02e607911 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/SetCartAttributeConditionForCartPriceRuleActionGroup.xml @@ -0,0 +1,34 @@ +<?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="SetCartAttributeConditionForCartPriceRuleActionGroup"> + <annotations> + <description>Sets the provided Cart Attribute Condition (Attribute Name, Operator Type and Value) on the Admin Cart Price Rule creation/edit page.</description> + </annotations> + <arguments> + <argument name="attributeName" type="string"/> + <argument name="operatorType" defaultValue="is" type="string"/> + <argument name="value" type="string"/> + </arguments> + + <scrollTo selector="{{AdminCartPriceRulesFormSection.conditionsHeader}}" stepKey="scrollToActionTab"/> + <conditionalClick selector="{{AdminCartPriceRulesFormSection.conditionsHeader}}" dependentSelector="{{AdminCartPriceRulesFormSection.conditionsHeaderOpen}}" visible="false" stepKey="openActionTab"/> + <click selector="{{AdminCartPriceRulesFormSection.conditions}}" stepKey="applyRuleForConditions"/> + <waitForPageLoad stepKey="waitForDropDownOpened"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.childAttribute}}" userInput="{{attributeName}}" stepKey="selectAttribute"/> + <waitForPageLoad stepKey="waitForOperatorOpened"/> + <click selector="{{AdminCartPriceRulesFormSection.condition('is')}}" stepKey="clickToChooseOption"/> + <selectOption userInput="{{operatorType}}" selector="{{AdminCartPriceRulesFormSection.conditionsOperator}}" stepKey="setOperatorType"/> + <click selector="{{AdminCartPriceRulesFormSection.condition('...')}}" stepKey="clickToChooseOption1"/> + <fillField userInput="{{value}}" selector="{{AdminCartPriceRulesFormSection.conditionsValue}}" stepKey="fillActionValue"/> + <click selector="{{AdminMainActionsSection.saveAndContinue}}" stepKey="clickSaveButton"/> + <see selector="{{AdminCartPriceRulesSection.messages}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/SetConditionForActionsInCartPriceRuleActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/SetConditionForActionsInCartPriceRuleActionGroup.xml new file mode 100644 index 0000000000000..118e9c9961ddb --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/SetConditionForActionsInCartPriceRuleActionGroup.xml @@ -0,0 +1,37 @@ +<?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="SetConditionForActionsInCartPriceRuleActionGroup"> + <annotations> + <description>Sets the provided Condition (Actions Aggregator/Value, Child Attribute and Action Value) for Actions on the Admin Cart Price Rule creation/edit page.</description> + </annotations> + <arguments> + <argument name="actionsAggregator" type="string" defaultValue="ANY"/> + <argument name="actionsValue" type="string" defaultValue="FALSE"/> + <argument name="childAttribute" type="string" defaultValue="Category"/> + <argument name="actionValue" type="string"/> + </arguments> + + <click selector="{{AdminCartPriceRulesFormSection.actionsHeader}}" stepKey="clickOnActionTab"/> + <click selector="{{AdminCartPriceRulesFormSection.condition('ALL')}}" stepKey="clickToChooseOption"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.actionsAggregator}}" userInput="{{actionsAggregator}}" stepKey="selectCondition"/> + <click selector="{{AdminCartPriceRulesFormSection.condition('TRUE')}}" stepKey="clickToChooseOption2"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.actionsValue}}" userInput="{{actionsValue}}" stepKey="selectCondition2"/> + <click selector="{{AdminCartPriceRulesFormSection.conditions}}" stepKey="selectActionConditions"/> + <waitForPageLoad stepKey="waitForDropDownOpened"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.childAttribute}}" userInput="{{childAttribute}}" stepKey="selectAttribute"/> + <waitForPageLoad stepKey="waitForOperatorOpened"/> + <click selector="{{AdminCartPriceRulesFormSection.condition('...')}}" stepKey="clickToChooseOption3"/> + <fillField selector="{{AdminCartPriceRulesFormSection.actionValue}}" userInput="{{actionValue}}" stepKey="fillActionValue"/> + <click selector="{{AdminCartPriceRulesFormSection.applyAction}}" stepKey="applyAction"/> + <click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveButton"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontApplyCouponActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontApplyCouponActionGroup.xml new file mode 100644 index 0000000000000..72f2fb2a2a386 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontApplyCouponActionGroup.xml @@ -0,0 +1,27 @@ +<?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"> + <!-- Apply Sales Rule Coupon to the cart --> + <actionGroup name="StorefrontApplyCouponActionGroup"> + <annotations> + <description>Applies the provided Coupon Code to the Storefront Shopping Cart.</description> + </annotations> + <arguments> + <argument name="coupon"/> + </arguments> + + <waitForElement selector="{{StorefrontSalesRuleCartCouponSection.couponHeader}}" time="30" stepKey="waitForCouponHeader"/> + <conditionalClick selector="{{StorefrontSalesRuleCartCouponSection.couponHeader}}" dependentSelector="{{StorefrontSalesRuleCartCouponSection.discountBlockActive}}" visible="false" stepKey="clickCouponHeader"/> + <waitForElementVisible selector="{{StorefrontSalesRuleCartCouponSection.couponField}}" stepKey="waitForCouponField"/> + <fillField userInput="{{coupon.code}}" selector="{{StorefrontSalesRuleCartCouponSection.couponField}}" stepKey="fillCouponField"/> + <click selector="{{StorefrontSalesRuleCartCouponSection.applyButton}}" stepKey="clickApplyButton"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontCancelCouponActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontCancelCouponActionGroup.xml new file mode 100644 index 0000000000000..a97d9e8cd6300 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontCancelCouponActionGroup.xml @@ -0,0 +1,21 @@ +<?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="StorefrontCancelCouponActionGroup"> + <annotations> + <description>Cancels the Coupon that is applied to the Storefront Shopping Cart.</description> + </annotations> + + <waitForElement selector="{{StorefrontSalesRuleCartCouponSection.couponHeader}}" time="30" stepKey="waitForCouponHeader"/> + <conditionalClick selector="{{StorefrontSalesRuleCartCouponSection.couponHeader}}" dependentSelector="{{StorefrontSalesRuleCartCouponSection.discountBlockActive}}" visible="false" stepKey="clickCouponHeader"/> + <waitForElementVisible selector="{{StorefrontSalesRuleCartCouponSection.couponField}}" stepKey="waitForCouponField"/> + <click selector="{{StorefrontSalesRuleCartCouponSection.cancelButton}}" stepKey="clickCancelButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontCheckCouponAppliedActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontCheckCouponAppliedActionGroup.xml new file mode 100644 index 0000000000000..84c2dd2121ae3 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontCheckCouponAppliedActionGroup.xml @@ -0,0 +1,24 @@ +<?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="StorefrontCheckCouponAppliedActionGroup"> + <annotations> + <description>Validates that the provided Rule and Discount Amount is present and correct on the Storefront Checkout page.</description> + </annotations> + <arguments> + <argument name="rule"/> + <argument name="discount" type="string"/> + </arguments> + + <waitForElementVisible selector="{{CheckoutCartSummarySection.discountTotal}}" stepKey="waitForDiscountTotal"/> + <see userInput="{{rule.store_labels[1][store_label]}}" selector="{{CheckoutCartSummarySection.discountLabel}}" stepKey="assertDiscountLabel"/> + <see userInput="-${{discount}}" selector="{{CheckoutCartSummarySection.discountTotal}}" stepKey="assertDiscountTotal"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontSalesRuleActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontSalesRuleActionGroup.xml deleted file mode 100644 index f978c1e2a9262..0000000000000 --- a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontSalesRuleActionGroup.xml +++ /dev/null @@ -1,76 +0,0 @@ -<?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"> - <!-- Apply Sales Rule Coupon to the cart --> - <actionGroup name="StorefrontApplyCouponActionGroup"> - <annotations> - <description>Applies the provided Coupon Code to the Storefront Shopping Cart.</description> - </annotations> - <arguments> - <argument name="coupon"/> - </arguments> - - <waitForElement selector="{{StorefrontSalesRuleCartCouponSection.couponHeader}}" time="30" stepKey="waitForCouponHeader"/> - <conditionalClick selector="{{StorefrontSalesRuleCartCouponSection.couponHeader}}" dependentSelector="{{StorefrontSalesRuleCartCouponSection.discountBlockActive}}" visible="false" stepKey="clickCouponHeader"/> - <waitForElementVisible selector="{{StorefrontSalesRuleCartCouponSection.couponField}}" stepKey="waitForCouponField"/> - <fillField userInput="{{coupon.code}}" selector="{{StorefrontSalesRuleCartCouponSection.couponField}}" stepKey="fillCouponField"/> - <click selector="{{StorefrontSalesRuleCartCouponSection.applyButton}}" stepKey="clickApplyButton"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - </actionGroup> - - <!-- Cancel Sales Rule Coupon applied to the cart --> - <actionGroup name="StorefrontCancelCouponActionGroup"> - <annotations> - <description>Cancels the Coupon that is applied to the Storefront Shopping Cart.</description> - </annotations> - - <waitForElement selector="{{StorefrontSalesRuleCartCouponSection.couponHeader}}" time="30" stepKey="waitForCouponHeader"/> - <conditionalClick selector="{{StorefrontSalesRuleCartCouponSection.couponHeader}}" dependentSelector="{{StorefrontSalesRuleCartCouponSection.discountBlockActive}}" visible="false" stepKey="clickCouponHeader"/> - <waitForElementVisible selector="{{StorefrontSalesRuleCartCouponSection.couponField}}" stepKey="waitForCouponField"/> - <click selector="{{StorefrontSalesRuleCartCouponSection.cancelButton}}" stepKey="clickCancelButton"/> - </actionGroup> - - <!-- Check applied discount in cart summary --> - <actionGroup name="StorefrontCheckCouponAppliedActionGroup"> - <annotations> - <description>Validates that the provided Rule and Discount Amount is present and correct on the Storefront Checkout page.</description> - </annotations> - <arguments> - <argument name="rule"/> - <argument name="discount" type="string"/> - </arguments> - - <waitForElementVisible selector="{{CheckoutCartSummarySection.discountTotal}}" stepKey="waitForDiscountTotal"/> - <see userInput="{{rule.store_labels[1][store_label]}}" selector="{{CheckoutCartSummarySection.discountLabel}}" stepKey="assertDiscountLabel"/> - <see userInput="-${{discount}}" selector="{{CheckoutCartSummarySection.discountTotal}}" stepKey="assertDiscountTotal"/> - </actionGroup> - - <actionGroup name="VerifyDiscountAmount"> - <annotations> - <description>Goes to the provided Storefront Product URL. Fills in provided Quantity. Clicks Add to Cart. Goes to Checkout. Validates that the provided Discount Amount is present and correct.</description> - </annotations> - <arguments> - <argument name="productUrl" type="string"/> - <argument name="quantity" type="string"/> - <argument name="expectedDiscount" type="string"/> - </arguments> - - <amOnPage url="{{productUrl}}" stepKey="goToProductPage"/> - <waitForPageLoad stepKey="waitForProductPageLoad"/> - <fillField selector="{{StorefrontProductActionSection.quantity}}" userInput="{{quantity}}" stepKey="fillQuantity"/> - <click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="addProductToCart"/> - <waitForPageLoad stepKey="waitForAddToCart"/> - <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/> - <amOnPage url="{{CheckoutCartPage.url}}" stepKey="goToCartPage"/> - <waitForPageLoad stepKey="waitForCartPage"/> - <waitForElementVisible selector="{{CheckoutCartSummarySection.discountAmount}}" stepKey="waitForDiscountElement"/> - <see selector="{{CheckoutCartSummarySection.discountAmount}}" userInput="{{expectedDiscount}}" stepKey="seeDiscountTotal"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/VerifyDiscountAmountActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/VerifyDiscountAmountActionGroup.xml new file mode 100644 index 0000000000000..c4e8f9f6ce32e --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/VerifyDiscountAmountActionGroup.xml @@ -0,0 +1,32 @@ +<?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="VerifyDiscountAmountActionGroup"> + <annotations> + <description>Goes to the provided Storefront Product URL. Fills in provided Quantity. Clicks Add to Cart. Goes to Checkout. Validates that the provided Discount Amount is present and correct.</description> + </annotations> + <arguments> + <argument name="productUrl" type="string"/> + <argument name="quantity" type="string"/> + <argument name="expectedDiscount" type="string"/> + </arguments> + + <amOnPage url="{{productUrl}}" stepKey="goToProductPage"/> + <waitForPageLoad stepKey="waitForProductPageLoad"/> + <fillField selector="{{StorefrontProductActionSection.quantity}}" userInput="{{quantity}}" stepKey="fillQuantity"/> + <click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="addProductToCart"/> + <waitForPageLoad stepKey="waitForAddToCart"/> + <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/> + <amOnPage url="{{CheckoutCartPage.url}}" stepKey="goToCartPage"/> + <waitForPageLoad stepKey="waitForCartPage"/> + <waitForElementVisible selector="{{CheckoutCartSummarySection.discountAmount}}" stepKey="waitForDiscountElement"/> + <see selector="{{CheckoutCartSummarySection.discountAmount}}" userInput="{{expectedDiscount}}" stepKey="seeDiscountTotal"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml index ab085dc5ae137..b516e102fc928 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml @@ -86,7 +86,7 @@ <actionGroup ref="saveProductForm" stepKey="saveProduct"/> <!--Create cart price rule--> - <actionGroup ref="AdminCreateCartPriceRuleWithConditions" stepKey="createRule"> + <actionGroup ref="AdminCreateCartPriceRuleWithConditionsActionGroup" stepKey="createRule"> <argument name="ruleName" value="PriceRuleWithCondition"/> <argument name="condition1" value="Products subselection"/> <argument name="condition2" value="Category"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateBuyXGetYFreeTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateBuyXGetYFreeTest.xml index 02078ff15ecc2..d6bb25fec6ff0 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateBuyXGetYFreeTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateBuyXGetYFreeTest.xml @@ -56,7 +56,7 @@ </actionGroup> <!-- Spot check the storefront --> - <actionGroup ref="VerifyDiscountAmount" stepKey="verifyStorefront"> + <actionGroup ref="VerifyDiscountAmountActionGroup" stepKey="verifyStorefront"> <argument name="productUrl" value="{{_defaultProduct.urlKey}}.html"/> <argument name="quantity" value="2"/> <argument name="expectedDiscount" value="-$123.00"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleEmptyFromDateTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleEmptyFromDateTest.xml index f5b285f2f0286..f0075a92a2b82 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleEmptyFromDateTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleEmptyFromDateTest.xml @@ -53,7 +53,7 @@ <click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/> <fillField selector="{{AdminCartPriceRulesFormSection.ruleName}}" userInput="{{_defaultCoupon.code}}" stepKey="fillRuleName"/> <selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="Main Website" stepKey="selectWebsites"/> - <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectCustomerGroup"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectCustomerGroup"/> <selectOption selector="{{AdminCartPriceRulesFormSection.coupon}}" userInput="Specific Coupon" stepKey="selectCouponType"/> <fillField selector="{{AdminCartPriceRulesFormSection.couponCode}}" userInput="{{_defaultCoupon.code}}" stepKey="fillCouponCode"/> <click selector="{{AdminCartPriceRulesFormSection.actionsHeader}}" stepKey="clickToExpandActions"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountDiscountTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountDiscountTest.xml index 1681d910ccdb0..1b5361a7f1d4d 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountDiscountTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountDiscountTest.xml @@ -55,7 +55,7 @@ </actionGroup> <!-- Spot check the storefront --> - <actionGroup ref="VerifyDiscountAmount" stepKey="verifyStorefront"> + <actionGroup ref="VerifyDiscountAmountActionGroup" stepKey="verifyStorefront"> <argument name="productUrl" value="{{_defaultProduct.urlKey}}.html"/> <argument name="quantity" value="2"/> <argument name="expectedDiscount" value="-$20.00"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountWholeCartDiscountTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountWholeCartDiscountTest.xml index 69918bda8c426..f4acb93c54572 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountWholeCartDiscountTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountWholeCartDiscountTest.xml @@ -55,7 +55,7 @@ </actionGroup> <!-- Spot check the storefront --> - <actionGroup ref="VerifyDiscountAmount" stepKey="verifyStorefront"> + <actionGroup ref="VerifyDiscountAmountActionGroup" stepKey="verifyStorefront"> <argument name="productUrl" value="{{_defaultProduct.urlKey}}.html"/> <argument name="quantity" value="2"/> <argument name="expectedDiscount" value="-$19.99"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreatePercentOfProductPriceTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreatePercentOfProductPriceTest.xml index 898e5a07304b6..e859d4ffc2b98 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreatePercentOfProductPriceTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreatePercentOfProductPriceTest.xml @@ -55,7 +55,7 @@ </actionGroup> <!-- Spot check the storefront --> - <actionGroup ref="VerifyDiscountAmount" stepKey="verifyStorefront"> + <actionGroup ref="VerifyDiscountAmountActionGroup" stepKey="verifyStorefront"> <argument name="productUrl" value="{{_defaultProduct.urlKey}}.html"/> <argument name="quantity" value="1"/> <argument name="expectedDiscount" value="-$61.50"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminDeleteActiveSalesRuleWithPercentPriceAndVerifyDeleteMessageTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminDeleteActiveSalesRuleWithPercentPriceAndVerifyDeleteMessageTest.xml index 41e4221a2c37f..34b8363e8b5ce 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminDeleteActiveSalesRuleWithPercentPriceAndVerifyDeleteMessageTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminDeleteActiveSalesRuleWithPercentPriceAndVerifyDeleteMessageTest.xml @@ -22,7 +22,7 @@ <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!--Create active cart price rule--> - <actionGroup ref="AdminCreateCartPriceRuleWithCouponCode" stepKey="createActiveCartPriceRule"> + <actionGroup ref="AdminCreateCartPriceRuleWithCouponCodeActionGroup" stepKey="createActiveCartPriceRule"> <argument name="ruleName" value="ActiveSalesRuleWithPercentPriceDiscountCoupon"/> <argument name="couponCode" value="ActiveSalesRuleWithPercentPriceDiscountCoupon.coupon_code"/> </actionGroup> @@ -41,4 +41,4 @@ <argument name="ruleName" value="ActiveSalesRuleWithPercentPriceDiscountCoupon.name"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/CartPriceRuleForConfigurableProductTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/CartPriceRuleForConfigurableProductTest.xml index 1eba06126ff6f..83625acf69822 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/CartPriceRuleForConfigurableProductTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/CartPriceRuleForConfigurableProductTest.xml @@ -88,14 +88,14 @@ <deleteData createDataKey="createCategory" stepKey="deleteApiCategory"/> <actionGroup ref="logout" stepKey="logout"/> </after> - + <!-- Create the rule --> <amOnPage url="{{AdminCartPriceRulesPage.url}}" stepKey="amOnCartPriceList"/> <waitForPageLoad stepKey="waitForRulesPage"/> <click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/> <fillField selector="{{AdminCartPriceRulesFormSection.ruleName}}" userInput="{{SimpleSalesRule.name}}" stepKey="fillRuleName"/> <selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="Main Website" stepKey="selectWebsites"/> - <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroup"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroup"/> <generateDate date="-1 day" format="m/d/Y" stepKey="yesterdayDate"/> <fillField selector="{{AdminCartPriceRulesFormSection.fromDate}}" userInput="{$yesterdayDate}" stepKey="fillFromDate"/> <selectOption selector="{{AdminCartPriceRulesFormSection.coupon}}" userInput="Specific Coupon" stepKey="selectCouponType"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleCountry.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleCountry.xml index ffd50e43a2344..832b9ef8bd4b4 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleCountry.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleCountry.xml @@ -42,7 +42,7 @@ <click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/> <fillField selector="{{AdminCartPriceRulesFormSection.ruleName}}" userInput="{{SimpleSalesRule.name}}" stepKey="fillRuleName"/> <selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="Main Website" stepKey="selectWebsites"/> - <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroup"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroup"/> <generateDate date="-1 day" format="m/d/Y" stepKey="yesterdayDate"/> <fillField selector="{{AdminCartPriceRulesFormSection.fromDate}}" userInput="{$yesterdayDate}" stepKey="fillFromDate"/> <click selector="{{PriceRuleConditionsSection.conditionsTab}}" stepKey="expandConditions"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRulePostcode.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRulePostcode.xml index 765f10e44d81b..9882b04bdc956 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRulePostcode.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRulePostcode.xml @@ -42,7 +42,7 @@ <click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/> <fillField selector="{{AdminCartPriceRulesFormSection.ruleName}}" userInput="{{SimpleSalesRule.name}}" stepKey="fillRuleName"/> <selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="Main Website" stepKey="selectWebsites"/> - <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroup"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroup"/> <generateDate date="-1 day" format="m/d/Y" stepKey="yesterdayDate"/> <fillField selector="{{AdminCartPriceRulesFormSection.fromDate}}" userInput="{$yesterdayDate}" stepKey="fillFromDate"/> <click selector="{{PriceRuleConditionsSection.conditionsTab}}" stepKey="expandConditions"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleQuantity.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleQuantity.xml index cde5e351e1b70..ad060c1412c8c 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleQuantity.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleQuantity.xml @@ -42,7 +42,7 @@ <click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/> <fillField selector="{{AdminCartPriceRulesFormSection.ruleName}}" userInput="{{SimpleSalesRule.name}}" stepKey="fillRuleName"/> <selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="Main Website" stepKey="selectWebsites"/> - <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroup"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroup"/> <generateDate date="-1 day" format="m/d/Y" stepKey="yesterdayDate"/> <fillField selector="{{AdminCartPriceRulesFormSection.fromDate}}" userInput="{$yesterdayDate}" stepKey="fillFromDate"/> <click selector="{{PriceRuleConditionsSection.conditionsTab}}" stepKey="expandConditions"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleState.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleState.xml index d6806e2a2966b..19ffb7c36f992 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleState.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleState.xml @@ -42,7 +42,7 @@ <click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/> <fillField selector="{{AdminCartPriceRulesFormSection.ruleName}}" userInput="{{SimpleSalesRule.name}}" stepKey="fillRuleName"/> <selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="Main Website" stepKey="selectWebsites"/> - <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroup"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroup"/> <generateDate date="-1 day" format="m/d/Y" stepKey="yesterdayDate"/> <fillField selector="{{AdminCartPriceRulesFormSection.fromDate}}" userInput="{$yesterdayDate}" stepKey="fillFromDate"/> <click selector="{{PriceRuleConditionsSection.conditionsTab}}" stepKey="expandConditions"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleSubtotal.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleSubtotal.xml index 8ff747607ea30..510bfabf303f5 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleSubtotal.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleSubtotal.xml @@ -42,7 +42,7 @@ <click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/> <fillField selector="{{AdminCartPriceRulesFormSection.ruleName}}" userInput="{{SimpleSalesRule.name}}" stepKey="fillRuleName"/> <selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="Main Website" stepKey="selectWebsites"/> - <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroup"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroup"/> <generateDate date="-1 day" format="m/d/Y" stepKey="yesterdayDate"/> <fillField selector="{{AdminCartPriceRulesFormSection.fromDate}}" userInput="{$yesterdayDate}" stepKey="fillFromDate"/> <click selector="{{PriceRuleConditionsSection.conditionsTab}}" stepKey="expandConditions"/> From d26e7b8afcfa04fdbdcb79ff2daf3e1149f977e2 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <p.bystritsky@yandex.ru> Date: Thu, 28 Nov 2019 17:05:02 +0200 Subject: [PATCH 123/586] Tests for: magento/magento2#25058, magento/magento2#25248. --- .../Mftf/Section/AdminImportMainSection.xml | 1 + ...gesFileDirectoryCorrectExplanationTest.xml | 33 ++++++++++++++ .../Page/AdminNewsletterSubscriberPage.xml | 13 ++++++ .../AdminNewsletterSubscriberGridSection.xml | 16 +++++++ .../Mftf/Test/AdminNameEmptyForGuestTest.xml | 45 +++++++++++++++++++ 5 files changed, 108 insertions(+) create mode 100644 app/code/Magento/ImportExport/Test/Mftf/Test/AdminImagesFileDirectoryCorrectExplanationTest.xml create mode 100644 app/code/Magento/Newsletter/Test/Mftf/Page/AdminNewsletterSubscriberPage.xml create mode 100644 app/code/Magento/Newsletter/Test/Mftf/Section/AdminNewsletterSubscriberGridSection.xml create mode 100644 app/code/Magento/Newsletter/Test/Mftf/Test/AdminNameEmptyForGuestTest.xml diff --git a/app/code/Magento/ImportExport/Test/Mftf/Section/AdminImportMainSection.xml b/app/code/Magento/ImportExport/Test/Mftf/Section/AdminImportMainSection.xml index ba1deeebbd89a..0f647aa027c23 100644 --- a/app/code/Magento/ImportExport/Test/Mftf/Section/AdminImportMainSection.xml +++ b/app/code/Magento/ImportExport/Test/Mftf/Section/AdminImportMainSection.xml @@ -17,5 +17,6 @@ <element name="messageError" type="text" selector=".messages div.message-error"/> <element name="validationStrategy" type="select" selector="#basic_behaviorvalidation_strategy"/> <element name="allowedErrorsCount" type="input" selector="#basic_behavior_allowed_error_count"/> + <element name="importImagesFileDirNote" type="input" selector="#import_images_file_dir-note"/> </section> </sections> diff --git a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminImagesFileDirectoryCorrectExplanationTest.xml b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminImagesFileDirectoryCorrectExplanationTest.xml new file mode 100644 index 0000000000000..989c405324f06 --- /dev/null +++ b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminImagesFileDirectoryCorrectExplanationTest.xml @@ -0,0 +1,33 @@ +<?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="AdminImagesFileDirectoryCorrectExplanationTest"> + <annotations> + <features value="Import/Export"/> + <stories value="Import CSV file"/> + <title value="Images file directory correct explanation test"/> + <description value="Check correct explanation for the 'Images File Directory' option."/> + <severity value="MINOR"/> + <group value="importExport"/> + </annotations> + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + </before> + <after> + <actionGroup ref="logout" stepKey="logoutFromAdmin"/> + </after> + <amOnPage url="{{AdminImportIndexPage.url}}" stepKey="goToImportIndexPage"/> + <waitForPageLoad stepKey="adminImportMainSectionLoad"/> + <selectOption selector="{{AdminImportMainSection.entityType}}" userInput="Products" stepKey="selectProductsOption"/> + <waitForElementVisible selector="{{AdminImportMainSection.importBehavior}}" stepKey="waitForImportBehaviorElementVisible"/> + + <see selector="{{AdminImportMainSection.importImagesFileDirNote}}" userInput='For Type "Local Server" use relative path to <Magento root directory>/var/import/images, e.g. ' stepKey="seeCorrectExplanation"/> + </test> +</tests> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Page/AdminNewsletterSubscriberPage.xml b/app/code/Magento/Newsletter/Test/Mftf/Page/AdminNewsletterSubscriberPage.xml new file mode 100644 index 0000000000000..0193064c8756c --- /dev/null +++ b/app/code/Magento/Newsletter/Test/Mftf/Page/AdminNewsletterSubscriberPage.xml @@ -0,0 +1,13 @@ +<?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="AdminNewsletterSubscriberPage" url="newsletter/subscriber/index/" area="admin" module="Magento_Newsletter"> + <section name="AdminNewsletterSubscriberGridSection"/> + </page> +</pages> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Section/AdminNewsletterSubscriberGridSection.xml b/app/code/Magento/Newsletter/Test/Mftf/Section/AdminNewsletterSubscriberGridSection.xml new file mode 100644 index 0000000000000..3332041817150 --- /dev/null +++ b/app/code/Magento/Newsletter/Test/Mftf/Section/AdminNewsletterSubscriberGridSection.xml @@ -0,0 +1,16 @@ +<?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="AdminNewsletterSubscriberGridSection"> + <element name="email" type="text" selector="//table[contains(@class, 'data-grid')]/tbody/tr[{{row}}][@data-role='row']/td[@data-column='email']" parameterized="true"/> + <element name="type" type="text" selector="//table[contains(@class, 'data-grid')]/tbody/tr[{{row}}][@data-role='row']/td[@data-column='type']" parameterized="true"/> + <element name="firstName" type="text" selector="//table[contains(@class, 'data-grid')]/tbody/tr[{{row}}][@data-role='row']/td[@data-column='firstname']" parameterized="true"/> + <element name="lastName" type="text" selector="//table[contains(@class, 'data-grid')]/tbody/tr[{{row}}][@data-role='row']/td[@data-column='lastname']" parameterized="true"/> + </section> +</sections> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminNameEmptyForGuestTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminNameEmptyForGuestTest.xml new file mode 100644 index 0000000000000..07c7cc050d5cf --- /dev/null +++ b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminNameEmptyForGuestTest.xml @@ -0,0 +1,45 @@ +<?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="AdminNameEmptyForGuestTest"> + <annotations> + <features value="Newsletter"/> + <group value="Newsletter"/> + <title value="Empty name for Guest Customer"/> + <description value="'Customer First Name' and 'Customer Last Name' should be empty for Guest Customer in Newsletter Subscribers Grid"/> + <severity value="MINOR"/> + </annotations> + + <before> + <actionGroup ref="LoginActionGroup" stepKey="loginAsAdmin"/> + </before> + + <after> + <actionGroup ref="logout" stepKey="adminLogout"/> + </after> + + <amOnPage url="{{StorefrontHomePage.url}}" stepKey="amOnStorefrontPage"/> + <waitForPageLoad stepKey="waitForCustomerPage"/> + <scrollTo selector="{{StorefrontCustomerFooterSection.footerBlock}}" stepKey="scrollToFooter"/> + <fillField userInput="{{Simple_US_Customer.email}}" selector="{{StorefrontCustomerFooterSection.formSubscribe}}" + stepKey="giveEmail"/> + <click selector="{{StorefrontCustomerFooterSection.buttonSubscribe}}" stepKey="clickSubscribeButton"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <see selector="{{StorefrontCustomerMessagesSection.successMessage}}" + userInput="Thank you for your subscription." stepKey="checkSuccessMessage"/> + + <amOnPage url="{{AdminNewsletterSubscriberPage.url}}" stepKey="amOnNewsletterSubscribersPage"/> + <see selector="{{AdminNewsletterSubscriberGridSection.email('1')}}" userInput="{{Simple_US_Customer.email}}" + stepKey="checkEmail"/> + <see selector="{{AdminNewsletterSubscriberGridSection.type('1')}}" userInput="Guest" stepKey="checkType"/> + <see selector="{{AdminNewsletterSubscriberGridSection.firstName('1')}}" userInput="" stepKey="checkFirstName"/> + <see selector="{{AdminNewsletterSubscriberGridSection.lastName('1')}}" userInput="" stepKey="checkLastName"/> + </test> +</tests> From 4c9c7bfb7c28cdd29e7b5f16944d81a3a9b99be5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 17:00:15 +0100 Subject: [PATCH 124/586] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- .../Test/AdminDashboardWithChartsChart.xml | 2 +- ...AnAdminOrderUsingBraintreePaymentTest1.xml | 8 +- ...thOnlinePaymentIncludingTaxAndDiscount.xml | 8 +- ...ProductWithZeroPriceToShoppingCartTest.xml | 2 +- .../Test/CheckTierPricingOfProductsTest.xml | 2 +- ...ctCustomOptionsDifferentStoreViewsTest.xml | 2 +- ...ntPurchaseProductWithCustomOptionsTest.xml | 2 +- ...ckoutAsCustomerUsingDefaultAddressTest.xml | 2 +- ...eCheckoutAsCustomerUsingNewAddressTest.xml | 2 +- ...utAsCustomerUsingNonDefaultAddressTest.xml | 2 +- .../OnePageCheckoutUsingSignInLinkTest.xml | 2 +- ...OnePageCheckoutWithAllProductTypesTest.xml | 2 +- ...efrontApplyPromoCodeDuringCheckoutTest.xml | 2 +- ...ingAddressAndProductWithTierPricesTest.xml | 4 +- ...ssAndRegisterCustomerAfterCheckoutTest.xml | 4 +- ...ntCheckoutWithSpecialPriceProductsTest.xml | 4 +- ...OnLoginWhenGuestCheckoutIsDisabledTest.xml | 4 +- ...egistrationAndDisableGuestCheckoutTest.xml | 4 +- ...tCheckoutUsingFreeShippingAndTaxesTest.xml | 4 +- ...tCheckoutWithCouponAndZeroSubtotalTest.xml | 4 +- ...ngesInBackendAfterCustomerCheckoutTest.xml | 4 +- ...efrontUKCustomerCheckoutWithCouponTest.xml | 2 +- ...uctQuantityEqualsToOrderedQuantityTest.xml | 4 +- ...CouponAndBankTransferPaymentMethodTest.xml | 4 +- ...SubtotalOrdersWithProcessingStatusTest.xml | 2 +- ...vailableToConfigureDisabledProductTest.xml | 4 +- .../ProductsQtyReturnAfterOrderCancelTest.xml | 4 +- ...ayWhenChooseThreeAllowedCurrenciesTest.xml | 2 +- .../AdminOrderRateDisplayedInOneLineTest.xml | 2 +- ...fStorefrontIsOpenedViaCustomerViewTest.xml | 12 +- ...oreFrontMyAccountWithMultishipmentTest.xml | 4 +- .../CancelOrdersInOrderSalesReportTest.xml | 2 +- .../AddBundleProductToOrderActionGroup.xml | 32 + ...tToOrderAndCheckPriceInGridActionGroup.xml | 25 + ...dConfigurableProductToOrderActionGroup.xml | 33 ++ ...ableProductToOrderFromAdminActionGroup.xml | 19 + ...dDownloadableProductToOrderActionGroup.xml | 29 + ...GroupedProductOptionToOrderActionGroup.xml | 33 ++ .../AddSimpleProductToOrderActionGroup.xml | 30 + ...SimpleProductWithQtyToOrderActionGroup.xml | 18 + .../AdminCreateInvoiceActionGroup.xml | 12 - ...nCreateInvoiceAndCreditMemoActionGroup.xml | 19 + ...minCreateInvoiceAndShipmentActionGroup.xml | 15 + .../AdminCreditMemoActionGroup.xml | 32 +- .../AdminFastCreateInvoiceActionGroup.xml | 26 + .../ActionGroup/AdminInvoiceActionGroup.xml | 130 ---- ...OpenAndFillCreditMemoRefundActionGroup.xml | 11 +- ...ditMemoRefundAndBackToStockActionGroup.xml | 18 + .../ActionGroup/AdminOrderActionGroup.xml | 557 ------------------ .../ActionGroup/AdminOrderGridActionGroup.xml | 113 ---- ...AdminOrdersGridClearFiltersActionGroup.xml | 20 + ...sertOrderAddressInformationActionGroup.xml | 20 + .../CancelPendingOrderActionGroup.xml | 26 + .../ChangeShippingMethodActionGroup.xml | 26 + ...kRequiredFieldsNewOrderFormActionGroup.xml | 39 ++ .../ClearInvoicesGridFiltersActionGroup.xml | 21 + ...eOrderedConfigurableProductActionGroup.xml | 28 + .../ActionGroup/CreateOrderActionGroup.xml | 38 ++ ...derFilteringCustomerByEmailActionGroup.xml | 14 + .../CreateOrderInStoreActionGroup.xml | 39 ++ ...nStoreChoosingPaymentMethodActionGroup.xml | 40 ++ .../CreateOrderToPrintPageActionGroup.xml | 9 - ...geWithSelectedPaymentMethodActionGroup.xml | 19 + ...ontSeeProductInItemsOrderedActionGroup.xml | 17 + ...illOrderCustomerInformationActionGroup.xml | 29 + .../FilterInvoiceGridByOrderIdActionGroup.xml | 25 + ...idByOrderIdWithCleanFiltersActionGroup.xml | 17 + ...erOrderGridByBaseTotalRangeActionGroup.xml | 26 + ...ilterOrderGridByBillingNameActionGroup.xml | 26 + .../FilterOrderGridByIdActionGroup.xml | 30 + ...lterOrderGridByPurchaseDateActionGroup.xml | 26 + .../FilterOrderGridByStatusActionGroup.xml | 24 + .../GoToInvoiceIntoOrderActionGroup.xml | 20 + ...ewOrderPageExistingCustomerActionGroup.xml | 39 ++ ...ageExistingCustomerAndStoreActionGroup.xml | 22 + ...teToNewOrderPageNewCustomerActionGroup.xml | 29 + ...rPageNewCustomerSingleStoreActionGroup.xml | 26 + ...dConfigurableProductToOrderActionGroup.xml | 16 + .../ActionGroup/OpenOrderByIdActionGroup.xml | 19 + ...OrderSelectFlatRateShippingActionGroup.xml | 22 + .../OrderSelectFreeShippingActionGroup.xml | 22 + .../SeeProductInInvoiceItemsActionGroup.xml | 21 + .../SeeProductInItemsOrderedActionGroup.xml | 21 + .../SeeProductInItemsRefundedActionGroup.xml | 21 + ...ctBankTransferPaymentMethodActionGroup.xml | 15 + ...CashOnDeliveryPaymentMethodActionGroup.xml | 15 + ...lectCheckMoneyPaymentMethodActionGroup.xml | 19 + ...tPurchaseOrderPaymentMethodActionGroup.xml | 19 + ...tCreateInvoiceFromOrderPageActionGroup.xml | 20 + .../StartToCreateCreditMemoActionGroup.xml | 20 + .../SubmitCreditMemoActionGroup.xml | 19 + .../ActionGroup/SubmitInvoiceActionGroup.xml | 22 + .../UpdateCreditMemoTotalsActionGroup.xml | 15 + ...rifyBasicInvoiceInformationActionGroup.xml | 35 ++ ...VerifyBasicOrderInformationActionGroup.xml | 34 ++ ...rifyCreatedOrderInformationActionGroup.xml | 21 + ...vailabilityCreditMemoWithNoPaymentTest.xml | 12 +- ...OrderWithBankTransferPaymentMethodTest.xml | 8 +- ...derWithCashOnDeliveryPaymentMethodTest.xml | 8 +- ...erWithCheckMoneyOrderPaymentMethodTest.xml | 16 +- ...WithProductQtyWithoutStockDecreaseTest.xml | 14 +- ...rderWithPurchaseOrderPaymentMethodTest.xml | 10 +- ...eatedOrderWithZeroSubtotalCheckoutTest.xml | 10 +- .../AdminChangeCustomerGroupInNewOrder.xml | 4 +- ...dminCheckingCreditMemoUpdateTotalsTest.xml | 4 +- ...kingDateAfterChangeInterfaceLocaleTest.xml | 4 +- ...ectnessInvoicedItemInBundleProductTest.xml | 6 +- ...reateCreditMemoBankTransferPaymentTest.xml | 12 +- ...reateCreditMemoConfigurableProductTest.xml | 12 +- ...AdminCreateCreditMemoPartialRefundTest.xml | 14 +- ...CreateCreditMemoWithCashOnDeliveryTest.xml | 12 +- ...nCreateCreditMemoWithPurchaseOrderTest.xml | 12 +- ...AdminCreateOrderAddProductCheckboxTest.xml | 2 +- ...AdminCreateOrderAndCheckTheReorderTest.xml | 10 +- ...thTwoAddressesTaxableAndNonTaxableTest.xml | 8 +- .../AdminCreateOrderWithBundleProductTest.xml | 8 +- ...reateOrderWithMinimumAmountEnabledTest.xml | 14 +- ...OrderWithSelectedShoppingCartItemsTest.xml | 12 +- .../AdminCreateOrderWithSimpleProductTest.xml | 10 +- ...nimumOrderAmountNotMatchOrderTotalTest.xml | 4 +- .../Mftf/Test/AdminHoldCreatedOrderTest.xml | 10 +- ...rderCreationWithMultiWebsiteConfigTest.xml | 8 +- .../Test/AdminReorderWithCatalogPriceTest.xml | 2 +- ...dminSaveInAddressBookCheckboxStateTest.xml | 4 +- ...dminSubmitConfigurableProductOrderTest.xml | 12 +- ...ubmitsOrderPaymentMethodValidationTest.xml | 10 +- ...minSubmitsOrderWithAndWithoutEmailTest.xml | 12 +- ...rderWithAndWithoutFieldsValidationTest.xml | 12 +- ...mOrderStatusNotVisibleOnStorefrontTest.xml | 4 +- ...SSVulnerabilityDuringOrderCreationTest.xml | 2 +- .../CreateInvoiceAndCheckInvoiceOrderTest.xml | 6 +- ...iceWithCashOnDeliveryPaymentMethodTest.xml | 4 +- ...eWithShipmentAndCheckInvoicedOrderTest.xml | 10 +- ...ateInvoiceWithZeroSubtotalCheckoutTest.xml | 8 +- .../CreateOrderFromEditCustomerPageTest.xml | 8 +- .../Test/Mftf/Test/EndToEndB2CAdminTest.xml | 42 +- ...eredConfigurableProductOnOrderPageTest.xml | 4 +- .../Test/StorefrontPrintOrderGuestTest.xml | 6 +- ...ustomStoreShippingMethodTableRatesTest.xml | 6 +- .../AdminCreatePartialShipmentEntityTest.xml | 6 +- .../Test/AdminCreateShipmentEntityTest.xml | 6 +- .../AdminTaxCalcWithApplyTaxOnSettingTest.xml | 6 +- .../Test/Mftf/Test/AdminTaxReportGridTest.xml | 10 +- .../Mftf/Test/CheckCreditMemoTotalsTest.xml | 6 +- 144 files changed, 1652 insertions(+), 1133 deletions(-) create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AddBundleProductToOrderActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AddBundleProductToOrderAndCheckPriceInGridActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AddConfigurableProductToOrderActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AddConfigurableProductToOrderFromAdminActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AddDownloadableProductToOrderActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AddGroupedProductOptionToOrderActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductToOrderActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductWithQtyToOrderActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCreateInvoiceAndCreditMemoActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCreateInvoiceAndShipmentActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminFastCreateInvoiceActionGroup.xml delete mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOpenAndFillCreditMemoRefundAndBackToStockActionGroup.xml delete mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderActionGroup.xml delete mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderGridActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrdersGridClearFiltersActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertOrderAddressInformationActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/CancelPendingOrderActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/ChangeShippingMethodActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/CheckRequiredFieldsNewOrderFormActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/ClearInvoicesGridFiltersActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/ConfigureOrderedConfigurableProductActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderFilteringCustomerByEmailActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderInStoreActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderInStoreChoosingPaymentMethodActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderToPrintPageWithSelectedPaymentMethodActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/DontSeeProductInItemsOrderedActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/FillOrderCustomerInformationActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterInvoiceGridByOrderIdActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterInvoiceGridByOrderIdWithCleanFiltersActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByBaseTotalRangeActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByBillingNameActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByIdActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByPurchaseDateActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByStatusActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/GoToInvoiceIntoOrderActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageExistingCustomerActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageExistingCustomerAndStoreActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageNewCustomerActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageNewCustomerSingleStoreActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/NewAddConfigurableProductToOrderActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/OpenOrderByIdActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/OrderSelectFlatRateShippingActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/OrderSelectFreeShippingActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/SeeProductInInvoiceItemsActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/SeeProductInItemsOrderedActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/SeeProductInItemsRefundedActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/SelectBankTransferPaymentMethodActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/SelectCashOnDeliveryPaymentMethodActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/SelectCheckMoneyPaymentMethodActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/SelectPurchaseOrderPaymentMethodActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/StartCreateInvoiceFromOrderPageActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/StartToCreateCreditMemoActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/SubmitCreditMemoActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/SubmitInvoiceActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/UpdateCreditMemoTotalsActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/VerifyBasicInvoiceInformationActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/VerifyBasicOrderInformationActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/VerifyCreatedOrderInformationActionGroup.xml diff --git a/app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardWithChartsChart.xml b/app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardWithChartsChart.xml index f48c7752efc7a..53d2081958b21 100644 --- a/app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardWithChartsChart.xml +++ b/app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardWithChartsChart.xml @@ -76,7 +76,7 @@ <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> <!-- Search for Order in the order grid --> <comment userInput="Search for Order in the order grid" stepKey="searchOrderInGrid"/> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$grabOrderNumber"/> </actionGroup> <waitForLoadingMaskToDisappear stepKey="waitForSearchingOrder"/> diff --git a/app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest1.xml b/app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest1.xml index 2594d245f9ff0..5a332b3518256 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest1.xml +++ b/app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest1.xml @@ -59,23 +59,23 @@ <waitForPageLoad stepKey="waitForLogin" time="3"/> <!--Create New Order--> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrder"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrder"> <argument name="customer" value="Simple_US_Customer"/> </actionGroup> <!--Add Product to Order--> - <actionGroup ref="addSimpleProductToOrder" stepKey="addProduct"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addProduct"> <argument name="product" value="_defaultProduct"/> </actionGroup> <!--Fill Order Customer Information--> - <actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerAddress"> + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerAddress"> <argument name="customer" value="Simple_US_Customer"/> <argument name="address" value="US_Address_TX"/> </actionGroup> <!--Select Shipping--> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRateShipping"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRateShipping"/> <waitForPageLoad stepKey="waitForShippingToFinish"/> <!--Pay with Braintree --> diff --git a/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml b/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml index 8f0ce4918b978..b2f13d6c8c56c 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml +++ b/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml @@ -98,17 +98,17 @@ <actionGroup ref="saveProductForm" stepKey="saveProductForm"/> <!--Create New Order--> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$simpleCustomer$$"/> </actionGroup> <!--Add a product to order--> - <actionGroup ref="addSimpleProductToOrder" stepKey="addProductToOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addProductToOrder"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> <!--Select FlatRate shipping method--> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="orderSelectFlatRateShippingMethod"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="orderSelectFlatRateShippingMethod"/> <!--Select Braintree online Payment method --> <actionGroup ref="AdminOrderBraintreeFillActionGroup" stepKey="selectCreditCardPayment"/> @@ -119,7 +119,7 @@ <see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="You created the order." stepKey="seeOrderSuccessMessage" after="waitForSubmitOrder"/> <!-- Create New invoice--> - <actionGroup ref="adminFastCreateInvoice" stepKey="createInvoice"/> + <actionGroup ref="AdminFastCreateInvoiceActionGroup" stepKey="createInvoice"/> <!--Get access to Credit Memo page from Invoice page--> <click selector="{{AdminInvoiceMainActionsSection.openNewCreditMemoFromInvoice}}" stepKey="clickCreateNewCreditMemo"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleProductWithZeroPriceToShoppingCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleProductWithZeroPriceToShoppingCartTest.xml index 33181d6e920eb..64b786ac4ed7c 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleProductWithZeroPriceToShoppingCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleProductWithZeroPriceToShoppingCartTest.xml @@ -67,7 +67,7 @@ <!--Check subtotal in created order--> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderById"> <argument name="orderId" value="$grabOrderNumber"/> </actionGroup> <click selector="{{AdminOrdersGridSection.firstRow}}" stepKey="clickOrderRow"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/CheckTierPricingOfProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/CheckTierPricingOfProductsTest.xml index cee40241185b4..9e980784e1a7c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/CheckTierPricingOfProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/CheckTierPricingOfProductsTest.xml @@ -149,7 +149,7 @@ <see userInput="You saved the rule." stepKey="RuleSaved"/> <!--Create new order--> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="CreateNewOrder"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="CreateNewOrder"> <argument name="customer" value="Simple_US_Customer"/> <argument name="storeView" value="customStoreView"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml index a0670bdee54c7..a96797f080a40 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml @@ -196,7 +196,7 @@ <!-- Open Order --> - <actionGroup ref="filterOrderGridById" stepKey="openOrdersGrid"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="openOrdersGrid"> <argument name="orderId" value="{$grabOrderNumber}"/> </actionGroup> <click selector="{{AdminOrdersGridSection.firstRow}}" stepKey="clickOrderRow"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml index 12a465188aa85..c0653d9dbba7e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml @@ -130,7 +130,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> - <actionGroup ref="filterOrderGridById" stepKey="filterByOrderId"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterByOrderId"> <argument name="orderId" value="$grabOrderNumber"/> </actionGroup> <click selector="{{AdminDataGridTableSection.firstRow}}" stepKey="clickOrderRow"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml index aa3665a81bbde..428b569046fa5 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml @@ -87,7 +87,7 @@ <!-- Open created order in backend --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/> <waitForPageLoad stepKey="waitForOrdersPageLoad"/> - <actionGroup ref="OpenOrderById" stepKey="filterOrderGridById"> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$grabOrderNumber"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNewAddressTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNewAddressTest.xml index bafad6f28a680..8ae1bb83d852b 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNewAddressTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNewAddressTest.xml @@ -100,7 +100,7 @@ <!-- Open created order in backend --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/> <waitForPageLoad stepKey="waitForOrdersPageLoad"/> - <actionGroup ref="OpenOrderById" stepKey="filterOrderGridById"> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$grabOrderNumber"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml index 2c341a5c4c1ab..4d5443d8430d7 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml @@ -88,7 +88,7 @@ <!-- Open created order in backend --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/> <waitForPageLoad stepKey="waitForOrdersPageLoad"/> - <actionGroup ref="OpenOrderById" stepKey="filterOrderGridById"> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$grabOrderNumber"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml index 990459d7c81b7..5b01246170a95 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml @@ -81,7 +81,7 @@ <!-- Open created order in backend --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/> <waitForPageLoad stepKey="waitForOrdersPageLoad"/> - <actionGroup ref="OpenOrderById" stepKey="filterOrderGridById"> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$grabOrderNumber"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml index e85a47ab7a91d..72ca058f7efd9 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml @@ -197,7 +197,7 @@ <!-- Open created order --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/> <waitForPageLoad stepKey="waitForOrderPageLoad"/> - <actionGroup ref="OpenOrderById" stepKey="filterOrderGridById"> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$grabOrderNumber"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontApplyPromoCodeDuringCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontApplyPromoCodeDuringCheckoutTest.xml index bdfdfceab53f9..6aa44d3c10499 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontApplyPromoCodeDuringCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontApplyPromoCodeDuringCheckoutTest.xml @@ -80,7 +80,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!-- Verify total on order page --> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderById"> <argument name="orderId" value="$grabOrderNumber"/> </actionGroup> <click selector="{{AdminOrdersGridSection.firstRow}}" stepKey="clickOrderRow"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml index c5d1c34a93b32..e7ff46f049109 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml @@ -111,7 +111,7 @@ <waitForPageLoad stepKey="waitForOrderIndexPageToLoad"/> <!-- Filter Order using orderId and assert order--> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$orderId"/> </actionGroup> <click selector="{{AdminOrdersGridSection.viewLink('$orderId')}}" stepKey="clickOnViewLink"/> @@ -127,4 +127,4 @@ <!-- Assert order buttons --> <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest.xml index 34dc6617d25d5..a943f928d9f18 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest.xml @@ -81,7 +81,7 @@ <waitForPageLoad stepKey="waitForPageLoad5"/> <!-- Filter Order using orderId and assert order--> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$orderId"/> </actionGroup> @@ -98,4 +98,4 @@ <!-- Assert order buttons --> <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml index 6ccb05bf4c4f7..255e9445e7948 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml @@ -151,7 +151,7 @@ <waitForPageLoad stepKey="waitForPageLoad5"/> <!-- Filter Order using orderId and assert order--> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$orderId"/> </actionGroup> @@ -168,4 +168,4 @@ <!-- Assert order buttons --> <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutOnLoginWhenGuestCheckoutIsDisabledTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutOnLoginWhenGuestCheckoutIsDisabledTest.xml index b0b72515611e8..9b9c5044af0bd 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutOnLoginWhenGuestCheckoutIsDisabledTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutOnLoginWhenGuestCheckoutIsDisabledTest.xml @@ -81,7 +81,7 @@ <waitForPageLoad stepKey="waitForPageLoad"/> <!-- Filter Order using orderId and assert order--> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$orderId"/> </actionGroup> @@ -91,4 +91,4 @@ <!-- Ship the order and assert the shipping status --> <actionGroup ref="AdminShipThePendingOrderActionGroup" stepKey="shipTheOrder"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithNewCustomerRegistrationAndDisableGuestCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithNewCustomerRegistrationAndDisableGuestCheckoutTest.xml index f7e54867b1ae4..931ee4e8ec59d 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithNewCustomerRegistrationAndDisableGuestCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithNewCustomerRegistrationAndDisableGuestCheckoutTest.xml @@ -119,7 +119,7 @@ <waitForPageLoad stepKey="waitForPageLoad"/> <!-- Filter Order using orderId and assert order--> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$orderId"/> </actionGroup> @@ -129,4 +129,4 @@ <!-- Ship the order and assert the shipping status --> <actionGroup ref="AdminShipThePendingOrderActionGroup" stepKey="shipTheOrder"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml index 2226e1ebc8292..961fc226d9d1e 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml @@ -196,7 +196,7 @@ <waitForPageLoad stepKey="waitForPageLoad5"/> <!-- Filter Order using orderId and assert order--> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$orderId"/> </actionGroup> <click selector="{{AdminOrdersGridSection.viewLink('$orderId')}}" stepKey="clickOnViewLink"/> @@ -220,4 +220,4 @@ <argument name="customerGroup" value=""/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutWithCouponAndZeroSubtotalTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutWithCouponAndZeroSubtotalTest.xml index 33ec099aa2ace..1fc6b7fc3eaf7 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutWithCouponAndZeroSubtotalTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutWithCouponAndZeroSubtotalTest.xml @@ -77,7 +77,7 @@ <waitForPageLoad stepKey="waitForPageLoad5"/> <!-- Filter Order using orderId and assert order--> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$orderId"/> </actionGroup> <click selector="{{AdminOrdersGridSection.viewLink('$orderId')}}" stepKey="clickOnViewLink"/> @@ -90,4 +90,4 @@ <see selector="{{AdminOrderTotalSection.grandTotal}}" userInput="$0.00" stepKey="seeGrandTotal"/> <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Pending" stepKey="seeOrderStatus"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductQuantityChangesInBackendAfterCustomerCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductQuantityChangesInBackendAfterCustomerCheckoutTest.xml index 285dc28cb520e..d0d5600175556 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductQuantityChangesInBackendAfterCustomerCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductQuantityChangesInBackendAfterCustomerCheckoutTest.xml @@ -71,7 +71,7 @@ <waitForPageLoad stepKey="waitForPageLoad5"/> <!-- Filter Order using orderId and assert order--> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$orderId"/> </actionGroup> <click selector="{{AdminOrdersGridSection.viewLink('$orderId')}}" stepKey="clickOnViewLink"/> @@ -102,4 +102,4 @@ </actionGroup> <see selector="{{StorefrontProductInfoMainSection.productStockStatus}}" userInput="Out Of Stock" stepKey="seeProductDisplayedAsOutOfStock"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKCustomerCheckoutWithCouponTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKCustomerCheckoutWithCouponTest.xml index 482e2fb6233a6..176bf2d0089c7 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKCustomerCheckoutWithCouponTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKCustomerCheckoutWithCouponTest.xml @@ -116,7 +116,7 @@ <waitForPageLoad stepKey="waitForPageLoad5"/> <!-- Filter Order using orderId and assert order--> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$orderId"/> </actionGroup> <see selector="{{AdminOrdersGridSection.firstRow}}" userInput="$$createCustomer.fullname$$" stepKey="seeCustomerNameInGrid"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKGuestCheckoutWithConditionProductQuantityEqualsToOrderedQuantityTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKGuestCheckoutWithConditionProductQuantityEqualsToOrderedQuantityTest.xml index deab32aede324..d9686d6784f39 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKGuestCheckoutWithConditionProductQuantityEqualsToOrderedQuantityTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKGuestCheckoutWithConditionProductQuantityEqualsToOrderedQuantityTest.xml @@ -66,7 +66,7 @@ <waitForPageLoad stepKey="waitForPageLoad5"/> <!-- Filter Order using orderId and assert order--> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$orderId"/> </actionGroup> <click selector="{{AdminOrdersGridSection.viewLink('$orderId')}}" stepKey="clickOnViewLink"/> @@ -97,4 +97,4 @@ </actionGroup> <see selector="{{StorefrontProductInfoMainSection.productStockStatus}}" userInput="Out Of Stock" stepKey="seeProductDisplayedAsOutOfStock"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUSCustomerCheckoutWithCouponAndBankTransferPaymentMethodTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUSCustomerCheckoutWithCouponAndBankTransferPaymentMethodTest.xml index 6d5f79f3aadf4..eb4633ee80c11 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUSCustomerCheckoutWithCouponAndBankTransferPaymentMethodTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUSCustomerCheckoutWithCouponAndBankTransferPaymentMethodTest.xml @@ -78,7 +78,7 @@ <waitForPageLoad stepKey="waitForPageLoad"/> <!-- Filter Order using orderId and assert order--> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$orderId"/> </actionGroup> <click selector="{{AdminOrdersGridSection.viewLink('$orderId')}}" stepKey="clickOnViewLink"/> @@ -94,4 +94,4 @@ <!-- Assert order buttons --> <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml index 4b3e18fb31877..88dffc32377cc 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml @@ -90,7 +90,7 @@ <waitForPageLoad stepKey="waitForSalesOrderPageLoaded"/> <!-- Open Order --> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$grabOrderNumber"/> </actionGroup> <click selector="{{AdminOrdersGridSection.firstRow}}" stepKey="clickOrderRow"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoOptionAvailableToConfigureDisabledProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoOptionAvailableToConfigureDisabledProductTest.xml index fd607d2203c66..21ffe1deef01c 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoOptionAvailableToConfigureDisabledProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoOptionAvailableToConfigureDisabledProductTest.xml @@ -118,7 +118,7 @@ <actionGroup ref="saveProductForm" stepKey="saveSecondProductForm"/> <!-- Go to created customer page --> <comment userInput="Go to created customer page" stepKey="goToCreatedCustomerPage"/> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="createNewOrder"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="createNewOrder"> <argument name="customer" value="$$createCustomer$$"/> </actionGroup> <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickToAddProduct"/> @@ -133,7 +133,7 @@ <dontSee userInput="$$createConfigProductAttributeOption1.option[store_labels][1][label]$$" stepKey="dontSeeOption1"/> <!-- Go to created customer page again --> <comment userInput="Go to created customer page again" stepKey="goToCreatedCustomerPageAgain"/> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="createNewOrderAgain"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="createNewOrderAgain"> <argument name="customer" value="$$createCustomer$$"/> </actionGroup> <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickToAddProductAgain"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml index c3459aec34492..80202396720bf 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml @@ -66,7 +66,7 @@ <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$grabOrderNumber"/> </actionGroup> @@ -83,7 +83,7 @@ <fillField selector="{{AdminShipmentItemsSection.itemQtyToShip('1')}}" userInput="1" stepKey="changeItemQtyToShip"/> <click selector="{{AdminShipmentMainActionsSection.submitShipment}}" stepKey="clickSubmitShipment"/> <waitForPageLoad stepKey="waitShipmentSectionToLoad"/> - <actionGroup ref="cancelPendingOrder" stepKey="cancelPendingOption"> + <actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelPendingOption"> <argument name="orderStatus" value="Complete"/> </actionGroup> diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayWhenChooseThreeAllowedCurrenciesTest.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayWhenChooseThreeAllowedCurrenciesTest.xml index 26fbfd394be68..6de2a46a5d3d9 100644 --- a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayWhenChooseThreeAllowedCurrenciesTest.xml +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayWhenChooseThreeAllowedCurrenciesTest.xml @@ -61,7 +61,7 @@ </actionGroup> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabNewOrderNumber"/> <!--Open order and check rates display in one line--> - <actionGroup ref="OpenOrderById" stepKey="openNewOrderById"> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openNewOrderById"> <argument name="orderId" value="$grabNewOrderNumber"/> </actionGroup> <see selector="{{AdminOrderDetailsInformationSection.orderInformationTable}}" userInput="EUR / USD rate" stepKey="seeUSDandEURRate"/> diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayedInOneLineTest.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayedInOneLineTest.xml index dc6bdf3db542e..3e3d3f5d20f26 100644 --- a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayedInOneLineTest.xml +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayedInOneLineTest.xml @@ -64,7 +64,7 @@ </actionGroup> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/> <!--Open order and check rates display in one line--> - <actionGroup ref="OpenOrderById" stepKey="openOrderById"> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrderById"> <argument name="orderId" value="$grabOrderNumber"/> </actionGroup> <see selector="{{AdminOrderDetailsInformationSection.orderInformationTable}}" userInput="EUR / USD rate" stepKey="seeEURandUSDRate"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminPanelIsFrozenIfStorefrontIsOpenedViaCustomerViewTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminPanelIsFrozenIfStorefrontIsOpenedViaCustomerViewTest.xml index d2d3343a3b8d3..ee32214435428 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminPanelIsFrozenIfStorefrontIsOpenedViaCustomerViewTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminPanelIsFrozenIfStorefrontIsOpenedViaCustomerViewTest.xml @@ -30,22 +30,22 @@ <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> <actionGroup ref="logout" stepKey="logout"/> </after> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderPage"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderPage"> <argument name="customer" value="$simpleCustomer$"/> </actionGroup> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSecondProduct"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSecondProduct"> <argument name="product" value="$createSimpleProduct$"/> </actionGroup> - <actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerInfo"> + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerInfo"> <argument name="customer" value="$simpleCustomer$"/> <argument name="address" value="US_Address_TX"/> </actionGroup> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRate"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRate"/> <actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder"/> <grabTextFrom selector="|Order # (\d+)|" stepKey="getOrderId"/> - <actionGroup ref="StartCreateInvoiceFromOrderPage" stepKey="startCreateInvoice"/> - <actionGroup ref="SubmitInvoice" stepKey="submitInvoice"/> + <actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="startCreateInvoice"/> + <actionGroup ref="SubmitInvoiceActionGroup" stepKey="submitInvoice"/> <actionGroup ref="goToShipmentIntoOrder" stepKey="goToShipment"/> <actionGroup ref="submitShipmentIntoOrder" stepKey="submitShipment"/> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMyAccountWithMultishipmentTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMyAccountWithMultishipmentTest.xml index eec8a40877bb3..0af5be7dafb3c 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMyAccountWithMultishipmentTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMyAccountWithMultishipmentTest.xml @@ -96,7 +96,7 @@ <waitForLoadingMaskToDisappear stepKey="waitForLoading"/> <!--Assert order in orders grid --> <!-- Go to order page --> - <actionGroup ref="OpenOrderById" stepKey="openFirstOrderPage"> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openFirstOrderPage"> <argument name="orderId" value="{$getFirstOrderIdPlaceOrder}"/> </actionGroup> <!-- Check status --> @@ -106,7 +106,7 @@ <waitForPageLoad stepKey="waitForOrderPageLoad4"/> <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters2"/> <!-- Go to order page --> - <actionGroup ref="OpenOrderById" stepKey="openSecondOrderPage"> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openSecondOrderPage"> <argument name="orderId" value="{$getSecondOrderIdPlaceOrder}"/> </actionGroup> <!-- Check status --> diff --git a/app/code/Magento/Reports/Test/Mftf/Test/CancelOrdersInOrderSalesReportTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/CancelOrdersInOrderSalesReportTest.xml index 0412e945362e4..324b56757c516 100644 --- a/app/code/Magento/Reports/Test/Mftf/Test/CancelOrdersInOrderSalesReportTest.xml +++ b/app/code/Magento/Reports/Test/Mftf/Test/CancelOrdersInOrderSalesReportTest.xml @@ -62,7 +62,7 @@ </actionGroup> <!-- Cancel order --> - <actionGroup ref="cancelPendingOrder" stepKey="cancelOrder"/> + <actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelOrder"/> <!-- Generate Order report for statuses --> <amOnPage url="{{OrdersReportPage.url}}" stepKey="goToOrdersReportPage1"/> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddBundleProductToOrderActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddBundleProductToOrderActionGroup.xml new file mode 100644 index 0000000000000..ee252990e0646 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddBundleProductToOrderActionGroup.xml @@ -0,0 +1,32 @@ +<?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="AddBundleProductToOrderActionGroup"> + <annotations> + <description>Adds the provided Bundled Product with the provided Option to an Order. Fills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="quantity" type="string" defaultValue="1"/> + </arguments> + + <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> + <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterBundle"/> + <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchBundle"/> + <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> + <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectBundleProduct"/> + <waitForElementVisible selector="{{AdminOrderFormBundleProductSection.quantity}}" stepKey="waitForBundleOptionLoad"/> + <wait time="2" stepKey="waitForOptionsToLoad"/> + <fillField selector="{{AdminOrderFormBundleProductSection.quantity}}" userInput="{{quantity}}" stepKey="fillQuantity"/> + <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOk"/> + <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> + <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddBundleProductToOrderAndCheckPriceInGridActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddBundleProductToOrderAndCheckPriceInGridActionGroup.xml new file mode 100644 index 0000000000000..71205ff9808d0 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddBundleProductToOrderAndCheckPriceInGridActionGroup.xml @@ -0,0 +1,25 @@ +<?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="AddBundleProductToOrderAndCheckPriceInGridActionGroup" extends="AddBundleProductToOrderActionGroup"> + <annotations> + <description>EXTENDS: addBundleProductToOrder. Validates that the provided Product Price is present and correct in the 'Items Ordered' section.</description> + </annotations> + <arguments> + <argument name="price" type="string"/> + </arguments> + + <grabTextFrom selector="{{AdminOrderFormItemsSection.rowPrice('1')}}" stepKey="grabProductPriceFromGrid" after="clickOk"/> + <assertEquals stepKey="assertProductPriceInGrid" message="Bundle product price in grid should be equal {{price}}" after="grabProductPriceFromGrid"> + <expectedResult type="string">{{price}}</expectedResult> + <actualResult type="variable">grabProductPriceFromGrid</actualResult> + </assertEquals> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddConfigurableProductToOrderActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddConfigurableProductToOrderActionGroup.xml new file mode 100644 index 0000000000000..dee2af6cd4053 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddConfigurableProductToOrderActionGroup.xml @@ -0,0 +1,33 @@ +<?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="AddConfigurableProductToOrderActionGroup"> + <annotations> + <description>Adds the provided Configurable Product with the provided Option to an Order. Fills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="attribute"/> + <argument name="option"/> + </arguments> + + <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> + <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterConfigurable"/> + <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchConfigurable"/> + <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> + <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectConfigurableProduct"/> + <waitForElementVisible selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_label)}}" stepKey="waitForConfigurablePopover"/> + <wait time="2" stepKey="waitForOptionsToLoad"/> + <selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_label)}}" userInput="{{option.name}}" stepKey="selectionConfigurableOption"/> + <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkConfigurablePopover"/> + <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> + <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddConfigurableProductToOrderFromAdminActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddConfigurableProductToOrderFromAdminActionGroup.xml new file mode 100644 index 0000000000000..200568fe2c05a --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddConfigurableProductToOrderFromAdminActionGroup.xml @@ -0,0 +1,19 @@ +<?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="AddConfigurableProductToOrderFromAdminActionGroup" extends="AddConfigurableProductToOrderActionGroup"> + <annotations> + <description>EXTENDS: addConfigurableProductToOrder. Selects the provided Option to the Configurable Product.</description> + </annotations> + + <waitForElementVisible selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}" stepKey="waitForConfigurablePopover"/> + <selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}" userInput="{{option.label}}" stepKey="selectionConfigurableOption"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddDownloadableProductToOrderActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddDownloadableProductToOrderActionGroup.xml new file mode 100644 index 0000000000000..3018b4308b193 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddDownloadableProductToOrderActionGroup.xml @@ -0,0 +1,29 @@ +<?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="AddDownloadableProductToOrderActionGroup"> + <annotations> + <description>Adds a Downloadable Product to an Order. Clicks on 'Add Selected Product(s) to Order'.</description> + </annotations> + + <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> + <waitForPageLoad time="30" stepKey="waitForPageLoad1"/> + <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterDownloadable"/> + <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchDownloadable"/> + <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> + <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectDownloadableProduct"/> + <waitForElementVisible selector="{{AdminOrderFormDownloadableProductSection.optionSelect(link.title)}}" stepKey="waitForLinkLoad"/> + <click selector="{{AdminOrderFormDownloadableProductSection.optionSelect(link.title)}}" stepKey="selectLink"/> + <fillField selector="{{AdminOrderFormDownloadableProductSection.quantity}}" userInput="{{quantity}}" stepKey="setQuantity"/> + <click selector="{{AdminOrderFormDownloadableProductSection.ok}}" stepKey="confirmConfiguration"/> + <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> + <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddGroupedProductOptionToOrderActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddGroupedProductOptionToOrderActionGroup.xml new file mode 100644 index 0000000000000..228198527b911 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddGroupedProductOptionToOrderActionGroup.xml @@ -0,0 +1,33 @@ +<?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="AddGroupedProductOptionToOrderActionGroup"> + <annotations> + <description>Adds the provided Grouped Product with the provided Option to an Order. Fills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="option"/> + <argument name="quantity" type="string" defaultValue="1"/> + </arguments> + + <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> + <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterGrouped"/> + <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchGrouped"/> + <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> + <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectGroupedProduct"/> + <waitForElementVisible selector="{{AdminOrderFormGroupedProductSection.optionQty(option.sku)}}" stepKey="waitForGroupedOptionLoad"/> + <wait time="2" stepKey="waitForOptionsToLoad"/> + <fillField selector="{{AdminOrderFormGroupedProductSection.optionQty(option.sku)}}" userInput="{{quantity}}" stepKey="fillOptionQuantity"/> + <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOk"/> + <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> + <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductToOrderActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductToOrderActionGroup.xml new file mode 100644 index 0000000000000..8d5062c79f828 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductToOrderActionGroup.xml @@ -0,0 +1,30 @@ +<?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="AddSimpleProductToOrderActionGroup"> + <annotations> + <description>Adds the provided Simple Product to an Order. Fills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> + </annotations> + <arguments> + <argument name="product" defaultValue="_defaultProduct" type="entity"/> + <argument name="productQty" defaultValue="1" type="string"/> + </arguments> + + <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> + <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilter"/> + <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearch"/> + <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> + <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectProduct"/> + <fillField selector="{{AdminOrderFormItemsSection.rowQty('1')}}" userInput="{{productQty}}" stepKey="fillProductQty"/> + <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> + <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> + <wait time="5" stepKey="waitForOptionsToLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductWithQtyToOrderActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductWithQtyToOrderActionGroup.xml new file mode 100644 index 0000000000000..e0d18fa9c2340 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductWithQtyToOrderActionGroup.xml @@ -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="AddSimpleProductWithQtyToOrderActionGroup" extends="AddSimpleProductToOrderActionGroup"> + <arguments> + <argument name="product" defaultValue="_defaultProduct" type="entity"/> + <argument name="productQty" type="string"/> + </arguments> + <fillField selector="{{AdminOrderFormItemsSection.rowQty('1')}}" userInput="{{productQty}}" stepKey="fillProductQty"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCreateInvoiceActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCreateInvoiceActionGroup.xml index 416d3f488dd1f..a90c16428ca03 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCreateInvoiceActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCreateInvoiceActionGroup.xml @@ -15,16 +15,4 @@ <waitForPageLoad stepKey="waitForLoadPage"/> <see userInput="The invoice has been created." stepKey="seeMessage"/> </actionGroup> - <actionGroup name="AdminCreateInvoiceAndShipmentActionGroup" extends="AdminCreateInvoiceActionGroup"> - <checkOption selector="{{AdminInvoicePaymentShippingSection.CreateShipment}}" stepKey="checkCreateShipment" after="waitForInvoicePage"/> - <see userInput="You created the invoice and shipment." stepKey="seeMessage"/> - </actionGroup> - <actionGroup name="AdminCreateInvoiceAndCreditMemoActionGroup" extends="AdminCreateInvoiceActionGroup"> - <click selector="{{AdminOrderDetailsMainActionsSection.creditMemo}}" stepKey="pushButtonCreditMemo" after="seeMessage"/> - <waitForPageLoad stepKey="waitForLoadingCreditMemoPage" after="pushButtonCreditMemo"/> - <scrollTo selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="scrollToBottom" after="waitForLoadingCreditMemoPage"/> - <click selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="clickSubmitRefund" after="scrollToBottom"/> - <waitForPageLoad stepKey="waitForMainOrderPageLoad" after="clickSubmitRefund"/> - <see userInput="You created the credit memo." stepKey="seeCreditMemoMessage" after="waitForMainOrderPageLoad"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCreateInvoiceAndCreditMemoActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCreateInvoiceAndCreditMemoActionGroup.xml new file mode 100644 index 0000000000000..a69cd8688c6c5 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCreateInvoiceAndCreditMemoActionGroup.xml @@ -0,0 +1,19 @@ +<?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="AdminCreateInvoiceAndCreditMemoActionGroup" extends="AdminCreateInvoiceActionGroup"> + <click selector="{{AdminOrderDetailsMainActionsSection.creditMemo}}" stepKey="pushButtonCreditMemo" after="seeMessage"/> + <waitForPageLoad stepKey="waitForLoadingCreditMemoPage" after="pushButtonCreditMemo"/> + <scrollTo selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="scrollToBottom" after="waitForLoadingCreditMemoPage"/> + <click selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="clickSubmitRefund" after="scrollToBottom"/> + <waitForPageLoad stepKey="waitForMainOrderPageLoad" after="clickSubmitRefund"/> + <see userInput="You created the credit memo." stepKey="seeCreditMemoMessage" after="waitForMainOrderPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCreateInvoiceAndShipmentActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCreateInvoiceAndShipmentActionGroup.xml new file mode 100644 index 0000000000000..047b78a81c2cd --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCreateInvoiceAndShipmentActionGroup.xml @@ -0,0 +1,15 @@ +<?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="AdminCreateInvoiceAndShipmentActionGroup" extends="AdminCreateInvoiceActionGroup"> + <checkOption selector="{{AdminInvoicePaymentShippingSection.CreateShipment}}" stepKey="checkCreateShipment" after="waitForInvoicePage"/> + <see userInput="You created the invoice and shipment." stepKey="seeMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCreditMemoActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCreditMemoActionGroup.xml index 75d41d835bed2..04e4c40060d27 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCreditMemoActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCreditMemoActionGroup.xml @@ -9,7 +9,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <!--Check customer information is correct in credit memo--> - <actionGroup name="verifyBasicCreditMemoInformation"> + <actionGroup name="VerifyBasicCreditMemoInformationActionGroup"> <annotations> <description>Validates that the provided Customer, Shipping/Billing Address and Customer Group are present and correct on the Admin Credit Memo view page.</description> </annotations> @@ -35,36 +35,6 @@ <see selector="{{AdminCreditMemoAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.postcode}}" stepKey="seeShippingAddressPostcode"/> </actionGroup> - <actionGroup name="seeProductInItemsRefunded"> - <annotations> - <description>Validates that the provided Product appears in the 'Product' column on the Admin Credit Memo view page.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - <see selector="{{AdminCreditMemoItemsSection.skuColumn}}" userInput="{{product.sku}}" stepKey="seeProductSkuInGrid"/> - </actionGroup> - <actionGroup name="StartToCreateCreditMemoActionGroup"> - <arguments> - <argument name="orderId" type="string"/> - </arguments> - <amOnPage url="{{AdminOrderPage.url(orderId)}}" stepKey="navigateToOrderPage"/> - <click selector="{{AdminOrderDetailsMainActionsSection.creditMemo}}" stepKey="clickCreditMemo"/> - <waitForElementVisible selector="{{AdminHeaderSection.pageTitle}}" stepKey="waitForPageTitle"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Memo" stepKey="seeNewMemoPageTitle"/> - </actionGroup> - <actionGroup name="SubmitCreditMemoActionGroup"> - <grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="grabOrderId"/> - <waitForElementVisible selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="waitButtonEnabled"/> - <click selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="clickSubmitCreditMemo"/> - <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForMessageAppears"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You created the credit memo." stepKey="seeCreditMemoCreateSuccess"/> - <seeInCurrentUrl url="{{AdminOrderDetailsPage.url}}$grabOrderId" stepKey="seeViewOrderPageCreditMemo"/> - </actionGroup> - <actionGroup name="UpdateCreditMemoTotalsActionGroup"> - <waitForElementVisible selector="{{AdminCreditMemoTotalSection.updateTotals}}" stepKey="waitUpdateTotalsButtonEnabled"/> - <click selector="{{AdminCreditMemoTotalSection.updateTotals}}" stepKey="clickUpdateTotals"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminFastCreateInvoiceActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminFastCreateInvoiceActionGroup.xml new file mode 100644 index 0000000000000..b5175b6c3002e --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminFastCreateInvoiceActionGroup.xml @@ -0,0 +1,26 @@ +<?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="AdminFastCreateInvoiceActionGroup"> + <annotations> + <description>Clicks on 'Invoice' on the Admin Orders view page. Clicks on 'Submit Invoice'. Clicks on 'View Invoice'.</description> + </annotations> + + <click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceButton"/> + <waitForPageLoad stepKey="waitForNewInvoicePageLoad"/> + <click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/> + <see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The invoice has been created." stepKey="seeSuccessMessage"/> + <click selector="{{AdminOrderDetailsOrderViewSection.invoices}}" stepKey="clickInvoices"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask5"/> + <conditionalClick selector="{{AdminOrderInvoicesTabSection.clearFilters}}" dependentSelector="{{AdminOrderInvoicesTabSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> + <click selector="{{AdminOrderInvoicesTabSection.viewInvoice}}" stepKey="openInvoicePage"/> + <waitForPageLoad stepKey="waitForInvoicePageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceActionGroup.xml deleted file mode 100644 index 8451f9de03293..0000000000000 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceActionGroup.xml +++ /dev/null @@ -1,130 +0,0 @@ -<?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"> - <!--Check customer information is correct in invoice--> - <actionGroup name="verifyBasicInvoiceInformation"> - <annotations> - <description>Validates that the provided Customer, Address and Customer Group details are present and correct on the Admin View Invoice page.</description> - </annotations> - <arguments> - <argument name="customer"/> - <argument name="shippingAddress"/> - <argument name="billingAddress"/> - <argument name="customerGroup" defaultValue="GeneralCustomerGroup"/> - </arguments> - - <see selector="{{AdminInvoiceOrderInformationSection.customerName}}" userInput="{{customer.firstname}}" stepKey="seeCustomerName"/> - <see selector="{{AdminInvoiceOrderInformationSection.customerEmail}}" userInput="{{customer.email}}" stepKey="seeCustomerEmail"/> - <see selector="{{AdminInvoiceOrderInformationSection.customerGroup}}" userInput="{{customerGroup.code}}" stepKey="seeCustomerGroup"/> - <see selector="{{AdminInvoiceAddressInformationSection.billingAddress}}" userInput="{{billingAddress.street[0]}}" stepKey="seeBillingAddressStreet"/> - <see selector="{{AdminInvoiceAddressInformationSection.billingAddress}}" userInput="{{billingAddress.city}}" stepKey="seeBillingAddressCity"/> - <see selector="{{AdminInvoiceAddressInformationSection.billingAddress}}" userInput="{{billingAddress.country_id}}" stepKey="seeBillingAddressCountry"/> - <see selector="{{AdminInvoiceAddressInformationSection.billingAddress}}" userInput="{{billingAddress.postcode}}" stepKey="seeBillingAddressPostcode"/> - <see selector="{{AdminInvoiceAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.street[0]}}" stepKey="seeShippingAddressStreet"/> - <see selector="{{AdminInvoiceAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.city}}" stepKey="seeShippingAddressCity"/> - <see selector="{{AdminInvoiceAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.country_id}}" stepKey="seeShippingAddressCountry"/> - <see selector="{{AdminInvoiceAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.postcode}}" stepKey="seeShippingAddressPostcode"/> - </actionGroup> - - <!--Check that product is in invoice items--> - <actionGroup name="seeProductInInvoiceItems"> - <annotations> - <description>Validates that the provided Product appears under the 'SKU' column in the Admin Invoices edit page.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <see selector="{{AdminInvoiceItemsSection.skuColumn}}" userInput="{{product.sku}}" stepKey="seeProductSkuInGrid"/> - </actionGroup> - - <!--Admin Fast Create Invoice--> - <actionGroup name="adminFastCreateInvoice"> - <annotations> - <description>Clicks on 'Invoice' on the Admin Orders view page. Clicks on 'Submit Invoice'. Clicks on 'View Invoice'.</description> - </annotations> - - <click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceButton"/> - <waitForPageLoad stepKey="waitForNewInvoicePageLoad"/> - <click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/> - <see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The invoice has been created." stepKey="seeSuccessMessage"/> - <click selector="{{AdminOrderDetailsOrderViewSection.invoices}}" stepKey="clickInvoices"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask5"/> - <conditionalClick selector="{{AdminOrderInvoicesTabSection.clearFilters}}" dependentSelector="{{AdminOrderInvoicesTabSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> - <click selector="{{AdminOrderInvoicesTabSection.viewInvoice}}" stepKey="openInvoicePage"/> - <waitForPageLoad stepKey="waitForInvoicePageLoad"/> - </actionGroup> - - <actionGroup name="clearInvoicesGridFilters"> - <annotations> - <description>Goes to the Admin Invoices grid page. Clicks on 'Clear Filters', if present.</description> - </annotations> - - <amOnPage url="{{AdminInvoicesPage.url}}" stepKey="goToInvoices"/> - <waitForPageLoad stepKey="waitInvoicesGridToLoad"/> - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearFilters"/> - <waitForPageLoad stepKey="waitInvoicesGrid"/> - </actionGroup> - - <actionGroup name="goToInvoiceIntoOrder"> - <annotations> - <description>Clicks on 'Invoice' on the Admin Orders view page. Validates that the URL and Page Title are correct.</description> - </annotations> - - <click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceAction"/> - <seeInCurrentUrl url="{{AdminInvoiceNewPage.url}}" stepKey="seeOrderInvoiceUrl"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seePageNameNewInvoicePage"/> - </actionGroup> - - <actionGroup name="StartCreateInvoiceFromOrderPage"> - <annotations> - <description>Clicks on 'Invoice' on the Admin Orders view page. Validates that the URL and Page Title are correct.</description> - </annotations> - - <click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceAction"/> - <seeInCurrentUrl url="{{AdminInvoiceNewPage.url}}" stepKey="seeNewInvoiceUrl"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seeNewInvoicePageTitle"/> - </actionGroup> - - <actionGroup name="SubmitInvoice"> - <annotations> - <description>Clicks on 'Submit Invoice' on the Admin 'New Invoice' page. Validates that the Success Message is present and correct. Validates that the Order ID appears in the URL.</description> - </annotations> - - <click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/> - <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForMessageAppears"/> - <see selector="{{AdminMessagesSection.success}}" userInput="The invoice has been created." stepKey="seeInvoiceCreateSuccess"/> - <grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="grabOrderId"/> - <seeInCurrentUrl url="{{AdminOrderDetailsPage.url('$grabOrderId')}}" stepKey="seeViewOrderPageInvoice"/> - </actionGroup> - - <!--Filter invoices by order id --> - <actionGroup name="filterInvoiceGridByOrderId"> - <annotations> - <description>Goes to the Admin Invoices grid page. Filters the grid for the provided Order ID.</description> - </annotations> - <arguments> - <argument name="orderId" type="string"/> - </arguments> - - <amOnPage url="{{AdminInvoicesPage.url}}" stepKey="goToInvoices"/> - <click selector="{{AdminInvoicesGridSection.filter}}" stepKey="clickFilter"/> - <fillField selector="{{AdminInvoicesFiltersSection.orderNum}}" userInput="{{orderId}}" stepKey="fillOrderIdForFilter"/> - <click selector="{{AdminInvoicesFiltersSection.applyFilters}}" stepKey="clickApplyFilters"/> - <waitForPageLoad stepKey="waitForFiltersApply"/> - </actionGroup> - - <actionGroup name="FilterInvoiceGridByOrderIdWithCleanFiltersActionGroup" extends="filterInvoiceGridByOrderId"> - <arguments> - <argument name="orderId" type="string"/> - </arguments> - <conditionalClick selector="{{AdminInvoicesGridSection.clearFilters}}" dependentSelector="{{AdminInvoicesGridSection.clearFilters}}" visible="true" stepKey="clearFilters" after="goToInvoices"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOpenAndFillCreditMemoRefundActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOpenAndFillCreditMemoRefundActionGroup.xml index da4c80bb28586..b11985fc8e7ef 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOpenAndFillCreditMemoRefundActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOpenAndFillCreditMemoRefundActionGroup.xml @@ -19,7 +19,7 @@ <argument name="adjustmentFee" type="string" defaultValue="0"/> <argument name="rowNumber" type="string" defaultValue="1"/> </arguments> - + <!-- Click 'Credit Memo' button --> <click selector="{{AdminOrderDetailsMainActionsSection.creditMemo}}" stepKey="clickCreateCreditMemo"/> <seeInCurrentUrl url="{{AdminCreditMemoNewPage.url}}" stepKey="seeNewCreditMemoPage"/> @@ -38,13 +38,4 @@ <click selector="{{AdminCreditMemoTotalSection.updateTotals}}" stepKey="clickUpdateTotals"/> <checkOption selector="{{AdminCreditMemoTotalSection.emailCopy}}" stepKey="checkSendEmailCopy"/> </actionGroup> - - <!-- Open and fill CreditMemo refund with back to stock --> - <actionGroup name="AdminOpenAndFillCreditMemoRefundAndBackToStockActionGroup" extends="AdminOpenAndFillCreditMemoRefundActionGroup"> - <annotations> - <description>EXTENDS: AdminOpenAndFillCreditMemoRefundActionGroup. Checks 'Return to Stock'.</description> - </annotations> - - <checkOption selector="{{AdminCreditMemoItemsSection.itemReturnToStock(rowNumber)}}" stepKey="backToStock" after="scrollToItemsToRefund"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOpenAndFillCreditMemoRefundAndBackToStockActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOpenAndFillCreditMemoRefundAndBackToStockActionGroup.xml new file mode 100644 index 0000000000000..0dc205df18249 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOpenAndFillCreditMemoRefundAndBackToStockActionGroup.xml @@ -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="AdminOpenAndFillCreditMemoRefundAndBackToStockActionGroup" extends="AdminOpenAndFillCreditMemoRefundActionGroup"> + <annotations> + <description>EXTENDS: AdminOpenAndFillCreditMemoRefundActionGroup. Checks 'Return to Stock'.</description> + </annotations> + + <checkOption selector="{{AdminCreditMemoItemsSection.itemReturnToStock(rowNumber)}}" stepKey="backToStock" after="scrollToItemsToRefund"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderActionGroup.xml deleted file mode 100644 index 90e2aa8e12527..0000000000000 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderActionGroup.xml +++ /dev/null @@ -1,557 +0,0 @@ -<?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"> - <!--Navigate to create order page (New Order -> Create New Customer)--> - <actionGroup name="navigateToNewOrderPageNewCustomer"> - <annotations> - <description>Goes to the Admin Orders grid page. Clicks on 'Create New Order'. Clicks on 'Create New Customer'. Select the provided Store View, if present. Validates that Page Title is present and correct.</description> - </annotations> - <arguments> - <argument name="storeView" defaultValue="_defaultStore"/> - </arguments> - - <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/> - <waitForPageLoad stepKey="waitForIndexPageLoad"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/> - <click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/> - <click selector="{{AdminOrderFormActionSection.CreateNewCustomer}}" stepKey="clickCreateCustomer"/> - <conditionalClick selector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" dependentSelector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" visible="true" stepKey="selectStoreViewIfAppears"/> - <waitForPageLoad stepKey="waitForCreateOrderPageLoadAfterStoreSelect"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/> - </actionGroup> - - <!--Navigate to create order page (New Order -> Create New Customer)--> - <actionGroup name="navigateToNewOrderPageNewCustomerSingleStore"> - <annotations> - <description>Goes to the Admin Orders grid page. Clicks on 'Create New Order'. Clicks on 'Create New Customer'. Validates that Page Title is present and correct.</description> - </annotations> - <arguments> - <argument name="storeView" defaultValue="_defaultStore"/> - </arguments> - - <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/> - <waitForPageLoad stepKey="waitForIndexPageLoad"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/> - <click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/> - <click selector="{{AdminOrderFormActionSection.CreateNewCustomer}}" stepKey="clickCreateCustomer"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/> - </actionGroup> - - <!--Navigate to create order page (New Order -> Select Customer)--> - <actionGroup name="navigateToNewOrderPageExistingCustomer"> - <annotations> - <description>Goes tot he Admin Orders grid page. Clicks on 'Create New Order'. Filters the grid for the provided Customer. Clicks on the Customer. Selects the provided Store View, if present. Validates that the Page Title is present and correct.</description> - </annotations> - <arguments> - <argument name="customer"/> - <argument name="storeView" defaultValue="_defaultStore"/> - </arguments> - - <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/> - <waitForPageLoad stepKey="waitForIndexPageLoad"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/> - <click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/> - <waitForPageLoad stepKey="waitForCustomerGridLoad"/> - - <!--Clear grid filters--> - <conditionalClick selector="{{AdminOrderCustomersGridSection.resetButton}}" dependentSelector="{{AdminOrderCustomersGridSection.resetButton}}" visible="true" stepKey="clearExistingCustomerFilters"/> - <fillField userInput="{{customer.email}}" selector="{{AdminOrderCustomersGridSection.emailInput}}" stepKey="filterEmail"/> - <click selector="{{AdminOrderCustomersGridSection.apply}}" stepKey="applyFilter"/> - <waitForPageLoad stepKey="waitForFilteredCustomerGridLoad"/> - <click selector="{{AdminOrderCustomersGridSection.firstRow}}" stepKey="clickOnCustomer"/> - <waitForPageLoad stepKey="waitForCreateOrderPageLoad"/> - - <!-- Select store view if appears --> - <conditionalClick selector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" dependentSelector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" visible="true" stepKey="selectStoreViewIfAppears"/> - <waitForPageLoad stepKey="waitForCreateOrderPageLoadAfterStoreSelect"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/> - </actionGroup> - - <!--Navigate to New Order Page for existing Customer And Store--> - <actionGroup name="NavigateToNewOrderPageExistingCustomerAndStoreActionGroup" extends="navigateToNewOrderPageExistingCustomer"> - <annotations> - <description>EXTENDS: navigateToNewOrderPageExistingCustomer. Clicks on the provided Store View.</description> - </annotations> - <arguments> - <argument name="storeView" defaultValue="_defaultStore"/> - </arguments> - - <click selector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" stepKey="selectStoreView" after="waitForCreateOrderPageLoad"/> - <waitForPageLoad stepKey="waitForLoad" after="selectStoreView"/> - </actionGroup> - - <!--Check the required fields are actually required--> - <actionGroup name="checkRequiredFieldsNewOrderForm"> - <annotations> - <description>Clears the Email, First Name, Last Name, Street Line 1, City, Postal Code and Phone fields when adding an Order and then verifies that they are required after attempting to Save.</description> - </annotations> - - <seeElement selector="{{AdminOrderFormAccountSection.requiredGroup}}" stepKey="seeCustomerGroupRequired"/> - <seeElement selector="{{AdminOrderFormAccountSection.requiredEmail}}" stepKey="seeEmailRequired"/> - <clearField selector="{{AdminOrderFormAccountSection.email}}" stepKey="clearEmailField"/> - <clearField selector="{{AdminOrderFormBillingAddressSection.FirstName}}" stepKey="clearFirstNameField"/> - <clearField selector="{{AdminOrderFormBillingAddressSection.LastName}}" stepKey="clearLastNameField"/> - <clearField selector="{{AdminOrderFormBillingAddressSection.StreetLine1}}" stepKey="clearStreetField"/> - <clearField selector="{{AdminOrderFormBillingAddressSection.City}}" stepKey="clearCityField"/> - <selectOption selector="{{AdminOrderFormBillingAddressSection.Country}}" userInput="United States" stepKey="selectUSCountry"/> - <selectOption selector="{{AdminOrderFormBillingAddressSection.State}}" userInput="Please select" stepKey="selectNoState"/> - <clearField selector="{{AdminOrderFormBillingAddressSection.PostalCode}}" stepKey="clearPostalCodeField"/> - <clearField selector="{{AdminOrderFormBillingAddressSection.Phone}}" stepKey="clearPhoneField"/> - <seeElement selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="seeShippingMethodNotSelected"/> - <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="trySubmitOrder"/> - <see selector="{{AdminOrderFormBillingAddressSection.emailError}}" userInput="This is a required field." stepKey="seeThatEmailIsRequired"/> - <see selector="{{AdminOrderFormBillingAddressSection.firstNameError}}" userInput="This is a required field." stepKey="seeFirstNameRequired"/> - <see selector="{{AdminOrderFormBillingAddressSection.lastNameError}}" userInput="This is a required field." stepKey="seeLastNameRequired"/> - <see selector="{{AdminOrderFormBillingAddressSection.streetAddressError}}" userInput="This is a required field." stepKey="seeStreetRequired"/> - <see selector="{{AdminOrderFormBillingAddressSection.cityError}}" userInput="This is a required field." stepKey="seeCityRequired"/> - <see selector="{{AdminOrderFormBillingAddressSection.stateError}}" userInput="This is a required field." stepKey="seeStateRequired"/> - <see selector="{{AdminOrderFormBillingAddressSection.postalCodeError}}" userInput="This is a required field." stepKey="seePostalCodeRequired"/> - <see selector="{{AdminOrderFormBillingAddressSection.phoneError}}" userInput="This is a required field." stepKey="seePhoneRequired"/> - <see selector="{{AdminOrderFormPaymentSection.shippingError}}" userInput="This is a required field." stepKey="seeShippingMethodRequired"/> - </actionGroup> - - <!--Add a simple product to order--> - <actionGroup name="addSimpleProductToOrder"> - <annotations> - <description>Adds the provided Simple Product to an Order. Fills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> - </annotations> - <arguments> - <argument name="product" defaultValue="_defaultProduct" type="entity"/> - <argument name="productQty" defaultValue="1" type="string"/> - </arguments> - - <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> - <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilter"/> - <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearch"/> - <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> - <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectProduct"/> - <fillField selector="{{AdminOrderFormItemsSection.rowQty('1')}}" userInput="{{productQty}}" stepKey="fillProductQty"/> - <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> - <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> - <wait time="5" stepKey="waitForOptionsToLoad"/> - </actionGroup> - - <actionGroup name="AddSimpleProductWithQtyToOrderActionGroup" extends="addSimpleProductToOrder"> - <arguments> - <argument name="product" defaultValue="_defaultProduct" type="entity"/> - <argument name="productQty" type="string"/> - </arguments> - <fillField selector="{{AdminOrderFormItemsSection.rowQty('1')}}" userInput="{{productQty}}" stepKey="fillProductQty"/> - </actionGroup> - - <!--Add configurable product to order --> - <actionGroup name="addConfigurableProductToOrder"> - <annotations> - <description>Adds the provided Configurable Product with the provided Option to an Order. Fills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="attribute"/> - <argument name="option"/> - </arguments> - - <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> - <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterConfigurable"/> - <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchConfigurable"/> - <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> - <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectConfigurableProduct"/> - <waitForElementVisible selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_label)}}" stepKey="waitForConfigurablePopover"/> - <wait time="2" stepKey="waitForOptionsToLoad"/> - <selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_label)}}" userInput="{{option.name}}" stepKey="selectionConfigurableOption"/> - <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkConfigurablePopover"/> - <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> - <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> - </actionGroup> - - <actionGroup name="newAddConfigurableProductToOrder" extends="addConfigurableProductToOrder"> - <remove keyForRemoval="waitForConfigurablePopover"/> - <remove keyForRemoval="selectionConfigurableOption"/> - <selectOption selector="{{AdminOrderFormConfigureProductSection.selectOption}}" userInput="{{option.value}}" stepKey="selectOption" after="waitForOptionsToLoad"/> - </actionGroup> - - <!--Add configurable product to order --> - <actionGroup name="addConfigurableProductToOrderFromAdmin" extends="addConfigurableProductToOrder"> - <annotations> - <description>EXTENDS: addConfigurableProductToOrder. Selects the provided Option to the Configurable Product.</description> - </annotations> - - <waitForElementVisible selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}" stepKey="waitForConfigurablePopover"/> - <selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}" userInput="{{option.label}}" stepKey="selectionConfigurableOption"/> - </actionGroup> - - <actionGroup name="configureOrderedConfigurableProduct"> - <annotations> - <description>Clicks on 'Configure' for a Product in the 'Please select products' under the 'Create New Order for' page. Selects the provided Option and Attribute. Fills in the provided Qty. Clicks on Ok.</description> - </annotations> - <arguments> - <argument name="attribute"/> - <argument name="option"/> - <argument name="quantity" type="string"/> - </arguments> - - <click selector="{{AdminOrderFormItemsSection.configure}}" stepKey="clickConfigure"/> - <waitForElementVisible selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}" stepKey="waitForConfigurablePopover"/> - <wait time="2" stepKey="waitForOptionsToLoad"/> - <selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}" userInput="{{option.label}}" stepKey="selectionConfigurableOption"/> - <fillField selector="{{AdminOrderFormConfigureProductSection.quantity}}" userInput="{{quantity}}" stepKey="fillQuantity"/> - <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkConfigurablePopover"/> - </actionGroup> - - <!--Add bundle product to order --> - <actionGroup name="addBundleProductToOrder"> - <annotations> - <description>Adds the provided Bundled Product with the provided Option to an Order. Fills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="quantity" type="string" defaultValue="1"/> - </arguments> - - <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> - <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterBundle"/> - <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchBundle"/> - <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> - <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectBundleProduct"/> - <waitForElementVisible selector="{{AdminOrderFormBundleProductSection.quantity}}" stepKey="waitForBundleOptionLoad"/> - <wait time="2" stepKey="waitForOptionsToLoad"/> - <fillField selector="{{AdminOrderFormBundleProductSection.quantity}}" userInput="{{quantity}}" stepKey="fillQuantity"/> - <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOk"/> - <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> - <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> - </actionGroup> - - <!--Add bundle product to order and check product price in the grid--> - <actionGroup name="addBundleProductToOrderAndCheckPriceInGrid" extends="addBundleProductToOrder"> - <annotations> - <description>EXTENDS: addBundleProductToOrder. Validates that the provided Product Price is present and correct in the 'Items Ordered' section.</description> - </annotations> - <arguments> - <argument name="price" type="string"/> - </arguments> - - <grabTextFrom selector="{{AdminOrderFormItemsSection.rowPrice('1')}}" stepKey="grabProductPriceFromGrid" after="clickOk"/> - <assertEquals stepKey="assertProductPriceInGrid" message="Bundle product price in grid should be equal {{price}}" after="grabProductPriceFromGrid"> - <expectedResult type="string">{{price}}</expectedResult> - <actualResult type="variable">grabProductPriceFromGrid</actualResult> - </assertEquals> - </actionGroup> - - <!--Add downloadable product to order --> - <actionGroup name="addDownloadableProductToOrder"> - <annotations> - <description>Adds a Downloadable Product to an Order. Clicks on 'Add Selected Product(s) to Order'.</description> - </annotations> - - <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> - <waitForPageLoad time="30" stepKey="waitForPageLoad1"/> - <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterDownloadable"/> - <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchDownloadable"/> - <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> - <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectDownloadableProduct"/> - <waitForElementVisible selector="{{AdminOrderFormDownloadableProductSection.optionSelect(link.title)}}" stepKey="waitForLinkLoad"/> - <click selector="{{AdminOrderFormDownloadableProductSection.optionSelect(link.title)}}" stepKey="selectLink"/> - <fillField selector="{{AdminOrderFormDownloadableProductSection.quantity}}" userInput="{{quantity}}" stepKey="setQuantity"/> - <click selector="{{AdminOrderFormDownloadableProductSection.ok}}" stepKey="confirmConfiguration"/> - <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> - <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> - </actionGroup> - - <!--Add grouped product option to order --> - <actionGroup name="addGroupedProductOptionToOrder"> - <annotations> - <description>Adds the provided Grouped Product with the provided Option to an Order. Fills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="option"/> - <argument name="quantity" type="string" defaultValue="1"/> - </arguments> - - <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> - <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterGrouped"/> - <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchGrouped"/> - <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> - <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectGroupedProduct"/> - <waitForElementVisible selector="{{AdminOrderFormGroupedProductSection.optionQty(option.sku)}}" stepKey="waitForGroupedOptionLoad"/> - <wait time="2" stepKey="waitForOptionsToLoad"/> - <fillField selector="{{AdminOrderFormGroupedProductSection.optionQty(option.sku)}}" userInput="{{quantity}}" stepKey="fillOptionQuantity"/> - <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOk"/> - <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> - <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> - </actionGroup> - - <!--Fill customer billing address--> - <actionGroup name="fillOrderCustomerInformation"> - <annotations> - <description>Fills in the provided Customer and Address details on the Admin 'Create New Order for' page.</description> - </annotations> - <arguments> - <argument name="customer"/> - <argument name="address"/> - </arguments> - - <fillField selector="{{AdminOrderFormBillingAddressSection.FirstName}}" userInput="{{customer.firstname}}" stepKey="fillFirstName"/> - <fillField selector="{{AdminOrderFormBillingAddressSection.LastName}}" userInput="{{customer.lastname}}" stepKey="fillLastName"/> - <fillField selector="{{AdminOrderFormBillingAddressSection.StreetLine1}}" userInput="{{address.street[0]}}" stepKey="fillStreetLine1"/> - <fillField selector="{{AdminOrderFormBillingAddressSection.City}}" userInput="{{address.city}}" stepKey="fillCity"/> - <selectOption selector="{{AdminOrderFormBillingAddressSection.Country}}" userInput="{{address.country_id}}" stepKey="fillCountry"/> - <selectOption selector="{{AdminOrderFormBillingAddressSection.State}}" userInput="{{address.state}}" stepKey="fillState"/> - <fillField selector="{{AdminOrderFormBillingAddressSection.PostalCode}}" userInput="{{address.postcode}}" stepKey="fillPostalCode"/> - <fillField selector="{{AdminOrderFormBillingAddressSection.Phone}}" userInput="{{address.telephone}}" stepKey="fillPhone"/> - </actionGroup> - - <!--Select flat rate shipping method--> - <actionGroup name="orderSelectFlatRateShipping"> - <annotations> - <description>Selects the 'Flat Rate' Shipping Method on the Admin 'Create New Order for' page.</description> - </annotations> - - <click selector="{{AdminOrderFormPaymentSection.header}}" stepKey="unfocus"/> - <waitForPageLoad stepKey="waitForJavascriptToFinish"/> - <click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickShippingMethods"/> - <waitForElementVisible selector="{{AdminOrderFormPaymentSection.flatRateOption}}" stepKey="waitForShippingOptions"/> - <selectOption selector="{{AdminOrderFormPaymentSection.flatRateOption}}" userInput="flatrate_flatrate" stepKey="checkFlatRate"/> - </actionGroup> - - <actionGroup name="changeShippingMethod"> - <annotations> - <description>Change Shipping Method on the Admin 'Create New Order for' page.</description> - </annotations> - <arguments> - <argument name="shippingMethod" defaultValue="flatrate_flatrate" type="string"/> - </arguments> - <click selector="{{AdminOrderFormPaymentSection.header}}" stepKey="unfocus"/> - <waitForPageLoad stepKey="waitForJavascriptToFinish"/> - <click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickShippingMethods1"/> - <waitForElementVisible selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="waitForChangeShippingMethod"/> - <click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickShippingMethods2"/> - <waitForElementVisible selector="{{AdminOrderFormPaymentSection.shippingMethod}}" stepKey="waitForShippingOptions2"/> - <selectOption selector="{{AdminOrderFormPaymentSection.shippingMethod}}" userInput="{{shippingMethod}}" stepKey="checkFlatRate"/> - </actionGroup> - - <!--Select free shipping method--> - <actionGroup name="orderSelectFreeShipping"> - <annotations> - <description>Selects the 'Free Shipping' Shipping Method on the Admin 'Create New Order for' page.</description> - </annotations> - - <click selector="{{AdminOrderFormPaymentSection.header}}" stepKey="unfocus"/> - <waitForPageLoad stepKey="waitForJavascriptToFinish"/> - <click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickShippingMethods"/> - <waitForElementVisible selector="{{AdminOrderFormPaymentSection.freeShippingOption}}" stepKey="waitForShippingOptions"/> - <selectOption selector="{{AdminOrderFormPaymentSection.freeShippingOption}}" userInput="freeshipping_freeshipping" stepKey="checkFreeShipping"/> - </actionGroup> - - <!--Check that customer information is correct in order--> - <actionGroup name="verifyBasicOrderInformation"> - <annotations> - <description>Validates that the provided Customer, Shipping/Billing Address and Customer Group are present and correct on the Admin Orders view page.</description> - </annotations> - <arguments> - <argument name="customer"/> - <argument name="shippingAddress"/> - <argument name="billingAddress"/> - <argument name="customerGroup" defaultValue="GeneralCustomerGroup"/> - </arguments> - - <see selector="{{AdminOrderDetailsInformationSection.customerName}}" userInput="{{customer.firstname}}" stepKey="seeCustomerName"/> - <see selector="{{AdminOrderDetailsInformationSection.customerEmail}}" userInput="{{customer.email}}" stepKey="seeCustomerEmail"/> - <see selector="{{AdminOrderDetailsInformationSection.customerGroup}}" userInput="{{customerGroup.code}}" stepKey="seeCustomerGroup"/> - <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.street[0]}}" stepKey="seeBillingAddressStreet"/> - <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.city}}" stepKey="seeBillingAddressCity"/> - <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.country_id}}" stepKey="seeBillingAddressCountry"/> - <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.postcode}}" stepKey="seeBillingAddressPostcode"/> - <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.street[0]}}" stepKey="seeShippingAddressStreet"/> - <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.city}}" stepKey="seeShippingAddressCity"/> - <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.country_id}}" stepKey="seeShippingAddressCountry"/> - <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.postcode}}" stepKey="seeShippingAddressPostcode"/> - </actionGroup> - <actionGroup name="AssertOrderAddressInformationActionGroup" extends="verifyBasicOrderInformation"> - <remove keyForRemoval="seeCustomerName"/> - <remove keyForRemoval="seeCustomerEmail"/> - <remove keyForRemoval="seeCustomerGroup"/> - <remove keyForRemoval="seeBillingAddressCountry"/> - <remove keyForRemoval="seeShippingAddressCountry"/> - <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.country}}" stepKey="seeBillingCountry" after="seeBillingAddressCity"/> - <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.country}}" stepKey="seeAddressCountry" after="seeShippingAddressCity"/> - </actionGroup> - - <!--Verify order information--> - <actionGroup name="verifyCreatedOrderInformation"> - <annotations> - <description>Validates that the Success Message, Order Status (Pending) and Order ID are present and correct.</description> - </annotations> - - <see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="You created the order." stepKey="seeSuccessMessage"/> - <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Pending" stepKey="seeOrderPendingStatus" after="seeSuccessMessage"/> - <grabTextFrom selector="|Order # (\d+)|" stepKey="getOrderId" after="seeOrderPendingStatus"/> - <assertNotEmpty actual="$getOrderId" stepKey="assertOrderIdIsNotEmpty" after="getOrderId"/> - </actionGroup> - - <!--Check for product in order items list--> - <actionGroup name="seeProductInItemsOrdered"> - <annotations> - <description>Validates that the provided Product is present and correct in the 'Items Ordered' section on the Admin Orders view page.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <see selector="{{AdminOrderItemsOrderedSection.productSkuColumn}}" userInput="{{product.sku}}" stepKey="seeSkuInItemsOrdered"/> - </actionGroup> - - <actionGroup name="CreateOrderInStoreActionGroup"> - <annotations> - <description>Goes to the Admin Create Order page. Creates an Order based on the provided Customer, Store View and Product. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="customer"/> - <argument name="storeView"/> - </arguments> - - <amOnPage stepKey="navigateToNewOrderPage" url="{{AdminOrderCreatePage.url}}"/> - <click stepKey="chooseCustomer" selector="{{AdminOrdersGridSection.customerInOrdersSection(customer.firstname)}}"/> - <waitForPageLoad stepKey="waitForStoresPageOpened"/> - <click stepKey="chooseStore" selector="{{AdminOrderStoreScopeTreeSection.storeForOrder(storeView.name)}}"/> - <scrollToTopOfPage stepKey="scrollToTop"/> - <waitForPageLoad stepKey="waitForStoreToAppear"/> - <click selector="{{OrdersGridSection.addProducts}}" stepKey="clickOnAddProducts"/> - <waitForPageLoad stepKey="waitForProductsListForOrder"/> - <click selector="{{AdminOrdersGridSection.productForOrder(product.sku)}}" stepKey="chooseTheProduct"/> - <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="addSelectedProductToOrder"/> - <waitForPageLoad stepKey="waitForProductAddedInOrder"/> - <click selector="{{AdminInvoicePaymentShippingSection.getShippingMethodAndRates}}" stepKey="openShippingMethod"/> - <waitForPageLoad stepKey="waitForShippingMethods"/> - <click selector="{{AdminInvoicePaymentShippingSection.shippingMethod}}" stepKey="chooseShippingMethod"/> - <waitForPageLoad stepKey="waitForShippingMethodsThickened"/> - <click selector="{{OrdersGridSection.submitOrder}}" stepKey="submitOrder"/> - <see stepKey="seeSuccessMessageForOrder" userInput="You created the order."/> - </actionGroup> - - <actionGroup name="CreateOrderInStoreChoosingPaymentMethodActionGroup"> - <annotations> - <description>Goes to the Admin Create Order page. Creates an Order based on the provided Customer, Store View and Product. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="customer"/> - <argument name="storeView"/> - </arguments> - - <amOnPage stepKey="navigateToNewOrderPage" url="{{AdminOrderCreatePage.url}}"/> - <click stepKey="chooseCustomer" selector="{{AdminOrdersGridSection.customerInOrdersSection(customer.firstname)}}"/> - <waitForPageLoad stepKey="waitForStoresPageOpened"/> - <click stepKey="chooseStore" selector="{{AdminOrderStoreScopeTreeSection.storeForOrder(storeView.name)}}"/> - <scrollToTopOfPage stepKey="scrollToTop"/> - <click selector="{{OrdersGridSection.addProducts}}" stepKey="clickOnAddProducts"/> - <waitForPageLoad stepKey="waitForProductsListForOrder"/> - <click selector="{{AdminOrdersGridSection.productForOrder(product.sku)}}" stepKey="chooseTheProduct"/> - <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="addSelectedProductToOrder"/> - <waitForPageLoad stepKey="waitForProductAddedInOrder"/> - <click selector="{{AdminInvoicePaymentShippingSection.getShippingMethodAndRates}}" stepKey="openShippingMethod"/> - <waitForPageLoad stepKey="waitForShippingMethods"/> - <click selector="{{AdminInvoicePaymentShippingSection.shippingMethod}}" stepKey="chooseShippingMethod"/> - <waitForPageLoad stepKey="waitForShippingMethodsThickened"/> - <waitForElementVisible selector="{{AdminOrderFormPaymentSection.paymentBlock}}" stepKey="waitForPaymentOptions"/> - <conditionalClick selector="{{AdminOrderFormPaymentSection.checkMoneyOption}}" dependentSelector="{{AdminOrderFormPaymentSection.checkMoneyOption}}" visible="true" stepKey="checkCheckMoneyOption"/> - <click selector="{{OrdersGridSection.submitOrder}}" stepKey="submitOrder"/> - <see stepKey="seeSuccessMessageForOrder" userInput="You created the order."/> - </actionGroup> - - <!--Cancel order that is in pending status--> - <actionGroup name="cancelPendingOrder"> - <annotations> - <description>Cancels the Pending Order on the Admin Orders view page. Validates that the provided Order Status is present and correct.</description> - </annotations> - <arguments> - <argument name="orderStatus" type="string" defaultValue="Canceled"/> - </arguments> - - <click selector="{{AdminOrderDetailsMainActionsSection.cancel}}" stepKey="clickCancelOrder"/> - <waitForElement selector="{{AdminConfirmationModalSection.message}}" stepKey="waitForCancelConfirmation"/> - <see selector="{{AdminConfirmationModalSection.message}}" userInput="Are you sure you want to cancel this order?" stepKey="seeConfirmationMessage"/> - <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmOrderCancel"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You canceled the order." stepKey="seeCancelSuccessMessage"/> - <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="{{orderStatus}}" stepKey="seeOrderStatusCanceled"/> - </actionGroup> - - <!--Assert that the product is not in the order items list--> - <actionGroup name="dontSeeProductInItemsOrdered"> - <arguments> - <argument name="product"/> - </arguments> - <dontSee selector="{{AdminOrderItemsOrderedSection.productSkuColumn}}" userInput="{{product.sku}}" stepKey="dontseeSkuInItemsOrdered"/> - </actionGroup> - - <!--Select Check Money payment method--> - <actionGroup name="SelectCheckMoneyPaymentMethod"> - <annotations> - <description>Selects the 'Check / Money Order' Payment Method on the Admin Create New Order page.</description> - </annotations> - - <waitForElementVisible selector="{{AdminOrderFormPaymentSection.paymentBlock}}" stepKey="waitForPaymentOptions"/> - <conditionalClick selector="{{AdminOrderFormPaymentSection.checkMoneyOption}}" dependentSelector="{{AdminOrderFormPaymentSection.checkMoneyOption}}" visible="true" stepKey="checkCheckMoneyOption"/> - </actionGroup> - - <!--Select Bank Transfer payment method--> - <actionGroup name="SelectBankTransferPaymentMethodActionGroup" extends="SelectCheckMoneyPaymentMethod"> - <remove keyForRemoval="checkCheckMoneyOption"/> - <conditionalClick selector="{{AdminOrderFormPaymentSection.checkBankTransfer}}" dependentSelector="{{AdminOrderFormPaymentSection.checkBankTransfer}}" visible="true" stepKey="checkBankTransferOption" after="waitForPaymentOptions"/> - </actionGroup> - - <!--Select Cash on Delivery payment method--> - <actionGroup name="SelectCashOnDeliveryPaymentMethodActionGroup" extends="SelectCheckMoneyPaymentMethod"> - <remove keyForRemoval="checkCheckMoneyOption"/> - <conditionalClick selector="{{AdminOrderFormPaymentSection.checkCashOnDelivery}}" dependentSelector="{{AdminOrderFormPaymentSection.checkCashOnDelivery}}" visible="true" stepKey="checkCashOnDeliveryOption" after="waitForPaymentOptions"/> - </actionGroup> - - <!--Select Purchase Order payment method--> - <actionGroup name="SelectPurchaseOrderPaymentMethodActionGroup" extends="SelectCheckMoneyPaymentMethod"> - <arguments> - <argument name="purchaseOrderNumber" type="string"/> - </arguments> - <remove keyForRemoval="checkCheckMoneyOption"/> - <conditionalClick selector="{{AdminOrderFormPaymentSection.checkPurchaseOrder}}" dependentSelector="{{AdminOrderFormPaymentSection.checkPurchaseOrder}}" visible="true" stepKey="checkPurchaseOrderOption" after="waitForPaymentOptions"/> - <fillField selector="{{AdminOrderFormPaymentSection.fieldPurchaseOrderNumber}}" userInput="{{purchaseOrderNumber}}" stepKey="fillPurchaseOrderNumber"/> - </actionGroup> - - <!-- Create Order --> - <actionGroup name="CreateOrderActionGroup"> - <annotations> - <description>Goes to the Admin Create New Order page. Selects the provided Customer. Adds the provided Product to the Order. Clicks on Submit Order. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="customer"/> - </arguments> - - <amOnPage stepKey="navigateToNewOrderPage" url="{{AdminOrderCreatePage.url}}"/> - <waitForPageLoad stepKey="waitForNewOrderPageOpened"/> - <click stepKey="chooseCustomer" selector="{{AdminOrdersGridSection.customerInOrdersSection(customer.firstname)}}"/> - <waitForPageLoad stepKey="waitForStoresPageOpened"/> - <click selector="{{OrdersGridSection.addProducts}}" stepKey="clickOnAddProducts"/> - <waitForPageLoad stepKey="waitForProductsListForOrder"/> - <click selector="{{AdminOrdersGridSection.productForOrder(product.sku)}}" stepKey="chooseTheProduct"/> - <waitForPageLoad stepKey="waitForClickProduct"/> - <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="addSelectedProductToOrder"/> - <waitForPageLoad stepKey="waitForProductAddedInOrder"/> - <click selector="{{AdminInvoicePaymentShippingSection.getShippingMethodAndRates}}" stepKey="openShippingMethod"/> - <waitForPageLoad stepKey="waitForShippingMethods"/> - <click selector="{{AdminInvoicePaymentShippingSection.shippingMethod}}" stepKey="chooseShippingMethod"/> - <waitForPageLoad stepKey="waitForShippingMethodsThickened"/> - <click selector="{{OrdersGridSection.submitOrder}}" stepKey="submitOrder"/> - <waitForPageLoad stepKey="waitForSubmitOrder"/> - <see stepKey="seeSuccessMessageForOrder" userInput="You created the order."/> - </actionGroup> - <actionGroup name="CreateOrderFilteringCustomerByEmailActionGroup" extends="CreateOrderActionGroup"> - <click stepKey="chooseCustomer" selector="{{AdminOrdersGridSection.customerInOrdersSection(customer.email)}}"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderGridActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderGridActionGroup.xml deleted file mode 100644 index e8ed82148b007..0000000000000 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderGridActionGroup.xml +++ /dev/null @@ -1,113 +0,0 @@ -<?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"> - <!--Filter order grid by order id field--> - <actionGroup name="filterOrderGridById"> - <annotations> - <description>Goes to the Admin Orders page. Filters the grid based on the provided Order ID.</description> - </annotations> - <arguments> - <argument name="orderId" type="string"/> - </arguments> - - <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderGridPage"/> - <waitForPageLoad stepKey="waitForOrdersPage"/> - <conditionalClick selector="{{AdminOrdersGridSection.clearFilters}}" dependentSelector="{{AdminOrdersGridSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> - <waitForPageLoad stepKey="waitForClearFilters"/> - <click selector="{{AdminOrdersGridSection.filters}}" stepKey="openOrderGridFilters"/> - <waitForPageLoad stepKey="waitForClickFilters"/> - <fillField selector="{{AdminOrdersGridSection.idFilter}}" userInput="{{orderId}}" stepKey="fillOrderIdFilter"/> - <click selector="{{AdminOrdersGridSection.applyFilters}}" stepKey="clickOrderApplyFilters"/> - <waitForPageLoad stepKey="waitForApplyFilters"/> - </actionGroup> - - <!--Filter order grid by the billing name field--> - <actionGroup name="filterOrderGridByBillingName"> - <annotations> - <description>Goes to the Admin Orders page. Filters the grid based on the provided Customer.</description> - </annotations> - <arguments> - <argument name="customer"/> - </arguments> - - <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderGridPage"/> - <waitForPageLoad stepKey="waitForOrderGridLoad"/> - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> - <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openOrderGridFilters"/> - <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('billing_name')}}" userInput="{{customer.fullname}}" stepKey="fillBillToNameFilter"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickOrderApplyFilters"/> - </actionGroup> - - <!--Filter order grid by order total range--> - <actionGroup name="filterOrderGridByBaseTotalRange"> - <annotations> - <description>Goes to the Admin Orders page. Filters the grid based on the provided Grand Total From/To values.</description> - </annotations> - <arguments> - <argument name="from"/> - <argument name="to"/> - </arguments> - - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> - <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openOrderGridFilters"/> - <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('base_grand_total[from]')}}" userInput="{{from}}" stepKey="fillOrderTotalFrom"/> - <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('base_grand_total[to]')}}" userInput="{{to}}" stepKey="fillOrderTotalTo"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFilters"/> - </actionGroup> - - <actionGroup name="filterOrderGridByPurchaseDate"> - <annotations> - <description>Goes to the Admin Orders page. Filters the grid based on the provided Purchased Date From/To values.</description> - </annotations> - <arguments> - <argument name="from"/> - <argument name="to"/> - </arguments> - - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> - <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openOrderGridFilters"/> - <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('created_at[from]')}}" userInput="{{from}}" stepKey="fillOrderPurchaseDateFrom"/> - <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('created_at[to]')}}" userInput="{{to}}" stepKey="fillOrderPurchaseDateTo"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFilters"/> - </actionGroup> - - <actionGroup name="filterOrderGridByStatus"> - <annotations> - <description>Filters the Admin Orders grid based on the provided Order Status.</description> - </annotations> - <arguments> - <argument name="status"/> - </arguments> - - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> - <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openOrderGridFilters"/> - <selectOption selector="{{AdminDataGridHeaderSection.filterFieldSelect('status')}}" userInput="{{status}}" stepKey="fillOrderStatusFilter"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFilters"/> - </actionGroup> - - <actionGroup name="AdminOrdersGridClearFiltersActionGroup"> - <annotations> - <description>Goes to the Admin Orders grid page. Clicks on 'Clear Filters', if present.</description> - </annotations> - - <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToGridOrdersPage"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> - <conditionalClick selector="{{AdminOrdersGridSection.clearFilters}}" dependentSelector="{{AdminOrdersGridSection.enabledFilters}}" visible="true" stepKey="clickOnButtonToRemoveFiltersIfPresent"/> - </actionGroup> - - <actionGroup name="OpenOrderById" extends="filterOrderGridById"> - <annotations> - <description>EXTENDS: filterOrderGridById. Clicks on the 1st row of the Admin Orders grid.</description> - </annotations> - - <click selector="{{AdminDataGridTableSection.firstRow}}" after="clickOrderApplyFilters" stepKey="openOrderViewPage"/> - <waitForPageLoad after="openOrderViewPage" stepKey="waitForOrderViewPageOpened"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrdersGridClearFiltersActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrdersGridClearFiltersActionGroup.xml new file mode 100644 index 0000000000000..b301864212c8b --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrdersGridClearFiltersActionGroup.xml @@ -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="AdminOrdersGridClearFiltersActionGroup"> + <annotations> + <description>Goes to the Admin Orders grid page. Clicks on 'Clear Filters', if present.</description> + </annotations> + + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToGridOrdersPage"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <conditionalClick selector="{{AdminOrdersGridSection.clearFilters}}" dependentSelector="{{AdminOrdersGridSection.enabledFilters}}" visible="true" stepKey="clickOnButtonToRemoveFiltersIfPresent"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertOrderAddressInformationActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertOrderAddressInformationActionGroup.xml new file mode 100644 index 0000000000000..db3343794de01 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertOrderAddressInformationActionGroup.xml @@ -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="AssertOrderAddressInformationActionGroup" extends="VerifyBasicOrderInformationActionGroup"> + <remove keyForRemoval="seeCustomerName"/> + <remove keyForRemoval="seeCustomerEmail"/> + <remove keyForRemoval="seeCustomerGroup"/> + <remove keyForRemoval="seeBillingAddressCountry"/> + <remove keyForRemoval="seeShippingAddressCountry"/> + <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.country}}" stepKey="seeBillingCountry" after="seeBillingAddressCity"/> + <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.country}}" stepKey="seeAddressCountry" after="seeShippingAddressCity"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/CancelPendingOrderActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/CancelPendingOrderActionGroup.xml new file mode 100644 index 0000000000000..b440817dfd80e --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/CancelPendingOrderActionGroup.xml @@ -0,0 +1,26 @@ +<?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="CancelPendingOrderActionGroup"> + <annotations> + <description>Cancels the Pending Order on the Admin Orders view page. Validates that the provided Order Status is present and correct.</description> + </annotations> + <arguments> + <argument name="orderStatus" type="string" defaultValue="Canceled"/> + </arguments> + + <click selector="{{AdminOrderDetailsMainActionsSection.cancel}}" stepKey="clickCancelOrder"/> + <waitForElement selector="{{AdminConfirmationModalSection.message}}" stepKey="waitForCancelConfirmation"/> + <see selector="{{AdminConfirmationModalSection.message}}" userInput="Are you sure you want to cancel this order?" stepKey="seeConfirmationMessage"/> + <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmOrderCancel"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You canceled the order." stepKey="seeCancelSuccessMessage"/> + <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="{{orderStatus}}" stepKey="seeOrderStatusCanceled"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/ChangeShippingMethodActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/ChangeShippingMethodActionGroup.xml new file mode 100644 index 0000000000000..49ad1013f7b73 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/ChangeShippingMethodActionGroup.xml @@ -0,0 +1,26 @@ +<?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="ChangeShippingMethodActionGroup"> + <annotations> + <description>Change Shipping Method on the Admin 'Create New Order for' page.</description> + </annotations> + <arguments> + <argument name="shippingMethod" defaultValue="flatrate_flatrate" type="string"/> + </arguments> + <click selector="{{AdminOrderFormPaymentSection.header}}" stepKey="unfocus"/> + <waitForPageLoad stepKey="waitForJavascriptToFinish"/> + <click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickShippingMethods1"/> + <waitForElementVisible selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="waitForChangeShippingMethod"/> + <click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickShippingMethods2"/> + <waitForElementVisible selector="{{AdminOrderFormPaymentSection.shippingMethod}}" stepKey="waitForShippingOptions2"/> + <selectOption selector="{{AdminOrderFormPaymentSection.shippingMethod}}" userInput="{{shippingMethod}}" stepKey="checkFlatRate"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/CheckRequiredFieldsNewOrderFormActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/CheckRequiredFieldsNewOrderFormActionGroup.xml new file mode 100644 index 0000000000000..25936ad3f6002 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/CheckRequiredFieldsNewOrderFormActionGroup.xml @@ -0,0 +1,39 @@ +<?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="CheckRequiredFieldsNewOrderFormActionGroup"> + <annotations> + <description>Clears the Email, First Name, Last Name, Street Line 1, City, Postal Code and Phone fields when adding an Order and then verifies that they are required after attempting to Save.</description> + </annotations> + + <seeElement selector="{{AdminOrderFormAccountSection.requiredGroup}}" stepKey="seeCustomerGroupRequired"/> + <seeElement selector="{{AdminOrderFormAccountSection.requiredEmail}}" stepKey="seeEmailRequired"/> + <clearField selector="{{AdminOrderFormAccountSection.email}}" stepKey="clearEmailField"/> + <clearField selector="{{AdminOrderFormBillingAddressSection.FirstName}}" stepKey="clearFirstNameField"/> + <clearField selector="{{AdminOrderFormBillingAddressSection.LastName}}" stepKey="clearLastNameField"/> + <clearField selector="{{AdminOrderFormBillingAddressSection.StreetLine1}}" stepKey="clearStreetField"/> + <clearField selector="{{AdminOrderFormBillingAddressSection.City}}" stepKey="clearCityField"/> + <selectOption selector="{{AdminOrderFormBillingAddressSection.Country}}" userInput="United States" stepKey="selectUSCountry"/> + <selectOption selector="{{AdminOrderFormBillingAddressSection.State}}" userInput="Please select" stepKey="selectNoState"/> + <clearField selector="{{AdminOrderFormBillingAddressSection.PostalCode}}" stepKey="clearPostalCodeField"/> + <clearField selector="{{AdminOrderFormBillingAddressSection.Phone}}" stepKey="clearPhoneField"/> + <seeElement selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="seeShippingMethodNotSelected"/> + <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="trySubmitOrder"/> + <see selector="{{AdminOrderFormBillingAddressSection.emailError}}" userInput="This is a required field." stepKey="seeThatEmailIsRequired"/> + <see selector="{{AdminOrderFormBillingAddressSection.firstNameError}}" userInput="This is a required field." stepKey="seeFirstNameRequired"/> + <see selector="{{AdminOrderFormBillingAddressSection.lastNameError}}" userInput="This is a required field." stepKey="seeLastNameRequired"/> + <see selector="{{AdminOrderFormBillingAddressSection.streetAddressError}}" userInput="This is a required field." stepKey="seeStreetRequired"/> + <see selector="{{AdminOrderFormBillingAddressSection.cityError}}" userInput="This is a required field." stepKey="seeCityRequired"/> + <see selector="{{AdminOrderFormBillingAddressSection.stateError}}" userInput="This is a required field." stepKey="seeStateRequired"/> + <see selector="{{AdminOrderFormBillingAddressSection.postalCodeError}}" userInput="This is a required field." stepKey="seePostalCodeRequired"/> + <see selector="{{AdminOrderFormBillingAddressSection.phoneError}}" userInput="This is a required field." stepKey="seePhoneRequired"/> + <see selector="{{AdminOrderFormPaymentSection.shippingError}}" userInput="This is a required field." stepKey="seeShippingMethodRequired"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/ClearInvoicesGridFiltersActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/ClearInvoicesGridFiltersActionGroup.xml new file mode 100644 index 0000000000000..8b8f400fca928 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/ClearInvoicesGridFiltersActionGroup.xml @@ -0,0 +1,21 @@ +<?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="ClearInvoicesGridFiltersActionGroup"> + <annotations> + <description>Goes to the Admin Invoices grid page. Clicks on 'Clear Filters', if present.</description> + </annotations> + + <amOnPage url="{{AdminInvoicesPage.url}}" stepKey="goToInvoices"/> + <waitForPageLoad stepKey="waitInvoicesGridToLoad"/> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearFilters"/> + <waitForPageLoad stepKey="waitInvoicesGrid"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/ConfigureOrderedConfigurableProductActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/ConfigureOrderedConfigurableProductActionGroup.xml new file mode 100644 index 0000000000000..1a0f1cb9689f1 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/ConfigureOrderedConfigurableProductActionGroup.xml @@ -0,0 +1,28 @@ +<?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="ConfigureOrderedConfigurableProductActionGroup"> + <annotations> + <description>Clicks on 'Configure' for a Product in the 'Please select products' under the 'Create New Order for' page. Selects the provided Option and Attribute. Fills in the provided Qty. Clicks on Ok.</description> + </annotations> + <arguments> + <argument name="attribute"/> + <argument name="option"/> + <argument name="quantity" type="string"/> + </arguments> + + <click selector="{{AdminOrderFormItemsSection.configure}}" stepKey="clickConfigure"/> + <waitForElementVisible selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}" stepKey="waitForConfigurablePopover"/> + <wait time="2" stepKey="waitForOptionsToLoad"/> + <selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}" userInput="{{option.label}}" stepKey="selectionConfigurableOption"/> + <fillField selector="{{AdminOrderFormConfigureProductSection.quantity}}" userInput="{{quantity}}" stepKey="fillQuantity"/> + <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkConfigurablePopover"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderActionGroup.xml new file mode 100644 index 0000000000000..576735a9a36c5 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderActionGroup.xml @@ -0,0 +1,38 @@ +<?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="CreateOrderActionGroup"> + <annotations> + <description>Goes to the Admin Create New Order page. Selects the provided Customer. Adds the provided Product to the Order. Clicks on Submit Order. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="customer"/> + </arguments> + + <amOnPage stepKey="navigateToNewOrderPage" url="{{AdminOrderCreatePage.url}}"/> + <waitForPageLoad stepKey="waitForNewOrderPageOpened"/> + <click stepKey="chooseCustomer" selector="{{AdminOrdersGridSection.customerInOrdersSection(customer.firstname)}}"/> + <waitForPageLoad stepKey="waitForStoresPageOpened"/> + <click selector="{{OrdersGridSection.addProducts}}" stepKey="clickOnAddProducts"/> + <waitForPageLoad stepKey="waitForProductsListForOrder"/> + <click selector="{{AdminOrdersGridSection.productForOrder(product.sku)}}" stepKey="chooseTheProduct"/> + <waitForPageLoad stepKey="waitForClickProduct"/> + <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="addSelectedProductToOrder"/> + <waitForPageLoad stepKey="waitForProductAddedInOrder"/> + <click selector="{{AdminInvoicePaymentShippingSection.getShippingMethodAndRates}}" stepKey="openShippingMethod"/> + <waitForPageLoad stepKey="waitForShippingMethods"/> + <click selector="{{AdminInvoicePaymentShippingSection.shippingMethod}}" stepKey="chooseShippingMethod"/> + <waitForPageLoad stepKey="waitForShippingMethodsThickened"/> + <click selector="{{OrdersGridSection.submitOrder}}" stepKey="submitOrder"/> + <waitForPageLoad stepKey="waitForSubmitOrder"/> + <see stepKey="seeSuccessMessageForOrder" userInput="You created the order."/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderFilteringCustomerByEmailActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderFilteringCustomerByEmailActionGroup.xml new file mode 100644 index 0000000000000..fb65531b14bfb --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderFilteringCustomerByEmailActionGroup.xml @@ -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="CreateOrderFilteringCustomerByEmailActionGroup" extends="CreateOrderActionGroup"> + <click stepKey="chooseCustomer" selector="{{AdminOrdersGridSection.customerInOrdersSection(customer.email)}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderInStoreActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderInStoreActionGroup.xml new file mode 100644 index 0000000000000..2349be636cfa7 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderInStoreActionGroup.xml @@ -0,0 +1,39 @@ +<?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="CreateOrderInStoreActionGroup"> + <annotations> + <description>Goes to the Admin Create Order page. Creates an Order based on the provided Customer, Store View and Product. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="customer"/> + <argument name="storeView"/> + </arguments> + + <amOnPage stepKey="navigateToNewOrderPage" url="{{AdminOrderCreatePage.url}}"/> + <click stepKey="chooseCustomer" selector="{{AdminOrdersGridSection.customerInOrdersSection(customer.firstname)}}"/> + <waitForPageLoad stepKey="waitForStoresPageOpened"/> + <click stepKey="chooseStore" selector="{{AdminOrderStoreScopeTreeSection.storeForOrder(storeView.name)}}"/> + <scrollToTopOfPage stepKey="scrollToTop"/> + <waitForPageLoad stepKey="waitForStoreToAppear"/> + <click selector="{{OrdersGridSection.addProducts}}" stepKey="clickOnAddProducts"/> + <waitForPageLoad stepKey="waitForProductsListForOrder"/> + <click selector="{{AdminOrdersGridSection.productForOrder(product.sku)}}" stepKey="chooseTheProduct"/> + <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="addSelectedProductToOrder"/> + <waitForPageLoad stepKey="waitForProductAddedInOrder"/> + <click selector="{{AdminInvoicePaymentShippingSection.getShippingMethodAndRates}}" stepKey="openShippingMethod"/> + <waitForPageLoad stepKey="waitForShippingMethods"/> + <click selector="{{AdminInvoicePaymentShippingSection.shippingMethod}}" stepKey="chooseShippingMethod"/> + <waitForPageLoad stepKey="waitForShippingMethodsThickened"/> + <click selector="{{OrdersGridSection.submitOrder}}" stepKey="submitOrder"/> + <see stepKey="seeSuccessMessageForOrder" userInput="You created the order."/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderInStoreChoosingPaymentMethodActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderInStoreChoosingPaymentMethodActionGroup.xml new file mode 100644 index 0000000000000..7277a75c9bc73 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderInStoreChoosingPaymentMethodActionGroup.xml @@ -0,0 +1,40 @@ +<?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="CreateOrderInStoreChoosingPaymentMethodActionGroup"> + <annotations> + <description>Goes to the Admin Create Order page. Creates an Order based on the provided Customer, Store View and Product. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="customer"/> + <argument name="storeView"/> + </arguments> + + <amOnPage stepKey="navigateToNewOrderPage" url="{{AdminOrderCreatePage.url}}"/> + <click stepKey="chooseCustomer" selector="{{AdminOrdersGridSection.customerInOrdersSection(customer.firstname)}}"/> + <waitForPageLoad stepKey="waitForStoresPageOpened"/> + <click stepKey="chooseStore" selector="{{AdminOrderStoreScopeTreeSection.storeForOrder(storeView.name)}}"/> + <scrollToTopOfPage stepKey="scrollToTop"/> + <click selector="{{OrdersGridSection.addProducts}}" stepKey="clickOnAddProducts"/> + <waitForPageLoad stepKey="waitForProductsListForOrder"/> + <click selector="{{AdminOrdersGridSection.productForOrder(product.sku)}}" stepKey="chooseTheProduct"/> + <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="addSelectedProductToOrder"/> + <waitForPageLoad stepKey="waitForProductAddedInOrder"/> + <click selector="{{AdminInvoicePaymentShippingSection.getShippingMethodAndRates}}" stepKey="openShippingMethod"/> + <waitForPageLoad stepKey="waitForShippingMethods"/> + <click selector="{{AdminInvoicePaymentShippingSection.shippingMethod}}" stepKey="chooseShippingMethod"/> + <waitForPageLoad stepKey="waitForShippingMethodsThickened"/> + <waitForElementVisible selector="{{AdminOrderFormPaymentSection.paymentBlock}}" stepKey="waitForPaymentOptions"/> + <conditionalClick selector="{{AdminOrderFormPaymentSection.checkMoneyOption}}" dependentSelector="{{AdminOrderFormPaymentSection.checkMoneyOption}}" visible="true" stepKey="checkCheckMoneyOption"/> + <click selector="{{OrdersGridSection.submitOrder}}" stepKey="submitOrder"/> + <see stepKey="seeSuccessMessageForOrder" userInput="You created the order."/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderToPrintPageActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderToPrintPageActionGroup.xml index 7388eaa96f215..2b09048a7a11f 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderToPrintPageActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderToPrintPageActionGroup.xml @@ -34,13 +34,4 @@ <click selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="clickOrderLink"/> <click selector="{{StorefrontCustomerOrderViewSection.printOrderLink}}" stepKey="clickPrintOrderLink"/> </actionGroup> - - <actionGroup name="CreateOrderToPrintPageWithSelectedPaymentMethodActionGroup" extends="CreateOrderToPrintPageActionGroup"> - <annotations> - <description>EXTENDS: CreateOrderToPrintPageActionGroup. Clicks on 'Check / Money Order'.</description> - </annotations> - - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" after="clickNext" stepKey="waitForPaymentSectionLoaded"/> - <conditionalClick selector="{{CheckoutPaymentSection.checkMoneyOrderPayment}}" dependentSelector="{{CheckoutPaymentSection.billingAddress}}" visible="false" before="waitForPlaceOrderButton" stepKey="clickCheckMoneyOrderPayment"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderToPrintPageWithSelectedPaymentMethodActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderToPrintPageWithSelectedPaymentMethodActionGroup.xml new file mode 100644 index 0000000000000..289855aee7e18 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderToPrintPageWithSelectedPaymentMethodActionGroup.xml @@ -0,0 +1,19 @@ +<?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="CreateOrderToPrintPageWithSelectedPaymentMethodActionGroup" extends="CreateOrderToPrintPageActionGroup"> + <annotations> + <description>EXTENDS: CreateOrderToPrintPageActionGroup. Clicks on 'Check / Money Order'.</description> + </annotations> + + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" after="clickNext" stepKey="waitForPaymentSectionLoaded"/> + <conditionalClick selector="{{CheckoutPaymentSection.checkMoneyOrderPayment}}" dependentSelector="{{CheckoutPaymentSection.billingAddress}}" visible="false" before="waitForPlaceOrderButton" stepKey="clickCheckMoneyOrderPayment"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/DontSeeProductInItemsOrderedActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/DontSeeProductInItemsOrderedActionGroup.xml new file mode 100644 index 0000000000000..da0deb15f35c1 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/DontSeeProductInItemsOrderedActionGroup.xml @@ -0,0 +1,17 @@ +<?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="DontSeeProductInItemsOrderedActionGroup"> + <arguments> + <argument name="product"/> + </arguments> + <dontSee selector="{{AdminOrderItemsOrderedSection.productSkuColumn}}" userInput="{{product.sku}}" stepKey="dontseeSkuInItemsOrdered"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/FillOrderCustomerInformationActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/FillOrderCustomerInformationActionGroup.xml new file mode 100644 index 0000000000000..188e6856db186 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/FillOrderCustomerInformationActionGroup.xml @@ -0,0 +1,29 @@ +<?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="FillOrderCustomerInformationActionGroup"> + <annotations> + <description>Fills in the provided Customer and Address details on the Admin 'Create New Order for' page.</description> + </annotations> + <arguments> + <argument name="customer"/> + <argument name="address"/> + </arguments> + + <fillField selector="{{AdminOrderFormBillingAddressSection.FirstName}}" userInput="{{customer.firstname}}" stepKey="fillFirstName"/> + <fillField selector="{{AdminOrderFormBillingAddressSection.LastName}}" userInput="{{customer.lastname}}" stepKey="fillLastName"/> + <fillField selector="{{AdminOrderFormBillingAddressSection.StreetLine1}}" userInput="{{address.street[0]}}" stepKey="fillStreetLine1"/> + <fillField selector="{{AdminOrderFormBillingAddressSection.City}}" userInput="{{address.city}}" stepKey="fillCity"/> + <selectOption selector="{{AdminOrderFormBillingAddressSection.Country}}" userInput="{{address.country_id}}" stepKey="fillCountry"/> + <selectOption selector="{{AdminOrderFormBillingAddressSection.State}}" userInput="{{address.state}}" stepKey="fillState"/> + <fillField selector="{{AdminOrderFormBillingAddressSection.PostalCode}}" userInput="{{address.postcode}}" stepKey="fillPostalCode"/> + <fillField selector="{{AdminOrderFormBillingAddressSection.Phone}}" userInput="{{address.telephone}}" stepKey="fillPhone"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterInvoiceGridByOrderIdActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterInvoiceGridByOrderIdActionGroup.xml new file mode 100644 index 0000000000000..5ad2b23089c76 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterInvoiceGridByOrderIdActionGroup.xml @@ -0,0 +1,25 @@ +<?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="FilterInvoiceGridByOrderIdActionGroup"> + <annotations> + <description>Goes to the Admin Invoices grid page. Filters the grid for the provided Order ID.</description> + </annotations> + <arguments> + <argument name="orderId" type="string"/> + </arguments> + + <amOnPage url="{{AdminInvoicesPage.url}}" stepKey="goToInvoices"/> + <click selector="{{AdminInvoicesGridSection.filter}}" stepKey="clickFilter"/> + <fillField selector="{{AdminInvoicesFiltersSection.orderNum}}" userInput="{{orderId}}" stepKey="fillOrderIdForFilter"/> + <click selector="{{AdminInvoicesFiltersSection.applyFilters}}" stepKey="clickApplyFilters"/> + <waitForPageLoad stepKey="waitForFiltersApply"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterInvoiceGridByOrderIdWithCleanFiltersActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterInvoiceGridByOrderIdWithCleanFiltersActionGroup.xml new file mode 100644 index 0000000000000..88dfc1dc888c2 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterInvoiceGridByOrderIdWithCleanFiltersActionGroup.xml @@ -0,0 +1,17 @@ +<?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="FilterInvoiceGridByOrderIdWithCleanFiltersActionGroup" extends="FilterInvoiceGridByOrderIdActionGroup"> + <arguments> + <argument name="orderId" type="string"/> + </arguments> + <conditionalClick selector="{{AdminInvoicesGridSection.clearFilters}}" dependentSelector="{{AdminInvoicesGridSection.clearFilters}}" visible="true" stepKey="clearFilters" after="goToInvoices"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByBaseTotalRangeActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByBaseTotalRangeActionGroup.xml new file mode 100644 index 0000000000000..cf200a99fc57c --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByBaseTotalRangeActionGroup.xml @@ -0,0 +1,26 @@ +<?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="FilterOrderGridByBaseTotalRangeActionGroup"> + <annotations> + <description>Goes to the Admin Orders page. Filters the grid based on the provided Grand Total From/To values.</description> + </annotations> + <arguments> + <argument name="from"/> + <argument name="to"/> + </arguments> + + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> + <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openOrderGridFilters"/> + <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('base_grand_total[from]')}}" userInput="{{from}}" stepKey="fillOrderTotalFrom"/> + <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('base_grand_total[to]')}}" userInput="{{to}}" stepKey="fillOrderTotalTo"/> + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFilters"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByBillingNameActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByBillingNameActionGroup.xml new file mode 100644 index 0000000000000..8636bd823e744 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByBillingNameActionGroup.xml @@ -0,0 +1,26 @@ +<?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="FilterOrderGridByBillingNameActionGroup"> + <annotations> + <description>Goes to the Admin Orders page. Filters the grid based on the provided Customer.</description> + </annotations> + <arguments> + <argument name="customer"/> + </arguments> + + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderGridPage"/> + <waitForPageLoad stepKey="waitForOrderGridLoad"/> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> + <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openOrderGridFilters"/> + <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('billing_name')}}" userInput="{{customer.fullname}}" stepKey="fillBillToNameFilter"/> + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickOrderApplyFilters"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByIdActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByIdActionGroup.xml new file mode 100644 index 0000000000000..bbab664809cdd --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByIdActionGroup.xml @@ -0,0 +1,30 @@ +<?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"> + <!--Filter order grid by order id field--> + <actionGroup name="FilterOrderGridByIdActionGroup"> + <annotations> + <description>Goes to the Admin Orders page. Filters the grid based on the provided Order ID.</description> + </annotations> + <arguments> + <argument name="orderId" type="string"/> + </arguments> + + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderGridPage"/> + <waitForPageLoad stepKey="waitForOrdersPage"/> + <conditionalClick selector="{{AdminOrdersGridSection.clearFilters}}" dependentSelector="{{AdminOrdersGridSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> + <waitForPageLoad stepKey="waitForClearFilters"/> + <click selector="{{AdminOrdersGridSection.filters}}" stepKey="openOrderGridFilters"/> + <waitForPageLoad stepKey="waitForClickFilters"/> + <fillField selector="{{AdminOrdersGridSection.idFilter}}" userInput="{{orderId}}" stepKey="fillOrderIdFilter"/> + <click selector="{{AdminOrdersGridSection.applyFilters}}" stepKey="clickOrderApplyFilters"/> + <waitForPageLoad stepKey="waitForApplyFilters"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByPurchaseDateActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByPurchaseDateActionGroup.xml new file mode 100644 index 0000000000000..538faf1327b35 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByPurchaseDateActionGroup.xml @@ -0,0 +1,26 @@ +<?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="FilterOrderGridByPurchaseDateActionGroup"> + <annotations> + <description>Goes to the Admin Orders page. Filters the grid based on the provided Purchased Date From/To values.</description> + </annotations> + <arguments> + <argument name="from"/> + <argument name="to"/> + </arguments> + + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> + <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openOrderGridFilters"/> + <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('created_at[from]')}}" userInput="{{from}}" stepKey="fillOrderPurchaseDateFrom"/> + <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('created_at[to]')}}" userInput="{{to}}" stepKey="fillOrderPurchaseDateTo"/> + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFilters"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByStatusActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByStatusActionGroup.xml new file mode 100644 index 0000000000000..05731e06c6228 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByStatusActionGroup.xml @@ -0,0 +1,24 @@ +<?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="FilterOrderGridByStatusActionGroup"> + <annotations> + <description>Filters the Admin Orders grid based on the provided Order Status.</description> + </annotations> + <arguments> + <argument name="status"/> + </arguments> + + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> + <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openOrderGridFilters"/> + <selectOption selector="{{AdminDataGridHeaderSection.filterFieldSelect('status')}}" userInput="{{status}}" stepKey="fillOrderStatusFilter"/> + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFilters"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/GoToInvoiceIntoOrderActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/GoToInvoiceIntoOrderActionGroup.xml new file mode 100644 index 0000000000000..15c7f3e9a7022 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/GoToInvoiceIntoOrderActionGroup.xml @@ -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="GoToInvoiceIntoOrderActionGroup"> + <annotations> + <description>Clicks on 'Invoice' on the Admin Orders view page. Validates that the URL and Page Title are correct.</description> + </annotations> + + <click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceAction"/> + <seeInCurrentUrl url="{{AdminInvoiceNewPage.url}}" stepKey="seeOrderInvoiceUrl"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seePageNameNewInvoicePage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageExistingCustomerActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageExistingCustomerActionGroup.xml new file mode 100644 index 0000000000000..a8f9d61ad6803 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageExistingCustomerActionGroup.xml @@ -0,0 +1,39 @@ +<?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="NavigateToNewOrderPageExistingCustomerActionGroup"> + <annotations> + <description>Goes tot he Admin Orders grid page. Clicks on 'Create New Order'. Filters the grid for the provided Customer. Clicks on the Customer. Selects the provided Store View, if present. Validates that the Page Title is present and correct.</description> + </annotations> + <arguments> + <argument name="customer"/> + <argument name="storeView" defaultValue="_defaultStore"/> + </arguments> + + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/> + <waitForPageLoad stepKey="waitForIndexPageLoad"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/> + <click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/> + <waitForPageLoad stepKey="waitForCustomerGridLoad"/> + + <!--Clear grid filters--> + <conditionalClick selector="{{AdminOrderCustomersGridSection.resetButton}}" dependentSelector="{{AdminOrderCustomersGridSection.resetButton}}" visible="true" stepKey="clearExistingCustomerFilters"/> + <fillField userInput="{{customer.email}}" selector="{{AdminOrderCustomersGridSection.emailInput}}" stepKey="filterEmail"/> + <click selector="{{AdminOrderCustomersGridSection.apply}}" stepKey="applyFilter"/> + <waitForPageLoad stepKey="waitForFilteredCustomerGridLoad"/> + <click selector="{{AdminOrderCustomersGridSection.firstRow}}" stepKey="clickOnCustomer"/> + <waitForPageLoad stepKey="waitForCreateOrderPageLoad"/> + + <!-- Select store view if appears --> + <conditionalClick selector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" dependentSelector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" visible="true" stepKey="selectStoreViewIfAppears"/> + <waitForPageLoad stepKey="waitForCreateOrderPageLoadAfterStoreSelect"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageExistingCustomerAndStoreActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageExistingCustomerAndStoreActionGroup.xml new file mode 100644 index 0000000000000..08f70f69013f3 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageExistingCustomerAndStoreActionGroup.xml @@ -0,0 +1,22 @@ +<?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="NavigateToNewOrderPageExistingCustomerAndStoreActionGroup" extends="navigateToNewOrderPageExistingCustomer"> + <annotations> + <description>EXTENDS: navigateToNewOrderPageExistingCustomer. Clicks on the provided Store View.</description> + </annotations> + <arguments> + <argument name="storeView" defaultValue="_defaultStore"/> + </arguments> + + <click selector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" stepKey="selectStoreView" after="waitForCreateOrderPageLoad"/> + <waitForPageLoad stepKey="waitForLoad" after="selectStoreView"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageNewCustomerActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageNewCustomerActionGroup.xml new file mode 100644 index 0000000000000..73a4da42eb093 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageNewCustomerActionGroup.xml @@ -0,0 +1,29 @@ +<?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"> + <!--Navigate to create order page (New Order -> Create New Customer)--> + <actionGroup name="NavigateToNewOrderPageNewCustomerActionGroup"> + <annotations> + <description>Goes to the Admin Orders grid page. Clicks on 'Create New Order'. Clicks on 'Create New Customer'. Select the provided Store View, if present. Validates that Page Title is present and correct.</description> + </annotations> + <arguments> + <argument name="storeView" defaultValue="_defaultStore"/> + </arguments> + + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/> + <waitForPageLoad stepKey="waitForIndexPageLoad"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/> + <click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/> + <click selector="{{AdminOrderFormActionSection.CreateNewCustomer}}" stepKey="clickCreateCustomer"/> + <conditionalClick selector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" dependentSelector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" visible="true" stepKey="selectStoreViewIfAppears"/> + <waitForPageLoad stepKey="waitForCreateOrderPageLoadAfterStoreSelect"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageNewCustomerSingleStoreActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageNewCustomerSingleStoreActionGroup.xml new file mode 100644 index 0000000000000..cd1be0ac34279 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageNewCustomerSingleStoreActionGroup.xml @@ -0,0 +1,26 @@ +<?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="NavigateToNewOrderPageNewCustomerSingleStoreActionGroup"> + <annotations> + <description>Goes to the Admin Orders grid page. Clicks on 'Create New Order'. Clicks on 'Create New Customer'. Validates that Page Title is present and correct.</description> + </annotations> + <arguments> + <argument name="storeView" defaultValue="_defaultStore"/> + </arguments> + + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/> + <waitForPageLoad stepKey="waitForIndexPageLoad"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/> + <click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/> + <click selector="{{AdminOrderFormActionSection.CreateNewCustomer}}" stepKey="clickCreateCustomer"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/NewAddConfigurableProductToOrderActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/NewAddConfigurableProductToOrderActionGroup.xml new file mode 100644 index 0000000000000..20f2ab162688d --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/NewAddConfigurableProductToOrderActionGroup.xml @@ -0,0 +1,16 @@ +<?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="NewAddConfigurableProductToOrderActionGroup" extends="AddConfigurableProductToOrderActionGroup"> + <remove keyForRemoval="waitForConfigurablePopover"/> + <remove keyForRemoval="selectionConfigurableOption"/> + <selectOption selector="{{AdminOrderFormConfigureProductSection.selectOption}}" userInput="{{option.value}}" stepKey="selectOption" after="waitForOptionsToLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/OpenOrderByIdActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/OpenOrderByIdActionGroup.xml new file mode 100644 index 0000000000000..ca05041140f47 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/OpenOrderByIdActionGroup.xml @@ -0,0 +1,19 @@ +<?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="OpenOrderByIdActionGroup" extends="FilterOrderGridByIdActionGroup"> + <annotations> + <description>EXTENDS: filterOrderGridById. Clicks on the 1st row of the Admin Orders grid.</description> + </annotations> + + <click selector="{{AdminDataGridTableSection.firstRow}}" after="clickOrderApplyFilters" stepKey="openOrderViewPage"/> + <waitForPageLoad after="openOrderViewPage" stepKey="waitForOrderViewPageOpened"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/OrderSelectFlatRateShippingActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/OrderSelectFlatRateShippingActionGroup.xml new file mode 100644 index 0000000000000..b85dc21e0b1b5 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/OrderSelectFlatRateShippingActionGroup.xml @@ -0,0 +1,22 @@ +<?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="OrderSelectFlatRateShippingActionGroup"> + <annotations> + <description>Selects the 'Flat Rate' Shipping Method on the Admin 'Create New Order for' page.</description> + </annotations> + + <click selector="{{AdminOrderFormPaymentSection.header}}" stepKey="unfocus"/> + <waitForPageLoad stepKey="waitForJavascriptToFinish"/> + <click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickShippingMethods"/> + <waitForElementVisible selector="{{AdminOrderFormPaymentSection.flatRateOption}}" stepKey="waitForShippingOptions"/> + <selectOption selector="{{AdminOrderFormPaymentSection.flatRateOption}}" userInput="flatrate_flatrate" stepKey="checkFlatRate"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/OrderSelectFreeShippingActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/OrderSelectFreeShippingActionGroup.xml new file mode 100644 index 0000000000000..ef78fe892e933 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/OrderSelectFreeShippingActionGroup.xml @@ -0,0 +1,22 @@ +<?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="OrderSelectFreeShippingActionGroup"> + <annotations> + <description>Selects the 'Free Shipping' Shipping Method on the Admin 'Create New Order for' page.</description> + </annotations> + + <click selector="{{AdminOrderFormPaymentSection.header}}" stepKey="unfocus"/> + <waitForPageLoad stepKey="waitForJavascriptToFinish"/> + <click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickShippingMethods"/> + <waitForElementVisible selector="{{AdminOrderFormPaymentSection.freeShippingOption}}" stepKey="waitForShippingOptions"/> + <selectOption selector="{{AdminOrderFormPaymentSection.freeShippingOption}}" userInput="freeshipping_freeshipping" stepKey="checkFreeShipping"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/SeeProductInInvoiceItemsActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SeeProductInInvoiceItemsActionGroup.xml new file mode 100644 index 0000000000000..0d35414617ff8 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SeeProductInInvoiceItemsActionGroup.xml @@ -0,0 +1,21 @@ +<?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="SeeProductInInvoiceItemsActionGroup"> + <annotations> + <description>Validates that the provided Product appears under the 'SKU' column in the Admin Invoices edit page.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <see selector="{{AdminInvoiceItemsSection.skuColumn}}" userInput="{{product.sku}}" stepKey="seeProductSkuInGrid"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/SeeProductInItemsOrderedActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SeeProductInItemsOrderedActionGroup.xml new file mode 100644 index 0000000000000..05328ab046bf8 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SeeProductInItemsOrderedActionGroup.xml @@ -0,0 +1,21 @@ +<?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="SeeProductInItemsOrderedActionGroup"> + <annotations> + <description>Validates that the provided Product is present and correct in the 'Items Ordered' section on the Admin Orders view page.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <see selector="{{AdminOrderItemsOrderedSection.productSkuColumn}}" userInput="{{product.sku}}" stepKey="seeSkuInItemsOrdered"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/SeeProductInItemsRefundedActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SeeProductInItemsRefundedActionGroup.xml new file mode 100644 index 0000000000000..0690a190d3f0f --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SeeProductInItemsRefundedActionGroup.xml @@ -0,0 +1,21 @@ +<?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="SeeProductInItemsRefundedActionGroup"> + <annotations> + <description>Validates that the provided Product appears in the 'Product' column on the Admin Credit Memo view page.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <see selector="{{AdminCreditMemoItemsSection.skuColumn}}" userInput="{{product.sku}}" stepKey="seeProductSkuInGrid"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/SelectBankTransferPaymentMethodActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SelectBankTransferPaymentMethodActionGroup.xml new file mode 100644 index 0000000000000..8c1ceeb97201d --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SelectBankTransferPaymentMethodActionGroup.xml @@ -0,0 +1,15 @@ +<?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="SelectBankTransferPaymentMethodActionGroup" extends="SelectCheckMoneyPaymentMethodActionGroup"> + <remove keyForRemoval="checkCheckMoneyOption"/> + <conditionalClick selector="{{AdminOrderFormPaymentSection.checkBankTransfer}}" dependentSelector="{{AdminOrderFormPaymentSection.checkBankTransfer}}" visible="true" stepKey="checkBankTransferOption" after="waitForPaymentOptions"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/SelectCashOnDeliveryPaymentMethodActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SelectCashOnDeliveryPaymentMethodActionGroup.xml new file mode 100644 index 0000000000000..dc6d8d4a8ffaf --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SelectCashOnDeliveryPaymentMethodActionGroup.xml @@ -0,0 +1,15 @@ +<?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="SelectCashOnDeliveryPaymentMethodActionGroup" extends="SelectCheckMoneyPaymentMethodActionGroup"> + <remove keyForRemoval="checkCheckMoneyOption"/> + <conditionalClick selector="{{AdminOrderFormPaymentSection.checkCashOnDelivery}}" dependentSelector="{{AdminOrderFormPaymentSection.checkCashOnDelivery}}" visible="true" stepKey="checkCashOnDeliveryOption" after="waitForPaymentOptions"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/SelectCheckMoneyPaymentMethodActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SelectCheckMoneyPaymentMethodActionGroup.xml new file mode 100644 index 0000000000000..044a7fa9f8b3b --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SelectCheckMoneyPaymentMethodActionGroup.xml @@ -0,0 +1,19 @@ +<?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="SelectCheckMoneyPaymentMethodActionGroup"> + <annotations> + <description>Selects the 'Check / Money Order' Payment Method on the Admin Create New Order page.</description> + </annotations> + + <waitForElementVisible selector="{{AdminOrderFormPaymentSection.paymentBlock}}" stepKey="waitForPaymentOptions"/> + <conditionalClick selector="{{AdminOrderFormPaymentSection.checkMoneyOption}}" dependentSelector="{{AdminOrderFormPaymentSection.checkMoneyOption}}" visible="true" stepKey="checkCheckMoneyOption"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/SelectPurchaseOrderPaymentMethodActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SelectPurchaseOrderPaymentMethodActionGroup.xml new file mode 100644 index 0000000000000..c9502afb3777f --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SelectPurchaseOrderPaymentMethodActionGroup.xml @@ -0,0 +1,19 @@ +<?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="SelectPurchaseOrderPaymentMethodActionGroup" extends="SelectCheckMoneyPaymentMethodActionGroup"> + <arguments> + <argument name="purchaseOrderNumber" type="string"/> + </arguments> + <remove keyForRemoval="checkCheckMoneyOption"/> + <conditionalClick selector="{{AdminOrderFormPaymentSection.checkPurchaseOrder}}" dependentSelector="{{AdminOrderFormPaymentSection.checkPurchaseOrder}}" visible="true" stepKey="checkPurchaseOrderOption" after="waitForPaymentOptions"/> + <fillField selector="{{AdminOrderFormPaymentSection.fieldPurchaseOrderNumber}}" userInput="{{purchaseOrderNumber}}" stepKey="fillPurchaseOrderNumber"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/StartCreateInvoiceFromOrderPageActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/StartCreateInvoiceFromOrderPageActionGroup.xml new file mode 100644 index 0000000000000..25906e895726d --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/StartCreateInvoiceFromOrderPageActionGroup.xml @@ -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="StartCreateInvoiceFromOrderPageActionGroup"> + <annotations> + <description>Clicks on 'Invoice' on the Admin Orders view page. Validates that the URL and Page Title are correct.</description> + </annotations> + + <click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceAction"/> + <seeInCurrentUrl url="{{AdminInvoiceNewPage.url}}" stepKey="seeNewInvoiceUrl"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seeNewInvoicePageTitle"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/StartToCreateCreditMemoActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/StartToCreateCreditMemoActionGroup.xml new file mode 100644 index 0000000000000..fbfdf4979fda8 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/StartToCreateCreditMemoActionGroup.xml @@ -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="StartToCreateCreditMemoActionGroup"> + <arguments> + <argument name="orderId" type="string"/> + </arguments> + <amOnPage url="{{AdminOrderPage.url(orderId)}}" stepKey="navigateToOrderPage"/> + <click selector="{{AdminOrderDetailsMainActionsSection.creditMemo}}" stepKey="clickCreditMemo"/> + <waitForElementVisible selector="{{AdminHeaderSection.pageTitle}}" stepKey="waitForPageTitle"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Memo" stepKey="seeNewMemoPageTitle"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/SubmitCreditMemoActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SubmitCreditMemoActionGroup.xml new file mode 100644 index 0000000000000..fbd2a0047d558 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SubmitCreditMemoActionGroup.xml @@ -0,0 +1,19 @@ +<?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="SubmitCreditMemoActionGroup"> + <grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="grabOrderId"/> + <waitForElementVisible selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="waitButtonEnabled"/> + <click selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="clickSubmitCreditMemo"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForMessageAppears"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You created the credit memo." stepKey="seeCreditMemoCreateSuccess"/> + <seeInCurrentUrl url="{{AdminOrderDetailsPage.url}}$grabOrderId" stepKey="seeViewOrderPageCreditMemo"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/SubmitInvoiceActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SubmitInvoiceActionGroup.xml new file mode 100644 index 0000000000000..2ff4dd210a187 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SubmitInvoiceActionGroup.xml @@ -0,0 +1,22 @@ +<?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="SubmitInvoiceActionGroup"> + <annotations> + <description>Clicks on 'Submit Invoice' on the Admin 'New Invoice' page. Validates that the Success Message is present and correct. Validates that the Order ID appears in the URL.</description> + </annotations> + + <click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForMessageAppears"/> + <see selector="{{AdminMessagesSection.success}}" userInput="The invoice has been created." stepKey="seeInvoiceCreateSuccess"/> + <grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="grabOrderId"/> + <seeInCurrentUrl url="{{AdminOrderDetailsPage.url('$grabOrderId')}}" stepKey="seeViewOrderPageInvoice"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/UpdateCreditMemoTotalsActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/UpdateCreditMemoTotalsActionGroup.xml new file mode 100644 index 0000000000000..18707a39853a3 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/UpdateCreditMemoTotalsActionGroup.xml @@ -0,0 +1,15 @@ +<?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="UpdateCreditMemoTotalsActionGroup"> + <waitForElementVisible selector="{{AdminCreditMemoTotalSection.updateTotals}}" stepKey="waitUpdateTotalsButtonEnabled"/> + <click selector="{{AdminCreditMemoTotalSection.updateTotals}}" stepKey="clickUpdateTotals"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/VerifyBasicInvoiceInformationActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/VerifyBasicInvoiceInformationActionGroup.xml new file mode 100644 index 0000000000000..431e5e7dbfee1 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/VerifyBasicInvoiceInformationActionGroup.xml @@ -0,0 +1,35 @@ +<?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"> + <!--Check customer information is correct in invoice--> + <actionGroup name="VerifyBasicInvoiceInformationActionGroup"> + <annotations> + <description>Validates that the provided Customer, Address and Customer Group details are present and correct on the Admin View Invoice page.</description> + </annotations> + <arguments> + <argument name="customer"/> + <argument name="shippingAddress"/> + <argument name="billingAddress"/> + <argument name="customerGroup" defaultValue="GeneralCustomerGroup"/> + </arguments> + + <see selector="{{AdminInvoiceOrderInformationSection.customerName}}" userInput="{{customer.firstname}}" stepKey="seeCustomerName"/> + <see selector="{{AdminInvoiceOrderInformationSection.customerEmail}}" userInput="{{customer.email}}" stepKey="seeCustomerEmail"/> + <see selector="{{AdminInvoiceOrderInformationSection.customerGroup}}" userInput="{{customerGroup.code}}" stepKey="seeCustomerGroup"/> + <see selector="{{AdminInvoiceAddressInformationSection.billingAddress}}" userInput="{{billingAddress.street[0]}}" stepKey="seeBillingAddressStreet"/> + <see selector="{{AdminInvoiceAddressInformationSection.billingAddress}}" userInput="{{billingAddress.city}}" stepKey="seeBillingAddressCity"/> + <see selector="{{AdminInvoiceAddressInformationSection.billingAddress}}" userInput="{{billingAddress.country_id}}" stepKey="seeBillingAddressCountry"/> + <see selector="{{AdminInvoiceAddressInformationSection.billingAddress}}" userInput="{{billingAddress.postcode}}" stepKey="seeBillingAddressPostcode"/> + <see selector="{{AdminInvoiceAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.street[0]}}" stepKey="seeShippingAddressStreet"/> + <see selector="{{AdminInvoiceAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.city}}" stepKey="seeShippingAddressCity"/> + <see selector="{{AdminInvoiceAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.country_id}}" stepKey="seeShippingAddressCountry"/> + <see selector="{{AdminInvoiceAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.postcode}}" stepKey="seeShippingAddressPostcode"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/VerifyBasicOrderInformationActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/VerifyBasicOrderInformationActionGroup.xml new file mode 100644 index 0000000000000..412586739006b --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/VerifyBasicOrderInformationActionGroup.xml @@ -0,0 +1,34 @@ +<?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="VerifyBasicOrderInformationActionGroup"> + <annotations> + <description>Validates that the provided Customer, Shipping/Billing Address and Customer Group are present and correct on the Admin Orders view page.</description> + </annotations> + <arguments> + <argument name="customer"/> + <argument name="shippingAddress"/> + <argument name="billingAddress"/> + <argument name="customerGroup" defaultValue="GeneralCustomerGroup"/> + </arguments> + + <see selector="{{AdminOrderDetailsInformationSection.customerName}}" userInput="{{customer.firstname}}" stepKey="seeCustomerName"/> + <see selector="{{AdminOrderDetailsInformationSection.customerEmail}}" userInput="{{customer.email}}" stepKey="seeCustomerEmail"/> + <see selector="{{AdminOrderDetailsInformationSection.customerGroup}}" userInput="{{customerGroup.code}}" stepKey="seeCustomerGroup"/> + <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.street[0]}}" stepKey="seeBillingAddressStreet"/> + <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.city}}" stepKey="seeBillingAddressCity"/> + <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.country_id}}" stepKey="seeBillingAddressCountry"/> + <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.postcode}}" stepKey="seeBillingAddressPostcode"/> + <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.street[0]}}" stepKey="seeShippingAddressStreet"/> + <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.city}}" stepKey="seeShippingAddressCity"/> + <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.country_id}}" stepKey="seeShippingAddressCountry"/> + <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.postcode}}" stepKey="seeShippingAddressPostcode"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/VerifyCreatedOrderInformationActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/VerifyCreatedOrderInformationActionGroup.xml new file mode 100644 index 0000000000000..9a62771fb54cd --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/VerifyCreatedOrderInformationActionGroup.xml @@ -0,0 +1,21 @@ +<?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="VerifyCreatedOrderInformationActionGroup"> + <annotations> + <description>Validates that the Success Message, Order Status (Pending) and Order ID are present and correct.</description> + </annotations> + + <see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="You created the order." stepKey="seeSuccessMessage"/> + <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Pending" stepKey="seeOrderPendingStatus" after="seeSuccessMessage"/> + <grabTextFrom selector="|Order # (\d+)|" stepKey="getOrderId" after="seeOrderPendingStatus"/> + <assertNotEmpty actual="$getOrderId" stepKey="assertOrderIdIsNotEmpty" after="getOrderId"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml index e405173429b2c..ec518c79a0808 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml @@ -42,11 +42,11 @@ </after> <!--Proceed to Admin panel > SALES > Orders. Created order should be in Processing status--> - <actionGroup ref="navigateToNewOrderPageNewCustomer" stepKey="navigateToNewOrderPage"/> + <actionGroup ref="NavigateToNewOrderPageNewCustomerActionGroup" stepKey="navigateToNewOrderPage"/> <!--Check if order can be submitted without the required fields including email address--> <scrollToTopOfPage stepKey="scrollToTopOfOrderFormPage"/> - <actionGroup ref="addSimpleProductToOrder" stepKey="addFirstProductToOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addFirstProductToOrder"> <argument name="product" value="$$createProduct$$"/> </actionGroup> @@ -61,20 +61,20 @@ <fillField selector="{{AdminOrderFormAccountSection.email}}" userInput="{{Simple_US_Customer.email}}" stepKey="fillCustomerEmail"/> <!--Fill customer address information--> - <actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerAddress"> + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerAddress"> <argument name="customer" value="Simple_US_Customer"/> <argument name="address" value="US_Address_TX"/> </actionGroup> <!-- Select Free shipping --> - <actionGroup ref="orderSelectFreeShipping" stepKey="selectFreeShippingOption"/> + <actionGroup ref="OrderSelectFreeShippingActionGroup" stepKey="selectFreeShippingOption"/> <!--Click *Submit Order* button--> <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="clickSubmitOrder"/> <!--Click *Invoice* button--> - <actionGroup ref="StartCreateInvoiceFromOrderPage" stepKey="startCreateInvoice"/> - <actionGroup ref="SubmitInvoice" stepKey="submitInvoice"/> + <actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="startCreateInvoice"/> + <actionGroup ref="SubmitInvoiceActionGroup" stepKey="submitInvoice"/> <!--Verify that *Credit Memo* button is displayed--> <seeElement selector="{{AdminOrderFormItemsSection.creditMemo}}" stepKey="seeCreditMemo"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithBankTransferPaymentMethodTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithBankTransferPaymentMethodTest.xml index 74cf3e9dd6b7a..726b4a99cdec9 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithBankTransferPaymentMethodTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithBankTransferPaymentMethodTest.xml @@ -44,12 +44,12 @@ </after> <!--Create new customer order--> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$simpleCustomer$$"/> </actionGroup> <!--Add Simple product to order--> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToTheOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToTheOrder"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> @@ -64,11 +64,11 @@ <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="submitOrder"/> <!-- Verify order information --> - <actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/> + <actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/> <grabTextFrom selector="|Order # (\d+)|" stepKey="orderId"/> <!-- Cancel the Order --> - <actionGroup ref="cancelPendingOrder" stepKey="cancelPendingOrder"/> + <actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelPendingOrder"/> <!--Log in to Storefront as Customer --> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="signUp"> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCashOnDeliveryPaymentMethodTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCashOnDeliveryPaymentMethodTest.xml index a412adee939d2..eb46621a458ab 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCashOnDeliveryPaymentMethodTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCashOnDeliveryPaymentMethodTest.xml @@ -44,12 +44,12 @@ </after> <!-- Create new customer order --> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$simpleCustomer$$"/> </actionGroup> <!-- Add Simple product to order --> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToTheOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToTheOrder"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> @@ -64,11 +64,11 @@ <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="submitOrder"/> <!--Verify order information--> - <actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/> + <actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/> <grabTextFrom selector="|Order # (\d+)|" stepKey="orderId"/> <!-- Cancel the Order --> - <actionGroup ref="cancelPendingOrder" stepKey="cancelPendingOrder"/> + <actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelPendingOrder"/> <!--Log in to Storefront as Customer --> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="signUp"> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml index 116b8e7d6ca71..f8bec3f450963 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml @@ -111,30 +111,30 @@ </after> <!-- Create new customer order --> <comment userInput="Create new customer order" stepKey="createNewCustomerOrderComment"/> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$simpleCustomer$$"/> </actionGroup> <!-- Add bundle product to order and check product price in grid --> <comment userInput="Add bundle product to order and check product price in grid" stepKey="addBundleProductToOrderComment"/> - <actionGroup ref="addBundleProductToOrder" stepKey="addBundleProductToOrder"> + <actionGroup ref="AddBundleProductToOrderActionGroup" stepKey="addBundleProductToOrder"> <argument name="product" value="$$createBundleProduct$$"/> <argument name="quantity" value="1"/> </actionGroup> <!-- Add configurable product to order --> <comment userInput="Add configurable product to order" stepKey="addConfigurableProductToOrderComment"/> - <actionGroup ref="newAddConfigurableProductToOrder" stepKey="addConfigurableProductToOrder"> + <actionGroup ref="NewAddConfigurableProductToOrderActionGroup" stepKey="addConfigurableProductToOrder"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="attribute" value="$$createConfigProductAttribute$$"/> <argument name="option" value="$$getConfigAttributeOption1$$"/> </actionGroup> <!-- Add Simple product to order --> <comment userInput="Add Simple product to order" stepKey="addSimpleProductToOrderComment"/> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToTheOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToTheOrder"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> <!-- Add Virtual product to order --> <comment userInput="Add Virtual product to order" stepKey="addVirtualProductToOrderComment"/> - <actionGroup ref="addSimpleProductToOrder" stepKey="addVirtualProductToTheOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addVirtualProductToTheOrder"> <argument name="product" value="$$virtualProduct$$"/> </actionGroup> <!-- Select FlatRate shipping method --> @@ -145,11 +145,11 @@ <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="submitOrder"/> <!-- Verify order information --> <comment userInput="Verify order information" stepKey="verifyOrderInformationComment"/> - <actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/> + <actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/> <grabTextFrom selector="|Order # (\d+)|" stepKey="orderId"/> <!-- Cancel the Order --> <comment userInput="Cancel the Order" stepKey="cancelTheOrder"/> - <actionGroup ref="cancelPendingOrder" stepKey="cancelPendingOrder"/> + <actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelPendingOrder"/> <!-- Assert Simple Product Quantity in backend after order Canceled --> <comment userInput="Assert Simple Product Quantity in backend after order Canceled" stepKey="assertSimpleProductQuantityAfterOrderCanceledComment"/> <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheProduct"> @@ -216,7 +216,7 @@ <waitForPageLoad stepKey="waitForPageLoad5"/> <!-- Filter order using orderId --> <comment userInput="Filter order using orderId" stepKey="filterOrderUsingOrderIdComment"/> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$orderId"/> </actionGroup> <see selector="{{AdminOrdersGridSection.firstRow}}" userInput="$orderId" stepKey="seeOrderIdInGrid"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithProductQtyWithoutStockDecreaseTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithProductQtyWithoutStockDecreaseTest.xml index 4300f22c3fb3a..1ab921ac2b09d 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithProductQtyWithoutStockDecreaseTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithProductQtyWithoutStockDecreaseTest.xml @@ -47,12 +47,12 @@ </after> <!--Create new customer order--> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$simpleCustomer$$"/> </actionGroup> <!--Add Simple product to order--> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToTheOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToTheOrder"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> @@ -63,7 +63,7 @@ <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="submitOrder"/> <!--Verify order information--> - <actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/> + <actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/> <grabTextFrom selector="|Order # (\d+)|" stepKey="orderId"/> <!-- Assert Simple Product Quantity in backend after order --> @@ -80,13 +80,13 @@ <waitForPageLoad stepKey="waitForPageLoad5"/> <!-- Filter Order using orderId --> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$orderId"/> </actionGroup> <click selector="{{AdminOrdersGridSection.rowViewAction('1')}}" stepKey="clickOnViewAction"/> <!-- Cancel the Order --> - <actionGroup ref="cancelPendingOrder" stepKey="cancelPendingOrder"/> + <actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelPendingOrder"/> <!-- Assert Simple Product Quantity in backend after Cancelling the order --> <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheProduct1"> @@ -102,7 +102,7 @@ <waitForPageLoad stepKey="waitForPageLoad6"/> <!-- Filter Order using orderId --> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById1"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById1"> <argument name="orderId" value="$orderId"/> </actionGroup> <click selector="{{AdminOrdersGridSection.rowViewAction('1')}}" stepKey="clickOnViewAction1"/> @@ -122,4 +122,4 @@ <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="10" stepKey="seeProductQuantityAfterReorder"/> <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="In Stock" stepKey="seeProductStockStatusAfterReorder"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithPurchaseOrderPaymentMethodTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithPurchaseOrderPaymentMethodTest.xml index d14987dd2e87b..c85a3fffc2c69 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithPurchaseOrderPaymentMethodTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithPurchaseOrderPaymentMethodTest.xml @@ -46,12 +46,12 @@ </after> <!--Create new customer order--> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$simpleCustomer$$"/> </actionGroup> <!--Add Simple product to order--> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToTheOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToTheOrder"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> @@ -70,11 +70,11 @@ <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="submitOrder"/> <!--Verify order information--> - <actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/> + <actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/> <grabTextFrom selector="|Order # (\d+)|" stepKey="orderId"/> <!-- Cancel the Order --> - <actionGroup ref="cancelPendingOrder" stepKey="cancelPendingOrder"/> + <actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelPendingOrder"/> <!--Log in to Storefront as Customer --> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="signUp"> @@ -86,4 +86,4 @@ <waitForPageLoad stepKey="waitForOrderDetailsToLoad"/> <seeElement selector="{{StorefrontCustomerOrderViewSection.orderStatusInGrid('$orderId', 'Canceled')}}" stepKey="seeOrderStatusInGrid"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml index f8c5b46dc6ff9..a8014466c5773 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml @@ -49,12 +49,12 @@ </after> <!--Create new customer order--> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$simpleCustomer$$"/> </actionGroup> <!--Add Simple product to order--> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToTheOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToTheOrder"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> @@ -65,11 +65,11 @@ <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="submitOrder"/> <!--Verify order information--> - <actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/> + <actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/> <grabTextFrom selector="|Order # (\d+)|" stepKey="orderId"/> <!-- Cancel the Order --> - <actionGroup ref="cancelPendingOrder" stepKey="cancelPendingOrder"/> + <actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelPendingOrder"/> <!--Log in to Storefront as Customer --> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="signUp"> @@ -81,4 +81,4 @@ <waitForPageLoad stepKey="waitForOrderDetailsToLoad"/> <seeElement selector="{{StorefrontCustomerOrderViewSection.orderStatusInGrid('$orderId', 'Canceled')}}" stepKey="seeOrderStatusInGrid"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminChangeCustomerGroupInNewOrder.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminChangeCustomerGroupInNewOrder.xml index 315a097eb2323..e19002d5ecb4c 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminChangeCustomerGroupInNewOrder.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminChangeCustomerGroupInNewOrder.xml @@ -25,8 +25,8 @@ <after> <actionGroup ref="logout" stepKey="logout"/> </after> - - <actionGroup ref="navigateToNewOrderPageNewCustomer" stepKey="openNewOrder"/> + + <actionGroup ref="NavigateToNewOrderPageNewCustomerActionGroup" stepKey="openNewOrder"/> <selectOption selector="{{AdminOrderFormAccountSection.group}}" userInput="Retailer" stepKey="selectCustomerGroup"/> <waitForPageLoad stepKey="waitForPageLoad"/> <grabValueFrom selector="{{AdminOrderFormAccountSection.group}}" stepKey="grabGroupValue"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingCreditMemoUpdateTotalsTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingCreditMemoUpdateTotalsTest.xml index 8cd2b8ee60edd..251d29df43dd1 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingCreditMemoUpdateTotalsTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingCreditMemoUpdateTotalsTest.xml @@ -41,9 +41,9 @@ </actionGroup> <grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="grabOrderId"/> <!--Create invoice--> - <actionGroup ref="StartCreateInvoiceFromOrderPage" stepKey="startCreateInvoice"/> + <actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="startCreateInvoice"/> <!--Submit invoice--> - <actionGroup ref="SubmitInvoice" stepKey="submitInvoice"/> + <actionGroup ref="SubmitInvoiceActionGroup" stepKey="submitInvoice"/> <!--Create Credit Memo--> <actionGroup ref="StartToCreateCreditMemoActionGroup" stepKey="startToCreateCreditMemo"> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingDateAfterChangeInterfaceLocaleTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingDateAfterChangeInterfaceLocaleTest.xml index add8f7d2ae2c3..ad3b6cf45d5bb 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingDateAfterChangeInterfaceLocaleTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingDateAfterChangeInterfaceLocaleTest.xml @@ -51,7 +51,7 @@ <grabTextFrom selector="{{AdminOrderDetailsInformationSection.orderId}}" stepKey="grabOrderId"/> <!--Filter orders grid by ID on Admin page--> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="{$grabOrderId}"/> </actionGroup> @@ -73,7 +73,7 @@ </actionGroup> <!--Filter orders grid by ID on Admin page after changing "Interface Locale"--> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridByIdAfterSetFrenchLocale"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridByIdAfterSetFrenchLocale"> <argument name="orderId" value="{$grabOrderId}"/> </actionGroup> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCorrectnessInvoicedItemInBundleProductTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCorrectnessInvoicedItemInBundleProductTest.xml index 4310d412d1c98..9fded54e73eb7 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCorrectnessInvoicedItemInBundleProductTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCorrectnessInvoicedItemInBundleProductTest.xml @@ -76,16 +76,16 @@ <!--Go to order page submit invoice--> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage"/> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$grabOrderNumber"/> </actionGroup> <click selector="{{AdminOrdersGridSection.firstRow}}" stepKey="clickOrderRow"/> <waitForPageLoad stepKey="waitForCreatedOrderPageOpened"/> - <actionGroup ref="goToInvoiceIntoOrder" stepKey="goToInvoiceIntoOrderPage"/> + <actionGroup ref="GoToInvoiceIntoOrderActionGroup" stepKey="goToInvoiceIntoOrderPage"/> <fillField selector="{{AdminInvoiceItemsSection.qtyToInvoiceColumn}}" userInput="5" stepKey="ChangeQtyToInvoice"/> <click selector="{{AdminInvoiceItemsSection.updateQty}}" stepKey="updateQunatity"/> <waitForPageLoad stepKey="waitPageToBeLoaded"/> - <actionGroup ref="SubmitInvoice" stepKey="submitInvoice"/> + <actionGroup ref="SubmitInvoiceActionGroup" stepKey="submitInvoice"/> <!--Verify invoiced items qty in ship tab--> <actionGroup ref="goToShipmentIntoOrder" stepKey="goToShipment"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoBankTransferPaymentTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoBankTransferPaymentTest.xml index 37a9b97fab064..4b582a09deacf 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoBankTransferPaymentTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoBankTransferPaymentTest.xml @@ -42,17 +42,17 @@ <actionGroup ref="logout" stepKey="logout"/> </after> <!-- Create Order --> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderPage"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderPage"> <argument name="customer" value="$createCustomer$"/> </actionGroup> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSecondProduct"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSecondProduct"> <argument name="product" value="$createProduct$"/> </actionGroup> - <actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerInfo"> + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerInfo"> <argument name="customer" value="$createCustomer$"/> <argument name="address" value="US_Address_TX"/> </actionGroup> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRate"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRate"/> <conditionalClick selector="{{AdminOrderFormPaymentSection.linkPaymentOptions}}" dependentSelector="{{AdminOrderFormPaymentSection.linkPaymentOptions}}" visible="true" stepKey="openMoneyOption"/> <waitForElementVisible selector="{{AdminOrderFormPaymentSection.paymentBlock}}" stepKey="waitForPaymentOptions"/> <checkOption selector="{{AdminOrderFormPaymentSection.checkBankTransfer}}" stepKey="checkBankTransfer"/> @@ -62,7 +62,7 @@ <see stepKey="seeSuccessMessageForOrder" userInput="You created the order."/> <!-- Create Invoice --> - <actionGroup ref="StartCreateInvoiceFromOrderPage" stepKey="startInvoice"/> + <actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="startInvoice"/> <click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/> <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForMessageAppears"/> <see selector="{{AdminMessagesSection.success}}" userInput="The invoice has been created." stepKey="seeInvoiceCreateSuccess"/> @@ -70,7 +70,7 @@ <!-- Go to Sales > Orders > find out placed order and open --> <grabTextFrom selector="|Order # (\d+)|" stepKey="grabOrderId" /> <assertNotEmpty actual="$grabOrderId" stepKey="assertOrderIdIsNotEmpty" after="grabOrderId"/> - <actionGroup ref="OpenOrderById" stepKey="openOrder"> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrder"> <argument name="orderId" value="{$grabOrderId}"/> </actionGroup> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoConfigurableProductTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoConfigurableProductTest.xml index 8a9369537f0a4..2a841b04bd647 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoConfigurableProductTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoConfigurableProductTest.xml @@ -100,28 +100,28 @@ <actionGroup ref="logout" stepKey="logout"/> </after> <!-- Create Order --> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderPage"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderPage"> <argument name="customer" value="$createCustomer$"/> </actionGroup> <!--Add configurable product to order--> - <actionGroup ref="addConfigurableProductToOrderFromAdmin" stepKey="addConfigurableProductToOrder"> + <actionGroup ref="AddConfigurableProductToOrderFromAdminActionGroup" stepKey="addConfigurableProductToOrder"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="attribute" value="$$createConfigProductAttribute$$"/> <argument name="option" value="$$getConfigAttributeOption1$$"/> </actionGroup> - <actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerInfo"> + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerInfo"> <argument name="customer" value="$createCustomer$"/> <argument name="address" value="US_Address_TX"/> </actionGroup> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRate"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRate"/> <click selector="{{OrdersGridSection.submitOrder}}" stepKey="submitOrder"/> <waitForPageLoad stepKey="waitForSubmitOrderPage"/> <see stepKey="seeSuccessMessageForOrder" userInput="You created the order."/> <!-- Create Invoice --> - <actionGroup ref="StartCreateInvoiceFromOrderPage" stepKey="startInvoice"/> + <actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="startInvoice"/> <click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/> <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForMessageAppears"/> <see selector="{{AdminMessagesSection.success}}" userInput="The invoice has been created." stepKey="seeInvoiceCreateSuccess"/> @@ -129,7 +129,7 @@ <!-- Go to Sales > Orders > find out placed order and open --> <grabTextFrom selector="|Order # (\d+)|" stepKey="grabOrderId" /> <assertNotEmpty actual="$grabOrderId" stepKey="assertOrderIdIsNotEmpty" after="grabOrderId"/> - <actionGroup ref="OpenOrderById" stepKey="openOrder"> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrder"> <argument name="orderId" value="{$grabOrderId}"/> </actionGroup> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoPartialRefundTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoPartialRefundTest.xml index 418c0e72dc1fc..acc119b53c9dc 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoPartialRefundTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoPartialRefundTest.xml @@ -40,24 +40,24 @@ <actionGroup ref="logout" stepKey="logout"/> </after> <!-- Create Order --> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderPage"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderPage"> <argument name="customer" value="$createCustomer$"/> </actionGroup> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSecondProduct"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSecondProduct"> <argument name="product" value="$createProduct$"/> <argument name="productQty" value="2"/> </actionGroup> - <actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerInfo"> + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerInfo"> <argument name="customer" value="$createCustomer$"/> <argument name="address" value="US_Address_TX"/> </actionGroup> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRate"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRate"/> <click selector="{{OrdersGridSection.submitOrder}}" stepKey="submitOrder"/> <waitForPageLoad stepKey="waitForSubmitOrderPage"/> <see stepKey="seeSuccessMessageForOrder" userInput="You created the order."/> <!-- Create Invoice --> - <actionGroup ref="StartCreateInvoiceFromOrderPage" stepKey="startInvoice"/> + <actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="startInvoice"/> <click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/> <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForMessageAppears"/> <see selector="{{AdminMessagesSection.success}}" userInput="The invoice has been created." stepKey="seeInvoiceCreateSuccess"/> @@ -65,7 +65,7 @@ <!-- Go to Sales > Orders > find out placed order and open --> <grabTextFrom selector="|Order # (\d+)|" stepKey="grabOrderId" /> <assertNotEmpty actual="$grabOrderId" stepKey="assertOrderIdIsNotEmpty" after="grabOrderId"/> - <actionGroup ref="OpenOrderById" stepKey="openOrder"> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrder"> <argument name="orderId" value="{$grabOrderId}"/> </actionGroup> @@ -102,7 +102,7 @@ <see userInput="1" selector="{{AdminCreditMemoViewItemsSection.productQty}}" stepKey="seeQty"/> <!-- Go to order page --> - <actionGroup ref="OpenOrderById" stepKey="openOrderPage"> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrderPage"> <argument name="orderId" value="{$grabOrderId}"/> </actionGroup> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoWithCashOnDeliveryTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoWithCashOnDeliveryTest.xml index c552f93e62a4a..452c54d188c57 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoWithCashOnDeliveryTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoWithCashOnDeliveryTest.xml @@ -43,17 +43,17 @@ </after> <!-- Create Order --> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderPage"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderPage"> <argument name="customer" value="$createCustomer$"/> </actionGroup> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSecondProduct"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSecondProduct"> <argument name="product" value="$createProduct$"/> </actionGroup> - <actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerInfo"> + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerInfo"> <argument name="customer" value="$createCustomer$"/> <argument name="address" value="US_Address_TX"/> </actionGroup> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRate"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRate"/> <conditionalClick selector="{{AdminOrderFormPaymentSection.linkPaymentOptions}}" dependentSelector="{{AdminOrderFormPaymentSection.linkPaymentOptions}}" visible="true" stepKey="openMoneyOption"/> <waitForElementVisible selector="{{AdminOrderFormPaymentSection.paymentBlock}}" stepKey="waitForPaymentOptions"/> <checkOption selector="{{AdminOrderFormPaymentSection.checkCashOnDelivery}}" stepKey="checkCashOnDelivery"/> @@ -63,7 +63,7 @@ <see stepKey="seeSuccessMessageForOrder" userInput="You created the order."/> <!-- Create Invoice --> - <actionGroup ref="StartCreateInvoiceFromOrderPage" stepKey="startInvoice"/> + <actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="startInvoice"/> <click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/> <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForMessageAppears"/> <see selector="{{AdminMessagesSection.success}}" userInput="The invoice has been created." stepKey="seeInvoiceCreateSuccess"/> @@ -71,7 +71,7 @@ <!-- Go to Sales > Orders > find out placed order and open --> <grabTextFrom selector="|Order # (\d+)|" stepKey="grabOrderId" /> <assertNotEmpty actual="$grabOrderId" stepKey="assertOrderIdIsNotEmpty" after="grabOrderId"/> - <actionGroup ref="OpenOrderById" stepKey="openOrder"> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrder"> <argument name="orderId" value="{$grabOrderId}"/> </actionGroup> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoWithPurchaseOrderTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoWithPurchaseOrderTest.xml index 57d9222d85096..231ff78d7d8fb 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoWithPurchaseOrderTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoWithPurchaseOrderTest.xml @@ -43,17 +43,17 @@ </after> <!-- Create Order --> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderPage"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderPage"> <argument name="customer" value="$createCustomer$"/> </actionGroup> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSecondProduct"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSecondProduct"> <argument name="product" value="$createProduct$"/> </actionGroup> - <actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerInfo"> + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerInfo"> <argument name="customer" value="$createCustomer$"/> <argument name="address" value="US_Address_TX"/> </actionGroup> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRate"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRate"/> <conditionalClick selector="{{AdminOrderFormPaymentSection.linkPaymentOptions}}" dependentSelector="{{AdminOrderFormPaymentSection.linkPaymentOptions}}" visible="true" stepKey="openMoneyOption"/> <waitForElementVisible selector="{{AdminOrderFormPaymentSection.paymentBlock}}" stepKey="waitForPaymentOptions"/> <checkOption selector="{{AdminOrderFormPaymentSection.checkPurchaseOrder}}" stepKey="checkPurchaseOrder"/> @@ -66,7 +66,7 @@ <see stepKey="seeSuccessMessageForOrder" selector="{{AdminIndexManagementSection.successMessage}}" userInput="You created the order."/> <!-- Create Invoice --> - <actionGroup ref="StartCreateInvoiceFromOrderPage" stepKey="startInvoice"/> + <actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="startInvoice"/> <click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/> <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForMessageAppears"/> <see selector="{{AdminMessagesSection.success}}" userInput="The invoice has been created." stepKey="seeInvoiceCreateSuccess"/> @@ -74,7 +74,7 @@ <!-- Go to Sales > Orders > find out placed order and open --> <grabTextFrom selector="|Order # (\d+)|" stepKey="grabOrderId" /> <assertNotEmpty actual="$grabOrderId" stepKey="assertOrderIdIsNotEmpty" after="grabOrderId"/> - <actionGroup ref="OpenOrderById" stepKey="openOrder"> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrder"> <argument name="orderId" value="{$grabOrderId}"/> </actionGroup> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAddProductCheckboxTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAddProductCheckboxTest.xml index bd13f7c847c34..8fe49558cf091 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAddProductCheckboxTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAddProductCheckboxTest.xml @@ -30,7 +30,7 @@ </before> <!-- Initiate create new order --> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$createSimpleCustomer$$"/> </actionGroup> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAndCheckTheReorderTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAndCheckTheReorderTest.xml index 80697fd57736a..338765d650d13 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAndCheckTheReorderTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAndCheckTheReorderTest.xml @@ -28,19 +28,19 @@ </createData> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> </before> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$simpleCustomer$$"/> </actionGroup> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToOrder"> <argument name="product" value="$$simpleProduct$$"/> <argument name="productQty" value="{{SimpleProduct_25.quantity}}"/> </actionGroup> <actionGroup ref="SelectCashOnDeliveryPaymentMethodActionGroup" stepKey="selectPaymentMethod"/> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="orderSelectFlatRateShippingMethod"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="orderSelectFlatRateShippingMethod"/> <actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder"/> - <actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/> + <actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/> <grabTextFrom selector="|Order # (\d+)|" stepKey="getOrderId"/> - <actionGroup ref="OpenOrderById" stepKey="openOrder"> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrder"> <argument name="orderId" value="$getOrderId"/> </actionGroup> <click selector="{{AdminOrderDetailsMainActionsSection.ship}}" stepKey="clickShipAction"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderForCustomerWithTwoAddressesTaxableAndNonTaxableTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderForCustomerWithTwoAddressesTaxableAndNonTaxableTest.xml index d6bf0eec301db..1c35a9e900a8a 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderForCustomerWithTwoAddressesTaxableAndNonTaxableTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderForCustomerWithTwoAddressesTaxableAndNonTaxableTest.xml @@ -36,23 +36,23 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> </before> <!--Step 1: Create new order for customer--> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$simpleCustomer$$"/> </actionGroup> <!--Step 2: Add product1 to the order--> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToOrder"> <argument name="product" value="$$product1$$"/> </actionGroup> <!--Step 2: Select taxable address as billing address--> <selectOption selector="{{AdminOrderFormBillingAddressSection.selectAddress}}" userInput="{{US_Address_CA.state}}" stepKey="selectTaxableAddress" /> <!--Step 3: Select FlatRate shipping method--> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRateShippingMethod"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRateShippingMethod"/> <!--Step 4: Verify that tax is applied to the order--> <seeElement selector="{{AdminOrderFormTotalSection.total('Tax')}}" stepKey="seeTax" /> <!--Step 5: Select non taxable address as billing address--> <selectOption selector="{{AdminOrderFormBillingAddressSection.selectAddress}}" userInput="{{US_Address_TX.state}}" stepKey="selectNonTaxableAddress" /> <!--Step 6: Change shipping method to Free--> - <actionGroup ref="changeShippingMethod" stepKey="changeShippingMethod"> + <actionGroup ref="ChangeShippingMethodActionGroup" stepKey="changeShippingMethod"> <argument name="shippingMethod" value="freeshipping_freeshipping"/> </actionGroup> <!--Step 7: Verify that tax is not applied to the order--> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithBundleProductTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithBundleProductTest.xml index d087b291de87c..1749fcd6c218e 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithBundleProductTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithBundleProductTest.xml @@ -80,25 +80,25 @@ </before> <!--Create new customer order--> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$simpleCustomer$$"/> </actionGroup> <!--Add bundle product to order and check product price in grid--> - <actionGroup ref="addBundleProductToOrderAndCheckPriceInGrid" stepKey="addBundleProductToOrder"> + <actionGroup ref="AddBundleProductToOrderAndCheckPriceInGridActionGroup" stepKey="addBundleProductToOrder"> <argument name="product" value="$$product$$"/> <argument name="quantity" value="1"/> <argument name="price" value="$738.00"/> </actionGroup> <!--Select FlatRate shipping method--> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="orderSelectFlatRateShippingMethod"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="orderSelectFlatRateShippingMethod"/> <!--Submit order--> <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="submitOrder"/> <!--Verify order information--> - <actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/> + <actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/> <after> <actionGroup ref="logout" stepKey="logout"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithMinimumAmountEnabledTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithMinimumAmountEnabledTest.xml index 40b26a6b46045..bfaf31007b10a 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithMinimumAmountEnabledTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithMinimumAmountEnabledTest.xml @@ -37,10 +37,10 @@ <!--Admin creates order--> <comment userInput="Admin creates order" stepKey="adminCreateOrder"/> - <actionGroup ref="navigateToNewOrderPageNewCustomerSingleStore" stepKey="navigateToNewOrderPage"/> + <actionGroup ref="NavigateToNewOrderPageNewCustomerSingleStoreActionGroup" stepKey="navigateToNewOrderPage"/> <conditionalClick selector="{{AdminOrderFormStoreSelectorSection.defaultStoreViewButton}}" dependentSelector="{{AdminOrderFormStoreSelectorSection.storeSelectorContainer}}" visible="true" stepKey="selectFirstStoreViewIfAppears"/> <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskDisappearedAfterStoreSelected"/> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToOrder"> <argument name="product" value="SimpleProduct"/> </actionGroup> @@ -49,15 +49,15 @@ <fillField selector="{{AdminOrderFormAccountSection.email}}" userInput="{{Simple_US_Customer.email}}" stepKey="fillEmail"/> <!--Fill customer address information--> - <actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerAddress"> + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerAddress"> <argument name="customer" value="Simple_US_Customer"/> <argument name="address" value="US_Address_TX"/> </actionGroup> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRateShipping"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRateShipping"/> <!-- Checkout select Check/Money Order payment --> - <actionGroup ref="SelectCheckMoneyPaymentMethod" stepKey="selectCheckMoneyPayment"/> + <actionGroup ref="SelectCheckMoneyPaymentMethodActionGroup" stepKey="selectCheckMoneyPayment"/> <!--Verify totals on Order page--> <see selector="{{AdminOrderFormTotalSection.total('Subtotal')}}" userInput="${{AdminOrderSimpleProduct.subtotal}}" stepKey="seeOrderSubTotal"/> @@ -72,12 +72,12 @@ <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Pending" stepKey="seeOrderPendingStatus"/> <grabTextFrom selector="|Order # (\d+)|" stepKey="orderId"/> <assertNotEmpty actual="$orderId" stepKey="assertOrderIdIsNotEmpty"/> - <actionGroup ref="verifyBasicOrderInformation" stepKey="verifyOrderInformation"> + <actionGroup ref="VerifyBasicOrderInformationActionGroup" stepKey="verifyOrderInformation"> <argument name="customer" value="Simple_US_Customer"/> <argument name="shippingAddress" value="US_Address_TX"/> <argument name="billingAddress" value="US_Address_TX"/> </actionGroup> - <actionGroup ref="seeProductInItemsOrdered" stepKey="seeSimpleProductInItemsOrdered"> + <actionGroup ref="SeeProductInItemsOrderedActionGroup" stepKey="seeSimpleProductInItemsOrdered"> <argument name="product" value="SimpleProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithSelectedShoppingCartItemsTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithSelectedShoppingCartItemsTest.xml index 513fcd7fd2699..58a680ea61c87 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithSelectedShoppingCartItemsTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithSelectedShoppingCartItemsTest.xml @@ -53,12 +53,12 @@ </actionGroup> <!--Step 3: Create new customer order--> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$simpleCustomer$$"/> </actionGroup> <!--Step 4: Add product2 to the order--> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToOrder"> <argument name="product" value="$$product2$$"/> </actionGroup> @@ -66,21 +66,21 @@ <click selector="{{AdminOrderFormShoppingCartSection.addProduct($$product1.name$$)}}" stepKey="selectProduct1InTheShoppingCart"/> <!--Step 6: Select FlatRate shipping method--> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="orderSelectFlatRateShippingMethod"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="orderSelectFlatRateShippingMethod"/> <!--Step 7: Submit order--> <actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder"/> <!--Step 8: Verify order information--> - <actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/> + <actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/> <!--Step 9: Check that product 2 is in the order items list --> - <actionGroup ref="seeProductInItemsOrdered" stepKey="seeProduct2InItemsOrdered"> + <actionGroup ref="SeeProductInItemsOrderedActionGroup" stepKey="seeProduct2InItemsOrdered"> <argument name="product" value="$$product2$$"/> </actionGroup> <!--Step 10: Check that product 1 is not in the order items list --> - <actionGroup ref="dontSeeProductInItemsOrdered" stepKey="dontSeeProduct1InItemsOrdered"> + <actionGroup ref="DontSeeProductInItemsOrderedActionGroup" stepKey="dontSeeProduct1InItemsOrdered"> <argument name="product" value="$$product1$$"/> </actionGroup> <after> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithSimpleProductTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithSimpleProductTest.xml index 85567374e36e4..76f916d55ee92 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithSimpleProductTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithSimpleProductTest.xml @@ -28,19 +28,19 @@ </createData> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> </before> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$simpleCustomer$$"/> </actionGroup> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToOrder"> <argument name="product" value="$$simpleProduct$$"/> <argument name="productQty" value="{{SimpleProduct_25.quantity}}"/> </actionGroup> <actionGroup ref="SelectCashOnDeliveryPaymentMethodActionGroup" stepKey="selectPaymentMethod"/> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="orderSelectFlatRateShippingMethod"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="orderSelectFlatRateShippingMethod"/> <actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder"/> - <actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/> + <actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/> <grabTextFrom selector="|Order # (\d+)|" stepKey="getOrderId"/> - <actionGroup ref="OpenOrderById" stepKey="openOrder"> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrder"> <argument name="orderId" value="$getOrderId"/> </actionGroup> <click selector="{{AdminOrderDetailsMainActionsSection.ship}}" stepKey="clickShipAction"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminFreeShippingNotAvailableIfMinimumOrderAmountNotMatchOrderTotalTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminFreeShippingNotAvailableIfMinimumOrderAmountNotMatchOrderTotalTest.xml index 8bfcaf67c4332..9ff6f3bdac985 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminFreeShippingNotAvailableIfMinimumOrderAmountNotMatchOrderTotalTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminFreeShippingNotAvailableIfMinimumOrderAmountNotMatchOrderTotalTest.xml @@ -41,11 +41,11 @@ <magentoCLI command="cache:flush" stepKey="flushCache2"/> </after> <!--Create new order with existing customer--> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="goToCreateOrderPage"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="goToCreateOrderPage"> <argument name="customer" value="$$createCustomer$$"/> </actionGroup> <!--Add product to order--> - <actionGroup ref="addSimpleProductToOrder" stepKey="addProductToOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addProductToOrder"> <argument name="product" value="$$createProduct$$"/> </actionGroup> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminHoldCreatedOrderTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminHoldCreatedOrderTest.xml index 9e8949c9ba600..5dc5dbf3ab79d 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminHoldCreatedOrderTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminHoldCreatedOrderTest.xml @@ -44,17 +44,17 @@ </after> <!--Create new customer order--> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$simpleCustomer$$"/> </actionGroup> <!--Add Simple product to order--> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToTheOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToTheOrder"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> <!--Add second product to order--> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSecondProductToTheOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSecondProductToTheOrder"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> @@ -65,7 +65,7 @@ <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="submitOrder"/> <!-- Verify order information --> - <actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/> + <actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/> <grabTextFrom selector="|Order # (\d+)|" stepKey="orderId"/> <!-- Hold the Order --> @@ -93,4 +93,4 @@ <waitForPageLoad stepKey="waitForOrderDetailsToLoad"/> <seeElement selector="{{StorefrontCustomerOrderViewSection.orderStatusInGrid('$orderId', 'On Hold')}}" stepKey="seeOrderStatusInGrid"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminProductInTheShoppingCartCouldBeReachedByAdminDuringOrderCreationWithMultiWebsiteConfigTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminProductInTheShoppingCartCouldBeReachedByAdminDuringOrderCreationWithMultiWebsiteConfigTest.xml index b40e9d041a10e..0646fdc5e5090 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminProductInTheShoppingCartCouldBeReachedByAdminDuringOrderCreationWithMultiWebsiteConfigTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminProductInTheShoppingCartCouldBeReachedByAdminDuringOrderCreationWithMultiWebsiteConfigTest.xml @@ -74,7 +74,7 @@ <actionGroup ref="StorefrontAddToTheCartActionGroup" stepKey="addProductToCart"/> <!--Create new order for existing Customer And Store--> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="createNewOrder"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="createNewOrder"> <argument name="customer" value="Simple_US_Customer"/> <argument name="storeView" value="customStore"/> </actionGroup> @@ -90,16 +90,16 @@ </actionGroup> <!--Fill customer address information--> - <actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerAddress"> + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerAddress"> <argument name="customer" value="Simple_US_Customer"/> <argument name="address" value="US_Address_TX"/> </actionGroup> <!--Select shipping method--> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRateShipping"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRateShipping"/> <!--Checkout select Check/Money Order payment--> - <actionGroup ref="SelectCheckMoneyPaymentMethod" stepKey="selectCheckMoneyPayment"/> + <actionGroup ref="SelectCheckMoneyPaymentMethodActionGroup" stepKey="selectCheckMoneyPayment"/> <!--Submit Order and verify information--> <actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml index 587b23e857c0c..fe29c1b63aa33 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml @@ -56,7 +56,7 @@ <!-- Login as admin --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!--Open order by Id--> - <actionGroup ref="OpenOrderById" stepKey="openOrderById"> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrderById"> <argument name="orderId" value="$createGuestCart.return$"/> </actionGroup> <!--Reorder--> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSaveInAddressBookCheckboxStateTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSaveInAddressBookCheckboxStateTest.xml index 650152a191d16..f2341278becba 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSaveInAddressBookCheckboxStateTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSaveInAddressBookCheckboxStateTest.xml @@ -39,12 +39,12 @@ </after> <!-- Create new order and choose an existing customer --> <comment userInput="Create new order and choose an existing customer" stepKey="createOrderAndAddCustomer"/> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderPage"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderPage"> <argument name="customer" value="$$createCustomer$$"/> </actionGroup> <!-- Add simple product to order --> <comment userInput="Add simple product to order" stepKey="addSimpleProdToOrder"/> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToOrder"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> <!-- Just in case uncheck and check 'Same as Billing Address checkbox' --> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitConfigurableProductOrderTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitConfigurableProductOrderTest.xml index 63607e59c41b2..65bba7512e228 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitConfigurableProductOrderTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitConfigurableProductOrderTest.xml @@ -91,35 +91,35 @@ </before> <!--Create new customer order--> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$simpleCustomer$$"/> </actionGroup> <!--Add configurable product to order--> - <actionGroup ref="addConfigurableProductToOrderFromAdmin" stepKey="addConfigurableProductToOrder"> + <actionGroup ref="AddConfigurableProductToOrderFromAdminActionGroup" stepKey="addConfigurableProductToOrder"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="attribute" value="$$createConfigProductAttribute$$"/> <argument name="option" value="$$getConfigAttributeOption1$$"/> </actionGroup> <!--Configure ordered configurable product--> - <actionGroup ref="configureOrderedConfigurableProduct" stepKey="configureOrderedConfigurableProduct"> + <actionGroup ref="ConfigureOrderedConfigurableProductActionGroup" stepKey="configureOrderedConfigurableProduct"> <argument name="attribute" value="$$createConfigProductAttribute$$"/> <argument name="option" value="$$getConfigAttributeOption2$$"/> <argument name="quantity" value="2"/> </actionGroup> <!--Select FlatRate shipping method--> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="orderSelectFlatRateShippingMethod"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="orderSelectFlatRateShippingMethod"/> <!-- Checkout select Check/Money Order payment --> - <actionGroup ref="SelectCheckMoneyPaymentMethod" stepKey="selectCheckMoneyPayment"/> + <actionGroup ref="SelectCheckMoneyPaymentMethodActionGroup" stepKey="selectCheckMoneyPayment"/> <!--Submit order--> <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="submitOrder"/> <!--Verify order information--> - <actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/> + <actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/> <after> <actionGroup ref="logout" stepKey="logout"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml index 255a7a91f9b10..b2d424ca5d7d3 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml @@ -41,10 +41,10 @@ <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/> <!--Check if order can be submitted without the required fields--> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToOrder" after="seeNewOrderPageTitle"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToOrder" after="seeNewOrderPageTitle"> <argument name="product" value="_defaultProduct"/> </actionGroup> - <actionGroup ref="checkRequiredFieldsNewOrderForm" stepKey="checkRequiredFieldsNewOrder" after="addSimpleProductToOrder"/> + <actionGroup ref="CheckRequiredFieldsNewOrderFormActionGroup" stepKey="checkRequiredFieldsNewOrder" after="addSimpleProductToOrder"/> <see selector="{{AdminOrderFormPaymentSection.paymentError}}" userInput="Please select one of the options." stepKey="seePaymentMethodRequired" after="checkRequiredFieldsNewOrder"/> <scrollToTopOfPage stepKey="scrollToTopOfOrderFormPage" after="seePaymentMethodRequired"/> @@ -53,7 +53,7 @@ <fillField selector="{{AdminOrderFormAccountSection.email}}" userInput="{{Simple_US_Customer.email}}" stepKey="fillCustomerEmail" after="selectCustomerGroup"/> <!--Fill customer address information--> - <actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerAddress" after="fillCustomerEmail"> + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerAddress" after="fillCustomerEmail"> <argument name="customer" value="Simple_US_Customer"/> <argument name="address" value="US_Address_TX"/> </actionGroup> @@ -61,7 +61,7 @@ <!-- Select payment and shipping --> <waitForElementVisible selector="{{AdminOrderFormPaymentSection.checkMoneyOption}}" stepKey="waitForPaymentOptions"/> <selectOption selector="{{AdminOrderFormPaymentSection.checkMoneyOption}}" userInput="checkmo" stepKey="checkPaymentOption"/> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRateShipping" after="fillCustomerAddress"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRateShipping" after="fillCustomerAddress"/> <!--Verify totals on Order page--> <see selector="{{AdminOrderFormTotalSection.total('Subtotal')}}" userInput="${{AdminOrderSimpleProduct.subtotal}}" stepKey="seeOrderSubTotal" after="selectFlatRateShipping"/> @@ -74,4 +74,4 @@ <seeInCurrentUrl url="{{AdminOrderDetailsPage.url}}" stepKey="seeViewOrderPage" after="clickSubmitOrder"/> <see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="You created the order." stepKey="seeSuccessMessage" after="seeViewOrderPage"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutEmailTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutEmailTest.xml index 01021ad745f70..f2d0fffe9b4cf 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutEmailTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutEmailTest.xml @@ -31,7 +31,7 @@ <!--Create order via Admin--> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <comment userInput="Admin creates order" stepKey="adminCreateOrderComment"/> - <!--<actionGroup ref="navigateToNewOrderPageNewCustomer" stepKey="navigateToNewOrderPage"/>--> + <!--<actionGroup ref="NavigateToNewOrderPageNewCustomerActionGroup" stepKey="navigateToNewOrderPage"/>--> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/> <waitForPageLoad stepKey="waitForIndexPageLoad"/> <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/> @@ -40,9 +40,9 @@ <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/> <!--Check if order can be submitted without the required fields including email address--> - <actionGroup ref="checkRequiredFieldsNewOrderForm" stepKey="checkRequiredFieldsNewOrder" after="seeNewOrderPageTitle"/> + <actionGroup ref="CheckRequiredFieldsNewOrderFormActionGroup" stepKey="checkRequiredFieldsNewOrder" after="seeNewOrderPageTitle"/> <scrollToTopOfPage stepKey="scrollToTopOfOrderFormPage" after="checkRequiredFieldsNewOrder"/> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToOrder" after="scrollToTopOfOrderFormPage"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToOrder" after="scrollToTopOfOrderFormPage"> <argument name="product" value="_defaultProduct"/> </actionGroup> @@ -51,15 +51,15 @@ <fillField selector="{{AdminOrderFormAccountSection.email}}" userInput="{{Simple_US_Customer.email}}" stepKey="fillCustomerEmail" after="selectCustomerGroup"/> <!--Fill customer address information--> - <actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerAddress" after="fillCustomerEmail"> + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerAddress" after="fillCustomerEmail"> <argument name="customer" value="Simple_US_Customer"/> <argument name="address" value="US_Address_TX"/> </actionGroup> <!-- Select shipping --> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRateShipping" after="fillCustomerAddress"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRateShipping" after="fillCustomerAddress"/> <!-- Checkout select Check/Money Order payment --> - <actionGroup ref="SelectCheckMoneyPaymentMethod" stepKey="selectCheckMoneyPayment"/> + <actionGroup ref="SelectCheckMoneyPaymentMethodActionGroup" stepKey="selectCheckMoneyPayment"/> <!--Verify totals on Order page--> <see selector="{{AdminOrderFormTotalSection.total('Subtotal')}}" userInput="${{AdminOrderSimpleProduct.subtotal}}" stepKey="seeOrderSubTotal" after="selectFlatRateShipping"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutFieldsValidationTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutFieldsValidationTest.xml index 9268e9e728658..4dbd80a351ee7 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutFieldsValidationTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutFieldsValidationTest.xml @@ -30,7 +30,7 @@ <!--Create order via Admin--> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <comment userInput="Admin creates order" stepKey="adminCreateOrderComment"/> - <!--<actionGroup ref="navigateToNewOrderPageNewCustomer" stepKey="navigateToNewOrderPage"/>--> + <!--<actionGroup ref="NavigateToNewOrderPageNewCustomerActionGroup" stepKey="navigateToNewOrderPage"/>--> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/> <waitForPageLoad stepKey="waitForIndexPageLoad"/> <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/> @@ -39,9 +39,9 @@ <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/> <!--Check if order can be submitted without the required fields including email address--> - <actionGroup ref="checkRequiredFieldsNewOrderForm" stepKey="checkRequiredFieldsNewOrder" after="seeNewOrderPageTitle"/> + <actionGroup ref="CheckRequiredFieldsNewOrderFormActionGroup" stepKey="checkRequiredFieldsNewOrder" after="seeNewOrderPageTitle"/> <scrollToTopOfPage stepKey="scrollToTopOfOrderFormPage" after="checkRequiredFieldsNewOrder"/> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToOrder" after="scrollToTopOfOrderFormPage"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToOrder" after="scrollToTopOfOrderFormPage"> <argument name="product" value="_defaultProduct"/> </actionGroup> @@ -50,12 +50,12 @@ <fillField selector="{{AdminOrderFormAccountSection.email}}" userInput="{{Simple_US_Customer.email}}" stepKey="fillCustomerEmail" after="selectCustomerGroup"/> <!--Fill wrong customer address information--> - <actionGroup ref="fillOrderCustomerInformation" stepKey="fillWrongCustomerAddress" after="fillCustomerEmail"> + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillWrongCustomerAddress" after="fillCustomerEmail"> <argument name="customer" value="Simple_US_Customer_Incorrect_Name"/> <argument name="address" value="US_Address_TX"/> </actionGroup> <!-- Select shipping --> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRateShipping" + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRateShipping" after="fillWrongCustomerAddress"/> <!--Verify totals on Order page--> @@ -72,7 +72,7 @@ after="clickSubmitOrderWrong"/> <!--Fill correct customer address information--> - <actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerAddress" after="firstNameError"> + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerAddress" after="firstNameError"> <argument name="customer" value="Simple_US_Customer"/> <argument name="address" value="US_Address_TX"/> </actionGroup> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AssignCustomOrderStatusNotVisibleOnStorefrontTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AssignCustomOrderStatusNotVisibleOnStorefrontTest.xml index c292afe65cdf3..ac377a0d31606 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AssignCustomOrderStatusNotVisibleOnStorefrontTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AssignCustomOrderStatusNotVisibleOnStorefrontTest.xml @@ -87,7 +87,7 @@ <!-- Assert order status is correct --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrdersPage"/> <waitForPageLoad stepKey="waitForOrdersPageLoad"/> - <actionGroup ref="filterOrderGridById" stepKey="filterOrdersGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrdersGridById"> <argument name="orderId" value="$getOrderId"/> </actionGroup> <click selector="{{AdminDataGridTableSection.firstRow}}" stepKey="clickCreatedOrderInGrid"/> @@ -112,7 +112,7 @@ <!-- Cancel order --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToAdminOrdersPage"/> <waitForPageLoad stepKey="waitForAdminOrdersPageLoad"/> - <actionGroup ref="filterOrderGridById" stepKey="filterOrdersGridByOrderId"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrdersGridByOrderId"> <argument name="orderId" value="$getOrderId"/> </actionGroup> <checkOption selector="{{AdminOrdersGridSection.checkOrder}}" stepKey="selectOrder"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CheckXSSVulnerabilityDuringOrderCreationTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CheckXSSVulnerabilityDuringOrderCreationTest.xml index a728b57a743af..6eb9e37a3ab79 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/CheckXSSVulnerabilityDuringOrderCreationTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/CheckXSSVulnerabilityDuringOrderCreationTest.xml @@ -52,7 +52,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!-- Try to create order in admin with provided email --> - <actionGroup ref="navigateToNewOrderPageNewCustomerSingleStore" stepKey="navigateToNewOrderPage"/> + <actionGroup ref="NavigateToNewOrderPageNewCustomerSingleStoreActionGroup" stepKey="navigateToNewOrderPage"/> <fillField selector="{{AdminOrderFormAccountSection.email}}" userInput="{{Simple_US_Customer_Incorrect_Email.email}}" stepKey="fillEmailAddressAdminPanel"/> <click selector="{{AdminOrderFormActionSection.submitOrder}}" stepKey="clickSubmitOrder"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceAndCheckInvoiceOrderTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceAndCheckInvoiceOrderTest.xml index 45953b7b584f2..0b065e0da54f0 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceAndCheckInvoiceOrderTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceAndCheckInvoiceOrderTest.xml @@ -51,7 +51,7 @@ </after> <!-- Create order --> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="goToCreateOrderPage"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="goToCreateOrderPage"> <argument name="customer" value="$$createCustomer$$"/> </actionGroup> @@ -79,7 +79,7 @@ <!-- Open created order --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrdersPage"/> <waitForPageLoad stepKey="waitForOrdersPageLoad"/> - <actionGroup ref="filterOrderGridById" stepKey="filterOrdersGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrdersGridById"> <argument name="orderId" value="$getOrderId"/> </actionGroup> <click selector="{{AdminDataGridTableSection.firstRow}}" stepKey="clickCreatedOrderInGrid"/> @@ -105,7 +105,7 @@ <!-- Assert invoice in invoices tab --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/> <waitForPageLoad stepKey="waitForOrdersLoad"/> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridByIdForAssertingInvoiceBtn"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridByIdForAssertingInvoiceBtn"> <argument name="orderId" value="$getOrderId"/> </actionGroup> <click selector="{{AdminDataGridTableSection.firstRow}}" stepKey="clickOrderInGrid"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceWithCashOnDeliveryPaymentMethodTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceWithCashOnDeliveryPaymentMethodTest.xml index ef194028a4367..295d388ced96e 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceWithCashOnDeliveryPaymentMethodTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceWithCashOnDeliveryPaymentMethodTest.xml @@ -51,7 +51,7 @@ </after> <!-- Create order --> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="goToCreateOrderPage"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="goToCreateOrderPage"> <argument name="customer" value="$$createCustomer$$"/> </actionGroup> @@ -79,7 +79,7 @@ <!-- Open created order --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrdersPage"/> <waitForPageLoad stepKey="waitForOrdersPageLoad"/> - <actionGroup ref="filterOrderGridById" stepKey="filterOrdersGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrdersGridById"> <argument name="orderId" value="$getOrderId"/> </actionGroup> <click selector="{{AdminDataGridTableSection.firstRow}}" stepKey="clickCreatedOrderInGrid"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceWithShipmentAndCheckInvoicedOrderTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceWithShipmentAndCheckInvoicedOrderTest.xml index 30ca1f5175576..2ccecf34a5a0c 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceWithShipmentAndCheckInvoicedOrderTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceWithShipmentAndCheckInvoicedOrderTest.xml @@ -49,12 +49,12 @@ </after> <!-- Create order--> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="goToCreateOrderPage"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="goToCreateOrderPage"> <argument name="customer" value="$$createCustomer$$"/> </actionGroup> <!-- Add product to order --> - <actionGroup ref="addSimpleProductToOrder" stepKey="addProductToOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addProductToOrder"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> @@ -73,7 +73,7 @@ <!-- Open created order --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrdersPage"/> <waitForPageLoad stepKey="waitForOrdersPageLoad"/> - <actionGroup ref="filterOrderGridById" stepKey="filterOrdersGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrdersGridById"> <argument name="orderId" value="$getOrderId"/> </actionGroup> <click selector="{{AdminDataGridTableSection.firstRow}}" stepKey="clickCreatedOrderInGrid"/> @@ -103,7 +103,7 @@ <!-- Assert no invoice button --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/> <waitForPageLoad stepKey="waitForOrdersLoad"/> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridByIdForAssertingInvoiceBtn"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridByIdForAssertingInvoiceBtn"> <argument name="orderId" value="$getOrderId"/> </actionGroup> <click selector="{{AdminDataGridTableSection.firstRow}}" stepKey="clickOrderInGrid"/> @@ -148,7 +148,7 @@ <!-- Assert no ship button --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToAdminOrdersPage"/> <waitForPageLoad stepKey="waitForOrdersPageToLoad"/> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridByIdForAssertingShipBtn"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridByIdForAssertingShipBtn"> <argument name="orderId" value="$getOrderId"/> </actionGroup> <click selector="{{AdminDataGridTableSection.firstRow}}" stepKey="selectOrderInGrid"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceWithZeroSubtotalCheckoutTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceWithZeroSubtotalCheckoutTest.xml index 4b8e5d88cdf49..944a1ed75cebd 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceWithZeroSubtotalCheckoutTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceWithZeroSubtotalCheckoutTest.xml @@ -62,12 +62,12 @@ </after> <!-- Create order --> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="goToCreateOrderPage"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="goToCreateOrderPage"> <argument name="customer" value="$$createCustomer$$"/> </actionGroup> <!-- Add product to order --> - <actionGroup ref="addSimpleProductToOrder" stepKey="addProductToOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addProductToOrder"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> @@ -77,7 +77,7 @@ </actionGroup> <!-- Select Free shipping --> - <actionGroup ref="orderSelectFreeShipping" stepKey="selectFreeShippingOption"/> + <actionGroup ref="OrderSelectFreeShippingActionGroup" stepKey="selectFreeShippingOption"/> <!-- Submit order --> <actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder"/> @@ -88,7 +88,7 @@ <!-- Open created order --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrdersPage"/> <waitForPageLoad stepKey="waitForOrdersPageLoad"/> - <actionGroup ref="filterOrderGridById" stepKey="filterOrdersGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrdersGridById"> <argument name="orderId" value="$getOrderId"/> </actionGroup> <click selector="{{AdminDataGridTableSection.firstRow}}" stepKey="clickCreatedOrderInGrid"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml index 9da5afffb48e5..d32a5304c5087 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml @@ -103,19 +103,19 @@ <conditionalClick selector="{{AdminOrderStoreScopeTreeSection.storeOption(_defaultStore.name)}}" dependentSelector="{{AdminOrderStoreScopeTreeSection.storeOption(_defaultStore.name)}}" visible="true" stepKey="selectStoreViewIfAppears"/> <!--Add configurable product to order--> - <actionGroup ref="addConfigurableProductToOrderFromAdmin" stepKey="addConfigurableProductToOrder"> + <actionGroup ref="AddConfigurableProductToOrderFromAdminActionGroup" stepKey="addConfigurableProductToOrder"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="attribute" value="$$createConfigProductAttribute$$"/> <argument name="option" value="$$getConfigAttributeOption1$$"/> </actionGroup> <!--Add Simple product to order--> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToOrder"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> <!--Add Second Simple product to order--> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSecondSimpleProductToOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSecondSimpleProductToOrder"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> @@ -185,7 +185,7 @@ <waitForPageLoad stepKey="waitForAdminOrderFormLoad"/> <!-- Verify order information --> - <actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/> + <actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/> <grabTextFrom selector="|Order # (\d+)|" stepKey="orderId"/> <!-- Filter and Open the customer edit page --> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/EndToEndB2CAdminTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/EndToEndB2CAdminTest.xml index 0fdd8d8c35b32..08fd95e73ad93 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/EndToEndB2CAdminTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/EndToEndB2CAdminTest.xml @@ -35,14 +35,14 @@ <!--Admin creates order--> <comment userInput="Admin creates order" stepKey="adminCreateOrderComment" before="navigateToNewOrderPage"/> - <actionGroup ref="navigateToNewOrderPageNewCustomer" stepKey="navigateToNewOrderPage" after="deleteCategory"/> + <actionGroup ref="NavigateToNewOrderPageNewCustomerActionGroup" stepKey="navigateToNewOrderPage" after="deleteCategory"/> - <actionGroup ref="checkRequiredFieldsNewOrderForm" stepKey="checkRequiredFieldsNewOrder" after="navigateToNewOrderPage"/> + <actionGroup ref="CheckRequiredFieldsNewOrderFormActionGroup" stepKey="checkRequiredFieldsNewOrder" after="navigateToNewOrderPage"/> <scrollToTopOfPage stepKey="scrollToTopOfOrderFormPage" after="checkRequiredFieldsNewOrder"/> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToOrder" after="scrollToTopOfOrderFormPage"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToOrder" after="scrollToTopOfOrderFormPage"> <argument name="product" value="SimpleProduct"/> </actionGroup> - <actionGroup ref="addConfigurableProductToOrder" stepKey="addConfigurableProductToOrder" after="addSimpleProductToOrder"> + <actionGroup ref="AddConfigurableProductToOrderActionGroup" stepKey="addConfigurableProductToOrder" after="addSimpleProductToOrder"> <argument name="product" value="BaseConfigurableProduct"/> <argument name="attribute" value="colorProductAttribute"/> <argument name="option" value="colorProductAttribute1"/> @@ -53,12 +53,12 @@ <fillField selector="{{AdminOrderFormAccountSection.email}}" userInput="{{Simple_US_Customer.email}}" stepKey="fillEmail" after="selectGroup"/> <!--Fill customer address information--> - <actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerAddress" after="fillEmail"> + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerAddress" after="fillEmail"> <argument name="customer" value="Simple_US_Customer"/> <argument name="address" value="US_Address_TX"/> </actionGroup> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRateShipping" after="fillCustomerAddress"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRateShipping" after="fillCustomerAddress"/> <!--Verify totals on Order page--> <see selector="{{AdminOrderFormTotalSection.total('Subtotal')}}" userInput="${{AdminOrderSimpleConfigurableProduct.subtotal}}" stepKey="seeOrderSubTotal" after="selectFlatRateShipping"/> @@ -73,15 +73,15 @@ <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Pending" stepKey="seeOrderPendingStatus" after="seeSuccessMessage"/> <grabTextFrom selector="|Order # (\d+)|" stepKey="getOrderId" after="seeOrderPendingStatus"/> <assertNotEmpty actual="$getOrderId" stepKey="assertOrderIdIsNotEmpty" after="getOrderId"/> - <actionGroup ref="verifyBasicOrderInformation" stepKey="verifyOrderInformation" after="assertOrderIdIsNotEmpty"> + <actionGroup ref="VerifyBasicOrderInformationActionGroup" stepKey="verifyOrderInformation" after="assertOrderIdIsNotEmpty"> <argument name="customer" value="Simple_US_Customer"/> <argument name="shippingAddress" value="US_Address_TX"/> <argument name="billingAddress" value="US_Address_TX"/> </actionGroup> - <actionGroup ref="seeProductInItemsOrdered" stepKey="seeSimpleProductInItemsOrdered" after="verifyOrderInformation"> + <actionGroup ref="SeeProductInItemsOrderedActionGroup" stepKey="seeSimpleProductInItemsOrdered" after="verifyOrderInformation"> <argument name="product" value="SimpleProduct"/> </actionGroup> - <actionGroup ref="seeProductInItemsOrdered" stepKey="seeConfigurableProductInItemsOrdered" after="seeSimpleProductInItemsOrdered"> + <actionGroup ref="SeeProductInItemsOrderedActionGroup" stepKey="seeConfigurableProductInItemsOrdered" after="seeSimpleProductInItemsOrdered"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> @@ -94,7 +94,7 @@ <!--Check Invoice Data--> <see selector="{{AdminInvoiceOrderInformationSection.orderStatus}}" userInput="Pending" stepKey="seeOrderPendingInvoice" after="seePageNameNewInvoicePage"/> - <actionGroup ref="verifyBasicInvoiceInformation" stepKey="verifyOrderInvoiceInformation" after="seeOrderPendingInvoice"> + <actionGroup ref="VerifyBasicInvoiceInformationActionGroup" stepKey="verifyOrderInvoiceInformation" after="seeOrderPendingInvoice"> <argument name="customer" value="Simple_US_Customer"/> <argument name="shippingAddress" value="US_Address_TX"/> <argument name="billingAddress" value="US_Address_TX"/> @@ -113,15 +113,15 @@ <see selector="{{AdminOrderInvoicesTabSection.gridRow('1')}}" userInput="{{Simple_US_Customer.firstname}}" stepKey="seeOrderInvoiceInTabGrid" after="waitForInvoiceGridLoadingMask"/> <click selector="{{AdminOrderInvoicesTabSection.viewGridRow('1')}}" stepKey="clickToViewInvoiceRow" after="seeOrderInvoiceInTabGrid"/> <see selector="{{AdminInvoiceOrderInformationSection.orderId}}" userInput="$getOrderId" stepKey="seeOrderIdOnInvoice" after="clickToViewInvoiceRow"/> - <actionGroup ref="verifyBasicInvoiceInformation" stepKey="verifyBasicInvoiceInformation" after="seeOrderIdOnInvoice"> + <actionGroup ref="VerifyBasicInvoiceInformationActionGroup" stepKey="verifyBasicInvoiceInformation" after="seeOrderIdOnInvoice"> <argument name="customer" value="Simple_US_Customer"/> <argument name="shippingAddress" value="US_Address_TX"/> <argument name="billingAddress" value="US_Address_TX"/> </actionGroup> - <actionGroup ref="seeProductInInvoiceItems" stepKey="seeSimpleProductInInvoice" after="verifyBasicInvoiceInformation"> + <actionGroup ref="SeeProductInInvoiceItemsActionGroup" stepKey="seeSimpleProductInInvoice" after="verifyBasicInvoiceInformation"> <argument name="product" value="SimpleProduct"/> </actionGroup> - <actionGroup ref="seeProductInInvoiceItems" stepKey="seeConfigurableProductInInvoice" after="seeSimpleProductInInvoice"> + <actionGroup ref="SeeProductInInvoiceItemsActionGroup" stepKey="seeConfigurableProductInInvoice" after="seeSimpleProductInInvoice"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> <click selector="{{AdminInvoiceOrderInformationSection.orderId}}" stepKey="clickOrderIdLinkOnInvoice" after="seeConfigurableProductInInvoice"/> @@ -132,7 +132,7 @@ <seeInCurrentUrl url="{{AdminCreditMemoNewPage.url}}" stepKey="seeNewCreditMemoPage" after="clickCreateCreditMemo"/> <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Memo" stepKey="seeNewMemoInPageTitle" after="seeNewCreditMemoPage"/> <!--Check Credit Memo Order Data--> - <actionGroup ref="verifyBasicCreditMemoInformation" stepKey="verifyOrderCreditMemoInformation" after="seeNewMemoInPageTitle"> + <actionGroup ref="VerifyBasicCreditMemoInformationActionGroup" stepKey="verifyOrderCreditMemoInformation" after="seeNewMemoInPageTitle"> <argument name="customer" value="Simple_US_Customer"/> <argument name="shippingAddress" value="US_Address_TX"/> <argument name="billingAddress" value="US_Address_TX"/> @@ -146,15 +146,15 @@ <click selector="{{AdminOrderCreditMemosTabSection.viewGridRow('1')}}" stepKey="clickToViewCreditMemoRow" after="seeOrderCreditMemoInTabGrid"/> <waitForPageLoad stepKey="waitForCreditMemoPageLoad" after="clickToViewCreditMemoRow"/> <see selector="{{AdminCreditMemoOrderInformationSection.orderId}}" userInput="$getOrderId" stepKey="seeOrderIdOnCreditMemo" after="waitForCreditMemoPageLoad"/> - <actionGroup ref="verifyBasicCreditMemoInformation" stepKey="verifyBasicCreditMemoInformation" after="seeOrderIdOnCreditMemo"> + <actionGroup ref="VerifyBasicCreditMemoInformationActionGroup" stepKey="verifyBasicCreditMemoInformation" after="seeOrderIdOnCreditMemo"> <argument name="customer" value="Simple_US_Customer"/> <argument name="shippingAddress" value="US_Address_TX"/> <argument name="billingAddress" value="US_Address_TX"/> </actionGroup> - <actionGroup ref="seeProductInItemsRefunded" stepKey="seeSimpleProductInItemsRefunded" after="verifyBasicCreditMemoInformation"> + <actionGroup ref="SeeProductInItemsRefundedActionGroup" stepKey="seeSimpleProductInItemsRefunded" after="verifyBasicCreditMemoInformation"> <argument name="product" value="SimpleProduct"/> </actionGroup> - <actionGroup ref="seeProductInItemsRefunded" stepKey="seeConfigurableProductInItemsRefunded" after="seeSimpleProductInItemsRefunded"> + <actionGroup ref="SeeProductInItemsRefundedActionGroup" stepKey="seeConfigurableProductInItemsRefunded" after="seeSimpleProductInItemsRefunded"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> <scrollToTopOfPage stepKey="scrollToTopOfCreditMemo" after="seeConfigurableProductInItemsRefunded"/> @@ -183,7 +183,7 @@ <actionGroup ref="resetAdminDataGridToDefaultView" stepKey="resetOrderGridForNameFilter" after="filterOrderGridByNameComment"/> <!--@TODO use "Bill-to Name" when MQE-794 is fixed--> <see selector="{{AdminDataGridTableSection.column('Bill')}}" userInput="{{BillingAddressTX.fullname}}" stepKey="seeNonFilterNameInColumn" after="resetOrderGridForNameFilter"/> - <actionGroup ref="filterOrderGridByBillingName" stepKey="filterOrderGridByBillingName" after="seeNonFilterNameInColumn"> + <actionGroup ref="FilterOrderGridByBillingNameActionGroup" stepKey="filterOrderGridByBillingName" after="seeNonFilterNameInColumn"> <argument name="customer" value="Simple_US_Customer"/> </actionGroup> <dontSee selector="{{AdminDataGridTableSection.column('Bill')}}" userInput="{{BillingAddressTX.fullname}}" stepKey="dontSeeNonFilterNameInColumn" after="filterOrderGridByBillingName"/> @@ -192,7 +192,7 @@ <comment userInput="Admin filters order grid by 'Grand Total'" stepKey="filterOrderGridByTotalComment" after="seeFilterNameInColumn"/> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFilterBeforeTotalFilter" after="filterOrderGridByTotalComment"/> <see selector="{{AdminDataGridTableSection.column('Grand Total')}}" userInput="{{AdminOrderSimpleProduct.grandTotal}}" stepKey="seeLowerTotalInGrid" after="clearFilterBeforeTotalFilter"/> - <actionGroup ref="filterOrderGridByBaseTotalRange" stepKey="filterOrderGridByTotal" after="seeLowerTotalInGrid"> + <actionGroup ref="FilterOrderGridByBaseTotalRangeActionGroup" stepKey="filterOrderGridByTotal" after="seeLowerTotalInGrid"> <argument name="from" value="OrderGrandTotalFilterRange.from"/> <argument name="to" value="OrderGrandTotalFilterRange.to"/> </actionGroup> @@ -217,12 +217,12 @@ <!--Filter order grid by status--> <comment userInput="Admin filters order grid by 'Status'" stepKey="filterOrderGridByStatusComment" after="dontSeeSecondOrderInGrid"/> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFilterBeforeStatusFilter" after="filterOrderGridByStatusComment"/> - <actionGroup ref="filterOrderGridByStatus" stepKey="filterOrderGridByPendingStatus" after="clearFilterBeforeStatusFilter"> + <actionGroup ref="FilterOrderGridByStatusActionGroup" stepKey="filterOrderGridByPendingStatus" after="clearFilterBeforeStatusFilter"> <argument name="status" value="OrderStatus.pending"/> </actionGroup> <dontSee selector="{{AdminDataGridTableSection.column('Status')}}" userInput="{{OrderStatus.closed}}" stepKey="dontSeeClosedStatusInOrderGrid" after="filterOrderGridByPendingStatus"/> <see selector="{{AdminDataGridTableSection.column('Status')}}" userInput="{{OrderStatus.pending}}" stepKey="seePendingStatusInOrderGrid" after="dontSeeClosedStatusInOrderGrid"/> - <actionGroup ref="filterOrderGridByStatus" stepKey="filterOrderGridByClosedStatus" after="seePendingStatusInOrderGrid"> + <actionGroup ref="FilterOrderGridByStatusActionGroup" stepKey="filterOrderGridByClosedStatus" after="seePendingStatusInOrderGrid"> <argument name="status" value="OrderStatus.closed"/> </actionGroup> <see selector="{{AdminDataGridTableSection.column('Status')}}" userInput="{{OrderStatus.closed}}" stepKey="seeClosedStatusInOrderGrid" after="filterOrderGridByClosedStatus"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/MoveLastOrderedConfigurableProductOnOrderPageTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/MoveLastOrderedConfigurableProductOnOrderPageTest.xml index 3cc14392c6183..b3c3f045f0d59 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/MoveLastOrderedConfigurableProductOnOrderPageTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/MoveLastOrderedConfigurableProductOnOrderPageTest.xml @@ -69,12 +69,12 @@ </after> <!-- Create order --> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="goToCreateOrderPage"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="goToCreateOrderPage"> <argument name="customer" value="$$createCustomer$$"/> </actionGroup> <!-- Add configurable product to order --> - <actionGroup ref="addConfigurableProductToOrderFromAdmin" stepKey="addConfigurableProductToOrder"> + <actionGroup ref="AddConfigurableProductToOrderFromAdminActionGroup" stepKey="addConfigurableProductToOrder"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="attribute" value="$$createConfigProductAttribute$$"/> <argument name="option" value="$$getConfigAttributeOption$$"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml index 0bd8ab4855e97..f5fc0851b3ec8 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml @@ -164,7 +164,7 @@ <magentoCLI command="cache:flush" stepKey="flushCache"/> <!-- Place order with options according to dataset --> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="newOrder"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="newOrder"> <argument name="customer" value="$$createCustomer$$"/> </actionGroup> @@ -200,12 +200,12 @@ <argument name="couponCode" value="$$createCouponForCartPriceRule.code$$"/> </actionGroup> - <actionGroup ref="fillOrderCustomerInformation" stepKey="fillOrder"> + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillOrder"> <argument name="customer" value="$$createCustomer$$"/> <argument name="address" value="US_Address_TX"/> </actionGroup> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRate"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRate"/> </before> <after> <magentoCLI command="downloadable:domains:remove" arguments="example.com static.magento.com" stepKey="removeDownloadableDomain"/> diff --git a/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateOrderCustomStoreShippingMethodTableRatesTest.xml b/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateOrderCustomStoreShippingMethodTableRatesTest.xml index b2e3e2516a5c3..48797336431fa 100644 --- a/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateOrderCustomStoreShippingMethodTableRatesTest.xml +++ b/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateOrderCustomStoreShippingMethodTableRatesTest.xml @@ -86,14 +86,14 @@ </actionGroup> <actionGroup ref="saveProductForm" stepKey="saveProduct"/> <!--Create order--> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$createCustomer$$"/> <argument name="storeView" value="customStore"/> </actionGroup> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToTheOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToTheOrder"> <argument name="product" value="$$createProduct$$"/> </actionGroup> - <actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerInfo"> + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerInfo"> <argument name="customer" value="$$createCustomer$$"/> <argument name="address" value="US_Address_TX"/> </actionGroup> diff --git a/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreatePartialShipmentEntityTest.xml b/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreatePartialShipmentEntityTest.xml index 30dc98c2f68ca..0e4fd3ce9a86c 100644 --- a/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreatePartialShipmentEntityTest.xml +++ b/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreatePartialShipmentEntityTest.xml @@ -40,15 +40,15 @@ <!-- TEST BODY --> <!-- Create Order --> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="goToCreateOrderPage"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="goToCreateOrderPage"> <argument name="customer" value="$$createCustomer$$"/> </actionGroup> - <actionGroup ref="addSimpleProductToOrder" stepKey="addProductToOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addProductToOrder"> <argument name="product" value="$$createSimpleProduct$$"/> <argument name="productQty" value="2"/> </actionGroup> <!-- Select Free shipping --> - <actionGroup ref="orderSelectFreeShipping" stepKey="selectFreeShippingOption"/> + <actionGroup ref="OrderSelectFreeShippingActionGroup" stepKey="selectFreeShippingOption"/> <!--Click *Submit Order* button--> <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="clickSubmitOrder"/> <!-- Create Partial Shipment --> diff --git a/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateShipmentEntityTest.xml b/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateShipmentEntityTest.xml index 3e6bf29b1bf54..f4087932a0710 100644 --- a/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateShipmentEntityTest.xml +++ b/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateShipmentEntityTest.xml @@ -41,14 +41,14 @@ <!-- TEST BODY --> <!-- Create Order --> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="goToCreateOrderPage"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="goToCreateOrderPage"> <argument name="customer" value="$$createCustomer$$"/> </actionGroup> - <actionGroup ref="addSimpleProductToOrder" stepKey="addProductToOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addProductToOrder"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> <!-- Select Free shipping --> - <actionGroup ref="orderSelectFreeShipping" stepKey="selectFreeShippingOption"/> + <actionGroup ref="OrderSelectFreeShippingActionGroup" stepKey="selectFreeShippingOption"/> <!--Click *Submit Order* button--> <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="clickSubmitOrder"/> <!-- Create Shipment --> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxCalcWithApplyTaxOnSettingTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxCalcWithApplyTaxOnSettingTest.xml index d249af983f715..d023f2eae25c8 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxCalcWithApplyTaxOnSettingTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxCalcWithApplyTaxOnSettingTest.xml @@ -52,12 +52,12 @@ <actionGroup ref="logout" stepKey="logout"/> </after> - <actionGroup ref="navigateToNewOrderPageNewCustomerSingleStore" stepKey="gotoNewOrderCreationPage"/> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToOrder"> + <actionGroup ref="NavigateToNewOrderPageNewCustomerSingleStoreActionGroup" stepKey="gotoNewOrderCreationPage"/> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToOrder"> <argument name="product" value="$$createProduct$$"></argument> </actionGroup> <fillField selector="{{AdminOrderFormAccountSection.email}}" userInput="{{Simple_US_Customer.email}}" stepKey="fillEmailField"/> - <actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerAddress"> + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerAddress"> <argument name="customer" value="Simple_US_Customer"/> <argument name="address" value="US_Address_CA"/> </actionGroup> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxReportGridTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxReportGridTest.xml index 628d189823a52..b7f604974fec2 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxReportGridTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxReportGridTest.xml @@ -104,10 +104,10 @@ <waitForPageLoad stepKey="waitForPage" time="60"/> <!--Check if order can be submitted without the required fields including email address--> <scrollToTopOfPage stepKey="scrollToTopOfOrderFormPage" after="seeNewOrderPageTitle"/> - <actionGroup ref="addSimpleProductToOrder" stepKey="addFirstProductToOrder" after="scrollToTopOfOrderFormPage"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addFirstProductToOrder" after="scrollToTopOfOrderFormPage"> <argument name="product" value="$$firstProduct$$"/> </actionGroup> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSecondProductToOrder" after="addFirstProductToOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSecondProductToOrder" after="addFirstProductToOrder"> <argument name="product" value="$$secondProduct$$"/> </actionGroup> @@ -116,15 +116,15 @@ <fillField selector="{{AdminOrderFormAccountSection.email}}" userInput="{{Simple_US_Customer.email}}" stepKey="fillCustomerEmail" after="selectCustomerGroup"/> <!--Fill customer address information--> - <actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerAddress" after="fillCustomerEmail"> + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerAddress" after="fillCustomerEmail"> <argument name="customer" value="Simple_US_Customer"/> <argument name="address" value="US_Address_TX"/> </actionGroup> <!-- Select shipping --> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRateShipping" after="fillCustomerAddress"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRateShipping" after="fillCustomerAddress"/> <!-- Checkout select Check/Money Order payment --> - <actionGroup ref="SelectCheckMoneyPaymentMethod" after="selectFlatRateShipping" stepKey="selectCheckMoneyPayment"/> + <actionGroup ref="SelectCheckMoneyPaymentMethodActionGroup" after="selectFlatRateShipping" stepKey="selectCheckMoneyPayment"/> <!--Submit Order and verify information--> <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" after="selectCheckMoneyPayment" stepKey="clickSubmitOrder"/> <seeInCurrentUrl url="{{AdminOrderDetailsPage.url}}" stepKey="seeViewOrderPage" after="clickSubmitOrder"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/CheckCreditMemoTotalsTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/CheckCreditMemoTotalsTest.xml index 38cc687ff53a4..d80e48bc08a90 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/CheckCreditMemoTotalsTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/CheckCreditMemoTotalsTest.xml @@ -102,7 +102,7 @@ <actionGroup ref="logout" stepKey="logout"/> </after> <!--Create new order--> - <actionGroup stepKey="CreateNewOrder" ref="navigateToNewOrderPageExistingCustomer"> + <actionGroup stepKey="CreateNewOrder" ref="NavigateToNewOrderPageExistingCustomerActionGroup"> <argument name="customer" value="Simple_US_Customer_NY"/> </actionGroup> <!--Add product to order--> @@ -112,7 +112,7 @@ <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> <waitForPageLoad stepKey="waitForPageLoad3"/> <!--Set shipping method--> - <actionGroup stepKey="orderSelectFlatRateShipping" ref="orderSelectFlatRateShipping"/> + <actionGroup stepKey="orderSelectFlatRateShipping" ref="OrderSelectFlatRateShippingActionGroup"/> <!--Submit order--> <click stepKey="SubmitOrder" selector="{{AdminOrderFormActionSection.SubmitOrder}}"/> <waitForPageLoad stepKey="waitForPageLoad4"/> @@ -120,7 +120,7 @@ <!--Open new created order--> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/> <waitForPageLoad stepKey="waitForPageLoad5"/> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$getOrderId"/> </actionGroup> <!--Create order invoice--> From 2270cebfeb0a8744d100c0b64031c99874a39bb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 17:16:37 +0100 Subject: [PATCH 125/586] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- .../AddProductVideoActionGroup.xml | 33 ++++++++ .../AdminProductVideoActionGroup.xml | 77 ------------------- ...roductVideoAdminProductPageActionGroup.xml | 25 ++++++ ...tVideoNotInAdminProductPageActionGroup.xml | 25 ++++++ ...oNotInStorefrontProductPageActionGroup.xml | 21 +++++ ...VideoStorefrontProductPageActionGroup.xml} | 14 +--- .../RemoveProductVideoActionGroup.xml | 21 +++++ .../AdminAddDefaultVideoSimpleProductTest.xml | 6 +- ...minRemoveDefaultVideoSimpleProductTest.xml | 8 +- .../YoutubeVideoWindowOnProductPageTest.xml | 6 +- 10 files changed, 136 insertions(+), 100 deletions(-) create mode 100644 app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AddProductVideoActionGroup.xml delete mode 100644 app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AdminProductVideoActionGroup.xml create mode 100644 app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoAdminProductPageActionGroup.xml create mode 100644 app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoNotInAdminProductPageActionGroup.xml create mode 100644 app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoNotInStorefrontProductPageActionGroup.xml rename app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/{StorefrontProductVideoActionGroup.xml => AssertProductVideoStorefrontProductPageActionGroup.xml} (56%) create mode 100644 app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/RemoveProductVideoActionGroup.xml diff --git a/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AddProductVideoActionGroup.xml b/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AddProductVideoActionGroup.xml new file mode 100644 index 0000000000000..bf76b7c11acfd --- /dev/null +++ b/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AddProductVideoActionGroup.xml @@ -0,0 +1,33 @@ +<?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"> + <!-- Add video in Admin Product page --> + <actionGroup name="AddProductVideoActionGroup"> + <annotations> + <description>Expands the 'Images And Videos' section on the Admin Product creation/edit page. Adds the provided Video to the Product. Clicks on Save.</description> + </annotations> + <arguments> + <argument name="video" defaultValue="mftfTestProductVideo"/> + </arguments> + + <scrollTo selector="{{AdminProductImagesSection.productImagesToggle}}" x="0" y="-100" stepKey="scrollToArea"/> + <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductVideoSection"/> + <waitForElementVisible selector="{{AdminProductImagesSection.addVideoButton}}" stepKey="waitForAddVideoButtonVisible" time="30"/> + <click selector="{{AdminProductImagesSection.addVideoButton}}" stepKey="addVideo"/> + <waitForElementVisible selector=".modal-slide.mage-new-video-dialog.form-inline._show" stepKey="waitForUrlElementVisibleslide" time="30"/> + <waitForElementVisible selector="{{AdminProductNewVideoSection.videoUrlTextField}}" stepKey="waitForUrlElementVisible" time="60"/> + <fillField selector="{{AdminProductNewVideoSection.videoUrlTextField}}" userInput="{{video.videoUrl}}" stepKey="fillFieldVideoUrl"/> + <fillField selector="{{AdminProductNewVideoSection.videoTitleTextField}}" userInput="{{video.videoTitle}}" stepKey="fillFieldVideoTitle"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <waitForElementNotVisible selector="{{AdminProductNewVideoSection.saveButtonDisabled}}" stepKey="waitForSaveButtonVisible" time="30"/> + <click selector="{{AdminProductNewVideoSection.saveButton}}" stepKey="saveVideo"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AdminProductVideoActionGroup.xml b/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AdminProductVideoActionGroup.xml deleted file mode 100644 index 67a79e7f37adf..0000000000000 --- a/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AdminProductVideoActionGroup.xml +++ /dev/null @@ -1,77 +0,0 @@ -<?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"> - <!-- Add video in Admin Product page --> - <actionGroup name="addProductVideo"> - <annotations> - <description>Expands the 'Images And Videos' section on the Admin Product creation/edit page. Adds the provided Video to the Product. Clicks on Save.</description> - </annotations> - <arguments> - <argument name="video" defaultValue="mftfTestProductVideo"/> - </arguments> - - <scrollTo selector="{{AdminProductImagesSection.productImagesToggle}}" x="0" y="-100" stepKey="scrollToArea"/> - <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductVideoSection"/> - <waitForElementVisible selector="{{AdminProductImagesSection.addVideoButton}}" stepKey="waitForAddVideoButtonVisible" time="30"/> - <click selector="{{AdminProductImagesSection.addVideoButton}}" stepKey="addVideo"/> - <waitForElementVisible selector=".modal-slide.mage-new-video-dialog.form-inline._show" stepKey="waitForUrlElementVisibleslide" time="30"/> - <waitForElementVisible selector="{{AdminProductNewVideoSection.videoUrlTextField}}" stepKey="waitForUrlElementVisible" time="60"/> - <fillField selector="{{AdminProductNewVideoSection.videoUrlTextField}}" userInput="{{video.videoUrl}}" stepKey="fillFieldVideoUrl"/> - <fillField selector="{{AdminProductNewVideoSection.videoTitleTextField}}" userInput="{{video.videoTitle}}" stepKey="fillFieldVideoTitle"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <waitForElementNotVisible selector="{{AdminProductNewVideoSection.saveButtonDisabled}}" stepKey="waitForSaveButtonVisible" time="30"/> - <click selector="{{AdminProductNewVideoSection.saveButton}}" stepKey="saveVideo"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/> - </actionGroup> - - <!-- Remove video in Admin Product page --> - <actionGroup name="removeProductVideo"> - <annotations> - <description>Expands the 'Images And Videos' section on the Admin Product creation/edit page. Clicks on the Remove Video button.</description> - </annotations> - - <scrollTo selector="{{AdminProductImagesSection.productImagesToggle}}" x="0" y="-100" stepKey="scrollToArea"/> - <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductVideoSection"/> - <waitForElementVisible selector="{{AdminProductImagesSection.addVideoButton}}" stepKey="waitForAddVideoButtonVisible" time="30"/> - <click selector="{{AdminProductImagesSection.removeVideoButton}}" stepKey="removeVideo"/> - </actionGroup> - - <!-- Assert product video in Admin Product page --> - <actionGroup name="assertProductVideoAdminProductPage"> - <annotations> - <description>Validates that the provided Video is present on the Admin Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="video" defaultValue="mftfTestProductVideo"/> - </arguments> - - <scrollTo selector="{{AdminProductImagesSection.productImagesToggle}}" x="0" y="-100" stepKey="scrollToArea"/> - <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductVideoSection"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <seeElement selector="{{AdminProductImagesSection.videoTitleText(video.videoShortTitle)}}" stepKey="seeVideoTitle"/> - <seeElementInDOM selector="{{AdminProductImagesSection.videoUrlHiddenField(video.videoUrl)}}" stepKey="seeVideoItem"/> - </actionGroup> - - <!-- Assert product video not in Admin Product page --> - <actionGroup name="assertProductVideoNotInAdminProductPage"> - <annotations> - <description>Validates that the provided Video is NOT present on the Admin Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="video" defaultValue="mftfTestProductVideo"/> - </arguments> - - <scrollTo selector="{{AdminProductImagesSection.productImagesToggle}}" x="0" y="-100" stepKey="scrollToArea"/> - <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductVideoSection"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <dontSeeElement selector="{{AdminProductImagesSection.videoTitleText(video.videoShortTitle)}}" stepKey="seeVideoTitle"/> - <dontSeeElementInDOM selector="{{AdminProductImagesSection.videoUrlHiddenField(video.videoUrl)}}" stepKey="seeVideoItem"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoAdminProductPageActionGroup.xml b/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoAdminProductPageActionGroup.xml new file mode 100644 index 0000000000000..bda0b9532f2a1 --- /dev/null +++ b/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoAdminProductPageActionGroup.xml @@ -0,0 +1,25 @@ +<?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="AssertProductVideoAdminProductPageActionGroup"> + <annotations> + <description>Validates that the provided Video is present on the Admin Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="video" defaultValue="mftfTestProductVideo"/> + </arguments> + + <scrollTo selector="{{AdminProductImagesSection.productImagesToggle}}" x="0" y="-100" stepKey="scrollToArea"/> + <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductVideoSection"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <seeElement selector="{{AdminProductImagesSection.videoTitleText(video.videoShortTitle)}}" stepKey="seeVideoTitle"/> + <seeElementInDOM selector="{{AdminProductImagesSection.videoUrlHiddenField(video.videoUrl)}}" stepKey="seeVideoItem"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoNotInAdminProductPageActionGroup.xml b/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoNotInAdminProductPageActionGroup.xml new file mode 100644 index 0000000000000..3a10c096222b8 --- /dev/null +++ b/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoNotInAdminProductPageActionGroup.xml @@ -0,0 +1,25 @@ +<?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="AssertProductVideoNotInAdminProductPageActionGroup"> + <annotations> + <description>Validates that the provided Video is NOT present on the Admin Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="video" defaultValue="mftfTestProductVideo"/> + </arguments> + + <scrollTo selector="{{AdminProductImagesSection.productImagesToggle}}" x="0" y="-100" stepKey="scrollToArea"/> + <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductVideoSection"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <dontSeeElement selector="{{AdminProductImagesSection.videoTitleText(video.videoShortTitle)}}" stepKey="seeVideoTitle"/> + <dontSeeElementInDOM selector="{{AdminProductImagesSection.videoUrlHiddenField(video.videoUrl)}}" stepKey="seeVideoItem"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoNotInStorefrontProductPageActionGroup.xml b/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoNotInStorefrontProductPageActionGroup.xml new file mode 100644 index 0000000000000..22666ad0eddcf --- /dev/null +++ b/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoNotInStorefrontProductPageActionGroup.xml @@ -0,0 +1,21 @@ +<?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="AssertProductVideoNotInStorefrontProductPageActionGroup"> + <annotations> + <description>Validates that the provided Video is NOT present on the Storefront Product page.</description> + </annotations> + <arguments> + <argument name="dataTypeAttribute" defaultValue="'youtube'"/> + </arguments> + + <dontSeeElement selector="{{StorefrontProductInfoMainSection.productVideo(dataTypeAttribute)}}" stepKey="dontSeeProductVideoDataType"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/StorefrontProductVideoActionGroup.xml b/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoStorefrontProductPageActionGroup.xml similarity index 56% rename from app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/StorefrontProductVideoActionGroup.xml rename to app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoStorefrontProductPageActionGroup.xml index e2cdac9ec9287..c2bb4e016147a 100644 --- a/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/StorefrontProductVideoActionGroup.xml +++ b/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoStorefrontProductPageActionGroup.xml @@ -9,7 +9,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <!--Assert product video in Storefront Product page --> - <actionGroup name="assertProductVideoStorefrontProductPage"> + <actionGroup name="AssertProductVideoStorefrontProductPageActionGroup"> <annotations> <description>Validates that the provided Video is present on the Storefront Product page.</description> </annotations> @@ -19,16 +19,4 @@ <seeElement selector="{{StorefrontProductInfoMainSection.productVideo(dataTypeAttribute)}}" stepKey="seeProductVideoDataType"/> </actionGroup> - - <!--Assert product video not in Storefront Product page --> - <actionGroup name="assertProductVideoNotInStorefrontProductPage"> - <annotations> - <description>Validates that the provided Video is NOT present on the Storefront Product page.</description> - </annotations> - <arguments> - <argument name="dataTypeAttribute" defaultValue="'youtube'"/> - </arguments> - - <dontSeeElement selector="{{StorefrontProductInfoMainSection.productVideo(dataTypeAttribute)}}" stepKey="dontSeeProductVideoDataType"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/RemoveProductVideoActionGroup.xml b/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/RemoveProductVideoActionGroup.xml new file mode 100644 index 0000000000000..5666d51082543 --- /dev/null +++ b/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/RemoveProductVideoActionGroup.xml @@ -0,0 +1,21 @@ +<?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="RemoveProductVideoActionGroup"> + <annotations> + <description>Expands the 'Images And Videos' section on the Admin Product creation/edit page. Clicks on the Remove Video button.</description> + </annotations> + + <scrollTo selector="{{AdminProductImagesSection.productImagesToggle}}" x="0" y="-100" stepKey="scrollToArea"/> + <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductVideoSection"/> + <waitForElementVisible selector="{{AdminProductImagesSection.addVideoButton}}" stepKey="waitForAddVideoButtonVisible" time="30"/> + <click selector="{{AdminProductImagesSection.removeVideoButton}}" stepKey="removeVideo"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminAddDefaultVideoSimpleProductTest.xml b/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminAddDefaultVideoSimpleProductTest.xml index 2b5f87f78d5e5..c2b92e6af452a 100644 --- a/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminAddDefaultVideoSimpleProductTest.xml +++ b/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminAddDefaultVideoSimpleProductTest.xml @@ -22,12 +22,12 @@ </after> <!-- Add product video --> - <actionGroup ref="addProductVideo" stepKey="addProductVideo" after="fillMainProductForm"/> + <actionGroup ref="AddProductVideoActionGroup" stepKey="addProductVideo" after="fillMainProductForm"/> <!-- Assert product video in admin product form --> - <actionGroup ref="assertProductVideoAdminProductPage" stepKey="assertProductVideoAdminProductPage" after="saveProductForm"/> + <actionGroup ref="AssertProductVideoAdminProductPageActionGroup" stepKey="assertProductVideoAdminProductPage" after="saveProductForm"/> <!-- Assert product video in storefront product page --> - <actionGroup ref="assertProductVideoStorefrontProductPage" stepKey="assertProductVideoStorefrontProductPage" after="AssertProductInStorefrontProductPage"/> + <actionGroup ref="AssertProductVideoStorefrontProductPageActionGroup" stepKey="assertProductVideoStorefrontProductPage" after="AssertProductInStorefrontProductPage"/> </test> </tests> diff --git a/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminRemoveDefaultVideoSimpleProductTest.xml b/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminRemoveDefaultVideoSimpleProductTest.xml index d4da0ffa54451..c674f12115334 100644 --- a/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminRemoveDefaultVideoSimpleProductTest.xml +++ b/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminRemoveDefaultVideoSimpleProductTest.xml @@ -22,15 +22,15 @@ </after> <!-- Add product video --> - <actionGroup ref="addProductVideo" stepKey="addProductVideo" after="fillMainProductForm"/> + <actionGroup ref="AddProductVideoActionGroup" stepKey="addProductVideo" after="fillMainProductForm"/> <!-- Remove product video --> - <actionGroup ref="removeProductVideo" stepKey="removeProductVideo" after="saveProductForm"/> + <actionGroup ref="RemoveProductVideoActionGroup" stepKey="removeProductVideo" after="saveProductForm"/> <!-- Assert product video not in admin product form --> - <actionGroup ref="assertProductVideoNotInAdminProductPage" stepKey="assertProductVideoNotInAdminProductPage" after="saveProductFormAfterRemove"/> + <actionGroup ref="AssertProductVideoNotInAdminProductPageActionGroup" stepKey="assertProductVideoNotInAdminProductPage" after="saveProductFormAfterRemove"/> <!-- Assert product video not in storefront product page --> - <actionGroup ref="assertProductVideoNotInStorefrontProductPage" stepKey="assertProductVideoNotInStorefrontProductPage" after="AssertProductInStorefrontProductPage"/> + <actionGroup ref="AssertProductVideoNotInStorefrontProductPageActionGroup" stepKey="assertProductVideoNotInStorefrontProductPage" after="AssertProductInStorefrontProductPage"/> </test> </tests> diff --git a/app/code/Magento/ProductVideo/Test/Mftf/Test/YoutubeVideoWindowOnProductPageTest.xml b/app/code/Magento/ProductVideo/Test/Mftf/Test/YoutubeVideoWindowOnProductPageTest.xml index 7249a4223503e..a550471715018 100644 --- a/app/code/Magento/ProductVideo/Test/Mftf/Test/YoutubeVideoWindowOnProductPageTest.xml +++ b/app/code/Magento/ProductVideo/Test/Mftf/Test/YoutubeVideoWindowOnProductPageTest.xml @@ -42,9 +42,9 @@ <actionGroup ref="openProducForEditByClickingRowXColumnYInProductGrid" stepKey="openFirstProductForEdit"/> <!-- Add product video --> - <actionGroup ref="addProductVideo" stepKey="addProductVideo" after="openFirstProductForEdit"/> + <actionGroup ref="AddProductVideoActionGroup" stepKey="addProductVideo" after="openFirstProductForEdit"/> <!-- Assert product video in admin product form --> - <actionGroup ref="assertProductVideoAdminProductPage" stepKey="assertProductVideoAdminProductPage" after="addProductVideo"/> + <actionGroup ref="AssertProductVideoAdminProductPageActionGroup" stepKey="assertProductVideoAdminProductPage" after="addProductVideo"/> <!-- Save the product --> <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveFirstProduct"/> @@ -53,7 +53,7 @@ <!-- Assert product video in storefront product page --> <amOnPage url="$$createProduct.name$$.html" stepKey="goToStorefrontCategoryPage"/> <waitForPageLoad stepKey="waitForStorefrontPageLoaded"/> - <actionGroup ref="assertProductVideoStorefrontProductPage" stepKey="assertProductVideoStorefrontProductPage" after="waitForStorefrontPageLoaded"/> + <actionGroup ref="AssertProductVideoStorefrontProductPageActionGroup" stepKey="assertProductVideoStorefrontProductPage" after="waitForStorefrontPageLoaded"/> <!--Click Play video button--> <click stepKey="clickToPlayVideo" selector="{{StorefrontProductInfoMainSection.clickInVideo}}"/> From f1781b6d5c9a18fc4eda5e1e45cde96c62aa1651 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 17:23:47 +0100 Subject: [PATCH 126/586] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- ...efrontWithRememberMeCheckedActionGroup.xml | 18 +++++++++ ...rontWithRememberMeUnCheckedActionGroup.xml | 18 +++++++++ ...tentCustomerWelcomeMessageActionGroup.xml} | 5 --- ...merWelcomeMessageNotPresentActionGroup.xml | 15 +++++++ ...RegisterPageDoNotRememberMeActionGroup.xml | 18 +++++++++ .../StorefrontCustomerActionGroup.xml | 40 ------------------- ...tRegisterCustomerRememberMeActionGroup.xml | 17 ++++++++ 7 files changed, 86 insertions(+), 45 deletions(-) create mode 100644 app/code/Magento/Persistent/Test/Mftf/ActionGroup/CustomerLoginOnStorefrontWithRememberMeCheckedActionGroup.xml create mode 100644 app/code/Magento/Persistent/Test/Mftf/ActionGroup/CustomerLoginOnStorefrontWithRememberMeUnCheckedActionGroup.xml rename app/code/Magento/Persistent/Test/Mftf/ActionGroup/{StorefrontPersistentAssertCustomerWelcomeMessageActionGroup.xml => StorefrontAssertPersistentCustomerWelcomeMessageActionGroup.xml} (64%) create mode 100644 app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontAssertPersistentCustomerWelcomeMessageNotPresentActionGroup.xml create mode 100644 app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontCreateCustomerOnRegisterPageDoNotRememberMeActionGroup.xml delete mode 100644 app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontCustomerActionGroup.xml create mode 100644 app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontRegisterCustomerRememberMeActionGroup.xml diff --git a/app/code/Magento/Persistent/Test/Mftf/ActionGroup/CustomerLoginOnStorefrontWithRememberMeCheckedActionGroup.xml b/app/code/Magento/Persistent/Test/Mftf/ActionGroup/CustomerLoginOnStorefrontWithRememberMeCheckedActionGroup.xml new file mode 100644 index 0000000000000..6a28829034611 --- /dev/null +++ b/app/code/Magento/Persistent/Test/Mftf/ActionGroup/CustomerLoginOnStorefrontWithRememberMeCheckedActionGroup.xml @@ -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="CustomerLoginOnStorefrontWithRememberMeCheckedActionGroup" extends="LoginToStorefrontActionGroup"> + <annotations> + <description>EXTENDS: LoginToStorefrontActionGroup. Checks the 'Remember Me' checkbox.</description> + </annotations> + + <checkOption selector="{{StorefrontCustomerSignInFormSection.rememberMe}}" before="clickSignInAccountButton" stepKey="checkRememberMe"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Persistent/Test/Mftf/ActionGroup/CustomerLoginOnStorefrontWithRememberMeUnCheckedActionGroup.xml b/app/code/Magento/Persistent/Test/Mftf/ActionGroup/CustomerLoginOnStorefrontWithRememberMeUnCheckedActionGroup.xml new file mode 100644 index 0000000000000..080dde1f60f93 --- /dev/null +++ b/app/code/Magento/Persistent/Test/Mftf/ActionGroup/CustomerLoginOnStorefrontWithRememberMeUnCheckedActionGroup.xml @@ -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="CustomerLoginOnStorefrontWithRememberMeUnCheckedActionGroup" extends="LoginToStorefrontActionGroup"> + <annotations> + <description>EXTENDS: LoginToStorefrontActionGroup. Uncheck the 'Remember Me' checkbox.</description> + </annotations> + + <uncheckOption selector="{{StorefrontCustomerSignInFormSection.rememberMe}}" before="clickSignInAccountButton" stepKey="unCheckRememberMe"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontPersistentAssertCustomerWelcomeMessageActionGroup.xml b/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontAssertPersistentCustomerWelcomeMessageActionGroup.xml similarity index 64% rename from app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontPersistentAssertCustomerWelcomeMessageActionGroup.xml rename to app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontAssertPersistentCustomerWelcomeMessageActionGroup.xml index b081f5c3eb0c8..54105dc0d31ad 100644 --- a/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontPersistentAssertCustomerWelcomeMessageActionGroup.xml +++ b/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontAssertPersistentCustomerWelcomeMessageActionGroup.xml @@ -15,9 +15,4 @@ <waitForPageLoad stepKey="waitForPageLoad"/> <see selector="{{StorefrontPanelHeaderSection.welcomeMessage}}" userInput="Welcome, {{customerFullName}}! Not you?" stepKey="verifyMessage" /> </actionGroup> - - <actionGroup name="StorefrontAssertPersistentCustomerWelcomeMessageNotPresentActionGroup" extends="StorefrontAssertPersistentCustomerWelcomeMessageActionGroup"> - <remove keyForRemoval="verifyMessage"/> - <dontSee selector="{{StorefrontPanelHeaderSection.welcomeMessage}}" userInput="Welcome, {{customerFullName}}! Not you?" stepKey="dontSeeWelcomeMessageNotYou"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontAssertPersistentCustomerWelcomeMessageNotPresentActionGroup.xml b/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontAssertPersistentCustomerWelcomeMessageNotPresentActionGroup.xml new file mode 100644 index 0000000000000..3aa0c4d9c0de5 --- /dev/null +++ b/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontAssertPersistentCustomerWelcomeMessageNotPresentActionGroup.xml @@ -0,0 +1,15 @@ +<?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="StorefrontAssertPersistentCustomerWelcomeMessageNotPresentActionGroup" extends="StorefrontAssertPersistentCustomerWelcomeMessageActionGroup"> + <remove keyForRemoval="verifyMessage"/> + <dontSee selector="{{StorefrontPanelHeaderSection.welcomeMessage}}" userInput="Welcome, {{customerFullName}}! Not you?" stepKey="dontSeeWelcomeMessageNotYou"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontCreateCustomerOnRegisterPageDoNotRememberMeActionGroup.xml b/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontCreateCustomerOnRegisterPageDoNotRememberMeActionGroup.xml new file mode 100644 index 0000000000000..75ca7bca24dce --- /dev/null +++ b/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontCreateCustomerOnRegisterPageDoNotRememberMeActionGroup.xml @@ -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="StorefrontCreateCustomerOnRegisterPageDoNotRememberMeActionGroup" extends="SignUpNewUserFromStorefrontActionGroup"> + <!--- Assume we are on customer registration page. --> + <remove keyForRemoval="amOnStorefrontPage"/> + <remove keyForRemoval="clickOnCreateAccountLink"/> + <uncheckOption selector="{{StorefrontCustomerSignInFormSection.rememberMe}}" before="clickCreateAccountButton" stepKey="unCheckRememberMe"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontCustomerActionGroup.xml b/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontCustomerActionGroup.xml deleted file mode 100644 index 70d5be2dcf23f..0000000000000 --- a/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontCustomerActionGroup.xml +++ /dev/null @@ -1,40 +0,0 @@ -<?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="CustomerLoginOnStorefrontWithRememberMeChecked" extends="LoginToStorefrontActionGroup"> - <annotations> - <description>EXTENDS: LoginToStorefrontActionGroup. Checks the 'Remember Me' checkbox.</description> - </annotations> - - <checkOption selector="{{StorefrontCustomerSignInFormSection.rememberMe}}" before="clickSignInAccountButton" stepKey="checkRememberMe"/> - </actionGroup> - - <actionGroup name="CustomerLoginOnStorefrontWithRememberMeUnChecked" extends="LoginToStorefrontActionGroup"> - <annotations> - <description>EXTENDS: LoginToStorefrontActionGroup. Uncheck the 'Remember Me' checkbox.</description> - </annotations> - - <uncheckOption selector="{{StorefrontCustomerSignInFormSection.rememberMe}}" before="clickSignInAccountButton" stepKey="unCheckRememberMe"/> - </actionGroup> - - <actionGroup name="StorefrontRegisterCustomerRememberMe" extends="SignUpNewUserFromStorefrontActionGroup"> - <!--- Assume we are on customer registration page. --> - <remove keyForRemoval="amOnStorefrontPage"/> - <remove keyForRemoval="clickOnCreateAccountLink"/> - <checkOption selector="{{StorefrontCustomerSignInFormSection.rememberMe}}" before="clickCreateAccountButton" stepKey="checkRememberMe"/> - </actionGroup> - - <actionGroup name="StorefrontCreateCustomerOnRegisterPageDoNotRememberMe" extends="SignUpNewUserFromStorefrontActionGroup"> - <!--- Assume we are on customer registration page. --> - <remove keyForRemoval="amOnStorefrontPage"/> - <remove keyForRemoval="clickOnCreateAccountLink"/> - <uncheckOption selector="{{StorefrontCustomerSignInFormSection.rememberMe}}" before="clickCreateAccountButton" stepKey="unCheckRememberMe"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontRegisterCustomerRememberMeActionGroup.xml b/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontRegisterCustomerRememberMeActionGroup.xml new file mode 100644 index 0000000000000..44cdb341b2b10 --- /dev/null +++ b/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontRegisterCustomerRememberMeActionGroup.xml @@ -0,0 +1,17 @@ +<?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="StorefrontRegisterCustomerRememberMeActionGroup" extends="SignUpNewUserFromStorefrontActionGroup"> + <!--- Assume we are on customer registration page. --> + <remove keyForRemoval="amOnStorefrontPage"/> + <remove keyForRemoval="clickOnCreateAccountLink"/> + <checkOption selector="{{StorefrontCustomerSignInFormSection.rememberMe}}" before="clickCreateAccountButton" stepKey="checkRememberMe"/> + </actionGroup> +</actionGroups> From b082a86ec685cbd88a112d8848e99bea2d683ff9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 17:28:23 +0100 Subject: [PATCH 127/586] FIX: Invalid references to ActionGroups after extracting --- ...CreateCustomerOnRegisterPageDoNotRememberMeActionGroup.xml | 1 - .../Test/Mftf/Test/ShippingQuotePersistedForGuestTest.xml | 2 +- ...frontCorrectWelcomeMessageAfterCustomerIsLoggedOutTest.xml | 4 ++-- ...ntVerifyShoppingCartPersistenceUnderLongTermCookieTest.xml | 4 ++-- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontCreateCustomerOnRegisterPageDoNotRememberMeActionGroup.xml b/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontCreateCustomerOnRegisterPageDoNotRememberMeActionGroup.xml index 75ca7bca24dce..9c8f04bf6292a 100644 --- a/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontCreateCustomerOnRegisterPageDoNotRememberMeActionGroup.xml +++ b/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontCreateCustomerOnRegisterPageDoNotRememberMeActionGroup.xml @@ -1,4 +1,3 @@ - <?xml version="1.0" encoding="UTF-8"?> <!-- /** diff --git a/app/code/Magento/Persistent/Test/Mftf/Test/ShippingQuotePersistedForGuestTest.xml b/app/code/Magento/Persistent/Test/Mftf/Test/ShippingQuotePersistedForGuestTest.xml index d508ebaa26885..add7f8a8bc0f8 100644 --- a/app/code/Magento/Persistent/Test/Mftf/Test/ShippingQuotePersistedForGuestTest.xml +++ b/app/code/Magento/Persistent/Test/Mftf/Test/ShippingQuotePersistedForGuestTest.xml @@ -40,7 +40,7 @@ <actionGroup ref="logout" stepKey="logout"/> </after> <!--Step 1: Login as a Customer with remember me checked--> - <actionGroup ref="CustomerLoginOnStorefrontWithRememberMeChecked" stepKey="loginToStorefrontAccountWithRememberMeChecked"> + <actionGroup ref="CustomerLoginOnStorefrontWithRememberMeCheckedActionGroup" stepKey="loginToStorefrontAccountWithRememberMeChecked"> <argument name="Customer" value="$$createCustomer$$"/> </actionGroup> <!--Step 2: Open the Product Page and add the product to shopping cart--> diff --git a/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontCorrectWelcomeMessageAfterCustomerIsLoggedOutTest.xml b/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontCorrectWelcomeMessageAfterCustomerIsLoggedOutTest.xml index 61710cbc98082..b41cad61c93a5 100644 --- a/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontCorrectWelcomeMessageAfterCustomerIsLoggedOutTest.xml +++ b/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontCorrectWelcomeMessageAfterCustomerIsLoggedOutTest.xml @@ -43,7 +43,7 @@ <deleteData createDataKey="createCustomerForPersistent" stepKey="deleteCustomerForPersistent"/> </after> <!--Login as a Customer with remember me unchecked--> - <actionGroup ref="CustomerLoginOnStorefrontWithRememberMeUnChecked" stepKey="loginToStorefrontAccountWithRememberMeUnchecked"> + <actionGroup ref="CustomerLoginOnStorefrontWithRememberMeUnCheckedActionGroup" stepKey="loginToStorefrontAccountWithRememberMeUnchecked"> <argument name="Customer" value="$$createCustomer$$"/> </actionGroup> @@ -60,7 +60,7 @@ stepKey="seeDefaultWelcomeMessage"/> <!--Login as a Customer with remember me checked--> - <actionGroup ref="CustomerLoginOnStorefrontWithRememberMeChecked" stepKey="loginToStorefrontAccountWithRememberMeChecked"> + <actionGroup ref="CustomerLoginOnStorefrontWithRememberMeCheckedActionGroup" stepKey="loginToStorefrontAccountWithRememberMeChecked"> <argument name="Customer" value="$$createCustomerForPersistent$$"/> </actionGroup> <!--Check customer name and last name in welcome message--> diff --git a/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyShoppingCartPersistenceUnderLongTermCookieTest.xml b/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyShoppingCartPersistenceUnderLongTermCookieTest.xml index e50fc4af83107..e80ff5b031125 100644 --- a/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyShoppingCartPersistenceUnderLongTermCookieTest.xml +++ b/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyShoppingCartPersistenceUnderLongTermCookieTest.xml @@ -54,7 +54,7 @@ <actionGroup ref="StorefrontAssertPersistentRegistrationPageFields" stepKey="assertPersistentRegistrationPageFields"/> <!-- 2. Fill fields for registration, set password and unselect the Remember Me checkbox--> - <actionGroup ref="StorefrontCreateCustomerOnRegisterPageDoNotRememberMe" stepKey="registrationJohnSmithCustomer"> + <actionGroup ref="StorefrontCreateCustomerOnRegisterPageDoNotRememberMeActionGroup" stepKey="registrationJohnSmithCustomer"> <argument name="Customer" value="John_Smith_Customer"/> </actionGroup> <!--Check customer name and last name in welcome message--> @@ -83,7 +83,7 @@ <!-- 5. Click the Create an Account link again and fill fields for registration of another customer, set password and check the Remember Me checkbox --> <amOnPage url="{{StorefrontCustomerCreatePage.url}}" stepKey="amOnCustomerAccountCreatePage"/> - <actionGroup ref="StorefrontRegisterCustomerRememberMe" stepKey="registrationJohnDoeCustomer"> + <actionGroup ref="StorefrontRegisterCustomerRememberMeActionGroup" stepKey="registrationJohnDoeCustomer"> <argument name="Customer" value="Simple_Customer_Without_Address"/> </actionGroup> <!--Check customer name and last name in welcome message--> From 59758da8a9ddb601abba21db21e5009da2b1d531 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 17:52:38 +0100 Subject: [PATCH 128/586] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- .../AddProductToCheckoutPageActionGroup.xml | 35 ++++++ ...leOptionPayPalConfigurationActionGroup.xml | 29 +++++ ...ConfigPayPalExpressCheckoutActionGroup.xml | 35 ++++++ ...erWithSelectedPaymentMethodActionGroup.xml | 44 +++++++ .../EnablePayPalConfigurationActionGroup.xml | 31 +++++ ...lePayPalSolutionWithoutSaveActionGroup.xml | 26 ++++ .../OtherPayPalConfigurationActionGroup.xml | 64 ---------- ...xpressCheckoutConfigurationActionGroup.xml | 118 ------------------ ...ConfigPayPalExpressCheckoutActionGroup.xml | 34 +++++ ...figPaymentsConflictResolutionForPayPal.xml | 74 +++++------ ...ayPalSolutionsEnabledAtTheSameTimeTest.xml | 4 +- ...rontCheckCreditButtonConfigurationTest.xml | 2 +- 12 files changed, 274 insertions(+), 222 deletions(-) create mode 100644 app/code/Magento/Paypal/Test/Mftf/ActionGroup/AddProductToCheckoutPageActionGroup.xml create mode 100644 app/code/Magento/Paypal/Test/Mftf/ActionGroup/CheckEnableOptionPayPalConfigurationActionGroup.xml create mode 100644 app/code/Magento/Paypal/Test/Mftf/ActionGroup/ConfigPayPalExpressCheckoutActionGroup.xml create mode 100644 app/code/Magento/Paypal/Test/Mftf/ActionGroup/CreatePayPalOrderWithSelectedPaymentMethodActionGroup.xml create mode 100644 app/code/Magento/Paypal/Test/Mftf/ActionGroup/EnablePayPalConfigurationActionGroup.xml create mode 100644 app/code/Magento/Paypal/Test/Mftf/ActionGroup/EnablePayPalSolutionWithoutSaveActionGroup.xml delete mode 100644 app/code/Magento/Paypal/Test/Mftf/ActionGroup/OtherPayPalConfigurationActionGroup.xml delete mode 100644 app/code/Magento/Paypal/Test/Mftf/ActionGroup/PayPalExpressCheckoutConfigurationActionGroup.xml create mode 100644 app/code/Magento/Paypal/Test/Mftf/ActionGroup/SampleConfigPayPalExpressCheckoutActionGroup.xml diff --git a/app/code/Magento/Paypal/Test/Mftf/ActionGroup/AddProductToCheckoutPageActionGroup.xml b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/AddProductToCheckoutPageActionGroup.xml new file mode 100644 index 0000000000000..bf2643fc535f7 --- /dev/null +++ b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/AddProductToCheckoutPageActionGroup.xml @@ -0,0 +1,35 @@ +<?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="AddProductToCheckoutPageActionGroup"> + <annotations> + <description>Goes to the provided Category page on the Storefront. Adds the 1st Product to the Cart. Goes to Checkout. Select the Shipping Method. Selects PayPal as the Payment Method.</description> + </annotations> + <arguments> + <argument name="Category"/> + </arguments> + + <amOnPage url="{{StorefrontCategoryPage.url(Category.name)}}" stepKey="onCategoryPage"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <moveMouseOver selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" stepKey="hoverProduct"/> + <click selector="{{StorefrontCategoryMainSection.AddToCartBtn}}" stepKey="addToCart"/> + <waitForElementVisible selector="{{StorefrontCategoryMainSection.SuccessMsg}}" time="30" stepKey="waitForProductAdded"/> + <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickCart"/> + <click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="goToCheckout"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> + <click selector="{{CheckoutShippingMethodsSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask2"/> + <waitForElement selector="{{CheckoutShippingMethodsSection.next}}" time="30" stepKey="waitForNextButton"/> + <click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickNext"/> + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPlaceOrderButton"/> + <click selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="clickPayPalCheckbox"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Paypal/Test/Mftf/ActionGroup/CheckEnableOptionPayPalConfigurationActionGroup.xml b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/CheckEnableOptionPayPalConfigurationActionGroup.xml new file mode 100644 index 0000000000000..6fe01799c5422 --- /dev/null +++ b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/CheckEnableOptionPayPalConfigurationActionGroup.xml @@ -0,0 +1,29 @@ +<?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="CheckEnableOptionPayPalConfigurationActionGroup"> + <annotations> + <description>Expands the 'OTHER PAYPAL PAYMENT SOLUTIONS' tab on the Admin Configuration page. Enables the provided PayPal Config type for the provided Country Code.</description> + </annotations> + <arguments> + <argument name="payPalConfigType"/> + <argument name="enabledOption" type="string"/> + <argument name="countryCode" type="string" defaultValue="us"/> + </arguments> + + <waitForElementVisible selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" stepKey="waitForOtherPayPalPaymentsSection"/> + <conditionalClick selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" dependentSelector="{{OtherPayPalPaymentsConfigSection.expandedTab(countryCode)}}" visible="false" stepKey="clickOtherPayPalPaymentsSection"/> + <waitForElementVisible selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="waitForWPSExpressConfigureBtn"/> + <click selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="clickWPSExpressConfigureBtn1"/> + <waitForElementVisible selector="{{payPalConfigType.enableSolution(countryCode)}}" stepKey="waitForWPSExpressEnable"/> + <seeOptionIsSelected selector="{{payPalConfigType.enableSolution(countryCode)}}" userInput="{{enabledOption}}" stepKey="seeSelectedOption"/> + <click selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="clickWPSExpressConfigureBtn2"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Paypal/Test/Mftf/ActionGroup/ConfigPayPalExpressCheckoutActionGroup.xml b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/ConfigPayPalExpressCheckoutActionGroup.xml new file mode 100644 index 0000000000000..90f0a25a8cd69 --- /dev/null +++ b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/ConfigPayPalExpressCheckoutActionGroup.xml @@ -0,0 +1,35 @@ +<?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="ConfigPayPalExpressCheckoutActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'Payment Methods'. Fills in the provided PayPal credentials and other details. Clicks on Save.</description> + </annotations> + <arguments> + <argument name="credentials" defaultValue="_CREDS"/> + <argument name="countryCode" type="string" defaultValue="us"/> + </arguments> + + <amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <click selector="{{PayPalExpressCheckoutConfigSection.configureBtn(countryCode)}}" stepKey="clickPayPalConfigureBtn"/> + <waitForElementVisible selector="{{PayPalAdvancedSettingConfigSection.advancedSettingTab(countryCode)}}" stepKey="waitForAdvancedSettingTab"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.email(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_business_account}}" stepKey="inputEmailAssociatedWithPayPalMerchantAccount"/> + <selectOption selector ="{{PayPalExpressCheckoutConfigSection.apiMethod(countryCode)}}" userInput="API Signature" stepKey="inputAPIAuthenticationMethods"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.username(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_api_username}}" stepKey="inputAPIUsername"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.password(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_api_password}}" stepKey="inputAPIPassword"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.signature(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_api_signature}}" stepKey="inputAPISignature"/> + <selectOption selector ="{{PayPalExpressCheckoutConfigSection.sandboxMode(countryCode)}}" userInput="Yes" stepKey="enableSandboxMode"/> + <selectOption selector="{{PayPalExpressCheckoutConfigSection.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableSolution"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.merchantID(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_merchant_id}}" stepKey="inputMerchantID"/> + <!--Save configuration--> + <click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Paypal/Test/Mftf/ActionGroup/CreatePayPalOrderWithSelectedPaymentMethodActionGroup.xml b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/CreatePayPalOrderWithSelectedPaymentMethodActionGroup.xml new file mode 100644 index 0000000000000..49ebe90418436 --- /dev/null +++ b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/CreatePayPalOrderWithSelectedPaymentMethodActionGroup.xml @@ -0,0 +1,44 @@ +<?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="CreatePayPalOrderWithSelectedPaymentMethodActionGroup" extends="CreateOrderToPrintPageActionGroup"> + <annotations> + <description>EXTENDS: CreateOrderToPrintPageActionGroup. Clicks on PayPal. Fills the PayPay details in the modal. PLEASE NOTE: The PayPal Payment credentials are Hardcoded using 'Payer'.</description> + </annotations> + <arguments> + <argument name="payerName" defaultValue="MPI" type="string"/> + <argument name="credentials" defaultValue="_CREDS"/> + </arguments> + + <!-- click on PayPal payment radio button --> + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPlaceOrderButton"/> + <click selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="clickPlaceOrder"/> + + <!--set ID for iframe of PayPal group button--> + <executeJS function="jQuery('.zoid-component-frame.zoid-visible').attr('id', 'myIframe')" stepKey="clickOrderLink"/> + + <!--switch to iframe of PayPal group button--> + <switchToIFrame userInput="myIframe" stepKey="clickPrintOrderLink"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.PayPalBtn}}" stepKey="waitForPayPalBtn"/> + <click selector="{{CheckoutPaymentSection.PayPalBtn}}" stepKey="clickPayPalBtn"/> + <switchToIFrame stepKey="switchBack1"/> + + <!--Check in-context--> + <switchToNextTab stepKey="switchToInContentTab"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <seeCurrentUrlMatches regex="~\//www.sandbox.paypal.com/~" stepKey="seeCurrentUrlMatchesConfigPath1"/> + <waitForElement selector="{{PayPalPaymentSection.email}}" stepKey="waitForLoginForm" /> + <fillField selector="{{PayPalPaymentSection.email}}" userInput="{{credentials.magento/paypal_sandbox_login_email}}" stepKey="fillEmail"/> + <fillField selector="{{PayPalPaymentSection.password}}" userInput="{{credentials.magento/paypal_sandbox_login_password}}" stepKey="fillPassword"/> + <click selector="{{PayPalPaymentSection.loginBtn}}" stepKey="login"/> + <waitForPageLoad stepKey="wait"/> + <see userInput="{{payerName}}" selector="{{PayPalPaymentSection.reviewUserInfo}}" stepKey="seePayerName"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Paypal/Test/Mftf/ActionGroup/EnablePayPalConfigurationActionGroup.xml b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/EnablePayPalConfigurationActionGroup.xml new file mode 100644 index 0000000000000..b653858f770e9 --- /dev/null +++ b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/EnablePayPalConfigurationActionGroup.xml @@ -0,0 +1,31 @@ +<?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="EnablePayPalConfigurationActionGroup"> + <annotations> + <description>Expands the 'OTHER PAYPAL PAYMENT SOLUTIONS' tab on the Admin Configuration page. Enables the provided PayPal Config type for the provided Country Code.</description> + </annotations> + <arguments> + <argument name="payPalConfigType"/> + <argument name="countryCode" type="string" defaultValue="us"/> + </arguments> + + <waitForElementVisible selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" stepKey="waitForOtherPayPalPaymentsSection"/> + <conditionalClick selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" dependentSelector="{{OtherPayPalPaymentsConfigSection.expandedTab(countryCode)}}" visible="false" stepKey="clickOtherPayPalPaymentsSection"/> + <waitForElementVisible selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="waitForWPSExpressConfigureBtn"/> + <click selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="clickWPSExpressConfigureBtn"/> + <waitForElementVisible selector="{{payPalConfigType.enableSolution(countryCode)}}" stepKey="waitForWPSExpressEnable"/> + <selectOption selector="{{payPalConfigType.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableWPSExpressSolution"/> + <seeInPopup userInput="There is already another PayPal solution enabled. Enable this solution instead?" stepKey="seeAlertMessage"/> + <acceptPopup stepKey="acceptEnablePopUp"/> + <click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Paypal/Test/Mftf/ActionGroup/EnablePayPalSolutionWithoutSaveActionGroup.xml b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/EnablePayPalSolutionWithoutSaveActionGroup.xml new file mode 100644 index 0000000000000..51b70b10a8827 --- /dev/null +++ b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/EnablePayPalSolutionWithoutSaveActionGroup.xml @@ -0,0 +1,26 @@ +<?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="EnablePayPalSolutionWithoutSaveActionGroup" > + <annotations> + <description>Expands the 'OTHER PAYPAL PAYMENT SOLUTIONS' tab on the Admin Configuration page. Enables the provided PayPal Config type for the provided Country Code without saving.</description> + </annotations> + <arguments> + <argument name="payPalConfigType"/> + <argument name="countryCode" type="string" defaultValue="us"/> + </arguments> + <waitForElementVisible selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" stepKey="waitForOtherPayPalPaymentsSection"/> + <conditionalClick selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" dependentSelector="{{OtherPayPalPaymentsConfigSection.expandedTab(countryCode)}}" visible="false" stepKey="clickOtherPayPalPaymentsSection"/> + <waitForElementVisible selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="waitForWPSExpressConfigureBtn"/> + <click selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="clickWPSExpressConfigureBtn"/> + <waitForElementVisible selector="{{payPalConfigType.enableSolution(countryCode)}}" stepKey="waitForWPSExpressEnable"/> + <selectOption selector="{{payPalConfigType.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableWPSExpressSolution"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Paypal/Test/Mftf/ActionGroup/OtherPayPalConfigurationActionGroup.xml b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/OtherPayPalConfigurationActionGroup.xml deleted file mode 100644 index c3e99854ce3ac..0000000000000 --- a/app/code/Magento/Paypal/Test/Mftf/ActionGroup/OtherPayPalConfigurationActionGroup.xml +++ /dev/null @@ -1,64 +0,0 @@ -<?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="EnablePayPalConfiguration"> - <annotations> - <description>Expands the 'OTHER PAYPAL PAYMENT SOLUTIONS' tab on the Admin Configuration page. Enables the provided PayPal Config type for the provided Country Code.</description> - </annotations> - <arguments> - <argument name="payPalConfigType"/> - <argument name="countryCode" type="string" defaultValue="us"/> - </arguments> - - <waitForElementVisible selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" stepKey="waitForOtherPayPalPaymentsSection"/> - <conditionalClick selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" dependentSelector="{{OtherPayPalPaymentsConfigSection.expandedTab(countryCode)}}" visible="false" stepKey="clickOtherPayPalPaymentsSection"/> - <waitForElementVisible selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="waitForWPSExpressConfigureBtn"/> - <click selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="clickWPSExpressConfigureBtn"/> - <waitForElementVisible selector="{{payPalConfigType.enableSolution(countryCode)}}" stepKey="waitForWPSExpressEnable"/> - <selectOption selector="{{payPalConfigType.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableWPSExpressSolution"/> - <seeInPopup userInput="There is already another PayPal solution enabled. Enable this solution instead?" stepKey="seeAlertMessage"/> - <acceptPopup stepKey="acceptEnablePopUp"/> - <click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - </actionGroup> - <actionGroup name="EnablePayPalSolutionWithoutSave" > - <annotations> - <description>Expands the 'OTHER PAYPAL PAYMENT SOLUTIONS' tab on the Admin Configuration page. Enables the provided PayPal Config type for the provided Country Code without saving.</description> - </annotations> - <arguments> - <argument name="payPalConfigType"/> - <argument name="countryCode" type="string" defaultValue="us"/> - </arguments> - <waitForElementVisible selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" stepKey="waitForOtherPayPalPaymentsSection"/> - <conditionalClick selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" dependentSelector="{{OtherPayPalPaymentsConfigSection.expandedTab(countryCode)}}" visible="false" stepKey="clickOtherPayPalPaymentsSection"/> - <waitForElementVisible selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="waitForWPSExpressConfigureBtn"/> - <click selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="clickWPSExpressConfigureBtn"/> - <waitForElementVisible selector="{{payPalConfigType.enableSolution(countryCode)}}" stepKey="waitForWPSExpressEnable"/> - <selectOption selector="{{payPalConfigType.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableWPSExpressSolution"/> - </actionGroup> - <actionGroup name="CheckEnableOptionPayPalConfiguration"> - <annotations> - <description>Expands the 'OTHER PAYPAL PAYMENT SOLUTIONS' tab on the Admin Configuration page. Enables the provided PayPal Config type for the provided Country Code.</description> - </annotations> - <arguments> - <argument name="payPalConfigType"/> - <argument name="enabledOption" type="string"/> - <argument name="countryCode" type="string" defaultValue="us"/> - </arguments> - - <waitForElementVisible selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" stepKey="waitForOtherPayPalPaymentsSection"/> - <conditionalClick selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" dependentSelector="{{OtherPayPalPaymentsConfigSection.expandedTab(countryCode)}}" visible="false" stepKey="clickOtherPayPalPaymentsSection"/> - <waitForElementVisible selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="waitForWPSExpressConfigureBtn"/> - <click selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="clickWPSExpressConfigureBtn1"/> - <waitForElementVisible selector="{{payPalConfigType.enableSolution(countryCode)}}" stepKey="waitForWPSExpressEnable"/> - <seeOptionIsSelected selector="{{payPalConfigType.enableSolution(countryCode)}}" userInput="{{enabledOption}}" stepKey="seeSelectedOption"/> - <click selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="clickWPSExpressConfigureBtn2"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Paypal/Test/Mftf/ActionGroup/PayPalExpressCheckoutConfigurationActionGroup.xml b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/PayPalExpressCheckoutConfigurationActionGroup.xml deleted file mode 100644 index 4d752d8377640..0000000000000 --- a/app/code/Magento/Paypal/Test/Mftf/ActionGroup/PayPalExpressCheckoutConfigurationActionGroup.xml +++ /dev/null @@ -1,118 +0,0 @@ -<?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="ConfigPayPalExpressCheckout"> - <annotations> - <description>Goes to the 'Configuration' page for 'Payment Methods'. Fills in the provided PayPal credentials and other details. Clicks on Save.</description> - </annotations> - <arguments> - <argument name="credentials" defaultValue="_CREDS"/> - <argument name="countryCode" type="string" defaultValue="us"/> - </arguments> - - <amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - <click selector="{{PayPalExpressCheckoutConfigSection.configureBtn(countryCode)}}" stepKey="clickPayPalConfigureBtn"/> - <waitForElementVisible selector="{{PayPalAdvancedSettingConfigSection.advancedSettingTab(countryCode)}}" stepKey="waitForAdvancedSettingTab"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.email(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_business_account}}" stepKey="inputEmailAssociatedWithPayPalMerchantAccount"/> - <selectOption selector ="{{PayPalExpressCheckoutConfigSection.apiMethod(countryCode)}}" userInput="API Signature" stepKey="inputAPIAuthenticationMethods"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.username(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_api_username}}" stepKey="inputAPIUsername"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.password(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_api_password}}" stepKey="inputAPIPassword"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.signature(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_api_signature}}" stepKey="inputAPISignature"/> - <selectOption selector ="{{PayPalExpressCheckoutConfigSection.sandboxMode(countryCode)}}" userInput="Yes" stepKey="enableSandboxMode"/> - <selectOption selector="{{PayPalExpressCheckoutConfigSection.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableSolution"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.merchantID(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_merchant_id}}" stepKey="inputMerchantID"/> - <!--Save configuration--> - <click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/> - </actionGroup> - - <actionGroup name="SampleConfigPayPalExpressCheckout"> - <annotations> - <description>Goes to the 'Configuration' page for 'Payment Methods'. Fills in the provided Sample PayPal credentials and other details. Clicks on Save.</description> - </annotations> - <arguments> - <argument name="credentials" defaultValue="SamplePaypalExpressConfig"/> - <argument name="countryCode" type="string" defaultValue="us"/> - </arguments> - <amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - <click selector="{{PayPalExpressCheckoutConfigSection.configureBtn(countryCode)}}" stepKey="clickPayPalConfigureBtn"/> - <waitForElementVisible selector="{{PayPalAdvancedSettingConfigSection.advancedSettingTab(countryCode)}}" stepKey="waitForAdvancedSettingTab"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.email(countryCode)}}" userInput="{{credentials.paypal_express_email}}" stepKey="inputEmailAssociatedWithPayPalMerchantAccount"/> - <selectOption selector ="{{PayPalExpressCheckoutConfigSection.apiMethod(countryCode)}}" userInput="API Signature" stepKey="inputAPIAuthenticationMethods"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.username(countryCode)}}" userInput="{{credentials.paypal_express_api_username}}" stepKey="inputAPIUsername"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.password(countryCode)}}" userInput="{{credentials.paypal_express_api_password}}" stepKey="inputAPIPassword"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.signature(countryCode)}}" userInput="{{credentials.paypal_express_api_signature}}" stepKey="inputAPISignature"/> - <selectOption selector ="{{PayPalExpressCheckoutConfigSection.sandboxMode(countryCode)}}" userInput="Yes" stepKey="enableSandboxMode"/> - <selectOption selector="{{PayPalExpressCheckoutConfigSection.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableSolution"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.merchantID(countryCode)}}" userInput="{{credentials.paypal_express_merchantID}}" stepKey="inputMerchantID"/> - <!--Save configuration--> - <click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/> - </actionGroup> - - <actionGroup name="CreatePayPalOrderWithSelectedPaymentMethodActionGroup" extends="CreateOrderToPrintPageActionGroup"> - <annotations> - <description>EXTENDS: CreateOrderToPrintPageActionGroup. Clicks on PayPal. Fills the PayPay details in the modal. PLEASE NOTE: The PayPal Payment credentials are Hardcoded using 'Payer'.</description> - </annotations> - <arguments> - <argument name="payerName" defaultValue="MPI" type="string"/> - <argument name="credentials" defaultValue="_CREDS"/> - </arguments> - - <!-- click on PayPal payment radio button --> - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPlaceOrderButton"/> - <click selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="clickPlaceOrder"/> - - <!--set ID for iframe of PayPal group button--> - <executeJS function="jQuery('.zoid-component-frame.zoid-visible').attr('id', 'myIframe')" stepKey="clickOrderLink"/> - - <!--switch to iframe of PayPal group button--> - <switchToIFrame userInput="myIframe" stepKey="clickPrintOrderLink"/> - <waitForElementVisible selector="{{CheckoutPaymentSection.PayPalBtn}}" stepKey="waitForPayPalBtn"/> - <click selector="{{CheckoutPaymentSection.PayPalBtn}}" stepKey="clickPayPalBtn"/> - <switchToIFrame stepKey="switchBack1"/> - - <!--Check in-context--> - <switchToNextTab stepKey="switchToInContentTab"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <seeCurrentUrlMatches regex="~\//www.sandbox.paypal.com/~" stepKey="seeCurrentUrlMatchesConfigPath1"/> - <waitForElement selector="{{PayPalPaymentSection.email}}" stepKey="waitForLoginForm" /> - <fillField selector="{{PayPalPaymentSection.email}}" userInput="{{credentials.magento/paypal_sandbox_login_email}}" stepKey="fillEmail"/> - <fillField selector="{{PayPalPaymentSection.password}}" userInput="{{credentials.magento/paypal_sandbox_login_password}}" stepKey="fillPassword"/> - <click selector="{{PayPalPaymentSection.loginBtn}}" stepKey="login"/> - <waitForPageLoad stepKey="wait"/> - <see userInput="{{payerName}}" selector="{{PayPalPaymentSection.reviewUserInfo}}" stepKey="seePayerName"/> - </actionGroup> - - <actionGroup name="addProductToCheckoutPage"> - <annotations> - <description>Goes to the provided Category page on the Storefront. Adds the 1st Product to the Cart. Goes to Checkout. Select the Shipping Method. Selects PayPal as the Payment Method.</description> - </annotations> - <arguments> - <argument name="Category"/> - </arguments> - - <amOnPage url="{{StorefrontCategoryPage.url(Category.name)}}" stepKey="onCategoryPage"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - <moveMouseOver selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" stepKey="hoverProduct"/> - <click selector="{{StorefrontCategoryMainSection.AddToCartBtn}}" stepKey="addToCart"/> - <waitForElementVisible selector="{{StorefrontCategoryMainSection.SuccessMsg}}" time="30" stepKey="waitForProductAdded"/> - <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickCart"/> - <click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="goToCheckout"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> - <click selector="{{CheckoutShippingMethodsSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask2"/> - <waitForElement selector="{{CheckoutShippingMethodsSection.next}}" time="30" stepKey="waitForNextButton"/> - <click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickNext"/> - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPlaceOrderButton"/> - <click selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="clickPayPalCheckbox"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Paypal/Test/Mftf/ActionGroup/SampleConfigPayPalExpressCheckoutActionGroup.xml b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/SampleConfigPayPalExpressCheckoutActionGroup.xml new file mode 100644 index 0000000000000..23d956c8e9b8f --- /dev/null +++ b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/SampleConfigPayPalExpressCheckoutActionGroup.xml @@ -0,0 +1,34 @@ +<?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="SampleConfigPayPalExpressCheckoutActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'Payment Methods'. Fills in the provided Sample PayPal credentials and other details. Clicks on Save.</description> + </annotations> + <arguments> + <argument name="credentials" defaultValue="SamplePaypalExpressConfig"/> + <argument name="countryCode" type="string" defaultValue="us"/> + </arguments> + <amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <click selector="{{PayPalExpressCheckoutConfigSection.configureBtn(countryCode)}}" stepKey="clickPayPalConfigureBtn"/> + <waitForElementVisible selector="{{PayPalAdvancedSettingConfigSection.advancedSettingTab(countryCode)}}" stepKey="waitForAdvancedSettingTab"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.email(countryCode)}}" userInput="{{credentials.paypal_express_email}}" stepKey="inputEmailAssociatedWithPayPalMerchantAccount"/> + <selectOption selector ="{{PayPalExpressCheckoutConfigSection.apiMethod(countryCode)}}" userInput="API Signature" stepKey="inputAPIAuthenticationMethods"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.username(countryCode)}}" userInput="{{credentials.paypal_express_api_username}}" stepKey="inputAPIUsername"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.password(countryCode)}}" userInput="{{credentials.paypal_express_api_password}}" stepKey="inputAPIPassword"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.signature(countryCode)}}" userInput="{{credentials.paypal_express_api_signature}}" stepKey="inputAPISignature"/> + <selectOption selector ="{{PayPalExpressCheckoutConfigSection.sandboxMode(countryCode)}}" userInput="Yes" stepKey="enableSandboxMode"/> + <selectOption selector="{{PayPalExpressCheckoutConfigSection.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableSolution"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.merchantID(countryCode)}}" userInput="{{credentials.paypal_express_merchantID}}" stepKey="inputMerchantID"/> + <!--Save configuration--> + <click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Paypal/Test/Mftf/Test/AdminConfigPaymentsConflictResolutionForPayPal.xml b/app/code/Magento/Paypal/Test/Mftf/Test/AdminConfigPaymentsConflictResolutionForPayPal.xml index cfc7d66ba23cf..e918a417dcfde 100644 --- a/app/code/Magento/Paypal/Test/Mftf/Test/AdminConfigPaymentsConflictResolutionForPayPal.xml +++ b/app/code/Magento/Paypal/Test/Mftf/Test/AdminConfigPaymentsConflictResolutionForPayPal.xml @@ -20,7 +20,7 @@ </annotations> <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="SampleConfigPayPalExpressCheckout" stepKey="ConfigPayPalExpress"> + <actionGroup ref="SampleConfigPayPalExpressCheckoutActionGroup" stepKey="ConfigPayPalExpress"> <argument name="credentials" value="SamplePaypalExpressConfig"/> </actionGroup> </before> @@ -38,36 +38,36 @@ <waitForPageLoad stepKey="waitForPageLoad1"/> <!-- Enable WPS Express --> <comment userInput="Enable WPS Express" stepKey="enableWPSExpressComment"/> - <actionGroup ref="EnablePayPalConfiguration" stepKey="EnableWPSExpress"> + <actionGroup ref="EnablePayPalConfigurationActionGroup" stepKey="EnableWPSExpress"> <argument name="payPalConfigType" value="WPSExpressConfigSection"/> <argument name="countryCode" value="gb"/> </actionGroup> <!-- Check only the correct solution is enabled --> <comment userInput="Check only the correct solution is enabled" stepKey="checkOnlyTheCorrectSolutionIsEnabledComment1"/> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkPayPalExpressIsDisabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkPayPalExpressIsDisabled"> <argument name="payPalConfigType" value="PayPalExpressCheckoutConfigSection"/> <argument name="enabledOption" value="No"/> <argument name="countryCode" value="gb"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkWPSExpressIsEnabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkWPSExpressIsEnabled"> <argument name="payPalConfigType" value="WPSExpressConfigSection"/> <argument name="enabledOption" value="Yes"/> <argument name="countryCode" value="gb"/> </actionGroup> <!-- Enable Pro Hosted With Express Checkout --> <comment userInput="Enable Pro Hosted With Express Checkout" stepKey="enableProHostedWithExpressCheckoutComment"/> - <actionGroup ref="EnablePayPalConfiguration" stepKey="EnableProHostedWithExpressCheckou"> + <actionGroup ref="EnablePayPalConfigurationActionGroup" stepKey="EnableProHostedWithExpressCheckou"> <argument name="payPalConfigType" value="PaymentsProHostedWithExpressCheckoutConfigSection"/> <argument name="countryCode" value="gb"/> </actionGroup> <!-- Check only the correct solution is enabled --> <comment userInput="Check only the correct solution is enabled" stepKey="checkOnlyTheCorrectSolutionIsEnabledComment2"/> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkWPSExpressIsDisabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkWPSExpressIsDisabled"> <argument name="payPalConfigType" value="WPSExpressConfigSection"/> <argument name="enabledOption" value="No"/> <argument name="countryCode" value="gb"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkProHostedIsEnabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkProHostedIsEnabled"> <argument name="payPalConfigType" value="PaymentsProHostedWithExpressCheckoutConfigSection"/> <argument name="enabledOption" value="Yes"/> <argument name="countryCode" value="gb"/> @@ -84,30 +84,30 @@ <group value="paypal"/> </annotations> <selectOption selector="{{PaymentsConfigSection.merchantCountry}}" userInput="Japan" stepKey="setMerchantCountry"/> - <actionGroup ref="EnablePayPalConfiguration" stepKey="EnableWPSExpress"> + <actionGroup ref="EnablePayPalConfigurationActionGroup" stepKey="EnableWPSExpress"> <argument name="payPalConfigType" value="WPSOtherConfigSection"/> <argument name="countryCode" value="jp"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkPayPalExpressIsDisabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkPayPalExpressIsDisabled"> <argument name="payPalConfigType" value="PayPalExpressCheckoutOtherCountryConfigSection"/> <argument name="enabledOption" value="No"/> <argument name="countryCode" value="jp"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkWPSExpressIsEnabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkWPSExpressIsEnabled"> <argument name="payPalConfigType" value="WPSOtherConfigSection"/> <argument name="enabledOption" value="Yes"/> <argument name="countryCode" value="jp"/> </actionGroup> - <actionGroup ref="EnablePayPalConfiguration" stepKey="EnableProHostedWithExpressCheckou"> + <actionGroup ref="EnablePayPalConfigurationActionGroup" stepKey="EnableProHostedWithExpressCheckou"> <argument name="payPalConfigType" value="WebsitePaymentsPlusConfigSection"/> <argument name="countryCode" value="jp"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkWPSExpressIsDisabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkWPSExpressIsDisabled"> <argument name="payPalConfigType" value="WPSOtherConfigSection"/> <argument name="enabledOption" value="No"/> <argument name="countryCode" value="jp"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkProHostedIsEnabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkProHostedIsEnabled"> <argument name="payPalConfigType" value="WebsitePaymentsPlusConfigSection"/> <argument name="enabledOption" value="Yes"/> <argument name="countryCode" value="jp"/> @@ -124,30 +124,30 @@ <group value="paypal"/> </annotations> <selectOption selector="{{PaymentsConfigSection.merchantCountry}}" userInput="France" stepKey="setMerchantCountry"/> - <actionGroup ref="EnablePayPalConfiguration" stepKey="EnableWPSExpress"> + <actionGroup ref="EnablePayPalConfigurationActionGroup" stepKey="EnableWPSExpress"> <argument name="payPalConfigType" value="WPSOtherConfigSection"/> <argument name="countryCode" value="fr"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkPayPalExpressIsDisabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkPayPalExpressIsDisabled"> <argument name="payPalConfigType" value="PayPalExpressCheckoutOtherCountryConfigSection"/> <argument name="enabledOption" value="No"/> <argument name="countryCode" value="fr"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkWPSExpressIsEnabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkWPSExpressIsEnabled"> <argument name="payPalConfigType" value="WPSOtherConfigSection"/> <argument name="enabledOption" value="Yes"/> <argument name="countryCode" value="fr"/> </actionGroup> - <actionGroup ref="EnablePayPalConfiguration" stepKey="EnableProHostedWithExpressCheckou"> + <actionGroup ref="EnablePayPalConfigurationActionGroup" stepKey="EnableProHostedWithExpressCheckou"> <argument name="payPalConfigType" value="WebsitePaymentsPlusConfigSection"/> <argument name="countryCode" value="fr"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkWPSExpressIsDisabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkWPSExpressIsDisabled"> <argument name="payPalConfigType" value="WPSOtherConfigSection"/> <argument name="enabledOption" value="No"/> <argument name="countryCode" value="fr"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkProHostedIsEnabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkProHostedIsEnabled"> <argument name="payPalConfigType" value="WebsitePaymentsPlusConfigSection"/> <argument name="enabledOption" value="Yes"/> <argument name="countryCode" value="fr"/> @@ -164,30 +164,30 @@ <group value="paypal"/> </annotations> <selectOption selector="{{PaymentsConfigSection.merchantCountry}}" userInput="Hong Kong SAR China" stepKey="setMerchantCountry"/> - <actionGroup ref="EnablePayPalConfiguration" stepKey="EnableWPSExpress"> + <actionGroup ref="EnablePayPalConfigurationActionGroup" stepKey="EnableWPSExpress"> <argument name="payPalConfigType" value="WPSOtherConfigSection"/> <argument name="countryCode" value="hk"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkPayPalExpressIsDisabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkPayPalExpressIsDisabled"> <argument name="payPalConfigType" value="PayPalExpressCheckoutOtherCountryConfigSection"/> <argument name="enabledOption" value="No"/> <argument name="countryCode" value="hk"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkWPSExpressIsEnabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkWPSExpressIsEnabled"> <argument name="payPalConfigType" value="WPSOtherConfigSection"/> <argument name="enabledOption" value="Yes"/> <argument name="countryCode" value="hk"/> </actionGroup> - <actionGroup ref="EnablePayPalConfiguration" stepKey="EnableProHostedWithExpressCheckou"> + <actionGroup ref="EnablePayPalConfigurationActionGroup" stepKey="EnableProHostedWithExpressCheckou"> <argument name="payPalConfigType" value="WebsitePaymentsPlusConfigSection"/> <argument name="countryCode" value="hk"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkWPSExpressIsDisabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkWPSExpressIsDisabled"> <argument name="payPalConfigType" value="WPSOtherConfigSection"/> <argument name="enabledOption" value="No"/> <argument name="countryCode" value="hk"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkProHostedIsEnabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkProHostedIsEnabled"> <argument name="payPalConfigType" value="WebsitePaymentsPlusConfigSection"/> <argument name="enabledOption" value="Yes"/> <argument name="countryCode" value="hk"/> @@ -204,30 +204,30 @@ <group value="paypal"/> </annotations> <selectOption selector="{{PaymentsConfigSection.merchantCountry}}" userInput="Italy" stepKey="setMerchantCountry"/> - <actionGroup ref="EnablePayPalConfiguration" stepKey="EnableWPSExpress"> + <actionGroup ref="EnablePayPalConfigurationActionGroup" stepKey="EnableWPSExpress"> <argument name="payPalConfigType" value="WPSOtherConfigSection"/> <argument name="countryCode" value="it"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkPayPalExpressIsDisabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkPayPalExpressIsDisabled"> <argument name="payPalConfigType" value="PayPalExpressCheckoutOtherCountryConfigSection"/> <argument name="enabledOption" value="No"/> <argument name="countryCode" value="it"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkWPSExpressIsEnabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkWPSExpressIsEnabled"> <argument name="payPalConfigType" value="WPSOtherConfigSection"/> <argument name="enabledOption" value="Yes"/> <argument name="countryCode" value="it"/> </actionGroup> - <actionGroup ref="EnablePayPalConfiguration" stepKey="EnableProHostedWithExpressCheckou"> + <actionGroup ref="EnablePayPalConfigurationActionGroup" stepKey="EnableProHostedWithExpressCheckou"> <argument name="payPalConfigType" value="WebsitePaymentsPlusConfigSection"/> <argument name="countryCode" value="it"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkWPSExpressIsDisabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkWPSExpressIsDisabled"> <argument name="payPalConfigType" value="WPSOtherConfigSection"/> <argument name="enabledOption" value="No"/> <argument name="countryCode" value="it"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkProHostedIsEnabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkProHostedIsEnabled"> <argument name="payPalConfigType" value="WebsitePaymentsPlusConfigSection"/> <argument name="enabledOption" value="Yes"/> <argument name="countryCode" value="it"/> @@ -244,30 +244,30 @@ <group value="paypal"/> </annotations> <selectOption selector="{{PaymentsConfigSection.merchantCountry}}" userInput="Spain" stepKey="setMerchantCountry"/> - <actionGroup ref="EnablePayPalConfiguration" stepKey="EnableWPSExpress"> + <actionGroup ref="EnablePayPalConfigurationActionGroup" stepKey="EnableWPSExpress"> <argument name="payPalConfigType" value="WPSOtherConfigSection"/> <argument name="countryCode" value="es"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkPayPalExpressIsDisabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkPayPalExpressIsDisabled"> <argument name="payPalConfigType" value="PayPalExpressCheckoutOtherCountryConfigSection"/> <argument name="enabledOption" value="No"/> <argument name="countryCode" value="es"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkWPSExpressIsEnabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkWPSExpressIsEnabled"> <argument name="payPalConfigType" value="WPSOtherConfigSection"/> <argument name="enabledOption" value="Yes"/> <argument name="countryCode" value="es"/> </actionGroup> - <actionGroup ref="EnablePayPalConfiguration" stepKey="EnableProHostedWithExpressCheckou"> + <actionGroup ref="EnablePayPalConfigurationActionGroup" stepKey="EnableProHostedWithExpressCheckou"> <argument name="payPalConfigType" value="WebsitePaymentsPlusConfigSection"/> <argument name="countryCode" value="es"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkWPSExpressIsDisabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkWPSExpressIsDisabled"> <argument name="payPalConfigType" value="WPSOtherConfigSection"/> <argument name="enabledOption" value="No"/> <argument name="countryCode" value="es"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkProHostedIsEnabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkProHostedIsEnabled"> <argument name="payPalConfigType" value="WebsitePaymentsPlusConfigSection"/> <argument name="enabledOption" value="Yes"/> <argument name="countryCode" value="es"/> diff --git a/app/code/Magento/Paypal/Test/Mftf/Test/AdminOnePayPalSolutionsEnabledAtTheSameTimeTest.xml b/app/code/Magento/Paypal/Test/Mftf/Test/AdminOnePayPalSolutionsEnabledAtTheSameTimeTest.xml index c653c1f03fd74..fd0e74f38287d 100644 --- a/app/code/Magento/Paypal/Test/Mftf/Test/AdminOnePayPalSolutionsEnabledAtTheSameTimeTest.xml +++ b/app/code/Magento/Paypal/Test/Mftf/Test/AdminOnePayPalSolutionsEnabledAtTheSameTimeTest.xml @@ -39,13 +39,13 @@ <!--Try to enable express checkout Solution--> <comment userInput="Try to enable express checkout Solution" stepKey="commentTryEnableExpressCheckout"/> <amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/> - <actionGroup ref="EnablePayPalSolutionWithoutSave" stepKey="enableExpressCheckout"> + <actionGroup ref="EnablePayPalSolutionWithoutSaveActionGroup" stepKey="enableExpressCheckout"> <argument name="payPalConfigType" value="WPSExpressConfigSection"/> <argument name="countryCode" value="us"/> </actionGroup> <click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/> <waitForPageLoad stepKey="waitForPageLoad2"/> - <actionGroup ref="EnablePayPalSolutionWithoutSave" stepKey="enableExpressCheckout2"> + <actionGroup ref="EnablePayPalSolutionWithoutSaveActionGroup" stepKey="enableExpressCheckout2"> <argument name="payPalConfigType" value="PayPalExpressCheckoutConfigSection"/> <argument name="countryCode" value="us"/> </actionGroup> diff --git a/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontCheckCreditButtonConfigurationTest.xml b/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontCheckCreditButtonConfigurationTest.xml index d8cea82bcc2f5..78a27106bf406 100644 --- a/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontCheckCreditButtonConfigurationTest.xml +++ b/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontCheckCreditButtonConfigurationTest.xml @@ -65,7 +65,7 @@ <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer"> <argument name="Customer" value="$$createCustomer$$"/> </actionGroup> - <actionGroup ref="addProductToCheckoutPage" stepKey="addProductToCheckoutPage"> + <actionGroup ref="AddProductToCheckoutPageActionGroup" stepKey="addProductToCheckoutPage"> <argument name="Category" value="$$createPreReqCategory$$"/> </actionGroup> <!--set ID for iframe of PayPal group button--> From 9f774144e527e81df731900005c249e2714f825c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 21:27:24 +0100 Subject: [PATCH 129/586] REFACTOR: Replace redundant Action Group with the same one --- .../Mftf/ActionGroup/ClearCacheActionGroup.xml | 15 +-------------- .../Test/Mftf/Test/NewProductsListWidgetTest.xml | 14 +++++++------- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/app/code/Magento/PageCache/Test/Mftf/ActionGroup/ClearCacheActionGroup.xml b/app/code/Magento/PageCache/Test/Mftf/ActionGroup/ClearCacheActionGroup.xml index 1eec4b40db68d..4bd68fa1e9929 100644 --- a/app/code/Magento/PageCache/Test/Mftf/ActionGroup/ClearCacheActionGroup.xml +++ b/app/code/Magento/PageCache/Test/Mftf/ActionGroup/ClearCacheActionGroup.xml @@ -12,23 +12,10 @@ <annotations> <description>Goes to the Admin Cache Management page. Clicks on 'Flush Magento Cache'.</description> </annotations> - + <amOnPage url="{{_ENV.MAGENTO_BACKEND_NAME}}/admin/cache/" stepKey="goToNewCustomVarialePage"/> <waitForPageLoad stepKey="waitForPageLoad"/> <click selector="{{AdminCacheManagementSection.FlushMagentoCache}}" stepKey="clickFlushMagentoCache"/> <waitForPageLoad stepKey="waitForCacheFlush"/> </actionGroup> - - <actionGroup name="clearPageCache"> - <annotations> - <description>Goes to the Admin Cache Management page. Selects 'Refresh'. Checks the 'Page Cache' row. Clicks on Submit.</description> - </annotations> - - <amOnPage url="{{_ENV.MAGENTO_BACKEND_NAME}}/admin/cache/" stepKey="amOnCacheManagementPage"/> - <waitForPageLoad stepKey="waitForCacheManagement"/> - <selectOption selector="{{AdminCacheManagementSection.massActionSelect}}" userInput="refresh" stepKey="selectRefresh"/> - <click selector="{{AdminCacheManagementSection.pageCacheCheckbox}}" stepKey="selectPageCache"/> - <click selector="{{AdminCacheManagementSection.massActionSubmit}}" stepKey="submitCacheForm"/> - <waitForPageLoad stepKey="waitForCacheFlush"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/PageCache/Test/Mftf/Test/NewProductsListWidgetTest.xml b/app/code/Magento/PageCache/Test/Mftf/Test/NewProductsListWidgetTest.xml index a3c9e7b39217d..e7dc40c20f4dd 100644 --- a/app/code/Magento/PageCache/Test/Mftf/Test/NewProductsListWidgetTest.xml +++ b/app/code/Magento/PageCache/Test/Mftf/Test/NewProductsListWidgetTest.xml @@ -9,21 +9,21 @@ <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="NewProductsListWidgetSimpleProductTest"> - <actionGroup ref="clearPageCache" stepKey="clearPageCache" before="amOnCmsPage"/> + <actionGroup ref="ClearPageCacheActionGroup" stepKey="clearPageCache" before="amOnCmsPage"/> </test> <test name="NewProductsListWidgetConfigurableProductTest"> - <actionGroup ref="clearPageCache" stepKey="clearPageCache" after="clickSaveProduct"/> + <actionGroup ref="ClearPageCacheActionGroup" stepKey="clearPageCache" after="clickSaveProduct"/> </test> <test name="NewProductsListWidgetGroupedProductTest"> - <actionGroup ref="clearPageCache" stepKey="clearPageCache" after="clickSaveProduct"/> + <actionGroup ref="ClearPageCacheActionGroup" stepKey="clearPageCache" after="clickSaveProduct"/> </test> <test name="NewProductsListWidgetVirtualProductTest"> - <actionGroup ref="clearPageCache" stepKey="clearPageCache" before="amOnCmsPage"/> + <actionGroup ref="ClearPageCacheActionGroup" stepKey="clearPageCache" before="amOnCmsPage"/> </test> <test name="NewProductsListWidgetBundleProductTest"> - <actionGroup ref="clearPageCache" stepKey="clearPageCache" after="clickSaveProduct"/> + <actionGroup ref="ClearPageCacheActionGroup" stepKey="clearPageCache" after="clickSaveProduct"/> </test> <test name="NewProductsListWidgetDownloadableProductTest"> - <actionGroup ref="clearPageCache" stepKey="clearPageCache" after="clickSaveProduct"/> + <actionGroup ref="ClearPageCacheActionGroup" stepKey="clearPageCache" after="clickSaveProduct"/> </test> -</tests> \ No newline at end of file +</tests> From 5f90f1aae78c7d20924a171bc03ca8a772c27426 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 21:36:20 +0100 Subject: [PATCH 130/586] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- .../CheckSubscribedNewsletterActionGroup.xml | 19 ++++++++ ...NewAccountNewsletterCheckedActionGroup.xml | 20 +++++++++ ...wAccountNewsletterUncheckedActionGroup.xml | 24 ++++++++++ ...l => SwitchToPreviewIframeActionGroup.xml} | 0 ...bscribedNewsletterDisplayedActionGroup.xml | 45 ------------------- ...erifySubscribedNewsletterDisplayedTest.xml | 4 +- 6 files changed, 65 insertions(+), 47 deletions(-) create mode 100644 app/code/Magento/Newsletter/Test/Mftf/ActionGroup/CheckSubscribedNewsletterActionGroup.xml create mode 100644 app/code/Magento/Newsletter/Test/Mftf/ActionGroup/StorefrontCreateNewAccountNewsletterCheckedActionGroup.xml create mode 100644 app/code/Magento/Newsletter/Test/Mftf/ActionGroup/StorefrontCreateNewAccountNewsletterUncheckedActionGroup.xml rename app/code/Magento/Newsletter/Test/Mftf/ActionGroup/{AdminNewsletterTemplateActionGroup.xml => SwitchToPreviewIframeActionGroup.xml} (100%) delete mode 100644 app/code/Magento/Newsletter/Test/Mftf/ActionGroup/VerifySubscribedNewsletterDisplayedActionGroup.xml diff --git a/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/CheckSubscribedNewsletterActionGroup.xml b/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/CheckSubscribedNewsletterActionGroup.xml new file mode 100644 index 0000000000000..feedd58c911aa --- /dev/null +++ b/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/CheckSubscribedNewsletterActionGroup.xml @@ -0,0 +1,19 @@ +<?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="CheckSubscribedNewsletterActionGroup"> + <annotations> + <description>Goes to the Storefront Newsletter Management page. Validates that the 'Subscription' checkbox is checked.</description> + </annotations> + + <amOnPage url="{{StorefrontNewsletterManagePage.url}}" stepKey="goToNewsletterManage"/> + <seeCheckboxIsChecked selector="{{StorefrontNewsletterManageSection.subscriptionCheckbox}}" stepKey="checkSubscribedNewsletter"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/StorefrontCreateNewAccountNewsletterCheckedActionGroup.xml b/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/StorefrontCreateNewAccountNewsletterCheckedActionGroup.xml new file mode 100644 index 0000000000000..ff543febcd9a3 --- /dev/null +++ b/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/StorefrontCreateNewAccountNewsletterCheckedActionGroup.xml @@ -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"> + <!--Create an Account. Check Sign Up for Newsletter checkbox --> + <actionGroup name="StorefrontCreateNewAccountNewsletterCheckedActionGroup" extends="SignUpNewUserFromStorefrontActionGroup"> + <annotations> + <description>EXTENDS: SignUpNewUserFromStorefrontActionGroup. Clicks on 'Sign Up for Newsletter'. Validates that the Subscription Confirmation message is present and correct.</description> + </annotations> + + <click selector="{{StorefrontCustomerCreateFormSection.signUpForNewsletter}}" stepKey="selectSignUpForNewsletterCheckbox" after="fillLastName"/> + <see stepKey="seeDescriptionNewsletter" userInput='You are subscribed to "General Subscription".' selector="{{CustomerMyAccountPage.DescriptionNewsletter}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/StorefrontCreateNewAccountNewsletterUncheckedActionGroup.xml b/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/StorefrontCreateNewAccountNewsletterUncheckedActionGroup.xml new file mode 100644 index 0000000000000..d6b0adff53a86 --- /dev/null +++ b/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/StorefrontCreateNewAccountNewsletterUncheckedActionGroup.xml @@ -0,0 +1,24 @@ +<?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="StorefrontCreateNewAccountNewsletterUncheckedActionGroup" extends="SignUpNewUserFromStorefrontActionGroup"> + <annotations> + <description>EXTENDS: SignUpNewUserFromStorefrontActionGroup. Validates that the you are NOT subscribed message is present and correct.</description> + </annotations> + <arguments> + <argument name="Customer"/> + <argument name="Store"/> + </arguments> + + <amOnPage stepKey="amOnStorefrontPage" url="{{Store.code}}"/> + <see stepKey="seeDescriptionNewsletter" userInput="You aren't subscribed to our newsletter." selector="{{CustomerMyAccountPage.DescriptionNewsletter}}"/> + <see stepKey="seeThankYouMessage" userInput="Thank you for registering with NewStore."/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/AdminNewsletterTemplateActionGroup.xml b/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/SwitchToPreviewIframeActionGroup.xml similarity index 100% rename from app/code/Magento/Newsletter/Test/Mftf/ActionGroup/AdminNewsletterTemplateActionGroup.xml rename to app/code/Magento/Newsletter/Test/Mftf/ActionGroup/SwitchToPreviewIframeActionGroup.xml diff --git a/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/VerifySubscribedNewsletterDisplayedActionGroup.xml b/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/VerifySubscribedNewsletterDisplayedActionGroup.xml deleted file mode 100644 index 69b973dbddbda..0000000000000 --- a/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/VerifySubscribedNewsletterDisplayedActionGroup.xml +++ /dev/null @@ -1,45 +0,0 @@ -<?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"> - <!--Create an Account. Check Sign Up for Newsletter checkbox --> - <actionGroup name="StorefrontCreateNewAccountNewsletterChecked" extends="SignUpNewUserFromStorefrontActionGroup"> - <annotations> - <description>EXTENDS: SignUpNewUserFromStorefrontActionGroup. Clicks on 'Sign Up for Newsletter'. Validates that the Subscription Confirmation message is present and correct.</description> - </annotations> - - <click selector="{{StorefrontCustomerCreateFormSection.signUpForNewsletter}}" stepKey="selectSignUpForNewsletterCheckbox" after="fillLastName"/> - <see stepKey="seeDescriptionNewsletter" userInput='You are subscribed to "General Subscription".' selector="{{CustomerMyAccountPage.DescriptionNewsletter}}"/> - </actionGroup> - - <!--Create an Account. Uncheck Sign Up for Newsletter checkbox --> - <actionGroup name="StorefrontCreateNewAccountNewsletterUnchecked" extends="SignUpNewUserFromStorefrontActionGroup"> - <annotations> - <description>EXTENDS: SignUpNewUserFromStorefrontActionGroup. Validates that the you are NOT subscribed message is present and correct.</description> - </annotations> - <arguments> - <argument name="Customer"/> - <argument name="Store"/> - </arguments> - - <amOnPage stepKey="amOnStorefrontPage" url="{{Store.code}}"/> - <see stepKey="seeDescriptionNewsletter" userInput="You aren't subscribed to our newsletter." selector="{{CustomerMyAccountPage.DescriptionNewsletter}}"/> - <see stepKey="seeThankYouMessage" userInput="Thank you for registering with NewStore."/> - </actionGroup> - - <!--Check Subscribed Newsletter via StoreFront--> - <actionGroup name="CheckSubscribedNewsletterActionGroup"> - <annotations> - <description>Goes to the Storefront Newsletter Management page. Validates that the 'Subscription' checkbox is checked.</description> - </annotations> - - <amOnPage url="{{StorefrontNewsletterManagePage.url}}" stepKey="goToNewsletterManage"/> - <seeCheckboxIsChecked selector="{{StorefrontNewsletterManageSection.subscriptionCheckbox}}" stepKey="checkSubscribedNewsletter"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/VerifySubscribedNewsletterDisplayedTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/VerifySubscribedNewsletterDisplayedTest.xml index 4d60b7676605e..2afeb8f8b0746 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Test/VerifySubscribedNewsletterDisplayedTest.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Test/VerifySubscribedNewsletterDisplayedTest.xml @@ -53,14 +53,14 @@ </after> <!--Go to store front (default) and click Create an Account.--> - <actionGroup ref="StorefrontCreateNewAccountNewsletterChecked" stepKey="SignUpNewUser"> + <actionGroup ref="StorefrontCreateNewAccountNewsletterCheckedActionGroup" stepKey="SignUpNewUser"> <argument name="Customer" value="CustomerEntityOne"/> </actionGroup> <!--Sign Out--> <amOnPage url="customer/account/logout/" stepKey="customerOnLogoutPage"/> <waitForPageLoad stepKey="waitLogoutCustomer"/> <!--Create new Account with the same email address. (unchecked Sign Up for Newsletter checkbox)--> - <actionGroup ref="StorefrontCreateNewAccountNewsletterUnchecked" stepKey="createNewAccountNewsletterUnchecked"> + <actionGroup ref="StorefrontCreateNewAccountNewsletterUncheckedActionGroup" stepKey="createNewAccountNewsletterUnchecked"> <argument name="Customer" value="CustomerEntityOne"/> <argument name="Store" value="staticStore"/> </actionGroup> From 5564c689d274012f97e4e8f63459bc33681727cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 21:46:13 +0100 Subject: [PATCH 131/586] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- ...eckingWithMultipleAddressesActionGroup.xml | 26 +-------------- .../CheckingWithSingleAddressActionGroup.xml | 18 ++++++++++ .../ActionGroup/PlaceOrderActionGroup.xml | 10 ------ .../ActionGroup/ReviewOrderActionGroup.xml | 22 ------------- ...ReviewOrderForMultiShipmentActionGroup.xml | 33 +++++++++++++++++++ ...=> SelectMultiShippingInfoActionGroup.xml} | 15 +-------- .../SelectSingleShippingInfoActionGroup.xml | 20 +++++++++++ ...ingSelectMultipleAddressesActionGroup.xml} | 7 ---- ...eckoutWithMultipleAddressesActionGroup.xml | 15 +++++++++ ...eckoutWithMultipleAddressesActionGroup.xml | 14 ++++++++ ...frontGoToBillingInformationActionGroup.xml | 15 +++++++++ ...ngMethodsAndGoToBillingInfoActionGroup.xml | 15 +++++++++ ...ceOrderForMultipleAddressesActionGroup.xml | 21 ++++++++++++ .../StorefrontSaveAddressActionGroup.xml | 17 ++++++++++ .../StorefrontSelectAddressActionGroup.xml | 18 ++++++++++ ...utWhenCartPageIsOpenedInAnotherTabTest.xml | 2 +- 16 files changed, 189 insertions(+), 79 deletions(-) create mode 100644 app/code/Magento/Multishipping/Test/Mftf/ActionGroup/CheckingWithSingleAddressActionGroup.xml create mode 100644 app/code/Magento/Multishipping/Test/Mftf/ActionGroup/ReviewOrderForMultiShipmentActionGroup.xml rename app/code/Magento/Multishipping/Test/Mftf/ActionGroup/{SelectShippingInfoActionGroup.xml => SelectMultiShippingInfoActionGroup.xml} (62%) create mode 100644 app/code/Magento/Multishipping/Test/Mftf/ActionGroup/SelectSingleShippingInfoActionGroup.xml rename app/code/Magento/Multishipping/Test/Mftf/ActionGroup/{StorefrontMultishippingCheckoutActionGroup.xml => StorefrontCheckoutShippingSelectMultipleAddressesActionGroup.xml} (70%) create mode 100644 app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontCheckoutWithMultipleAddressesActionGroup.xml create mode 100644 app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontGoCheckoutWithMultipleAddressesActionGroup.xml create mode 100644 app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontGoToBillingInformationActionGroup.xml create mode 100644 app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontLeaveDefaultShippingMethodsAndGoToBillingInfoActionGroup.xml create mode 100644 app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontPlaceOrderForMultipleAddressesActionGroup.xml create mode 100644 app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontSaveAddressActionGroup.xml create mode 100644 app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontSelectAddressActionGroup.xml diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/CheckingWithMultipleAddressesActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/CheckingWithMultipleAddressesActionGroup.xml index 34ce38bd0d935..a34e0627bd150 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/CheckingWithMultipleAddressesActionGroup.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/CheckingWithMultipleAddressesActionGroup.xml @@ -7,13 +7,7 @@ --> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <actionGroup name="CheckingWithSingleAddressActionGroup"> - <click selector="{{SingleShippingSection.checkoutWithMultipleAddresses}}" stepKey="clickOnCheckoutWithMultipleAddresses"/> - <waitForPageLoad stepKey="waitForMultipleAddressPageLoad"/> - <click selector="{{SingleShippingSection.goToShippingInfo}}" stepKey="goToShippingInformation"/> - <waitForPageLoad stepKey="waitForShippingPageLoad"/> - </actionGroup> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="CheckingWithMultipleAddressesActionGroup" extends="CheckingWithSingleAddressActionGroup"> <arguments> <argument name="addressOption1" type="string" defaultValue="1"/> @@ -27,22 +21,4 @@ <click selector="{{SingleShippingSection.updateAddress}}" after="selectSecondShippingMethod" stepKey="clickOnUpdateAddress"/> <waitForPageLoad after="clickOnUpdateAddress" stepKey="waitForShippingInformation"/> </actionGroup> - <actionGroup name="StorefrontCheckoutWithMultipleAddressesActionGroup"> - <click selector="{{SingleShippingSection.checkoutWithMultipleAddresses}}" stepKey="clickOnCheckoutWithMultipleAddresses"/> - <waitForPageLoad stepKey="waitForMultipleAddressPageLoad"/> - </actionGroup> - <actionGroup name="StorefrontSelectAddressActionGroup"> - <arguments> - <argument name="sequenceNumber" type="string" defaultValue="1"/> - <argument name="option" type="string" defaultValue="1"/> - </arguments> - <selectOption selector="{{MultishippingSection.selectShippingAddress(sequenceNumber)}}" userInput="{{option}}" stepKey="selectShippingAddress"/> - </actionGroup> - <actionGroup name="StorefrontSaveAddressActionGroup"> - <click selector="{{SingleShippingSection.updateAddress}}" stepKey="clickOnUpdateAddress"/> - <waitForPageLoad time="90" stepKey="waitForShippingInformationAfterUpdated"/> - <click selector="{{SingleShippingSection.goToShippingInfo}}" stepKey="goToShippingInformation"/> - <waitForPageLoad stepKey="waitForShippingPageLoad"/> - </actionGroup> </actionGroups> - diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/CheckingWithSingleAddressActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/CheckingWithSingleAddressActionGroup.xml new file mode 100644 index 0000000000000..d911488925427 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/CheckingWithSingleAddressActionGroup.xml @@ -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/testSchema.xsd"> + <actionGroup name="CheckingWithSingleAddressActionGroup"> + <click selector="{{SingleShippingSection.checkoutWithMultipleAddresses}}" stepKey="clickOnCheckoutWithMultipleAddresses"/> + <waitForPageLoad stepKey="waitForMultipleAddressPageLoad"/> + <click selector="{{SingleShippingSection.goToShippingInfo}}" stepKey="goToShippingInformation"/> + <waitForPageLoad stepKey="waitForShippingPageLoad"/> + </actionGroup> +</actionGroups> + diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/PlaceOrderActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/PlaceOrderActionGroup.xml index 871c71de522c7..8cfbe2665d685 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/PlaceOrderActionGroup.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/PlaceOrderActionGroup.xml @@ -13,14 +13,4 @@ <waitForPageLoad stepKey="waitForSuccessfullyPlacedOrder"/> <see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage"/> </actionGroup> - <actionGroup name="StorefrontPlaceOrderForMultipleAddressesActionGroup" extends="PlaceOrderActionGroup"> - <arguments> - <argument name="firstOrderPosition" type="string" defaultValue="1"/> - <argument name="secondOrderPosition" type="string" defaultValue="2"/> - </arguments> - <grabTextFrom selector="{{StorefrontSalesOrderSection.orderLinkByPosition(firstOrderPosition)}}" after="waitForLoadSuccessPage" stepKey="getFirstOrderId"/> - <grabAttributeFrom selector="{{StorefrontSalesOrderSection.orderLinkByPosition(firstOrderPosition)}}" userInput="href" after="getFirstOrderId" stepKey="dataHrefForFirstOrder"/> - <grabTextFrom selector="{{StorefrontSalesOrderSection.orderLinkByPosition(secondOrderPosition)}}" after="dataHrefForFirstOrder" stepKey="getSecondOrderId"/> - <grabAttributeFrom selector="{{StorefrontSalesOrderSection.orderLinkByPosition(secondOrderPosition)}}" userInput="href" after="getSecondOrderId" stepKey="dataHrefForSecondOrder"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/ReviewOrderActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/ReviewOrderActionGroup.xml index 638c5dd8dde61..8a63c42006443 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/ReviewOrderActionGroup.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/ReviewOrderActionGroup.xml @@ -20,26 +20,4 @@ <actualResult type="string">$shippingMethodBasePrice</actualResult> </assertEquals> </actionGroup> - <actionGroup name="ReviewOrderForMultiShipmentActionGroup"> - <arguments> - <argument name="totalNameForFirstOrder" type="string" defaultValue="Shipping & Handling"/> - <argument name="totalPositionForFirstOrder" type="string" defaultValue="1"/> - <argument name="totalNameForSecondOrder" type="string" defaultValue="Shipping & Handling"/> - <argument name="totalPositionForSecondOrder" type="string" defaultValue="2"/> - </arguments> - <!--Check First Shipping Method Price--> - <grabTextFrom selector="{{ReviewOrderSection.shippingMethodBasePrice(totalPositionForFirstOrder)}}" stepKey="firstShippingMethodBasePrice"/> - <grabTextFrom selector="{{ReviewOrderSection.shippingMethodSubtotalPrice(totalPositionForFirstOrder,totalNameForFirstOrder)}}" stepKey="firstShippingMethodSubtotalPrice"/> - <assertEquals stepKey="assertShippingMethodPrice"> - <expectedResult type="string">$firstShippingMethodSubtotalPrice</expectedResult> - <actualResult type="string">$firstShippingMethodBasePrice</actualResult> - </assertEquals> - <!--Check Second Shipping Method Price--> - <grabTextFrom selector="{{ReviewOrderSection.shippingMethodBasePrice(totalPositionForSecondOrder)}}" stepKey="secondShippingMethodBasePrice"/> - <grabTextFrom selector="{{ReviewOrderSection.shippingMethodSubtotalPrice(totalPositionForSecondOrder,totalNameForSecondOrder)}}" stepKey="secondShippingMethodSubtotalPrice"/> - <assertEquals stepKey="assertSecondShippingMethodPrice" > - <expectedResult type="string">$secondShippingMethodSubtotalPrice</expectedResult> - <actualResult type="string">$secondShippingMethodBasePrice</actualResult> - </assertEquals> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/ReviewOrderForMultiShipmentActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/ReviewOrderForMultiShipmentActionGroup.xml new file mode 100644 index 0000000000000..3a95c7779d596 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/ReviewOrderForMultiShipmentActionGroup.xml @@ -0,0 +1,33 @@ +<?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="ReviewOrderForMultiShipmentActionGroup"> + <arguments> + <argument name="totalNameForFirstOrder" type="string" defaultValue="Shipping & Handling"/> + <argument name="totalPositionForFirstOrder" type="string" defaultValue="1"/> + <argument name="totalNameForSecondOrder" type="string" defaultValue="Shipping & Handling"/> + <argument name="totalPositionForSecondOrder" type="string" defaultValue="2"/> + </arguments> + <!--Check First Shipping Method Price--> + <grabTextFrom selector="{{ReviewOrderSection.shippingMethodBasePrice(totalPositionForFirstOrder)}}" stepKey="firstShippingMethodBasePrice"/> + <grabTextFrom selector="{{ReviewOrderSection.shippingMethodSubtotalPrice(totalPositionForFirstOrder,totalNameForFirstOrder)}}" stepKey="firstShippingMethodSubtotalPrice"/> + <assertEquals stepKey="assertShippingMethodPrice"> + <expectedResult type="string">$firstShippingMethodSubtotalPrice</expectedResult> + <actualResult type="string">$firstShippingMethodBasePrice</actualResult> + </assertEquals> + <!--Check Second Shipping Method Price--> + <grabTextFrom selector="{{ReviewOrderSection.shippingMethodBasePrice(totalPositionForSecondOrder)}}" stepKey="secondShippingMethodBasePrice"/> + <grabTextFrom selector="{{ReviewOrderSection.shippingMethodSubtotalPrice(totalPositionForSecondOrder,totalNameForSecondOrder)}}" stepKey="secondShippingMethodSubtotalPrice"/> + <assertEquals stepKey="assertSecondShippingMethodPrice" > + <expectedResult type="string">$secondShippingMethodSubtotalPrice</expectedResult> + <actualResult type="string">$secondShippingMethodBasePrice</actualResult> + </assertEquals> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/SelectShippingInfoActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/SelectMultiShippingInfoActionGroup.xml similarity index 62% rename from app/code/Magento/Multishipping/Test/Mftf/ActionGroup/SelectShippingInfoActionGroup.xml rename to app/code/Magento/Multishipping/Test/Mftf/ActionGroup/SelectMultiShippingInfoActionGroup.xml index a5aac6b32011b..9da09a524184d 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/SelectShippingInfoActionGroup.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/SelectMultiShippingInfoActionGroup.xml @@ -7,15 +7,7 @@ --> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <actionGroup name="SelectSingleShippingInfoActionGroup"> - <arguments> - <argument name="shippingMethodType" type="string" defaultValue="Fixed"/> - </arguments> - <selectOption selector="{{ShippingMethodSection.shippingMethodRadioButton}}" userInput="{{shippingMethodType}}" stepKey="selectShippingMethod"/> - <waitForPageLoad stepKey="waitForRadioOptions"/> - <click selector="{{ShippingMethodSection.goToBillingInfo}}" stepKey="goToBillingInformation"/> - </actionGroup> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="SelectMultiShippingInfoActionGroup"> <arguments> <argument name="shippingMethodPosition1" type="string" defaultValue="1"/> @@ -29,9 +21,4 @@ <waitForPageLoad stepKey="waitForRadioOptions"/> <click selector="{{ShippingMethodSection.goToBillingInfo}}" stepKey="goToBillingInformation"/> </actionGroup> - <actionGroup name="StorefrontLeaveDefaultShippingMethodsAndGoToBillingInfoActionGroup"> - <waitForPageLoad stepKey="waitForShippingInfo"/> - <click selector="{{ShippingMethodSection.goToBillingInfo}}" stepKey="goToBillingInformation"/> - </actionGroup> </actionGroups> - diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/SelectSingleShippingInfoActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/SelectSingleShippingInfoActionGroup.xml new file mode 100644 index 0000000000000..329f1451788cd --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/SelectSingleShippingInfoActionGroup.xml @@ -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/testSchema.xsd"> + <actionGroup name="SelectSingleShippingInfoActionGroup"> + <arguments> + <argument name="shippingMethodType" type="string" defaultValue="Fixed"/> + </arguments> + <selectOption selector="{{ShippingMethodSection.shippingMethodRadioButton}}" userInput="{{shippingMethodType}}" stepKey="selectShippingMethod"/> + <waitForPageLoad stepKey="waitForRadioOptions"/> + <click selector="{{ShippingMethodSection.goToBillingInfo}}" stepKey="goToBillingInformation"/> + </actionGroup> +</actionGroups> + diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontMultishippingCheckoutActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontCheckoutShippingSelectMultipleAddressesActionGroup.xml similarity index 70% rename from app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontMultishippingCheckoutActionGroup.xml rename to app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontCheckoutShippingSelectMultipleAddressesActionGroup.xml index c5dee010239d7..b698f00078bd6 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontMultishippingCheckoutActionGroup.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontCheckoutShippingSelectMultipleAddressesActionGroup.xml @@ -17,12 +17,5 @@ <selectOption selector="{{StorefrontCheckoutShippingMultipleAddressesSection.selectedMultipleShippingAddress('2')}}" userInput="{{secondAddress}}" stepKey="selectShippingAddressForTheSecondItem"/> <click selector="{{CheckoutSuccessMainSection.continueShoppingButton}}" stepKey="clickToGoToInformationButton"/> </actionGroup> - <actionGroup name="StorefrontGoCheckoutWithMultipleAddresses"> - <click selector="{{MultishippingSection.shippingMultipleCheckout}}" stepKey="clickToMultipleAddressShippingButton"/> - </actionGroup> - <actionGroup name="StorefrontGoToBillingInformationActionGroup"> - <click selector="{{StorefrontMultipleShippingMethodSection.continueToBillingInformationButton}}" stepKey="clickToContinueToBillingInformationButton"/> - <waitForPageLoad stepKey="waitForBillingPage"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontCheckoutWithMultipleAddressesActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontCheckoutWithMultipleAddressesActionGroup.xml new file mode 100644 index 0000000000000..f7d6ea6711f89 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontCheckoutWithMultipleAddressesActionGroup.xml @@ -0,0 +1,15 @@ +<?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="StorefrontCheckoutWithMultipleAddressesActionGroup"> + <click selector="{{SingleShippingSection.checkoutWithMultipleAddresses}}" stepKey="clickOnCheckoutWithMultipleAddresses"/> + <waitForPageLoad stepKey="waitForMultipleAddressPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontGoCheckoutWithMultipleAddressesActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontGoCheckoutWithMultipleAddressesActionGroup.xml new file mode 100644 index 0000000000000..fd57a3b095a3d --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontGoCheckoutWithMultipleAddressesActionGroup.xml @@ -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="StorefrontGoCheckoutWithMultipleAddressesActionGroup"> + <click selector="{{MultishippingSection.shippingMultipleCheckout}}" stepKey="clickToMultipleAddressShippingButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontGoToBillingInformationActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontGoToBillingInformationActionGroup.xml new file mode 100644 index 0000000000000..baca62007d3cb --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontGoToBillingInformationActionGroup.xml @@ -0,0 +1,15 @@ +<?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="StorefrontGoToBillingInformationActionGroup"> + <click selector="{{StorefrontMultipleShippingMethodSection.continueToBillingInformationButton}}" stepKey="clickToContinueToBillingInformationButton"/> + <waitForPageLoad stepKey="waitForBillingPage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontLeaveDefaultShippingMethodsAndGoToBillingInfoActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontLeaveDefaultShippingMethodsAndGoToBillingInfoActionGroup.xml new file mode 100644 index 0000000000000..1054d9b7d9160 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontLeaveDefaultShippingMethodsAndGoToBillingInfoActionGroup.xml @@ -0,0 +1,15 @@ +<?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="StorefrontLeaveDefaultShippingMethodsAndGoToBillingInfoActionGroup"> + <waitForPageLoad stepKey="waitForShippingInfo"/> + <click selector="{{ShippingMethodSection.goToBillingInfo}}" stepKey="goToBillingInformation"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontPlaceOrderForMultipleAddressesActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontPlaceOrderForMultipleAddressesActionGroup.xml new file mode 100644 index 0000000000000..8391a16f81b6d --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontPlaceOrderForMultipleAddressesActionGroup.xml @@ -0,0 +1,21 @@ +<?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="StorefrontPlaceOrderForMultipleAddressesActionGroup" extends="PlaceOrderActionGroup"> + <arguments> + <argument name="firstOrderPosition" type="string" defaultValue="1"/> + <argument name="secondOrderPosition" type="string" defaultValue="2"/> + </arguments> + <grabTextFrom selector="{{StorefrontSalesOrderSection.orderLinkByPosition(firstOrderPosition)}}" after="waitForLoadSuccessPage" stepKey="getFirstOrderId"/> + <grabAttributeFrom selector="{{StorefrontSalesOrderSection.orderLinkByPosition(firstOrderPosition)}}" userInput="href" after="getFirstOrderId" stepKey="dataHrefForFirstOrder"/> + <grabTextFrom selector="{{StorefrontSalesOrderSection.orderLinkByPosition(secondOrderPosition)}}" after="dataHrefForFirstOrder" stepKey="getSecondOrderId"/> + <grabAttributeFrom selector="{{StorefrontSalesOrderSection.orderLinkByPosition(secondOrderPosition)}}" userInput="href" after="getSecondOrderId" stepKey="dataHrefForSecondOrder"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontSaveAddressActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontSaveAddressActionGroup.xml new file mode 100644 index 0000000000000..c977c94b4e590 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontSaveAddressActionGroup.xml @@ -0,0 +1,17 @@ +<?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="StorefrontSaveAddressActionGroup"> + <click selector="{{SingleShippingSection.updateAddress}}" stepKey="clickOnUpdateAddress"/> + <waitForPageLoad time="90" stepKey="waitForShippingInformationAfterUpdated"/> + <click selector="{{SingleShippingSection.goToShippingInfo}}" stepKey="goToShippingInformation"/> + <waitForPageLoad stepKey="waitForShippingPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontSelectAddressActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontSelectAddressActionGroup.xml new file mode 100644 index 0000000000000..9a20c325df7a6 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontSelectAddressActionGroup.xml @@ -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="StorefrontSelectAddressActionGroup"> + <arguments> + <argument name="sequenceNumber" type="string" defaultValue="1"/> + <argument name="option" type="string" defaultValue="1"/> + </arguments> + <selectOption selector="{{MultishippingSection.selectShippingAddress(sequenceNumber)}}" userInput="{{option}}" stepKey="selectShippingAddress"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontProcessMultishippingCheckoutWhenCartPageIsOpenedInAnotherTabTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontProcessMultishippingCheckoutWhenCartPageIsOpenedInAnotherTabTest.xml index fd79d4d954cd4..cb333a16dfb96 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontProcessMultishippingCheckoutWhenCartPageIsOpenedInAnotherTabTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontProcessMultishippingCheckoutWhenCartPageIsOpenedInAnotherTabTest.xml @@ -62,7 +62,7 @@ <amOnPage url="{{CheckoutCartPage.url}}" stepKey="amOnShoppingCartPage"/> <!-- Click 'Check Out with Multiple Addresses' --> <waitForPageLoad stepKey="waitForSecondPageLoad"/> - <actionGroup ref="StorefrontGoCheckoutWithMultipleAddresses" stepKey="goCheckoutWithMultipleAddresses"/> + <actionGroup ref="StorefrontGoCheckoutWithMultipleAddressesActionGroup" stepKey="goCheckoutWithMultipleAddresses"/> <!-- Select different addresses and click 'Go to Shipping Information' --> <actionGroup ref="StorefrontCheckoutShippingSelectMultipleAddressesActionGroup" stepKey="selectMultipleAddresses"> <argument name="firstAddress" value="{{UK_Not_Default_Address.street[0]}}"/> From 02e83cabc83534c1bebcd4e90b0a29ab87e5e70a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 21:52:28 +0100 Subject: [PATCH 132/586] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- ...oductQuickSearchUsingElasticSearchTest.xml | 6 ++--- ...=> UpdateIndexerByScheduleActionGroup.xml} | 19 +------------ .../UpdateIndexerOnSaveActionGroup.xml | 27 +++++++++++++++++++ 3 files changed, 31 insertions(+), 21 deletions(-) rename app/code/Magento/Indexer/Test/Mftf/ActionGroup/{IndexerActionGroup.xml => UpdateIndexerByScheduleActionGroup.xml} (54%) create mode 100644 app/code/Magento/Indexer/Test/Mftf/ActionGroup/UpdateIndexerOnSaveActionGroup.xml diff --git a/app/code/Magento/Elasticsearch/Test/Mftf/Test/ProductQuickSearchUsingElasticSearchTest.xml b/app/code/Magento/Elasticsearch/Test/Mftf/Test/ProductQuickSearchUsingElasticSearchTest.xml index d8ce091fba76f..d2df6119aa98a 100644 --- a/app/code/Magento/Elasticsearch/Test/Mftf/Test/ProductQuickSearchUsingElasticSearchTest.xml +++ b/app/code/Magento/Elasticsearch/Test/Mftf/Test/ProductQuickSearchUsingElasticSearchTest.xml @@ -29,7 +29,7 @@ <deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/> <deleteData createDataKey="categoryFirst" stepKey="deleteCategory"/> <actionGroup ref="ResetSearchEngineConfiguration" stepKey="resetCatalogSearchConfiguration"/> - <actionGroup ref="updateIndexerOnSave" stepKey="resetIndexerBackToOriginalState"> + <actionGroup ref="UpdateIndexerOnSaveActionGroup" stepKey="resetIndexerBackToOriginalState"> <argument name="indexerName" value="catalogsearch_fulltext"/> </actionGroup> <actionGroup ref="logout" stepKey="logoutOfAdmin"/> @@ -39,7 +39,7 @@ <comment userInput="Change Catalog search engine option to Elastic Search 5.0+" stepKey="chooseElasticSearch5"/> <actionGroup ref="ChooseElasticSearchAsSearchEngine" stepKey="chooseES5"/> <actionGroup ref="ClearPageCacheActionGroup" stepKey="clearing"/> - <actionGroup ref="updateIndexerBySchedule" stepKey="updateAnIndexerBySchedule"> + <actionGroup ref="UpdateIndexerByScheduleActionGroup" stepKey="updateAnIndexerBySchedule"> <argument name="indexerName" value="catalogsearch_fulltext"/> </actionGroup> <actionGroup ref="logout" stepKey="logoutOfAdmin"/> @@ -57,4 +57,4 @@ <comment userInput="End of searching products" stepKey="endOfSearchingProducts"/> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin2"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Indexer/Test/Mftf/ActionGroup/IndexerActionGroup.xml b/app/code/Magento/Indexer/Test/Mftf/ActionGroup/UpdateIndexerByScheduleActionGroup.xml similarity index 54% rename from app/code/Magento/Indexer/Test/Mftf/ActionGroup/IndexerActionGroup.xml rename to app/code/Magento/Indexer/Test/Mftf/ActionGroup/UpdateIndexerByScheduleActionGroup.xml index 642982f37866f..04a5b97469c8e 100644 --- a/app/code/Magento/Indexer/Test/Mftf/ActionGroup/IndexerActionGroup.xml +++ b/app/code/Magento/Indexer/Test/Mftf/ActionGroup/UpdateIndexerByScheduleActionGroup.xml @@ -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="updateIndexerBySchedule"> + <actionGroup name="UpdateIndexerByScheduleActionGroup"> <annotations> <description>Goes to the Index Management page. Checks the provided Indexer Name. Selects 'Update by Schedule'. Clicks on Submit.</description> </annotations> @@ -24,21 +24,4 @@ <!-- No re-indexing is done as part of this actionGroup since the test required no re-indexing --> <waitForPageLoad stepKey="waitForSave"/> </actionGroup> - - <actionGroup name="updateIndexerOnSave"> - <annotations> - <description>Goes to the Index Management page. Checks the provided Indexer Name. Selects 'Update on Save'. Clicks on Submit.</description> - </annotations> - <arguments> - <argument name="indexerName" type="string"/> - </arguments> - - <amOnPage url="{{_ENV.MAGENTO_BACKEND_NAME}}/indexer/indexer/list/" stepKey="amOnIndexManagementPage2"/> - <waitForPageLoad stepKey="waitForIndexManagementPageToLoad2"/> - <click selector="{{AdminIndexManagementSection.indexerCheckbox(indexerName)}}" stepKey="selectIndexer2"/> - <selectOption selector="{{AdminIndexManagementSection.massActionSelect}}" userInput="change_mode_onthefly" stepKey="selectUpdateOnSave"/> - <click selector="{{AdminIndexManagementSection.massActionSubmit}}" stepKey="submitIndexerForm2"/> - <!-- No re-indexing is done as part of this actionGroup since the test required no re-indexing --> - <waitForPageLoad stepKey="waitForSave2"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Indexer/Test/Mftf/ActionGroup/UpdateIndexerOnSaveActionGroup.xml b/app/code/Magento/Indexer/Test/Mftf/ActionGroup/UpdateIndexerOnSaveActionGroup.xml new file mode 100644 index 0000000000000..65be57a335006 --- /dev/null +++ b/app/code/Magento/Indexer/Test/Mftf/ActionGroup/UpdateIndexerOnSaveActionGroup.xml @@ -0,0 +1,27 @@ +<?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="UpdateIndexerOnSaveActionGroup"> + <annotations> + <description>Goes to the Index Management page. Checks the provided Indexer Name. Selects 'Update on Save'. Clicks on Submit.</description> + </annotations> + <arguments> + <argument name="indexerName" type="string"/> + </arguments> + + <amOnPage url="{{_ENV.MAGENTO_BACKEND_NAME}}/indexer/indexer/list/" stepKey="amOnIndexManagementPage2"/> + <waitForPageLoad stepKey="waitForIndexManagementPageToLoad2"/> + <click selector="{{AdminIndexManagementSection.indexerCheckbox(indexerName)}}" stepKey="selectIndexer2"/> + <selectOption selector="{{AdminIndexManagementSection.massActionSelect}}" userInput="change_mode_onthefly" stepKey="selectUpdateOnSave"/> + <click selector="{{AdminIndexManagementSection.massActionSubmit}}" stepKey="submitIndexerForm2"/> + <!-- No re-indexing is done as part of this actionGroup since the test required no re-indexing --> + <waitForPageLoad stepKey="waitForSave2"/> + </actionGroup> +</actionGroups> From 439132a5de79fe2c37dc277cc4de6ff2ed18d849 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 21:58:33 +0100 Subject: [PATCH 133/586] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- .../AdminAssignProductToGroupActionGroup.xml | 29 ++++++ .../AdminGroupedProductActionGroup.xml | 92 ------------------- ...dFieldsInGroupedProductFormActionGroup.xml | 37 ++++++++ ...rLinkedToGroupProductInGridActionGroup.xml | 22 +++++ .../FillGroupedProductFormActionGroup.xml | 22 +++++ ...ewGroupedProductInAdminGridActionGroup.xml | 30 ++++++ 6 files changed, 140 insertions(+), 92 deletions(-) create mode 100644 app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/AdminAssignProductToGroupActionGroup.xml delete mode 100644 app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/AdminGroupedProductActionGroup.xml create mode 100644 app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/CheckRequiredFieldsInGroupedProductFormActionGroup.xml create mode 100644 app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/FillDefaultQuantityForLinkedToGroupProductInGridActionGroup.xml create mode 100644 app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/FillGroupedProductFormActionGroup.xml create mode 100644 app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/ViewGroupedProductInAdminGridActionGroup.xml diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/AdminAssignProductToGroupActionGroup.xml b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/AdminAssignProductToGroupActionGroup.xml new file mode 100644 index 0000000000000..fa1b24616ee6f --- /dev/null +++ b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/AdminAssignProductToGroupActionGroup.xml @@ -0,0 +1,29 @@ +<?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="AdminAssignProductToGroupActionGroup"> + <annotations> + <description>Adds the provided Product to a Grouped Product on an Admin Grouped Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <scrollTo selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" x="0" y="-100" stepKey="scrollToGroupedSection"/> + <conditionalClick selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" dependentSelector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" visible="false" stepKey="openGroupedProductsSection"/> + <click selector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" stepKey="clickAddProductsToGroup"/> + <conditionalClick selector="{{AdminAddProductsToGroupPanel.clearFilters}}" dependentSelector="{{AdminAddProductsToGroupPanel.clearFilters}}" visible="true" stepKey="clearExistingFilters"/> + <click selector="{{AdminAddProductsToGroupPanel.filters}}" stepKey="showFiltersPanel"/> + <fillField userInput="{{product.name}}" selector="{{AdminAddProductsToGroupPanel.nameFilter}}" stepKey="fillNameFilter"/> + <click selector="{{AdminAddProductsToGroupPanel.applyFilters}}" stepKey="clickApplyFilters"/> + <click selector="{{AdminAddProductsToGroupPanel.firstCheckbox}}" stepKey="selectProduct"/> + <click selector="{{AdminAddProductsToGroupPanel.addSelectedProducts}}" stepKey="clickAddSelectedGroupProducts"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/AdminGroupedProductActionGroup.xml b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/AdminGroupedProductActionGroup.xml deleted file mode 100644 index 7b44697880a70..0000000000000 --- a/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/AdminGroupedProductActionGroup.xml +++ /dev/null @@ -1,92 +0,0 @@ -<?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"> - <!--Check that required fields are actually required--> - <actionGroup name="checkRequiredFieldsInGroupedProductForm"> - <annotations> - <description>Clears the Product Name and SKU fields when adding a Grouped Product and then verifies that they are required after attempting to Save.</description> - </annotations> - - <clearField selector="{{AdminProductFormSection.productName}}" stepKey="clearProductSku"/> - <clearField selector="{{AdminProductFormSection.productSku}}" stepKey="clearProductName"/> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Product" stepKey="seeStillOnEditPage"/> - <see selector="{{AdminProductFormSection.fieldError('name')}}" userInput="This is a required field." stepKey="seeNameRequired"/> - <see selector="{{AdminProductFormSection.fieldError('sku')}}" userInput="This is a required field." stepKey="seeSkuRequired"/> - </actionGroup> - - <!--Fill main fields in grouped product form--> - <actionGroup name="fillGroupedProductForm"> - <annotations> - <description>Fills in the provided Product Name and SKU on the Grouped Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="product" defaultValue="GroupedProduct"/> - </arguments> - - <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductSku"/> - <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductName"/> - </actionGroup> - - <!--Filter product grid and see expected grouped product--> - <actionGroup name="viewGroupedProductInAdminGrid"> - <annotations> - <description>Goes to the Admin Products grid page. Filters the grid for the provided Product. Validates that the provided Product appears in the grid.</description> - </annotations> - <arguments> - <argument name="product" defaultValue="GroupedProduct"/> - </arguments> - - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> - <waitForPageLoad stepKey="waitForPageLoadInitial"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{product.name}}" stepKey="fillProductNameFilter"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> - <selectOption selector="{{AdminProductGridFilterSection.typeFilter}}" userInput="{{product.type_id}}" stepKey="selectionProductType"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.name}}" stepKey="seeProductNameInGrid"/> - <click selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="clickClearFiltersAfter"/> - </actionGroup> - - <!--Fill product min quantity in group products grid--> - <actionGroup name="fillDefaultQuantityForLinkedToGroupProductInGrid"> - <annotations> - <description>Fills the provided Qty for a Product linked to a Grouped Product.</description> - </annotations> - <arguments> - <argument name="productName" type="string"/> - <argument name="qty" type="string"/> - </arguments> - - <fillField selector="{{AdminAddedProductsToGroupGrid.inputByProductName(productName)}}" userInput="{{qty}}" stepKey="fillDefaultQtyForLinkedProduct"/> - </actionGroup> - - <!-- Assign Specified Product To Grouped Product --> - <!-- Assumes web client is on grouped product edit page --> - <actionGroup name="AdminAssignProductToGroup"> - <annotations> - <description>Adds the provided Product to a Grouped Product on an Admin Grouped Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <scrollTo selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" x="0" y="-100" stepKey="scrollToGroupedSection"/> - <conditionalClick selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" dependentSelector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" visible="false" stepKey="openGroupedProductsSection"/> - <click selector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" stepKey="clickAddProductsToGroup"/> - <conditionalClick selector="{{AdminAddProductsToGroupPanel.clearFilters}}" dependentSelector="{{AdminAddProductsToGroupPanel.clearFilters}}" visible="true" stepKey="clearExistingFilters"/> - <click selector="{{AdminAddProductsToGroupPanel.filters}}" stepKey="showFiltersPanel"/> - <fillField userInput="{{product.name}}" selector="{{AdminAddProductsToGroupPanel.nameFilter}}" stepKey="fillNameFilter"/> - <click selector="{{AdminAddProductsToGroupPanel.applyFilters}}" stepKey="clickApplyFilters"/> - <click selector="{{AdminAddProductsToGroupPanel.firstCheckbox}}" stepKey="selectProduct"/> - <click selector="{{AdminAddProductsToGroupPanel.addSelectedProducts}}" stepKey="clickAddSelectedGroupProducts"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/CheckRequiredFieldsInGroupedProductFormActionGroup.xml b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/CheckRequiredFieldsInGroupedProductFormActionGroup.xml new file mode 100644 index 0000000000000..26257dd98673c --- /dev/null +++ b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/CheckRequiredFieldsInGroupedProductFormActionGroup.xml @@ -0,0 +1,37 @@ +<?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"> + <!--Check that required fields are actually required--> + <actionGroup name="CheckRequiredFieldsInGroupedProductFormActionGroup"> + <annotations> + <description>Clears the Product Name and SKU fields when adding a Grouped Product and then verifies that they are required after attempting to Save.</description> + </annotations> + + <clearField selector="{{AdminProductFormSection.productName}}" stepKey="clearProductSku"/> + <clearField selector="{{AdminProductFormSection.productSku}}" stepKey="clearProductName"/> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Product" stepKey="seeStillOnEditPage"/> + <see selector="{{AdminProductFormSection.fieldError('name')}}" userInput="This is a required field." stepKey="seeNameRequired"/> + <see selector="{{AdminProductFormSection.fieldError('sku')}}" userInput="This is a required field." stepKey="seeSkuRequired"/> + </actionGroup> + + <!--Fill main fields in grouped product form--> + + + <!--Filter product grid and see expected grouped product--> + + + <!--Fill product min quantity in group products grid--> + + + <!-- Assign Specified Product To Grouped Product --> + <!-- Assumes web client is on grouped product edit page --> + +</actionGroups> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/FillDefaultQuantityForLinkedToGroupProductInGridActionGroup.xml b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/FillDefaultQuantityForLinkedToGroupProductInGridActionGroup.xml new file mode 100644 index 0000000000000..faa39eb70cced --- /dev/null +++ b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/FillDefaultQuantityForLinkedToGroupProductInGridActionGroup.xml @@ -0,0 +1,22 @@ +<?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="FillDefaultQuantityForLinkedToGroupProductInGridActionGroup"> + <annotations> + <description>Fills the provided Qty for a Product linked to a Grouped Product.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + <argument name="qty" type="string"/> + </arguments> + + <fillField selector="{{AdminAddedProductsToGroupGrid.inputByProductName(productName)}}" userInput="{{qty}}" stepKey="fillDefaultQtyForLinkedProduct"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/FillGroupedProductFormActionGroup.xml b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/FillGroupedProductFormActionGroup.xml new file mode 100644 index 0000000000000..c4df7f67ac201 --- /dev/null +++ b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/FillGroupedProductFormActionGroup.xml @@ -0,0 +1,22 @@ +<?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="FillGroupedProductFormActionGroup"> + <annotations> + <description>Fills in the provided Product Name and SKU on the Grouped Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="product" defaultValue="GroupedProduct"/> + </arguments> + + <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductSku"/> + <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductName"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/ViewGroupedProductInAdminGridActionGroup.xml b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/ViewGroupedProductInAdminGridActionGroup.xml new file mode 100644 index 0000000000000..369a0c3f12970 --- /dev/null +++ b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/ViewGroupedProductInAdminGridActionGroup.xml @@ -0,0 +1,30 @@ +<?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="ViewGroupedProductInAdminGridActionGroup"> + <annotations> + <description>Goes to the Admin Products grid page. Filters the grid for the provided Product. Validates that the provided Product appears in the grid.</description> + </annotations> + <arguments> + <argument name="product" defaultValue="GroupedProduct"/> + </arguments> + + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> + <waitForPageLoad stepKey="waitForPageLoadInitial"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{product.name}}" stepKey="fillProductNameFilter"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> + <selectOption selector="{{AdminProductGridFilterSection.typeFilter}}" userInput="{{product.type_id}}" stepKey="selectionProductType"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.name}}" stepKey="seeProductNameInGrid"/> + <click selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="clickClearFiltersAfter"/> + </actionGroup> +</actionGroups> From c0901615f14e004f28147909c609595ce7307194 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 22:07:39 +0100 Subject: [PATCH 134/586] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- .../AssertEmailTemplateContentActionGroup.xml | 18 ++++ .../CreateCustomTemplateActionGroup.xml | 18 ++++ .../CreateNewTemplateActionGroup.xml | 33 +++++++ .../DeleteEmailTemplateActionGroup.xml | 21 +++++ .../ActionGroup/EmailTemplateActionGroup.xml | 86 ------------------- .../FindAndOpenEmailTemplateActionGroup.xml | 25 ++++++ .../PreviewEmailTemplateActionGroup.xml | 19 ++++ .../Test/AdminEmailTemplatePreviewTest.xml | 8 +- 8 files changed, 138 insertions(+), 90 deletions(-) create mode 100644 app/code/Magento/Email/Test/Mftf/ActionGroup/AssertEmailTemplateContentActionGroup.xml create mode 100644 app/code/Magento/Email/Test/Mftf/ActionGroup/CreateCustomTemplateActionGroup.xml create mode 100644 app/code/Magento/Email/Test/Mftf/ActionGroup/CreateNewTemplateActionGroup.xml create mode 100644 app/code/Magento/Email/Test/Mftf/ActionGroup/DeleteEmailTemplateActionGroup.xml delete mode 100644 app/code/Magento/Email/Test/Mftf/ActionGroup/EmailTemplateActionGroup.xml create mode 100644 app/code/Magento/Email/Test/Mftf/ActionGroup/FindAndOpenEmailTemplateActionGroup.xml create mode 100644 app/code/Magento/Email/Test/Mftf/ActionGroup/PreviewEmailTemplateActionGroup.xml diff --git a/app/code/Magento/Email/Test/Mftf/ActionGroup/AssertEmailTemplateContentActionGroup.xml b/app/code/Magento/Email/Test/Mftf/ActionGroup/AssertEmailTemplateContentActionGroup.xml new file mode 100644 index 0000000000000..653de14a56c9c --- /dev/null +++ b/app/code/Magento/Email/Test/Mftf/ActionGroup/AssertEmailTemplateContentActionGroup.xml @@ -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="AssertEmailTemplateContentActionGroup"> + <arguments> + <argument name="expectedContent" type="string" defaultValue="{{EmailTemplate.templateText}}"/> + </arguments> + + <see userInput="{{expectedContent}}" stepKey="checkTemplateContainText"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Email/Test/Mftf/ActionGroup/CreateCustomTemplateActionGroup.xml b/app/code/Magento/Email/Test/Mftf/ActionGroup/CreateCustomTemplateActionGroup.xml new file mode 100644 index 0000000000000..6fe1dfad761ff --- /dev/null +++ b/app/code/Magento/Email/Test/Mftf/ActionGroup/CreateCustomTemplateActionGroup.xml @@ -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="CreateCustomTemplateActionGroup" extends="CreateNewTemplateActionGroup"> + <remove keyForRemoval="selectValueFromTemplateDropDown"/> + <remove keyForRemoval="clickLoadTemplateButton"/> + + <fillField selector="{{AdminEmailTemplateEditSection.templateSubject}}" userInput="{{template.templateSubject}}" after="fillTemplateNameField" stepKey="fillTemplateSubject"/> + <fillField selector="{{AdminEmailTemplateEditSection.templateText}}" userInput="{{template.templateText}}" after="fillTemplateSubject" stepKey="fillTemplateText"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Email/Test/Mftf/ActionGroup/CreateNewTemplateActionGroup.xml b/app/code/Magento/Email/Test/Mftf/ActionGroup/CreateNewTemplateActionGroup.xml new file mode 100644 index 0000000000000..c6e45ad06971a --- /dev/null +++ b/app/code/Magento/Email/Test/Mftf/ActionGroup/CreateNewTemplateActionGroup.xml @@ -0,0 +1,33 @@ +<?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"> + <!--Create New Template --> + <actionGroup name="CreateNewTemplateActionGroup"> + <annotations> + <description>Clicks on Add New Template. Fills the Template details. Clicks on Save. PLEASE NOTE: The values are Hardcoded.</description> + </annotations> + <arguments> + <argument name="template" defaultValue="EmailTemplate"/> + </arguments> + + <!--Go to Marketing> Email Templates--> + <amOnPage url="{{AdminEmailTemplateIndexPage.url}}" stepKey="navigateToEmailTemplatePage"/> + <!--Click "Add New Template" button--> + <click selector="{{AdminMainActionsSection.add}}" stepKey="clickAddNewTemplateButton"/> + <!--Select value for "Template" drop-down menu in "Load Default Template" tab--> + <selectOption selector="{{AdminEmailTemplateEditSection.templateDropDown}}" userInput="Registry Update" stepKey="selectValueFromTemplateDropDown"/> + <!--Fill in required fields in "Template Information" tab and click "Save Template" button--> + <click selector="{{AdminEmailTemplateEditSection.loadTemplateButton}}" stepKey="clickLoadTemplateButton"/> + <fillField selector="{{AdminEmailTemplateEditSection.templateCode}}" userInput="{{EmailTemplate.templateName}}" stepKey="fillTemplateNameField"/> + <click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveTemplateButton"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You saved the email template." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Email/Test/Mftf/ActionGroup/DeleteEmailTemplateActionGroup.xml b/app/code/Magento/Email/Test/Mftf/ActionGroup/DeleteEmailTemplateActionGroup.xml new file mode 100644 index 0000000000000..b12f79da5f597 --- /dev/null +++ b/app/code/Magento/Email/Test/Mftf/ActionGroup/DeleteEmailTemplateActionGroup.xml @@ -0,0 +1,21 @@ +<?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="DeleteEmailTemplateActionGroup" extends="FindAndOpenEmailTemplateActionGroup"> + <annotations> + <description>Clicks on Delete Template. Accepts the Popup. Validates that the Email Template is NOT present in the Email Templates Grid.</description> + </annotations> + <click selector="{{AdminEmailTemplateEditSection.deleteTemplateButton}}" after="checkTemplateName" stepKey="deleteTemplate"/> + <waitForElementVisible selector="{{AdminEmailTemplateEditSection.acceptPopupButton}}" after="deleteTemplate" stepKey="waitForConfirmButton"/> + <click selector="{{AdminEmailTemplateEditSection.acceptPopupButton}}" after="waitForConfirmButton" stepKey="acceptPopup"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" after="acceptPopup" stepKey="waitForSuccessMessage"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You deleted the email template." after="waitForSuccessMessage" stepKey="seeSuccessfulMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Email/Test/Mftf/ActionGroup/EmailTemplateActionGroup.xml b/app/code/Magento/Email/Test/Mftf/ActionGroup/EmailTemplateActionGroup.xml deleted file mode 100644 index c859b956810c7..0000000000000 --- a/app/code/Magento/Email/Test/Mftf/ActionGroup/EmailTemplateActionGroup.xml +++ /dev/null @@ -1,86 +0,0 @@ -<?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"> - <!--Create New Template --> - <actionGroup name="CreateNewTemplate"> - <annotations> - <description>Clicks on Add New Template. Fills the Template details. Clicks on Save. PLEASE NOTE: The values are Hardcoded.</description> - </annotations> - <arguments> - <argument name="template" defaultValue="EmailTemplate"/> - </arguments> - - <!--Go to Marketing> Email Templates--> - <amOnPage url="{{AdminEmailTemplateIndexPage.url}}" stepKey="navigateToEmailTemplatePage"/> - <!--Click "Add New Template" button--> - <click selector="{{AdminMainActionsSection.add}}" stepKey="clickAddNewTemplateButton"/> - <!--Select value for "Template" drop-down menu in "Load Default Template" tab--> - <selectOption selector="{{AdminEmailTemplateEditSection.templateDropDown}}" userInput="Registry Update" stepKey="selectValueFromTemplateDropDown"/> - <!--Fill in required fields in "Template Information" tab and click "Save Template" button--> - <click selector="{{AdminEmailTemplateEditSection.loadTemplateButton}}" stepKey="clickLoadTemplateButton"/> - <fillField selector="{{AdminEmailTemplateEditSection.templateCode}}" userInput="{{EmailTemplate.templateName}}" stepKey="fillTemplateNameField"/> - <click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveTemplateButton"/> - <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You saved the email template." stepKey="seeSuccessMessage"/> - </actionGroup> - - <!--Create New Custom Template --> - <actionGroup name="CreateCustomTemplate" extends="CreateNewTemplate"> - <remove keyForRemoval="selectValueFromTemplateDropDown"/> - <remove keyForRemoval="clickLoadTemplateButton"/> - - <fillField selector="{{AdminEmailTemplateEditSection.templateSubject}}" userInput="{{template.templateSubject}}" after="fillTemplateNameField" stepKey="fillTemplateSubject"/> - <fillField selector="{{AdminEmailTemplateEditSection.templateText}}" userInput="{{template.templateText}}" after="fillTemplateSubject" stepKey="fillTemplateText"/> - </actionGroup> - - <!-- Find and Open Email Template --> - <actionGroup name="FindAndOpenEmailTemplate"> - <arguments> - <argument name="template" defaultValue="EmailTemplate"/> - </arguments> - - <amOnPage url="{{AdminEmailTemplateIndexPage.url}}" stepKey="navigateEmailTemplatePage" /> - <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clearFilters"/> - <fillField selector="{{AdminEmailTemplateIndexSection.searchTemplateField}}" userInput="{{template.templateName}}" stepKey="findCreatedTemplate"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearch"/> - <waitForElementVisible selector="{{AdminEmailTemplateIndexSection.templateRowByName(template.templateName)}}" stepKey="waitForTemplatesAppeared"/> - <click selector="{{AdminEmailTemplateIndexSection.templateRowByName(template.templateName)}}" stepKey="clickToOpenTemplate"/> - <waitForElementVisible selector="{{AdminEmailTemplateEditSection.templateCode}}" stepKey="waitForTemplateNameisible"/> - <seeInField selector="{{AdminEmailTemplateEditSection.templateCode}}" userInput="{{template.templateName}}" stepKey="checkTemplateName"/> - </actionGroup> - - <actionGroup name="DeleteEmailTemplate" extends="FindAndOpenEmailTemplate"> - <annotations> - <description>Clicks on Delete Template. Accepts the Popup. Validates that the Email Template is NOT present in the Email Templates Grid.</description> - </annotations> - <click selector="{{AdminEmailTemplateEditSection.deleteTemplateButton}}" after="checkTemplateName" stepKey="deleteTemplate"/> - <waitForElementVisible selector="{{AdminEmailTemplateEditSection.acceptPopupButton}}" after="deleteTemplate" stepKey="waitForConfirmButton"/> - <click selector="{{AdminEmailTemplateEditSection.acceptPopupButton}}" after="waitForConfirmButton" stepKey="acceptPopup"/> - <waitForElementVisible selector="{{AdminMessagesSection.success}}" after="acceptPopup" stepKey="waitForSuccessMessage"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You deleted the email template." after="waitForSuccessMessage" stepKey="seeSuccessfulMessage"/> - </actionGroup> - - <actionGroup name="PreviewEmailTemplate" extends="FindAndOpenEmailTemplate"> - <click selector="{{AdminEmailTemplateEditSection.previewTemplateButton}}" after="checkTemplateName" stepKey="clickPreviewTemplate"/> - <switchToNextTab after="clickPreviewTemplate" stepKey="switchToNewOpenedTab"/> - <seeInCurrentUrl url="{{AdminEmailTemplatePreviewPage.url}}" after="switchToNewOpenedTab" stepKey="seeCurrentUrl"/> - <seeElement selector="{{AdminEmailTemplatePreviewSection.iframe}}" after="seeCurrentUrl" stepKey="seeIframeOnPage"/> - <switchToIFrame userInput="preview_iframe" after="seeIframeOnPage" stepKey="switchToIframe"/> - <waitForPageLoad after="switchToIframe" stepKey="waitForPageLoaded"/> - </actionGroup> - - <actionGroup name="AssertEmailTemplateContent"> - <arguments> - <argument name="expectedContent" type="string" defaultValue="{{EmailTemplate.templateText}}"/> - </arguments> - - <see userInput="{{expectedContent}}" stepKey="checkTemplateContainText"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Email/Test/Mftf/ActionGroup/FindAndOpenEmailTemplateActionGroup.xml b/app/code/Magento/Email/Test/Mftf/ActionGroup/FindAndOpenEmailTemplateActionGroup.xml new file mode 100644 index 0000000000000..5e95b4a72b0ec --- /dev/null +++ b/app/code/Magento/Email/Test/Mftf/ActionGroup/FindAndOpenEmailTemplateActionGroup.xml @@ -0,0 +1,25 @@ +<?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="FindAndOpenEmailTemplateActionGroup"> + <arguments> + <argument name="template" defaultValue="EmailTemplate"/> + </arguments> + + <amOnPage url="{{AdminEmailTemplateIndexPage.url}}" stepKey="navigateEmailTemplatePage" /> + <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clearFilters"/> + <fillField selector="{{AdminEmailTemplateIndexSection.searchTemplateField}}" userInput="{{template.templateName}}" stepKey="findCreatedTemplate"/> + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearch"/> + <waitForElementVisible selector="{{AdminEmailTemplateIndexSection.templateRowByName(template.templateName)}}" stepKey="waitForTemplatesAppeared"/> + <click selector="{{AdminEmailTemplateIndexSection.templateRowByName(template.templateName)}}" stepKey="clickToOpenTemplate"/> + <waitForElementVisible selector="{{AdminEmailTemplateEditSection.templateCode}}" stepKey="waitForTemplateNameisible"/> + <seeInField selector="{{AdminEmailTemplateEditSection.templateCode}}" userInput="{{template.templateName}}" stepKey="checkTemplateName"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Email/Test/Mftf/ActionGroup/PreviewEmailTemplateActionGroup.xml b/app/code/Magento/Email/Test/Mftf/ActionGroup/PreviewEmailTemplateActionGroup.xml new file mode 100644 index 0000000000000..4038a34625800 --- /dev/null +++ b/app/code/Magento/Email/Test/Mftf/ActionGroup/PreviewEmailTemplateActionGroup.xml @@ -0,0 +1,19 @@ +<?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="PreviewEmailTemplateActionGroup" extends="FindAndOpenEmailTemplateActionGroup"> + <click selector="{{AdminEmailTemplateEditSection.previewTemplateButton}}" after="checkTemplateName" stepKey="clickPreviewTemplate"/> + <switchToNextTab after="clickPreviewTemplate" stepKey="switchToNewOpenedTab"/> + <seeInCurrentUrl url="{{AdminEmailTemplatePreviewPage.url}}" after="switchToNewOpenedTab" stepKey="seeCurrentUrl"/> + <seeElement selector="{{AdminEmailTemplatePreviewSection.iframe}}" after="seeCurrentUrl" stepKey="seeIframeOnPage"/> + <switchToIFrame userInput="preview_iframe" after="seeIframeOnPage" stepKey="switchToIframe"/> + <waitForPageLoad after="switchToIframe" stepKey="waitForPageLoaded"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Email/Test/Mftf/Test/AdminEmailTemplatePreviewTest.xml b/app/code/Magento/Email/Test/Mftf/Test/AdminEmailTemplatePreviewTest.xml index 459e3c0f9290f..ca73de1f88fcc 100644 --- a/app/code/Magento/Email/Test/Mftf/Test/AdminEmailTemplatePreviewTest.xml +++ b/app/code/Magento/Email/Test/Mftf/Test/AdminEmailTemplatePreviewTest.xml @@ -27,14 +27,14 @@ <after> <!--Delete created Template--> - <actionGroup ref="DeleteEmailTemplate" stepKey="deleteTemplate"/> + <actionGroup ref="DeleteEmailTemplateActionGroup" stepKey="deleteTemplate"/> <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clearFilters"/> <!--Logout from Admin Area--> <actionGroup ref="logout" stepKey="logoutOfAdmin"/> </after> - <actionGroup ref="CreateCustomTemplate" stepKey="createTemplate"/> - <actionGroup ref="PreviewEmailTemplate" stepKey="previewTemplate"/> - <actionGroup ref="AssertEmailTemplateContent" stepKey="assertContent"/> + <actionGroup ref="CreateCustomTemplateActionGroup" stepKey="createTemplate"/> + <actionGroup ref="PreviewEmailTemplateActionGroup" stepKey="previewTemplate"/> + <actionGroup ref="AssertEmailTemplateContentActionGroup" stepKey="assertContent"/> </test> </tests> From 988705f2acfcafbf8128c40851a3f910497a485e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 22:17:39 +0100 Subject: [PATCH 135/586] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- ...AdminProductTypeSwitchingOnEditingTest.xml | 2 +- .../AddDownloadableProductLinkActionGroup.xml | 32 ++++++ ...ProductLinkWithMaxDownloadsActionGroup.xml | 30 ++++++ .../AddDownloadableSampleFileActionGroup.xml | 26 +++++ .../AddDownloadableSampleUrlActionGroup.xml | 25 +++++ .../AdminDownloadableProductActionGroup.xml | 102 ------------------ ...MainDownloadableProductFormActionGroup.xml | 25 +++++ ...AddDefaultImageDownloadableProductTest.xml | 4 +- ...AddDefaultVideoDownloadableProductTest.xml | 4 +- ...bleProductAndAssignItToCustomStoreTest.xml | 2 +- ...wnloadableProductWithCustomOptionsTest.xml | 2 +- ...loadableProductWithDefaultSetLinksTest.xml | 4 +- ...eDownloadableProductWithGroupPriceTest.xml | 4 +- ...bleProductWithInvalidDomainLinkUrlTest.xml | 4 +- ...nCreateDownloadableProductWithLinkTest.xml | 2 +- ...DownloadableProductWithManageStockTest.xml | 4 +- ...oadableProductWithOutOfStockStatusTest.xml | 4 +- ...ownloadableProductWithSpecialPriceTest.xml | 4 +- ...ductWithoutFillingQuantityAndStockTest.xml | 4 +- ...wnloadableProductWithoutTaxClassIdTest.xml | 4 +- ...AdminProductTypeSwitchingOnEditingTest.xml | 2 +- ...oveDefaultImageDownloadableProductTest.xml | 4 +- ...oveDefaultVideoDownloadableProductTest.xml | 4 +- ...leProductWithSeparateLinksFromCartTest.xml | 4 +- .../Test/Mftf/Test/EndToEndB2CAdminTest.xml | 10 +- ...wnloadableLinksDownloadableProductTest.xml | 4 +- ...ductsListWidgetDownloadableProductTest.xml | 4 +- ...wnloadableLinksDownloadableProductTest.xml | 4 +- 28 files changed, 180 insertions(+), 144 deletions(-) create mode 100644 app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AddDownloadableProductLinkActionGroup.xml create mode 100644 app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AddDownloadableProductLinkWithMaxDownloadsActionGroup.xml create mode 100644 app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AddDownloadableSampleFileActionGroup.xml create mode 100644 app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AddDownloadableSampleUrlActionGroup.xml delete mode 100644 app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AdminDownloadableProductActionGroup.xml create mode 100644 app/code/Magento/Downloadable/Test/Mftf/ActionGroup/FillMainDownloadableProductFormActionGroup.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml index de065d2d930cb..609f9a6629a3d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml @@ -42,7 +42,7 @@ <waitForPageLoad stepKey="waitForDownloadableProductPageLoad"/> <actionGroup ref="AdminAddDownloadableLinkInformationActionGroup" stepKey="addDownloadableLinkInformation"/> <checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkOptionPurchaseSeparately"/> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addDownloadableProductLink"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> <actionGroup ref="saveProductForm" stepKey="saveDownloadableProductForm"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AddDownloadableProductLinkActionGroup.xml b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AddDownloadableProductLinkActionGroup.xml new file mode 100644 index 0000000000000..d132b3bc609ae --- /dev/null +++ b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AddDownloadableProductLinkActionGroup.xml @@ -0,0 +1,32 @@ +<?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="AddDownloadableProductLinkActionGroup"> + <annotations> + <description>Clicks on 'Add Link', under the 'Links' section. Fills in the provided Link details including Unlimited Downloads.</description> + </annotations> + <arguments> + <argument name="link" defaultValue="downloadableLink"/> + <argument name="index" type="string" defaultValue="1"/> + </arguments> + + <click selector="{{AdminProductDownloadableSection.linksAddLinkButton}}" stepKey="clickLinkAddLinkButton"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <fillField userInput="{{link.title}}" selector="{{AdminProductDownloadableSection.addLinkTitleInput(index)}}" stepKey="fillDownloadableLinkTitle"/> + <fillField userInput="{{link.price}}" selector="{{AdminProductDownloadableSection.addLinkPriceInput(index)}}" stepKey="fillDownloadableLinkPrice"/> + <selectOption userInput="{{link.file_type}}" selector="{{AdminProductDownloadableSection.addLinkFileTypeSelector(index)}}" stepKey="selectDownloadableLinkFileType"/> + <selectOption userInput="{{link.sample_type}}" selector="{{AdminProductDownloadableSection.addLinkSampleTypeSelector(index)}}" stepKey="selectDownloadableLinkSampleType"/> + <selectOption userInput="{{link.shareable}}" selector="{{AdminProductDownloadableSection.addLinkShareableSelector(index)}}" stepKey="selectDownloadableLinkShareable"/> + <checkOption selector="{{AdminProductDownloadableSection.addLinkIsUnlimitedDownloads(index)}}" stepKey="checkDownloadableLinkUnlimited"/> + <fillField userInput="{{link.file}}" selector="{{AdminProductDownloadableSection.addLinkFileUrlInput(index)}}" stepKey="fillDownloadableLinkFileUrl"/> + <attachFile userInput="{{link.sample}}" selector="{{AdminProductDownloadableSection.addLinkSampleUploadFile(index)}}" stepKey="attachDownloadableLinkUploadSample"/> + <waitForPageLoad stepKey="waitForPageLoadAfterFillingOutForm" /> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AddDownloadableProductLinkWithMaxDownloadsActionGroup.xml b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AddDownloadableProductLinkWithMaxDownloadsActionGroup.xml new file mode 100644 index 0000000000000..fb21724130042 --- /dev/null +++ b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AddDownloadableProductLinkWithMaxDownloadsActionGroup.xml @@ -0,0 +1,30 @@ +<?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="AddDownloadableProductLinkWithMaxDownloadsActionGroup"> + <annotations> + <description>Clicks on 'Add Link'. Fills in the provided Link details including a Max Downloads limit.</description> + </annotations> + <arguments> + <argument name="link" defaultValue="downloadableLinkWithMaxDownloads"/> + </arguments> + + <click selector="{{AdminProductDownloadableSection.linksAddLinkButton}}" stepKey="clickLinkAddLinkButton"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <fillField userInput="{{link.title}}" selector="{{AdminProductDownloadableSection.addLinkTitleInput('0')}}" stepKey="fillDownloadableLinkTitle"/> + <fillField userInput="{{link.price}}" selector="{{AdminProductDownloadableSection.addLinkPriceInput('0')}}" stepKey="fillDownloadableLinkPrice"/> + <selectOption userInput="{{link.file_type}}" selector="{{AdminProductDownloadableSection.addLinkFileTypeSelector('0')}}" stepKey="selectDownloadableLinkFileType"/> + <selectOption userInput="{{link.sample_type}}" selector="{{AdminProductDownloadableSection.addLinkSampleTypeSelector('0')}}" stepKey="selectDownloadableLinkSampleType"/> + <selectOption userInput="{{link.shareable}}" selector="{{AdminProductDownloadableSection.addLinkShareableSelector('0')}}" stepKey="selectDownloadableLinkShareable"/> + <fillField userInput="{{link.max_downloads}}" selector="{{AdminProductDownloadableSection.addLinkMaxDownloadsInput('0')}}" stepKey="fillDownloadableLinkMaxDownloads"/> + <attachFile userInput="{{link.file}}" selector="{{AdminProductDownloadableSection.addLinkFileUploadFile('0')}}" stepKey="fillDownloadableLinkUploadFile"/> + <fillField userInput="{{link.sample}}" selector="{{AdminProductDownloadableSection.addLinkSampleUrlInput('0')}}" stepKey="fillDownloadableLinkSampleUrl"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AddDownloadableSampleFileActionGroup.xml b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AddDownloadableSampleFileActionGroup.xml new file mode 100644 index 0000000000000..b5b37d0a41b98 --- /dev/null +++ b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AddDownloadableSampleFileActionGroup.xml @@ -0,0 +1,26 @@ +<?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="AddDownloadableSampleFileActionGroup"> + <annotations> + <description>Clicks on 'Add Link' under the 'Samples' section. Fills in the provided Downloadable Sample File details.</description> + </annotations> + <arguments> + <argument name="sample" defaultValue="downloadableSampleFile"/> + </arguments> + + <click selector="{{AdminProductDownloadableSection.samplesAddLinkButton}}" stepKey="clickSampleAddLinkButton"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <fillField userInput="{{sample.title}}" selector="{{AdminProductDownloadableSection.addSampleTitleInput('0')}}" stepKey="fillDownloadableSampleTitle"/> + <selectOption userInput="{{sample.file_type}}" selector="{{AdminProductDownloadableSection.addSampleFileTypeSelector('0')}}" stepKey="selectDownloadableSampleFileType"/> + <attachFile userInput="{{sample.file}}" selector="{{AdminProductDownloadableSection.addSampleFileUploadFile('0')}}" stepKey="selectDownloadableSampleUpload"/> + <waitForAjaxLoad stepKey="waitForSampleFileUpload"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AddDownloadableSampleUrlActionGroup.xml b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AddDownloadableSampleUrlActionGroup.xml new file mode 100644 index 0000000000000..5002722feb51d --- /dev/null +++ b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AddDownloadableSampleUrlActionGroup.xml @@ -0,0 +1,25 @@ +<?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="AddDownloadableSampleUrlActionGroup"> + <annotations> + <description>Clicks on 'Add Link' under the 'Samples' section. Fills in the provided Downloadable Sample URL details.</description> + </annotations> + <arguments> + <argument name="sample" defaultValue="downloadableSampleUrl"/> + </arguments> + + <click selector="{{AdminProductDownloadableSection.samplesAddLinkButton}}" stepKey="clickSampleAddLinkButton2"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <fillField userInput="{{sample.title}}" selector="{{AdminProductDownloadableSection.addSampleTitleInput('1')}}" stepKey="fillDownloadableSampleTitle"/> + <selectOption userInput="{{sample.file_type}}" selector="{{AdminProductDownloadableSection.addSampleFileTypeSelector('1')}}" stepKey="selectDownloadableSampleFileType"/> + <fillField userInput="{{sample.file}}" selector="{{AdminProductDownloadableSection.addSampleFileUrlInput('1')}}" stepKey="fillDownloadableSampleFileUrl"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AdminDownloadableProductActionGroup.xml b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AdminDownloadableProductActionGroup.xml deleted file mode 100644 index 2d2cdd969ac9d..0000000000000 --- a/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AdminDownloadableProductActionGroup.xml +++ /dev/null @@ -1,102 +0,0 @@ -<?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"> - <!--Fill main fields in product form--> - <actionGroup name="fillMainDownloadableProductForm"> - <annotations> - <description>Fills the Name, SKU, Price and Quantity on the Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="product" defaultValue="DownloadableProduct"/> - </arguments> - - <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductSku"/> - <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductName"/> - <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{product.price}}" stepKey="fillProductPrice"/> - <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{product.quantity}}" stepKey="fillProductQty"/> - </actionGroup> - - <!--Add a downloadable link that has max downloads--> - <actionGroup name="addDownloadableProductLinkWithMaxDownloads"> - <annotations> - <description>Clicks on 'Add Link'. Fills in the provided Link details including a Max Downloads limit.</description> - </annotations> - <arguments> - <argument name="link" defaultValue="downloadableLinkWithMaxDownloads"/> - </arguments> - - <click selector="{{AdminProductDownloadableSection.linksAddLinkButton}}" stepKey="clickLinkAddLinkButton"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <fillField userInput="{{link.title}}" selector="{{AdminProductDownloadableSection.addLinkTitleInput('0')}}" stepKey="fillDownloadableLinkTitle"/> - <fillField userInput="{{link.price}}" selector="{{AdminProductDownloadableSection.addLinkPriceInput('0')}}" stepKey="fillDownloadableLinkPrice"/> - <selectOption userInput="{{link.file_type}}" selector="{{AdminProductDownloadableSection.addLinkFileTypeSelector('0')}}" stepKey="selectDownloadableLinkFileType"/> - <selectOption userInput="{{link.sample_type}}" selector="{{AdminProductDownloadableSection.addLinkSampleTypeSelector('0')}}" stepKey="selectDownloadableLinkSampleType"/> - <selectOption userInput="{{link.shareable}}" selector="{{AdminProductDownloadableSection.addLinkShareableSelector('0')}}" stepKey="selectDownloadableLinkShareable"/> - <fillField userInput="{{link.max_downloads}}" selector="{{AdminProductDownloadableSection.addLinkMaxDownloadsInput('0')}}" stepKey="fillDownloadableLinkMaxDownloads"/> - <attachFile userInput="{{link.file}}" selector="{{AdminProductDownloadableSection.addLinkFileUploadFile('0')}}" stepKey="fillDownloadableLinkUploadFile"/> - <fillField userInput="{{link.sample}}" selector="{{AdminProductDownloadableSection.addLinkSampleUrlInput('0')}}" stepKey="fillDownloadableLinkSampleUrl"/> - </actionGroup> - - <!--Add a downloadable link with unlimited downloads--> - <actionGroup name="addDownloadableProductLink"> - <annotations> - <description>Clicks on 'Add Link', under the 'Links' section. Fills in the provided Link details including Unlimited Downloads.</description> - </annotations> - <arguments> - <argument name="link" defaultValue="downloadableLink"/> - <argument name="index" type="string" defaultValue="1"/> - </arguments> - - <click selector="{{AdminProductDownloadableSection.linksAddLinkButton}}" stepKey="clickLinkAddLinkButton"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <fillField userInput="{{link.title}}" selector="{{AdminProductDownloadableSection.addLinkTitleInput(index)}}" stepKey="fillDownloadableLinkTitle"/> - <fillField userInput="{{link.price}}" selector="{{AdminProductDownloadableSection.addLinkPriceInput(index)}}" stepKey="fillDownloadableLinkPrice"/> - <selectOption userInput="{{link.file_type}}" selector="{{AdminProductDownloadableSection.addLinkFileTypeSelector(index)}}" stepKey="selectDownloadableLinkFileType"/> - <selectOption userInput="{{link.sample_type}}" selector="{{AdminProductDownloadableSection.addLinkSampleTypeSelector(index)}}" stepKey="selectDownloadableLinkSampleType"/> - <selectOption userInput="{{link.shareable}}" selector="{{AdminProductDownloadableSection.addLinkShareableSelector(index)}}" stepKey="selectDownloadableLinkShareable"/> - <checkOption selector="{{AdminProductDownloadableSection.addLinkIsUnlimitedDownloads(index)}}" stepKey="checkDownloadableLinkUnlimited"/> - <fillField userInput="{{link.file}}" selector="{{AdminProductDownloadableSection.addLinkFileUrlInput(index)}}" stepKey="fillDownloadableLinkFileUrl"/> - <attachFile userInput="{{link.sample}}" selector="{{AdminProductDownloadableSection.addLinkSampleUploadFile(index)}}" stepKey="attachDownloadableLinkUploadSample"/> - <waitForPageLoad stepKey="waitForPageLoadAfterFillingOutForm" /> - </actionGroup> - - <!--Add a downloadable sample file--> - <actionGroup name="addDownloadableSampleFile"> - <annotations> - <description>Clicks on 'Add Link' under the 'Samples' section. Fills in the provided Downloadable Sample File details.</description> - </annotations> - <arguments> - <argument name="sample" defaultValue="downloadableSampleFile"/> - </arguments> - - <click selector="{{AdminProductDownloadableSection.samplesAddLinkButton}}" stepKey="clickSampleAddLinkButton"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <fillField userInput="{{sample.title}}" selector="{{AdminProductDownloadableSection.addSampleTitleInput('0')}}" stepKey="fillDownloadableSampleTitle"/> - <selectOption userInput="{{sample.file_type}}" selector="{{AdminProductDownloadableSection.addSampleFileTypeSelector('0')}}" stepKey="selectDownloadableSampleFileType"/> - <attachFile userInput="{{sample.file}}" selector="{{AdminProductDownloadableSection.addSampleFileUploadFile('0')}}" stepKey="selectDownloadableSampleUpload"/> - <waitForAjaxLoad stepKey="waitForSampleFileUpload"/> - </actionGroup> - - <!--Add a downloadable sample URL--> - <actionGroup name="addDownloadableSampleUrl"> - <annotations> - <description>Clicks on 'Add Link' under the 'Samples' section. Fills in the provided Downloadable Sample URL details.</description> - </annotations> - <arguments> - <argument name="sample" defaultValue="downloadableSampleUrl"/> - </arguments> - - <click selector="{{AdminProductDownloadableSection.samplesAddLinkButton}}" stepKey="clickSampleAddLinkButton2"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <fillField userInput="{{sample.title}}" selector="{{AdminProductDownloadableSection.addSampleTitleInput('1')}}" stepKey="fillDownloadableSampleTitle"/> - <selectOption userInput="{{sample.file_type}}" selector="{{AdminProductDownloadableSection.addSampleFileTypeSelector('1')}}" stepKey="selectDownloadableSampleFileType"/> - <fillField userInput="{{sample.file}}" selector="{{AdminProductDownloadableSection.addSampleFileUrlInput('1')}}" stepKey="fillDownloadableSampleFileUrl"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/FillMainDownloadableProductFormActionGroup.xml b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/FillMainDownloadableProductFormActionGroup.xml new file mode 100644 index 0000000000000..f18267459c4be --- /dev/null +++ b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/FillMainDownloadableProductFormActionGroup.xml @@ -0,0 +1,25 @@ +<?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"> + <!--Fill main fields in product form--> + <actionGroup name="FillMainDownloadableProductFormActionGroup"> + <annotations> + <description>Fills the Name, SKU, Price and Quantity on the Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="product" defaultValue="DownloadableProduct"/> + </arguments> + + <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductSku"/> + <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductName"/> + <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{product.price}}" stepKey="fillProductPrice"/> + <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{product.quantity}}" stepKey="fillProductQty"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultImageDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultImageDownloadableProductTest.xml index a7ce96ddf1fde..a9c0c8c058890 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultImageDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultImageDownloadableProductTest.xml @@ -51,10 +51,10 @@ <fillField userInput="{{downloadableData.link_title}}" selector="{{AdminProductDownloadableSection.linksTitleInput}}" stepKey="fillDownloadableLinkTitle"/> <checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkLinksPurchasedSeparately"/> <fillField userInput="{{downloadableData.sample_title}}" selector="{{AdminProductDownloadableSection.samplesTitleInput}}" stepKey="fillDownloadableSampleTitle"/> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addDownloadableLinkWithMaxDownloads"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addDownloadableLinkWithMaxDownloads"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> - <actionGroup ref="addDownloadableProductLink" stepKey="addDownloadableLink"> + <actionGroup ref="AddDownloadableProductLinkActionGroup" stepKey="addDownloadableLink"> <argument name="link" value="downloadableLink"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultVideoDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultVideoDownloadableProductTest.xml index d95ddaf12470d..814090c3f4450 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultVideoDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultVideoDownloadableProductTest.xml @@ -40,10 +40,10 @@ <fillField userInput="{{downloadableData.link_title}}" selector="{{AdminProductDownloadableSection.linksTitleInput}}" stepKey="fillLinkTitle" after="checkOptionIsDownloadable"/> <checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkOptionPurchaseSeparately" after="fillLinkTitle"/> <fillField userInput="{{downloadableData.sample_title}}" selector="{{AdminProductDownloadableSection.samplesTitleInput}}" stepKey="fillSampleTitle" after="checkOptionPurchaseSeparately"/> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addDownloadableProductLinkWithMaxDownloads" after="fillSampleTitle"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addDownloadableProductLinkWithMaxDownloads" after="fillSampleTitle"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> - <actionGroup ref="addDownloadableProductLink" stepKey="addDownloadableProductLink" before="saveProductForm"> + <actionGroup ref="AddDownloadableProductLinkActionGroup" stepKey="addDownloadableProductLink" before="saveProductForm"> <argument name="link" value="downloadableLink"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductAndAssignItToCustomStoreTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductAndAssignItToCustomStoreTest.xml index 4f07334640cf3..2e196d1d4e115 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductAndAssignItToCustomStoreTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductAndAssignItToCustomStoreTest.xml @@ -69,7 +69,7 @@ <checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkOptionPurchaseSeparately"/> <!-- Add downloadable link --> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addDownloadableProductLink"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithCustomOptionsTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithCustomOptionsTest.xml index 54a2ff606f384..c6bbbc1f6885a 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithCustomOptionsTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithCustomOptionsTest.xml @@ -81,7 +81,7 @@ <checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkOptionPurchaseSeparately"/> <!-- Add downloadable link --> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addDownloadableProductLink"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithDefaultSetLinksTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithDefaultSetLinksTest.xml index 24741c281d7f6..7e8950cbfb6e0 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithDefaultSetLinksTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithDefaultSetLinksTest.xml @@ -65,12 +65,12 @@ <checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkOptionPurchaseSeparately"/> <!-- Add first downloadable link --> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addFirstDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addFirstDownloadableProductLink"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> <!-- Add second downloadable link --> - <actionGroup ref="addDownloadableProductLink" stepKey="addSecondDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkActionGroup" stepKey="addSecondDownloadableProductLink"> <argument name="link" value="downloadableLink"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithGroupPriceTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithGroupPriceTest.xml index 06cf31b763f1c..92b409b4e882e 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithGroupPriceTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithGroupPriceTest.xml @@ -69,12 +69,12 @@ <checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkOptionPurchaseSeparately"/> <!-- Add first downloadable link --> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addFirstDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addFirstDownloadableProductLink"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> <!-- Add second downloadable link --> - <actionGroup ref="addDownloadableProductLink" stepKey="addSecondDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkActionGroup" stepKey="addSecondDownloadableProductLink"> <argument name="link" value="downloadableLink"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithInvalidDomainLinkUrlTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithInvalidDomainLinkUrlTest.xml index f2e4bdfb4890f..d21d44b85df89 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithInvalidDomainLinkUrlTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithInvalidDomainLinkUrlTest.xml @@ -21,7 +21,7 @@ <before> <remove keyForRemoval="addDownloadableDomain" /> </before> - <actionGroup ref="addDownloadableProductLink" stepKey="addDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkActionGroup" stepKey="addDownloadableProductLink"> <argument name="link" value="downloadableLink"/> <argument name="index" value="0"/> </actionGroup> @@ -33,7 +33,7 @@ </actionGroup> <checkOption selector="{{AdminProductDownloadableSection.isDownloadableProduct}}" stepKey="checkIsDownloadable" after="fillDownloadableProductFormAgain"/> <checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkIsLinksPurchasedSeparately" after="checkIsDownloadable"/> - <actionGroup ref="addDownloadableProductLink" stepKey="addDownloadableProductLinkAgain" after="checkIsLinksPurchasedSeparately"> + <actionGroup ref="AddDownloadableProductLinkActionGroup" stepKey="addDownloadableProductLinkAgain" after="checkIsLinksPurchasedSeparately"> <argument name="link" value="downloadableLink"/> <argument name="index" value="0"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithLinkTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithLinkTest.xml index e43b8f94c7a3d..3dfe45341b694 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithLinkTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithLinkTest.xml @@ -63,7 +63,7 @@ <checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkOptionPurchaseSeparately"/> <!-- Add downloadable link --> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addDownloadableProductLink"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithManageStockTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithManageStockTest.xml index fb6a48254fa8d..14f7fca32782f 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithManageStockTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithManageStockTest.xml @@ -76,12 +76,12 @@ <checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkOptionPurchaseSeparately"/> <!-- Add first downloadable link --> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addFirstDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addFirstDownloadableProductLink"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> <!-- Add second downloadable link --> - <actionGroup ref="addDownloadableProductLink" stepKey="addSecondDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkActionGroup" stepKey="addSecondDownloadableProductLink"> <argument name="link" value="downloadableLink"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithOutOfStockStatusTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithOutOfStockStatusTest.xml index 5e3fe6836f7e9..737945715cd57 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithOutOfStockStatusTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithOutOfStockStatusTest.xml @@ -63,12 +63,12 @@ <checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkOptionPurchaseSeparately"/> <!-- Add first downloadable link --> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addFirstDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addFirstDownloadableProductLink"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> <!-- Add second downloadable link --> - <actionGroup ref="addDownloadableProductLink" stepKey="addSecondDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkActionGroup" stepKey="addSecondDownloadableProductLink"> <argument name="link" value="downloadableLink"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithSpecialPriceTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithSpecialPriceTest.xml index fb59d51831bae..4e01fb575f9f4 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithSpecialPriceTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithSpecialPriceTest.xml @@ -68,12 +68,12 @@ <checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkOptionPurchaseSeparately"/> <!-- Add first downloadable link --> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addFirstDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addFirstDownloadableProductLink"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> <!-- Add second downloadable link --> - <actionGroup ref="addDownloadableProductLink" stepKey="addSecondDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkActionGroup" stepKey="addSecondDownloadableProductLink"> <argument name="link" value="downloadableLink"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutFillingQuantityAndStockTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutFillingQuantityAndStockTest.xml index af9487e3e6a23..12d2d5492d12b 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutFillingQuantityAndStockTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutFillingQuantityAndStockTest.xml @@ -65,12 +65,12 @@ <checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkOptionPurchaseSeparately"/> <!-- Add first downloadable link --> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addFirstDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addFirstDownloadableProductLink"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> <!-- Add second downloadable link --> - <actionGroup ref="addDownloadableProductLink" stepKey="addSecondDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkActionGroup" stepKey="addSecondDownloadableProductLink"> <argument name="link" value="downloadableLink"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutTaxClassIdTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutTaxClassIdTest.xml index dd7e3331a0ed2..670f9f66c186b 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutTaxClassIdTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutTaxClassIdTest.xml @@ -66,12 +66,12 @@ <checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkOptionPurchaseSeparately"/> <!-- Add first downloadable link --> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addFirstDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addFirstDownloadableProductLink"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> <!-- Add second downloadable link --> - <actionGroup ref="addDownloadableProductLink" stepKey="addSecondDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkActionGroup" stepKey="addSecondDownloadableProductLink"> <argument name="link" value="downloadableLink"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml index 20c1acaf8d612..ff76180e34d05 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml @@ -59,7 +59,7 @@ <selectOption selector="{{AdminProductFormSection.productWeightSelect}}" userInput="This item has no weight" stepKey="selectNoWeightForProduct"/> <actionGroup ref="AdminAddDownloadableLinkInformationActionGroup" stepKey="addDownloadableLinkInformation"/> <checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkOptionPurchaseSeparately"/> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addDownloadableProductLink"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> <actionGroup ref="saveProductForm" stepKey="saveDownloadableProductForm"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultImageDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultImageDownloadableProductTest.xml index 3597c12e82df0..90d77a016629b 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultImageDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultImageDownloadableProductTest.xml @@ -48,10 +48,10 @@ <fillField userInput="{{downloadableData.link_title}}" selector="{{AdminProductDownloadableSection.linksTitleInput}}" stepKey="fillDownloadableLinkTitle"/> <checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkLinksPurchasedSeparately"/> <fillField userInput="{{downloadableData.sample_title}}" selector="{{AdminProductDownloadableSection.samplesTitleInput}}" stepKey="fillDownloadableSampleTitle"/> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addDownloadableLinkWithMaxDownloads"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addDownloadableLinkWithMaxDownloads"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> - <actionGroup ref="addDownloadableProductLink" stepKey="addDownloadableLink"> + <actionGroup ref="AddDownloadableProductLinkActionGroup" stepKey="addDownloadableLink"> <argument name="link" value="downloadableLink"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultVideoDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultVideoDownloadableProductTest.xml index 0d98862d9a5e7..ff31087b05d20 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultVideoDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultVideoDownloadableProductTest.xml @@ -41,10 +41,10 @@ <fillField userInput="{{downloadableData.link_title}}" selector="{{AdminProductDownloadableSection.linksTitleInput}}" stepKey="fillLinkTitle" after="checkOptionIsDownloadable"/> <checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkOptionPurchaseSeparately" after="fillLinkTitle"/> <fillField userInput="{{downloadableData.sample_title}}" selector="{{AdminProductDownloadableSection.samplesTitleInput}}" stepKey="fillSampleTitle" after="checkOptionPurchaseSeparately"/> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addDownloadableProductLinkWithMaxDownloads" after="fillSampleTitle"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addDownloadableProductLinkWithMaxDownloads" after="fillSampleTitle"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> - <actionGroup ref="addDownloadableProductLink" stepKey="addDownloadableProductLink" before="saveProductForm"> + <actionGroup ref="AddDownloadableProductLinkActionGroup" stepKey="addDownloadableProductLink" before="saveProductForm"> <argument name="link" value="downloadableLink"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/EditDownloadableProductWithSeparateLinksFromCartTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/EditDownloadableProductWithSeparateLinksFromCartTest.xml index 274dd39468a2b..6beb145de5cfa 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/EditDownloadableProductWithSeparateLinksFromCartTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/EditDownloadableProductWithSeparateLinksFromCartTest.xml @@ -51,12 +51,12 @@ stepKey="checkOptionPurchaseSeparately"/> <!-- Add first downloadable link --> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addFirstDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addFirstDownloadableProductLink"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> <!-- Add second downloadable link --> - <actionGroup ref="addDownloadableProductLink" stepKey="addSecondDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkActionGroup" stepKey="addSecondDownloadableProductLink"> <argument name="link" value="downloadableLink"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/EndToEndB2CAdminTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/EndToEndB2CAdminTest.xml index 75a66cec91692..18b851f08927b 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/EndToEndB2CAdminTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/EndToEndB2CAdminTest.xml @@ -14,7 +14,7 @@ <actionGroup ref="goToCreateProductPage" stepKey="goToCreateDownloadableProduct" after="waitForProductPageLoadDownloadable"> <argument name="product" value="DownloadableProduct"/> </actionGroup> - <actionGroup ref="fillMainDownloadableProductForm" stepKey="fillMainProductFormDownloadable" after="goToCreateDownloadableProduct"> + <actionGroup ref="FillMainDownloadableProductFormActionGroup" stepKey="fillMainProductFormDownloadable" after="goToCreateDownloadableProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -25,22 +25,22 @@ <fillField userInput="{{downloadableData.sample_title}}" selector="{{AdminProductDownloadableSection.samplesTitleInput}}" stepKey="fillDownloadableSampleTitle" after="checkLinksPurchasedSeparately"/> <!-- Link 1 --> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addDownloadableLinkWithMaxDownloads" after="fillDownloadableSampleTitle"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addDownloadableLinkWithMaxDownloads" after="fillDownloadableSampleTitle"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> <!-- Link 2 --> - <actionGroup ref="addDownloadableProductLink" stepKey="addDownloadableLink" after="addDownloadableLinkWithMaxDownloads"> + <actionGroup ref="AddDownloadableProductLinkActionGroup" stepKey="addDownloadableLink" after="addDownloadableLinkWithMaxDownloads"> <argument name="link" value="downloadableLink"/> </actionGroup> <!-- Sample 1 --> - <actionGroup ref="addDownloadableSampleFile" stepKey="addDownloadSampleFile" after="addDownloadableLink"> + <actionGroup ref="AddDownloadableSampleFileActionGroup" stepKey="addDownloadSampleFile" after="addDownloadableLink"> <argument name="sample" value="downloadableSampleFile"/> </actionGroup> <!-- Sample 2 --> - <actionGroup ref="addDownloadableSampleUrl" stepKey="addDownloadableSampleUrl" after="addDownloadSampleFile"> + <actionGroup ref="AddDownloadableSampleUrlActionGroup" stepKey="addDownloadableSampleUrl" after="addDownloadSampleFile"> <argument name="sample" value="downloadableSampleUrl"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/ManualSelectAllDownloadableLinksDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/ManualSelectAllDownloadableLinksDownloadableProductTest.xml index a86fd544d24d6..505151c3ac458 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/ManualSelectAllDownloadableLinksDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/ManualSelectAllDownloadableLinksDownloadableProductTest.xml @@ -51,12 +51,12 @@ stepKey="checkOptionPurchaseSeparately"/> <!-- Add first downloadable link --> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addFirstDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addFirstDownloadableProductLink"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> <!-- Add second downloadable link --> - <actionGroup ref="addDownloadableProductLink" stepKey="addSecondDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkActionGroup" stepKey="addSecondDownloadableProductLink"> <argument name="link" value="downloadableLink"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/NewProductsListWidgetDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/NewProductsListWidgetDownloadableProductTest.xml index 94fca6f507637..55c673146021d 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/NewProductsListWidgetDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/NewProductsListWidgetDownloadableProductTest.xml @@ -46,7 +46,7 @@ <fillField userInput="This Is A Title" selector="{{AdminProductDownloadableSection.linksTitleInput}}" stepKey="fillDownloadableLinkTitle"/> <checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkLinksPurchasedSeparately"/> <fillField userInput="This Is Another Title" selector="{{AdminProductDownloadableSection.samplesTitleInput}}" stepKey="fillDownloadableSampleTitle"/> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addDownloadableLinkWithMaxDownloads"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addDownloadableLinkWithMaxDownloads"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveProduct"/> @@ -59,4 +59,4 @@ <waitForPageLoad stepKey="waitForCmsPage"/> <see selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" userInput="{{_defaultProduct.name}}" stepKey="seeProductName"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/SelectAllDownloadableLinksDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/SelectAllDownloadableLinksDownloadableProductTest.xml index f9ca6fea09cf0..fdd4268bd84e1 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/SelectAllDownloadableLinksDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/SelectAllDownloadableLinksDownloadableProductTest.xml @@ -51,12 +51,12 @@ stepKey="checkOptionPurchaseSeparately"/> <!-- Add first downloadable link --> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addFirstDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addFirstDownloadableProductLink"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> <!-- Add second downloadable link --> - <actionGroup ref="addDownloadableProductLink" stepKey="addSecondDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkActionGroup" stepKey="addSecondDownloadableProductLink"> <argument name="link" value="downloadableLink"/> </actionGroup> From 8ac3bba1327060112cd2b437f95d9fbc71fea89a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 22:27:30 +0100 Subject: [PATCH 136/586] FIX: Update references to the right ones (forgot to replace) --- ...equiredFieldsInGroupedProductFormActionGroup.xml | 13 ------------- .../Test/AdminAddDefaultImageGroupedProductTest.xml | 2 +- .../Test/AdminAddDefaultVideoGroupedProductTest.xml | 2 +- ...AdminCreateAndEditGroupedProductSettingsTest.xml | 4 ++-- .../Test/Mftf/Test/AdminGroupedProductsListTest.xml | 2 +- .../Test/AdminGroupedSetEditRelatedProductsTest.xml | 2 +- .../AdminRemoveDefaultImageGroupedProductTest.xml | 2 +- .../AdminRemoveDefaultVideoGroupedProductTest.xml | 2 +- .../Test/AdminSortingAssociatedProductsTest.xml | 2 +- .../Test/Mftf/Test/EndToEndB2CAdminTest.xml | 8 ++++---- 10 files changed, 13 insertions(+), 26 deletions(-) diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/CheckRequiredFieldsInGroupedProductFormActionGroup.xml b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/CheckRequiredFieldsInGroupedProductFormActionGroup.xml index 26257dd98673c..84bb291120ee5 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/CheckRequiredFieldsInGroupedProductFormActionGroup.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/CheckRequiredFieldsInGroupedProductFormActionGroup.xml @@ -21,17 +21,4 @@ <see selector="{{AdminProductFormSection.fieldError('name')}}" userInput="This is a required field." stepKey="seeNameRequired"/> <see selector="{{AdminProductFormSection.fieldError('sku')}}" userInput="This is a required field." stepKey="seeSkuRequired"/> </actionGroup> - - <!--Fill main fields in grouped product form--> - - - <!--Filter product grid and see expected grouped product--> - - - <!--Fill product min quantity in group products grid--> - - - <!-- Assign Specified Product To Grouped Product --> - <!-- Assumes web client is on grouped product edit page --> - </actionGroups> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultImageGroupedProductTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultImageGroupedProductTest.xml index f2cb2cc993a50..3618e90e6efda 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultImageGroupedProductTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultImageGroupedProductTest.xml @@ -45,7 +45,7 @@ <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> <argument name="product" value="GroupedProduct"/> </actionGroup> - <actionGroup ref="fillGroupedProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillGroupedProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="GroupedProduct"/> </actionGroup> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultVideoGroupedProductTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultVideoGroupedProductTest.xml index c3a95bbef3aa3..9892df4bb0b41 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultVideoGroupedProductTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultVideoGroupedProductTest.xml @@ -32,7 +32,7 @@ <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"> <argument name="product" value="GroupedProduct"/> </actionGroup> - <actionGroup ref="fillGroupedProductForm" stepKey="fillMainProductForm"> + <actionGroup ref="FillGroupedProductFormActionGroup" stepKey="fillMainProductForm"> <argument name="product" value="GroupedProduct"/> </actionGroup> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateAndEditGroupedProductSettingsTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateAndEditGroupedProductSettingsTest.xml index 62a685554f735..8420de66a1604 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateAndEditGroupedProductSettingsTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateAndEditGroupedProductSettingsTest.xml @@ -52,12 +52,12 @@ </actionGroup> <!-- Fill all main fields --> - <actionGroup ref="fillGroupedProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillGroupedProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="GroupedProduct"/> </actionGroup> <!-- Add simple product to the Group --> - <actionGroup ref="AdminAssignProductToGroup" stepKey="addFirstSimpleToGroup"> + <actionGroup ref="AdminAssignProductToGroupActionGroup" stepKey="addFirstSimpleToGroup"> <argument name="product" value="$$createProduct$$"/> </actionGroup> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedProductsListTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedProductsListTest.xml index b59cf1e2175d8..8c9b9ee552ffe 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedProductsListTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedProductsListTest.xml @@ -42,7 +42,7 @@ <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"> <argument name="product" value="GroupedProduct"/> </actionGroup> - <actionGroup ref="fillGroupedProductForm" stepKey="fillMainProductForm"> + <actionGroup ref="FillGroupedProductFormActionGroup" stepKey="fillMainProductForm"> <argument name="product" value="GroupedProduct"/> </actionGroup> <!-- Add two simple products to grouped product --> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedSetEditRelatedProductsTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedSetEditRelatedProductsTest.xml index 8117d627a370c..cddadff986539 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedSetEditRelatedProductsTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedSetEditRelatedProductsTest.xml @@ -30,7 +30,7 @@ <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> <argument name="product" value="GroupedProduct"/> </actionGroup> - <actionGroup ref="fillGroupedProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillGroupedProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="GroupedProduct"/> </actionGroup> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultImageGroupedProductTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultImageGroupedProductTest.xml index da7cfaeb71566..de899d77a9a7a 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultImageGroupedProductTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultImageGroupedProductTest.xml @@ -42,7 +42,7 @@ <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> <argument name="product" value="GroupedProduct"/> </actionGroup> - <actionGroup ref="fillGroupedProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillGroupedProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="GroupedProduct"/> </actionGroup> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultVideoGroupedProductTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultVideoGroupedProductTest.xml index e322d4a1eb038..3bd74c103a519 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultVideoGroupedProductTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultVideoGroupedProductTest.xml @@ -32,7 +32,7 @@ <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"> <argument name="product" value="GroupedProduct"/> </actionGroup> - <actionGroup ref="fillGroupedProductForm" stepKey="fillMainProductForm"> + <actionGroup ref="FillGroupedProductFormActionGroup" stepKey="fillMainProductForm"> <argument name="product" value="GroupedProduct"/> </actionGroup> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminSortingAssociatedProductsTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminSortingAssociatedProductsTest.xml index ad5fbbb30edeb..dc6cde31c1ae6 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminSortingAssociatedProductsTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminSortingAssociatedProductsTest.xml @@ -133,7 +133,7 @@ <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> <argument name="product" value="GroupedProduct"/> </actionGroup> - <actionGroup ref="fillGroupedProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillGroupedProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="GroupedProduct"/> </actionGroup> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/EndToEndB2CAdminTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/EndToEndB2CAdminTest.xml index dbe3dddfca81b..80b7640f8283c 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/EndToEndB2CAdminTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/EndToEndB2CAdminTest.xml @@ -14,8 +14,8 @@ <actionGroup ref="goToCreateProductPage" stepKey="goToCreateGroupedProduct" after="waitForProductPageLoadGrouped"> <argument name="product" value="GroupedProduct"/> </actionGroup> - <actionGroup ref="checkRequiredFieldsInGroupedProductForm" stepKey="checkRequiredFieldsProductGrouped" after="goToCreateGroupedProduct"/> - <actionGroup ref="fillGroupedProductForm" stepKey="fillGroupedProductForm" after="checkRequiredFieldsProductGrouped"> + <actionGroup ref="CheckRequiredFieldsInGroupedProductFormActionGroup" stepKey="checkRequiredFieldsProductGrouped" after="goToCreateGroupedProduct"/> + <actionGroup ref="FillGroupedProductFormActionGroup" stepKey="fillGroupedProductForm" after="checkRequiredFieldsProductGrouped"> <argument name="product" value="GroupedProduct"/> </actionGroup> <scrollTo selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" x="0" y="-100" stepKey="scrollToGroupedSection" after="fillGroupedProductForm"/> @@ -29,7 +29,7 @@ <checkOption selector="{{AdminAddProductsToGroupPanel.firstCheckbox}}" stepKey="checkFilterResult" after="filterGroupedProductOptions"/> <click selector="{{AdminAddProductsToGroupPanel.addSelectedProducts}}" stepKey="clickAddSelectedGroupProducts" after="checkFilterResult"/> <actionGroup ref="saveProductForm" stepKey="saveGroupedProduct" after="clickAddSelectedGroupProducts"/> - <actionGroup ref="viewGroupedProductInAdminGrid" stepKey="viewGroupedProductInGrid" after="saveGroupedProduct"> + <actionGroup ref="ViewGroupedProductInAdminGridActionGroup" stepKey="viewGroupedProductInGrid" after="saveGroupedProduct"> <argument name="product" value="GroupedProduct"/> </actionGroup> @@ -39,4 +39,4 @@ <argument name="product" value="GroupedProduct"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> From c6c5a3302467f20e270dc5d20ff5b4f23e3f2e8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 22:53:03 +0100 Subject: [PATCH 137/586] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- .../AdminCurrencyRatesActionGroup.xml | 16 -------------- .../AdminSaveCurrencyRatesActionGroup.xml | 16 ++++++++++++++ .../AdminSetCurrencyRatesActionGroup.xml | 22 +++++++++++++++++++ .../StorefrontCurrencyRatesActionGroup.xml | 9 -------- ...ayWhenChooseThreeAllowedCurrenciesTest.xml | 2 +- 5 files changed, 39 insertions(+), 26 deletions(-) create mode 100644 app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/AdminSaveCurrencyRatesActionGroup.xml create mode 100644 app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/AdminSetCurrencyRatesActionGroup.xml diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/AdminCurrencyRatesActionGroup.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/AdminCurrencyRatesActionGroup.xml index a2e25cf858a6e..7f2a9846f3fd0 100644 --- a/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/AdminCurrencyRatesActionGroup.xml +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/AdminCurrencyRatesActionGroup.xml @@ -16,20 +16,4 @@ <click selector="{{AdminCurrencyRatesSection.import}}" stepKey="clickImport"/> <waitForElementVisible selector="{{AdminCurrencyRatesSection.oldRate}}" stepKey="waitForOldRateVisible"/> </actionGroup> - <actionGroup name="AdminSaveCurrencyRatesActionGroup"> - <click selector="{{AdminCurrencyRatesSection.saveCurrencyRates}}" stepKey="clickSaveCurrencyRates"/> - <waitForPageLoad stepKey="waitForSave"/> - <see selector="{{AdminMessagesSection.success}}" userInput="All valid rates have been saved." stepKey="seeSuccessMessage"/> - </actionGroup> - <actionGroup name="AdminSetCurrencyRatesActionGroup"> - <arguments> - <argument name="firstCurrency" type="string" defaultValue="USD"/> - <argument name="secondCurrency" type="string" defaultValue="EUR"/> - <argument name="rate" type="string" defaultValue="0.5"/> - </arguments> - <fillField selector="{{AdminCurrencyRatesSection.currencyRate(firstCurrency, secondCurrency)}}" userInput="{{rate}}" stepKey="setCurrencyRate"/> - <click selector="{{AdminCurrencyRatesSection.saveCurrencyRates}}" stepKey="clickSaveCurrencyRates"/> - <waitForPageLoad stepKey="waitForSave"/> - <see selector="{{AdminMessagesSection.success}}" userInput="{{AdminSaveCurrencyRatesMessageData.success}}" stepKey="seeSuccessMessage"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/AdminSaveCurrencyRatesActionGroup.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/AdminSaveCurrencyRatesActionGroup.xml new file mode 100644 index 0000000000000..82401eea34aca --- /dev/null +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/AdminSaveCurrencyRatesActionGroup.xml @@ -0,0 +1,16 @@ +<?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="AdminSaveCurrencyRatesActionGroup"> + <click selector="{{AdminCurrencyRatesSection.saveCurrencyRates}}" stepKey="clickSaveCurrencyRates"/> + <waitForPageLoad stepKey="waitForSave"/> + <see selector="{{AdminMessagesSection.success}}" userInput="All valid rates have been saved." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/AdminSetCurrencyRatesActionGroup.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/AdminSetCurrencyRatesActionGroup.xml new file mode 100644 index 0000000000000..6b8a93ef3542d --- /dev/null +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/AdminSetCurrencyRatesActionGroup.xml @@ -0,0 +1,22 @@ +<?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="AdminSetCurrencyRatesActionGroup"> + <arguments> + <argument name="firstCurrency" type="string" defaultValue="USD"/> + <argument name="secondCurrency" type="string" defaultValue="EUR"/> + <argument name="rate" type="string" defaultValue="0.5"/> + </arguments> + <fillField selector="{{AdminCurrencyRatesSection.currencyRate(firstCurrency, secondCurrency)}}" userInput="{{rate}}" stepKey="setCurrencyRate"/> + <click selector="{{AdminCurrencyRatesSection.saveCurrencyRates}}" stepKey="clickSaveCurrencyRates"/> + <waitForPageLoad stepKey="waitForSave"/> + <see selector="{{AdminMessagesSection.success}}" userInput="{{AdminSaveCurrencyRatesMessageData.success}}" stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/StorefrontCurrencyRatesActionGroup.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/StorefrontCurrencyRatesActionGroup.xml index 02cf23c323a8a..2f6d1df102d06 100644 --- a/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/StorefrontCurrencyRatesActionGroup.xml +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/StorefrontCurrencyRatesActionGroup.xml @@ -17,13 +17,4 @@ <click selector="{{StorefrontSwitchCurrencyRatesSection.currency(currency)}}" stepKey="chooseCurrency"/> <see selector="{{StorefrontSwitchCurrencyRatesSection.selectedCurrency}}" userInput="{{currency}}" stepKey="seeSelectedCurrency"/> </actionGroup> - <actionGroup name="StorefrontSwitchCurrency"> - <arguments> - <argument name="currency" type="string" defaultValue="EUR"/> - </arguments> - <click selector="{{StorefrontSwitchCurrencyRatesSection.currencyTrigger}}" stepKey="openTrigger"/> - <waitForElementVisible selector="{{StorefrontSwitchCurrencyRatesSection.currency(currency)}}" stepKey="waitForCurrency"/> - <click selector="{{StorefrontSwitchCurrencyRatesSection.currency(currency)}}" stepKey="chooseCurrency"/> - <see selector="{{StorefrontSwitchCurrencyRatesSection.selectedCurrency}}" userInput="{{currency}}" stepKey="seeSelectedCurrency"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayWhenChooseThreeAllowedCurrenciesTest.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayWhenChooseThreeAllowedCurrenciesTest.xml index 26fbfd394be68..8783f1cee041b 100644 --- a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayWhenChooseThreeAllowedCurrenciesTest.xml +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayWhenChooseThreeAllowedCurrenciesTest.xml @@ -45,7 +45,7 @@ <!--Open created product on Storefront and place for order--> <amOnPage url="{{StorefrontProductPage.url($$createNewProduct.custom_attributes[url_key]$$)}}" stepKey="goToNewProductPage"/> <waitForPageLoad stepKey="waitForNewProductPagePageLoad"/> - <actionGroup ref="StorefrontSwitchCurrency" stepKey="switchCurrency"> + <actionGroup ref="StorefrontSwitchCurrencyActionGroup" stepKey="switchCurrency"> <argument name="currency" value="RUB"/> </actionGroup> <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontNewProductPage"> From 121a17d31906f2cedc266e0c5a316b9b15cc0064 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Fri, 29 Nov 2019 00:04:35 +0100 Subject: [PATCH 138/586] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- .../Test/AdminDeleteCatalogPriceRuleTest.xml | 2 +- .../Mftf/Test/SearchEntityResultsTest.xml | 4 +- ...oductConfigurationAttributeActionGroup.xml | 49 ++ ...ProductToConfigurationsGridActionGroup.xml | 29 + ...ToConfigurableProductOptionActionGroup.xml | 27 + ...ToConfigurableProductOptionActionGroup.xml | 25 + ...ToConfigurableProductOptionActionGroup.xml | 21 + .../AdminConfigurableProductActionGroup.xml | 545 ------------------ ...roductDisableConfigurationsActionGroup.xml | 19 + ...gurableWizardMoveToNextStepActionGroup.xml | 23 + ...reateApiConfigurableProductActionGroup.xml | 17 - ...rableProductWithHiddenChildActionGroup.xml | 26 + ...tWithAttributeUncheckOptionActionGroup.xml | 25 + ...eConfigurationsForAttributeActionGroup.xml | 22 + ...leProductOnAdminProductPageActionGroup.xml | 23 + ...riceOnStorefrontProductPageActionGroup.xml | 26 + ...AndPriceInStorefrontProductActionGroup.xml | 25 + ...mageInStorefrontProductPageActionGroup.xml | 26 + ...bleProductChildProductPriceActionGroup.xml | 21 + ...ProductConfigurationsInGridActionGroup.xml | 31 + ...nfigurationsInGridExceptSkuActionGroup.xml | 19 + .../CreateConfigurableProductActionGroup.xml | 75 +++ ...ableProductWithAttributeSetActionGroup.xml | 27 + ...bleProductWithTwoAttributesActionGroup.xml | 57 ++ ...eConfigurationsForAttributeActionGroup.xml | 22 + ...tionsForAttributeWithImagesActionGroup.xml | 29 + ...nfigurationsForTwoAttributeActionGroup.xml | 34 ++ ....xml => CreateNewAttributeActionGroup.xml} | 74 +-- .../CreateOptionsForAttributeActionGroup.xml | 31 + .../DeleteCreatedAttributeActionGroup.xml | 45 ++ .../FillAllRequiredFieldsActionGroup.xml | 24 + ...dProductAfterSettingOptionsActionGroup.xml | 15 + ...nfigurationsByAttributeCodeActionGroup.xml | 32 + .../GotoCatalogProductsPageActionGroup.xml | 22 + ...GotoConfigurableProductPageActionGroup.xml | 21 + .../SaveConfigurableProductActionGroup.xml | 23 + ...uctAddToCurrentAttributeSetActionGroup.xml | 22 + ...eProductWithNewAttributeSetActionGroup.xml | 23 + .../SaveConfiguredProductActionGroup.xml | 20 + ...ttributeAndCreateTwoOptionsActionGroup.xml | 28 + ...SingleAttributeAndAddToCartActionGroup.xml | 26 + ...eConfigurationsForAttributeActionGroup.xml | 15 + ...ategoryConfigurableProductActionGroup.xml} | 17 +- ...tOfStockConfigurableProductActionGroup.xml | 24 + ...ontCheckConfigurableProductActionGroup.xml | 31 + ...kConfigurableProductOptionsActionGroup.xml | 32 + ...AndCheckConfigurableProductActionGroup.xml | 24 + .../StorefrontProductActionGroup.xml | 134 ----- .../StorefrontProductCartActionGroup.xml | 12 - ...fyOptionInProductStorefrontActionGroup.xml | 22 + ...figurableProductInAdminGridActionGroup.xml | 41 ++ ...agesAndPricesToConfigurableProductTest.xml | 6 +- ...hangedWhenSavingProductWithSameSkuTest.xml | 2 +- ...bleProductAttributeValueUniquenessTest.xml | 2 +- ...CheckResultsOfColorAndOtherFiltersTest.xml | 14 +- .../AdminConfigurableProductCreateTest.xml | 2 +- .../AdminConfigurableProductLongSkuTest.xml | 2 +- .../AdminConfigurableProductUpdateTest.xml | 4 +- ...ConfigurableSetEditRelatedProductsTest.xml | 2 +- .../Test/AdminCreateAndSwitchProductType.xml | 18 +- ...onfigurableProductBasedOnParentSkuTest.xml | 8 +- ...ctWithCreatingCategoryAndAttributeTest.xml | 12 +- ...roductWithDisabledChildrenProductsTest.xml | 6 +- ...reateConfigurableProductWithImagesTest.xml | 16 +- ...eeProductDisplayOutOfStockProductsTest.xml | 12 +- ...oductDontDisplayOutOfStockProductsTest.xml | 12 +- ...ableProductWithTierPriceForOneItemTest.xml | 6 +- ...ctWithTwoOptionsAssignedToCategoryTest.xml | 10 +- ...woOptionsWithoutAssignedToCategoryTest.xml | 8 +- ...AdminProductTypeSwitchingOnEditingTest.xml | 8 +- ...igurableProductAttributeNameDesignTest.xml | 10 +- .../Test/Mftf/Test/EndToEndB2CAdminTest.xml | 4 +- .../Mftf/Test/EndToEndB2CGuestUserTest.xml | 32 +- .../Mftf/Test/EndToEndB2CLoggedInUserTest.xml | 16 +- ...orefrontConfigurableProductDetailsTest.xml | 10 +- .../StorefrontConfigurableProductViewTest.xml | 6 +- ...gurableProductWithFileCustomOptionTest.xml | 4 +- ...efrontVisibilityOfDuplicateProductTest.xml | 28 +- ...uctWithAttributesImagesAndSwatchesTest.xml | 2 +- ...figurableProductSwatchMinimumPriceTest.xml | 22 +- .../StorefrontFilterByImageSwatchTest.xml | 2 +- .../Test/StorefrontFilterByTextSwatchTest.xml | 2 +- .../StorefrontFilterByVisualSwatchTest.xml | 2 +- ...tImageColorWhenFilterByColorFilterTest.xml | 4 +- ...oductImagesMatchingProductSwatchesTest.xml | 8 +- ...ddToCartWishListWithUnselectedAttrTest.xml | 2 +- ...tChildImageShouldBeShownOnWishListTest.xml | 2 +- .../Test/EndToEndB2CGuestUserTest.xml | 8 +- .../Test/EndToEndB2CLoggedInUserTest.xml | 4 +- 89 files changed, 1366 insertions(+), 959 deletions(-) create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddNewProductConfigurationAttributeActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddProductToConfigurationsGridActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddUniqueImageToConfigurableProductOptionActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddUniquePriceToConfigurableProductOptionActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddUniqueQuantityToConfigurableProductOptionActionGroup.xml delete mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminConfigurableProductActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminConfigurableProductDisableConfigurationsActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminConfigurableWizardMoveToNextStepActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminCreateApiConfigurableProductWithHiddenChildActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminCreateConfigurableProductWithAttributeUncheckOptionActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminCreateConfigurationsForAttributeActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertConfigurableProductOnAdminProductPageActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertConfigurableProductWithSpecialPriceOnStorefrontProductPageActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertOptionImageAndPriceInStorefrontProductActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertOptionImageInStorefrontProductPageActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/ChangeConfigurableProductChildProductPriceActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/ChangeProductConfigurationsInGridActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/ChangeProductConfigurationsInGridExceptSkuActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurableProductActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurableProductWithAttributeSetActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurableProductWithTwoAttributesActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurationsForAttributeActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurationsForAttributeWithImagesActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurationsForTwoAttributeActionGroup.xml rename app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/{ConfigurableProductAttributeNameDesignActionGroup.xml => CreateNewAttributeActionGroup.xml} (55%) create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateOptionsForAttributeActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/DeleteCreatedAttributeActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/FillAllRequiredFieldsActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/GenerateAndSaveConfiguredProductAfterSettingOptionsActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/GenerateConfigurationsByAttributeCodeActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/GotoCatalogProductsPageActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/GotoConfigurableProductPageActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SaveConfigurableProductActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SaveConfigurableProductAddToCurrentAttributeSetActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SaveConfigurableProductWithNewAttributeSetActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SaveConfiguredProductActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SelectCreatedAttributeAndCreateTwoOptionsActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SelectSingleAttributeAndAddToCartActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StartCreateConfigurationsForAttributeActionGroup.xml rename app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/{StorefrontCategoryActionGroup.xml => StorefrontCheckCategoryConfigurableProductActionGroup.xml} (60%) create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontCheckCategoryOutOfStockConfigurableProductActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontCheckConfigurableProductActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontCheckConfigurableProductOptionsActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontOpenMinicartAndCheckConfigurableProductActionGroup.xml delete mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontProductActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/VerifyOptionInProductStorefrontActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/ViewConfigurableProductInAdminGridActionGroup.xml diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml index 16fbca2697702..f9665e9e0a48a 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml @@ -28,7 +28,7 @@ <!-- Login to Admin page --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!-- Create a configurable product --> - <actionGroup ref="createConfigurableProduct" stepKey="createConfigurableProduct"> + <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createConfigurableProduct"> <argument name="product" value="_defaultProduct"/> <argument name="category" value="$$createCategory$$"/> </actionGroup> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml index 3b60e4b09de28..a4a41b38aa954 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml @@ -366,7 +366,7 @@ <before> <createData entity="_defaultCategory" stepKey="createCategory"/> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> - <actionGroup ref="createConfigurableProduct" stepKey="createProduct"> + <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> <argument name="product" value="_defaultProduct"/> <argument name="category" value="$$createCategory$$"/> </actionGroup> @@ -391,7 +391,7 @@ <argument name="productName" value="{{_defaultProduct.name}}"/> <argument name="productUrlKey" value="{{_defaultProduct.urlKey}}"/> </actionGroup> - <actionGroup ref="SelectSingleAttributeAndAddToCart" stepKey="addProductToCart"> + <actionGroup ref="SelectSingleAttributeAndAddToCartActionGroup" stepKey="addProductToCart"> <argument name="productName" value="{{_defaultProduct.name}}"/> <argument name="attributeCode" value="{{colorProductAttribute.default_label}}"/> <argument name="optionName" value="{{colorProductAttribute1.name}}"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddNewProductConfigurationAttributeActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddNewProductConfigurationAttributeActionGroup.xml new file mode 100644 index 0000000000000..5914d935d3c49 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddNewProductConfigurationAttributeActionGroup.xml @@ -0,0 +1,49 @@ +<?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="AddNewProductConfigurationAttributeActionGroup"> + <annotations> + <description>Generates the Product Configurations for the 2 provided Attribute Names on the Configurable Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="attribute" type="entity"/> + <argument name="firstOption" type="entity"/> + <argument name="secondOption" type="entity"/> + </arguments> + + <!-- Create new attribute --> + <click selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" stepKey="clickOnNewAttribute"/> + <waitForPageLoad stepKey="waitForIFrame"/> + <switchToIFrame selector="{{AdminNewAttributePanel.newAttributeIFrame}}" stepKey="switchToNewAttributeIFrame"/> + <fillField selector="{{AdminNewAttributePanel.defaultLabel}}" userInput="{{attribute.default_label}}" stepKey="fillDefaultLabel"/> + <click selector="{{AdminNewAttributePanel.saveAttribute}}" stepKey="clickOnNewAttributePanel"/> + <waitForPageLoad stepKey="waitForSaveAttribute"/> + <switchToIFrame stepKey="switchOutOfIFrame"/> + <waitForPageLoad stepKey="waitForFilters"/> + + <!-- Find created below attribute and add option; save attribute --> + <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickOnFilters"/> + <fillField userInput="{{attribute.default_label}}" selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" stepKey="fillFilterAttributeCodeField"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/> + <click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton"/> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="waitCreateNewValueAppears"/> + <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateFirstNewValue"/> + <fillField userInput="{{firstOption.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewFirstOption"/> + <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute"/> + <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateSecondNewValue"/> + <fillField userInput="{{secondOption.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewSecondOption"/> + <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveAttribute"/> + <click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="clickOnSelectAll"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnSecondNextButton"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnThirdNextButton"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnFourthNextButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddProductToConfigurationsGridActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddProductToConfigurationsGridActionGroup.xml new file mode 100644 index 0000000000000..f9bd485fa4511 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddProductToConfigurationsGridActionGroup.xml @@ -0,0 +1,29 @@ +<?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="AddProductToConfigurationsGridActionGroup"> + <annotations> + <description>Adds the provided Product SKU to the provided Product Name.</description> + </annotations> + <arguments> + <argument name="sku" type="string"/> + <argument name="name" type="string"/> + </arguments> + + <click selector="{{AdminProductFormConfigurationsSection.actionsBtnByProductName(name)}}" stepKey="clickToExpandFirstActions"/> + <click selector="{{AdminProductFormConfigurationsSection.addProduct(name)}}" stepKey="clickChooseFirstDifferentProduct"/> + <switchToIFrame stepKey="switchOutOfIFrame"/> + <waitForPageLoad stepKey="waitForFilters"/> + <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickFilters"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <click selector="{{AdminProductGridFilterSection.firstRowBySku(sku)}}" stepKey="clickOnFirstRow"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddUniqueImageToConfigurableProductOptionActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddUniqueImageToConfigurableProductOptionActionGroup.xml new file mode 100644 index 0000000000000..26fe50d845dbc --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddUniqueImageToConfigurableProductOptionActionGroup.xml @@ -0,0 +1,27 @@ +<?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="AddUniqueImageToConfigurableProductOptionActionGroup"> + <annotations> + <description>Adds the provided Image to a Configurable Product on the Admin Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="image" defaultValue="ProductImage"/> + <argument name="frontend_label" type="string"/> + <argument name="label" type="string"/> + </arguments> + + <click selector="{{AdminCreateProductConfigurationsPanel.applyUniqueImagesToEachSkus}}" stepKey="clickOnApplyUniqueImagesToEachSku"/> + <selectOption userInput="{{frontend_label}}" selector="{{AdminCreateProductConfigurationsPanel.selectImagesButton}}" stepKey="selectOption"/> + <attachFile selector="{{AdminCreateProductConfigurationsPanel.uploadImagesButton(label)}}" userInput="{{image.file}}" stepKey="uploadFile"/> + <waitForElementNotVisible selector="{{AdminCreateProductConfigurationsPanel.uploadProgressBar}}" stepKey="waitForUpload"/> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.imageFile(image.fileName)}}" stepKey="waitForThumbnail"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddUniquePriceToConfigurableProductOptionActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddUniquePriceToConfigurableProductOptionActionGroup.xml new file mode 100644 index 0000000000000..3852dc5c821ed --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddUniquePriceToConfigurableProductOptionActionGroup.xml @@ -0,0 +1,25 @@ +<?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="AddUniquePriceToConfigurableProductOptionActionGroup"> + <annotations> + <description>On the 'Step 3: Bulk Images, Price and Quantity' page of the 'Create Product Configurations' model click on 'Apply unique prices...'. Select provided Option. Fill price.</description> + </annotations> + <arguments> + <argument name="frontend_label" type="string"/> + <argument name="label" type="string"/> + <argument name="price" type="string"/> + </arguments> + + <click selector="{{AdminCreateProductConfigurationsPanel.applyUniquePricesToEachSkus}}" stepKey="clickOnApplyUniquePricesToEachSku"/> + <selectOption userInput="{{frontend_label}}" selector="{{AdminCreateProductConfigurationsPanel.selectPriceButton}}" stepKey="selectOption"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.price(label)}}" userInput="{{price}}" stepKey="enterAttributeQuantity"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddUniqueQuantityToConfigurableProductOptionActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddUniqueQuantityToConfigurableProductOptionActionGroup.xml new file mode 100644 index 0000000000000..b92a847df8f1d --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddUniqueQuantityToConfigurableProductOptionActionGroup.xml @@ -0,0 +1,21 @@ +<?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="AddUniqueQuantityToConfigurableProductOptionActionGroup"> + <arguments> + <argument name="frontend_label" type="string" defaultValue="{{productAttributeColor.default_label}}"/> + <argument name="label" type="string" defaultValue="option1"/> + <argument name="quantity" type="string" defaultValue="10"/> + </arguments> + <click selector="{{AdminCreateProductConfigurationsPanel.applyUniqueQuantityToEachSkus}}" stepKey="clickOnApplyUniqueQuantitiesToEachSku"/> + <selectOption selector="{{AdminCreateProductConfigurationsPanel.selectQuantity}}" userInput="{{frontend_label}}" stepKey="selectOption"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.applyUniqueQuantity(label)}}" userInput="{{quantity}}" stepKey="enterAttributeQuantity"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminConfigurableProductActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminConfigurableProductActionGroup.xml deleted file mode 100644 index 02c7aeb3db6ac..0000000000000 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminConfigurableProductActionGroup.xml +++ /dev/null @@ -1,545 +0,0 @@ -<?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="CreateConfigurableProductWithAttributeSet"> - <annotations> - <description>Admin edit created product as configurable. Choose created options</description> - </annotations> - <arguments> - <argument name="product" defaultValue="_defaultProduct"/> - <argument name="category" defaultValue="_defaultCategory"/> - <argument name="label" type="string" defaultValue="mySet"/> - <argument name="option" type="string" defaultValue="['option1', 'option2', 'option3', 'option4']"/> - </arguments> - <click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet"/> - <fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{label}}" stepKey="searchForAttrSet"/> - <click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttrSet"/> - <fillField userInput="{{product.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/> - <selectOption selector="{{AdminProductFormSection.additionalOptions}}" parameterArray="{{option}}" stepKey="searchAndMultiSelectCreatedOption"/> - </actionGroup> - <actionGroup name="AdminCreateConfigurationsForAttribute" extends="generateConfigurationsByAttributeCode"> - <annotations> - <description>EXTENDS: generateConfigurationsByAttributeCode. Click to apply single price to all Skus. Enter Attribute price</description> - </annotations> - <arguments> - <argument name="price" type="string" defaultValue="100"/> - </arguments> - <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" after="clickOnNextButton2" stepKey="waitForNextPageOpened2"/> - <click selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" after="waitForNextPageOpened2" stepKey="clickOnApplySinglePriceToAllSkus"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.singlePrice}}" userInput="{{price}}" before="clickOnApplySingleQuantityToEachSku" stepKey="enterAttributePrice"/> - </actionGroup> - <actionGroup name="AdminCreateConfigurableProductWithAttributeUncheckOption" extends="generateConfigurationsByAttributeCode"> - <annotations> - <description>EXTENDS: generateConfigurationsByAttributeCode. Click to uncheck created option. Enter Attribute price</description> - </annotations> - <arguments> - <argument name="attributeOption" type="string" defaultValue="option1"/> - <argument name="price" type="string" defaultValue="100"/> - </arguments> - <click selector="{{AdminCreateProductConfigurationsPanel.attributeOption('attributeOption')}}" after="clickOnSelectAll" stepKey="clickToUncheckOption"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" after="clickToUncheckOption" stepKey="clickOnNextButton22"/> - <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" after="clickOnNextButton22" stepKey="waitForNextPageOpened2"/> - <click selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" after="waitForNextPageOpened2" stepKey="clickOnApplySinglePriceToAllSkus"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.singlePrice}}" userInput="{{price}}" before="clickOnApplySingleQuantityToEachSku" stepKey="enterAttributePrice"/> - </actionGroup> - <!--Filter the product grid and view expected products--> - <actionGroup name="viewConfigurableProductInAdminGrid"> - <annotations> - <description>Goes to the Admin Product grid page. Validates the provided Configurable Product is present and correct in the grid.</description> - </annotations> - <arguments> - <argument name="product" defaultValue="_defaultProduct"/> - </arguments> - - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> - <waitForPageLoad stepKey="waitForPageLoadInitial"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <seeNumberOfElements selector="{{AdminProductGridSection.productGridRows}}" userInput="3" stepKey="seeCorrectNumberOfProducts"/> - - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFiltersSimple"/> - <selectOption selector="{{AdminProductGridFilterSection.typeFilter}}" userInput="simple" stepKey="selectionProductType"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFiltersWithSimpleType"/> - <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.name}}" stepKey="seeSimpleProductNameInGrid"/> - <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.price}}" stepKey="seeSimpleProductPriceInGrid"/> - - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFiltersConfigurable"/> - <selectOption selector="{{AdminProductGridFilterSection.typeFilter}}" userInput="{{product.type_id}}" stepKey="selectionConfigurableProductType"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFiltersWithConfigurableType"/> - <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.name}}" stepKey="seeConfigurableProductNameInGrid"/> - <dontSee selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.price}}" stepKey="dontSeeProductPriceNameInGrid"/> - - <click selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="clickClearFiltersAfter"/> - </actionGroup> - - <!--Create a configurable product with three options for color: red, white, and blue - Expected start state = logged in as an admin - End state = on the product edit page in the admin--> - <actionGroup name="createConfigurableProduct"> - <annotations> - <description>Goes to the Admin Product grid page. Creates a Configurable Product using the default Product Options.</description> - </annotations> - <arguments> - <argument name="product" defaultValue="_defaultProduct"/> - <argument name="category" defaultValue="_defaultCategory"/> - </arguments> - - <!-- fill in basic configurable product values --> - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> - <waitForPageLoad time="30" stepKey="wait1"/> - <click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickOnAddProductToggle"/> - <click selector="{{AdminProductGridActionSection.addConfigurableProduct}}" stepKey="clickOnAddConfigurableProduct"/> - <fillField userInput="{{product.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/> - <fillField userInput="{{product.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="fillSKU"/> - <fillField userInput="{{product.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="fillPrice"/> - <fillField userInput="{{product.quantity}}" selector="{{AdminProductFormSection.productQuantity}}" stepKey="fillQuantity"/> - <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{category.name}}]" stepKey="fillCategory"/> - <selectOption userInput="{{product.visibility}}" selector="{{AdminProductFormSection.visibility}}" stepKey="fillVisibility"/> - <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/> - <fillField userInput="{{product.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/> - - <!-- create configurations for colors the product is available in --> - <click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickOnCreateConfigurations"/> - <click selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" stepKey="clickOnNewAttribute"/> - <waitForPageLoad stepKey="waitForIFrame"/> - <switchToIFrame selector="{{AdminNewAttributePanel.newAttributeIFrame}}" stepKey="switchToNewAttributeIFrame"/> - <fillField selector="{{AdminNewAttributePanel.defaultLabel}}" userInput="{{colorProductAttribute.default_label}}" stepKey="fillDefaultLabel"/> - <click selector="{{AdminNewAttributePanel.saveAttribute}}" stepKey="clickOnNewAttributePanel"/> - <waitForPageLoad stepKey="waitForSaveAttribute"/> - <switchToIFrame stepKey="switchOutOfIFrame"/> - <waitForPageLoad stepKey="waitForFilters"/> - <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickOnFilters"/> - <fillField userInput="{{colorProductAttribute.default_label}}" selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" stepKey="fillFilterAttributeCodeField"/> - <click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/> - <click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton1"/> - <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="waitCreateNewValueAppears"/> - <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateNewValue1"/> - <fillField userInput="{{colorProductAttribute1.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewAttribute1"/> - <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute1"/> - <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateNewValue2"/> - <fillField userInput="{{colorProductAttribute2.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewAttribute2"/> - <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute2"/> - <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateNewValue3"/> - <fillField userInput="{{colorProductAttribute3.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewAttribute3"/> - <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute3"/> - <click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="clickOnSelectAll"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton2"/> - <click selector="{{AdminCreateProductConfigurationsPanel.applyUniquePricesByAttributeToEachSku}}" stepKey="clickOnApplyUniquePricesByAttributeToEachSku"/> - <selectOption selector="{{AdminCreateProductConfigurationsPanel.selectAttribute}}" userInput="{{colorProductAttribute.default_label}}" stepKey="selectAttributes"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.attribute1}}" userInput="{{colorProductAttribute1.price}}" stepKey="fillAttributePrice1"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.attribute2}}" userInput="{{colorProductAttribute2.price}}" stepKey="fillAttributePrice2"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.attribute3}}" userInput="{{colorProductAttribute3.price}}" stepKey="fillAttributePrice3"/> - <click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickOnApplySingleQuantityToEachSku"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="1" stepKey="enterAttributeQuantity"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton3"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton4"/> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/> - <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> - <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/> - <seeInTitle userInput="{{product.name}}" stepKey="seeProductNameInTitle"/> - </actionGroup> - - <actionGroup name="createConfigurableProductWithTwoAttributes" extends="createConfigurableProduct"> - <annotations> - <description>Goes to the Admin Product grid page. Creates a Configurable Product with 2 product attributes.</description> - </annotations> - <arguments> - <argument name="attribute1" defaultValue="ProductColorAttribute"/> - <argument name="attribute2" defaultValue="ProductSizeAttribute"/> - </arguments> - <remove keyForRemoval="clickOnNewAttribute"/> - <remove keyForRemoval="waitForIFrame"/> - <remove keyForRemoval="switchToNewAttributeIFrame"/> - <remove keyForRemoval="fillDefaultLabel"/> - <remove keyForRemoval="clickOnNewAttributePanel"/> - <remove keyForRemoval="waitForSaveAttribute"/> - <remove keyForRemoval="switchOutOfIFrame"/> - <remove keyForRemoval="waitForFilters"/> - <remove keyForRemoval="clickOnFilters"/> - <remove keyForRemoval="fillFilterAttributeCodeField"/> - <remove keyForRemoval="clickApplyFiltersButton"/> - <remove keyForRemoval="clickOnFirstCheckbox"/> - <click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox(attribute1.attribute_code)}}" stepKey="selectAttribute1" after="clickOnCreateConfigurations"/> - <click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox(attribute2.attribute_code)}}" stepKey="selectAttribute2" after="selectAttribute1"/> - <remove keyForRemoval="waitCreateNewValueAppears"/> - <remove keyForRemoval="clickOnCreateNewValue1"/> - <remove keyForRemoval="fillFieldForNewAttribute1"/> - <remove keyForRemoval="clickOnSaveNewAttribute1"/> - <remove keyForRemoval="clickOnCreateNewValue2"/> - <remove keyForRemoval="fillFieldForNewAttribute2"/> - <remove keyForRemoval="clickOnSaveNewAttribute2"/> - <remove keyForRemoval="clickOnCreateNewValue3"/> - <remove keyForRemoval="fillFieldForNewAttribute3"/> - <remove keyForRemoval="clickOnSaveNewAttribute3"/> - <remove keyForRemoval="clickOnSelectAll"/> - <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(attribute1.frontend_label)}}" stepKey="selectAllOptionsOfAttribute1" before="clickOnNextButton2"/> - <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(attribute2.frontend_label)}}" stepKey="selectAllOptionsOfAttribute2" before="clickOnNextButton2"/> - <remove keyForRemoval="applyUniquePricesByAttributeToEachSku"/> - <remove keyForRemoval="clickOnApplyUniquePricesByAttributeToEachSku"/> - <remove keyForRemoval="selectAttributes"/> - <remove keyForRemoval="fillAttributePrice1"/> - <remove keyForRemoval="fillAttributePrice2"/> - <remove keyForRemoval="fillAttributePrice3"/> - <remove keyForRemoval="clickOnSaveButton2"/> - <remove keyForRemoval="clickOnConfirmInPopup"/> - <remove keyForRemoval="seeSaveProductMessage"/> - <remove keyForRemoval="seeProductNameInTitle"/> - </actionGroup> - <actionGroup name="saveConfigurableProduct"> - <annotations> - <description>Save configurable product</description> - </annotations> - <arguments> - <argument name="product" defaultValue="_defaultProduct"/> - </arguments> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton"/> - <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> - <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/> - <seeInTitle userInput="{{product.name}}" stepKey="seeProductNameInTitle"/> - </actionGroup> - - <actionGroup name="generateConfigurationsByAttributeCode"> - <annotations> - <description>Generates the Product Configurations for the provided Attribute Code on the Configurable Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="attributeCode" type="string" defaultValue="SomeString"/> - </arguments> - - <click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickCreateConfigurations"/> - <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickFilters"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" userInput="{{attributeCode}}" stepKey="fillFilterAttributeCodeField"/> - <click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/> - <click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton1"/> - <click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="clickOnSelectAll"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton2"/> - <click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickOnApplySingleQuantityToEachSku"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="99" stepKey="enterAttributeQuantity"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton3"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton4"/> - </actionGroup> - <actionGroup name="createOptionsForAttribute"> - <arguments> - <argument name="attributeName" type="string" defaultValue="{{productAttributeColor.default_label}}"/> - <argument name="firstOptionName" type="string" defaultValue="option1"/> - <argument name="secondOptionName" type="string" defaultValue="option2"/> - </arguments> - <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickOnFilters"/> - <fillField userInput="{{attributeName}}" selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" stepKey="fillFilterAttributeCodeField"/> - <click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/> - <click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton"/> - <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="waitCreateNewValueAppears"/> - <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateFirstNewValue"/> - <fillField userInput="{{firstOptionName}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewFirstOption"/> - <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute"/> - <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateSecondNewValue"/> - <fillField userInput="{{secondOptionName}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewSecondOption"/> - <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveAttribute"/> - <click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="clickOnSelectAll"/> - </actionGroup> - - <actionGroup name="createConfigurationsForAttribute" extends="generateConfigurationsByAttributeCode"> - <annotations> - <description>EXTENDS: generateConfigurationsByAttributeCode. Clicks on the Save button. Clicks on the Confirm button.</description> - </annotations> - <arguments> - <argument name="attributeCode" type="string" defaultValue="SomeString"/> - </arguments> - - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/> - <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> - </actionGroup> - - <actionGroup name="createConfigurationsForAttributeWithImages" extends="generateConfigurationsByAttributeCode"> - <annotations> - <description>EXTENDS: generateConfigurationsByAttributeCode. Adds the provided Attribute Image to the provided Attribute Code.</description> - </annotations> - <arguments> - <argument name="attributeCode" type="string" defaultValue="SomeString"/> - <argument name="image" defaultValue="ProductImage"/> - </arguments> - - <click selector="{{AdminCreateProductConfigurationsPanel.applySingleSetOfImages}}" stepKey="clickOnApplySingleImageSetToAllSku" after="enterAttributeQuantity"/> - <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.imageUploadButton}}" stepKey="seeImageSectionIsReady" after="clickOnApplySingleImageSetToAllSku"/> - <attachFile selector="{{AdminCreateProductConfigurationsPanel.imageFileUpload}}" userInput="{{image.file}}" stepKey="uploadFile" after="seeImageSectionIsReady"/> - <waitForElementNotVisible selector="{{AdminCreateProductConfigurationsPanel.uploadProgressBar}}" stepKey="waitForUpload" after="uploadFile"/> - <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.imageFile(image.fileName)}}" stepKey="waitForThumbnail" after="waitForUpload"/> - - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2" after="clickOnNextButton4"/> - <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup" after="clickOnSaveButton2"/> - </actionGroup> - - <actionGroup name="createConfigurationsForTwoAttribute" extends="generateConfigurationsByAttributeCode"> - <annotations> - <description>EXTENDS: generateConfigurationsByAttributeCode. Generates the Product Configurations for the 2 provided Attribute Codes on the Configurable Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="secondAttributeCode" type="string"/> - </arguments> - - <remove keyForRemoval="clickOnSelectAll"/> - <remove keyForRemoval="clickFilters"/> - <remove keyForRemoval="fillFilterAttributeCodeField"/> - <remove keyForRemoval="clickApplyFiltersButton"/> - <remove keyForRemoval="clickOnFirstCheckbox"/> - - <click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox(attributeCode)}}" stepKey="clickOnFirstAttributeCheckbox" after="clickCreateConfigurations"/> - <click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox(secondAttributeCode)}}" stepKey="clickOnSecondAttributeCheckbox" after="clickOnFirstAttributeCheckbox"/> - <grabTextFrom selector="{{AdminCreateProductConfigurationsPanel.defaultLabel(attributeCode)}}" stepKey="grabFirstAttributeDefaultLabel" after="clickOnSecondAttributeCheckbox"/> - <grabTextFrom selector="{{AdminCreateProductConfigurationsPanel.defaultLabel(secondAttributeCode)}}" stepKey="grabSecondAttributeDefaultLabel" after="grabFirstAttributeDefaultLabel"/> - <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute({$grabFirstAttributeDefaultLabel})}}" stepKey="clickOnSelectAllForFirstAttribute" after="clickOnNextButton1"/> - <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute({$grabSecondAttributeDefaultLabel})}}" stepKey="clickOnSelectAllForSecondAttribute" after="clickOnSelectAllForFirstAttribute"/> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/> - <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> - </actionGroup> - - <actionGroup name="saveConfiguredProduct"> - <annotations> - <description>Save the Configurable Product on the Configurable Product creation/edit page. Validates that the Success Message is present.</description> - </annotations> - - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/> - <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> - <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/> - </actionGroup> - - <!--Generate and save configurable product after setting options--> - <actionGroup name="GenerateAndSaveConfiguredProductAfterSettingOptions" extends="saveConfiguredProduct"> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" before="clickOnSaveButton2" stepKey="clickOnNextButton"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" after="clickOnNextButton" stepKey="clickOnGenerateProductsButton"/> - </actionGroup> - - <actionGroup name="addNewProductConfigurationAttribute"> - <annotations> - <description>Generates the Product Configurations for the 2 provided Attribute Names on the Configurable Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="attribute" type="entity"/> - <argument name="firstOption" type="entity"/> - <argument name="secondOption" type="entity"/> - </arguments> - - <!-- Create new attribute --> - <click selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" stepKey="clickOnNewAttribute"/> - <waitForPageLoad stepKey="waitForIFrame"/> - <switchToIFrame selector="{{AdminNewAttributePanel.newAttributeIFrame}}" stepKey="switchToNewAttributeIFrame"/> - <fillField selector="{{AdminNewAttributePanel.defaultLabel}}" userInput="{{attribute.default_label}}" stepKey="fillDefaultLabel"/> - <click selector="{{AdminNewAttributePanel.saveAttribute}}" stepKey="clickOnNewAttributePanel"/> - <waitForPageLoad stepKey="waitForSaveAttribute"/> - <switchToIFrame stepKey="switchOutOfIFrame"/> - <waitForPageLoad stepKey="waitForFilters"/> - - <!-- Find created below attribute and add option; save attribute --> - <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickOnFilters"/> - <fillField userInput="{{attribute.default_label}}" selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" stepKey="fillFilterAttributeCodeField"/> - <click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/> - <click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton"/> - <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="waitCreateNewValueAppears"/> - <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateFirstNewValue"/> - <fillField userInput="{{firstOption.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewFirstOption"/> - <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute"/> - <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateSecondNewValue"/> - <fillField userInput="{{secondOption.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewSecondOption"/> - <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveAttribute"/> - <click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="clickOnSelectAll"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnSecondNextButton"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnThirdNextButton"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnFourthNextButton"/> - </actionGroup> - <actionGroup name="selectCreatedAttributeAndCreateTwoOptions" extends="addNewProductConfigurationAttribute"> - <remove keyForRemoval="clickOnNewAttribute"/> - <remove keyForRemoval="waitForIFrame"/> - <remove keyForRemoval="switchToNewAttributeIFrame"/> - <remove keyForRemoval="fillDefaultLabel"/> - <remove keyForRemoval="clickOnNewAttributePanel"/> - <remove keyForRemoval="waitForSaveAttribute"/> - <remove keyForRemoval="switchOutOfIFrame"/> - <remove keyForRemoval="waitForFilters"/> - <fillField userInput="{{attribute.attribute_code}}" selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" stepKey="fillFilterAttributeCodeField"/> - <fillField userInput="{{firstOption.label}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewFirstOption"/> - <fillField userInput="{{secondOption.label}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewSecondOption"/> - <remove keyForRemoval="clickOnSelectAll"/> - <remove keyForRemoval="clickOnSecondNextButton"/> - <remove keyForRemoval="clickOnThirdNextButton"/> - <remove keyForRemoval="clickOnFourthNextButton"/> - </actionGroup> - <actionGroup name="changeProductConfigurationsInGrid"> - <annotations> - <description>Edit the Product Configuration via the Admin Product grid page.</description> - </annotations> - <arguments> - <argument name="firstOption" type="entity"/> - <argument name="secondOption" type="entity"/> - </arguments> - - <fillField userInput="{{firstOption.name}}" selector="{{AdminProductFormConfigurationsSection.confProductNameCell(firstOption.name)}}" stepKey="fillFieldNameForFirstAttributeOption"/> - <fillField userInput="{{secondOption.name}}" selector="{{AdminProductFormConfigurationsSection.confProductNameCell(secondOption.name)}}" stepKey="fillFieldNameForSecondAttributeOption"/> - <fillField userInput="{{firstOption.sku}}" selector="{{AdminProductFormConfigurationsSection.confProductSkuCell(firstOption.name)}}" stepKey="fillFieldSkuForFirstAttributeOption"/> - <fillField userInput="{{secondOption.sku}}" selector="{{AdminProductFormConfigurationsSection.confProductSkuCell(secondOption.name)}}" stepKey="fillFieldSkuForSecondAttributeOption"/> - <fillField userInput="{{firstOption.price}}" selector="{{AdminProductFormConfigurationsSection.confProductPriceCell(firstOption.name)}}" stepKey="fillFieldPriceForFirstAttributeOption"/> - <fillField userInput="{{secondOption.price}}" selector="{{AdminProductFormConfigurationsSection.confProductPriceCell(secondOption.name)}}" stepKey="fillFieldPriceForSecondAttributeOption"/> - <fillField userInput="{{firstOption.quantity}}" selector="{{AdminProductFormConfigurationsSection.confProductQuantityCell(firstOption.name)}}" stepKey="fillFieldQuantityForFirstAttributeOption"/> - <fillField userInput="{{secondOption.quantity}}" selector="{{AdminProductFormConfigurationsSection.confProductQuantityCell(secondOption.name)}}" stepKey="fillFieldQuantityForSecondAttributeOption"/> - <fillField userInput="{{firstOption.weight}}" selector="{{AdminProductFormConfigurationsSection.confProductWeightCell(firstOption.name)}}" stepKey="fillFieldWeightForFirstAttributeOption"/> - <fillField userInput="{{secondOption.weight}}" selector="{{AdminProductFormConfigurationsSection.confProductWeightCell(secondOption.name)}}" stepKey="fillFieldWeightForSecondAttributeOption"/> - </actionGroup> - <actionGroup name="changeConfigurableProductChildProductPrice"> - <annotations> - <description>Change the price of a configurable child product in the grid under configurations.</description> - </annotations> - <arguments> - <argument name="productAttributes" type="string"/> - <argument name="productPrice" type="string"/> - </arguments> - <fillField userInput="{{productPrice}}" selector="{{AdminProductFormConfigurationsSection.confProductPriceCell(productAttributes)}}" stepKey="fillPriceForConfigurableProductAttributeOption"/> - </actionGroup> - <actionGroup name="changeProductConfigurationsInGridExceptSku" extends="changeProductConfigurationsInGrid"> - <annotations> - <description>EXTENDS: changeProductConfigurationsInGrid. Removes 'fillFieldSkuForFirstAttributeOption' and 'fillFieldSkuForSecondAttributeOption'.</description> - </annotations> - - <remove keyForRemoval="fillFieldSkuForFirstAttributeOption"/> - <remove keyForRemoval="fillFieldSkuForSecondAttributeOption"/> - </actionGroup> - - <actionGroup name="addProductToConfigurationsGrid"> - <annotations> - <description>Adds the provided Product SKU to the provided Product Name.</description> - </annotations> - <arguments> - <argument name="sku" type="string"/> - <argument name="name" type="string"/> - </arguments> - - <click selector="{{AdminProductFormConfigurationsSection.actionsBtnByProductName(name)}}" stepKey="clickToExpandFirstActions"/> - <click selector="{{AdminProductFormConfigurationsSection.addProduct(name)}}" stepKey="clickChooseFirstDifferentProduct"/> - <switchToIFrame stepKey="switchOutOfIFrame"/> - <waitForPageLoad stepKey="waitForFilters"/> - <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickFilters"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <click selector="{{AdminProductGridFilterSection.firstRowBySku(sku)}}" stepKey="clickOnFirstRow"/> - </actionGroup> - - <actionGroup name="addUniqueImageToConfigurableProductOption"> - <annotations> - <description>Adds the provided Image to a Configurable Product on the Admin Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="image" defaultValue="ProductImage"/> - <argument name="frontend_label" type="string"/> - <argument name="label" type="string"/> - </arguments> - - <click selector="{{AdminCreateProductConfigurationsPanel.applyUniqueImagesToEachSkus}}" stepKey="clickOnApplyUniqueImagesToEachSku"/> - <selectOption userInput="{{frontend_label}}" selector="{{AdminCreateProductConfigurationsPanel.selectImagesButton}}" stepKey="selectOption"/> - <attachFile selector="{{AdminCreateProductConfigurationsPanel.uploadImagesButton(label)}}" userInput="{{image.file}}" stepKey="uploadFile"/> - <waitForElementNotVisible selector="{{AdminCreateProductConfigurationsPanel.uploadProgressBar}}" stepKey="waitForUpload"/> - <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.imageFile(image.fileName)}}" stepKey="waitForThumbnail"/> - </actionGroup> - - <actionGroup name="addUniquePriceToConfigurableProductOption"> - <annotations> - <description>On the 'Step 3: Bulk Images, Price and Quantity' page of the 'Create Product Configurations' model click on 'Apply unique prices...'. Select provided Option. Fill price.</description> - </annotations> - <arguments> - <argument name="frontend_label" type="string"/> - <argument name="label" type="string"/> - <argument name="price" type="string"/> - </arguments> - - <click selector="{{AdminCreateProductConfigurationsPanel.applyUniquePricesToEachSkus}}" stepKey="clickOnApplyUniquePricesToEachSku"/> - <selectOption userInput="{{frontend_label}}" selector="{{AdminCreateProductConfigurationsPanel.selectPriceButton}}" stepKey="selectOption"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.price(label)}}" userInput="{{price}}" stepKey="enterAttributeQuantity"/> - </actionGroup> - <actionGroup name="addUniqueQuantityToConfigurableProductOption"> - <arguments> - <argument name="frontend_label" type="string" defaultValue="{{productAttributeColor.default_label}}"/> - <argument name="label" type="string" defaultValue="option1"/> - <argument name="quantity" type="string" defaultValue="10"/> - </arguments> - <click selector="{{AdminCreateProductConfigurationsPanel.applyUniqueQuantityToEachSkus}}" stepKey="clickOnApplyUniqueQuantitiesToEachSku"/> - <selectOption selector="{{AdminCreateProductConfigurationsPanel.selectQuantity}}" userInput="{{frontend_label}}" stepKey="selectOption"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.applyUniqueQuantity(label)}}" userInput="{{quantity}}" stepKey="enterAttributeQuantity"/> - </actionGroup> - - <actionGroup name="saveConfigurableProductWithNewAttributeSet"> - <annotations> - <description>Clicks on 'Save'. Clicks radio for '...new Attribute Set...' in the 'Choose Affected Attribute Set' modal. Clicks on 'Confirm' in the model on the Configurable Product creation/edit page.</description> - </annotations> - - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveConfigurableProduct"/> - <waitForElementVisible selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" time="30" stepKey="waitForAttributeSetConfirmation"/> - <click selector="{{AdminChooseAffectedAttributeSetPopup.addNewAttrSet}}" stepKey="clickAddNewAttributeSet"/> - <fillField selector="{{AdminChooseAffectedAttributeSetPopup.createNewAttrSetName}}" userInput="{{ProductAttributeFrontendLabel.label}}" stepKey="fillFieldNewAttrSetName"/> - <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickConfirmAttributeSet"/> - <see selector="You saved the product" stepKey="seeConfigurableSaveConfirmation" after="clickConfirmAttributeSet"/> - </actionGroup> - - <actionGroup name="saveConfigurableProductAddToCurrentAttributeSet"> - <annotations> - <description>Clicks on 'Save'. Clicks on 'Confirm' in the 'Choose Affected Attribute Set' model on the Configurable Product creation/edit page.</description> - </annotations> - - <waitForElementVisible selector="{{AdminProductFormActionSection.saveButton}}" stepKey="waitForSaveBtnVisible"/> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProductAgain"/> - <waitForElementVisible selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="waitPopUpVisible"/> - <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmPopup"/> - <seeElement selector="{{AdminMessagesSection.success}}" stepKey="seeSaveProductMessage"/> - </actionGroup> - - <actionGroup name="assertConfigurableProductOnAdminProductPage"> - <annotations> - <description>Validates that the provided Configurable Product Name, SKU and Price are present and correct on the Configurable Product creation/edit page. PLEASE NOTE: The Product Data is Hardcoded.</description> - </annotations> - <arguments> - <argument name="product" type="entity"/> - </arguments> - - <seeInField userInput="{{ApiConfigurableProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="seeNameRequired"/> - <seeInField userInput="{{ApiConfigurableProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="seeSkuRequired"/> - <dontSeeInField userInput="{{ApiConfigurableProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="dontSeePriceRequired"/> - </actionGroup> - - <!--Click in Next Step and see Title--> - <actionGroup name="AdminConfigurableWizardMoveToNextStepActionGroup"> - <annotations> - <description>Click on the 'Next' button in the 'Create Product Configurations' panel on the Configurable Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="title" type="string"/> - </arguments> - - <click selector="{{ConfigurableProductSection.nextButton}}" stepKey="clickNextButton"/> - <waitForPageLoad stepKey="waitForNextStepLoaded"/> - <see userInput="{{title}}" selector="{{AdminProductFormConfigurationsSection.stepsWizardTitle}}" stepKey="seeStepTitle"/> - </actionGroup> - <actionGroup name="AdminConfigurableProductDisableConfigurationsActionGroup"> - <arguments> - <argument name="productName" type="string" defaultValue="{{SimpleProduct.name}}"/> - </arguments> - <click selector="{{AdminProductFormConfigurationsSection.actionsBtnByProductName(productName)}}" stepKey="clickToExpandActionsSelect"/> - <click selector="{{AdminProductFormConfigurationsSection.disableProductBtn}}" stepKey="clickDisableChildProduct"/> - <see selector="{{AdminProductFormConfigurationsSection.confProductOptionStatusCell(productName)}}" userInput="Disabled" stepKey="seeConfigDisabled"/> - </actionGroup> - - <!--You are on AdminProductEditPage--> - <!--Start create configurations for attribute and fill quantity--> - <actionGroup name="StartCreateConfigurationsForAttribute" extends="generateConfigurationsByAttributeCode"> - <remove keyForRemoval="clickOnNextButton3"/> - <remove keyForRemoval="clickOnNextButton4"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminConfigurableProductDisableConfigurationsActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminConfigurableProductDisableConfigurationsActionGroup.xml new file mode 100644 index 0000000000000..69b2c37b6e850 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminConfigurableProductDisableConfigurationsActionGroup.xml @@ -0,0 +1,19 @@ +<?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="AdminConfigurableProductDisableConfigurationsActionGroup"> + <arguments> + <argument name="productName" type="string" defaultValue="{{SimpleProduct.name}}"/> + </arguments> + <click selector="{{AdminProductFormConfigurationsSection.actionsBtnByProductName(productName)}}" stepKey="clickToExpandActionsSelect"/> + <click selector="{{AdminProductFormConfigurationsSection.disableProductBtn}}" stepKey="clickDisableChildProduct"/> + <see selector="{{AdminProductFormConfigurationsSection.confProductOptionStatusCell(productName)}}" userInput="Disabled" stepKey="seeConfigDisabled"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminConfigurableWizardMoveToNextStepActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminConfigurableWizardMoveToNextStepActionGroup.xml new file mode 100644 index 0000000000000..50621b7114002 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminConfigurableWizardMoveToNextStepActionGroup.xml @@ -0,0 +1,23 @@ +<?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="AdminConfigurableWizardMoveToNextStepActionGroup"> + <annotations> + <description>Click on the 'Next' button in the 'Create Product Configurations' panel on the Configurable Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="title" type="string"/> + </arguments> + + <click selector="{{ConfigurableProductSection.nextButton}}" stepKey="clickNextButton"/> + <waitForPageLoad stepKey="waitForNextStepLoaded"/> + <see userInput="{{title}}" selector="{{AdminProductFormConfigurationsSection.stepsWizardTitle}}" stepKey="seeStepTitle"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminCreateApiConfigurableProductActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminCreateApiConfigurableProductActionGroup.xml index 2cdee5468a457..6dba2f09a707b 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminCreateApiConfigurableProductActionGroup.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminCreateApiConfigurableProductActionGroup.xml @@ -65,21 +65,4 @@ <requiredEntity createDataKey="createConfigChildProduct2"/> </createData> </actionGroup> - - <!-- Create the configurable product, children are not visible individually --> - <actionGroup name="AdminCreateApiConfigurableProductWithHiddenChildActionGroup" extends="AdminCreateApiConfigurableProductActionGroup"> - <annotations> - <description>EXTENDS: AdminCreateApiConfigurableProductActionGroup. Adds 2 Hidden Product Options.</description> - </annotations> - - <!-- Create the 2 children that will be a part of the configurable product --> - <createData entity="ApiSimpleOneHidden" stepKey="createConfigChildProduct1"> - <requiredEntity createDataKey="createConfigProductAttribute"/> - <requiredEntity createDataKey="getConfigAttributeOption1"/> - </createData> - <createData entity="ApiSimpleTwoHidden" stepKey="createConfigChildProduct2"> - <requiredEntity createDataKey="createConfigProductAttribute"/> - <requiredEntity createDataKey="getConfigAttributeOption2"/> - </createData> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminCreateApiConfigurableProductWithHiddenChildActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminCreateApiConfigurableProductWithHiddenChildActionGroup.xml new file mode 100644 index 0000000000000..2562c8cc20e6e --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminCreateApiConfigurableProductWithHiddenChildActionGroup.xml @@ -0,0 +1,26 @@ +<?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="AdminCreateApiConfigurableProductWithHiddenChildActionGroup" extends="AdminCreateApiConfigurableProductActionGroup"> + <annotations> + <description>EXTENDS: AdminCreateApiConfigurableProductActionGroup. Adds 2 Hidden Product Options.</description> + </annotations> + + <!-- Create the 2 children that will be a part of the configurable product --> + <createData entity="ApiSimpleOneHidden" stepKey="createConfigChildProduct1"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + <requiredEntity createDataKey="getConfigAttributeOption1"/> + </createData> + <createData entity="ApiSimpleTwoHidden" stepKey="createConfigChildProduct2"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + <requiredEntity createDataKey="getConfigAttributeOption2"/> + </createData> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminCreateConfigurableProductWithAttributeUncheckOptionActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminCreateConfigurableProductWithAttributeUncheckOptionActionGroup.xml new file mode 100644 index 0000000000000..2f494bb003bfa --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminCreateConfigurableProductWithAttributeUncheckOptionActionGroup.xml @@ -0,0 +1,25 @@ +<?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="AdminCreateConfigurableProductWithAttributeUncheckOptionActionGroup" extends="GenerateConfigurationsByAttributeCodeActionGroup"> + <annotations> + <description>EXTENDS: generateConfigurationsByAttributeCode. Click to uncheck created option. Enter Attribute price</description> + </annotations> + <arguments> + <argument name="attributeOption" type="string" defaultValue="option1"/> + <argument name="price" type="string" defaultValue="100"/> + </arguments> + <click selector="{{AdminCreateProductConfigurationsPanel.attributeOption('attributeOption')}}" after="clickOnSelectAll" stepKey="clickToUncheckOption"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" after="clickToUncheckOption" stepKey="clickOnNextButton22"/> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" after="clickOnNextButton22" stepKey="waitForNextPageOpened2"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" after="waitForNextPageOpened2" stepKey="clickOnApplySinglePriceToAllSkus"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.singlePrice}}" userInput="{{price}}" before="clickOnApplySingleQuantityToEachSku" stepKey="enterAttributePrice"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminCreateConfigurationsForAttributeActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminCreateConfigurationsForAttributeActionGroup.xml new file mode 100644 index 0000000000000..57468165fe4f9 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminCreateConfigurationsForAttributeActionGroup.xml @@ -0,0 +1,22 @@ +<?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="AdminCreateConfigurationsForAttributeActionGroup" extends="GenerateConfigurationsByAttributeCodeActionGroup"> + <annotations> + <description>EXTENDS: generateConfigurationsByAttributeCode. Click to apply single price to all Skus. Enter Attribute price</description> + </annotations> + <arguments> + <argument name="price" type="string" defaultValue="100"/> + </arguments> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" after="clickOnNextButton2" stepKey="waitForNextPageOpened2"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" after="waitForNextPageOpened2" stepKey="clickOnApplySinglePriceToAllSkus"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.singlePrice}}" userInput="{{price}}" before="clickOnApplySingleQuantityToEachSku" stepKey="enterAttributePrice"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertConfigurableProductOnAdminProductPageActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertConfigurableProductOnAdminProductPageActionGroup.xml new file mode 100644 index 0000000000000..88e170e3a3a90 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertConfigurableProductOnAdminProductPageActionGroup.xml @@ -0,0 +1,23 @@ +<?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="AssertConfigurableProductOnAdminProductPageActionGroup"> + <annotations> + <description>Validates that the provided Configurable Product Name, SKU and Price are present and correct on the Configurable Product creation/edit page. PLEASE NOTE: The Product Data is Hardcoded.</description> + </annotations> + <arguments> + <argument name="product" type="entity"/> + </arguments> + + <seeInField userInput="{{ApiConfigurableProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="seeNameRequired"/> + <seeInField userInput="{{ApiConfigurableProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="seeSkuRequired"/> + <dontSeeInField userInput="{{ApiConfigurableProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="dontSeePriceRequired"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertConfigurableProductWithSpecialPriceOnStorefrontProductPageActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertConfigurableProductWithSpecialPriceOnStorefrontProductPageActionGroup.xml new file mode 100644 index 0000000000000..b998b4443f446 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertConfigurableProductWithSpecialPriceOnStorefrontProductPageActionGroup.xml @@ -0,0 +1,26 @@ +<?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="AssertConfigurableProductWithSpecialPriceOnStorefrontProductPageActionGroup"> + <annotations> + <description>Validates that Special Price for a Configurable Product is present and correct when the provided Product Option is selected.</description> + </annotations> + <arguments> + <argument name="option" type="string"/> + <argument name="price" type="string"/> + <argument name="specialPrice" defaultValue="specialProductPrice"/> + </arguments> + + <selectOption userInput="{{option}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOptionWithSpecialPrice"/> + <see userInput="{{specialProductPrice.price}}" selector="{{StorefrontProductInfoMainSection.productSpecialPrice}}" stepKey="seeSpecialProductPrice"/> + <see userInput="Regular Price" selector="{{StorefrontProductInfoMainSection.specialProductText}}" stepKey="seeText"/> + <see userInput="{{price}}" selector="{{StorefrontProductInfoMainSection.oldProductPrice}}" stepKey="seeOldProductPrice"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertOptionImageAndPriceInStorefrontProductActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertOptionImageAndPriceInStorefrontProductActionGroup.xml new file mode 100644 index 0000000000000..e13d1909b5a10 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertOptionImageAndPriceInStorefrontProductActionGroup.xml @@ -0,0 +1,25 @@ +<?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="AssertOptionImageAndPriceInStorefrontProductActionGroup"> + <annotations> + <description>Validates that the provided Product Image and Price are present when the provided Product Option is selected.</description> + </annotations> + <arguments> + <argument name="label" type="string"/> + <argument name="image" type="string"/> + <argument name="price" type="string"/> + </arguments> + + <selectOption userInput="{{label}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption"/> + <seeElement selector="{{StorefrontProductMediaSection.imageFile(image)}}" stepKey="seeImage"/> + <see userInput="{{price}}" selector="{{StorefrontProductInfoMainSection.price}}" stepKey="seeProductPrice"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertOptionImageInStorefrontProductPageActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertOptionImageInStorefrontProductPageActionGroup.xml new file mode 100644 index 0000000000000..ba41d36d95970 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertOptionImageInStorefrontProductPageActionGroup.xml @@ -0,0 +1,26 @@ +<?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="AssertOptionImageInStorefrontProductPageActionGroup"> + <annotations> + <description>Validates that the provided Product Image is present when the provided Product Option is selected.</description> + </annotations> + <arguments> + <argument name="product" type="entity"/> + <argument name="label" type="string"/> + <argument name="image" defaultValue="MagentoLogo"/> + </arguments> + + <seeInCurrentUrl url="/{{product.urlKey}}.html" stepKey="checkUrl"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <selectOption userInput="{{label}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption1"/> + <seeElement selector="{{StorefrontProductMediaSection.imageFile(image.filename)}}" stepKey="seeFirstImage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/ChangeConfigurableProductChildProductPriceActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/ChangeConfigurableProductChildProductPriceActionGroup.xml new file mode 100644 index 0000000000000..b244681afbbb9 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/ChangeConfigurableProductChildProductPriceActionGroup.xml @@ -0,0 +1,21 @@ +<?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="ChangeConfigurableProductChildProductPriceActionGroup"> + <annotations> + <description>Change the price of a configurable child product in the grid under configurations.</description> + </annotations> + <arguments> + <argument name="productAttributes" type="string"/> + <argument name="productPrice" type="string"/> + </arguments> + <fillField userInput="{{productPrice}}" selector="{{AdminProductFormConfigurationsSection.confProductPriceCell(productAttributes)}}" stepKey="fillPriceForConfigurableProductAttributeOption"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/ChangeProductConfigurationsInGridActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/ChangeProductConfigurationsInGridActionGroup.xml new file mode 100644 index 0000000000000..48523fe693c44 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/ChangeProductConfigurationsInGridActionGroup.xml @@ -0,0 +1,31 @@ +<?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="ChangeProductConfigurationsInGridActionGroup"> + <annotations> + <description>Edit the Product Configuration via the Admin Product grid page.</description> + </annotations> + <arguments> + <argument name="firstOption" type="entity"/> + <argument name="secondOption" type="entity"/> + </arguments> + + <fillField userInput="{{firstOption.name}}" selector="{{AdminProductFormConfigurationsSection.confProductNameCell(firstOption.name)}}" stepKey="fillFieldNameForFirstAttributeOption"/> + <fillField userInput="{{secondOption.name}}" selector="{{AdminProductFormConfigurationsSection.confProductNameCell(secondOption.name)}}" stepKey="fillFieldNameForSecondAttributeOption"/> + <fillField userInput="{{firstOption.sku}}" selector="{{AdminProductFormConfigurationsSection.confProductSkuCell(firstOption.name)}}" stepKey="fillFieldSkuForFirstAttributeOption"/> + <fillField userInput="{{secondOption.sku}}" selector="{{AdminProductFormConfigurationsSection.confProductSkuCell(secondOption.name)}}" stepKey="fillFieldSkuForSecondAttributeOption"/> + <fillField userInput="{{firstOption.price}}" selector="{{AdminProductFormConfigurationsSection.confProductPriceCell(firstOption.name)}}" stepKey="fillFieldPriceForFirstAttributeOption"/> + <fillField userInput="{{secondOption.price}}" selector="{{AdminProductFormConfigurationsSection.confProductPriceCell(secondOption.name)}}" stepKey="fillFieldPriceForSecondAttributeOption"/> + <fillField userInput="{{firstOption.quantity}}" selector="{{AdminProductFormConfigurationsSection.confProductQuantityCell(firstOption.name)}}" stepKey="fillFieldQuantityForFirstAttributeOption"/> + <fillField userInput="{{secondOption.quantity}}" selector="{{AdminProductFormConfigurationsSection.confProductQuantityCell(secondOption.name)}}" stepKey="fillFieldQuantityForSecondAttributeOption"/> + <fillField userInput="{{firstOption.weight}}" selector="{{AdminProductFormConfigurationsSection.confProductWeightCell(firstOption.name)}}" stepKey="fillFieldWeightForFirstAttributeOption"/> + <fillField userInput="{{secondOption.weight}}" selector="{{AdminProductFormConfigurationsSection.confProductWeightCell(secondOption.name)}}" stepKey="fillFieldWeightForSecondAttributeOption"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/ChangeProductConfigurationsInGridExceptSkuActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/ChangeProductConfigurationsInGridExceptSkuActionGroup.xml new file mode 100644 index 0000000000000..740eda889637f --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/ChangeProductConfigurationsInGridExceptSkuActionGroup.xml @@ -0,0 +1,19 @@ +<?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="ChangeProductConfigurationsInGridExceptSkuActionGroup" extends="ChangeProductConfigurationsInGridActionGroup"> + <annotations> + <description>EXTENDS: changeProductConfigurationsInGrid. Removes 'fillFieldSkuForFirstAttributeOption' and 'fillFieldSkuForSecondAttributeOption'.</description> + </annotations> + + <remove keyForRemoval="fillFieldSkuForFirstAttributeOption"/> + <remove keyForRemoval="fillFieldSkuForSecondAttributeOption"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurableProductActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurableProductActionGroup.xml new file mode 100644 index 0000000000000..cb903222822eb --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurableProductActionGroup.xml @@ -0,0 +1,75 @@ +<?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="CreateConfigurableProductActionGroup"> + <annotations> + <description>Goes to the Admin Product grid page. Creates a Configurable Product using the default Product Options.</description> + </annotations> + <arguments> + <argument name="product" defaultValue="_defaultProduct"/> + <argument name="category" defaultValue="_defaultCategory"/> + </arguments> + + <!-- fill in basic configurable product values --> + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> + <waitForPageLoad time="30" stepKey="wait1"/> + <click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickOnAddProductToggle"/> + <click selector="{{AdminProductGridActionSection.addConfigurableProduct}}" stepKey="clickOnAddConfigurableProduct"/> + <fillField userInput="{{product.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/> + <fillField userInput="{{product.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="fillSKU"/> + <fillField userInput="{{product.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="fillPrice"/> + <fillField userInput="{{product.quantity}}" selector="{{AdminProductFormSection.productQuantity}}" stepKey="fillQuantity"/> + <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{category.name}}]" stepKey="fillCategory"/> + <selectOption userInput="{{product.visibility}}" selector="{{AdminProductFormSection.visibility}}" stepKey="fillVisibility"/> + <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/> + <fillField userInput="{{product.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/> + + <!-- create configurations for colors the product is available in --> + <click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickOnCreateConfigurations"/> + <click selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" stepKey="clickOnNewAttribute"/> + <waitForPageLoad stepKey="waitForIFrame"/> + <switchToIFrame selector="{{AdminNewAttributePanel.newAttributeIFrame}}" stepKey="switchToNewAttributeIFrame"/> + <fillField selector="{{AdminNewAttributePanel.defaultLabel}}" userInput="{{colorProductAttribute.default_label}}" stepKey="fillDefaultLabel"/> + <click selector="{{AdminNewAttributePanel.saveAttribute}}" stepKey="clickOnNewAttributePanel"/> + <waitForPageLoad stepKey="waitForSaveAttribute"/> + <switchToIFrame stepKey="switchOutOfIFrame"/> + <waitForPageLoad stepKey="waitForFilters"/> + <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickOnFilters"/> + <fillField userInput="{{colorProductAttribute.default_label}}" selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" stepKey="fillFilterAttributeCodeField"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/> + <click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton1"/> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="waitCreateNewValueAppears"/> + <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateNewValue1"/> + <fillField userInput="{{colorProductAttribute1.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewAttribute1"/> + <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute1"/> + <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateNewValue2"/> + <fillField userInput="{{colorProductAttribute2.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewAttribute2"/> + <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute2"/> + <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateNewValue3"/> + <fillField userInput="{{colorProductAttribute3.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewAttribute3"/> + <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute3"/> + <click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="clickOnSelectAll"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton2"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applyUniquePricesByAttributeToEachSku}}" stepKey="clickOnApplyUniquePricesByAttributeToEachSku"/> + <selectOption selector="{{AdminCreateProductConfigurationsPanel.selectAttribute}}" userInput="{{colorProductAttribute.default_label}}" stepKey="selectAttributes"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.attribute1}}" userInput="{{colorProductAttribute1.price}}" stepKey="fillAttributePrice1"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.attribute2}}" userInput="{{colorProductAttribute2.price}}" stepKey="fillAttributePrice2"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.attribute3}}" userInput="{{colorProductAttribute3.price}}" stepKey="fillAttributePrice3"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickOnApplySingleQuantityToEachSku"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="1" stepKey="enterAttributeQuantity"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton3"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton4"/> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/> + <seeInTitle userInput="{{product.name}}" stepKey="seeProductNameInTitle"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurableProductWithAttributeSetActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurableProductWithAttributeSetActionGroup.xml new file mode 100644 index 0000000000000..cf8d36b393178 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurableProductWithAttributeSetActionGroup.xml @@ -0,0 +1,27 @@ +<?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="CreateConfigurableProductWithAttributeSetActionGroup"> + <annotations> + <description>Admin edit created product as configurable. Choose created options</description> + </annotations> + <arguments> + <argument name="product" defaultValue="_defaultProduct"/> + <argument name="category" defaultValue="_defaultCategory"/> + <argument name="label" type="string" defaultValue="mySet"/> + <argument name="option" type="string" defaultValue="['option1', 'option2', 'option3', 'option4']"/> + </arguments> + <click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet"/> + <fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{label}}" stepKey="searchForAttrSet"/> + <click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttrSet"/> + <fillField userInput="{{product.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/> + <selectOption selector="{{AdminProductFormSection.additionalOptions}}" parameterArray="{{option}}" stepKey="searchAndMultiSelectCreatedOption"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurableProductWithTwoAttributesActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurableProductWithTwoAttributesActionGroup.xml new file mode 100644 index 0000000000000..aeb39fc9cbb0a --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurableProductWithTwoAttributesActionGroup.xml @@ -0,0 +1,57 @@ +<?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="CreateConfigurableProductWithTwoAttributesActionGroup" extends="CreateConfigurableProductActionGroup"> + <annotations> + <description>Goes to the Admin Product grid page. Creates a Configurable Product with 2 product attributes.</description> + </annotations> + <arguments> + <argument name="attribute1" defaultValue="ProductColorAttribute"/> + <argument name="attribute2" defaultValue="ProductSizeAttribute"/> + </arguments> + <remove keyForRemoval="clickOnNewAttribute"/> + <remove keyForRemoval="waitForIFrame"/> + <remove keyForRemoval="switchToNewAttributeIFrame"/> + <remove keyForRemoval="fillDefaultLabel"/> + <remove keyForRemoval="clickOnNewAttributePanel"/> + <remove keyForRemoval="waitForSaveAttribute"/> + <remove keyForRemoval="switchOutOfIFrame"/> + <remove keyForRemoval="waitForFilters"/> + <remove keyForRemoval="clickOnFilters"/> + <remove keyForRemoval="fillFilterAttributeCodeField"/> + <remove keyForRemoval="clickApplyFiltersButton"/> + <remove keyForRemoval="clickOnFirstCheckbox"/> + <click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox(attribute1.attribute_code)}}" stepKey="selectAttribute1" after="clickOnCreateConfigurations"/> + <click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox(attribute2.attribute_code)}}" stepKey="selectAttribute2" after="selectAttribute1"/> + <remove keyForRemoval="waitCreateNewValueAppears"/> + <remove keyForRemoval="clickOnCreateNewValue1"/> + <remove keyForRemoval="fillFieldForNewAttribute1"/> + <remove keyForRemoval="clickOnSaveNewAttribute1"/> + <remove keyForRemoval="clickOnCreateNewValue2"/> + <remove keyForRemoval="fillFieldForNewAttribute2"/> + <remove keyForRemoval="clickOnSaveNewAttribute2"/> + <remove keyForRemoval="clickOnCreateNewValue3"/> + <remove keyForRemoval="fillFieldForNewAttribute3"/> + <remove keyForRemoval="clickOnSaveNewAttribute3"/> + <remove keyForRemoval="clickOnSelectAll"/> + <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(attribute1.frontend_label)}}" stepKey="selectAllOptionsOfAttribute1" before="clickOnNextButton2"/> + <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(attribute2.frontend_label)}}" stepKey="selectAllOptionsOfAttribute2" before="clickOnNextButton2"/> + <remove keyForRemoval="applyUniquePricesByAttributeToEachSku"/> + <remove keyForRemoval="clickOnApplyUniquePricesByAttributeToEachSku"/> + <remove keyForRemoval="selectAttributes"/> + <remove keyForRemoval="fillAttributePrice1"/> + <remove keyForRemoval="fillAttributePrice2"/> + <remove keyForRemoval="fillAttributePrice3"/> + <remove keyForRemoval="clickOnSaveButton2"/> + <remove keyForRemoval="clickOnConfirmInPopup"/> + <remove keyForRemoval="seeSaveProductMessage"/> + <remove keyForRemoval="seeProductNameInTitle"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurationsForAttributeActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurationsForAttributeActionGroup.xml new file mode 100644 index 0000000000000..bcfad4849276d --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurationsForAttributeActionGroup.xml @@ -0,0 +1,22 @@ +<?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="CreateConfigurationsForAttributeActionGroup" extends="GenerateConfigurationsByAttributeCodeActionGroup"> + <annotations> + <description>EXTENDS: generateConfigurationsByAttributeCode. Clicks on the Save button. Clicks on the Confirm button.</description> + </annotations> + <arguments> + <argument name="attributeCode" type="string" defaultValue="SomeString"/> + </arguments> + + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurationsForAttributeWithImagesActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurationsForAttributeWithImagesActionGroup.xml new file mode 100644 index 0000000000000..b74300b0d5a13 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurationsForAttributeWithImagesActionGroup.xml @@ -0,0 +1,29 @@ +<?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="CreateConfigurationsForAttributeWithImagesActionGroup" extends="GenerateConfigurationsByAttributeCodeActionGroup"> + <annotations> + <description>EXTENDS: generateConfigurationsByAttributeCode. Adds the provided Attribute Image to the provided Attribute Code.</description> + </annotations> + <arguments> + <argument name="attributeCode" type="string" defaultValue="SomeString"/> + <argument name="image" defaultValue="ProductImage"/> + </arguments> + + <click selector="{{AdminCreateProductConfigurationsPanel.applySingleSetOfImages}}" stepKey="clickOnApplySingleImageSetToAllSku" after="enterAttributeQuantity"/> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.imageUploadButton}}" stepKey="seeImageSectionIsReady" after="clickOnApplySingleImageSetToAllSku"/> + <attachFile selector="{{AdminCreateProductConfigurationsPanel.imageFileUpload}}" userInput="{{image.file}}" stepKey="uploadFile" after="seeImageSectionIsReady"/> + <waitForElementNotVisible selector="{{AdminCreateProductConfigurationsPanel.uploadProgressBar}}" stepKey="waitForUpload" after="uploadFile"/> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.imageFile(image.fileName)}}" stepKey="waitForThumbnail" after="waitForUpload"/> + + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2" after="clickOnNextButton4"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup" after="clickOnSaveButton2"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurationsForTwoAttributeActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurationsForTwoAttributeActionGroup.xml new file mode 100644 index 0000000000000..e241d1dfa3921 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurationsForTwoAttributeActionGroup.xml @@ -0,0 +1,34 @@ +<?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="CreateConfigurationsForTwoAttributeActionGroup" extends="GenerateConfigurationsByAttributeCodeActionGroup"> + <annotations> + <description>EXTENDS: generateConfigurationsByAttributeCode. Generates the Product Configurations for the 2 provided Attribute Codes on the Configurable Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="secondAttributeCode" type="string"/> + </arguments> + + <remove keyForRemoval="clickOnSelectAll"/> + <remove keyForRemoval="clickFilters"/> + <remove keyForRemoval="fillFilterAttributeCodeField"/> + <remove keyForRemoval="clickApplyFiltersButton"/> + <remove keyForRemoval="clickOnFirstCheckbox"/> + + <click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox(attributeCode)}}" stepKey="clickOnFirstAttributeCheckbox" after="clickCreateConfigurations"/> + <click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox(secondAttributeCode)}}" stepKey="clickOnSecondAttributeCheckbox" after="clickOnFirstAttributeCheckbox"/> + <grabTextFrom selector="{{AdminCreateProductConfigurationsPanel.defaultLabel(attributeCode)}}" stepKey="grabFirstAttributeDefaultLabel" after="clickOnSecondAttributeCheckbox"/> + <grabTextFrom selector="{{AdminCreateProductConfigurationsPanel.defaultLabel(secondAttributeCode)}}" stepKey="grabSecondAttributeDefaultLabel" after="grabFirstAttributeDefaultLabel"/> + <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute({$grabFirstAttributeDefaultLabel})}}" stepKey="clickOnSelectAllForFirstAttribute" after="clickOnNextButton1"/> + <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute({$grabSecondAttributeDefaultLabel})}}" stepKey="clickOnSelectAllForSecondAttribute" after="clickOnSelectAllForFirstAttribute"/> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/ConfigurableProductAttributeNameDesignActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateNewAttributeActionGroup.xml similarity index 55% rename from app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/ConfigurableProductAttributeNameDesignActionGroup.xml rename to app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateNewAttributeActionGroup.xml index 8863cfaf4aeaa..9925aba09fb82 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/ConfigurableProductAttributeNameDesignActionGroup.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateNewAttributeActionGroup.xml @@ -8,44 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="GotoCatalogProductsPage"> - <annotations> - <description>Goes to the Admin Products grid via the Admin Side Menu.</description> - </annotations> - - <click stepKey="clickOnCatalogItem" selector="{{CatalogProductsSection.catalogItem}}"/> - <waitForPageLoad stepKey="waitForCatalogLoad"/> - <click stepKey="clickOnProductItem" selector="{{CatalogProductsSection.productItem}}"/> - <waitForPageLoad stepKey="waitForCatalogProductPageLoad"/> - <seeInCurrentUrl stepKey="assertWeAreOnTheCatalogProductPage" url="{{assertionData.catalogProduct}}"/> - </actionGroup> - - <actionGroup name="GotoConfigurableProductPage"> - <annotations> - <description>Clicks on create Configurable Product from the Admin Products grid page.</description> - </annotations> - - <click stepKey="clickOnAddProductItem" selector="{{ConfigurableProductSection.addProductItem}}"/> - <click stepKey="clickOnConfigurationProductItem" selector="{{ConfigurableProductSection.configProductItem}}"/> - <waitForPageLoad stepKey="waitForConfigurableProductPageLoad"/> - <seeInCurrentUrl stepKey="assertWeAreOnTheConfigurableProductPage" url="{{assertionData.configurableProduct}}"/> - </actionGroup> - - <actionGroup name="FillAllRequiredFields"> - <annotations> - <description>Fills the Product Name, Price and Weight fields. Clicks on 'Create Configurations'. Clicks on 'Create New Attribute'.</description> - </annotations> - - <fillField stepKey="fillInProductNameFields" selector="{{NewProduct.productName}}" userInput="{{NewProductsData.productName}}"/> - <fillField stepKey="fillInPriceFields" selector="{{NewProduct.price}}" userInput="{{NewProductsData.price}}"/> - <fillField stepKey="fillInWeightFields" selector="{{NewProduct.weight}}" userInput="{{NewProductsData.weight}}"/> - <click stepKey="clickOnCreateConfigurationsButton" selector="{{NewProduct.createConfigurationButton}}"/> - <waitForPageLoad stepKey="waitForCreateProductConfigurationsPageLoad"/> - <click stepKey="clickOnCreateNewAttributeButton" selector="{{NewProduct.createNewAttributeButton}}"/> - <waitForPageLoad stepKey="waitForNewAttributePageLoad"/> - </actionGroup> - - <actionGroup name="CreateNewAttribute"> + <actionGroup name="CreateNewAttributeActionGroup"> <annotations> <description>Creates a new Product Attribute via the Admin Products creation/edit page. PLEASE NOTE: The Product Attributes are Hardcoded.</description> </annotations> @@ -120,39 +83,4 @@ <conditionalClick selector="{{ConfigurableProductSection.closeFrame}}" dependentSelector="{{ConfigurableProductSection.closeFrame}}" visible="1" stepKey="closeFrame"/> <waitForPageLoad stepKey="waitForClosingFrame"/> </actionGroup> - - <actionGroup name="DeleteCreatedAttribute"> - <annotations> - <description>Deletes the Configurable Product Attribute.</description> - </annotations> - - <!--Click on Stores item--> - <click stepKey="clickOnStoresItem" selector="{{CatalogProductsSection.storesItem}}"/> - <waitForPageLoad stepKey="waitForNavigationPanel"/> - - <!--Click on Products item--> - <waitForElementVisible selector="{{CatalogProductsSection.storesProductItem}}" stepKey="waitForCatalogLoad"/> - <click stepKey="clickOnStoresProductItem" selector="{{CatalogProductsSection.storesProductItem}}"/> - <waitForPageLoad stepKey="waitForStoresProductPageLoad"/> - - <!--Click on created Attribute --> - <fillField stepKey="searchProductDefaultLabel" selector="{{CatalogProductsSection.searchDefaultLabelField}}" userInput="{{NewProductsData.defaultLabel}}"/> - <click stepKey="clickSearchButton" selector="{{CatalogProductsSection.searchButton}}"/> - <waitForPageLoad stepKey="waitForCreatedAttributeLoad"/> - <click stepKey="clickOnCreatedAttributeItem" selector="{{CatalogProductsSection.createdAttributeItem}}"/> - <waitForPageLoad stepKey="waitForAttributePropertiesPageLoad"/> - - <!--Click on Delete Attribute item--> - <click stepKey="clickOnDeleteAttributeItem" selector="{{CatalogProductsSection.deleteAttributeItem}}"/> - <waitForPageLoad stepKey="waitForDeletedDialogOpened"/> - - <!--Click on OK button--> - <click stepKey="clickOnOKButton" selector="{{CatalogProductsSection.okButton}}"/> - <waitForPageLoad stepKey="waitFordAttributeDeleted"/> - <see userInput="You deleted the product attribute." stepKey="seeDeletedTheProductAttributeMessage"/> - - <!-- Click Reset Filter button--> - <click stepKey="clickResetFilterButton" selector="{{CatalogProductsSection.resetFilter}}"/> - <waitForPageLoad stepKey="waitForAllFilterReset"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateOptionsForAttributeActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateOptionsForAttributeActionGroup.xml new file mode 100644 index 0000000000000..d691564f331f1 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateOptionsForAttributeActionGroup.xml @@ -0,0 +1,31 @@ +<?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="CreateOptionsForAttributeActionGroup"> + <arguments> + <argument name="attributeName" type="string" defaultValue="{{productAttributeColor.default_label}}"/> + <argument name="firstOptionName" type="string" defaultValue="option1"/> + <argument name="secondOptionName" type="string" defaultValue="option2"/> + </arguments> + <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickOnFilters"/> + <fillField userInput="{{attributeName}}" selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" stepKey="fillFilterAttributeCodeField"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/> + <click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton"/> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="waitCreateNewValueAppears"/> + <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateFirstNewValue"/> + <fillField userInput="{{firstOptionName}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewFirstOption"/> + <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute"/> + <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateSecondNewValue"/> + <fillField userInput="{{secondOptionName}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewSecondOption"/> + <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveAttribute"/> + <click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="clickOnSelectAll"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/DeleteCreatedAttributeActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/DeleteCreatedAttributeActionGroup.xml new file mode 100644 index 0000000000000..ff8cfecf83ab9 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/DeleteCreatedAttributeActionGroup.xml @@ -0,0 +1,45 @@ +<?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="DeleteCreatedAttributeActionGroup"> + <annotations> + <description>Deletes the Configurable Product Attribute.</description> + </annotations> + + <!--Click on Stores item--> + <click stepKey="clickOnStoresItem" selector="{{CatalogProductsSection.storesItem}}"/> + <waitForPageLoad stepKey="waitForNavigationPanel"/> + + <!--Click on Products item--> + <waitForElementVisible selector="{{CatalogProductsSection.storesProductItem}}" stepKey="waitForCatalogLoad"/> + <click stepKey="clickOnStoresProductItem" selector="{{CatalogProductsSection.storesProductItem}}"/> + <waitForPageLoad stepKey="waitForStoresProductPageLoad"/> + + <!--Click on created Attribute --> + <fillField stepKey="searchProductDefaultLabel" selector="{{CatalogProductsSection.searchDefaultLabelField}}" userInput="{{NewProductsData.defaultLabel}}"/> + <click stepKey="clickSearchButton" selector="{{CatalogProductsSection.searchButton}}"/> + <waitForPageLoad stepKey="waitForCreatedAttributeLoad"/> + <click stepKey="clickOnCreatedAttributeItem" selector="{{CatalogProductsSection.createdAttributeItem}}"/> + <waitForPageLoad stepKey="waitForAttributePropertiesPageLoad"/> + + <!--Click on Delete Attribute item--> + <click stepKey="clickOnDeleteAttributeItem" selector="{{CatalogProductsSection.deleteAttributeItem}}"/> + <waitForPageLoad stepKey="waitForDeletedDialogOpened"/> + + <!--Click on OK button--> + <click stepKey="clickOnOKButton" selector="{{CatalogProductsSection.okButton}}"/> + <waitForPageLoad stepKey="waitFordAttributeDeleted"/> + <see userInput="You deleted the product attribute." stepKey="seeDeletedTheProductAttributeMessage"/> + + <!-- Click Reset Filter button--> + <click stepKey="clickResetFilterButton" selector="{{CatalogProductsSection.resetFilter}}"/> + <waitForPageLoad stepKey="waitForAllFilterReset"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/FillAllRequiredFieldsActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/FillAllRequiredFieldsActionGroup.xml new file mode 100644 index 0000000000000..9021225dd6fca --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/FillAllRequiredFieldsActionGroup.xml @@ -0,0 +1,24 @@ +<?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="FillAllRequiredFieldsActionGroup"> + <annotations> + <description>Fills the Product Name, Price and Weight fields. Clicks on 'Create Configurations'. Clicks on 'Create New Attribute'.</description> + </annotations> + + <fillField stepKey="fillInProductNameFields" selector="{{NewProduct.productName}}" userInput="{{NewProductsData.productName}}"/> + <fillField stepKey="fillInPriceFields" selector="{{NewProduct.price}}" userInput="{{NewProductsData.price}}"/> + <fillField stepKey="fillInWeightFields" selector="{{NewProduct.weight}}" userInput="{{NewProductsData.weight}}"/> + <click stepKey="clickOnCreateConfigurationsButton" selector="{{NewProduct.createConfigurationButton}}"/> + <waitForPageLoad stepKey="waitForCreateProductConfigurationsPageLoad"/> + <click stepKey="clickOnCreateNewAttributeButton" selector="{{NewProduct.createNewAttributeButton}}"/> + <waitForPageLoad stepKey="waitForNewAttributePageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/GenerateAndSaveConfiguredProductAfterSettingOptionsActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/GenerateAndSaveConfiguredProductAfterSettingOptionsActionGroup.xml new file mode 100644 index 0000000000000..a4eade1549b07 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/GenerateAndSaveConfiguredProductAfterSettingOptionsActionGroup.xml @@ -0,0 +1,15 @@ +<?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="GenerateAndSaveConfiguredProductAfterSettingOptionsActionGroup" extends="SaveConfiguredProductActionGroup"> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" before="clickOnSaveButton2" stepKey="clickOnNextButton"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" after="clickOnNextButton" stepKey="clickOnGenerateProductsButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/GenerateConfigurationsByAttributeCodeActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/GenerateConfigurationsByAttributeCodeActionGroup.xml new file mode 100644 index 0000000000000..80248cf5e00f8 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/GenerateConfigurationsByAttributeCodeActionGroup.xml @@ -0,0 +1,32 @@ +<?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="GenerateConfigurationsByAttributeCodeActionGroup"> + <annotations> + <description>Generates the Product Configurations for the provided Attribute Code on the Configurable Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="attributeCode" type="string" defaultValue="SomeString"/> + </arguments> + + <click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickCreateConfigurations"/> + <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickFilters"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" userInput="{{attributeCode}}" stepKey="fillFilterAttributeCodeField"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/> + <click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton1"/> + <click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="clickOnSelectAll"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton2"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickOnApplySingleQuantityToEachSku"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="99" stepKey="enterAttributeQuantity"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton3"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton4"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/GotoCatalogProductsPageActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/GotoCatalogProductsPageActionGroup.xml new file mode 100644 index 0000000000000..237c55dd591ae --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/GotoCatalogProductsPageActionGroup.xml @@ -0,0 +1,22 @@ +<?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="GotoCatalogProductsPageActionGroup"> + <annotations> + <description>Goes to the Admin Products grid via the Admin Side Menu.</description> + </annotations> + + <click stepKey="clickOnCatalogItem" selector="{{CatalogProductsSection.catalogItem}}"/> + <waitForPageLoad stepKey="waitForCatalogLoad"/> + <click stepKey="clickOnProductItem" selector="{{CatalogProductsSection.productItem}}"/> + <waitForPageLoad stepKey="waitForCatalogProductPageLoad"/> + <seeInCurrentUrl stepKey="assertWeAreOnTheCatalogProductPage" url="{{assertionData.catalogProduct}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/GotoConfigurableProductPageActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/GotoConfigurableProductPageActionGroup.xml new file mode 100644 index 0000000000000..a16d99944003b --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/GotoConfigurableProductPageActionGroup.xml @@ -0,0 +1,21 @@ +<?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="GotoConfigurableProductPageActionGroup"> + <annotations> + <description>Clicks on create Configurable Product from the Admin Products grid page.</description> + </annotations> + + <click stepKey="clickOnAddProductItem" selector="{{ConfigurableProductSection.addProductItem}}"/> + <click stepKey="clickOnConfigurationProductItem" selector="{{ConfigurableProductSection.configProductItem}}"/> + <waitForPageLoad stepKey="waitForConfigurableProductPageLoad"/> + <seeInCurrentUrl stepKey="assertWeAreOnTheConfigurableProductPage" url="{{assertionData.configurableProduct}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SaveConfigurableProductActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SaveConfigurableProductActionGroup.xml new file mode 100644 index 0000000000000..3b77a3b00c960 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SaveConfigurableProductActionGroup.xml @@ -0,0 +1,23 @@ +<?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="SaveConfigurableProductActionGroup"> + <annotations> + <description>Save configurable product</description> + </annotations> + <arguments> + <argument name="product" defaultValue="_defaultProduct"/> + </arguments> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/> + <seeInTitle userInput="{{product.name}}" stepKey="seeProductNameInTitle"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SaveConfigurableProductAddToCurrentAttributeSetActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SaveConfigurableProductAddToCurrentAttributeSetActionGroup.xml new file mode 100644 index 0000000000000..2b45b52e39d8f --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SaveConfigurableProductAddToCurrentAttributeSetActionGroup.xml @@ -0,0 +1,22 @@ +<?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="SaveConfigurableProductAddToCurrentAttributeSetActionGroup"> + <annotations> + <description>Clicks on 'Save'. Clicks on 'Confirm' in the 'Choose Affected Attribute Set' model on the Configurable Product creation/edit page.</description> + </annotations> + + <waitForElementVisible selector="{{AdminProductFormActionSection.saveButton}}" stepKey="waitForSaveBtnVisible"/> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProductAgain"/> + <waitForElementVisible selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="waitPopUpVisible"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmPopup"/> + <seeElement selector="{{AdminMessagesSection.success}}" stepKey="seeSaveProductMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SaveConfigurableProductWithNewAttributeSetActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SaveConfigurableProductWithNewAttributeSetActionGroup.xml new file mode 100644 index 0000000000000..449c97cb5da6e --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SaveConfigurableProductWithNewAttributeSetActionGroup.xml @@ -0,0 +1,23 @@ +<?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="SaveConfigurableProductWithNewAttributeSetActionGroup"> + <annotations> + <description>Clicks on 'Save'. Clicks radio for '...new Attribute Set...' in the 'Choose Affected Attribute Set' modal. Clicks on 'Confirm' in the model on the Configurable Product creation/edit page.</description> + </annotations> + + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveConfigurableProduct"/> + <waitForElementVisible selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" time="30" stepKey="waitForAttributeSetConfirmation"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.addNewAttrSet}}" stepKey="clickAddNewAttributeSet"/> + <fillField selector="{{AdminChooseAffectedAttributeSetPopup.createNewAttrSetName}}" userInput="{{ProductAttributeFrontendLabel.label}}" stepKey="fillFieldNewAttrSetName"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickConfirmAttributeSet"/> + <see selector="You saved the product" stepKey="seeConfigurableSaveConfirmation" after="clickConfirmAttributeSet"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SaveConfiguredProductActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SaveConfiguredProductActionGroup.xml new file mode 100644 index 0000000000000..011c1f195dbd1 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SaveConfiguredProductActionGroup.xml @@ -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="SaveConfiguredProductActionGroup"> + <annotations> + <description>Save the Configurable Product on the Configurable Product creation/edit page. Validates that the Success Message is present.</description> + </annotations> + + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SelectCreatedAttributeAndCreateTwoOptionsActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SelectCreatedAttributeAndCreateTwoOptionsActionGroup.xml new file mode 100644 index 0000000000000..ef06518205196 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SelectCreatedAttributeAndCreateTwoOptionsActionGroup.xml @@ -0,0 +1,28 @@ +<?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="SelectCreatedAttributeAndCreateTwoOptionsActionGroup" extends="AddNewProductConfigurationAttributeActionGroup"> + <remove keyForRemoval="clickOnNewAttribute"/> + <remove keyForRemoval="waitForIFrame"/> + <remove keyForRemoval="switchToNewAttributeIFrame"/> + <remove keyForRemoval="fillDefaultLabel"/> + <remove keyForRemoval="clickOnNewAttributePanel"/> + <remove keyForRemoval="waitForSaveAttribute"/> + <remove keyForRemoval="switchOutOfIFrame"/> + <remove keyForRemoval="waitForFilters"/> + <fillField userInput="{{attribute.attribute_code}}" selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" stepKey="fillFilterAttributeCodeField"/> + <fillField userInput="{{firstOption.label}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewFirstOption"/> + <fillField userInput="{{secondOption.label}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewSecondOption"/> + <remove keyForRemoval="clickOnSelectAll"/> + <remove keyForRemoval="clickOnSecondNextButton"/> + <remove keyForRemoval="clickOnThirdNextButton"/> + <remove keyForRemoval="clickOnFourthNextButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SelectSingleAttributeAndAddToCartActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SelectSingleAttributeAndAddToCartActionGroup.xml new file mode 100644 index 0000000000000..681e3a319eac6 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SelectSingleAttributeAndAddToCartActionGroup.xml @@ -0,0 +1,26 @@ +<?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="SelectSingleAttributeAndAddToCartActionGroup"> + <annotations> + <description>Selects a Product Option. Clicks 'Add to Cart'. Validates that the Product Added Success message appears.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + <argument name="attributeCode" type="string"/> + <argument name="optionName" type="string"/> + </arguments> + + <selectOption selector="{{StorefrontProductInfoMainSection.attributeSelectByAttributeID(attributeCode)}}" userInput="{{optionName}}" stepKey="selectAttribute"/> + <click stepKey="addProduct" selector="{{StorefrontProductActionSection.addToCart}}"/> + <waitForElementVisible selector="{{StorefrontQuickSearchResultsSection.messageSection}}" time="30" stepKey="waitForProductAdded"/> + <see selector="{{StorefrontQuickSearchResultsSection.messageSection}}" userInput="You added {{productName}} to your shopping cart." stepKey="seeAddedToCartMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StartCreateConfigurationsForAttributeActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StartCreateConfigurationsForAttributeActionGroup.xml new file mode 100644 index 0000000000000..d91d918c9ec79 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StartCreateConfigurationsForAttributeActionGroup.xml @@ -0,0 +1,15 @@ +<?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="StartCreateConfigurationsForAttributeActionGroup" extends="GenerateConfigurationsByAttributeCodeActionGroup"> + <remove keyForRemoval="clickOnNextButton3"/> + <remove keyForRemoval="clickOnNextButton4"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontCategoryActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontCheckCategoryConfigurableProductActionGroup.xml similarity index 60% rename from app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontCategoryActionGroup.xml rename to app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontCheckCategoryConfigurableProductActionGroup.xml index 8b61f0e109591..d33675e2c6b06 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontCategoryActionGroup.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontCheckCategoryConfigurableProductActionGroup.xml @@ -9,7 +9,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <!-- Check configurable product on the category page --> - <actionGroup name="StorefrontCheckCategoryConfigurableProduct"> + <actionGroup name="StorefrontCheckCategoryConfigurableProductActionGroup"> <annotations> <description>Validates that the provided Configurable Product is present and correct on a Category page.</description> </annotations> @@ -25,19 +25,4 @@ <!-- @TODO: MAGETWO-80272 Move to Magento_Checkout --> <seeElement selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="AssertAddToCart"/> </actionGroup> - - <!-- Check configurable product out of stock on the category page --> - <actionGroup name="StorefrontCheckCategoryOutOfStockConfigurableProduct"> - <annotations> - <description>Validates that the provided Configurable Product is present and correct on a Category page.</description> - </annotations> - <arguments> - <argument name="product" type="entity"/> - </arguments> - - <seeElement selector="{{StorefrontCategoryProductSection.ProductTitleByName(product.name)}}" stepKey="assertProductName"/> - <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct"/> - <seeElement selector="{{StorefrontCategoryProductSection.ProductStockUnavailable}}" stepKey="AssertOutOfStock"/> - <dontSeeElement selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="AssertAddToCart"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontCheckCategoryOutOfStockConfigurableProductActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontCheckCategoryOutOfStockConfigurableProductActionGroup.xml new file mode 100644 index 0000000000000..1de28e36d83ae --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontCheckCategoryOutOfStockConfigurableProductActionGroup.xml @@ -0,0 +1,24 @@ +<?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="StorefrontCheckCategoryOutOfStockConfigurableProductActionGroup"> + <annotations> + <description>Validates that the provided Configurable Product is present and correct on a Category page.</description> + </annotations> + <arguments> + <argument name="product" type="entity"/> + </arguments> + + <seeElement selector="{{StorefrontCategoryProductSection.ProductTitleByName(product.name)}}" stepKey="assertProductName"/> + <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct"/> + <seeElement selector="{{StorefrontCategoryProductSection.ProductStockUnavailable}}" stepKey="AssertOutOfStock"/> + <dontSeeElement selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="AssertAddToCart"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontCheckConfigurableProductActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontCheckConfigurableProductActionGroup.xml new file mode 100644 index 0000000000000..e21c2e11fcc4c --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontCheckConfigurableProductActionGroup.xml @@ -0,0 +1,31 @@ +<?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"> + <!-- Check the configurable product on the product page --> + <actionGroup name="StorefrontCheckConfigurableProductActionGroup"> + <annotations> + <description>Goes to the provided Storefront Product page. Validates that the Product details are present and correct.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="optionProduct"/> + </arguments> + + <seeInCurrentUrl url="/{{product.custom_attributes[url_key]}}.html" stepKey="checkUrl"/> + <seeInTitle userInput="{{product.name}}" stepKey="AssertProductNameInTitle"/> + <see userInput="{{product.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertProductName"/> + <see userInput="{{product.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="assertProductSku"/> + <see userInput="${{optionProduct.price}}.00" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="assertProductPrice"/> + <see userInput="IN STOCK" selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="assertInStock"/> + <seeElement selector="{{StorefrontProductInfoMainSection.AddToCart}}" stepKey="assertAddToCart"/> + <see userInput="{{product.custom_attributes[description]}}" selector="{{StorefrontProductInfoMainSection.productDescription}}" stepKey="assertProductDescription"/> + <see userInput="{{product.custom_attributes[short_description]}}" selector="{{StorefrontProductInfoMainSection.productShortDescription}}" stepKey="assertProductShortDescription"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontCheckConfigurableProductOptionsActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontCheckConfigurableProductOptionsActionGroup.xml new file mode 100644 index 0000000000000..bee1181601f9b --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontCheckConfigurableProductOptionsActionGroup.xml @@ -0,0 +1,32 @@ +<?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="StorefrontCheckConfigurableProductOptionsActionGroup"> + <annotations> + <description>Validates that the Options for a Configurable Product are present and correct.</description> + </annotations> + <arguments> + <argument name="product" type="entity"/> + <argument name="firstOption" type="entity"/> + <argument name="secondOption" type="entity"/> + </arguments> + + <selectOption userInput="{{firstOption.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption1"/> + <see userInput="{{product.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="seeConfigurableProductName"/> + <see userInput="{{firstOption.price}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="assertProductPricePresent"/> + <see userInput="{{product.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="seeConfigurableProductSku"/> + <see userInput="IN STOCK" selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="assertInStock"/> + <see userInput="{{colorProductAttribute.default_label}}" selector="{{StorefrontProductInfoMainSection.productAttributeTitle1}}" stepKey="seeColorAttributeName"/> + <dontSee userInput="As low as" selector="{{StorefrontProductInfoMainSection.productPriceLabel}}" stepKey="dontSeeProductPriceLabel1"/> + <selectOption userInput="{{secondOption.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption2"/> + <dontSee userInput="As low as" selector="{{StorefrontProductInfoMainSection.productPriceLabel}}" stepKey="dontSeeProductPriceLabel2"/> + <see userInput="{{secondOption.price}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="seeProductPrice2"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontOpenMinicartAndCheckConfigurableProductActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontOpenMinicartAndCheckConfigurableProductActionGroup.xml new file mode 100644 index 0000000000000..d2567aa9c87f8 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontOpenMinicartAndCheckConfigurableProductActionGroup.xml @@ -0,0 +1,24 @@ +<?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="StorefrontOpenMinicartAndCheckConfigurableProductActionGroup"> + <annotations> + <description>Validates that the provided Option Price is present and correct in the Mini Shopping Cart on the Storefront.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="optionProduct"/> + </arguments> + + <waitForElement selector="{{StorefrontMinicartSection.productLinkByName(product.name)}}" stepKey="waitForMinicartProduct"/> + <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickShowMinicart"/> + <see userInput="${{optionProduct.price}}.00" selector="{{StorefrontMinicartSection.productPriceByName(product.name)}}" stepKey="assertProductPrice"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontProductActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontProductActionGroup.xml deleted file mode 100644 index e5d537f350299..0000000000000 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontProductActionGroup.xml +++ /dev/null @@ -1,134 +0,0 @@ -<?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"> - <!-- Check the configurable product on the product page --> - <actionGroup name="StorefrontCheckConfigurableProduct"> - <annotations> - <description>Goes to the provided Storefront Product page. Validates that the Product details are present and correct.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="optionProduct"/> - </arguments> - - <seeInCurrentUrl url="/{{product.custom_attributes[url_key]}}.html" stepKey="checkUrl"/> - <seeInTitle userInput="{{product.name}}" stepKey="AssertProductNameInTitle"/> - <see userInput="{{product.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertProductName"/> - <see userInput="{{product.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="assertProductSku"/> - <see userInput="${{optionProduct.price}}.00" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="assertProductPrice"/> - <see userInput="IN STOCK" selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="assertInStock"/> - <seeElement selector="{{StorefrontProductInfoMainSection.AddToCart}}" stepKey="assertAddToCart"/> - <see userInput="{{product.custom_attributes[description]}}" selector="{{StorefrontProductInfoMainSection.productDescription}}" stepKey="assertProductDescription"/> - <see userInput="{{product.custom_attributes[short_description]}}" selector="{{StorefrontProductInfoMainSection.productShortDescription}}" stepKey="assertProductShortDescription"/> - </actionGroup> - - <!-- Check Storefront Configurable Product Option --> - <actionGroup name="VerifyOptionInProductStorefront"> - <annotations> - <description>Validates that the provided Option Code and Option Name are present and correct on a Configurable Product page.</description> - </annotations> - <arguments> - <argument name="attributeCode" type="string"/> - <argument name="optionName" type="string"/> - </arguments> - - <seeElement selector="{{StorefrontProductInfoMainSection.attributeOptionByAttributeID(attributeCode, optionName)}}" stepKey="verifyOptionExists"/> - </actionGroup> - - <!-- Adds Single Option Configurable Product to cart--> - <actionGroup name="SelectSingleAttributeAndAddToCart"> - <annotations> - <description>Selects a Product Option. Clicks 'Add to Cart'. Validates that the Product Added Success message appears.</description> - </annotations> - <arguments> - <argument name="productName" type="string"/> - <argument name="attributeCode" type="string"/> - <argument name="optionName" type="string"/> - </arguments> - - <selectOption selector="{{StorefrontProductInfoMainSection.attributeSelectByAttributeID(attributeCode)}}" userInput="{{optionName}}" stepKey="selectAttribute"/> - <click stepKey="addProduct" selector="{{StorefrontProductActionSection.addToCart}}"/> - <waitForElementVisible selector="{{StorefrontQuickSearchResultsSection.messageSection}}" time="30" stepKey="waitForProductAdded"/> - <see selector="{{StorefrontQuickSearchResultsSection.messageSection}}" userInput="You added {{productName}} to your shopping cart." stepKey="seeAddedToCartMessage"/> - </actionGroup> - - <!-- Verify configurable product options in storefront product view --> - <actionGroup name="storefrontCheckConfigurableProductOptions"> - <annotations> - <description>Validates that the Options for a Configurable Product are present and correct.</description> - </annotations> - <arguments> - <argument name="product" type="entity"/> - <argument name="firstOption" type="entity"/> - <argument name="secondOption" type="entity"/> - </arguments> - - <selectOption userInput="{{firstOption.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption1"/> - <see userInput="{{product.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="seeConfigurableProductName"/> - <see userInput="{{firstOption.price}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="assertProductPricePresent"/> - <see userInput="{{product.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="seeConfigurableProductSku"/> - <see userInput="IN STOCK" selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="assertInStock"/> - <see userInput="{{colorProductAttribute.default_label}}" selector="{{StorefrontProductInfoMainSection.productAttributeTitle1}}" stepKey="seeColorAttributeName"/> - <dontSee userInput="As low as" selector="{{StorefrontProductInfoMainSection.productPriceLabel}}" stepKey="dontSeeProductPriceLabel1"/> - <selectOption userInput="{{secondOption.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption2"/> - <dontSee userInput="As low as" selector="{{StorefrontProductInfoMainSection.productPriceLabel}}" stepKey="dontSeeProductPriceLabel2"/> - <see userInput="{{secondOption.price}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="seeProductPrice2"/> - </actionGroup> - - <!-- Assert option image in storefront product page --> - <actionGroup name="assertOptionImageInStorefrontProductPage"> - <annotations> - <description>Validates that the provided Product Image is present when the provided Product Option is selected.</description> - </annotations> - <arguments> - <argument name="product" type="entity"/> - <argument name="label" type="string"/> - <argument name="image" defaultValue="MagentoLogo"/> - </arguments> - - <seeInCurrentUrl url="/{{product.urlKey}}.html" stepKey="checkUrl"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <selectOption userInput="{{label}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption1"/> - <seeElement selector="{{StorefrontProductMediaSection.imageFile(image.filename)}}" stepKey="seeFirstImage"/> - </actionGroup> - - <!-- Assert option image and price in storefront product page --> - <actionGroup name="AssertOptionImageAndPriceInStorefrontProductActionGroup"> - <annotations> - <description>Validates that the provided Product Image and Price are present when the provided Product Option is selected.</description> - </annotations> - <arguments> - <argument name="label" type="string"/> - <argument name="image" type="string"/> - <argument name="price" type="string"/> - </arguments> - - <selectOption userInput="{{label}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption"/> - <seeElement selector="{{StorefrontProductMediaSection.imageFile(image)}}" stepKey="seeImage"/> - <see userInput="{{price}}" selector="{{StorefrontProductInfoMainSection.price}}" stepKey="seeProductPrice"/> - </actionGroup> - - <!-- Assert configurable product with special price in storefront product page --> - <actionGroup name="assertConfigurableProductWithSpecialPriceOnStorefrontProductPage"> - <annotations> - <description>Validates that Special Price for a Configurable Product is present and correct when the provided Product Option is selected.</description> - </annotations> - <arguments> - <argument name="option" type="string"/> - <argument name="price" type="string"/> - <argument name="specialPrice" defaultValue="specialProductPrice"/> - </arguments> - - <selectOption userInput="{{option}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOptionWithSpecialPrice"/> - <see userInput="{{specialProductPrice.price}}" selector="{{StorefrontProductInfoMainSection.productSpecialPrice}}" stepKey="seeSpecialProductPrice"/> - <see userInput="Regular Price" selector="{{StorefrontProductInfoMainSection.specialProductText}}" stepKey="seeText"/> - <see userInput="{{price}}" selector="{{StorefrontProductInfoMainSection.oldProductPrice}}" stepKey="seeOldProductPrice"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontProductCartActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontProductCartActionGroup.xml index 965f452861f7c..28c23955aa1f8 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontProductCartActionGroup.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontProductCartActionGroup.xml @@ -25,17 +25,5 @@ </actionGroup> <!-- Open the Minicart and check Configurable Product --> - <actionGroup name="StorefrontOpenMinicartAndCheckConfigurableProductActionGroup"> - <annotations> - <description>Validates that the provided Option Price is present and correct in the Mini Shopping Cart on the Storefront.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="optionProduct"/> - </arguments> - <waitForElement selector="{{StorefrontMinicartSection.productLinkByName(product.name)}}" stepKey="waitForMinicartProduct"/> - <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickShowMinicart"/> - <see userInput="${{optionProduct.price}}.00" selector="{{StorefrontMinicartSection.productPriceByName(product.name)}}" stepKey="assertProductPrice"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/VerifyOptionInProductStorefrontActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/VerifyOptionInProductStorefrontActionGroup.xml new file mode 100644 index 0000000000000..05623ee9c8ee4 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/VerifyOptionInProductStorefrontActionGroup.xml @@ -0,0 +1,22 @@ +<?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="VerifyOptionInProductStorefrontActionGroup"> + <annotations> + <description>Validates that the provided Option Code and Option Name are present and correct on a Configurable Product page.</description> + </annotations> + <arguments> + <argument name="attributeCode" type="string"/> + <argument name="optionName" type="string"/> + </arguments> + + <seeElement selector="{{StorefrontProductInfoMainSection.attributeOptionByAttributeID(attributeCode, optionName)}}" stepKey="verifyOptionExists"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/ViewConfigurableProductInAdminGridActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/ViewConfigurableProductInAdminGridActionGroup.xml new file mode 100644 index 0000000000000..135bd21aad3e9 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/ViewConfigurableProductInAdminGridActionGroup.xml @@ -0,0 +1,41 @@ +<?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="ViewConfigurableProductInAdminGridActionGroup"> + <annotations> + <description>Goes to the Admin Product grid page. Validates the provided Configurable Product is present and correct in the grid.</description> + </annotations> + <arguments> + <argument name="product" defaultValue="_defaultProduct"/> + </arguments> + + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> + <waitForPageLoad stepKey="waitForPageLoadInitial"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <seeNumberOfElements selector="{{AdminProductGridSection.productGridRows}}" userInput="3" stepKey="seeCorrectNumberOfProducts"/> + + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFiltersSimple"/> + <selectOption selector="{{AdminProductGridFilterSection.typeFilter}}" userInput="simple" stepKey="selectionProductType"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFiltersWithSimpleType"/> + <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.name}}" stepKey="seeSimpleProductNameInGrid"/> + <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.price}}" stepKey="seeSimpleProductPriceInGrid"/> + + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFiltersConfigurable"/> + <selectOption selector="{{AdminProductGridFilterSection.typeFilter}}" userInput="{{product.type_id}}" stepKey="selectionConfigurableProductType"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFiltersWithConfigurableType"/> + <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.name}}" stepKey="seeConfigurableProductNameInGrid"/> + <dontSee selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.price}}" stepKey="dontSeeProductPriceNameInGrid"/> + + <click selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="clickClearFiltersAfter"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddingNewOptionsWithImagesAndPricesToConfigurableProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddingNewOptionsWithImagesAndPricesToConfigurableProductTest.xml index 36c135c427365..7740589b4d498 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddingNewOptionsWithImagesAndPricesToConfigurableProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddingNewOptionsWithImagesAndPricesToConfigurableProductTest.xml @@ -67,17 +67,17 @@ selector="{{AdminCreateProductConfigurationsPanel.selectImagesButton}}" stepKey="selectAttributeOption"/> <!-- Add images to configurable product attribute options --> - <actionGroup ref="addUniqueImageToConfigurableProductOption" stepKey="addImageToConfigurableProductOptionOne"> + <actionGroup ref="AddUniqueImageToConfigurableProductOptionActionGroup" stepKey="addImageToConfigurableProductOptionOne"> <argument name="image" value="ImageUpload"/> <argument name="frontend_label" value="$$createConfigProductAttributeCreateConfigurableProduct.default_frontend_label$$"/> <argument name="label" value="$$getConfigAttributeOption1CreateConfigurableProduct.label$$"/> </actionGroup> - <actionGroup ref="addUniqueImageToConfigurableProductOption" stepKey="addImageToConfigurableProductOptionTwo"> + <actionGroup ref="AddUniqueImageToConfigurableProductOptionActionGroup" stepKey="addImageToConfigurableProductOptionTwo"> <argument name="image" value="ImageUpload_1"/> <argument name="frontend_label" value="$$createConfigProductAttributeCreateConfigurableProduct.default_frontend_label$$"/> <argument name="label" value="$$getConfigAttributeOption2CreateConfigurableProduct.label$$"/> </actionGroup> - <actionGroup ref="addUniqueImageToConfigurableProductOption" stepKey="addImageToConfigurableProductOptionThree"> + <actionGroup ref="AddUniqueImageToConfigurableProductOptionActionGroup" stepKey="addImageToConfigurableProductOptionThree"> <argument name="image" value="ImageUpload3"/> <argument name="frontend_label" value="$$createConfigProductAttributeCreateConfigurableProduct.default_frontend_label$$"/> <argument name="label" value="{{colorDefaultProductAttribute1.name}}"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAssertNoticeThatExistingSkuAutomaticallyChangedWhenSavingProductWithSameSkuTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAssertNoticeThatExistingSkuAutomaticallyChangedWhenSavingProductWithSameSkuTest.xml index c085229da8028..0568ee445034e 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAssertNoticeThatExistingSkuAutomaticallyChangedWhenSavingProductWithSameSkuTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAssertNoticeThatExistingSkuAutomaticallyChangedWhenSavingProductWithSameSkuTest.xml @@ -52,7 +52,7 @@ <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" time="30" stepKey="waitForConfigurationModalOpen" after="clickCreateConfigurations"/> <!--Create new attribute with two option --> - <actionGroup ref="addNewProductConfigurationAttribute" stepKey="createProductConfigurationAttribute"> + <actionGroup ref="AddNewProductConfigurationAttributeActionGroup" stepKey="createProductConfigurationAttribute"> <argument name="attribute" value="colorProductAttribute"/> <argument name="firstOption" value="colorConfigurableProductAttribute1"/> <argument name="secondOption" value="colorConfigurableProductAttribute2"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckConfigurableProductAttributeValueUniquenessTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckConfigurableProductAttributeValueUniquenessTest.xml index df6afdcfd2243..7c25cf82a1181 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckConfigurableProductAttributeValueUniquenessTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckConfigurableProductAttributeValueUniquenessTest.xml @@ -55,7 +55,7 @@ <conditionalClick selector="{{AdminProductFormConfigurationsSection.sectionHeader}}" dependentSelector="{{AdminProductFormConfigurationsSection.createConfigurations}}" visible="false" stepKey="expandConfigurationsTab1"/> <click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickOnCreateConfigurations1"/> <waitForPageLoad stepKey="waitForSelectAttributesPage1"/> - <actionGroup ref="selectCreatedAttributeAndCreateTwoOptions" stepKey="selectCreatedAttributeAndCreateOptions"> + <actionGroup ref="SelectCreatedAttributeAndCreateTwoOptionsActionGroup" stepKey="selectCreatedAttributeAndCreateOptions"> <argument name="attribute" value="dropdownProductAttribute"/> <argument name="firstOption" value="productAttributeOption1"/> <argument name="secondOption" value="productAttributeOption1"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml index de0cca11235ea..502b25617e2b3 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml @@ -120,13 +120,13 @@ <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProductFirst"> <argument name="product" value="$$createFirstConfigurableProduct$$"/> </actionGroup> - <actionGroup ref="CreateConfigurableProductWithAttributeSet" stepKey="createProductFirst"> + <actionGroup ref="CreateConfigurableProductWithAttributeSetActionGroup" stepKey="createProductFirst"> <argument name="product" value="$$createFirstConfigurableProduct$$"/> <argument name="category" value="$$createCategory$$"/> <argument name="label" value="mySet"/> <argument name="option1" value="['option1', 'option2', 'option3', 'option4']"/> </actionGroup> - <actionGroup ref="AdminCreateConfigurationsForAttribute" stepKey="createConfigurationFirst"> + <actionGroup ref="AdminCreateConfigurationsForAttributeActionGroup" stepKey="createConfigurationFirst"> <argument name="attributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> <argument name="price" value="34"/> </actionGroup> @@ -142,13 +142,13 @@ <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProductSecond"> <argument name="product" value="$$createSecondConfigurableProduct$$"/> </actionGroup> - <actionGroup ref="CreateConfigurableProductWithAttributeSet" stepKey="createProductSecond"> + <actionGroup ref="CreateConfigurableProductWithAttributeSetActionGroup" stepKey="createProductSecond"> <argument name="product" value="$$createSecondConfigurableProduct$$"/> <argument name="category" value="$$createCategory$$"/> <argument name="label" value="mySet"/> <argument name="option1" value="['option1', 'option2', 'option3']"/> </actionGroup> - <actionGroup ref="AdminCreateConfigurableProductWithAttributeUncheckOption" stepKey="createConfigurationSecond"> + <actionGroup ref="AdminCreateConfigurableProductWithAttributeUncheckOptionActionGroup" stepKey="createConfigurationSecond"> <argument name="attributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> <argument name="price" value="34"/> <argument name="attributeOption" value="option5"/> @@ -165,13 +165,13 @@ <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProductThird"> <argument name="product" value="$$createThirdConfigurableProduct$$"/> </actionGroup> - <actionGroup ref="CreateConfigurableProductWithAttributeSet" stepKey="createProductThird"> + <actionGroup ref="CreateConfigurableProductWithAttributeSetActionGroup" stepKey="createProductThird"> <argument name="product" value="$$createThirdConfigurableProduct$$"/> <argument name="category" value="$$createCategory$$"/> <argument name="label" value="mySet"/> <argument name="option1" value="['option2', 'option3', 'option4']"/> </actionGroup> - <actionGroup ref="AdminCreateConfigurableProductWithAttributeUncheckOption" stepKey="createConfigurationThird"> + <actionGroup ref="AdminCreateConfigurableProductWithAttributeUncheckOptionActionGroup" stepKey="createConfigurationThird"> <argument name="attributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> <argument name="price" value="34"/> <argument name="attributeOption" value="option1"/> @@ -187,7 +187,7 @@ <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditSimpleProduct"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> - <actionGroup ref="CreateConfigurableProductWithAttributeSet" stepKey="createSimpleProduct"> + <actionGroup ref="CreateConfigurableProductWithAttributeSetActionGroup" stepKey="createSimpleProduct"> <argument name="product" value="$$createSimpleProduct$$"/> <argument name="category" value="$$createCategory$$"/> <argument name="label" value="mySet"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest.xml index 430007ae761f7..aa2e7c1a8a073 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest.xml @@ -30,7 +30,7 @@ </after> <!-- Create a configurable product via the UI --> - <actionGroup ref="createConfigurableProduct" stepKey="createProduct"> + <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> <argument name="product" value="_defaultProduct"/> <argument name="category" value="$$createCategory$$"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductLongSkuTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductLongSkuTest.xml index cd09cbd295877..592642573a221 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductLongSkuTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductLongSkuTest.xml @@ -63,7 +63,7 @@ <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{ProductWithLongNameSku.price}}" stepKey="fillProductPrice"/> <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createCategory.name$$]" stepKey="selectCategory"/> <!--Setup configurations--> - <actionGroup ref="generateConfigurationsByAttributeCode" stepKey="setupConfigurations"> + <actionGroup ref="GenerateConfigurationsByAttributeCodeActionGroup" stepKey="setupConfigurations"> <argument name="attributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest.xml index 7c6cd57097591..6514ed23ea2b5 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest.xml @@ -284,7 +284,7 @@ </after> <!-- Create a configurable product via the UI --> - <actionGroup ref="createConfigurableProduct" stepKey="createProduct"> + <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> <argument name="product" value="_defaultProduct"/> <argument name="category" value="$$createCategory$$"/> </actionGroup> @@ -333,7 +333,7 @@ </after> <!-- Create a configurable product via the UI --> - <actionGroup ref="createConfigurableProduct" stepKey="createProduct"> + <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> <argument name="product" value="_defaultProduct"/> <argument name="category" value="$$createCategory$$"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableSetEditRelatedProductsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableSetEditRelatedProductsTest.xml index 11f1e9bb33c10..f6bcfac593bf2 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableSetEditRelatedProductsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableSetEditRelatedProductsTest.xml @@ -32,7 +32,7 @@ <!-- Create product --> <remove keyForRemoval="goToCreateProduct"/> - <actionGroup ref="createConfigurableProduct" stepKey="fillProductForm"> + <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="fillProductForm"> <argument name="product" value="_defaultProduct"/> <argument name="category" value="$$createCategory$$"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndSwitchProductType.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndSwitchProductType.xml index 2cc71964042a4..e1dab01697d89 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndSwitchProductType.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndSwitchProductType.xml @@ -70,12 +70,12 @@ <argument name="product" value="_defaultProduct"/> </actionGroup> <comment before="createConfiguration" stepKey="beforeCreateConfiguration" userInput="Adding Configuration to Product"/> - <actionGroup ref="generateConfigurationsByAttributeCode" stepKey="createConfiguration" after="fillProductForm"> + <actionGroup ref="GenerateConfigurationsByAttributeCodeActionGroup" stepKey="createConfiguration" after="fillProductForm"> <argument name="attributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> </actionGroup> - <actionGroup ref="saveConfiguredProduct" stepKey="saveProductForm"/> + <actionGroup ref="SaveConfiguredProductActionGroup" stepKey="saveProductForm"/> <see selector="{{AdminProductGridSection.productGridCell('2', 'Type')}}" userInput="Configurable Product" stepKey="seeProductTypeInGrid"/> - <actionGroup ref="VerifyOptionInProductStorefront" stepKey="verifyConfigurableOption" after="AssertProductInStorefrontProductPage"> + <actionGroup ref="VerifyOptionInProductStorefrontActionGroup" stepKey="verifyConfigurableOption" after="AssertProductInStorefrontProductPage"> <argument name="attributeCode" value="$createConfigProductAttribute.default_frontend_label$"/> <argument name="optionName" value="$createConfigProductAttributeOption1.option[store_labels][1][label]$"/> </actionGroup> @@ -109,14 +109,14 @@ <argument name="product" value="_defaultProduct"/> </actionGroup> <comment before="createConfiguration" stepKey="beforeCreateConfiguration" userInput="Adding Configuration to Product"/> - <actionGroup ref="generateConfigurationsByAttributeCode" stepKey="createConfiguration" after="fillProductForm"> + <actionGroup ref="GenerateConfigurationsByAttributeCodeActionGroup" stepKey="createConfiguration" after="fillProductForm"> <argument name="attributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> </actionGroup> - <actionGroup ref="saveConfiguredProduct" stepKey="saveProductForm"/> + <actionGroup ref="SaveConfiguredProductActionGroup" stepKey="saveProductForm"/> <see selector="{{AdminProductGridSection.productGridCell('2', 'Type')}}" userInput="Configurable Product" stepKey="seeProductTypeInGrid"/> <!-- Verify product on store front --> <comment userInput="Verify product on store front" stepKey="commentVerifyProductGrid"/> - <actionGroup ref="VerifyOptionInProductStorefront" stepKey="verifyConfigurableOption" after="AssertProductInStorefrontProductPage"> + <actionGroup ref="VerifyOptionInProductStorefrontActionGroup" stepKey="verifyConfigurableOption" after="AssertProductInStorefrontProductPage"> <argument name="attributeCode" value="$createConfigProductAttribute.default_frontend_label$"/> <argument name="optionName" value="$createConfigProductAttributeOption1.option[store_labels][1][label]$"/> </actionGroup> @@ -169,10 +169,10 @@ <argument name="product" value="_defaultProduct"/> </actionGroup> <comment before="createConfiguration" stepKey="beforeCreateConfiguration" userInput="Adding Configuration to Product"/> - <actionGroup ref="generateConfigurationsByAttributeCode" stepKey="createConfiguration"> + <actionGroup ref="GenerateConfigurationsByAttributeCodeActionGroup" stepKey="createConfiguration"> <argument name="attributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> </actionGroup> - <actionGroup ref="saveConfiguredProduct" stepKey="saveProductForm"/> + <actionGroup ref="SaveConfiguredProductActionGroup" stepKey="saveProductForm"/> <!-- Check that product was added with implicit type change --> <comment stepKey="beforeVerify" userInput="Verify Product Type Assigned Correctly"/> <actionGroup ref="GoToProductCatalogPage" stepKey="goToProductCatalogPage"/> @@ -184,7 +184,7 @@ <actionGroup ref="AssertProductInStorefrontProductPage" stepKey="assertProductInStorefrontProductPage"> <argument name="product" value="_defaultProduct"/> </actionGroup> - <actionGroup ref="VerifyOptionInProductStorefront" stepKey="verifyConfigurableOption"> + <actionGroup ref="VerifyOptionInProductStorefrontActionGroup" stepKey="verifyConfigurableOption"> <argument name="attributeCode" value="$createConfigProductAttribute.default_frontend_label$"/> <argument name="optionName" value="$createConfigProductAttributeOption1.option[store_labels][1][label]$"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductBasedOnParentSkuTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductBasedOnParentSkuTest.xml index f4f607e9119b6..4bec1b243ae39 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductBasedOnParentSkuTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductBasedOnParentSkuTest.xml @@ -52,20 +52,20 @@ <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" time="30" stepKey="waitForConfigurationModalOpen" after="clickCreateConfigurations"/> <!--Create new attribute with two option --> - <actionGroup ref="addNewProductConfigurationAttribute" stepKey="createProductConfigurationAttribute"> + <actionGroup ref="AddNewProductConfigurationAttributeActionGroup" stepKey="createProductConfigurationAttribute"> <argument name="attribute" value="colorProductAttribute"/> <argument name="firstOption" value="colorConfigurableProductAttribute1"/> <argument name="secondOption" value="colorConfigurableProductAttribute2"/> </actionGroup> <!-- Change product configurations except sku --> - <actionGroup ref="changeProductConfigurationsInGridExceptSku" stepKey="changeProductConfigurationsInGridExceptSku"> + <actionGroup ref="ChangeProductConfigurationsInGridExceptSkuActionGroup" stepKey="changeProductConfigurationsInGridExceptSku"> <argument name="firstOption" value="colorConfigurableProductAttribute1"/> <argument name="secondOption" value="colorConfigurableProductAttribute2"/> </actionGroup> <!-- Save product --> - <actionGroup ref="saveConfigurableProductAddToCurrentAttributeSet" stepKey="saveProduct"/> + <actionGroup ref="SaveConfigurableProductAddToCurrentAttributeSetActionGroup" stepKey="saveProduct"/> <!-- Assert child products generated sku in grid --> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="openProductCatalogPage"/> @@ -79,4 +79,4 @@ </actionGroup> <see selector="{{AdminProductGridSection.productGridCell('1', 'SKU')}}" userInput="{{ApiConfigurableProduct.sku}}-{{colorConfigurableProductAttribute2.name}}" stepKey="seeSecondProductSkuInGrid"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithCreatingCategoryAndAttributeTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithCreatingCategoryAndAttributeTest.xml index a7242b43c2b5f..c87fd7dda867a 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithCreatingCategoryAndAttributeTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithCreatingCategoryAndAttributeTest.xml @@ -72,20 +72,20 @@ <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" time="30" stepKey="waitForConfigurationModalOpen" after="clickCreateConfigurations"/> <!--Create new attribute with two option --> - <actionGroup ref="addNewProductConfigurationAttribute" stepKey="createProductConfigurationAttribute"> + <actionGroup ref="AddNewProductConfigurationAttributeActionGroup" stepKey="createProductConfigurationAttribute"> <argument name="attribute" value="colorProductAttribute"/> <argument name="firstOption" value="colorConfigurableProductAttribute1"/> <argument name="secondOption" value="colorConfigurableProductAttribute2"/> </actionGroup> <!-- Change product configurations in grid --> - <actionGroup ref="changeProductConfigurationsInGrid" stepKey="changeProductConfigurationsInGrid"> + <actionGroup ref="ChangeProductConfigurationsInGridActionGroup" stepKey="changeProductConfigurationsInGrid"> <argument name="firstOption" value="colorConfigurableProductAttribute1"/> <argument name="secondOption" value="colorConfigurableProductAttribute2"/> </actionGroup> <!-- Save configurable product; add product to new attribute set --> - <actionGroup ref="saveConfigurableProductWithNewAttributeSet" stepKey="saveConfigurableProduct"/> + <actionGroup ref="SaveConfigurableProductWithNewAttributeSetActionGroup" stepKey="saveConfigurableProduct"/> <!-- Find configurable product in grid --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> @@ -97,7 +97,7 @@ <!-- Assert configurable product on admin product page --> <click selector="{{AdminProductGridSection.firstRow}}" stepKey="clickOnProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> - <actionGroup ref="assertConfigurableProductOnAdminProductPage" stepKey="assertConfigurableProductOnAdminProductPage"> + <actionGroup ref="AssertConfigurableProductOnAdminProductPageActionGroup" stepKey="assertConfigurableProductOnAdminProductPage"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> @@ -107,7 +107,7 @@ <!--Assert configurable product in category --> <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> - <actionGroup ref="StorefrontCheckCategoryConfigurableProduct" stepKey="assertConfigurableProductInCategory"> + <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="assertConfigurableProductInCategory"> <argument name="product" value="ApiConfigurableProduct"/> <argument name="optionProduct" value="colorConfigurableProductAttribute1"/> </actionGroup> @@ -115,7 +115,7 @@ <!--Assert configurable product on product page --> <amOnPage url="{{ApiConfigurableProduct.urlKey}}.html" stepKey="amOnProductPage"/> <waitForPageLoad stepKey="waitForPageLoad"/> - <actionGroup ref="storefrontCheckConfigurableProductOptions" stepKey="checkConfigurableProductOptions"> + <actionGroup ref="StorefrontCheckConfigurableProductOptionsActionGroup" stepKey="checkConfigurableProductOptions"> <argument name="product" value="ApiConfigurableProduct"/> <argument name="firstOption" value="colorConfigurableProductAttribute1"/> <argument name="secondOption" value="colorConfigurableProductAttribute2"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithDisabledChildrenProductsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithDisabledChildrenProductsTest.xml index 49f3f8b5ea931..8c69542117993 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithDisabledChildrenProductsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithDisabledChildrenProductsTest.xml @@ -69,7 +69,7 @@ </actionGroup> <!-- Create product configurations and add attribute and select all options --> - <actionGroup ref="generateConfigurationsByAttributeCode" stepKey="generateConfigurationsByAttributeCode" after="fillConfigurableProductValues"> + <actionGroup ref="GenerateConfigurationsByAttributeCodeActionGroup" stepKey="generateConfigurationsByAttributeCode" after="fillConfigurableProductValues"> <argument name="attributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> </actionGroup> @@ -77,7 +77,7 @@ <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createCategory.name$$]" stepKey="fillCategory" after="fillConfigurableProductValues"/> <!-- Add child product to configurations grid --> - <actionGroup ref="addProductToConfigurationsGrid" stepKey="addSimpleProduct"> + <actionGroup ref="AddProductToConfigurationsGridActionGroup" stepKey="addSimpleProduct"> <argument name="sku" value="$$createSimpleProduct.sku$$"/> <argument name="name" value="$$createConfigProductAttributeOption.option[store_labels][1][label]$$"/> </actionGroup> @@ -95,7 +95,7 @@ <!-- Assert configurable product on admin product page --> <click selector="{{AdminProductGridSection.firstRow}}" stepKey="clickOnProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> - <actionGroup ref="assertConfigurableProductOnAdminProductPage" stepKey="assertConfigurableProductOnAdminProductPage"> + <actionGroup ref="AssertConfigurableProductOnAdminProductPageActionGroup" stepKey="assertConfigurableProductOnAdminProductPage"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml index 9796c14f5519a..e856755a48ff8 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml @@ -97,24 +97,24 @@ <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton2"/> <!-- Add images to first product attribute options --> - <actionGroup ref="addUniqueImageToConfigurableProductOption" stepKey="addImageToConfigurableProductOptionOne"> + <actionGroup ref="AddUniqueImageToConfigurableProductOptionActionGroup" stepKey="addImageToConfigurableProductOptionOne"> <argument name="image" value="MagentoLogo"/> <argument name="frontend_label" value="$$createFirstConfigProductAttribute.default_frontend_label$$"/> <argument name="label" value="$$createConfigProductAttributeOptionOne.option[store_labels][1][label]$$"/> </actionGroup> - <actionGroup ref="addUniqueImageToConfigurableProductOption" stepKey="addImageToConfigurableProductOptionTwo"> + <actionGroup ref="AddUniqueImageToConfigurableProductOptionActionGroup" stepKey="addImageToConfigurableProductOptionTwo"> <argument name="image" value="TestImageNew"/> <argument name="frontend_label" value="$$createFirstConfigProductAttribute.default_frontend_label$$"/> <argument name="label" value="$$createConfigProductAttributeOptionTwo.option[store_labels][1][label]$$"/> </actionGroup> <!-- Add price to second product attribute options --> - <actionGroup ref="addUniquePriceToConfigurableProductOption" stepKey="addPriceToConfigurableProductOptionThree"> + <actionGroup ref="AddUniquePriceToConfigurableProductOptionActionGroup" stepKey="addPriceToConfigurableProductOptionThree"> <argument name="frontend_label" value="$$createSecondConfigProductAttribute.default_frontend_label$$"/> <argument name="label" value="$$createConfigProductAttributeOptionThree.option[store_labels][1][label]$$"/> <argument name="price" value="{{virtualProductWithRequiredFields.price}}"/> </actionGroup> - <actionGroup ref="addUniquePriceToConfigurableProductOption" stepKey="addPriceToConfigurableProductOptionFour"> + <actionGroup ref="AddUniquePriceToConfigurableProductOptionActionGroup" stepKey="addPriceToConfigurableProductOptionFour"> <argument name="frontend_label" value="$$createSecondConfigProductAttribute.default_frontend_label$$"/> <argument name="label" value="$$createConfigProductAttributeOptionFour.option[store_labels][1][label]$$"/> <argument name="price" value="{{virtualProductWithRequiredFields.price}}"/> @@ -127,7 +127,7 @@ <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton4"/> <!-- Save product --> - <actionGroup ref="saveConfigurableProductAddToCurrentAttributeSet" stepKey="saveProduct"/> + <actionGroup ref="SaveConfigurableProductAddToCurrentAttributeSetActionGroup" stepKey="saveProduct"/> <!--Run re-index task--> <magentoCLI command="indexer:reindex" stepKey="reindex"/> @@ -135,7 +135,7 @@ <!-- Assert configurable product in category --> <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> - <actionGroup ref="StorefrontCheckCategoryConfigurableProduct" stepKey="assertConfigurableProductInCategory"> + <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="assertConfigurableProductInCategory"> <argument name="product" value="ApiConfigurableProduct"/> <argument name="optionProduct" value="virtualProductWithRequiredFields"/> </actionGroup> @@ -148,12 +148,12 @@ </actionGroup> <!-- Assert product options images in storefront product page --> - <actionGroup ref="assertOptionImageInStorefrontProductPage" stepKey="assertFirstOptionImageInStorefrontProductPage"> + <actionGroup ref="AssertOptionImageInStorefrontProductPageActionGroup" stepKey="assertFirstOptionImageInStorefrontProductPage"> <argument name="product" value="ApiConfigurableProduct"/> <argument name="label" value="$$createConfigProductAttributeOptionOne.option[store_labels][1][label]$$"/> <argument name="image" value="MagentoLogo"/> </actionGroup> - <actionGroup ref="assertOptionImageInStorefrontProductPage" stepKey="assertSecondOptionImageInStorefrontProductPage"> + <actionGroup ref="AssertOptionImageInStorefrontProductPageActionGroup" stepKey="assertSecondOptionImageInStorefrontProductPage"> <argument name="product" value="ApiConfigurableProduct"/> <argument name="label" value="$$createConfigProductAttributeOptionTwo.option[store_labels][1][label]$$"/> <argument name="image" value="TestImageNew"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDisplayOutOfStockProductsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDisplayOutOfStockProductsTest.xml index 308e256543736..07d4f6cdabcf2 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDisplayOutOfStockProductsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDisplayOutOfStockProductsTest.xml @@ -92,7 +92,7 @@ </actionGroup> <!-- Create product configurations and add attribute and select all options --> - <actionGroup ref="generateConfigurationsByAttributeCode" stepKey="generateConfigurationsByAttributeCode" after="fillConfigurableProductValues"> + <actionGroup ref="GenerateConfigurationsByAttributeCodeActionGroup" stepKey="generateConfigurationsByAttributeCode" after="fillConfigurableProductValues"> <argument name="attributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> </actionGroup> @@ -100,17 +100,17 @@ <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createCategory.name$$]" stepKey="fillCategory" after="fillConfigurableProductValues"/> <!-- Add child products to configurations grid --> - <actionGroup ref="addProductToConfigurationsGrid" stepKey="addFirstSimpleProduct"> + <actionGroup ref="AddProductToConfigurationsGridActionGroup" stepKey="addFirstSimpleProduct"> <argument name="sku" value="$$createFirstSimpleProduct.sku$$"/> <argument name="name" value="$$createConfigProductAttributeOptionOne.option[store_labels][1][label]$$"/> </actionGroup> - <actionGroup ref="addProductToConfigurationsGrid" stepKey="addSecondSimpleProduct"> + <actionGroup ref="AddProductToConfigurationsGridActionGroup" stepKey="addSecondSimpleProduct"> <argument name="sku" value="$$createSecondSimpleProduct.sku$$"/> <argument name="name" value="$$createConfigProductAttributeOptionTwo.option[store_labels][1][label]$$"/> </actionGroup> - <actionGroup ref="addProductToConfigurationsGrid" stepKey="addOutOfStockProduct"> + <actionGroup ref="AddProductToConfigurationsGridActionGroup" stepKey="addOutOfStockProduct"> <argument name="sku" value="$$createSimpleOutOfStockProduct.sku$$"/> <argument name="name" value="$$createConfigProductAttributeOptionThree.option[store_labels][1][label]$$"/> </actionGroup> @@ -127,7 +127,7 @@ <!--Assert configurable product in category --> <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> - <actionGroup ref="StorefrontCheckCategoryConfigurableProduct" stepKey="assertConfigurableProductInCategory"> + <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="assertConfigurableProductInCategory"> <argument name="product" value="ApiConfigurableProduct"/> <argument name="optionProduct" value="$$createFirstSimpleProduct$$"/> </actionGroup> @@ -137,4 +137,4 @@ <waitForPageLoad stepKey="waitForProductPageLoad"/> <see userInput="$$createConfigProductAttributeOptionThree.option[store_labels][1][label]$$" selector="{{StorefrontProductInfoMainSection.optionByAttributeId($$createConfigProductAttribute.attribute_id$$)}}" stepKey="assertOptionNotAvailable" /> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDontDisplayOutOfStockProductsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDontDisplayOutOfStockProductsTest.xml index e24ac07c30d1e..514ad6ea6f675 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDontDisplayOutOfStockProductsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDontDisplayOutOfStockProductsTest.xml @@ -89,7 +89,7 @@ </actionGroup> <!-- Create product configurations and add attribute and select all options --> - <actionGroup ref="generateConfigurationsByAttributeCode" stepKey="generateConfigurationsByAttributeCode" after="fillConfigurableProductValues"> + <actionGroup ref="GenerateConfigurationsByAttributeCodeActionGroup" stepKey="generateConfigurationsByAttributeCode" after="fillConfigurableProductValues"> <argument name="attributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> </actionGroup> @@ -97,17 +97,17 @@ <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createCategory.name$$]" stepKey="fillCategory" after="fillConfigurableProductValues"/> <!-- Add child products to configurations grid --> - <actionGroup ref="addProductToConfigurationsGrid" stepKey="addFirstSimpleProduct"> + <actionGroup ref="AddProductToConfigurationsGridActionGroup" stepKey="addFirstSimpleProduct"> <argument name="sku" value="$$createFirstSimpleProduct.sku$$"/> <argument name="name" value="$$createConfigProductAttributeOptionOne.option[store_labels][1][label]$$"/> </actionGroup> - <actionGroup ref="addProductToConfigurationsGrid" stepKey="addSecondSimpleProduct"> + <actionGroup ref="AddProductToConfigurationsGridActionGroup" stepKey="addSecondSimpleProduct"> <argument name="sku" value="$$createSecondSimpleProduct.sku$$"/> <argument name="name" value="$$createConfigProductAttributeOptionTwo.option[store_labels][1][label]$$"/> </actionGroup> - <actionGroup ref="addProductToConfigurationsGrid" stepKey="addOutOfStockProduct"> + <actionGroup ref="AddProductToConfigurationsGridActionGroup" stepKey="addOutOfStockProduct"> <argument name="sku" value="$$createSimpleOutOfStockProduct.sku$$"/> <argument name="name" value="$createConfigProductAttributeOptionThree.option[store_labels][1][label]$$"/> </actionGroup> @@ -121,7 +121,7 @@ <!--Assert configurable product in category --> <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> - <actionGroup ref="StorefrontCheckCategoryConfigurableProduct" stepKey="assertConfigurableProductInCategory"> + <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="assertConfigurableProductInCategory"> <argument name="product" value="ApiConfigurableProduct"/> <argument name="optionProduct" value="$$createFirstSimpleProduct$$"/> </actionGroup> @@ -131,4 +131,4 @@ <waitForPageLoad stepKey="waitForPageLoad"/> <dontSee userInput="$$createConfigProductAttributeOptionThree.option[store_labels][1][label]$$" selector="{{StorefrontProductInfoMainSection.optionByAttributeId($$createConfigProductAttribute.attribute_id$$)}}" stepKey="assertOptionNotAvailable"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTierPriceForOneItemTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTierPriceForOneItemTest.xml index 51f4bf0279942..f4ce226960ca2 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTierPriceForOneItemTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTierPriceForOneItemTest.xml @@ -80,17 +80,17 @@ </actionGroup> <!-- Create product configurations and add attribute and select all options --> - <actionGroup ref="generateConfigurationsByAttributeCode" stepKey="generateConfigurationsByAttributeCode" after="fillConfigurableProductValues"> + <actionGroup ref="GenerateConfigurationsByAttributeCodeActionGroup" stepKey="generateConfigurationsByAttributeCode" after="fillConfigurableProductValues"> <argument name="attributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> </actionGroup> <!-- Add associated products to configurations grid --> - <actionGroup ref="addProductToConfigurationsGrid" stepKey="addFirstSimpleProduct"> + <actionGroup ref="AddProductToConfigurationsGridActionGroup" stepKey="addFirstSimpleProduct"> <argument name="sku" value="$$createFirstSimpleProduct.sku$$"/> <argument name="name" value="$$createConfigProductAttributeOptionOne.option[store_labels][1][label]$$"/> </actionGroup> - <actionGroup ref="addProductToConfigurationsGrid" stepKey="addSecondSimpleProduct"> + <actionGroup ref="AddProductToConfigurationsGridActionGroup" stepKey="addSecondSimpleProduct"> <argument name="sku" value="$$createSecondSimpleProduct.sku$$"/> <argument name="name" value="$$createConfigProductAttributeOptionTwo.option[store_labels][1][label]$$"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsAssignedToCategoryTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsAssignedToCategoryTest.xml index 1db9b3e5b79b2..bdf3e49aa466c 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsAssignedToCategoryTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsAssignedToCategoryTest.xml @@ -72,14 +72,14 @@ <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" time="30" stepKey="waitForConfigurationModalOpen" after="clickCreateConfigurations"/> <!--Create new attribute with two options --> - <actionGroup ref="addNewProductConfigurationAttribute" stepKey="createProductConfigurationAttribute"> + <actionGroup ref="AddNewProductConfigurationAttributeActionGroup" stepKey="createProductConfigurationAttribute"> <argument name="attribute" value="colorProductAttribute"/> <argument name="firstOption" value="colorConfigurableProductAttribute1"/> <argument name="secondOption" value="colorConfigurableProductAttribute2"/> </actionGroup> <!-- Change product configurations in grid --> - <actionGroup ref="changeProductConfigurationsInGrid" stepKey="changeProductConfigurationsInGrid"> + <actionGroup ref="ChangeProductConfigurationsInGridActionGroup" stepKey="changeProductConfigurationsInGrid"> <argument name="firstOption" value="colorConfigurableProductAttribute1"/> <argument name="secondOption" value="colorConfigurableProductAttribute2"/> </actionGroup> @@ -88,7 +88,7 @@ <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createCategory.name$$]" stepKey="fillCategory" after="fillConfigurableProductValues"/> <!-- Save configurable product; add product to new attribute set --> - <actionGroup ref="saveConfigurableProductWithNewAttributeSet" stepKey="saveConfigurableProduct"/> + <actionGroup ref="SaveConfigurableProductWithNewAttributeSetActionGroup" stepKey="saveConfigurableProduct"/> <!-- Assert child products in grid --> <actionGroup ref="viewProductInAdminGrid" stepKey="viewFirstChildProductInAdminGrid"> @@ -111,7 +111,7 @@ <!--Assert configurable product in category --> <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> - <actionGroup ref="StorefrontCheckCategoryConfigurableProduct" stepKey="assertConfigurableProductInCategory"> + <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="assertConfigurableProductInCategory"> <argument name="product" value="ApiConfigurableProduct"/> <argument name="optionProduct" value="colorConfigurableProductAttribute1"/> </actionGroup> @@ -119,7 +119,7 @@ <!--Assert configurable product on product page --> <amOnPage url="{{ApiConfigurableProduct.urlKey}}.html" stepKey="amOnProductPage" after="assertConfigurableProductInCategory"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> - <actionGroup ref="storefrontCheckConfigurableProductOptions" stepKey="checkConfigurableProductOptions"> + <actionGroup ref="StorefrontCheckConfigurableProductOptionsActionGroup" stepKey="checkConfigurableProductOptions"> <argument name="product" value="ApiConfigurableProduct"/> <argument name="firstOption" value="colorConfigurableProductAttribute1"/> <argument name="secondOption" value="colorConfigurableProductAttribute2"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsWithoutAssignedToCategoryTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsWithoutAssignedToCategoryTest.xml index 934a410d58a8a..f3c56184bc956 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsWithoutAssignedToCategoryTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsWithoutAssignedToCategoryTest.xml @@ -65,20 +65,20 @@ <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" time="30" stepKey="waitForConfigurationModalOpen" after="clickCreateConfigurations"/> <!--Create new attribute with two option --> - <actionGroup ref="addNewProductConfigurationAttribute" stepKey="createProductConfigurationAttribute"> + <actionGroup ref="AddNewProductConfigurationAttributeActionGroup" stepKey="createProductConfigurationAttribute"> <argument name="attribute" value="colorProductAttribute"/> <argument name="firstOption" value="colorConfigurableProductAttribute1"/> <argument name="secondOption" value="colorConfigurableProductAttribute2"/> </actionGroup> <!-- Change product configurations in grid --> - <actionGroup ref="changeProductConfigurationsInGrid" stepKey="changeProductConfigurationsInGrid"> + <actionGroup ref="ChangeProductConfigurationsInGridActionGroup" stepKey="changeProductConfigurationsInGrid"> <argument name="firstOption" value="colorConfigurableProductAttribute1"/> <argument name="secondOption" value="colorConfigurableProductAttribute2"/> </actionGroup> <!-- Save configurable product; add product to new attribute set --> - <actionGroup ref="saveConfigurableProductWithNewAttributeSet" stepKey="saveConfigurableProduct"/> + <actionGroup ref="SaveConfigurableProductWithNewAttributeSetActionGroup" stepKey="saveConfigurableProduct"/> <!-- Assert Child Products in grid --> <actionGroup ref="viewProductInAdminGrid" stepKey="viewFirstChildProductInAdminGrid"> @@ -101,7 +101,7 @@ <!-- Assert configurable product on product page --> <amOnPage url="{{ApiConfigurableProduct.urlKey}}.html" stepKey="amOnProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> - <actionGroup ref="storefrontCheckConfigurableProductOptions" stepKey="checkConfigurableProductOptions"> + <actionGroup ref="StorefrontCheckConfigurableProductOptionsActionGroup" stepKey="checkConfigurableProductOptions"> <argument name="product" value="ApiConfigurableProduct"/> <argument name="firstOption" value="colorConfigurableProductAttribute1"/> <argument name="secondOption" value="colorConfigurableProductAttribute2"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml index fa21d20eb4456..f3d9eef42458e 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml @@ -49,10 +49,10 @@ <comment userInput="Add configurations to product" stepKey="commentAddConfigs"/> <amOnPage url="{{AdminProductEditPage.url($$createProduct.id$$)}}" stepKey="gotToSimpleProductPage"/> <waitForPageLoad stepKey="waitForSimpleProductPageLoad"/> - <actionGroup ref="generateConfigurationsByAttributeCode" stepKey="setupConfigurations"> + <actionGroup ref="GenerateConfigurationsByAttributeCodeActionGroup" stepKey="setupConfigurations"> <argument name="attributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> </actionGroup> - <actionGroup ref="saveConfiguredProduct" stepKey="saveConfigProductForm"/> + <actionGroup ref="SaveConfiguredProductActionGroup" stepKey="saveConfigProductForm"/> <!--Assert configurable product on Admin product page grid--> <comment userInput="Assert configurable product in Admin product page grid" stepKey="commentAssertConfigProductOnAdmin"/> <amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="goToCatalogProductPage"/> @@ -154,10 +154,10 @@ <amOnPage url="{{AdminProductEditPage.url($$createProduct.id$$)}}" stepKey="gotToConfigProductPage"/> <waitForPageLoad stepKey="waitForConfigurableProductPageLoad"/> <selectOption selector="{{AdminProductFormSection.productWeightSelect}}" userInput="This item has weight" stepKey="selectWeightForConfigurableProduct"/> - <actionGroup ref="generateConfigurationsByAttributeCode" stepKey="setupConfigurationsForProduct"> + <actionGroup ref="GenerateConfigurationsByAttributeCodeActionGroup" stepKey="setupConfigurationsForProduct"> <argument name="attributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> </actionGroup> - <actionGroup ref="saveConfiguredProduct" stepKey="saveNewConfigurableProductForm"/> + <actionGroup ref="SaveConfiguredProductActionGroup" stepKey="saveNewConfigurableProductForm"/> <!--Assert configurable product on Admin product page grid--> <comment userInput="Assert configurable product in Admin product page grid" stepKey="commentAssertConfigurableProductOnAdmin"/> <amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="goToCatalogProductPageForConfigurable"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ConfigurableProductAttributeNameDesignTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ConfigurableProductAttributeNameDesignTest.xml index 7fbff5eac2583..bb16d04dfc94a 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ConfigurableProductAttributeNameDesignTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ConfigurableProductAttributeNameDesignTest.xml @@ -26,16 +26,16 @@ <!-- Navigate to Catalog-> Products --> - <actionGroup ref="GotoCatalogProductsPage" stepKey="goToCatalogProductsPage"/> + <actionGroup ref="GotoCatalogProductsPageActionGroup" stepKey="goToCatalogProductsPage"/> <!-- Fill the fields on Configurable Product--> - <actionGroup ref="GotoConfigurableProductPage" stepKey="goToConfigurableProductPage"/> - <actionGroup ref="FillAllRequiredFields" stepKey="fillInAllRequiredFields"/> + <actionGroup ref="GotoConfigurableProductPageActionGroup" stepKey="goToConfigurableProductPage"/> + <actionGroup ref="FillAllRequiredFieldsActionGroup" stepKey="fillInAllRequiredFields"/> <!-- Create New Attribute (Default Label= design) --> - <actionGroup ref="CreateNewAttribute" stepKey="createNewAttribute"/> + <actionGroup ref="CreateNewAttributeActionGroup" stepKey="createNewAttribute"/> <after> <!-- Delete Created Attribute --> - <actionGroup ref="DeleteCreatedAttribute" stepKey="deleteCreatedAttribute"/> + <actionGroup ref="DeleteCreatedAttributeActionGroup" stepKey="deleteCreatedAttribute"/> </after> </test> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CAdminTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CAdminTest.xml index 6bbb97c66cdd8..3135393bd502b 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CAdminTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CAdminTest.xml @@ -63,7 +63,7 @@ <waitForElementVisible selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" time="30" stepKey="waitForAttributeSetConfirmation" after="clickSaveConfigurableProduct"/> <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickConfirmAttributeSet" after="waitForAttributeSetConfirmation"/> <see selector="You saved the product" stepKey="seeConfigurableSaveConfirmation" after="clickConfirmAttributeSet"/> - <actionGroup ref="viewConfigurableProductInAdminGrid" stepKey="viewConfigurableProductInGrid" after="seeConfigurableSaveConfirmation"> + <actionGroup ref="ViewConfigurableProductInAdminGridActionGroup" stepKey="viewConfigurableProductInGrid" after="seeConfigurableSaveConfirmation"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> @@ -73,4 +73,4 @@ <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CGuestUserTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CGuestUserTest.xml index 04687a2314dc6..59bb7f53f0aa8 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CGuestUserTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CGuestUserTest.xml @@ -85,7 +85,7 @@ <!-- Check configurable product in category --> <comment userInput="Verify Configurable Product in category" stepKey="commentVerifyConfigurableProductInCategory" after="browseAssertSimpleProduct2ImageNotDefault" /> - <actionGroup ref="StorefrontCheckCategoryConfigurableProduct" stepKey="browseAssertCategoryConfigProduct" after="commentVerifyConfigurableProductInCategory"> + <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="browseAssertCategoryConfigProduct" after="commentVerifyConfigurableProductInCategory"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -98,7 +98,7 @@ <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="clickCategory2" after="commentViewConfigurableProduct"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createConfigProduct.name$$)}}" stepKey="browseClickCategoryConfigProductView" after="clickCategory2"/> <waitForLoadingMaskToDisappear stepKey="waitForConfigurableProductViewloaded" after="browseClickCategoryConfigProductView"/> - <actionGroup ref="StorefrontCheckConfigurableProduct" stepKey="browseAssertConfigProductPage" after="waitForConfigurableProductViewloaded"> + <actionGroup ref="StorefrontCheckConfigurableProductActionGroup" stepKey="browseAssertConfigProductPage" after="waitForConfigurableProductViewloaded"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -114,7 +114,7 @@ <argument name="category" value="$$createCategory$$"/> <argument name="productCount" value="3"/> </actionGroup> - <actionGroup ref="StorefrontCheckCategoryConfigurableProduct" stepKey="cartAssertConfigProduct" after="cartAssertCategory1ForConfigurableProduct"> + <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="cartAssertConfigProduct" after="cartAssertCategory1ForConfigurableProduct"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -123,7 +123,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$cartGrabConfigProductImageSrc" stepKey="cartAssertConfigProductImageNotDefault" after="cartGrabConfigProductImageSrc"/> <click selector="{{StorefrontCategoryProductSection.ProductAddToCartByName($$createConfigProduct.name$$)}}" stepKey="cartClickCategoryConfigProductAddToCart" after="cartAssertConfigProductImageNotDefault"/> <waitForElement selector="{{StorefrontMessagesSection.message('You need to choose options for your item.')}}" time="30" stepKey="cartWaitForConfigProductPageLoad" after="cartClickCategoryConfigProductAddToCart"/> - <actionGroup ref="StorefrontCheckConfigurableProduct" stepKey="cartAssertConfigProductPage" after="cartWaitForConfigProductPageLoad"> + <actionGroup ref="StorefrontCheckConfigurableProductActionGroup" stepKey="cartAssertConfigProductPage" after="cartWaitForConfigProductPageLoad"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -132,7 +132,7 @@ <assertNotRegExp expected="'/placeholder\/image\.jpg/'" actual="$cartGrabConfigProductPageImageSrc1" stepKey="cartAssertConfigProductPageImageNotDefault1" after="cartGrabConfigProductPageImageSrc1"/> <selectOption userInput="$$createConfigProductAttributeOption2.option[store_labels][1][label]$$" selector="{{StorefrontProductInfoMainSection.optionByAttributeId($$createConfigProductAttribute.attribute_id$$)}}" stepKey="cartConfigProductFillOption" after="cartAssertConfigProductPageImageNotDefault1"/> <waitForLoadingMaskToDisappear stepKey="waitForConfigurableProductOptionloaded" after="cartConfigProductFillOption"/> - <actionGroup ref="StorefrontCheckConfigurableProduct" stepKey="cartAssertConfigProductWithOptionPage" after="waitForConfigurableProductOptionloaded"> + <actionGroup ref="StorefrontCheckConfigurableProductActionGroup" stepKey="cartAssertConfigProductWithOptionPage" after="waitForConfigurableProductOptionloaded"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct2$$"/> </actionGroup> @@ -157,7 +157,7 @@ <see userInput="$$createConfigProductAttributeOption2.option[store_labels][1][label]$$" selector="{{StorefrontMinicartSection.productOptionByNameAndAttribute($$createConfigProduct.name$$, $$createConfigProductAttribute.attribute[frontend_labels][0][label]$$)}}" stepKey="cartMinicartCheckConfigProductOption" after="cartMinicartClickConfigProductDetails"/> <click selector="{{StorefrontMinicartSection.productLinkByName($$createConfigProduct.name$$)}}" stepKey="cartMinicartClickConfigProduct" after="cartMinicartCheckConfigProductOption"/> <waitForLoadingMaskToDisappear stepKey="waitForMinicartConfigProductloaded" after="cartMinicartClickConfigProduct"/> - <actionGroup ref="StorefrontCheckConfigurableProduct" stepKey="cartAssertMinicartConfigProductPage" after="waitForMinicartConfigProductloaded"> + <actionGroup ref="StorefrontCheckConfigurableProductActionGroup" stepKey="cartAssertMinicartConfigProductPage" after="waitForMinicartConfigProductloaded"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -180,7 +180,7 @@ <see userInput="$$createConfigProductAttributeOption2.option[store_labels][1][label]$$" selector="{{CheckoutCartProductSection.ProductOptionByNameAndAttribute($$createConfigProduct.name$$, $$createConfigProductAttribute.attribute[frontend_labels][0][label]$$)}}" stepKey="cartCheckConfigProductOption" after="cartCartAssertConfigProduct2ImageNotDefault"/> <click selector="{{CheckoutCartProductSection.ProductLinkByName($$createConfigProduct.name$$)}}" stepKey="cartClickCartConfigProduct" after="cartCheckConfigProductOption"/> <waitForLoadingMaskToDisappear stepKey="waitForCartConfigProductloaded" after="cartClickCartConfigProduct"/> - <actionGroup ref="StorefrontCheckConfigurableProduct" stepKey="cartAssertCartConfigProductPage" after="waitForCartConfigProductloaded"> + <actionGroup ref="StorefrontCheckConfigurableProductActionGroup" stepKey="cartAssertCartConfigProductPage" after="waitForCartConfigProductloaded"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -190,7 +190,7 @@ <!-- Add Configurable Product to comparison --> <comment userInput="Add Configurable Product to comparison" stepKey="commentAddConfigurableProductToComparison" after="compareAddSimpleProduct2ToCompare" /> - <actionGroup ref="StorefrontCheckCategoryConfigurableProduct" stepKey="compareAssertConfigProduct" after="commentAddConfigurableProductToComparison"> + <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="compareAssertConfigProduct" after="commentAddConfigurableProductToComparison"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -294,7 +294,7 @@ <!-- Check configurable product in category --> <comment userInput="Verify Configurable Product in category" stepKey="commentVerifyConfigurableProductInCategory" after="browseAssertSimpleProduct2ImageNotDefault" /> - <actionGroup ref="StorefrontCheckCategoryConfigurableProduct" stepKey="browseAssertCategoryConfigProduct" after="commentVerifyConfigurableProductInCategory"> + <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="browseAssertCategoryConfigProduct" after="commentVerifyConfigurableProductInCategory"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -307,7 +307,7 @@ <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="clickCategory2" after="commentViewConfigurableProduct"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createConfigProduct.name$$)}}" stepKey="browseClickCategoryConfigProductView" after="clickCategory2"/> <waitForLoadingMaskToDisappear stepKey="waitForConfigurableProductViewloaded" after="browseClickCategoryConfigProductView"/> - <actionGroup ref="StorefrontCheckConfigurableProduct" stepKey="browseAssertConfigProductPage" after="waitForConfigurableProductViewloaded"> + <actionGroup ref="StorefrontCheckConfigurableProductActionGroup" stepKey="browseAssertConfigProductPage" after="waitForConfigurableProductViewloaded"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -323,7 +323,7 @@ <argument name="category" value="$$createCategory$$"/> <argument name="productCount" value="3"/> </actionGroup> - <actionGroup ref="StorefrontCheckCategoryConfigurableProduct" stepKey="cartAssertConfigProduct" after="cartAssertCategory1ForConfigurableProduct"> + <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="cartAssertConfigProduct" after="cartAssertCategory1ForConfigurableProduct"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -332,7 +332,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$cartGrabConfigProductImageSrc" stepKey="cartAssertConfigProductImageNotDefault" after="cartGrabConfigProductImageSrc"/> <click selector="{{StorefrontCategoryProductSection.ProductAddToCartByName($$createConfigProduct.name$$)}}" stepKey="cartClickCategoryConfigProductAddToCart" after="cartAssertConfigProductImageNotDefault"/> <waitForElement selector="{{StorefrontMessagesSection.message('You need to choose options for your item.')}}" time="30" stepKey="cartWaitForConfigProductPageLoad" after="cartClickCategoryConfigProductAddToCart"/> - <actionGroup ref="StorefrontCheckConfigurableProduct" stepKey="cartAssertConfigProductPage" after="cartWaitForConfigProductPageLoad"> + <actionGroup ref="StorefrontCheckConfigurableProductActionGroup" stepKey="cartAssertConfigProductPage" after="cartWaitForConfigProductPageLoad"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -341,7 +341,7 @@ <assertNotRegExp expected="'/placeholder\/image\.jpg/'" actual="$cartGrabConfigProductPageImageSrc1" stepKey="cartAssertConfigProductPageImageNotDefault1" after="cartGrabConfigProductPageImageSrc1"/> <selectOption userInput="$$createConfigProductAttributeOption2.option[store_labels][1][label]$$" selector="{{StorefrontProductInfoMainSection.optionByAttributeId($$createConfigProductAttribute.attribute_id$$)}}" stepKey="cartConfigProductFillOption" after="cartAssertConfigProductPageImageNotDefault1"/> <waitForLoadingMaskToDisappear stepKey="waitForConfigurableProductOptionloaded" after="cartConfigProductFillOption"/> - <actionGroup ref="StorefrontCheckConfigurableProduct" stepKey="cartAssertConfigProductWithOptionPage" after="waitForConfigurableProductOptionloaded"> + <actionGroup ref="StorefrontCheckConfigurableProductActionGroup" stepKey="cartAssertConfigProductWithOptionPage" after="waitForConfigurableProductOptionloaded"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct2$$"/> </actionGroup> @@ -366,7 +366,7 @@ <see userInput="$$createConfigProductAttributeOption2.option[store_labels][1][label]$$" selector="{{StorefrontMinicartSection.productOptionByNameAndAttribute($$createConfigProduct.name$$, $$createConfigProductAttribute.attribute[frontend_labels][0][label]$$)}}" stepKey="cartMinicartCheckConfigProductOption" after="cartMinicartClickConfigProductDetails"/> <click selector="{{StorefrontMinicartSection.productLinkByName($$createConfigProduct.name$$)}}" stepKey="cartMinicartClickConfigProduct" after="cartMinicartCheckConfigProductOption"/> <waitForLoadingMaskToDisappear stepKey="waitForMinicartConfigProductloaded" after="cartMinicartClickConfigProduct"/> - <actionGroup ref="StorefrontCheckConfigurableProduct" stepKey="cartAssertMinicartConfigProductPage" after="waitForMinicartConfigProductloaded"> + <actionGroup ref="StorefrontCheckConfigurableProductActionGroup" stepKey="cartAssertMinicartConfigProductPage" after="waitForMinicartConfigProductloaded"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -389,7 +389,7 @@ <see userInput="$$createConfigProductAttributeOption2.option[store_labels][1][label]$$" selector="{{CheckoutCartProductSection.ProductOptionByNameAndAttribute($$createConfigProduct.name$$, $$createConfigProductAttribute.attribute[frontend_labels][0][label]$$)}}" stepKey="cartCheckConfigProductOption" after="cartCartAssertConfigProduct2ImageNotDefault"/> <click selector="{{CheckoutCartProductSection.ProductLinkByName($$createConfigProduct.name$$)}}" stepKey="cartClickCartConfigProduct" after="cartCheckConfigProductOption"/> <waitForLoadingMaskToDisappear stepKey="waitForCartConfigProductloaded" after="cartClickCartConfigProduct"/> - <actionGroup ref="StorefrontCheckConfigurableProduct" stepKey="cartAssertCartConfigProductPage" after="waitForCartConfigProductloaded"> + <actionGroup ref="StorefrontCheckConfigurableProductActionGroup" stepKey="cartAssertCartConfigProductPage" after="waitForCartConfigProductloaded"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -399,7 +399,7 @@ <!-- Add Configurable Product to comparison --> <comment userInput="Add Configurable Product to comparison" stepKey="commentAddConfigurableProductToComparison" after="compareAddSimpleProduct2ToCompare" /> - <actionGroup ref="StorefrontCheckCategoryConfigurableProduct" stepKey="compareAssertConfigProduct" after="commentAddConfigurableProductToComparison"> + <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="compareAssertConfigProduct" after="commentAddConfigurableProductToComparison"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml index 6f9ad93a56dc5..dd0673563838e 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml @@ -85,7 +85,7 @@ <!-- Check configurable product in category --> <comment userInput="Verify Configurable Product in category" stepKey="commentVerifyConfigurableProductInCategory" after="browseAssertSimpleProduct2ImageNotDefault" /> - <actionGroup ref="StorefrontCheckCategoryConfigurableProduct" stepKey="browseAssertCategoryConfigProduct" after="commentVerifyConfigurableProductInCategory"> + <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="browseAssertCategoryConfigProduct" after="commentVerifyConfigurableProductInCategory"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -98,7 +98,7 @@ <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="clickCategory2" after="commentViewConfigurableProduct"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createConfigProduct.name$$)}}" stepKey="browseClickCategoryConfigProductView" after="clickCategory2"/> <waitForLoadingMaskToDisappear stepKey="waitForConfigurableProductViewloaded" after="browseClickCategoryConfigProductView"/> - <actionGroup ref="StorefrontCheckConfigurableProduct" stepKey="browseAssertConfigProductPage" after="waitForConfigurableProductViewloaded"> + <actionGroup ref="StorefrontCheckConfigurableProductActionGroup" stepKey="browseAssertConfigProductPage" after="waitForConfigurableProductViewloaded"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -114,7 +114,7 @@ <argument name="category" value="$$createCategory$$"/> <argument name="productCount" value="3"/> </actionGroup> - <actionGroup ref="StorefrontCheckCategoryConfigurableProduct" stepKey="cartAssertConfigProduct" after="cartAssertCategory1ForConfigurableProduct"> + <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="cartAssertConfigProduct" after="cartAssertCategory1ForConfigurableProduct"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -123,7 +123,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$cartGrabConfigProductImageSrc" stepKey="cartAssertConfigProductImageNotDefault" after="cartGrabConfigProductImageSrc"/> <click selector="{{StorefrontCategoryProductSection.ProductAddToCartByName($$createConfigProduct.name$$)}}" stepKey="cartClickCategoryConfigProductAddToCart" after="cartAssertConfigProductImageNotDefault"/> <waitForElement selector="{{StorefrontMessagesSection.message('You need to choose options for your item.')}}" time="30" stepKey="cartWaitForConfigProductPageLoad" after="cartClickCategoryConfigProductAddToCart"/> - <actionGroup ref="StorefrontCheckConfigurableProduct" stepKey="cartAssertConfigProductPage" after="cartWaitForConfigProductPageLoad"> + <actionGroup ref="StorefrontCheckConfigurableProductActionGroup" stepKey="cartAssertConfigProductPage" after="cartWaitForConfigProductPageLoad"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -132,7 +132,7 @@ <assertNotRegExp expected="'/placeholder\/image\.jpg/'" actual="$cartGrabConfigProductPageImageSrc1" stepKey="cartAssertConfigProductPageImageNotDefault1" after="cartGrabConfigProductPageImageSrc1"/> <selectOption userInput="$$createConfigProductAttributeOption2.option[store_labels][1][label]$$" selector="{{StorefrontProductInfoMainSection.optionByAttributeId($$createConfigProductAttribute.attribute_id$$)}}" stepKey="cartConfigProductFillOption" after="cartAssertConfigProductPageImageNotDefault1"/> <waitForLoadingMaskToDisappear stepKey="waitForConfigurableProductOptionloaded" after="cartConfigProductFillOption"/> - <actionGroup ref="StorefrontCheckConfigurableProduct" stepKey="cartAssertConfigProductWithOptionPage" after="waitForConfigurableProductOptionloaded"> + <actionGroup ref="StorefrontCheckConfigurableProductActionGroup" stepKey="cartAssertConfigProductWithOptionPage" after="waitForConfigurableProductOptionloaded"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct2$$"/> </actionGroup> @@ -157,7 +157,7 @@ <see userInput="$$createConfigProductAttributeOption2.option[store_labels][1][label]$$" selector="{{StorefrontMinicartSection.productOptionByNameAndAttribute($$createConfigProduct.name$$, $$createConfigProductAttribute.attribute[frontend_labels][0][label]$$)}}" stepKey="cartMinicartCheckConfigProductOption" after="cartMinicartClickConfigProductDetails"/> <click selector="{{StorefrontMinicartSection.productLinkByName($$createConfigProduct.name$$)}}" stepKey="cartMinicartClickConfigProduct" after="cartMinicartCheckConfigProductOption"/> <waitForLoadingMaskToDisappear stepKey="waitForMinicartConfigProductloaded" after="cartMinicartClickConfigProduct"/> - <actionGroup ref="StorefrontCheckConfigurableProduct" stepKey="cartAssertMinicartConfigProductPage" after="waitForMinicartConfigProductloaded"> + <actionGroup ref="StorefrontCheckConfigurableProductActionGroup" stepKey="cartAssertMinicartConfigProductPage" after="waitForMinicartConfigProductloaded"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -180,7 +180,7 @@ <see userInput="$$createConfigProductAttributeOption2.option[store_labels][1][label]$$" selector="{{CheckoutCartProductSection.ProductOptionByNameAndAttribute($$createConfigProduct.name$$, $$createConfigProductAttribute.attribute[frontend_labels][0][label]$$)}}" stepKey="cartCheckConfigProductOption" after="cartCartAssertConfigProduct2ImageNotDefault"/> <click selector="{{CheckoutCartProductSection.ProductLinkByName($$createConfigProduct.name$$)}}" stepKey="cartClickCartConfigProduct" after="cartCheckConfigProductOption"/> <waitForLoadingMaskToDisappear stepKey="waitForCartConfigProductloaded" after="cartClickCartConfigProduct"/> - <actionGroup ref="StorefrontCheckConfigurableProduct" stepKey="cartAssertCartConfigProductPage" after="waitForCartConfigProductloaded"> + <actionGroup ref="StorefrontCheckConfigurableProductActionGroup" stepKey="cartAssertCartConfigProductPage" after="waitForCartConfigProductloaded"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -190,7 +190,7 @@ <!-- Add Configurable Product to comparison --> <comment userInput="Add Configurable Product to comparison" stepKey="commentAddConfigurableProductToComparison" after="compareAddSimpleProduct2ToCompare" /> - <actionGroup ref="StorefrontCheckCategoryConfigurableProduct" stepKey="compareAssertConfigProduct" after="commentAddConfigurableProductToComparison"> + <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="compareAssertConfigProduct" after="commentAddConfigurableProductToComparison"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest.xml index 2f5ee036b1420..632e066456c4c 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest.xml @@ -24,7 +24,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!-- Create a configurable product via the UI --> - <actionGroup ref="createConfigurableProduct" stepKey="createProduct"> + <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> <argument name="product" value="_defaultProduct"/> <argument name="category" value="$$createCategory$$"/> </actionGroup> @@ -69,7 +69,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!-- Create a configurable product via the UI --> - <actionGroup ref="createConfigurableProduct" stepKey="createProduct"> + <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> <argument name="product" value="_defaultProduct"/> <argument name="category" value="$$createCategory$$"/> </actionGroup> @@ -114,7 +114,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!-- Create a configurable product via the UI --> - <actionGroup ref="createConfigurableProduct" stepKey="createProduct"> + <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> <argument name="product" value="_defaultProduct"/> <argument name="category" value="$$createCategory$$"/> </actionGroup> @@ -156,7 +156,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!-- Create a configurable product via the UI --> - <actionGroup ref="createConfigurableProduct" stepKey="createProduct"> + <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> <argument name="product" value="_defaultProduct"/> <argument name="category" value="$$createCategory$$"/> </actionGroup> @@ -269,7 +269,7 @@ <argument name="rowIndex" value="3"/> <argument name="quantity" value="1"/> </actionGroup> - <actionGroup ref="saveConfigurableProduct" stepKey="saveConfigurableProduct"> + <actionGroup ref="SaveConfigurableProductActionGroup" stepKey="saveConfigurableProduct"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest.xml index 65e1d3a74f060..5bebe900ed30d 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest.xml @@ -23,7 +23,7 @@ <createData entity="ApiCategory" stepKey="createCategory"/> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> <!-- Create a configurable product via the UI --> - <actionGroup ref="createConfigurableProduct" stepKey="createProduct"> + <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> <argument name="product" value="_defaultProduct"/> <argument name="category" value="$$createCategory$$"/> </actionGroup> @@ -65,7 +65,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> <!-- Create a configurable product via the UI --> - <actionGroup ref="createConfigurableProduct" stepKey="createProduct"> + <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> <argument name="product" value="_defaultProduct"/> <argument name="category" value="$$createCategory$$"/> </actionGroup> @@ -103,7 +103,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> <!-- Create a configurable product via the UI --> - <actionGroup ref="createConfigurableProduct" stepKey="createProduct"> + <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> <argument name="product" value="_defaultProduct"/> <argument name="category" value="$$createCategory$$"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductWithFileCustomOptionTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductWithFileCustomOptionTest.xml index 4c955f3385643..68a3dc8d437a3 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductWithFileCustomOptionTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductWithFileCustomOptionTest.xml @@ -31,14 +31,14 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!-- Create a configurable product via the UI --> - <actionGroup ref="createConfigurableProduct" stepKey="createProduct"> + <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> <argument name="product" value="BaseConfigurableProduct"/> <argument name="category" value="$$createCategory$$"/> </actionGroup> <!--Add custom option to configurable product--> <actionGroup ref="AddProductCustomOptionFile" stepKey="addCustomOptionToProduct"/> <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct"/> - + <!--Go to storefront--> <amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToHomePage"/> <waitForPageLoad stepKey="waitForHomePageLoad"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml index 749d1bee0661a..af612baed2052 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml @@ -64,7 +64,7 @@ <waitForPageLoad stepKey="waitForProductPageReload"/> <click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickOnCreateConfigurations"/> <waitForPageLoad stepKey="waitForFilters"/> - <actionGroup ref="createOptionsForAttribute" stepKey="createOptions"> + <actionGroup ref="CreateOptionsForAttributeActionGroup" stepKey="createOptions"> <argument name="attributeName" value="{{colorProductAttribute.default_label}}"/> <argument name="firstOptionName" value="{{colorConfigurableProductAttribute1.name}}"/> <argument name="secondOptionName" value="{{colorConfigurableProductAttribute2.name}}"/> @@ -73,36 +73,36 @@ <waitForPageLoad stepKey="waitForBulkImagesPriceQuantityPageLoad"/> <!--Add images to configurable product attribute options--> <comment userInput="Add images to configurable product attribute options" stepKey="commentAddImages"/> - <actionGroup ref="addUniqueImageToConfigurableProductOption" stepKey="addImageToConfigurableProductOptionOne"> + <actionGroup ref="AddUniqueImageToConfigurableProductOptionActionGroup" stepKey="addImageToConfigurableProductOptionOne"> <argument name="image" value="ImageUpload"/> <argument name="frontend_label" value="{{colorProductAttribute.default_label}}"/> <argument name="label" value="{{colorConfigurableProductAttribute1.name}}"/> </actionGroup> - <actionGroup ref="addUniqueImageToConfigurableProductOption" stepKey="addImageToConfigurableProductOptionTwo"> + <actionGroup ref="AddUniqueImageToConfigurableProductOptionActionGroup" stepKey="addImageToConfigurableProductOptionTwo"> <argument name="image" value="ImageUpload_1"/> <argument name="frontend_label" value="{{colorProductAttribute.default_label}}"/> <argument name="label" value="{{colorConfigurableProductAttribute2.name}}"/> </actionGroup> <!--Add price to product attribute options--> <comment userInput="Add price to product attribute options" stepKey="commentAddPrice"/> - <actionGroup ref="addUniquePriceToConfigurableProductOption" stepKey="addPriceToConfigurableProductOptionFirst"> + <actionGroup ref="AddUniquePriceToConfigurableProductOptionActionGroup" stepKey="addPriceToConfigurableProductOptionFirst"> <argument name="frontend_label" value="{{colorProductAttribute.default_label}}"/> <argument name="label" value="{{colorConfigurableProductAttribute1.name}}"/> <argument name="price" value="{{virtualProductWithRequiredFields.price}}"/> </actionGroup> - <actionGroup ref="addUniquePriceToConfigurableProductOption" stepKey="addPriceToConfigurableProductOptionSecond"> + <actionGroup ref="AddUniquePriceToConfigurableProductOptionActionGroup" stepKey="addPriceToConfigurableProductOptionSecond"> <argument name="frontend_label" value="{{colorProductAttribute.default_label}}"/> <argument name="label" value="{{colorConfigurableProductAttribute2.name}}"/> <argument name="price" value="{{virtualProductWithRequiredFields.price}}"/> </actionGroup> <!--Add quantity to product attribute options--> <comment userInput="Add quantity to product attribute options" stepKey="commentAddQuantity"/> - <actionGroup ref="addUniqueQuantityToConfigurableProductOption" stepKey="addUniqueQtyForFirstOption"> + <actionGroup ref="AddUniqueQuantityToConfigurableProductOptionActionGroup" stepKey="addUniqueQtyForFirstOption"> <argument name="frontend_label" value="{{colorProductAttribute.default_label}}"/> <argument name="label" value="{{colorConfigurableProductAttribute1.name}}"/> <argument name="quantity" value="{{virtualProductBigQty.quantity}}"/> </actionGroup> - <actionGroup ref="addUniqueQuantityToConfigurableProductOption" stepKey="addUniqueQtyForSecondOption"> + <actionGroup ref="AddUniqueQuantityToConfigurableProductOptionActionGroup" stepKey="addUniqueQtyForSecondOption"> <argument name="frontend_label" value="{{colorProductAttribute.default_label}}"/> <argument name="label" value="{{colorConfigurableProductAttribute2.name}}"/> <argument name="quantity" value="{{virtualProductBigQty.quantity}}"/> @@ -146,39 +146,39 @@ <waitForElementVisible selector="{{AdminGridSelectRows.multicheckDropdown}}" stepKey="waitForCreateConfigurationsPageLoad"/> <click selector="{{AdminGridSelectRows.multicheckDropdown}}" stepKey="openMulticheckDropdown"/> <click selector="{{AdminGridSelectRows.multicheckOption('Deselect All')}}" stepKey="DeselectAllAttributes"/> - <actionGroup ref="createOptionsForAttribute" stepKey="createOptionsForDuplicatedProduct"> + <actionGroup ref="CreateOptionsForAttributeActionGroup" stepKey="createOptionsForDuplicatedProduct"> <argument name="attributeName" value="{{productAttributeColor.default_label}}"/> <argument name="firstOptionName" value="{{colorConfigurableProductAttribute1.name}}"/> <argument name="secondOptionName" value="{{colorConfigurableProductAttribute2.name}}"/> </actionGroup> <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnFirstNextButtonForDuplicatedProduct"/> <waitForPageLoad stepKey="waitForBulkImagesPriceQuantityPageLoadForDuplicatedProduct"/> - <actionGroup ref="addUniqueImageToConfigurableProductOption" stepKey="addImgConfigProductOption1DuplicatedProduct"> + <actionGroup ref="AddUniqueImageToConfigurableProductOptionActionGroup" stepKey="addImgConfigProductOption1DuplicatedProduct"> <argument name="image" value="MagentoLogo"/> <argument name="frontend_label" value="{{productAttributeColor.default_label}}"/> <argument name="label" value="{{colorConfigurableProductAttribute1.name}}"/> </actionGroup> - <actionGroup ref="addUniqueImageToConfigurableProductOption" stepKey="addImgConfigProductOption2DuplicatedProduct"> + <actionGroup ref="AddUniqueImageToConfigurableProductOptionActionGroup" stepKey="addImgConfigProductOption2DuplicatedProduct"> <argument name="image" value="MagentoLogo"/> <argument name="frontend_label" value="{{productAttributeColor.default_label}}"/> <argument name="label" value="{{colorConfigurableProductAttribute2.name}}"/> </actionGroup> - <actionGroup ref="addUniquePriceToConfigurableProductOption" stepKey="addPriceConfigProductOption1DuplicatedProduct"> + <actionGroup ref="AddUniquePriceToConfigurableProductOptionActionGroup" stepKey="addPriceConfigProductOption1DuplicatedProduct"> <argument name="frontend_label" value="{{productAttributeColor.default_label}}"/> <argument name="label" value="{{colorConfigurableProductAttribute1.name}}"/> <argument name="price" value="{{virtualProductWithRequiredFields.price}}"/> </actionGroup> - <actionGroup ref="addUniquePriceToConfigurableProductOption" stepKey="addPriceConfigProductOption2DuplicatedProduct"> + <actionGroup ref="AddUniquePriceToConfigurableProductOptionActionGroup" stepKey="addPriceConfigProductOption2DuplicatedProduct"> <argument name="frontend_label" value="{{productAttributeColor.default_label}}"/> <argument name="label" value="{{colorConfigurableProductAttribute2.name}}"/> <argument name="price" value="{{virtualProductWithRequiredFields.price}}"/> </actionGroup> - <actionGroup ref="addUniqueQuantityToConfigurableProductOption" stepKey="addUniqueQtyOption1DuplicatedProduct"> + <actionGroup ref="AddUniqueQuantityToConfigurableProductOptionActionGroup" stepKey="addUniqueQtyOption1DuplicatedProduct"> <argument name="frontend_label" value="{{productAttributeColor.default_label}}"/> <argument name="label" value="{{colorConfigurableProductAttribute1.name}}"/> <argument name="quantity" value="{{virtualProductBigQty.quantity}}"/> </actionGroup> - <actionGroup ref="addUniqueQuantityToConfigurableProductOption" stepKey="addUniqueQtyOption2DuplicatedProduct"> + <actionGroup ref="AddUniqueQuantityToConfigurableProductOptionActionGroup" stepKey="addUniqueQtyOption2DuplicatedProduct"> <argument name="frontend_label" value="{{productAttributeColor.default_label}}"/> <argument name="label" value="{{colorConfigurableProductAttribute2.name}}"/> <argument name="quantity" value="{{virtualProductBigQty.quantity}}"/> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml index f94314fe94806..a342f30b66598 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml @@ -89,7 +89,7 @@ <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <!-- Click "Create Configurations" button, select created product attribute using the same Quantity for all products. Click "Generate products" button --> - <actionGroup ref="generateConfigurationsByAttributeCode" stepKey="addAttributeToProduct"> + <actionGroup ref="GenerateConfigurationsByAttributeCodeActionGroup" stepKey="addAttributeToProduct"> <argument name="attributeCode" value="{{VisualSwatchProductAttribute.attribute_code}}"/> </actionGroup> <!-- Using this action to concatenate 2 strings to have unique identifier for grid --> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontConfigurableProductSwatchMinimumPriceTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontConfigurableProductSwatchMinimumPriceTest.xml index 0a98e7a721c17..c65a24e2c724f 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontConfigurableProductSwatchMinimumPriceTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontConfigurableProductSwatchMinimumPriceTest.xml @@ -60,59 +60,59 @@ <argument name="option3" value="Large"/> </actionGroup> <!--Create configurable product with two attributes: Color and Size--> - <actionGroup ref="createConfigurableProductWithTwoAttributes" stepKey="createProduct"> + <actionGroup ref="CreateConfigurableProductWithTwoAttributesActionGroup" stepKey="createProduct"> <argument name="product" value="_defaultProduct"/> <argument name="category" value="$$createCategory$$"/> <argument name="attribute1" value="ProductColorAttribute"/> <argument name="attribute2" value="ProductSizeAttribute"/> </actionGroup> <!--Set Black-Small product price to 10--> - <actionGroup ref="changeConfigurableProductChildProductPrice" stepKey="changeBlackSmallPrice"> + <actionGroup ref="ChangeConfigurableProductChildProductPriceActionGroup" stepKey="changeBlackSmallPrice"> <argument name="productAttributes" value="Color: Black, Size: Small"/> <argument name="productPrice" value="10"/> </actionGroup> <!--Set Black-Medium product price to 11--> - <actionGroup ref="changeConfigurableProductChildProductPrice" stepKey="changeBlackMediumPrice"> + <actionGroup ref="ChangeConfigurableProductChildProductPriceActionGroup" stepKey="changeBlackMediumPrice"> <argument name="productAttributes" value="Color: Black, Size: Medium"/> <argument name="productPrice" value="11"/> </actionGroup> <!--Set Black-Large product price to 12--> - <actionGroup ref="changeConfigurableProductChildProductPrice" stepKey="changeBlackLargePrice"> + <actionGroup ref="ChangeConfigurableProductChildProductPriceActionGroup" stepKey="changeBlackLargePrice"> <argument name="productAttributes" value="Color: Black, Size: Large"/> <argument name="productPrice" value="12"/> </actionGroup> <!--Set White-Small product price to 14--> - <actionGroup ref="changeConfigurableProductChildProductPrice" stepKey="changeWhiteSmallPrice"> + <actionGroup ref="ChangeConfigurableProductChildProductPriceActionGroup" stepKey="changeWhiteSmallPrice"> <argument name="productAttributes" value="Color: White, Size: Small"/> <argument name="productPrice" value="14"/> </actionGroup> <!--Set White-Medium product price to 13--> - <actionGroup ref="changeConfigurableProductChildProductPrice" stepKey="changeWhiteMediumPrice"> + <actionGroup ref="ChangeConfigurableProductChildProductPriceActionGroup" stepKey="changeWhiteMediumPrice"> <argument name="productAttributes" value="Color: White, Size: Medium"/> <argument name="productPrice" value="13"/> </actionGroup> <!--Set White-Large product price to 15--> - <actionGroup ref="changeConfigurableProductChildProductPrice" stepKey="changeWhiteLargePrice"> + <actionGroup ref="ChangeConfigurableProductChildProductPriceActionGroup" stepKey="changeWhiteLargePrice"> <argument name="productAttributes" value="Color: White, Size: Large"/> <argument name="productPrice" value="15"/> </actionGroup> <!--Set Blue-Small product price to 18--> - <actionGroup ref="changeConfigurableProductChildProductPrice" stepKey="changeBlueSmallPrice"> + <actionGroup ref="ChangeConfigurableProductChildProductPriceActionGroup" stepKey="changeBlueSmallPrice"> <argument name="productAttributes" value="Color: Blue, Size: Small"/> <argument name="productPrice" value="18"/> </actionGroup> <!--Set Blue-Medium product price to 17--> - <actionGroup ref="changeConfigurableProductChildProductPrice" stepKey="changeBlueMediumPrice"> + <actionGroup ref="ChangeConfigurableProductChildProductPriceActionGroup" stepKey="changeBlueMediumPrice"> <argument name="productAttributes" value="Color: Blue, Size: Medium"/> <argument name="productPrice" value="17"/> </actionGroup> <!--Set Blue-Large product price to 16--> - <actionGroup ref="changeConfigurableProductChildProductPrice" stepKey="changeBlueLargePrice"> + <actionGroup ref="ChangeConfigurableProductChildProductPriceActionGroup" stepKey="changeBlueLargePrice"> <argument name="productAttributes" value="Color: Blue, Size: Large"/> <argument name="productPrice" value="16"/> </actionGroup> <!--Save configurable product--> - <actionGroup ref="saveConfigurableProduct" stepKey="saveProduct"> + <actionGroup ref="SaveConfigurableProductActionGroup" stepKey="saveProduct"> <argument name="product" value="_defaultProduct"/> </actionGroup> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByImageSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByImageSwatchTest.xml index c9602ddcd127c..e9f5461435449 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByImageSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByImageSwatchTest.xml @@ -98,7 +98,7 @@ <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createCategory.name$$]" stepKey="fillCategory"/> <!-- Create configurations based off the visual swatch we created earlier --> - <actionGroup ref="createConfigurationsForAttributeWithImages" stepKey="createConfigurations"> + <actionGroup ref="CreateConfigurationsForAttributeWithImagesActionGroup" stepKey="createConfigurations"> <argument name="attributeCode" value="{{ProductAttributeFrontendLabel.label}}"/> <argument name="image" value="TestImageAdobe"/> </actionGroup> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByTextSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByTextSwatchTest.xml index 7bf63d25417e3..f3304e67e5534 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByTextSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByTextSwatchTest.xml @@ -78,7 +78,7 @@ <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createCategory.name$$]" stepKey="fillCategory"/> <!-- Create configurations based off the text swatch we created earlier --> - <actionGroup ref="createConfigurationsForAttribute" stepKey="createConfigurations"> + <actionGroup ref="CreateConfigurationsForAttributeActionGroup" stepKey="createConfigurations"> <argument name="attributeCode" value="{{ProductAttributeFrontendLabel.label}}"/> </actionGroup> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByVisualSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByVisualSwatchTest.xml index fd38c48919416..b4028674ee5bd 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByVisualSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByVisualSwatchTest.xml @@ -90,7 +90,7 @@ <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createCategory.name$$]" stepKey="fillCategory"/> <!-- Create configurations based off the visual watch we created earlier --> - <actionGroup ref="createConfigurationsForAttribute" stepKey="createConfigurations"> + <actionGroup ref="CreateConfigurationsForAttributeActionGroup" stepKey="createConfigurations"> <argument name="attributeCode" value="{{ProductAttributeFrontendLabel.label}}"/> </actionGroup> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontImageColorWhenFilterByColorFilterTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontImageColorWhenFilterByColorFilterTest.xml index 2928011662864..b46f5753152b6 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontImageColorWhenFilterByColorFilterTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontImageColorWhenFilterByColorFilterTest.xml @@ -54,12 +54,12 @@ <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton1"/> <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton2"/> <!--Add images to product attribute options--> - <actionGroup ref="addUniqueImageToConfigurableProductOption" stepKey="addImageToConfigurableProductOptionOne"> + <actionGroup ref="AddUniqueImageToConfigurableProductOptionActionGroup" stepKey="addImageToConfigurableProductOptionOne"> <argument name="image" value="MagentoLogo"/> <argument name="frontend_label" value="{{visualSwatchAttribute.default_label}}"/> <argument name="label" value="{{visualSwatchOption1.default_label}}"/> </actionGroup> - <actionGroup ref="addUniqueImageToConfigurableProductOption" stepKey="addImageToConfigurableProductOptionTwo"> + <actionGroup ref="AddUniqueImageToConfigurableProductOptionActionGroup" stepKey="addImageToConfigurableProductOptionTwo"> <argument name="image" value="TestImageNew"/> <argument name="frontend_label" value="{{visualSwatchAttribute.default_label}}"/> <argument name="label" value="{{visualSwatchOption2.default_label}}"/> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSeeProductImagesMatchingProductSwatchesTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSeeProductImagesMatchingProductSwatchesTest.xml index 1717b424e4597..bf432b98b3d3a 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSeeProductImagesMatchingProductSwatchesTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSeeProductImagesMatchingProductSwatchesTest.xml @@ -76,23 +76,23 @@ </actionGroup> <!-- Create configurations based off the visual swatch we created earlier --> - <actionGroup ref="StartCreateConfigurationsForAttribute" stepKey="createConfigurations"> + <actionGroup ref="StartCreateConfigurationsForAttributeActionGroup" stepKey="createConfigurations"> <argument name="attributeCode" value="{{VisualSwatchProductAttribute.attribute_code}}"/> </actionGroup> <!--Add images to configurable product attribute options--> - <actionGroup ref="addUniqueImageToConfigurableProductOption" stepKey="addImageToConfigurableProductOptionOne"> + <actionGroup ref="AddUniqueImageToConfigurableProductOptionActionGroup" stepKey="addImageToConfigurableProductOptionOne"> <argument name="image" value="TestImageAdobe"/> <argument name="frontend_label" value="{{VisualSwatchProductAttribute.attribute_code}}"/> <argument name="label" value="{{visualSwatchOption1.default_label}}"/> </actionGroup> - <actionGroup ref="addUniqueImageToConfigurableProductOption" stepKey="addImageToConfigurableProductOptionTwo"> + <actionGroup ref="AddUniqueImageToConfigurableProductOptionActionGroup" stepKey="addImageToConfigurableProductOptionTwo"> <argument name="image" value="ImageUpload3"/> <argument name="frontend_label" value="{{VisualSwatchProductAttribute.attribute_code}}"/> <argument name="label" value="{{visualSwatchOption2.default_label}}"/> </actionGroup> - <actionGroup ref="GenerateAndSaveConfiguredProductAfterSettingOptions" stepKey="saveProductForm"/> + <actionGroup ref="GenerateAndSaveConfiguredProductAfterSettingOptionsActionGroup" stepKey="saveProductForm"/> <!-- Go to the category page --> <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="goToProductPage"/> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/ConfProdAddToCartWishListWithUnselectedAttrTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/ConfProdAddToCartWishListWithUnselectedAttrTest.xml index 4e6a062c7993d..317e9e9bab3cd 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/ConfProdAddToCartWishListWithUnselectedAttrTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/ConfProdAddToCartWishListWithUnselectedAttrTest.xml @@ -23,7 +23,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> <createData entity="ApiCategory" stepKey="createCategory"/> <!--Create Configurable product--> - <actionGroup ref="createConfigurableProduct" stepKey="createProduct"> + <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> <argument name="product" value="_defaultProduct"/> <argument name="category" value="$$createCategory$$"/> </actionGroup> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/ConfigurableProductChildImageShouldBeShownOnWishListTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/ConfigurableProductChildImageShouldBeShownOnWishListTest.xml index 0489ec750b7e0..bb4870d294b0c 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/ConfigurableProductChildImageShouldBeShownOnWishListTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/ConfigurableProductChildImageShouldBeShownOnWishListTest.xml @@ -23,7 +23,7 @@ <createData entity="ApiCategory" stepKey="createCategory"/> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> - <actionGroup ref="createConfigurableProduct" stepKey="createProduct"> + <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> <argument name="product" value="_defaultProduct"/> <argument name="category" value="$$createCategory$$"/> </actionGroup> diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductCatalogSearch/Test/EndToEndB2CGuestUserTest.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductCatalogSearch/Test/EndToEndB2CGuestUserTest.xml index cac9d0c3cb55f..d38bf90a3a16d 100644 --- a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductCatalogSearch/Test/EndToEndB2CGuestUserTest.xml +++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductCatalogSearch/Test/EndToEndB2CGuestUserTest.xml @@ -11,7 +11,7 @@ <test name="EndToEndB2CGuestUserTest"> <!-- Search configurable product --> <comment userInput="Search configurable product" stepKey="commentSearchConfigurableProduct" after="searchAssertSimpleProduct2ImageNotDefault" /> - <actionGroup ref="StorefrontCheckCategoryConfigurableProduct" stepKey="searchAssertFilterCategoryConfigProduct" after="commentSearchConfigurableProduct"> + <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="searchAssertFilterCategoryConfigProduct" after="commentSearchConfigurableProduct"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -19,7 +19,7 @@ <grabAttributeFrom selector="{{StorefrontCategoryProductSection.ProductImageByName($$createConfigProduct.name$$)}}" userInput="src" stepKey="searchGrabConfigProductImageSrc" after="searchAssertFilterCategoryConfigProduct"/> <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$searchGrabConfigProductImageSrc" stepKey="searchAssertConfigProductImageNotDefault" after="searchGrabConfigProductImageSrc"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createConfigProduct.name$$)}}" stepKey="searchClickConfigProductView" after="searchAssertConfigProductImageNotDefault"/> - <actionGroup ref="StorefrontCheckConfigurableProduct" stepKey="searchAssertConfigProductPage" after="searchClickConfigProductView"> + <actionGroup ref="StorefrontCheckConfigurableProductActionGroup" stepKey="searchAssertConfigProductPage" after="searchClickConfigProductView"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -30,7 +30,7 @@ <test name="EndToEndB2CGuestUserMysqlTest"> <!-- Search configurable product --> <comment userInput="Search configurable product" stepKey="commentSearchConfigurableProduct" after="searchAssertSimpleProduct2ImageNotDefault" /> - <actionGroup ref="StorefrontCheckCategoryConfigurableProduct" stepKey="searchAssertFilterCategoryConfigProduct" after="commentSearchConfigurableProduct"> + <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="searchAssertFilterCategoryConfigProduct" after="commentSearchConfigurableProduct"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -38,7 +38,7 @@ <grabAttributeFrom selector="{{StorefrontCategoryProductSection.ProductImageByName($$createConfigProduct.name$$)}}" userInput="src" stepKey="searchGrabConfigProductImageSrc" after="searchAssertFilterCategoryConfigProduct"/> <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$searchGrabConfigProductImageSrc" stepKey="searchAssertConfigProductImageNotDefault" after="searchGrabConfigProductImageSrc"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createConfigProduct.name$$)}}" stepKey="searchClickConfigProductView" after="searchAssertConfigProductImageNotDefault"/> - <actionGroup ref="StorefrontCheckConfigurableProduct" stepKey="searchAssertConfigProductPage" after="searchClickConfigProductView"> + <actionGroup ref="StorefrontCheckConfigurableProductActionGroup" stepKey="searchAssertConfigProductPage" after="searchClickConfigProductView"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductCatalogSearch/Test/EndToEndB2CLoggedInUserTest.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductCatalogSearch/Test/EndToEndB2CLoggedInUserTest.xml index 9fe70c8b4dd3b..f616e46d6f692 100644 --- a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductCatalogSearch/Test/EndToEndB2CLoggedInUserTest.xml +++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductCatalogSearch/Test/EndToEndB2CLoggedInUserTest.xml @@ -11,7 +11,7 @@ <test name="EndToEndB2CLoggedInUserTest"> <!-- Search configurable product --> <comment userInput="Search configurable product" stepKey="commentSearchConfigurableProduct" after="searchAssertSimpleProduct2ImageNotDefault" /> - <actionGroup ref="StorefrontCheckCategoryConfigurableProduct" stepKey="searchAssertFilterCategoryConfigProduct" after="commentSearchConfigurableProduct"> + <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="searchAssertFilterCategoryConfigProduct" after="commentSearchConfigurableProduct"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -19,7 +19,7 @@ <grabAttributeFrom selector="{{StorefrontCategoryProductSection.ProductImageByName($$createConfigProduct.name$$)}}" userInput="src" stepKey="searchGrabConfigProductImageSrc" after="searchAssertFilterCategoryConfigProduct"/> <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$searchGrabConfigProductImageSrc" stepKey="searchAssertConfigProductImageNotDefault" after="searchGrabConfigProductImageSrc"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createConfigProduct.name$$)}}" stepKey="searchClickConfigProductView" after="searchAssertConfigProductImageNotDefault"/> - <actionGroup ref="StorefrontCheckConfigurableProduct" stepKey="searchAssertConfigProductPage" after="searchClickConfigProductView"> + <actionGroup ref="StorefrontCheckConfigurableProductActionGroup" stepKey="searchAssertConfigProductPage" after="searchClickConfigProductView"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> From 363ecc0c8bc61cbf41ba8f0228c30380571e10e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Fri, 29 Nov 2019 00:22:14 +0100 Subject: [PATCH 139/586] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- .../StorefrontBundleProductDetailsTest.xml | 2 +- .../AdminAddImageToWYSIWYGCatalogTest.xml | 4 +- .../AdminAddImageToWYSIWYGProductTest.xml | 4 +- ...reateAndEditVirtualProductSettingsTest.xml | 4 +- ...dminEditTextEditorProductAttributeTest.xml | 4 +- .../AdminRemoveImageAffectsAllScopesTest.xml | 2 +- .../AdminSimpleProductSetEditContentTest.xml | 2 +- .../Mftf/Test/AdminSortingByWebsitesTest.xml | 4 +- ...ductWithCustomOptionsSecondWebsiteTest.xml | 6 +- ...rifyDefaultWYSIWYGToolbarOnProductTest.xml | 8 +- ...yTinyMCEv4IsNativeWYSIWYGOnCatalogTest.xml | 4 +- ...yTinyMCEv4IsNativeWYSIWYGOnProductTest.xml | 4 +- .../CatalogProductListWidgetOperatorsTest.xml | 4 +- .../CatalogProductListWidgetOrderTest.xml | 6 +- .../Test/CheckoutSpecificDestinationsTest.xml | 8 +- ...frontCustomerCheckoutWithoutRegionTest.xml | 4 +- .../Test/AdminAddImageToWYSIWYGBlockTest.xml | 4 +- .../Test/AdminAddImageToWYSIWYGCMSTest.xml | 4 +- .../AdminAddVariableToWYSIWYGBlockTest.xml | 4 +- .../Test/AdminAddVariableToWYSIWYGCMSTest.xml | 4 +- .../Test/AdminAddWidgetToWYSIWYGBlockTest.xml | 4 +- ...WidgetToWYSIWYGWithCMSPageLinkTypeTest.xml | 4 +- ...getToWYSIWYGWithCMSStaticBlockTypeTest.xml | 4 +- ...WYSIWYGWithCatalogCategoryLinkTypeTest.xml | 4 +- ...oWYSIWYGWithCatalogProductLinkTypeTest.xml | 4 +- ...oWYSIWYGWithCatalogProductListTypeTest.xml | 4 +- ...YGWithRecentlyComparedProductsTypeTest.xml | 4 +- ...IWYGWithRecentlyViewedProductsTypeTest.xml | 4 +- .../Mftf/Test/AdminCreateCmsBlockTest.xml | 2 +- .../Test/Mftf/Test/AdminCreateCmsPageTest.xml | 4 +- ...CheckOrderOfProdsInWidgetOnCMSPageTest.xml | 4 +- ...ifyTinyMCEv4IsNativeWYSIWYGOnBlockTest.xml | 4 +- ...yTinyMCEv4IsNativeWYSIWYGOnCMSPageTest.xml | 4 +- ...lasticSearchAsSearchEngineActionGroup.xml} | 20 +---- .../ConfigAdminAccountSharingActionGroup.xml | 16 ---- .../ConfigSalesTaxClassActionGroup.xml | 78 ------------------- .../ActionGroup/ConfigWYSIWYGActionGroup.xml | 76 ------------------ .../DisableAdminAccountSharingActionGroup.xml | 18 +++++ ...ableTaxApplyOnOriginalPriceActionGroup.xml | 29 +++++++ .../DisabledWYSIWYGActionGroup.xml | 18 +++++ .../EnableAdminAccountSharingActionGroup.xml | 18 +++++ .../EnableWebUrlOptionsActionGroup.xml | 25 ++++++ .../ActionGroup/EnabledWYSIWYGActionGroup.xml | 18 +++++ .../EnabledWYSIWYGEditorActionGroup.xml | 26 +++++++ .../GeneralConfigurationActionGroup.xml | 72 ----------------- ...eToConfigurationGeneralPageActionGroup.xml | 19 +++++ ...gateToDefaultLayoutsSettingActionGroup.xml | 21 +++++ ...etSearchEngineConfigurationActionGroup.xml | 26 +++++++ .../ResetTaxClassForShippingActionGroup.xml | 25 ++++++ ....xml => ResetWebUrlOptionsActionGroup.xml} | 19 +---- ...CountriesWithRequiredRegionActionGroup.xml | 27 +++++++ ...electTopDestinationsCountryActionGroup.xml | 23 ++++++ .../SetTaxApplyOnSettingActionGroup.xml | 29 +++++++ .../SetTaxClassForShippingActionGroup.xml | 25 ++++++ .../SwitchToTinyMCE3ActionGroup.xml | 26 +++++++ ...electTopDestinationsCountryActionGroup.xml | 23 ++++++ ...URLForMediaContentInWYSIWYGActionGroup.xml | 28 +++++++ ...bleProductPriceAdditionalStoreViewTest.xml | 6 +- ...CountriesRestrictionApplyOnBackendTest.xml | 4 +- ...oductQuickSearchUsingElasticSearchTest.xml | 6 +- .../AdminAddImageToWYSIWYGNewsletterTest.xml | 4 +- ...dminAddVariableToWYSIWYGNewsletterTest.xml | 4 +- .../AdminAddWidgetToWYSIWYGNewsletterTest.xml | 4 +- ...erifySubscribedNewsletterDisplayedTest.xml | 4 +- ...nyMCEv4IsNativeWYSIWYGOnNewsletterTest.xml | 4 +- ...editMemoTotalAfterShippingDiscountTest.xml | 4 +- .../AdminTaxCalcWithApplyTaxOnSettingTest.xml | 8 +- .../Test/AdminSwitchWYSIWYGOptionsTest.xml | 4 +- .../Mftf/Test/NewProductsListWidgetTest.xml | 4 +- 69 files changed, 524 insertions(+), 373 deletions(-) rename app/code/Magento/Config/Test/Mftf/ActionGroup/{ConfigAdminCatalogSearchActionGroup.xml => ChooseElasticSearchAsSearchEngineActionGroup.xml} (56%) delete mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigSalesTaxClassActionGroup.xml delete mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigWYSIWYGActionGroup.xml create mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/DisableAdminAccountSharingActionGroup.xml create mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/DisableTaxApplyOnOriginalPriceActionGroup.xml create mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/DisabledWYSIWYGActionGroup.xml create mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/EnableAdminAccountSharingActionGroup.xml create mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/EnableWebUrlOptionsActionGroup.xml create mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/EnabledWYSIWYGActionGroup.xml create mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/EnabledWYSIWYGEditorActionGroup.xml delete mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/GeneralConfigurationActionGroup.xml create mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/NavigateToConfigurationGeneralPageActionGroup.xml create mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/NavigateToDefaultLayoutsSettingActionGroup.xml create mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/ResetSearchEngineConfigurationActionGroup.xml create mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/ResetTaxClassForShippingActionGroup.xml rename app/code/Magento/Config/Test/Mftf/ActionGroup/{ConfigWebUrlOptionsActionGroup.xml => ResetWebUrlOptionsActionGroup.xml} (56%) create mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/SelectCountriesWithRequiredRegionActionGroup.xml create mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/SelectTopDestinationsCountryActionGroup.xml create mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/SetTaxApplyOnSettingActionGroup.xml create mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/SetTaxClassForShippingActionGroup.xml create mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/SwitchToTinyMCE3ActionGroup.xml create mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/UnSelectTopDestinationsCountryActionGroup.xml create mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/UseStaticURLForMediaContentInWYSIWYGActionGroup.xml diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml index d7394b2dbf32e..c1414b4c96230 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml @@ -26,7 +26,7 @@ <!-- Admin Login--> <actionGroup stepKey="loginToAdminPanel" ref="LoginAsAdmin"/> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> </before> <after> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGCatalogTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGCatalogTest.xml index c36c29ce594d0..a59562717d688 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGCatalogTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGCatalogTest.xml @@ -10,7 +10,7 @@ <test name="AdminAddImageToWYSIWYGCatalogTest"> <before> <actionGroup ref="LoginActionGroup" stepKey="login"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <annotations> @@ -54,7 +54,7 @@ <actionGroup ref="DeleteCategory" stepKey="DeleteCategory"> <argument name="categoryEntity" value="SimpleSubCategory"/> </actionGroup> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGProductTest.xml index 4044490c92334..450f21b7afd99 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGProductTest.xml @@ -19,11 +19,11 @@ </annotations> <before> <actionGroup ref="LoginActionGroup" stepKey="login"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <after> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditVirtualProductSettingsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditVirtualProductSettingsTest.xml index 90cbab59bd71d..26043bef51e6d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditVirtualProductSettingsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditVirtualProductSettingsTest.xml @@ -51,7 +51,7 @@ <actionGroup ref="logout" stepKey="adminLogout"/> </after> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <!-- Create new virtual product --> <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createVirtualProduct"> @@ -185,6 +185,6 @@ <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/> <dontSeeElement selector="{{StorefrontProductCartGiftOptionSection.giftOptions}}" stepKey="dontSeeGiftOptionBtn"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminEditTextEditorProductAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminEditTextEditorProductAttributeTest.xml index 53040993beb8f..eff05fd64a775 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminEditTextEditorProductAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminEditTextEditorProductAttributeTest.xml @@ -19,7 +19,7 @@ </annotations> <before> <actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> <createData stepKey="myProductAttributeCreation" entity="productAttributeWysiwyg"/> <createData stepKey="myProductAttributeSetAssign" entity="AddToDefaultSet"> @@ -75,7 +75,7 @@ <seeElement selector="{{ProductAttributeWYSIWYGSection.TinyMCE4($$myProductAttributeCreation.attribute_code$$)}}" stepKey="seePoweredBy"/> <after> <deleteData createDataKey="myProductAttributeCreation" stepKey="deletePreReqProductAttribute" /> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml index 8316f54c15a52..d92a3622725bf 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml @@ -55,7 +55,7 @@ </before> <after> - <actionGroup ref="ResetWebUrlOptions" stepKey="resetUrlOption"/> + <actionGroup ref="ResetWebUrlOptionsActionGroup" stepKey="resetUrlOption"/> <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite"> <argument name="websiteName" value="FirstWebSite"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductSetEditContentTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductSetEditContentTest.xml index f5e5911352c86..2099e95d61ed2 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductSetEditContentTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductSetEditContentTest.xml @@ -22,7 +22,7 @@ <before> <!--Admin Login--> <actionGroup stepKey="loginToAdminPanel" ref="LoginAsAdmin"/> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> </before> <after> <!-- Delete simple product --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml index 5b6207e135796..ddef7beb07b43 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml @@ -30,7 +30,7 @@ <argument name="newWebsiteName" value="{{customWebsite.name}}"/> <argument name="websiteCode" value="{{customWebsite.code}}"/> </actionGroup> - <actionGroup ref="EnableWebUrlOptions" stepKey="addStoreCodeToUrls"/> + <actionGroup ref="EnableWebUrlOptionsActionGroup" stepKey="addStoreCodeToUrls"/> <magentoCLI command="cache:flush" stepKey="flushCacheAfterEnableWebUrlOptions"/> </before> <after> @@ -42,7 +42,7 @@ </actionGroup> <actionGroup ref="GoToProductCatalogPage" stepKey="goToProductCatalogPage"/> <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial"/> - <actionGroup ref="ResetWebUrlOptions" stepKey="resetUrlOption"/> + <actionGroup ref="ResetWebUrlOptionsActionGroup" stepKey="resetUrlOption"/> <magentoCLI command="indexer:reindex" stepKey="reindex"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> <actionGroup ref="logout" stepKey="logout"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/SaveProductWithCustomOptionsSecondWebsiteTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/SaveProductWithCustomOptionsSecondWebsiteTest.xml index 8092b03c53cba..89e784d67eaea 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/SaveProductWithCustomOptionsSecondWebsiteTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/SaveProductWithCustomOptionsSecondWebsiteTest.xml @@ -49,14 +49,14 @@ <see userInput="You saved the store view." stepKey="seeSaveMessage" /> </before> <after> - <actionGroup ref="ResetWebUrlOptions" stepKey="resetUrlOption"/> + <actionGroup ref="ResetWebUrlOptionsActionGroup" stepKey="resetUrlOption"/> <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteTestWebsite"> <argument name="websiteName" value="Second Website"/> </actionGroup> <actionGroup ref="logout" stepKey="adminLogout"/> </after> - <actionGroup ref="EnableWebUrlOptions" stepKey="addStoreCodeToUrls"/> + <actionGroup ref="EnableWebUrlOptionsActionGroup" stepKey="addStoreCodeToUrls"/> <!--Create a Simple Product with Custom Options --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToCatalogProductGrid"/> <waitForPageLoad stepKey="waitForCatalogProductGrid"/> @@ -103,4 +103,4 @@ <seeNumberOfElements selector=".admin__dynamic-rows[data-index='values'] tr.data-row" userInput="3" stepKey="see4RowsOfOptions"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyDefaultWYSIWYGToolbarOnProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyDefaultWYSIWYGToolbarOnProductTest.xml index 53bcac5b1d5f0..fe0ed32f39e1e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyDefaultWYSIWYGToolbarOnProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyDefaultWYSIWYGToolbarOnProductTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <amOnPage url="{{AdminProductCreatePage.url(AddToDefaultSet.attributeSetId, 'simple')}}" stepKey="navigateToProduct"/> @@ -43,7 +43,7 @@ <seeElement selector="{{ProductDescriptionWYSIWYGToolbarSection.InsertTable}}" stepKey="assertInfo13"/> <seeElement selector="{{ProductDescriptionWYSIWYGToolbarSection.SpecialCharacter}}" stepKey="assertInfo14"/> <after> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> @@ -59,7 +59,7 @@ </annotations> <before> <actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <amOnPage url="{{AdminProductCreatePage.url(AddToDefaultSet.attributeSetId, 'simple')}}" stepKey="navigateToProduct"/> @@ -82,7 +82,7 @@ <seeElement selector="{{ProductShortDescriptionWYSIWYGToolbarSection.InsertTable}}" stepKey="assertInfo27"/> <seeElement selector="{{ProductShortDescriptionWYSIWYGToolbarSection.SpecialCharacter}}" stepKey="assertInfo28"/> <after> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnCatalogTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnCatalogTest.xml index aad83cd0c2aff..cc69d0828015f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnCatalogTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnCatalogTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <amOnPage url="{{AdminCategoryPage.url}}" stepKey="navigateToNewCatalog"/> @@ -45,7 +45,7 @@ <waitForElementVisible selector="{{StorefrontCategoryMainSection.CatalogDescription}}" stepKey="waitForDesVisible" /> <see userInput="Hello World!" selector="{{StorefrontCategoryMainSection.CatalogDescription}}" stepKey="assertCatalogDescription"/> <after> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnProductTest.xml index 29ed3af4f01d9..5a2728b6532c8 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnProductTest.xml @@ -19,7 +19,7 @@ </annotations> <before> <actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <amOnPage url="{{AdminProductCreatePage.url(AddToDefaultSet.attributeSetId, 'simple')}}" stepKey="navigateToNewProduct"/> @@ -58,7 +58,7 @@ <see userInput="Hello World!" selector="{{StorefrontProductInfoMainSection.productDescription}}" stepKey="assertProductDescription"/> <see userInput="Hello World! Short Content" selector="{{StorefrontProductInfoMainSection.productShortDescription}}" stepKey="assertProductShortDescription"/> <after> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOperatorsTest.xml b/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOperatorsTest.xml index 32bea8b604cf8..d4344c5d2fac6 100644 --- a/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOperatorsTest.xml +++ b/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOperatorsTest.xml @@ -38,7 +38,7 @@ <createData entity="_defaultBlock" stepKey="createPreReqBlock"/> <!--User log in on back-end as admin--> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> </before> <!--Open block with widget.--> @@ -145,7 +145,7 @@ <dontSeeElement selector="{{InsertWidgetSection.checkElementStorefrontByPrice('100')}}" stepKey="dontSeeElementByPrice100s"/> <after> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <deleteData createDataKey="createPreReqBlock" stepKey="deletePreReqBlock" /> <deleteData createDataKey="simplecategory" stepKey="deleteSimpleCategory"/> <deleteData createDataKey="createFirstProduct" stepKey="deleteFirstProduct"/> diff --git a/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOrderTest.xml b/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOrderTest.xml index 11586207c4d8e..f9e050100bf05 100644 --- a/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOrderTest.xml +++ b/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOrderTest.xml @@ -38,7 +38,7 @@ </createData> <createData entity="_defaultCmsPage" stepKey="createPreReqPage"/> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> </before> <!--Open created cms page--> <comment userInput="Open created cms page" stepKey="commentOpenCreatedCmsPage"/> @@ -76,7 +76,7 @@ <seeElement selector="{{InsertWidgetSection.checkElementStorefrontByName('2','$$createSecondProduct.name$$')}}" stepKey="seeElementByName2"/> <seeElement selector="{{InsertWidgetSection.checkElementStorefrontByName('3','$$createFirstProduct.name$$')}}" stepKey="seeElementByName3"/> <after> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <deleteData createDataKey="createPreReqPage" stepKey="deletePreReqPage" /> <deleteData createDataKey="simplecategory" stepKey="deleteSimpleCategory"/> <deleteData createDataKey="createFirstProduct" stepKey="deleteFirstProduct"/> @@ -85,4 +85,4 @@ <actionGroup ref="logout" stepKey="logout"/> </after> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/CheckoutSpecificDestinationsTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/CheckoutSpecificDestinationsTest.xml index f3807388399b8..70a4c64558779 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/CheckoutSpecificDestinationsTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/CheckoutSpecificDestinationsTest.xml @@ -28,13 +28,13 @@ </before> <!--Go to configuration general page--> - <actionGroup ref="NavigateToConfigurationGeneralPage" stepKey="navigateToConfigurationGeneralPage"/> + <actionGroup ref="NavigateToConfigurationGeneralPageActionGroup" stepKey="navigateToConfigurationGeneralPage"/> <!--Open country options section--> <conditionalClick selector="{{CountryOptionsSection.countryOptions}}" dependentSelector="{{CountryOptionsSection.countryOptionsOpen}}" visible="false" stepKey="clickOnStoreInformation"/> <!--Select top destinations country--> - <actionGroup ref="SelectTopDestinationsCountry" stepKey="selectTopDestinationsCountry"> + <actionGroup ref="SelectTopDestinationsCountryActionGroup" stepKey="selectTopDestinationsCountry"> <argument name="countries" value="Countries"/> </actionGroup> @@ -57,13 +57,13 @@ </actionGroup> <!--Go to configuration general page--> - <actionGroup ref="NavigateToConfigurationGeneralPage" stepKey="navigateToConfigurationGeneralPage2"/> + <actionGroup ref="NavigateToConfigurationGeneralPageActionGroup" stepKey="navigateToConfigurationGeneralPage2"/> <!--Open country options section--> <conditionalClick selector="{{CountryOptionsSection.countryOptions}}" dependentSelector="{{CountryOptionsSection.countryOptionsOpen}}" visible="false" stepKey="clickOnStoreInformation2"/> <!--Deselect top destinations country--> - <actionGroup ref="UnSelectTopDestinationsCountry" stepKey="unSelectTopDestinationsCountry"> + <actionGroup ref="UnSelectTopDestinationsCountryActionGroup" stepKey="unSelectTopDestinationsCountry"> <argument name="countries" value="Countries"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithoutRegionTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithoutRegionTest.xml index 0cc0dcf38e312..81412451d2941 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithoutRegionTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithoutRegionTest.xml @@ -25,12 +25,12 @@ </createData> <createData entity="Simple_GB_Customer" stepKey="createCustomer"/> <actionGroup stepKey="loginToAdminPanel" ref="LoginAsAdmin"/> - <actionGroup ref="SelectCountriesWithRequiredRegion" stepKey="setCustomCountryWithRequiredRegion"> + <actionGroup ref="SelectCountriesWithRequiredRegionActionGroup" stepKey="setCustomCountryWithRequiredRegion"> <argument name="countries" value="CustomCountryWithRequiredRegion"/> </actionGroup> </before> <after> - <actionGroup ref="SelectCountriesWithRequiredRegion" stepKey="setDefaultCountriesWithRequiredRegion"> + <actionGroup ref="SelectCountriesWithRequiredRegionActionGroup" stepKey="setDefaultCountriesWithRequiredRegion"> <argument name="countries" value="DefaultCountriesWithRequiredRegions"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGBlockTest.xml index 03edc69e6d625..a972c895160fb 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGBlockTest.xml @@ -21,7 +21,7 @@ <createData entity="_defaultCmsPage" stepKey="createCMSPage" /> <createData entity="_defaultBlock" stepKey="createPreReqBlock" /> <actionGroup ref="LoginActionGroup" stepKey="login"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <actionGroup ref="AssignBlockToCMSPage" stepKey="assignBlockToCMSPage"> @@ -62,7 +62,7 @@ <waitForPageLoad stepKey="waitForGridReload"/> <deleteData createDataKey="createPreReqBlock" stepKey="deletePreReqBlock" /> <deleteData createDataKey="createCMSPage" stepKey="deletePreReqCMSPage" /> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGCMSTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGCMSTest.xml index 205850f888797..039bd0c7cbc82 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGCMSTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGCMSTest.xml @@ -20,7 +20,7 @@ <before> <createData entity="_defaultCmsPage" stepKey="createCMSPage" /> <actionGroup ref="LoginActionGroup" stepKey="login"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPage"> @@ -56,7 +56,7 @@ <seeElementInDOM selector="{{StorefrontCMSPageSection.imageSource(ImageUpload3.fileName)}}" stepKey="assertMediaSource"/> <after> <deleteData createDataKey="createCMSPage" stepKey="deletePreReqCMSPage" /> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml index ce34a8d09c302..6cfe35564297f 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml @@ -21,7 +21,7 @@ <createData entity="_defaultCmsPage" stepKey="createCMSPage" /> <createData entity="_defaultBlock" stepKey="createPreReqBlock" /> <actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <!--Create Custom Variable--> @@ -142,7 +142,7 @@ <waitForPageLoad stepKey="waitForGridReload"/> <deleteData createDataKey="createPreReqBlock" stepKey="deletePreReqBlock" /> <deleteData createDataKey="createCMSPage" stepKey="deletePreReqCMSPage" /> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGCMSTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGCMSTest.xml index 3b501859e606e..92164f34f5a83 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGCMSTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGCMSTest.xml @@ -18,7 +18,7 @@ </annotations> <before> <actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <!--Create Custom Variable--> @@ -94,7 +94,7 @@ <!--see custom variable blank--> <dontSee userInput="{{customVariable.html}}" stepKey="dontSeeCustomVariableName" /> <after> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGBlockTest.xml index ad5e769c61be4..0242f07edab88 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGBlockTest.xml @@ -21,7 +21,7 @@ <createData entity="_defaultCmsPage" stepKey="createCMSPage" /> <createData entity="_defaultBlock" stepKey="createPreReqBlock" /> <actionGroup ref="LoginActionGroup" stepKey="login"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <actionGroup ref="navigateToCreatedCMSBlockPage" stepKey="navigateToCreatedCMSBlockPage"> @@ -80,7 +80,7 @@ <waitForPageLoad stepKey="waitForGridReload"/> <deleteData createDataKey="createCMSPage" stepKey="deletePreReqCMSPage" /> <deleteData createDataKey="createPreReqBlock" stepKey="deletePreReqBlock" /> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSPageLinkTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSPageLinkTypeTest.xml index 1adb781a67536..53ed63c89bfb6 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSPageLinkTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSPageLinkTypeTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <actionGroup ref="LoginActionGroup" stepKey="login"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <!--Main test--> @@ -66,7 +66,7 @@ <!--see widget on Storefront--> <see userInput="Home page" stepKey="seeHomepageWidget" /> <after> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSStaticBlockTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSStaticBlockTypeTest.xml index f37038435e109..c199601231a13 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSStaticBlockTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSStaticBlockTypeTest.xml @@ -21,7 +21,7 @@ <before> <createData entity="_defaultBlock" stepKey="createPreReqBlock" /> <actionGroup ref="LoginActionGroup" stepKey="login"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <!--Main test--> @@ -68,7 +68,7 @@ <see userInput="$$createPreReqBlock.content$$" stepKey="seeBlockLink"/> <after> <deleteData createDataKey="createPreReqBlock" stepKey="deletePreReqBlock" /> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml index 552eae407391d..0237d3704f7c1 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml @@ -20,7 +20,7 @@ <before> <createData entity="_defaultCategory" stepKey="createPreReqCategory"/> <actionGroup ref="LoginActionGroup" stepKey="login"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> <actionGroup ref="ConfigAdminAccountSharingActionGroup" stepKey="allowAdminShareAccount"/> </before> @@ -75,7 +75,7 @@ stepKey="seeProductLinkInCategory"/> <after> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCatalog" /> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <magentoCLI command="config:set catalog/seo/generate_category_product_rewrites 1" stepKey="enableGenerateUrlRewrite"/> <actionGroup ref="logout" stepKey="logout"/> </after> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml index d75d422afa2a4..4e7ecd48a6af4 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml @@ -24,7 +24,7 @@ <requiredEntity createDataKey="createPreReqCategory"/> </createData> <actionGroup ref="LoginActionGroup" stepKey="login"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <!--Main test--> @@ -82,7 +82,7 @@ <after> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCatalog" /> <deleteData createDataKey="createPreReqProduct" stepKey="deletePreReqProduct" /> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <magentoCLI command="config:set catalog/seo/generate_category_product_rewrites 1" stepKey="enableGenerateUrlRewrite"/> <actionGroup ref="logout" stepKey="logout"/> </after> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductListTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductListTypeTest.xml index 394d79bda1ab3..2cd41eb9d9f7b 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductListTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductListTypeTest.xml @@ -26,7 +26,7 @@ <requiredEntity createDataKey="createPreReqCategory"/> </createData> <actionGroup ref="LoginActionGroup" stepKey="login"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <!--Main test--> @@ -99,7 +99,7 @@ <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCatalog" /> <deleteData createDataKey="createPreReqProduct1" stepKey="deletePreReqProduct1" /> <deleteData createDataKey="createPreReqProduct2" stepKey="deletePreReqProduct2" /> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml index 862f51ea72fad..803a3b692dbe2 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml @@ -25,7 +25,7 @@ <requiredEntity createDataKey="createPreReqCategory"/> </createData> <actionGroup ref="LoginActionGroup" stepKey="login"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <amOnPage url="{{CmsNewPagePage.url}}" stepKey="navigateToPage"/> @@ -82,7 +82,7 @@ <after> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCatalog" /> <deleteData createDataKey="createPreReqProduct" stepKey="deletePreReqProduct" /> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyViewedProductsTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyViewedProductsTypeTest.xml index 298aed917fc18..2c3b060d3bc15 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyViewedProductsTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyViewedProductsTypeTest.xml @@ -24,7 +24,7 @@ <requiredEntity createDataKey="createPreReqCategory"/> </createData> <actionGroup ref="LoginActionGroup" stepKey="login"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <!--Main test--> @@ -72,7 +72,7 @@ <after> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCatalog" /> <deleteData createDataKey="createPreReqProduct" stepKey="deletePreReqProduct" /> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsBlockTest.xml index 7ab0d9209dde3..ef4a7575c35d3 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsBlockTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> </before> <after> <actionGroup ref="deleteBlock" stepKey="deleteCreatedBlock"> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsPageTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsPageTest.xml index b7c7e4a4212fe..81c239a58f03e 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsPageTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsPageTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> </before> <after> <actionGroup ref="logout" stepKey="adminLogout"/> @@ -90,7 +90,7 @@ </annotations> <before> <actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> </before> <after> <actionGroup ref="logout" stepKey="logout"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/CheckOrderOfProdsInWidgetOnCMSPageTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/CheckOrderOfProdsInWidgetOnCMSPageTest.xml index ce093144e6a2a..599276db8e615 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/CheckOrderOfProdsInWidgetOnCMSPageTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/CheckOrderOfProdsInWidgetOnCMSPageTest.xml @@ -21,7 +21,7 @@ </annotations> <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="enableTinyMCE4"/> <waitForPageLoad stepKey="waitConfigToSave"/> <createData entity="ApiCategory" stepKey="createFirstCategory"/> @@ -34,7 +34,7 @@ <createData entity="_defaultCmsPage" stepKey="createCMSPage"/> </before> <after> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <deleteData createDataKey="createFirstCategory" stepKey="deleteCategory"/> <deleteData createDataKey="product1" stepKey="deleteProduct1"/> <deleteData createDataKey="product2" stepKey="deleteProduct2"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnBlockTest.xml index 9ee2055aae650..944cd02d87b86 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnBlockTest.xml @@ -21,7 +21,7 @@ <before> <createData entity="_defaultCmsPage" stepKey="createPreReqCMSPage" /> <actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <amOnPage url="{{CmsNewBlock.url}}" stepKey="amOnNewBlockPage"/> @@ -90,7 +90,7 @@ <conditionalClick selector="{{CmsPagesPageActionsSection.clearAllButton}}" dependentSelector="{{CmsPagesPageActionsSection.activeFilters}}" stepKey="clickToResetFilter" visible="true"/> <waitForPageLoad stepKey="waitForGridReload"/> <deleteData createDataKey="createPreReqCMSPage" stepKey="deletePreReqCMSPage" /> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnCMSPageTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnCMSPageTest.xml index caad1cabe78c5..24377e92fe083 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnCMSPageTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnCMSPageTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <amOnPage url="{{CmsPagesPage.url}}" stepKey="amOnPagePagesGrid"/> @@ -50,7 +50,7 @@ <see userInput="{{_defaultCmsPage.content_heading}}" stepKey="seeContentHeading"/> <see userInput="Hello World!" stepKey="seeContent" /> <after> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigAdminCatalogSearchActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/ChooseElasticSearchAsSearchEngineActionGroup.xml similarity index 56% rename from app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigAdminCatalogSearchActionGroup.xml rename to app/code/Magento/Config/Test/Mftf/ActionGroup/ChooseElasticSearchAsSearchEngineActionGroup.xml index d700896f08bc0..ad1cf897b4601 100644 --- a/app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigAdminCatalogSearchActionGroup.xml +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/ChooseElasticSearchAsSearchEngineActionGroup.xml @@ -8,11 +8,11 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="ChooseElasticSearchAsSearchEngine"> + <actionGroup name="ChooseElasticSearchAsSearchEngineActionGroup"> <annotations> <description>Goes to the 'Configuration' page for 'Catalog'. Sets the 'Search Engine' to 'elasticsearch5'. Clicks on the Save button. PLEASE NOTE: The value is Hardcoded.</description> </annotations> - + <amOnPage url="{{AdminCatalogSearchConfigurationPage.url}}" stepKey="configureSearchEngine"/> <waitForPageLoad stepKey="waitForConfigPage"/> <scrollTo selector="{{AdminCatalogSearchConfigurationSection.catalogSearchTab}}" stepKey="scrollToCatalogSearchTab"/> @@ -25,20 +25,4 @@ <click selector="{{ContentManagementSection.Save}}" stepKey="saveConfiguration"/> <see selector="{{AdminMessagesSection.success}}" userInput="You saved the configuration." stepKey="seeConfigurationSuccessMessage"/> </actionGroup> - - <actionGroup name="ResetSearchEngineConfiguration"> - <annotations> - <description>Goes to the 'Configuration' page for 'Catalog'. Sets the 'Search Engine' to 'mysql'. Clicks on the Save button. PLEASE NOTE: The value is Hardcoded.</description> - </annotations> - - <amOnPage url="{{AdminCatalogSearchConfigurationPage.url}}" stepKey="resetSearchEngine"/> - <waitForPageLoad stepKey="waitForConfigPage2"/> - <scrollTo selector="{{AdminCatalogSearchConfigurationSection.catalogSearchTab}}" stepKey="scrollToCatalogSearchTab2"/> - <conditionalClick selector="{{AdminCatalogSearchConfigurationSection.catalogSearchTab}}" dependentSelector="{{AdminCatalogSearchConfigurationSection.checkIfCatalogSearchTabExpand}}" visible="true" stepKey="expandCatalogSearchTab2"/> - <waitForElementVisible selector="{{AdminCatalogSearchConfigurationSection.searchEngine}}" stepKey="waitForDropdownToBeVisible2"/> - <selectOption selector="{{AdminCatalogSearchConfigurationSection.searchEngine}}" userInput="mysql" stepKey="chooseMySQL"/> - <checkOption selector="{{AdminCatalogSearchConfigurationSection.searchEngineDefaultSystemValue}}" stepKey="checkUseSystemValue"/> - <click selector="{{ContentManagementSection.Save}}" stepKey="saveConfiguration2"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You saved the configuration." stepKey="seeConfigurationSuccessMessage2"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigAdminAccountSharingActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigAdminAccountSharingActionGroup.xml index 01cfa30ce0e7f..4e11dd6e971de 100644 --- a/app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigAdminAccountSharingActionGroup.xml +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigAdminAccountSharingActionGroup.xml @@ -22,20 +22,4 @@ <click selector="{{AdminSection.SecurityTab}}" stepKey="clollapseSecurityTab"/> <click selector="{{ContentManagementSection.Save}}" stepKey="saveConfig"/> </actionGroup> - - <actionGroup name="EnableAdminAccountSharingActionGroup"> - <annotations> - <description>Enabled 'Admin Account Sharing' via the API.</description> - </annotations> - - <createData stepKey="setConfig" entity="EnableAdminAccountSharing"/> - </actionGroup> - - <actionGroup name="DisableAdminAccountSharingActionGroup"> - <annotations> - <description>Disables 'Admin Account Sharing' via the API.</description> - </annotations> - - <createData stepKey="setConfig" entity="DisableAdminAccountSharing"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigSalesTaxClassActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigSalesTaxClassActionGroup.xml deleted file mode 100644 index bfa42636519a0..0000000000000 --- a/app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigSalesTaxClassActionGroup.xml +++ /dev/null @@ -1,78 +0,0 @@ -<?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="SetTaxClassForShipping"> - <annotations> - <description>Goes to the 'Configuration' page for 'Tax'. Sets 'Tax Class for Shipping' to 'Taxable Goods'. Clicks on the Save button. PLEASE NOTE: The value is Hardcoded.</description> - </annotations> - - <amOnPage url="{{AdminSalesTaxClassPage.url}}" stepKey="navigateToSalesTaxPage"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <conditionalClick selector="{{SalesConfigSection.TaxClassesTab}}" dependentSelector="{{SalesConfigSection.CheckIfTaxClassesTabExpand}}" visible="true" stepKey="expandTaxClassesTab"/> - <waitForElementVisible selector="{{SalesConfigSection.ShippingTaxClass}}" stepKey="seeShippingTaxClass"/> - <uncheckOption selector="{{SalesConfigSection.EnableTaxClassForShipping}}" stepKey="uncheckUseSystemValue"/> - <selectOption selector="{{SalesConfigSection.ShippingTaxClass}}" userInput="Taxable Goods" stepKey="setShippingTaxClass"/> - <click selector="{{SalesConfigSection.TaxClassesTab}}" stepKey="collapseTaxClassesTab"/> - <click selector="{{ContentManagementSection.Save}}" stepKey="saveConfig"/> - </actionGroup> - - <actionGroup name="ResetTaxClassForShipping"> - <annotations> - <description>Goes to the 'Configuration' page for 'Tax'. Sets 'Tax Class for Shipping' to 'None'. Clicks on the Save button. PLEASE NOTE: The value is Hardcoded.</description> - </annotations> - - <amOnPage url="{{AdminSalesTaxClassPage.url}}" stepKey="navigateToSalesTaxConfigPagetoReset"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - <conditionalClick selector="{{SalesConfigSection.TaxClassesTab}}" dependentSelector="{{SalesConfigSection.CheckIfTaxClassesTabExpand}}" visible="true" stepKey="openTaxClassTab"/> - <waitForElementVisible selector="{{SalesConfigSection.ShippingTaxClass}}" stepKey="seeShippingTaxClass2"/> - <selectOption selector="{{SalesConfigSection.ShippingTaxClass}}" userInput="None" stepKey="resetShippingTaxClass"/> - <checkOption selector="{{SalesConfigSection.EnableTaxClassForShipping}}" stepKey="useSystemValue"/> - <click selector="{{SalesConfigSection.TaxClassesTab}}" stepKey="collapseTaxClassesTab"/> - <click selector="{{ContentManagementSection.Save}}" stepKey="saveConfiguration"/> - </actionGroup> - - <actionGroup name="SetTaxApplyOnSetting"> - <annotations> - <description>Goes to the 'Configuration' page for 'Tax'. Sets 'Apply Tax On' to the provided value. Clicks on the Save button</description> - </annotations> - <arguments> - <argument name="userInput" type="string"/> - </arguments> - - <conditionalClick selector="{{AdminConfigureTaxSection.taxCalculationSettings}}" dependentSelector="{{AdminConfigureTaxSection.taxCalculationAlgorithm}}" visible="false" stepKey="openTaxCalcSettingsSection"/> - <scrollTo selector="{{AdminConfigureTaxSection.taxCalculationApplyTaxOnInherit}}" x="0" y="-80" stepKey="goToCheckbox"/> - <uncheckOption selector="{{AdminConfigureTaxSection.taxCalculationApplyTaxOnInherit}}" stepKey="enableApplyTaxOnSetting"/> - <selectOption selector="{{AdminConfigureTaxSection.taxCalculationApplyTaxOn}}" userInput="{{userInput}}" stepKey="setApplyTaxOn"/> - <scrollTo selector="{{SalesConfigSection.TaxClassesTab}}" stepKey="scrollToTop"/> - <click selector="{{AdminConfigureTaxSection.taxCalculationSettings}}" stepKey="collapseCalcSettingsTab"/> - <click selector="{{AdminConfigureTaxSection.save}}" stepKey="saveConfig"/> - <waitForPageLoad stepKey="waitForConfigSaved"/> - <see userInput="You saved the configuration." stepKey="seeSuccessMessage"/> - </actionGroup> - - <actionGroup name="DisableTaxApplyOnOriginalPrice"> - <annotations> - <description>Goes to the 'Configuration' page for 'Tax'. Sets 'Apply Tax On' to the provided value. Clicks on the Save button.</description> - </annotations> - <arguments> - <argument name="userInput" type="string"/> - </arguments> - - <amOnPage url="{{AdminSalesTaxClassPage.url}}" stepKey="navigateToSalesTaxPage"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <conditionalClick selector="{{AdminConfigureTaxSection.taxCalculationSettings}}" dependentSelector="{{AdminConfigureTaxSection.taxCalculationAlgorithm}}" visible="false" stepKey="openTaxCalcSettingsSection"/> - <scrollTo selector="{{AdminConfigureTaxSection.taxCalculationApplyTaxOnInherit}}" x="0" y="-80" stepKey="goToCheckbox"/> - <selectOption selector="{{AdminConfigureTaxSection.taxCalculationApplyTaxOn}}" userInput="{{userInput}}" stepKey="setApplyTaxOff"/> - <checkOption selector="{{AdminConfigureTaxSection.taxCalculationApplyTaxOnInherit}}" stepKey="disableApplyTaxOnSetting"/> - <click selector="{{AdminConfigureTaxSection.save}}" stepKey="saveConfig"/> - <waitForPageLoad stepKey="waitForConfigSaved"/> - <see userInput="You saved the configuration." stepKey="seeSuccessMessage"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigWYSIWYGActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigWYSIWYGActionGroup.xml deleted file mode 100644 index 342b98a64c828..0000000000000 --- a/app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigWYSIWYGActionGroup.xml +++ /dev/null @@ -1,76 +0,0 @@ -<?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="EnabledWYSIWYG"> - <annotations> - <description>Enables the WYSIWYG Editor via the CLI.</description> - </annotations> - - <magentoCLI stepKey="enableWYSIWYG" command="config:set cms/wysiwyg/enabled enabled"/> - </actionGroup> - - <actionGroup name="SwitchToTinyMCE3"> - <annotations> - <description>Goes to the 'Configuration' page for 'Content Management'. Sets 'WYSIWYG Editor' to 'TinyMCE 3'. Clicks on the Save button. PLEASE NOTE: The value is Hardcoded.</description> - </annotations> - - <comment userInput="Choose TinyMCE3 as the default editor" stepKey="chooseTinyMCE3AsEditor"/> - <conditionalClick stepKey="expandWYSIWYGOptions1" selector="{{ContentManagementSection.WYSIWYGOptions}}" dependentSelector="{{ContentManagementSection.CheckIfTabExpand}}" visible="true"/> - <waitForElementVisible selector="{{ContentManagementSection.SwitcherSystemValue}}" stepKey="waitForCheckbox2"/> - <uncheckOption selector="{{ContentManagementSection.SwitcherSystemValue}}" stepKey="uncheckUseSystemValue2"/> - <waitForElementVisible selector="{{ContentManagementSection.Switcher}}" stepKey="waitForSwitcherDropdown2"/> - <selectOption selector="{{ContentManagementSection.Switcher}}" userInput="TinyMCE 3" stepKey="switchToVersion3"/> - <click selector="{{ContentManagementSection.WYSIWYGOptions}}" stepKey="collapseWYSIWYGOptions"/> - <click selector="{{ContentManagementSection.Save}}" stepKey="saveConfig"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You saved the configuration." stepKey="seeConfigurationSuccessMessage"/> - </actionGroup> - - <actionGroup name="DisabledWYSIWYG"> - <annotations> - <description>Disables the WYSIWYG Editor via the CLI.</description> - </annotations> - - <magentoCLI stepKey="disableWYSIWYG" command="config:set cms/wysiwyg/enabled disabled"/> - </actionGroup> - - <actionGroup name="UseStaticURLForMediaContentInWYSIWYG"> - <annotations> - <description>Goes to the 'Configuration' page for 'Content Management'. Sets 'Use Static URLs for Media Content in WYSIWYG' to the provided value. Clicks on the Save button.</description> - </annotations> - <arguments> - <argument name="value" defaultValue="Yes" type="string"/> - </arguments> - - <amOnPage url="{{ConfigurationStoresPage.url}}" stepKey="navigateToWYSIWYGConfigPage1"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - <conditionalClick stepKey="expandWYSIWYGOptions" selector="{{ContentManagementSection.WYSIWYGOptions}}" dependentSelector="{{ContentManagementSection.CheckIfTabExpand}}" visible="true"/> - <waitForElementVisible selector="{{ContentManagementSection.EnableWYSIWYG}}" stepKey="waitForEnableWYSIWYGDropdown1"/> - <selectOption selector="{{ContentManagementSection.StaticURL}}" userInput="{{value}}" stepKey="selectOption1"/> - <click selector="{{ContentManagementSection.WYSIWYGOptions}}" stepKey="collapseWYSIWYGOptions"/> - <click selector="{{ContentManagementSection.Save}}" stepKey="saveConfig"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - </actionGroup> - - <actionGroup name="EnabledWYSIWYGEditor"> - <annotations> - <description>Goes to the 'Configuration' page for 'Content Management'. Sets 'Enable WYSIWYG Editor' to 'Enabled by Default'. Clicks on the Save button. PLEASE NOTE: The value is Hardcoded.</description> - </annotations> - - <amOnPage url="{{AdminContentManagementPage.url}}" stepKey="navigateToConfigurationPage"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <conditionalClick selector="{{ContentManagementSection.WYSIWYGOptions}}" dependentSelector="{{ContentManagementSection.EnableWYSIWYG}}" visible="false" stepKey="expandWYSIWYGOptionsTab"/> - <waitForElementVisible selector="{{ContentManagementSection.EnableWYSIWYG}}" stepKey="waitTabToExpand"/> - <uncheckOption selector="{{ContentManagementSection.EnableSystemValue}}" stepKey="enableEnableSystemValue"/> - <selectOption selector="{{ContentManagementSection.EnableWYSIWYG}}" userInput="Enabled by Default" stepKey="enableWYSIWYG"/> - <click selector="{{ContentManagementSection.WYSIWYGOptions}}" stepKey="collapseWYSIWYGOptionsTab"/> - <click selector="{{ContentManagementSection.Save}}" stepKey="clickSaveConfig"/> - <see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/DisableAdminAccountSharingActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/DisableAdminAccountSharingActionGroup.xml new file mode 100644 index 0000000000000..5bc9cca7d171f --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/DisableAdminAccountSharingActionGroup.xml @@ -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="DisableAdminAccountSharingActionGroup"> + <annotations> + <description>Disables 'Admin Account Sharing' via the API.</description> + </annotations> + + <createData stepKey="setConfig" entity="DisableAdminAccountSharing"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/DisableTaxApplyOnOriginalPriceActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/DisableTaxApplyOnOriginalPriceActionGroup.xml new file mode 100644 index 0000000000000..c27fc6a93ca5a --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/DisableTaxApplyOnOriginalPriceActionGroup.xml @@ -0,0 +1,29 @@ +<?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="DisableTaxApplyOnOriginalPriceActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'Tax'. Sets 'Apply Tax On' to the provided value. Clicks on the Save button.</description> + </annotations> + <arguments> + <argument name="userInput" type="string"/> + </arguments> + + <amOnPage url="{{AdminSalesTaxClassPage.url}}" stepKey="navigateToSalesTaxPage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <conditionalClick selector="{{AdminConfigureTaxSection.taxCalculationSettings}}" dependentSelector="{{AdminConfigureTaxSection.taxCalculationAlgorithm}}" visible="false" stepKey="openTaxCalcSettingsSection"/> + <scrollTo selector="{{AdminConfigureTaxSection.taxCalculationApplyTaxOnInherit}}" x="0" y="-80" stepKey="goToCheckbox"/> + <selectOption selector="{{AdminConfigureTaxSection.taxCalculationApplyTaxOn}}" userInput="{{userInput}}" stepKey="setApplyTaxOff"/> + <checkOption selector="{{AdminConfigureTaxSection.taxCalculationApplyTaxOnInherit}}" stepKey="disableApplyTaxOnSetting"/> + <click selector="{{AdminConfigureTaxSection.save}}" stepKey="saveConfig"/> + <waitForPageLoad stepKey="waitForConfigSaved"/> + <see userInput="You saved the configuration." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/DisabledWYSIWYGActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/DisabledWYSIWYGActionGroup.xml new file mode 100644 index 0000000000000..f1b817711d6b1 --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/DisabledWYSIWYGActionGroup.xml @@ -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="DisabledWYSIWYGActionGroup"> + <annotations> + <description>Disables the WYSIWYG Editor via the CLI.</description> + </annotations> + + <magentoCLI stepKey="disableWYSIWYG" command="config:set cms/wysiwyg/enabled disabled"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/EnableAdminAccountSharingActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/EnableAdminAccountSharingActionGroup.xml new file mode 100644 index 0000000000000..5541a1e48a0af --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/EnableAdminAccountSharingActionGroup.xml @@ -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="EnableAdminAccountSharingActionGroup"> + <annotations> + <description>Enabled 'Admin Account Sharing' via the API.</description> + </annotations> + + <createData stepKey="setConfig" entity="EnableAdminAccountSharing"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/EnableWebUrlOptionsActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/EnableWebUrlOptionsActionGroup.xml new file mode 100644 index 0000000000000..2e4fdf0debd79 --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/EnableWebUrlOptionsActionGroup.xml @@ -0,0 +1,25 @@ +<?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="EnableWebUrlOptionsActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'Url Options'. Enables 'Add Store Code to Urls'. Clicks on the Save button.</description> + </annotations> + + <amOnPage url="{{WebConfigurationPage.url}}" stepKey="navigateToWebConfigurationPage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <conditionalClick selector="{{WebSection.UrlOptionsTab}}" dependentSelector="{{WebSection.CheckIfUrlOptionsTabExpand}}" visible="true" stepKey="expandUrlSectionTab"/> + <waitForElementVisible selector="{{UrlOptionsSection.addStoreCodeToUrl}}" stepKey="seeAddStoreCodeToUrl"/> + <uncheckOption selector="{{UrlOptionsSection.systemValueForStoreCode}}" stepKey="uncheckUseSystemValue"/> + <selectOption selector="{{UrlOptionsSection.addStoreCodeToUrl}}" userInput="Yes" stepKey="enableStoreCode"/> + <click selector="{{WebSection.UrlOptionsTab}}" stepKey="collapseUrlOptions"/> + <click selector="{{ContentManagementSection.Save}}" stepKey="saveConfig"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/EnabledWYSIWYGActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/EnabledWYSIWYGActionGroup.xml new file mode 100644 index 0000000000000..556b8bdcf9736 --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/EnabledWYSIWYGActionGroup.xml @@ -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="EnabledWYSIWYGActionGroup"> + <annotations> + <description>Enables the WYSIWYG Editor via the CLI.</description> + </annotations> + + <magentoCLI stepKey="enableWYSIWYG" command="config:set cms/wysiwyg/enabled enabled"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/EnabledWYSIWYGEditorActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/EnabledWYSIWYGEditorActionGroup.xml new file mode 100644 index 0000000000000..7d23a5d7581c5 --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/EnabledWYSIWYGEditorActionGroup.xml @@ -0,0 +1,26 @@ +<?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="EnabledWYSIWYGEditorActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'Content Management'. Sets 'Enable WYSIWYG Editor' to 'Enabled by Default'. Clicks on the Save button. PLEASE NOTE: The value is Hardcoded.</description> + </annotations> + + <amOnPage url="{{AdminContentManagementPage.url}}" stepKey="navigateToConfigurationPage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <conditionalClick selector="{{ContentManagementSection.WYSIWYGOptions}}" dependentSelector="{{ContentManagementSection.EnableWYSIWYG}}" visible="false" stepKey="expandWYSIWYGOptionsTab"/> + <waitForElementVisible selector="{{ContentManagementSection.EnableWYSIWYG}}" stepKey="waitTabToExpand"/> + <uncheckOption selector="{{ContentManagementSection.EnableSystemValue}}" stepKey="enableEnableSystemValue"/> + <selectOption selector="{{ContentManagementSection.EnableWYSIWYG}}" userInput="Enabled by Default" stepKey="enableWYSIWYG"/> + <click selector="{{ContentManagementSection.WYSIWYGOptions}}" stepKey="collapseWYSIWYGOptionsTab"/> + <click selector="{{ContentManagementSection.Save}}" stepKey="clickSaveConfig"/> + <see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/GeneralConfigurationActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/GeneralConfigurationActionGroup.xml deleted file mode 100644 index d65376828e2c4..0000000000000 --- a/app/code/Magento/Config/Test/Mftf/ActionGroup/GeneralConfigurationActionGroup.xml +++ /dev/null @@ -1,72 +0,0 @@ -<?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="NavigateToDefaultLayoutsSetting"> - <annotations> - <description>Goes to the 'Configuration' page for 'Web'. Expands the 'Default Layouts' section.</description> - </annotations> - - <amOnPage url="{{WebConfigurationPage.url}}" stepKey="navigateToWebConfigurationPage"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <conditionalClick stepKey="expandDefaultLayouts" selector="{{WebSection.DefaultLayoutsTab}}" dependentSelector="{{WebSection.CheckIfTabExpand}}" visible="true"/> - <waitForElementVisible selector="{{DefaultLayoutsSection.categoryLayout}}" stepKey="waittForDefaultCategoryLayout"/> - </actionGroup> - - <actionGroup name="NavigateToConfigurationGeneralPage"> - <annotations> - <description>Goes to the 'Configuration' page for 'General'.</description> - </annotations> - - <amOnPage url="{{AdminConfigGeneralPage.url}}" stepKey="navigateToConfigGeneralPage"/> - <waitForPageLoad stepKey="waitForConfigPageLoad"/> - </actionGroup> - <actionGroup name="SelectTopDestinationsCountry"> - <annotations> - <description>Selects the provided Countries under 'Top destinations' on the 'General' section of the 'Configuration' page. Clicks on the Save button.</description> - </annotations> - <arguments> - <argument name="countries" type="entity"/> - </arguments> - - <selectOption selector="{{CountryOptionsSection.topDestinations}}" parameterArray="[{{countries.country}}]" stepKey="selectTopDestinationsCountry"/> - <click selector="#save" stepKey="saveConfig"/> - <waitForPageLoad stepKey="waitForSavingConfig"/> - </actionGroup> - - <actionGroup name="UnSelectTopDestinationsCountry"> - <annotations> - <description>Un-selects the provided Countries under 'Top destinations' on the 'General' section of the 'Configuration' page. Clicks on the Save button.</description> - </annotations> - <arguments> - <argument name="countries" type="entity"/> - </arguments> - - <unselectOption selector="{{CountryOptionsSection.topDestinations}}" parameterArray="[{{countries.country}}]" stepKey="unSelectTopDestinationsCountry"/> - <click selector="#save" stepKey="saveConfig"/> - <waitForPageLoad stepKey="waitForSavingConfig"/> - </actionGroup> - - <actionGroup name="SelectCountriesWithRequiredRegion"> - <annotations> - <description>Goes to the 'Configuration' page for 'General'. Selects the provided Countries under 'State is Required for'. Clicks on the Save button.</description> - </annotations> - <arguments> - <argument name="countries" type="entity"/> - </arguments> - - <amOnPage url="{{AdminConfigGeneralPage.url}}" stepKey="navigateToAdminConfigGeneralPage"/> - <conditionalClick selector="{{StateOptionsSection.stateOptions}}" dependentSelector="{{StateOptionsSection.countriesWithRequiredRegions}}" visible="false" stepKey="expandStateOptionsTab"/> - <waitForAjaxLoad stepKey="waitForAjax"/> - <scrollTo selector="{{StateOptionsSection.countriesWithRequiredRegions}}" stepKey="scrollToForm"/> - <selectOption selector="{{StateOptionsSection.countriesWithRequiredRegions}}" parameterArray="[{{countries.country}}]" stepKey="selectCountriesWithRequiredRegion"/> - <click selector="#save" stepKey="saveConfig"/> - <waitForPageLoad stepKey="waitForSavingConfig"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/NavigateToConfigurationGeneralPageActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/NavigateToConfigurationGeneralPageActionGroup.xml new file mode 100644 index 0000000000000..fb89b406d9f32 --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/NavigateToConfigurationGeneralPageActionGroup.xml @@ -0,0 +1,19 @@ +<?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="NavigateToConfigurationGeneralPageActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'General'.</description> + </annotations> + + <amOnPage url="{{AdminConfigGeneralPage.url}}" stepKey="navigateToConfigGeneralPage"/> + <waitForPageLoad stepKey="waitForConfigPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/NavigateToDefaultLayoutsSettingActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/NavigateToDefaultLayoutsSettingActionGroup.xml new file mode 100644 index 0000000000000..c6690632194b3 --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/NavigateToDefaultLayoutsSettingActionGroup.xml @@ -0,0 +1,21 @@ +<?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="NavigateToDefaultLayoutsSettingActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'Web'. Expands the 'Default Layouts' section.</description> + </annotations> + + <amOnPage url="{{WebConfigurationPage.url}}" stepKey="navigateToWebConfigurationPage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <conditionalClick stepKey="expandDefaultLayouts" selector="{{WebSection.DefaultLayoutsTab}}" dependentSelector="{{WebSection.CheckIfTabExpand}}" visible="true"/> + <waitForElementVisible selector="{{DefaultLayoutsSection.categoryLayout}}" stepKey="waittForDefaultCategoryLayout"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/ResetSearchEngineConfigurationActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/ResetSearchEngineConfigurationActionGroup.xml new file mode 100644 index 0000000000000..f6451a4171a59 --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/ResetSearchEngineConfigurationActionGroup.xml @@ -0,0 +1,26 @@ +<?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="ResetSearchEngineConfigurationActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'Catalog'. Sets the 'Search Engine' to 'mysql'. Clicks on the Save button. PLEASE NOTE: The value is Hardcoded.</description> + </annotations> + + <amOnPage url="{{AdminCatalogSearchConfigurationPage.url}}" stepKey="resetSearchEngine"/> + <waitForPageLoad stepKey="waitForConfigPage2"/> + <scrollTo selector="{{AdminCatalogSearchConfigurationSection.catalogSearchTab}}" stepKey="scrollToCatalogSearchTab2"/> + <conditionalClick selector="{{AdminCatalogSearchConfigurationSection.catalogSearchTab}}" dependentSelector="{{AdminCatalogSearchConfigurationSection.checkIfCatalogSearchTabExpand}}" visible="true" stepKey="expandCatalogSearchTab2"/> + <waitForElementVisible selector="{{AdminCatalogSearchConfigurationSection.searchEngine}}" stepKey="waitForDropdownToBeVisible2"/> + <selectOption selector="{{AdminCatalogSearchConfigurationSection.searchEngine}}" userInput="mysql" stepKey="chooseMySQL"/> + <checkOption selector="{{AdminCatalogSearchConfigurationSection.searchEngineDefaultSystemValue}}" stepKey="checkUseSystemValue"/> + <click selector="{{ContentManagementSection.Save}}" stepKey="saveConfiguration2"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You saved the configuration." stepKey="seeConfigurationSuccessMessage2"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/ResetTaxClassForShippingActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/ResetTaxClassForShippingActionGroup.xml new file mode 100644 index 0000000000000..3f768bdac8055 --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/ResetTaxClassForShippingActionGroup.xml @@ -0,0 +1,25 @@ +<?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="ResetTaxClassForShippingActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'Tax'. Sets 'Tax Class for Shipping' to 'None'. Clicks on the Save button. PLEASE NOTE: The value is Hardcoded.</description> + </annotations> + + <amOnPage url="{{AdminSalesTaxClassPage.url}}" stepKey="navigateToSalesTaxConfigPagetoReset"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + <conditionalClick selector="{{SalesConfigSection.TaxClassesTab}}" dependentSelector="{{SalesConfigSection.CheckIfTaxClassesTabExpand}}" visible="true" stepKey="openTaxClassTab"/> + <waitForElementVisible selector="{{SalesConfigSection.ShippingTaxClass}}" stepKey="seeShippingTaxClass2"/> + <selectOption selector="{{SalesConfigSection.ShippingTaxClass}}" userInput="None" stepKey="resetShippingTaxClass"/> + <checkOption selector="{{SalesConfigSection.EnableTaxClassForShipping}}" stepKey="useSystemValue"/> + <click selector="{{SalesConfigSection.TaxClassesTab}}" stepKey="collapseTaxClassesTab"/> + <click selector="{{ContentManagementSection.Save}}" stepKey="saveConfiguration"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigWebUrlOptionsActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/ResetWebUrlOptionsActionGroup.xml similarity index 56% rename from app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigWebUrlOptionsActionGroup.xml rename to app/code/Magento/Config/Test/Mftf/ActionGroup/ResetWebUrlOptionsActionGroup.xml index fe297cbf9ad7d..8c403c95cacbc 100644 --- a/app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigWebUrlOptionsActionGroup.xml +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/ResetWebUrlOptionsActionGroup.xml @@ -8,26 +8,11 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="EnableWebUrlOptions"> - <annotations> - <description>Goes to the 'Configuration' page for 'Url Options'. Enables 'Add Store Code to Urls'. Clicks on the Save button.</description> - </annotations> - - <amOnPage url="{{WebConfigurationPage.url}}" stepKey="navigateToWebConfigurationPage"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <conditionalClick selector="{{WebSection.UrlOptionsTab}}" dependentSelector="{{WebSection.CheckIfUrlOptionsTabExpand}}" visible="true" stepKey="expandUrlSectionTab"/> - <waitForElementVisible selector="{{UrlOptionsSection.addStoreCodeToUrl}}" stepKey="seeAddStoreCodeToUrl"/> - <uncheckOption selector="{{UrlOptionsSection.systemValueForStoreCode}}" stepKey="uncheckUseSystemValue"/> - <selectOption selector="{{UrlOptionsSection.addStoreCodeToUrl}}" userInput="Yes" stepKey="enableStoreCode"/> - <click selector="{{WebSection.UrlOptionsTab}}" stepKey="collapseUrlOptions"/> - <click selector="{{ContentManagementSection.Save}}" stepKey="saveConfig"/> - </actionGroup> - - <actionGroup name="ResetWebUrlOptions"> + <actionGroup name="ResetWebUrlOptionsActionGroup"> <annotations> <description>Goes to the 'Configuration' page for 'Url Options'. Disables 'Add Store Code to Urls'. Clicks on the Save button.</description> </annotations> - + <amOnPage url="{{WebConfigurationPage.url}}" stepKey="navigateToWebConfigurationPagetoReset"/> <waitForPageLoad stepKey="waitForPageLoad2"/> <conditionalClick selector="{{WebSection.UrlOptionsTab}}" dependentSelector="{{WebSection.CheckIfUrlOptionsTabExpand}}" visible="true" stepKey="closeUrlSectionTab"/> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/SelectCountriesWithRequiredRegionActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/SelectCountriesWithRequiredRegionActionGroup.xml new file mode 100644 index 0000000000000..c1e90c1c835b8 --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/SelectCountriesWithRequiredRegionActionGroup.xml @@ -0,0 +1,27 @@ +<?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="SelectCountriesWithRequiredRegionActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'General'. Selects the provided Countries under 'State is Required for'. Clicks on the Save button.</description> + </annotations> + <arguments> + <argument name="countries" type="entity"/> + </arguments> + + <amOnPage url="{{AdminConfigGeneralPage.url}}" stepKey="navigateToAdminConfigGeneralPage"/> + <conditionalClick selector="{{StateOptionsSection.stateOptions}}" dependentSelector="{{StateOptionsSection.countriesWithRequiredRegions}}" visible="false" stepKey="expandStateOptionsTab"/> + <waitForAjaxLoad stepKey="waitForAjax"/> + <scrollTo selector="{{StateOptionsSection.countriesWithRequiredRegions}}" stepKey="scrollToForm"/> + <selectOption selector="{{StateOptionsSection.countriesWithRequiredRegions}}" parameterArray="[{{countries.country}}]" stepKey="selectCountriesWithRequiredRegion"/> + <click selector="#save" stepKey="saveConfig"/> + <waitForPageLoad stepKey="waitForSavingConfig"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/SelectTopDestinationsCountryActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/SelectTopDestinationsCountryActionGroup.xml new file mode 100644 index 0000000000000..8e44bbf912667 --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/SelectTopDestinationsCountryActionGroup.xml @@ -0,0 +1,23 @@ +<?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="SelectTopDestinationsCountryActionGroup"> + <annotations> + <description>Selects the provided Countries under 'Top destinations' on the 'General' section of the 'Configuration' page. Clicks on the Save button.</description> + </annotations> + <arguments> + <argument name="countries" type="entity"/> + </arguments> + + <selectOption selector="{{CountryOptionsSection.topDestinations}}" parameterArray="[{{countries.country}}]" stepKey="selectTopDestinationsCountry"/> + <click selector="#save" stepKey="saveConfig"/> + <waitForPageLoad stepKey="waitForSavingConfig"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/SetTaxApplyOnSettingActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/SetTaxApplyOnSettingActionGroup.xml new file mode 100644 index 0000000000000..f91575b052ac7 --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/SetTaxApplyOnSettingActionGroup.xml @@ -0,0 +1,29 @@ +<?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="SetTaxApplyOnSettingActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'Tax'. Sets 'Apply Tax On' to the provided value. Clicks on the Save button</description> + </annotations> + <arguments> + <argument name="userInput" type="string"/> + </arguments> + + <conditionalClick selector="{{AdminConfigureTaxSection.taxCalculationSettings}}" dependentSelector="{{AdminConfigureTaxSection.taxCalculationAlgorithm}}" visible="false" stepKey="openTaxCalcSettingsSection"/> + <scrollTo selector="{{AdminConfigureTaxSection.taxCalculationApplyTaxOnInherit}}" x="0" y="-80" stepKey="goToCheckbox"/> + <uncheckOption selector="{{AdminConfigureTaxSection.taxCalculationApplyTaxOnInherit}}" stepKey="enableApplyTaxOnSetting"/> + <selectOption selector="{{AdminConfigureTaxSection.taxCalculationApplyTaxOn}}" userInput="{{userInput}}" stepKey="setApplyTaxOn"/> + <scrollTo selector="{{SalesConfigSection.TaxClassesTab}}" stepKey="scrollToTop"/> + <click selector="{{AdminConfigureTaxSection.taxCalculationSettings}}" stepKey="collapseCalcSettingsTab"/> + <click selector="{{AdminConfigureTaxSection.save}}" stepKey="saveConfig"/> + <waitForPageLoad stepKey="waitForConfigSaved"/> + <see userInput="You saved the configuration." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/SetTaxClassForShippingActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/SetTaxClassForShippingActionGroup.xml new file mode 100644 index 0000000000000..a0f05405ba0c9 --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/SetTaxClassForShippingActionGroup.xml @@ -0,0 +1,25 @@ +<?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="SetTaxClassForShippingActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'Tax'. Sets 'Tax Class for Shipping' to 'Taxable Goods'. Clicks on the Save button. PLEASE NOTE: The value is Hardcoded.</description> + </annotations> + + <amOnPage url="{{AdminSalesTaxClassPage.url}}" stepKey="navigateToSalesTaxPage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <conditionalClick selector="{{SalesConfigSection.TaxClassesTab}}" dependentSelector="{{SalesConfigSection.CheckIfTaxClassesTabExpand}}" visible="true" stepKey="expandTaxClassesTab"/> + <waitForElementVisible selector="{{SalesConfigSection.ShippingTaxClass}}" stepKey="seeShippingTaxClass"/> + <uncheckOption selector="{{SalesConfigSection.EnableTaxClassForShipping}}" stepKey="uncheckUseSystemValue"/> + <selectOption selector="{{SalesConfigSection.ShippingTaxClass}}" userInput="Taxable Goods" stepKey="setShippingTaxClass"/> + <click selector="{{SalesConfigSection.TaxClassesTab}}" stepKey="collapseTaxClassesTab"/> + <click selector="{{ContentManagementSection.Save}}" stepKey="saveConfig"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/SwitchToTinyMCE3ActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/SwitchToTinyMCE3ActionGroup.xml new file mode 100644 index 0000000000000..b725610b7b2ee --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/SwitchToTinyMCE3ActionGroup.xml @@ -0,0 +1,26 @@ +<?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="SwitchToTinyMCE3ActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'Content Management'. Sets 'WYSIWYG Editor' to 'TinyMCE 3'. Clicks on the Save button. PLEASE NOTE: The value is Hardcoded.</description> + </annotations> + + <comment userInput="Choose TinyMCE3 as the default editor" stepKey="chooseTinyMCE3AsEditor"/> + <conditionalClick stepKey="expandWYSIWYGOptions1" selector="{{ContentManagementSection.WYSIWYGOptions}}" dependentSelector="{{ContentManagementSection.CheckIfTabExpand}}" visible="true"/> + <waitForElementVisible selector="{{ContentManagementSection.SwitcherSystemValue}}" stepKey="waitForCheckbox2"/> + <uncheckOption selector="{{ContentManagementSection.SwitcherSystemValue}}" stepKey="uncheckUseSystemValue2"/> + <waitForElementVisible selector="{{ContentManagementSection.Switcher}}" stepKey="waitForSwitcherDropdown2"/> + <selectOption selector="{{ContentManagementSection.Switcher}}" userInput="TinyMCE 3" stepKey="switchToVersion3"/> + <click selector="{{ContentManagementSection.WYSIWYGOptions}}" stepKey="collapseWYSIWYGOptions"/> + <click selector="{{ContentManagementSection.Save}}" stepKey="saveConfig"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You saved the configuration." stepKey="seeConfigurationSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/UnSelectTopDestinationsCountryActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/UnSelectTopDestinationsCountryActionGroup.xml new file mode 100644 index 0000000000000..54e4024be5f34 --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/UnSelectTopDestinationsCountryActionGroup.xml @@ -0,0 +1,23 @@ +<?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="UnSelectTopDestinationsCountryActionGroup"> + <annotations> + <description>Un-selects the provided Countries under 'Top destinations' on the 'General' section of the 'Configuration' page. Clicks on the Save button.</description> + </annotations> + <arguments> + <argument name="countries" type="entity"/> + </arguments> + + <unselectOption selector="{{CountryOptionsSection.topDestinations}}" parameterArray="[{{countries.country}}]" stepKey="unSelectTopDestinationsCountry"/> + <click selector="#save" stepKey="saveConfig"/> + <waitForPageLoad stepKey="waitForSavingConfig"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/UseStaticURLForMediaContentInWYSIWYGActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/UseStaticURLForMediaContentInWYSIWYGActionGroup.xml new file mode 100644 index 0000000000000..b7c7ea2067db2 --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/UseStaticURLForMediaContentInWYSIWYGActionGroup.xml @@ -0,0 +1,28 @@ +<?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="UseStaticURLForMediaContentInWYSIWYGActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'Content Management'. Sets 'Use Static URLs for Media Content in WYSIWYG' to the provided value. Clicks on the Save button.</description> + </annotations> + <arguments> + <argument name="value" defaultValue="Yes" type="string"/> + </arguments> + + <amOnPage url="{{ConfigurationStoresPage.url}}" stepKey="navigateToWYSIWYGConfigPage1"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <conditionalClick stepKey="expandWYSIWYGOptions" selector="{{ContentManagementSection.WYSIWYGOptions}}" dependentSelector="{{ContentManagementSection.CheckIfTabExpand}}" visible="true"/> + <waitForElementVisible selector="{{ContentManagementSection.EnableWYSIWYG}}" stepKey="waitForEnableWYSIWYGDropdown1"/> + <selectOption selector="{{ContentManagementSection.StaticURL}}" userInput="{{value}}" stepKey="selectOption1"/> + <click selector="{{ContentManagementSection.WYSIWYGOptions}}" stepKey="collapseWYSIWYGOptions"/> + <click selector="{{ContentManagementSection.Save}}" stepKey="saveConfig"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ConfigurableProductPriceAdditionalStoreViewTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ConfigurableProductPriceAdditionalStoreViewTest.xml index 83d9bbe8c270a..0b078bc7d2a98 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ConfigurableProductPriceAdditionalStoreViewTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ConfigurableProductPriceAdditionalStoreViewTest.xml @@ -19,7 +19,7 @@ <group value="ConfigurableProduct"/> </annotations> <before> - + <createData entity="ApiCategory" stepKey="createCategory"/> <createData entity="ApiConfigurableProduct" stepKey="createConfigProduct"> <requiredEntity createDataKey="createCategory"/> @@ -73,14 +73,14 @@ <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> - <actionGroup ref="ResetWebUrlOptions" stepKey="resetUrlOption"/> + <actionGroup ref="ResetWebUrlOptionsActionGroup" stepKey="resetUrlOption"/> <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteSecondWebsite"> <argument name="websiteName" value="Second Website"/> </actionGroup> <actionGroup ref="logout" stepKey="adminLogout"/> </after> - <actionGroup ref="EnableWebUrlOptions" stepKey="addStoreCodeToUrls"/> + <actionGroup ref="EnableWebUrlOptionsActionGroup" stepKey="addStoreCodeToUrls"/> <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="addNewWebsite"> <argument name="newWebsiteName" value="Second Website"/> <argument name="websiteCode" value="second_website"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AllowedCountriesRestrictionApplyOnBackendTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AllowedCountriesRestrictionApplyOnBackendTest.xml index 6de03e225ae08..194c6e6164f8c 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AllowedCountriesRestrictionApplyOnBackendTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AllowedCountriesRestrictionApplyOnBackendTest.xml @@ -53,7 +53,7 @@ <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteTestWebsite"> <argument name="websiteName" value="{{NewWebSiteData.name}}"/> </actionGroup> - <actionGroup ref="NavigateToConfigurationGeneralPage" stepKey="navigateToConfigGeneralPage2"/> + <actionGroup ref="NavigateToConfigurationGeneralPageActionGroup" stepKey="navigateToConfigGeneralPage2"/> <actionGroup ref="AdminSwitchWebsiteActionGroup" stepKey="adminSwitchWebsiteActionGroup"> <argument name="website" value="_defaultWebsite"/> </actionGroup> @@ -65,7 +65,7 @@ </after> <!--Check that all countries are allowed initially and get amount--> <comment userInput="Check that all countries are allowed initially and get amount" stepKey="checkAllCountriesAreAllowed"/> - <actionGroup ref="NavigateToConfigurationGeneralPage" stepKey="navigateToConfigGeneralPage"/> + <actionGroup ref="NavigateToConfigurationGeneralPageActionGroup" stepKey="navigateToConfigGeneralPage"/> <createData entity="DisableAdminAccountAllowCountry" stepKey="setDefaultValueForAllowCountries"/> <executeJS function="return document.querySelectorAll('{{CountryOptionsSection.allowedCountries}} option').length" stepKey="countriesAmount"/> <!-- Create customer for US --> diff --git a/app/code/Magento/Elasticsearch/Test/Mftf/Test/ProductQuickSearchUsingElasticSearchTest.xml b/app/code/Magento/Elasticsearch/Test/Mftf/Test/ProductQuickSearchUsingElasticSearchTest.xml index d8ce091fba76f..d8abea9196265 100644 --- a/app/code/Magento/Elasticsearch/Test/Mftf/Test/ProductQuickSearchUsingElasticSearchTest.xml +++ b/app/code/Magento/Elasticsearch/Test/Mftf/Test/ProductQuickSearchUsingElasticSearchTest.xml @@ -28,7 +28,7 @@ <after> <deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/> <deleteData createDataKey="categoryFirst" stepKey="deleteCategory"/> - <actionGroup ref="ResetSearchEngineConfiguration" stepKey="resetCatalogSearchConfiguration"/> + <actionGroup ref="ResetSearchEngineConfigurationActionGroup" stepKey="resetCatalogSearchConfiguration"/> <actionGroup ref="updateIndexerOnSave" stepKey="resetIndexerBackToOriginalState"> <argument name="indexerName" value="catalogsearch_fulltext"/> </actionGroup> @@ -37,7 +37,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <comment userInput="Change Catalog search engine option to Elastic Search 5.0+" stepKey="chooseElasticSearch5"/> - <actionGroup ref="ChooseElasticSearchAsSearchEngine" stepKey="chooseES5"/> + <actionGroup ref="ChooseElasticSearchAsSearchEngineActionGroup" stepKey="chooseES5"/> <actionGroup ref="ClearPageCacheActionGroup" stepKey="clearing"/> <actionGroup ref="updateIndexerBySchedule" stepKey="updateAnIndexerBySchedule"> <argument name="indexerName" value="catalogsearch_fulltext"/> @@ -57,4 +57,4 @@ <comment userInput="End of searching products" stepKey="endOfSearchingProducts"/> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin2"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddImageToWYSIWYGNewsletterTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddImageToWYSIWYGNewsletterTest.xml index 0371c0265d149..7ced9d206a28c 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddImageToWYSIWYGNewsletterTest.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddImageToWYSIWYGNewsletterTest.xml @@ -19,7 +19,7 @@ </annotations> <before> <actionGroup ref="LoginActionGroup" stepKey="login"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <!--Create a newsletter template that contains an image--> @@ -57,7 +57,7 @@ <seeElementInDOM selector="{{StorefrontNewsletterSection.imageSource(ImageUpload3.fileName)}}" stepKey="assertMediaSource"/> <closeTab stepKey="closeTab"/> <after> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddVariableToWYSIWYGNewsletterTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddVariableToWYSIWYGNewsletterTest.xml index b6f78b6f33792..958340671ac43 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddVariableToWYSIWYGNewsletterTest.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddVariableToWYSIWYGNewsletterTest.xml @@ -19,7 +19,7 @@ </annotations> <before> <actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <!--Create Custom Variable--> @@ -99,7 +99,7 @@ <dontSee userInput="{{customVariable.html}}" stepKey="dontSeeCustomVariableName" /> <closeTab stepKey="closeTab"/> <after> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddWidgetToWYSIWYGNewsletterTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddWidgetToWYSIWYGNewsletterTest.xml index 273a39a312132..29c125a52c9e2 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddWidgetToWYSIWYGNewsletterTest.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddWidgetToWYSIWYGNewsletterTest.xml @@ -19,7 +19,7 @@ </annotations> <before> <actionGroup ref="LoginActionGroup" stepKey="login"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <amOnPage url="{{NewsletterTemplateForm.url}}" stepKey="amOnNewsletterTemplatePage"/> @@ -54,7 +54,7 @@ <see userInput="Home page" stepKey="seeHomePageCMSPage"/> <closeTab stepKey="closeTab"/> <after> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/VerifySubscribedNewsletterDisplayedTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/VerifySubscribedNewsletterDisplayedTest.xml index 4d60b7676605e..15ce00cd11471 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Test/VerifySubscribedNewsletterDisplayedTest.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Test/VerifySubscribedNewsletterDisplayedTest.xml @@ -37,13 +37,13 @@ <argument name="StoreGroup" value="staticStoreGroup"/> <argument name="customStore" value="staticStore"/> </actionGroup> - <actionGroup ref="EnableWebUrlOptions" stepKey="addStoreCodeToUrls"/> + <actionGroup ref="EnableWebUrlOptionsActionGroup" stepKey="addStoreCodeToUrls"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </before> <after> <!--Delete created data and set Default Configuration--> - <actionGroup ref="ResetWebUrlOptions" stepKey="resetUrlOption"/> + <actionGroup ref="ResetWebUrlOptionsActionGroup" stepKey="resetUrlOption"/> <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite"> <argument name="websiteName" value="Second"/> </actionGroup> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnNewsletterTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnNewsletterTest.xml index 722a0dd22119d..0c20357127e6d 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnNewsletterTest.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnNewsletterTest.xml @@ -19,7 +19,7 @@ </annotations> <before> <actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <amOnPage url="{{NewsletterTemplateForm.url}}" stepKey="amOnNewsletterTemplatePage"/> @@ -48,7 +48,7 @@ <see userInput="Hello World From Newsletter Template!" stepKey="seeContent" /> <closeTab stepKey="closeTab"/> <after> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CreditMemoTotalAfterShippingDiscountTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CreditMemoTotalAfterShippingDiscountTest.xml index ec0f97e418c8c..86b55f854d593 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/CreditMemoTotalAfterShippingDiscountTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/CreditMemoTotalAfterShippingDiscountTest.xml @@ -25,10 +25,10 @@ </createData> <actionGroup ref="LoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearOrderFilters"/> - <actionGroup ref="SetTaxClassForShipping" stepKey="setShippingTaxClass"/> + <actionGroup ref="SetTaxClassForShippingActionGroup" stepKey="setShippingTaxClass"/> </before> <after> - <actionGroup ref="ResetTaxClassForShipping" stepKey="resetTaxClassForShipping"/> + <actionGroup ref="ResetTaxClassForShippingActionGroup" stepKey="resetTaxClassForShipping"/> <actionGroup ref="DeleteCartPriceRuleByName" stepKey="deleteSalesRule"> <argument name="ruleName" value="{{ApiSalesRule.name}}"/> </actionGroup> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxCalcWithApplyTaxOnSettingTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxCalcWithApplyTaxOnSettingTest.xml index d249af983f715..a225144afea34 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxCalcWithApplyTaxOnSettingTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxCalcWithApplyTaxOnSettingTest.xml @@ -28,8 +28,8 @@ <requiredEntity createDataKey="createCategory"/> </createData> <actionGroup ref="LoginActionGroup" stepKey="loginAsAdmin"/> - <actionGroup ref="SetTaxClassForShipping" stepKey="setTaxClass"/> - <actionGroup ref="SetTaxApplyOnSetting" stepKey="setApplyTaxOnSetting"> + <actionGroup ref="SetTaxClassForShippingActionGroup" stepKey="setTaxClass"/> + <actionGroup ref="SetTaxApplyOnSettingActionGroup" stepKey="setApplyTaxOnSetting"> <argument name="userInput" value="Original price only"/> </actionGroup> <amOnPage url="{{AdminEditTaxRulePage.url($$createTaxRule.id$$)}}" stepKey="navigateToEditTaxRulePage"/> @@ -45,10 +45,10 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createTaxRule" stepKey="deleteTaxRule"/> <deleteData stepKey="deleteTaxRate" createDataKey="initialTaxRate" /> - <actionGroup ref="DisableTaxApplyOnOriginalPrice" stepKey="setApplyTaxOffSetting"> + <actionGroup ref="DisableTaxApplyOnOriginalPriceActionGroup" stepKey="setApplyTaxOffSetting"> <argument name="userInput" value="Custom price if available"/> </actionGroup> - <actionGroup ref="ResetTaxClassForShipping" stepKey="resetTaxClassForShipping"/> + <actionGroup ref="ResetTaxClassForShippingActionGroup" stepKey="resetTaxClassForShipping"/> <actionGroup ref="logout" stepKey="logout"/> </after> diff --git a/app/code/Magento/Tinymce3/Test/Mftf/Test/AdminSwitchWYSIWYGOptionsTest.xml b/app/code/Magento/Tinymce3/Test/Mftf/Test/AdminSwitchWYSIWYGOptionsTest.xml index e15886e026c4c..deb94a7f30d34 100644 --- a/app/code/Magento/Tinymce3/Test/Mftf/Test/AdminSwitchWYSIWYGOptionsTest.xml +++ b/app/code/Magento/Tinymce3/Test/Mftf/Test/AdminSwitchWYSIWYGOptionsTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> </before> <amOnPage url="{{ConfigurationStoresPage.url}}" stepKey="navigateToWYSIWYGConfigPage1"/> <waitForPageLoad stepKey="wait1"/> @@ -80,7 +80,7 @@ <see userInput="Hello TinyMCE3!" stepKey="seeContent2"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> <after> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Widget/Test/Mftf/Test/NewProductsListWidgetTest.xml b/app/code/Magento/Widget/Test/Mftf/Test/NewProductsListWidgetTest.xml index c63e76d851933..e2fb9cb50f88a 100644 --- a/app/code/Magento/Widget/Test/Mftf/Test/NewProductsListWidgetTest.xml +++ b/app/code/Magento/Widget/Test/Mftf/Test/NewProductsListWidgetTest.xml @@ -23,7 +23,7 @@ <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> </before> <after> @@ -49,4 +49,4 @@ <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_newDefaultCmsPage.identifier}}" stepKey="fillPageUrlKey"/> <click selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="clickSaveCmsPage"/> </test> -</tests> \ No newline at end of file +</tests> From 86f46bb62423949fc808a492c1c75d416bf24a86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Fri, 29 Nov 2019 10:45:04 +0100 Subject: [PATCH 140/586] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- .../AdminAddImageToWYSIWYGCatalogTest.xml | 16 +- .../CatalogProductListWidgetOperatorsTest.xml | 8 +- .../CatalogProductListWidgetOrderTest.xml | 4 +- .../AddStoreViewToCmsPageActionGroup.xml | 30 ++++ .../AssertCMSPageContentActionGroup.xml | 19 +- .../AssertStoreFrontCMSPageActionGroup.xml | 25 +++ .../ActionGroup/AttachImageActionGroup.xml | 25 +++ .../Test/Mftf/ActionGroup/CMSActionGroup.xml | 170 ------------------ ...ePageContentWYSIWYGDisabledActionGroup.xml | 20 +++ .../ClearWidgetsFromCMSContentActionGroup.xml | 13 +- ...ClickBrowseBtnOnUploadPopupActionGroup.xml | 19 ++ .../CreateImageFolderActionGroup.xml | 31 ++++ .../CreateNewPageWithAllValuesActionGroup.xml | 8 +- ...PageWithAllValuesAndContentActionGroup.xml | 17 ++ .../ActionGroup/DeleteCMSBlockActionGroup.xml | 25 +++ .../ActionGroup/DeleteImageActionGroup.xml | 23 +++ .../FillOutUploadImagePopupActionGroup.xml | 22 +++ ...vigateToCreatedCMSBlockPageActionGroup.xml | 34 ++++ .../NavigateToCreatedCMSPageActionGroup.xml | 35 ++++ ...eToStorefrontForCreatedPageActionGroup.xml | 22 +++ ...loseCMSBlockWithSplitButtonActionGroup.xml | 22 +++ .../SaveAndContinueEditCmsPageActionGroup.xml | 22 +++ .../ActionGroup/SaveCMSBlockActionGroup.xml | 21 +++ .../ActionGroup/SaveCmsPageActionGroup.xml | 23 +++ .../Mftf/ActionGroup/SaveImageActionGroup.xml | 20 +++ ...SelectImageFromMediaStorageActionGroup.xml | 120 ------------- .../Mftf/ActionGroup/SetLayoutActionGroup.xml | 26 +++ .../VerifyMagentoEntityActionGroup.xml | 19 ++ ...yMediaGalleryStorageActionsActionGroup.xml | 22 +++ ...VerifyOversizeValidationMsgActionGroup.xml | 19 ++ .../ActionGroup/VerifyTinyMCEActionGroup.xml | 11 +- ...WrongExtensionValidationMsgActionGroup.xml | 19 ++ .../AdminAddImageToCMSPageTinyMCE3Test.xml | 8 +- .../Test/AdminAddImageToWYSIWYGBlockTest.xml | 18 +- .../Test/AdminAddImageToWYSIWYGCMSTest.xml | 18 +- .../AdminAddVariableToWYSIWYGBlockTest.xml | 2 +- .../Test/AdminAddWidgetToWYSIWYGBlockTest.xml | 4 +- .../Test/Mftf/Test/AdminCreateCmsPageTest.xml | 2 +- ...lleryPopupUploadImagesWithoutErrorTest.xml | 2 +- ...CheckOrderOfProdsInWidgetOnCMSPageTest.xml | 4 +- .../StoreViewLanguageCorrectSwitchTest.xml | 2 +- .../AdminAddImageToWYSIWYGNewsletterTest.xml | 12 +- ...esignConfigMediaGalleryImageUploadTest.xml | 6 +- ...eUrlRewriteAndAddPermanentRedirectTest.xml | 10 +- ...eUrlRewriteAndAddTemporaryRedirectTest.xml | 10 +- 45 files changed, 610 insertions(+), 398 deletions(-) create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/AddStoreViewToCmsPageActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertStoreFrontCMSPageActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/AttachImageActionGroup.xml delete mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/CMSActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/ClearWidgetsForCMSHomePageContentWYSIWYGDisabledActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/ClickBrowseBtnOnUploadPopupActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateImageFolderActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateNewPageWithAllValuesAndContentActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/DeleteCMSBlockActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/DeleteImageActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/FillOutUploadImagePopupActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/NavigateToCreatedCMSBlockPageActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/NavigateToCreatedCMSPageActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/NavigateToStorefrontForCreatedPageActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveAndCloseCMSBlockWithSplitButtonActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveAndContinueEditCmsPageActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveCMSBlockActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveCmsPageActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveImageActionGroup.xml delete mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/SelectImageFromMediaStorageActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/SetLayoutActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyMagentoEntityActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyMediaGalleryStorageActionsActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyOversizeValidationMsgActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyWrongExtensionValidationMsgActionGroup.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGCatalogTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGCatalogTest.xml index c36c29ce594d0..81694749fa79b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGCatalogTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGCatalogTest.xml @@ -31,20 +31,20 @@ <waitForElementVisible selector="{{CatalogWYSIWYGSection.TinyMCE4}}" stepKey="waitForTinyMCE4" /> <click selector="{{CatalogWYSIWYGSection.InsertImageIcon}}" stepKey="clickInsertImageIcon" /> <waitForPageLoad stepKey="waitForPageLoad" /> - <actionGroup ref="clickBrowseBtnOnUploadPopup" stepKey="clickBrowserBtn"/> - <actionGroup ref="VerifyMediaGalleryStorageActions" stepKey="VerifyMediaGalleryStorageBtn"/> - <actionGroup ref="CreateImageFolder" stepKey="CreateImageFolder"> + <actionGroup ref="ClickBrowseBtnOnUploadPopupActionGroup" stepKey="clickBrowserBtn"/> + <actionGroup ref="VerifyMediaGalleryStorageActionsActionGroup" stepKey="VerifyMediaGalleryStorageBtn"/> + <actionGroup ref="CreateImageFolderActionGroup" stepKey="CreateImageFolder"> <argument name="ImageFolder" value="ImageFolder"/> </actionGroup> - <actionGroup ref="attachImage" stepKey="attachImage1"> + <actionGroup ref="AttachImageActionGroup" stepKey="attachImage1"> <argument name="Image" value="ImageUpload3"/> </actionGroup> - <actionGroup ref="deleteImage" stepKey="deleteImage"/> - <actionGroup ref="attachImage" stepKey="attachImage2"> + <actionGroup ref="DeleteImageActionGroup" stepKey="deleteImage"/> + <actionGroup ref="AttachImageActionGroup" stepKey="attachImage2"> <argument name="Image" value="ImageUpload3"/> </actionGroup> - <actionGroup ref="saveImage" stepKey="insertImage"/> - <actionGroup ref="fillOutUploadImagePopup" stepKey="fillOutUploadImagePopup" /> + <actionGroup ref="SaveImageActionGroup" stepKey="insertImage"/> + <actionGroup ref="FillOutUploadImagePopupActionGroup" stepKey="fillOutUploadImagePopup" /> <click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCatalog"/> <amOnPage url="/{{SimpleSubCategory.name_lwr}}.html" stepKey="goToCategoryFrontPage"/> <waitForPageLoad stepKey="waitForPageLoad2"/> diff --git a/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOperatorsTest.xml b/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOperatorsTest.xml index 32bea8b604cf8..bc1542cd2ea28 100644 --- a/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOperatorsTest.xml +++ b/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOperatorsTest.xml @@ -42,7 +42,7 @@ </before> <!--Open block with widget.--> - <actionGroup ref="navigateToCreatedCMSBlockPage" stepKey="navigateToCreatedCMSBlockPage1"> + <actionGroup ref="NavigateToCreatedCMSBlockPageActionGroup" stepKey="navigateToCreatedCMSBlockPage1"> <argument name="CMSBlockPage" value="$$createPreReqBlock$$"/> </actionGroup> @@ -85,7 +85,7 @@ <seeElement selector="{{InsertWidgetSection.checkElementStorefrontByPrice('100')}}" stepKey="seeElementByPrice100"/> <!--Open block with widget.--> - <actionGroup ref="navigateToCreatedCMSBlockPage" stepKey="navigateToCreatedCMSBlockPage2"> + <actionGroup ref="NavigateToCreatedCMSBlockPageActionGroup" stepKey="navigateToCreatedCMSBlockPage2"> <argument name="CMSBlockPage" value="$$createPreReqBlock$$"/> </actionGroup> @@ -105,7 +105,7 @@ <dontSeeElement selector="{{InsertWidgetSection.checkElementStorefrontByPrice('100')}}" stepKey="dontSeeElementByPrice100"/> <!--Open block with widget.--> - <actionGroup ref="navigateToCreatedCMSBlockPage" stepKey="navigateToCreatedCMSBlockPage3"> + <actionGroup ref="NavigateToCreatedCMSBlockPageActionGroup" stepKey="navigateToCreatedCMSBlockPage3"> <argument name="CMSBlockPage" value="$$createPreReqBlock$$"/> </actionGroup> @@ -125,7 +125,7 @@ <seeElement selector="{{InsertWidgetSection.checkElementStorefrontByPrice('100')}}" stepKey="seeElementByPrice100s"/> <!--Open block with widget.--> - <actionGroup ref="navigateToCreatedCMSBlockPage" stepKey="navigateToCreatedCMSBlockPage4"> + <actionGroup ref="NavigateToCreatedCMSBlockPageActionGroup" stepKey="navigateToCreatedCMSBlockPage4"> <argument name="CMSBlockPage" value="$$createPreReqBlock$$"/> </actionGroup> diff --git a/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOrderTest.xml b/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOrderTest.xml index 11586207c4d8e..cceb25ecebe21 100644 --- a/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOrderTest.xml +++ b/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOrderTest.xml @@ -42,7 +42,7 @@ </before> <!--Open created cms page--> <comment userInput="Open created cms page" stepKey="commentOpenCreatedCmsPage"/> - <actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPage1"> + <actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage1"> <argument name="CMSPage" value="$$createPreReqPage$$"/> </actionGroup> <!--Add widget to cms page--> @@ -85,4 +85,4 @@ <actionGroup ref="logout" stepKey="logout"/> </after> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AddStoreViewToCmsPageActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AddStoreViewToCmsPageActionGroup.xml new file mode 100644 index 0000000000000..505f3bebbf70c --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AddStoreViewToCmsPageActionGroup.xml @@ -0,0 +1,30 @@ +<?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="AddStoreViewToCmsPageActionGroup" extends="NavigateToCreatedCMSPageActionGroup"> + <annotations> + <description>EXTENDS: navigateToCreatedCMSPage. Adds the provided Store View to a Page.</description> + </annotations> + <arguments> + <argument name="storeViewName" type="string"/> + </arguments> + + <remove keyForRemoval="clickExpandContentTabForPage"/> + <remove keyForRemoval="waitForLoadingMaskOfStagingSection"/> + <click selector="{{CmsNewPagePiwSection.header}}" stepKey="clickPageInWebsites" after="waitForPageLoad3"/> + <waitForElementVisible selector="{{CmsNewPagePiwSection.selectStoreView(storeViewName)}}" stepKey="waitForStoreGridReload"/> + <clickWithLeftButton selector="{{CmsNewPagePiwSection.selectStoreView(storeViewName)}}" stepKey="clickStoreView"/> + <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> + <waitForElementVisible selector="{{CmsNewPagePageActionsSection.splitButtonMenu}}" stepKey="waitForSplitButtonMenuVisible"/> + <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <see userInput="You saved the page." stepKey="seeMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageContentActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageContentActionGroup.xml index 336ed8ea495ec..7697931a24176 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageContentActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageContentActionGroup.xml @@ -8,11 +8,11 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AssertCMSPageContent"> + <actionGroup name="AssertCMSPageContentActionGroup"> <annotations> <description>Validates that the CMS Page details are present and correct. PLEASE NOTE: The CMS Page data is Hardcoded, using '_duplicatedCMSPage'.</description> </annotations> - + <grabValueFrom selector="{{CmsNewPagePageBasicFieldsSection.pageTitle}}" stepKey="grabTextFromTitle"/> <assertEquals stepKey="assertTitle" message="pass"> <expectedResult type="string">{{_duplicatedCMSPage.title}}</expectedResult> @@ -28,19 +28,4 @@ <executeJS function="(el = document.querySelector('[name=\'identifier\']')) && el['se' + 'tAt' + 'tribute']('data-value', el.value.split('-')[0]);" stepKey="setAttribute"/> <seeElement selector="{{CmsNewPagePageBasicFieldsSection.duplicatedURLKey(_duplicatedCMSPage.title)}}" stepKey="see"/> </actionGroup> - - <actionGroup name="AssertStoreFrontCMSPage"> - <annotations> - <description>Validates that the provided CMS Page Title, Content and Heading are present and correct on a Storefront CMS Page.</description> - </annotations> - <arguments> - <argument name="cmsTitle" type="string"/> - <argument name="cmsContent" type="string"/> - <argument name="cmsContentHeading" type="string"/> - </arguments> - - <see selector="{{StorefrontCMSPageSection.title}}" userInput="{{cmsTitle}}" stepKey="seeTitle"/> - <see selector="{{StorefrontCMSPageSection.mainTitle}}" userInput="{{cmsContentHeading}}" stepKey="seeContentHeading"/> - <see selector="{{StorefrontCMSPageSection.mainContent}}" userInput="{{cmsContent}}" stepKey="seeContent"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertStoreFrontCMSPageActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertStoreFrontCMSPageActionGroup.xml new file mode 100644 index 0000000000000..136fecbab5d8b --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertStoreFrontCMSPageActionGroup.xml @@ -0,0 +1,25 @@ +<?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="AssertStoreFrontCMSPageActionGroup"> + <annotations> + <description>Validates that the provided CMS Page Title, Content and Heading are present and correct on a Storefront CMS Page.</description> + </annotations> + <arguments> + <argument name="cmsTitle" type="string"/> + <argument name="cmsContent" type="string"/> + <argument name="cmsContentHeading" type="string"/> + </arguments> + + <see selector="{{StorefrontCMSPageSection.title}}" userInput="{{cmsTitle}}" stepKey="seeTitle"/> + <see selector="{{StorefrontCMSPageSection.mainTitle}}" userInput="{{cmsContentHeading}}" stepKey="seeContentHeading"/> + <see selector="{{StorefrontCMSPageSection.mainContent}}" userInput="{{cmsContent}}" stepKey="seeContent"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AttachImageActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AttachImageActionGroup.xml new file mode 100644 index 0000000000000..f4eb3ced2a203 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AttachImageActionGroup.xml @@ -0,0 +1,25 @@ +<?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="AttachImageActionGroup"> + <annotations> + <description>Uploads the provided Image to Media Gallery. + If you use this action group, you MUST add steps to delete the image in the "after" steps.</description> + </annotations> + <arguments> + <argument name="Image"/> + </arguments> + + <attachFile selector="{{MediaGallerySection.BrowseUploadImage}}" userInput="{{Image.value}}" stepKey="uploadImage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/> + <waitForElementVisible selector="{{MediaGallerySection.imageOrImageCopy(Image.fileName, Image.extension)}}" stepKey="waitForUploadImage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/CMSActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/CMSActionGroup.xml deleted file mode 100644 index a75090179460b..0000000000000 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/CMSActionGroup.xml +++ /dev/null @@ -1,170 +0,0 @@ -<?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="navigateToCreatedCMSPage"> - <annotations> - <description>Goes to the Admin CMS Pages page. </description> - </annotations> - <arguments> - <argument name="CMSPage" defaultValue=""/> - </arguments> - - <amOnPage url="{{CmsPagesPage.url}}" stepKey="navigateToCMSPagesGrid"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - <conditionalClick selector="{{CmsPagesPageActionsSection.clearAllButton}}" dependentSelector="{{CmsPagesPageActionsSection.activeFilters}}" stepKey="clickToResetFilter" visible="true"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - <conditionalClick selector="//div[contains(@data-role, 'grid-wrapper')]/table/thead/tr/th/span[contains(text(), 'ID')]" dependentSelector="//span[contains(text(), 'ID')]/parent::th[not(contains(@class, '_descend'))]/parent::tr/parent::thead/parent::table/parent::div[contains(@data-role, 'grid-wrapper')]" stepKey="clickToAttemptSortByIdDescending" visible="true"/> - <waitForLoadingMaskToDisappear stepKey="waitForFirstIdSortDescendingToFinish"/> - - <!-- Conditional Click again in case it goes from default state to ascending on first click --> - <conditionalClick selector="//div[contains(@data-role, 'grid-wrapper')]/table/thead/tr/th/span[contains(text(), 'ID')]" dependentSelector="//span[contains(text(), 'ID')]/parent::th[not(contains(@class, '_descend'))]/parent::tr/parent::thead/parent::table/parent::div[contains(@data-role, 'grid-wrapper')]" stepKey="secondClickToAttemptSortByIdDescending" visible="true"/> - <waitForLoadingMaskToDisappear stepKey="waitForSecondIdSortDescendingToFinish"/> - <click selector="{{CmsPagesPageActionsSection.select(CMSPage.identifier)}}" stepKey="clickSelectCreatedCMSPage"/> - <click selector="{{CmsPagesPageActionsSection.edit(CMSPage.identifier)}}" stepKey="navigateToCreatedCMSPage"/> - <waitForPageLoad stepKey="waitForPageLoad3"/> - <click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickExpandContentTabForPage"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskOfStagingSection"/> - </actionGroup> - - <actionGroup name="navigateToCreatedCMSBlockPage"> - <annotations> - <description>Goes to the Admin Blocks page. Clicks on 'Edit' for the provided Block.</description> - </annotations> - <arguments> - <argument name="CMSBlockPage" defaultValue=""/> - </arguments> - - <amOnPage url="{{CmsBlocksPage.url}}" stepKey="navigateToCMSBlocksGrid"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - <conditionalClick selector="{{CmsPagesPageActionsSection.clearAllButton}}" dependentSelector="{{CmsPagesPageActionsSection.activeFilters}}" stepKey="clickToResetFilter" visible="true"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - <conditionalClick selector="{{BlockPageActionsSection.idColumn}}" dependentSelector="//span[contains(text(), 'ID')]/parent::th[not(contains(@class, '_descend'))]/parent::tr/parent::thead/parent::table/parent::div[contains(@data-role, 'grid-wrapper')]" stepKey="clickToAttemptSortByIdDescending" visible="true"/> - <waitForLoadingMaskToDisappear stepKey="waitForFirstIdSortDescendingToFinish"/> - - <!-- Conditional Click again in case it goes from default state to ascending on first click --> - <conditionalClick selector="{{BlockPageActionsSection.idColumn}}" dependentSelector="//span[contains(text(), 'ID')]/parent::th[not(contains(@class, '_descend'))]/parent::tr/parent::thead/parent::table/parent::div[contains(@data-role, 'grid-wrapper')]" stepKey="secondClickToAttemptSortByIdDescending" visible="true"/> - <waitForLoadingMaskToDisappear stepKey="waitForSecondIdSortDescendingToFinish"/> - <click selector="{{BlockPageActionsSection.select(CMSBlockPage.identifier)}}" stepKey="clickSelectCreatedCMSBlock"/> - <click selector="{{BlockPageActionsSection.edit(CMSBlockPage.identifier)}}" stepKey="navigateToCreatedCMSBlock"/> - <waitForPageLoad stepKey="waitForPageLoad3"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskOfStagingSection"/> - </actionGroup> - - <actionGroup name="DeleteCMSBlockActionGroup"> - <annotations> - <description>Goes to the Admin CMS Blocks page. Deletes the '_defaultBlock' Block. Validates that the Success Message is present and correct. PLEASE NOTE: The Block that is deleted it Hardcoded.</description> - </annotations> - - <amOnPage url="{{CmsBlocksPage.url}}" stepKey="navigateToCMSPagesGrid"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <click selector="{{CmsPagesPageActionsSection.select(_defaultBlock.title)}}" stepKey="ClickOnSelect"/> - <click selector="{{CmsPagesPageActionsSection.delete(_defaultBlock.title)}}" stepKey="ClickOnEdit"/> - <waitForPageLoad stepKey="waitForPageLoad3"/> - <click selector="{{CmsPagesPageActionsSection.deleteConfirm}}" stepKey="ClickToConfirm"/> - <waitForPageLoad stepKey="waitForPageLoad4"/> - <see userInput="You deleted the block." stepKey="VerifyBlockIsDeleted"/> - </actionGroup> - - <actionGroup name="AddStoreViewToCmsPage" extends="navigateToCreatedCMSPage"> - <annotations> - <description>EXTENDS: navigateToCreatedCMSPage. Adds the provided Store View to a Page.</description> - </annotations> - <arguments> - <argument name="storeViewName" type="string"/> - </arguments> - - <remove keyForRemoval="clickExpandContentTabForPage"/> - <remove keyForRemoval="waitForLoadingMaskOfStagingSection"/> - <click selector="{{CmsNewPagePiwSection.header}}" stepKey="clickPageInWebsites" after="waitForPageLoad3"/> - <waitForElementVisible selector="{{CmsNewPagePiwSection.selectStoreView(storeViewName)}}" stepKey="waitForStoreGridReload"/> - <clickWithLeftButton selector="{{CmsNewPagePiwSection.selectStoreView(storeViewName)}}" stepKey="clickStoreView"/> - <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> - <waitForElementVisible selector="{{CmsNewPagePageActionsSection.splitButtonMenu}}" stepKey="waitForSplitButtonMenuVisible"/> - <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <see userInput="You saved the page." stepKey="seeMessage"/> - </actionGroup> - - <actionGroup name="saveAndCloseCMSBlockWithSplitButton"> - <annotations> - <description>Clicks on the Save and Close button.</description> - </annotations> - - <waitForElementVisible selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="waitForExpandSplitButtonToBeVisible"/> - <click selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitButton"/> - <click selector="{{BlockNewPagePageActionsSection.saveAndClose}}" stepKey="clickSaveBlock"/> - <waitForPageLoad stepKey="waitForPageLoadAfterClickingSave"/> - <see userInput="You saved the block." stepKey="assertSaveBlockSuccessMessage"/> - </actionGroup> - - <actionGroup name="navigateToStorefrontForCreatedPage"> - <annotations> - <description>Goes to the provided Page on the Storefront.</description> - </annotations> - <arguments> - <argument name="page" type="string"/> - </arguments> - - <amOnPage url="{{page}}" stepKey="goToStorefront"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - </actionGroup> - - <actionGroup name="saveCMSBlock"> - <annotations> - <description>Clicks on the Save button. Validates that the Save message is present and correct. PLEASE NOTE: The message is Hardcoded.</description> - </annotations> - - <waitForElementVisible selector="{{CmsNewBlockBlockActionsSection.savePage}}" stepKey="waitForSaveButton"/> - <click selector="{{CmsNewBlockBlockActionsSection.savePage}}" stepKey="clickSaveButton"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <see userInput="You saved the block." stepKey="seeSuccessfulSaveMessage"/> - </actionGroup> - - <actionGroup name="saveAndContinueEditCmsPage"> - <annotations> - <description>Clicks on the Save and Continue button.</description> - </annotations> - - <waitForElementVisible time="10" selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="waitForSaveAndContinueVisibility"/> - <click selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="clickSaveAndContinueEditCmsPage"/> - <waitForPageLoad stepKey="waitForCmsPageLoad"/> - <waitForElementVisible time="1" selector="{{CmsNewPagePageActionsSection.cmsPageTitle}}" stepKey="waitForCmsPageSaveButton"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> - </actionGroup> - - <actionGroup name="saveCmsPage"> - <annotations> - <description>Clicks on the Save button. Validates that the Success Message is present.</description> - </annotations> - - <waitForElementVisible selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="waitForSplitButton"/> - <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitButton"/> - <waitForElementVisible selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="waitForSaveCmsPage"/> - <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSaveCmsPage"/> - <waitForElementVisible time="1" selector="{{CmsPagesPageActionsSection.addNewPageButton}}" stepKey="waitForCmsPageSaveButton"/> - <see userInput="You saved the page." selector="{{CmsPagesPageActionsSection.savePageSuccessMessage}}" stepKey="assertSavePageSuccessMessage"/> - </actionGroup> - - <actionGroup name="setLayout"> - <annotations> - <description>Sets the provided option for 'Layout', under 'Design' on the Page creation/edit page. </description> - </annotations> - <arguments> - <argument name="designSection"/> - <argument name="layoutOption"/> - </arguments> - - <waitForElementVisible selector="{{designSection.DesignTab}}" stepKey="waitForDesignTabVisible"/> - <conditionalClick selector="{{designSection.DesignTab}}" dependentSelector="{{designSection.LayoutDropdown}}" visible="false" stepKey="clickOnDesignTab"/> - <waitForPageLoad stepKey="waitForPageLoadDesignTab"/> - <waitForElementVisible selector="{{designSection.LayoutDropdown}}" stepKey="waitForLayoutDropDown"/> - <selectOption selector="{{designSection.LayoutDropdown}}" userInput="{{layoutOption}}" stepKey="selectLayout"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/ClearWidgetsForCMSHomePageContentWYSIWYGDisabledActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/ClearWidgetsForCMSHomePageContentWYSIWYGDisabledActionGroup.xml new file mode 100644 index 0000000000000..adaeb8c90ff0b --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/ClearWidgetsForCMSHomePageContentWYSIWYGDisabledActionGroup.xml @@ -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="ClearWidgetsForCMSHomePageContentWYSIWYGDisabledActionGroup"> + <amOnPage url="{{CmsPageEditPage.url('2')}}" stepKey="navigateToEditHomePagePage"/> + <waitForPageLoad stepKey="waitForCmsPageEditPage"/> + <conditionalClick selector="{{CmsNewPagePageActionsSection.contentSectionName}}" dependentSelector="{{CatalogWidgetSection.insertWidgetButton}}" visible="false" stepKey="clickShowHideEditorIfVisible"/> + <waitForElementVisible selector="{{CmsNewPagePageContentSection.content}}" stepKey="waitForContentField"/> + <fillField selector="{{CmsNewPagePageContentSection.content}}" userInput="CMS homepage content goes here." stepKey="resetCMSPageToDefaultContent"/> + <click selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="clickSave"/> + <waitForPageLoad stepKey="waitForSettingsApply"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/ClearWidgetsFromCMSContentActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/ClearWidgetsFromCMSContentActionGroup.xml index b176de3748282..98de51574aa4b 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/ClearWidgetsFromCMSContentActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/ClearWidgetsFromCMSContentActionGroup.xml @@ -8,11 +8,11 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="ClearWidgetsFromCMSContent"> + <actionGroup name="ClearWidgetsFromCMSContentActionGroup"> <annotations> <description>Goes to the Admin CMS Page Edit page for the Page ID number 2. Clears the Widget and replaces it with Text. PLEASE NOTE: The Page ID/Text are Hardcoded.</description> </annotations> - + <amOnPage url="{{CmsPageEditPage.url('2')}}" stepKey="navigateToEditHomePagePage"/> <waitForPageLoad stepKey="waitEditHomePagePageToLoad"/> <click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickContentTab"/> @@ -26,13 +26,4 @@ <waitForPageLoad stepKey="waitSaveToBeApplied"/> <see selector="{{AdminProductMessagesSection.successMessage}}" userInput="You saved the page." stepKey="seeSaveSuccess"/> </actionGroup> - <actionGroup name="ClearWidgetsForCMSHomePageContentWYSIWYGDisabled"> - <amOnPage url="{{CmsPageEditPage.url('2')}}" stepKey="navigateToEditHomePagePage"/> - <waitForPageLoad stepKey="waitForCmsPageEditPage"/> - <conditionalClick selector="{{CmsNewPagePageActionsSection.contentSectionName}}" dependentSelector="{{CatalogWidgetSection.insertWidgetButton}}" visible="false" stepKey="clickShowHideEditorIfVisible"/> - <waitForElementVisible selector="{{CmsNewPagePageContentSection.content}}" stepKey="waitForContentField"/> - <fillField selector="{{CmsNewPagePageContentSection.content}}" userInput="CMS homepage content goes here." stepKey="resetCMSPageToDefaultContent"/> - <click selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="clickSave"/> - <waitForPageLoad stepKey="waitForSettingsApply"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/ClickBrowseBtnOnUploadPopupActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/ClickBrowseBtnOnUploadPopupActionGroup.xml new file mode 100644 index 0000000000000..b0c0278f0c1a5 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/ClickBrowseBtnOnUploadPopupActionGroup.xml @@ -0,0 +1,19 @@ +<?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="ClickBrowseBtnOnUploadPopupActionGroup"> + <annotations> + <description>Clicks on the Browse button in the 'Insert/edit image' model.</description> + </annotations> + + <click selector="{{MediaGallerySection.Browse}}" stepKey="clickBrowse"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateImageFolderActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateImageFolderActionGroup.xml new file mode 100644 index 0000000000000..e39263debd127 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateImageFolderActionGroup.xml @@ -0,0 +1,31 @@ +<?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="CreateImageFolderActionGroup"> + <annotations> + <description>Creates a folder in the Media Gallery based on the provided Folder.</description> + </annotations> + <arguments> + <argument name="ImageFolder" defaultValue="ImageFolder"/> + </arguments> + + <click selector="{{MediaGallerySection.CreateFolder}}" stepKey="createFolder"/> + <waitForElementVisible selector="{{MediaGallerySection.FolderName}}" stepKey="waitForPopUp"/> + <fillField selector="{{MediaGallerySection.FolderName}}" userInput="{{ImageFolder.name}}" stepKey="fillFolderName"/> + <click selector="{{MediaGallerySection.AcceptFolderName}}" stepKey="acceptFolderName"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoading3"/> + <waitForPageLoad stepKey="waitForLoadingArrowToExpand" time="15"/> + <conditionalClick selector="{{MediaGallerySection.StorageRootArrow}}" dependentSelector="{{MediaGallerySection.checkIfArrowExpand}}" stepKey="clickArrowIfClosed" visible="true"/> + <conditionalClick selector="{{MediaGallerySection.WysiwygArrow}}" dependentSelector="{{MediaGallerySection.checkIfWysiwygArrowExpand}}" stepKey="clickWysiwygArrowIfClosed" visible="true"/> + <waitForText userInput="{{ImageFolder.name}}" stepKey="waitForNewFolder"/> + <click userInput="{{ImageFolder.name}}" stepKey="clickOnCreatedFolder"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoading5"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateNewPageWithAllValuesActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateNewPageWithAllValuesActionGroup.xml index fa5cccafccd54..fb8250ae00f27 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateNewPageWithAllValuesActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateNewPageWithAllValuesActionGroup.xml @@ -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="CreateNewPageWithAllValues"> + <actionGroup name="CreateNewPageWithAllValuesActionGroup"> <annotations> <description>Goes to the Admin CMS creation page. Fills in the provided Page details (Title, Heading, URL, Store View and Hierarchy).</description> </annotations> @@ -33,10 +33,4 @@ <click selector="{{CmsNewPageHierarchySection.header}}" stepKey="clickHierarchy"/> <click selector="{{CmsNewPageHierarchySection.selectHierarchy(selectHierarchyOpt)}}" stepKey="clickPageCheckBoxes"/> </actionGroup> - <actionGroup name="CreateNewPageWithAllValuesAndContent" extends="CreateNewPageWithAllValues"> - <arguments> - <argument name="pageContent" type="string"/> - </arguments> - <fillField selector="{{CmsNewPagePageContentSection.content}}" userInput="{{pageContent}}" stepKey="fillContentField" after="fillFieldContentHeading"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateNewPageWithAllValuesAndContentActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateNewPageWithAllValuesAndContentActionGroup.xml new file mode 100644 index 0000000000000..201e78fff6dbe --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateNewPageWithAllValuesAndContentActionGroup.xml @@ -0,0 +1,17 @@ +<?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="CreateNewPageWithAllValuesAndContentActionGroup" extends="CreateNewPageWithAllValues"> + <arguments> + <argument name="pageContent" type="string"/> + </arguments> + <fillField selector="{{CmsNewPagePageContentSection.content}}" userInput="{{pageContent}}" stepKey="fillContentField" after="fillFieldContentHeading"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/DeleteCMSBlockActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/DeleteCMSBlockActionGroup.xml new file mode 100644 index 0000000000000..2f9b03f1e33b3 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/DeleteCMSBlockActionGroup.xml @@ -0,0 +1,25 @@ +<?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="DeleteCMSBlockActionGroup"> + <annotations> + <description>Goes to the Admin CMS Blocks page. Deletes the '_defaultBlock' Block. Validates that the Success Message is present and correct. PLEASE NOTE: The Block that is deleted it Hardcoded.</description> + </annotations> + + <amOnPage url="{{CmsBlocksPage.url}}" stepKey="navigateToCMSPagesGrid"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <click selector="{{CmsPagesPageActionsSection.select(_defaultBlock.title)}}" stepKey="ClickOnSelect"/> + <click selector="{{CmsPagesPageActionsSection.delete(_defaultBlock.title)}}" stepKey="ClickOnEdit"/> + <waitForPageLoad stepKey="waitForPageLoad3"/> + <click selector="{{CmsPagesPageActionsSection.deleteConfirm}}" stepKey="ClickToConfirm"/> + <waitForPageLoad stepKey="waitForPageLoad4"/> + <see userInput="You deleted the block." stepKey="VerifyBlockIsDeleted"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/DeleteImageActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/DeleteImageActionGroup.xml new file mode 100644 index 0000000000000..3bf2c6795bcb6 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/DeleteImageActionGroup.xml @@ -0,0 +1,23 @@ +<?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="DeleteImageActionGroup"> + <annotations> + <description>Deletes the selected Image from the Media Gallery.</description> + </annotations> + + <see selector="{{MediaGallerySection.DeleteSelectedBtn}}" userInput="Delete Selected" stepKey="seeDeleteBtn"/> + <click selector="{{MediaGallerySection.DeleteSelectedBtn}}" stepKey="clickDeleteSelected"/> + <waitForText userInput="OK" stepKey="waitForConfirm"/> + <click selector="{{MediaGallerySection.confirmDelete}}" stepKey="confirmDelete"/> + <waitForElementNotVisible selector="{{MediaGallerySection.image(ImageUpload.file)}}" stepKey="waitForImageDeleted"/> + <dontSeeElement selector="{{MediaGallerySection.image(ImageUpload.file)}}" stepKey="dontSeeImage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/FillOutUploadImagePopupActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/FillOutUploadImagePopupActionGroup.xml new file mode 100644 index 0000000000000..dc4abe9a5115a --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/FillOutUploadImagePopupActionGroup.xml @@ -0,0 +1,22 @@ +<?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="FillOutUploadImagePopupActionGroup"> + <annotations> + <description>Fills in the Image Description and Height fields. PLEASE NOTE: The values are Hardcoded using 'ImageUpload'.</description> + </annotations> + + <waitForElementVisible selector="{{MediaGallerySection.OkBtn}}" stepKey="waitForOkBtn"/> + <fillField selector="{{MediaGallerySection.ImageDescription}}" userInput="{{ImageUpload.content}}" stepKey="fillImageDescription"/> + <fillField selector="{{MediaGallerySection.Height}}" userInput="{{ImageUpload.height}}" stepKey="fillImageHeight"/> + <click selector="{{MediaGallerySection.OkBtn}}" stepKey="clickOkBtn"/> + <waitForPageLoad stepKey="wait3"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/NavigateToCreatedCMSBlockPageActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/NavigateToCreatedCMSBlockPageActionGroup.xml new file mode 100644 index 0000000000000..06bc3787579e4 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/NavigateToCreatedCMSBlockPageActionGroup.xml @@ -0,0 +1,34 @@ +<?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="NavigateToCreatedCMSBlockPageActionGroup"> + <annotations> + <description>Goes to the Admin Blocks page. Clicks on 'Edit' for the provided Block.</description> + </annotations> + <arguments> + <argument name="CMSBlockPage" defaultValue=""/> + </arguments> + + <amOnPage url="{{CmsBlocksPage.url}}" stepKey="navigateToCMSBlocksGrid"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <conditionalClick selector="{{CmsPagesPageActionsSection.clearAllButton}}" dependentSelector="{{CmsPagesPageActionsSection.activeFilters}}" stepKey="clickToResetFilter" visible="true"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + <conditionalClick selector="{{BlockPageActionsSection.idColumn}}" dependentSelector="//span[contains(text(), 'ID')]/parent::th[not(contains(@class, '_descend'))]/parent::tr/parent::thead/parent::table/parent::div[contains(@data-role, 'grid-wrapper')]" stepKey="clickToAttemptSortByIdDescending" visible="true"/> + <waitForLoadingMaskToDisappear stepKey="waitForFirstIdSortDescendingToFinish"/> + + <!-- Conditional Click again in case it goes from default state to ascending on first click --> + <conditionalClick selector="{{BlockPageActionsSection.idColumn}}" dependentSelector="//span[contains(text(), 'ID')]/parent::th[not(contains(@class, '_descend'))]/parent::tr/parent::thead/parent::table/parent::div[contains(@data-role, 'grid-wrapper')]" stepKey="secondClickToAttemptSortByIdDescending" visible="true"/> + <waitForLoadingMaskToDisappear stepKey="waitForSecondIdSortDescendingToFinish"/> + <click selector="{{BlockPageActionsSection.select(CMSBlockPage.identifier)}}" stepKey="clickSelectCreatedCMSBlock"/> + <click selector="{{BlockPageActionsSection.edit(CMSBlockPage.identifier)}}" stepKey="navigateToCreatedCMSBlock"/> + <waitForPageLoad stepKey="waitForPageLoad3"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskOfStagingSection"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/NavigateToCreatedCMSPageActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/NavigateToCreatedCMSPageActionGroup.xml new file mode 100644 index 0000000000000..3b763d3f44125 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/NavigateToCreatedCMSPageActionGroup.xml @@ -0,0 +1,35 @@ +<?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="NavigateToCreatedCMSPageActionGroup"> + <annotations> + <description>Goes to the Admin CMS Pages page. </description> + </annotations> + <arguments> + <argument name="CMSPage" defaultValue=""/> + </arguments> + + <amOnPage url="{{CmsPagesPage.url}}" stepKey="navigateToCMSPagesGrid"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <conditionalClick selector="{{CmsPagesPageActionsSection.clearAllButton}}" dependentSelector="{{CmsPagesPageActionsSection.activeFilters}}" stepKey="clickToResetFilter" visible="true"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + <conditionalClick selector="//div[contains(@data-role, 'grid-wrapper')]/table/thead/tr/th/span[contains(text(), 'ID')]" dependentSelector="//span[contains(text(), 'ID')]/parent::th[not(contains(@class, '_descend'))]/parent::tr/parent::thead/parent::table/parent::div[contains(@data-role, 'grid-wrapper')]" stepKey="clickToAttemptSortByIdDescending" visible="true"/> + <waitForLoadingMaskToDisappear stepKey="waitForFirstIdSortDescendingToFinish"/> + + <!-- Conditional Click again in case it goes from default state to ascending on first click --> + <conditionalClick selector="//div[contains(@data-role, 'grid-wrapper')]/table/thead/tr/th/span[contains(text(), 'ID')]" dependentSelector="//span[contains(text(), 'ID')]/parent::th[not(contains(@class, '_descend'))]/parent::tr/parent::thead/parent::table/parent::div[contains(@data-role, 'grid-wrapper')]" stepKey="secondClickToAttemptSortByIdDescending" visible="true"/> + <waitForLoadingMaskToDisappear stepKey="waitForSecondIdSortDescendingToFinish"/> + <click selector="{{CmsPagesPageActionsSection.select(CMSPage.identifier)}}" stepKey="clickSelectCreatedCMSPage"/> + <click selector="{{CmsPagesPageActionsSection.edit(CMSPage.identifier)}}" stepKey="navigateToCreatedCMSPage"/> + <waitForPageLoad stepKey="waitForPageLoad3"/> + <click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickExpandContentTabForPage"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskOfStagingSection"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/NavigateToStorefrontForCreatedPageActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/NavigateToStorefrontForCreatedPageActionGroup.xml new file mode 100644 index 0000000000000..7576c61e2391c --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/NavigateToStorefrontForCreatedPageActionGroup.xml @@ -0,0 +1,22 @@ +<?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="NavigateToStorefrontForCreatedPageActionGroup"> + <annotations> + <description>Goes to the provided Page on the Storefront.</description> + </annotations> + <arguments> + <argument name="page" type="string"/> + </arguments> + + <amOnPage url="{{page}}" stepKey="goToStorefront"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveAndCloseCMSBlockWithSplitButtonActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveAndCloseCMSBlockWithSplitButtonActionGroup.xml new file mode 100644 index 0000000000000..95ce3c499b6b8 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveAndCloseCMSBlockWithSplitButtonActionGroup.xml @@ -0,0 +1,22 @@ +<?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="SaveAndCloseCMSBlockWithSplitButtonActionGroup"> + <annotations> + <description>Clicks on the Save and Close button.</description> + </annotations> + + <waitForElementVisible selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="waitForExpandSplitButtonToBeVisible"/> + <click selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitButton"/> + <click selector="{{BlockNewPagePageActionsSection.saveAndClose}}" stepKey="clickSaveBlock"/> + <waitForPageLoad stepKey="waitForPageLoadAfterClickingSave"/> + <see userInput="You saved the block." stepKey="assertSaveBlockSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveAndContinueEditCmsPageActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveAndContinueEditCmsPageActionGroup.xml new file mode 100644 index 0000000000000..a8dce19153a98 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveAndContinueEditCmsPageActionGroup.xml @@ -0,0 +1,22 @@ +<?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="SaveAndContinueEditCmsPageActionGroup"> + <annotations> + <description>Clicks on the Save and Continue button.</description> + </annotations> + + <waitForElementVisible time="10" selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="waitForSaveAndContinueVisibility"/> + <click selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="clickSaveAndContinueEditCmsPage"/> + <waitForPageLoad stepKey="waitForCmsPageLoad"/> + <waitForElementVisible time="1" selector="{{CmsNewPagePageActionsSection.cmsPageTitle}}" stepKey="waitForCmsPageSaveButton"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveCMSBlockActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveCMSBlockActionGroup.xml new file mode 100644 index 0000000000000..2f86df70ae8c8 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveCMSBlockActionGroup.xml @@ -0,0 +1,21 @@ +<?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="SaveCMSBlockActionGroup"> + <annotations> + <description>Clicks on the Save button. Validates that the Save message is present and correct. PLEASE NOTE: The message is Hardcoded.</description> + </annotations> + + <waitForElementVisible selector="{{CmsNewBlockBlockActionsSection.savePage}}" stepKey="waitForSaveButton"/> + <click selector="{{CmsNewBlockBlockActionsSection.savePage}}" stepKey="clickSaveButton"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <see userInput="You saved the block." stepKey="seeSuccessfulSaveMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveCmsPageActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveCmsPageActionGroup.xml new file mode 100644 index 0000000000000..5b3b0460edbdb --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveCmsPageActionGroup.xml @@ -0,0 +1,23 @@ +<?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="SaveCmsPageActionGroup"> + <annotations> + <description>Clicks on the Save button. Validates that the Success Message is present.</description> + </annotations> + + <waitForElementVisible selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="waitForSplitButton"/> + <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitButton"/> + <waitForElementVisible selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="waitForSaveCmsPage"/> + <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSaveCmsPage"/> + <waitForElementVisible time="1" selector="{{CmsPagesPageActionsSection.addNewPageButton}}" stepKey="waitForCmsPageSaveButton"/> + <see userInput="You saved the page." selector="{{CmsPagesPageActionsSection.savePageSuccessMessage}}" stepKey="assertSavePageSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveImageActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveImageActionGroup.xml new file mode 100644 index 0000000000000..612cc1c485b08 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveImageActionGroup.xml @@ -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="SaveImageActionGroup"> + <annotations> + <description>Clicks on Insert File in the Media Gallery.</description> + </annotations> + + <click selector="{{MediaGallerySection.InsertFile}}" stepKey="clickInsertBtn"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/SelectImageFromMediaStorageActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/SelectImageFromMediaStorageActionGroup.xml deleted file mode 100644 index 073c299c240e9..0000000000000 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/SelectImageFromMediaStorageActionGroup.xml +++ /dev/null @@ -1,120 +0,0 @@ -<?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="clickBrowseBtnOnUploadPopup"> - <annotations> - <description>Clicks on the Browse button in the 'Insert/edit image' model.</description> - </annotations> - - <click selector="{{MediaGallerySection.Browse}}" stepKey="clickBrowse"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - </actionGroup> - - <actionGroup name="VerifyMediaGalleryStorageActions"> - <annotations> - <description>Validates that the Media Gallery 'Cancel'/'Create Folder' buttons are present.</description> - </annotations> - - <waitForPageLoad stepKey="waitForPageLoad1"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoading1"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoading2"/> - <see selector="{{MediaGallerySection.CancelBtn}}" userInput="Cancel" stepKey="seeCancelBtn"/> - <see selector="{{MediaGallerySection.CreateFolder}}" userInput="Create Folder" stepKey="seeCreateFolderBtn"/> - </actionGroup> - - <actionGroup name="CreateImageFolder"> - <annotations> - <description>Creates a folder in the Media Gallery based on the provided Folder.</description> - </annotations> - <arguments> - <argument name="ImageFolder" defaultValue="ImageFolder"/> - </arguments> - - <click selector="{{MediaGallerySection.CreateFolder}}" stepKey="createFolder"/> - <waitForElementVisible selector="{{MediaGallerySection.FolderName}}" stepKey="waitForPopUp"/> - <fillField selector="{{MediaGallerySection.FolderName}}" userInput="{{ImageFolder.name}}" stepKey="fillFolderName"/> - <click selector="{{MediaGallerySection.AcceptFolderName}}" stepKey="acceptFolderName"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoading3"/> - <waitForPageLoad stepKey="waitForLoadingArrowToExpand" time="15"/> - <conditionalClick selector="{{MediaGallerySection.StorageRootArrow}}" dependentSelector="{{MediaGallerySection.checkIfArrowExpand}}" stepKey="clickArrowIfClosed" visible="true"/> - <conditionalClick selector="{{MediaGallerySection.WysiwygArrow}}" dependentSelector="{{MediaGallerySection.checkIfWysiwygArrowExpand}}" stepKey="clickWysiwygArrowIfClosed" visible="true"/> - <waitForText userInput="{{ImageFolder.name}}" stepKey="waitForNewFolder"/> - <click userInput="{{ImageFolder.name}}" stepKey="clickOnCreatedFolder"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoading5"/> - </actionGroup> - - <actionGroup name="attachImage"> - <annotations> - <description>Uploads the provided Image to Media Gallery. - If you use this action group, you MUST add steps to delete the image in the "after" steps.</description> - </annotations> - <arguments> - <argument name="Image"/> - </arguments> - - <attachFile selector="{{MediaGallerySection.BrowseUploadImage}}" userInput="{{Image.value}}" stepKey="uploadImage"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/> - <waitForElementVisible selector="{{MediaGallerySection.imageOrImageCopy(Image.fileName, Image.extension)}}" stepKey="waitForUploadImage"/> - </actionGroup> - - <actionGroup name="deleteImage"> - <annotations> - <description>Deletes the selected Image from the Media Gallery.</description> - </annotations> - - <see selector="{{MediaGallerySection.DeleteSelectedBtn}}" userInput="Delete Selected" stepKey="seeDeleteBtn"/> - <click selector="{{MediaGallerySection.DeleteSelectedBtn}}" stepKey="clickDeleteSelected"/> - <waitForText userInput="OK" stepKey="waitForConfirm"/> - <click selector="{{MediaGallerySection.confirmDelete}}" stepKey="confirmDelete"/> - <waitForElementNotVisible selector="{{MediaGallerySection.image(ImageUpload.file)}}" stepKey="waitForImageDeleted"/> - <dontSeeElement selector="{{MediaGallerySection.image(ImageUpload.file)}}" stepKey="dontSeeImage"/> - </actionGroup> - - <actionGroup name="saveImage"> - <annotations> - <description>Clicks on Insert File in the Media Gallery.</description> - </annotations> - - <click selector="{{MediaGallerySection.InsertFile}}" stepKey="clickInsertBtn"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/> - </actionGroup> - - <actionGroup name="fillOutUploadImagePopup"> - <annotations> - <description>Fills in the Image Description and Height fields. PLEASE NOTE: The values are Hardcoded using 'ImageUpload'.</description> - </annotations> - - <waitForElementVisible selector="{{MediaGallerySection.OkBtn}}" stepKey="waitForOkBtn"/> - <fillField selector="{{MediaGallerySection.ImageDescription}}" userInput="{{ImageUpload.content}}" stepKey="fillImageDescription"/> - <fillField selector="{{MediaGallerySection.Height}}" userInput="{{ImageUpload.height}}" stepKey="fillImageHeight"/> - <click selector="{{MediaGallerySection.OkBtn}}" stepKey="clickOkBtn"/> - <waitForPageLoad stepKey="wait3"/> - </actionGroup> - - <actionGroup name="verifyOversizeValidationMsg"> - <annotations> - <description>Validates that the Oversize validation message is present and correct.</description> - </annotations> - - <see userInput="this is oversize" stepKey="seeValidationMsg"/> - <click selector="#OK" stepKey="clickOKBtn"/> - </actionGroup> - - <actionGroup name="verifyWrongExtensionValidationMsg"> - <annotations> - <description>Validates that the Wrong Extensions validation message is present and correct.</description> - </annotations> - - <see userInput="this is wrong extension" stepKey="seeValidationMsg"/> - <click selector="#OK" stepKey="clickOKBtn"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/SetLayoutActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/SetLayoutActionGroup.xml new file mode 100644 index 0000000000000..23f4cccd33118 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/SetLayoutActionGroup.xml @@ -0,0 +1,26 @@ +<?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="SetLayoutActionGroup"> + <annotations> + <description>Sets the provided option for 'Layout', under 'Design' on the Page creation/edit page. </description> + </annotations> + <arguments> + <argument name="designSection"/> + <argument name="layoutOption"/> + </arguments> + + <waitForElementVisible selector="{{designSection.DesignTab}}" stepKey="waitForDesignTabVisible"/> + <conditionalClick selector="{{designSection.DesignTab}}" dependentSelector="{{designSection.LayoutDropdown}}" visible="false" stepKey="clickOnDesignTab"/> + <waitForPageLoad stepKey="waitForPageLoadDesignTab"/> + <waitForElementVisible selector="{{designSection.LayoutDropdown}}" stepKey="waitForLayoutDropDown"/> + <selectOption selector="{{designSection.LayoutDropdown}}" userInput="{{layoutOption}}" stepKey="selectLayout"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyMagentoEntityActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyMagentoEntityActionGroup.xml new file mode 100644 index 0000000000000..717c0dbb83dd2 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyMagentoEntityActionGroup.xml @@ -0,0 +1,19 @@ +<?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="VerifyMagentoEntityActionGroup"> + <annotations> + <description>Validates that the Insert Widget and Insert Variables buttons are present.</description> + </annotations> + + <seeElement selector="{{TinyMCESection.InsertWidgetIcon}}" stepKey="assertInfo15"/> + <seeElement selector="{{TinyMCESection.InsertVariableIcon}}" stepKey="assertInfo16"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyMediaGalleryStorageActionsActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyMediaGalleryStorageActionsActionGroup.xml new file mode 100644 index 0000000000000..4410be84485d0 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyMediaGalleryStorageActionsActionGroup.xml @@ -0,0 +1,22 @@ +<?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="VerifyMediaGalleryStorageActionsActionGroup"> + <annotations> + <description>Validates that the Media Gallery 'Cancel'/'Create Folder' buttons are present.</description> + </annotations> + + <waitForPageLoad stepKey="waitForPageLoad1"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoading1"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoading2"/> + <see selector="{{MediaGallerySection.CancelBtn}}" userInput="Cancel" stepKey="seeCancelBtn"/> + <see selector="{{MediaGallerySection.CreateFolder}}" userInput="Create Folder" stepKey="seeCreateFolderBtn"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyOversizeValidationMsgActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyOversizeValidationMsgActionGroup.xml new file mode 100644 index 0000000000000..6a4d49fcd6eb7 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyOversizeValidationMsgActionGroup.xml @@ -0,0 +1,19 @@ +<?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="VerifyOversizeValidationMsgActionGroup"> + <annotations> + <description>Validates that the Oversize validation message is present and correct.</description> + </annotations> + + <see userInput="this is oversize" stepKey="seeValidationMsg"/> + <click selector="#OK" stepKey="clickOKBtn"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyTinyMCEActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyTinyMCEActionGroup.xml index c1682e32c28c6..7ba0fcdf0d605 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyTinyMCEActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyTinyMCEActionGroup.xml @@ -12,7 +12,7 @@ <annotations> <description>Goes to Admin CMS Page creation page. Validates that all of the Tiny MCE buttons are present.</description> </annotations> - + <seeElement selector="{{TinyMCESection.Style}}" stepKey="assertInfo2"/> <seeElement selector="{{TinyMCESection.Bold}}" stepKey="assertInfo3"/> <seeElement selector="{{TinyMCESection.Italic}}" stepKey="assertInfo4"/> @@ -27,13 +27,4 @@ <seeElement selector="{{TinyMCESection.InsertTable}}" stepKey="assertInfo13"/> <seeElement selector="{{TinyMCESection.SpecialCharacter}}" stepKey="assertInfo14"/> </actionGroup> - - <actionGroup name="VerifyMagentoEntityActionGroup"> - <annotations> - <description>Validates that the Insert Widget and Insert Variables buttons are present.</description> - </annotations> - - <seeElement selector="{{TinyMCESection.InsertWidgetIcon}}" stepKey="assertInfo15"/> - <seeElement selector="{{TinyMCESection.InsertVariableIcon}}" stepKey="assertInfo16"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyWrongExtensionValidationMsgActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyWrongExtensionValidationMsgActionGroup.xml new file mode 100644 index 0000000000000..bfd43bf0d9e1d --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyWrongExtensionValidationMsgActionGroup.xml @@ -0,0 +1,19 @@ +<?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="VerifyWrongExtensionValidationMsgActionGroup"> + <annotations> + <description>Validates that the Wrong Extensions validation message is present and correct.</description> + </annotations> + + <see userInput="this is wrong extension" stepKey="seeValidationMsg"/> + <click selector="#OK" stepKey="clickOKBtn"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToCMSPageTinyMCE3Test.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToCMSPageTinyMCE3Test.xml index 11bf03c1d5ee9..69f9d24699db0 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToCMSPageTinyMCE3Test.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToCMSPageTinyMCE3Test.xml @@ -47,13 +47,13 @@ <click selector="{{MediaGallerySection.browseForImage}}" stepKey="clickBrowse"/> <switchToIFrame stepKey="switchOutOfIFrame"/> <waitForPageLoad stepKey="waitForPageToLoad" /> - <actionGroup ref="CreateImageFolder" stepKey="CreateImageFolder"> + <actionGroup ref="CreateImageFolderActionGroup" stepKey="CreateImageFolder"> <argument name="ImageFolder" value="ImageFolder"/> </actionGroup> - <actionGroup ref="attachImage" stepKey="attachImage1"> + <actionGroup ref="AttachImageActionGroup" stepKey="attachImage1"> <argument name="Image" value="ImageUpload"/> </actionGroup> - <actionGroup ref="saveImage" stepKey="insertImage"/> + <actionGroup ref="SaveImageActionGroup" stepKey="insertImage"/> <!-- Switching back to the Edit/Insert Image iFrame--> <comment userInput="switching back to iFrame" stepKey="switchBackToIFrame"/> <executeJS function="document.querySelector('.clearlooks2 iframe').setAttribute('name', 'insert-image');" stepKey="makeIFrameInteractable2"/> @@ -67,4 +67,4 @@ <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/> <see userInput="You saved the page." stepKey="seeSuccessMessage"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGBlockTest.xml index 03edc69e6d625..23f43ed21367c 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGBlockTest.xml @@ -28,27 +28,27 @@ <argument name="Block" value="$$createPreReqBlock$$"/> <argument name="CmsPage" value="$$createCMSPage$$"/> </actionGroup> - <actionGroup ref="navigateToCreatedCMSBlockPage" stepKey="navigateToCreatedCMSBlockPage1"> + <actionGroup ref="NavigateToCreatedCMSBlockPageActionGroup" stepKey="navigateToCreatedCMSBlockPage1"> <argument name="CMSBlockPage" value="$$createPreReqBlock$$"/> </actionGroup> <selectOption selector="{{BlockNewPageBasicFieldsSection.storeView}}" userInput="All Store View" stepKey="selectAllStoreView" /> <waitForElementVisible selector="{{TinyMCESection.TinyMCE4}}" stepKey="waitForTinyMCE" /> <click selector="{{TinyMCESection.InsertImageIcon}}" stepKey="clickInsertImageIcon" /> <waitForPageLoad stepKey="waitForPageLoad2" /> - <actionGroup ref="clickBrowseBtnOnUploadPopup" stepKey="clickBrowserBtn"/> - <actionGroup ref="VerifyMediaGalleryStorageActions" stepKey="VerifyMediaGalleryStorageBtn"/> - <actionGroup ref="CreateImageFolder" stepKey="CreateImageFolder"> + <actionGroup ref="ClickBrowseBtnOnUploadPopupActionGroup" stepKey="clickBrowserBtn"/> + <actionGroup ref="VerifyMediaGalleryStorageActionsActionGroup" stepKey="VerifyMediaGalleryStorageBtn"/> + <actionGroup ref="CreateImageFolderActionGroup" stepKey="CreateImageFolder"> <argument name="ImageFolder" value="ImageFolder"/> </actionGroup> - <actionGroup ref="attachImage" stepKey="attachImage1"> + <actionGroup ref="AttachImageActionGroup" stepKey="attachImage1"> <argument name="Image" value="ImageUpload"/> </actionGroup> - <actionGroup ref="deleteImage" stepKey="deleteImage"/> - <actionGroup ref="attachImage" stepKey="attachImage2"> + <actionGroup ref="DeleteImageActionGroup" stepKey="deleteImage"/> + <actionGroup ref="AttachImageActionGroup" stepKey="attachImage2"> <argument name="Image" value="ImageUpload"/> </actionGroup> - <actionGroup ref="saveImage" stepKey="insertImage"/> - <actionGroup ref="fillOutUploadImagePopup" stepKey="fillOutUploadImagePopup" /> + <actionGroup ref="SaveImageActionGroup" stepKey="insertImage"/> + <actionGroup ref="FillOutUploadImagePopupActionGroup" stepKey="fillOutUploadImagePopup" /> <click selector="{{BlockNewPagePageActionsSection.saveBlock}}" stepKey="clickSaveBlock"/> <amOnPage url="$$createCMSPage.identifier$$" stepKey="amOnPageTestPage"/> <waitForPageLoad stepKey="waitForPageLoad11" /> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGCMSTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGCMSTest.xml index 205850f888797..a244e4bc7f525 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGCMSTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGCMSTest.xml @@ -23,27 +23,27 @@ <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> - <actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPage"> + <actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage"> <argument name="CMSPage" value="$$createCMSPage$$"/> </actionGroup> <click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickExpandContent"/> <waitForElementVisible selector="{{TinyMCESection.TinyMCE4}}" stepKey="waitForTinyMCE4" /> <click selector="{{TinyMCESection.InsertImageIcon}}" stepKey="clickInsertImageIcon" /> <waitForPageLoad stepKey="waitForPageLoad" /> - <actionGroup ref="clickBrowseBtnOnUploadPopup" stepKey="clickBrowserBtn"/> - <actionGroup ref="VerifyMediaGalleryStorageActions" stepKey="VerifyMediaGalleryStorageBtn"/> - <actionGroup ref="CreateImageFolder" stepKey="CreateImageFolder"> + <actionGroup ref="ClickBrowseBtnOnUploadPopupActionGroup" stepKey="clickBrowserBtn"/> + <actionGroup ref="VerifyMediaGalleryStorageActionsActionGroup" stepKey="VerifyMediaGalleryStorageBtn"/> + <actionGroup ref="CreateImageFolderActionGroup" stepKey="CreateImageFolder"> <argument name="ImageFolder" value="ImageFolder"/> </actionGroup> - <actionGroup ref="attachImage" stepKey="attachImage1"> + <actionGroup ref="AttachImageActionGroup" stepKey="attachImage1"> <argument name="Image" value="ImageUpload3"/> </actionGroup> - <actionGroup ref="deleteImage" stepKey="deleteImage"/> - <actionGroup ref="attachImage" stepKey="attachImage2"> + <actionGroup ref="DeleteImageActionGroup" stepKey="deleteImage"/> + <actionGroup ref="AttachImageActionGroup" stepKey="attachImage2"> <argument name="Image" value="ImageUpload3"/> </actionGroup> - <actionGroup ref="saveImage" stepKey="insertImage"/> - <actionGroup ref="fillOutUploadImagePopup" stepKey="fillOutUploadImagePopup" /> + <actionGroup ref="SaveImageActionGroup" stepKey="insertImage"/> + <actionGroup ref="FillOutUploadImagePopupActionGroup" stepKey="fillOutUploadImagePopup" /> <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="$$createCMSPage.identifier$$" stepKey="fillFieldUrlKey"/> <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml index ce34a8d09c302..4ff5f314662b3 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml @@ -38,7 +38,7 @@ <argument name="Block" value="$$createPreReqBlock$$"/> <argument name="CmsPage" value="$$createCMSPage$$"/> </actionGroup> - <actionGroup ref="navigateToCreatedCMSBlockPage" stepKey="navigateToCreatedCMSBlockPage1"> + <actionGroup ref="NavigateToCreatedCMSBlockPageActionGroup" stepKey="navigateToCreatedCMSBlockPage1"> <argument name="CMSBlockPage" value="$$createPreReqBlock$$"/> </actionGroup> <selectOption selector="{{BlockNewPageBasicFieldsSection.storeView}}" userInput="All Store View" stepKey="selectAllStoreView" /> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGBlockTest.xml index ad5e769c61be4..0253e62b40a56 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGBlockTest.xml @@ -24,7 +24,7 @@ <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> - <actionGroup ref="navigateToCreatedCMSBlockPage" stepKey="navigateToCreatedCMSBlockPage"> + <actionGroup ref="NavigateToCreatedCMSBlockPageActionGroup" stepKey="navigateToCreatedCMSBlockPage"> <argument name="CMSBlockPage" value="$$createPreReqBlock$$"/> </actionGroup> <selectOption selector="{{BlockNewPageBasicFieldsSection.storeView}}" userInput="All Store View" stepKey="selectAllStoreView" /> @@ -45,7 +45,7 @@ <waitForElementNotVisible selector="{{WidgetSection.InsertWidgetTitle}}" stepKey="waitForSlideOutCloses1" /> <click selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitButton"/> <click selector="{{BlockNewPagePageActionsSection.saveAndClose}}" stepKey="clickSaveBlock"/> - <actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPage"> + <actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage"> <argument name="CMSPage" value="$$createCMSPage$$"/> </actionGroup> <waitForElementVisible selector="{{TinyMCESection.TinyMCE4}}" stepKey="waitForTinyMCE4"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsPageTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsPageTest.xml index b7c7e4a4212fe..6d5adc65fb1df 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsPageTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsPageTest.xml @@ -110,7 +110,7 @@ <see userInput="You duplicated the page." stepKey="seeDuplicatedPageMsg"/> <!--Verify duplicated CMS Page--> <seeElement selector="{{BlockNewPageBasicFieldsSection.isActive('0')}}" stepKey="seeBlockNotEnable" /> - <actionGroup ref="AssertCMSPageContent" stepKey="assertContent"/> + <actionGroup ref="AssertCMSPageContentActionGroup" stepKey="assertContent"/> <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitBtn3" /> <click selector="{{CmsNewPagePageActionsSection.saveAndClose}}" stepKey="clickSaveAndClose"/> <see userInput="You saved the page." stepKey="seeSavedCMSPageMsgOnGrid"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminMediaGalleryPopupUploadImagesWithoutErrorTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminMediaGalleryPopupUploadImagesWithoutErrorTest.xml index bc1688c9d692b..ff389a6ce2965 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminMediaGalleryPopupUploadImagesWithoutErrorTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminMediaGalleryPopupUploadImagesWithoutErrorTest.xml @@ -37,7 +37,7 @@ </after> <!--Open created block page and add image--> <comment userInput="Open create block page and add image" stepKey="commentOpenBlockPage"/> - <actionGroup ref="navigateToCreatedCMSBlockPage" stepKey="navigateToCreatedCMSBlockPage1"> + <actionGroup ref="NavigateToCreatedCMSBlockPageActionGroup" stepKey="navigateToCreatedCMSBlockPage1"> <argument name="CMSBlockPage" value="$$createBlock$$"/> </actionGroup> <actionGroup ref="AdminAddImageToCMSBlockContent" stepKey="addImage"> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/CheckOrderOfProdsInWidgetOnCMSPageTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/CheckOrderOfProdsInWidgetOnCMSPageTest.xml index ce093144e6a2a..cfb765656dbd1 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/CheckOrderOfProdsInWidgetOnCMSPageTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/CheckOrderOfProdsInWidgetOnCMSPageTest.xml @@ -41,7 +41,7 @@ <deleteData createDataKey="createCMSPage" stepKey="deletePreReqCMSPage"/> <actionGroup ref="logout" stepKey="logoutOfAdmin"/> </after> - <actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPage1"> + <actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage1"> <argument name="CMSPage" value="$$createCMSPage$$"/> </actionGroup> <conditionalClick selector="{{CmsNewPagePageContentSection.header}}" @@ -99,7 +99,7 @@ <argument name="product_1" value="$$product1$$"/> <argument name="product_2" value="$$product2$$"/> </actionGroup> - <actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPage2"> + <actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage2"> <argument name="CMSPage" value="$$createCMSPage$$"/> </actionGroup> <conditionalClick selector="{{CmsNewPagePageContentSection.header}}" diff --git a/app/code/Magento/Cms/Test/Mftf/Test/StoreViewLanguageCorrectSwitchTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/StoreViewLanguageCorrectSwitchTest.xml index d4796b2ef7d43..6569c07f4580a 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/StoreViewLanguageCorrectSwitchTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/StoreViewLanguageCorrectSwitchTest.xml @@ -41,7 +41,7 @@ </actionGroup> <!-- Add StoreView To Cms Page--> - <actionGroup ref="AddStoreViewToCmsPage" stepKey="gotToCmsPage"> + <actionGroup ref="AddStoreViewToCmsPageActionGroup" stepKey="gotToCmsPage"> <argument name="CMSPage" value="$$createSecondCmsPage$$"/> <argument name="storeViewName" value="{{NewStoreViewData.name}}"/> </actionGroup> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddImageToWYSIWYGNewsletterTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddImageToWYSIWYGNewsletterTest.xml index 0371c0265d149..a62933d7ecb9e 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddImageToWYSIWYGNewsletterTest.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddImageToWYSIWYGNewsletterTest.xml @@ -33,16 +33,16 @@ <waitForElementVisible selector="{{NewsletterWYSIWYGSection.TinyMCE4}}" stepKey="waitForTinyMCE4"/> <click selector="{{TinyMCESection.InsertImageIcon}}" stepKey="clickInsertImageIcon" /> <waitForPageLoad stepKey="waitForPageLoad" /> - <actionGroup ref="clickBrowseBtnOnUploadPopup" stepKey="clickBrowserBtn"/> - <actionGroup ref="VerifyMediaGalleryStorageActions" stepKey="VerifyMediaGalleryStorageBtn"/> - <actionGroup ref="CreateImageFolder" stepKey="CreateImageFolder"> + <actionGroup ref="ClickBrowseBtnOnUploadPopupActionGroup" stepKey="clickBrowserBtn"/> + <actionGroup ref="VerifyMediaGalleryStorageActionsActionGroup" stepKey="VerifyMediaGalleryStorageBtn"/> + <actionGroup ref="CreateImageFolderActionGroup" stepKey="CreateImageFolder"> <argument name="ImageFolder" value="ImageFolder"/> </actionGroup> - <actionGroup ref="attachImage" stepKey="attachImage1"> + <actionGroup ref="AttachImageActionGroup" stepKey="attachImage1"> <argument name="Image" value="ImageUpload3"/> </actionGroup> - <actionGroup ref="saveImage" stepKey="insertImage"/> - <actionGroup ref="fillOutUploadImagePopup" stepKey="fillOutUploadImagePopup" /> + <actionGroup ref="SaveImageActionGroup" stepKey="insertImage"/> + <actionGroup ref="FillOutUploadImagePopupActionGroup" stepKey="fillOutUploadImagePopup" /> <click selector="{{BasicFieldNewsletterSection.save}}" stepKey="clickSaveTemplate"/> <waitForPageLoad stepKey="waitForPageLoad10" /> <!--Preview the newsletter template--> diff --git a/app/code/Magento/Theme/Test/Mftf/Test/AdminDesignConfigMediaGalleryImageUploadTest.xml b/app/code/Magento/Theme/Test/Mftf/Test/AdminDesignConfigMediaGalleryImageUploadTest.xml index f46328ac151b1..201f8eba3376b 100644 --- a/app/code/Magento/Theme/Test/Mftf/Test/AdminDesignConfigMediaGalleryImageUploadTest.xml +++ b/app/code/Magento/Theme/Test/Mftf/Test/AdminDesignConfigMediaGalleryImageUploadTest.xml @@ -35,14 +35,14 @@ <!--Upload Image--> <comment userInput="Upload Image" stepKey="uploadImageComment"/> <click selector="{{AdminDesignConfigSection.selectFromGalleryByFieldsetName('Head')}}" stepKey="openMediaGallery"/> - <actionGroup ref="VerifyMediaGalleryStorageActions" stepKey="verifyMediaGalleryStorageBtn"/> + <actionGroup ref="VerifyMediaGalleryStorageActionsActionGroup" stepKey="verifyMediaGalleryStorageBtn"/> <actionGroup ref="NavigateToMediaFolderActionGroup" stepKey="navigateToFolder"> <argument name="FolderName" value="Storage Root"/> </actionGroup> - <actionGroup ref="attachImage" stepKey="selectImageFromMediaStorage"> + <actionGroup ref="AttachImageActionGroup" stepKey="selectImageFromMediaStorage"> <argument name="Image" value="ImageUpload3"/> </actionGroup> - <actionGroup ref="saveImage" stepKey="insertImage"/> + <actionGroup ref="SaveImageActionGroup" stepKey="insertImage"/> <click selector="{{AdminDesignConfigSection.saveConfiguration}}" stepKey="saveConfiguration"/> <waitForElementVisible selector="{{AdminDesignConfigSection.successNotification}}" stepKey="waitForSuccessNotification"/> <waitForPageLoad stepKey="waitForPageloadSuccess"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddPermanentRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddPermanentRedirectTest.xml index 358aa58aba0f7..3329dd61e0352 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddPermanentRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddPermanentRedirectTest.xml @@ -30,7 +30,7 @@ </after> <!--Open CMS Edit Page and Get the CMS ID --> - <actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPage"> + <actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage"> <argument name="CMSPage" value="$$createCMSPage$$"/> </actionGroup> <grabFromCurrentUrl stepKey="cmsId" regex="#\/([0-9]*)?\/$#"/> @@ -60,24 +60,24 @@ </actionGroup> <!-- Assert Updated Request Path redirects to the CMS Page on Store Front --> - <actionGroup ref="navigateToStorefrontForCreatedPage" stepKey="navigateToTheStoreFront"> + <actionGroup ref="NavigateToStorefrontForCreatedPageActionGroup" stepKey="navigateToTheStoreFront"> <argument name="page" value="{{defaultCmsPage.title}}"/> </actionGroup> <!-- Assert updated CMS redirect in Store Front --> - <actionGroup ref="AssertStoreFrontCMSPage" stepKey="assertCMSPage"> + <actionGroup ref="AssertStoreFrontCMSPageActionGroup" stepKey="assertCMSPage"> <argument name="cmsTitle" value="$$createCMSPage.title$$"/> <argument name="cmsContent" value="$$createCMSPage.content$$"/> <argument name="cmsContentHeading" value="$$createCMSPage.content_heading$$"/> </actionGroup> <!-- Assert initial request path directs to the CMS Page on Store Front --> - <actionGroup ref="navigateToStorefrontForCreatedPage" stepKey="navigateToTheStoreFront1"> + <actionGroup ref="NavigateToStorefrontForCreatedPageActionGroup" stepKey="navigateToTheStoreFront1"> <argument name="page" value="$$createCMSPage.identifier$$"/> </actionGroup> <!-- Assert initial CMS redirect in Store Front --> - <actionGroup ref="AssertStoreFrontCMSPage" stepKey="assertCMSPage1"> + <actionGroup ref="AssertStoreFrontCMSPageActionGroup" stepKey="assertCMSPage1"> <argument name="cmsTitle" value="$$createCMSPage.title$$"/> <argument name="cmsContent" value="$$createCMSPage.content$$"/> <argument name="cmsContentHeading" value="$$createCMSPage.content_heading$$"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddTemporaryRedirectTest.xml index e6ee9b484059d..cf66d7a06f0d0 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddTemporaryRedirectTest.xml @@ -30,7 +30,7 @@ </after> <!--Open CMS Edit Page and Get the CMS ID --> - <actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPage"> + <actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage"> <argument name="CMSPage" value="$$createCMSPage$$"/> </actionGroup> <grabFromCurrentUrl stepKey="cmsId" regex="#\/([0-9]*)?\/$#"/> @@ -60,24 +60,24 @@ </actionGroup> <!-- Assert Updated Request Path redirects to the CMS Page on Store Front --> - <actionGroup ref="navigateToStorefrontForCreatedPage" stepKey="navigateToTheStoreFront"> + <actionGroup ref="NavigateToStorefrontForCreatedPageActionGroup" stepKey="navigateToTheStoreFront"> <argument name="page" value="{{defaultCmsPage.title}}"/> </actionGroup> <!--Assert updated CMS redirect in Store Front--> - <actionGroup ref="AssertStoreFrontCMSPage" stepKey="assertCMSPage"> + <actionGroup ref="AssertStoreFrontCMSPageActionGroup" stepKey="assertCMSPage"> <argument name="cmsTitle" value="$$createCMSPage.title$$"/> <argument name="cmsContent" value="$$createCMSPage.content$$"/> <argument name="cmsContentHeading" value="$$createCMSPage.content_heading$$"/> </actionGroup> <!-- Assert initial request path directs to the CMS Page on Store Front --> - <actionGroup ref="navigateToStorefrontForCreatedPage" stepKey="navigateToTheStoreFront1"> + <actionGroup ref="NavigateToStorefrontForCreatedPageActionGroup" stepKey="navigateToTheStoreFront1"> <argument name="page" value="$$createCMSPage.identifier$$"/> </actionGroup> <!--Assert initial CMS redirect in Store Front--> - <actionGroup ref="AssertStoreFrontCMSPage" stepKey="assertCMSPage1"> + <actionGroup ref="AssertStoreFrontCMSPageActionGroup" stepKey="assertCMSPage1"> <argument name="cmsTitle" value="$$createCMSPage.title$$"/> <argument name="cmsContent" value="$$createCMSPage.content$$"/> <argument name="cmsContentHeading" value="$$createCMSPage.content_heading$$"/> From cf1b0845fd7d0c083b5f20ba2c0a495d0e9bf9ad Mon Sep 17 00:00:00 2001 From: Andreas Mautz <am@webvisum.de> Date: Fri, 29 Nov 2019 10:58:58 +0100 Subject: [PATCH 141/586] [FIXES] #25674: Elasticsearch version selections in admin are overly broad. This removes the X.0+ notation and replaces it with X.x notation --- .../Mftf/Test/ProductQuickSearchUsingElasticSearchTest.xml | 6 +++--- app/code/Magento/Elasticsearch/etc/adminhtml/system.xml | 2 +- app/code/Magento/Elasticsearch/etc/di.xml | 2 +- .../Magento/Elasticsearch6/Test/Mftf/Data/ConfigData.xml | 2 +- app/code/Magento/Elasticsearch6/etc/adminhtml/system.xml | 2 +- app/code/Magento/Elasticsearch6/etc/di.xml | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/code/Magento/Elasticsearch/Test/Mftf/Test/ProductQuickSearchUsingElasticSearchTest.xml b/app/code/Magento/Elasticsearch/Test/Mftf/Test/ProductQuickSearchUsingElasticSearchTest.xml index d8ce091fba76f..9891b80435476 100644 --- a/app/code/Magento/Elasticsearch/Test/Mftf/Test/ProductQuickSearchUsingElasticSearchTest.xml +++ b/app/code/Magento/Elasticsearch/Test/Mftf/Test/ProductQuickSearchUsingElasticSearchTest.xml @@ -11,7 +11,7 @@ <test name="ProductQuickSearchUsingElasticSearchTest"> <annotations> <features value="Search"/> - <stories value="Quick Search of products on Storefront when ES 5.0+ is enabled"/> + <stories value="Quick Search of products on Storefront when ES 5.x is enabled"/> <title value="Product quick search doesn't throw exception after ES is chosen as search engine"/> <description value="Verify no elastic search exception is thrown when searching for product before catalogsearch reindexing"/> <severity value="CRITICAL"/> @@ -36,7 +36,7 @@ </after> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <comment userInput="Change Catalog search engine option to Elastic Search 5.0+" stepKey="chooseElasticSearch5"/> + <comment userInput="Change Catalog search engine option to Elastic Search 5.x" stepKey="chooseElasticSearch5"/> <actionGroup ref="ChooseElasticSearchAsSearchEngine" stepKey="chooseES5"/> <actionGroup ref="ClearPageCacheActionGroup" stepKey="clearing"/> <actionGroup ref="updateIndexerBySchedule" stepKey="updateAnIndexerBySchedule"> @@ -57,4 +57,4 @@ <comment userInput="End of searching products" stepKey="endOfSearchingProducts"/> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin2"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Elasticsearch/etc/adminhtml/system.xml b/app/code/Magento/Elasticsearch/etc/adminhtml/system.xml index dd42b408ff75e..e08d4fafd63da 100644 --- a/app/code/Magento/Elasticsearch/etc/adminhtml/system.xml +++ b/app/code/Magento/Elasticsearch/etc/adminhtml/system.xml @@ -63,7 +63,7 @@ <field id="engine">elasticsearch</field> </depends> </field> - <!-- Elasticsearch 5.0+ --> + <!-- Elasticsearch 5.x --> <field id="elasticsearch5_server_hostname" translate="label" type="text" sortOrder="61" showInDefault="1" showInWebsite="0" showInStore="0"> <label>Elasticsearch Server Hostname</label> <depends> diff --git a/app/code/Magento/Elasticsearch/etc/di.xml b/app/code/Magento/Elasticsearch/etc/di.xml index f42d957276d76..2b29e53635e3a 100644 --- a/app/code/Magento/Elasticsearch/etc/di.xml +++ b/app/code/Magento/Elasticsearch/etc/di.xml @@ -169,7 +169,7 @@ <arguments> <argument name="engines" xsi:type="array"> <item name="elasticsearch" xsi:type="string">Elasticsearch</item> - <item name="elasticsearch5" xsi:type="string">Elasticsearch 5.0+</item> + <item name="elasticsearch5" xsi:type="string">Elasticsearch 5.x</item> </argument> </arguments> </type> diff --git a/app/code/Magento/Elasticsearch6/Test/Mftf/Data/ConfigData.xml b/app/code/Magento/Elasticsearch6/Test/Mftf/Data/ConfigData.xml index f1f2f39f4457b..03a1c63f71515 100644 --- a/app/code/Magento/Elasticsearch6/Test/Mftf/Data/ConfigData.xml +++ b/app/code/Magento/Elasticsearch6/Test/Mftf/Data/ConfigData.xml @@ -10,7 +10,7 @@ <entity name="SearchEngineElasticsearchConfigData"> <data key="path">catalog/search/engine</data> <data key="scope_id">1</data> - <data key="label">Elasticsearch 6.0+</data> + <data key="label">Elasticsearch 6.x</data> <data key="value">elasticsearch6</data> </entity> </entities> diff --git a/app/code/Magento/Elasticsearch6/etc/adminhtml/system.xml b/app/code/Magento/Elasticsearch6/etc/adminhtml/system.xml index 067a0acb8c908..6002f3d489d3c 100644 --- a/app/code/Magento/Elasticsearch6/etc/adminhtml/system.xml +++ b/app/code/Magento/Elasticsearch6/etc/adminhtml/system.xml @@ -10,7 +10,7 @@ <system> <section id="catalog"> <group id="search"> - <!-- Elasticsearch 6.0+ --> + <!-- Elasticsearch 6.x --> <field id="elasticsearch6_server_hostname" translate="label" type="text" sortOrder="71" showInDefault="1" showInWebsite="0" showInStore="0"> <label>Elasticsearch Server Hostname</label> diff --git a/app/code/Magento/Elasticsearch6/etc/di.xml b/app/code/Magento/Elasticsearch6/etc/di.xml index 580c61ffc8cdb..434aec5af221a 100644 --- a/app/code/Magento/Elasticsearch6/etc/di.xml +++ b/app/code/Magento/Elasticsearch6/etc/di.xml @@ -17,7 +17,7 @@ <type name="Magento\Search\Model\Adminhtml\System\Config\Source\Engine"> <arguments> <argument name="engines" xsi:type="array"> - <item name="elasticsearch6" xsi:type="string">Elasticsearch 6.0+</item> + <item name="elasticsearch6" xsi:type="string">Elasticsearch 6.x</item> </argument> </arguments> </type> From a5f6167b9f8a35ebdbdd55e5d477c4802fdac51c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Fri, 29 Nov 2019 12:20:08 +0100 Subject: [PATCH 142/586] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- .../Test/AdminApplyTierPriceToProductTest.xml | 2 +- ...inConfigureProductImagePlaceholderTest.xml | 8 +- ...IncrementsWorkWithDecimalinventoryTest.xml | 2 +- .../AssertMiniCartEmptyActionGroup.xml | 20 + ...ertOneProductNameInMiniCartActionGroup.xml | 23 + ...ckoutPaymentSummarySubtotalActionGroup.xml | 19 + ...CheckoutPaymentSummaryTotalActionGroup.xml | 19 + ...tPaymentSummaryTotalMissingActionGroup.xml | 15 + ...sertStorefrontMiniCartItemsActionGroup.xml | 13 - ...iniCartProductDetailsAbsentActionGroup.xml | 23 + .../ChangeSummaryQuoteAddressActionGroup.xml | 25 + ...eckBillingAddressInCheckoutActionGroup.xml | 29 ++ ...BillingAddressOnPaymentPageActionGroup.xml | 29 ++ ...CheckOrderSummaryInCheckoutActionGroup.xml | 28 ++ ...kProductInCheckoutCartItemsActionGroup.xml | 25 + ...edShippingAddressInCheckoutActionGroup.xml | 28 ++ ...ShipToInformationInCheckoutActionGroup.xml | 29 ++ ...eckShippingMethodInCheckoutActionGroup.xml | 22 + ...lsSortOrderInSummarySectionActionGroup.xml | 22 + .../Mftf/ActionGroup/CheckoutActionGroup.xml | 433 ------------------ .../CheckoutPlaceOrderActionGroup.xml | 25 + ...electCheckMoneyOrderPaymentActionGroup.xml | 21 + ...electFlatRateShippingMethodActionGroup.xml | 20 + .../ClickPlaceOrderActionGroup.xml | 20 + ...ViewAndEditCartFromMiniCartActionGroup.xml | 23 + ...CheckoutShippingAddressFormActionGroup.xml | 5 +- ...tShippingAddressWithCountryActionGroup.xml | 14 + .../GoToCheckoutFromCartActionGroup.xml | 22 + .../GoToCheckoutFromMinicartActionGroup.xml | 21 + ...eckoutFillNewBillingAddressActionGroup.xml | 70 --- ...illShippingNoWaitForPaymentActionGroup.xml | 19 + ...ckoutFillingShippingSectionActionGroup.xml | 38 ++ ...ngSectionUnavailablePaymentActionGroup.xml | 36 ++ ...hippingSectionWithoutRegionActionGroup.xml | 35 ++ ...entAndFillNewBillingAddressActionGroup.xml | 22 + ...untryOptionForPaymentMethodActionGroup.xml | 22 + ...eckoutFillNewBillingAddressActionGroup.xml | 34 ++ ...dressFieldWithoutStateFieldActionGroup.xml | 19 + ...hippingSectionWithoutRegionActionGroup.xml | 35 ++ ...ckoutFillingShippingSectionActionGroup.xml | 34 ++ .../PlaceOrderWithLoggedUserActionGroup.xml | 31 ++ .../RemoveProductFromMiniCartActionGroup.xml | 27 ++ ...ontAddCategoryProductToCartActionGroup.xml | 28 ++ ...ryProductToCartWithQuantityActionGroup.xml | 32 ++ .../StorefrontAddProductToCartActionGroup.xml | 26 ++ .../StorefrontCheckCartActionGroup.xml | 35 ++ ...frontCheckCartSimpleProductActionGroup.xml | 24 + ...rtTotalWithDiscountCategoryActionGroup.xml | 21 + ...eckoutFillNewBillingAddressActionGroup.xml | 15 + ...koutForwardFromShippingStepActionGroup.xml | 18 + .../StorefrontMiniCartActionGroup.xml | 65 --- ...refrontOpenCartFromMinicartActionGroup.xml | 21 + ...nicartAndCheckSimpleProductActionGroup.xml | 23 + .../StorefrontProductCartActionGroup.xml | 161 ------- .../StorefrontSignOutActionGroup.xml | 21 + ...CheckoutPaymentOrderSummaryActionGroup.xml | 23 - ...erifyTopDestinationsCountryActionGroup.xml | 23 + ...rCheckoutAddressPopupFieldsActionGroup.xml | 30 ++ .../CheckNotVisibleProductInMinicartTest.xml | 6 +- .../Test/CheckoutSpecificDestinationsTest.xml | 4 +- ...ddressShouldBeCheckedOnPaymentPageTest.xml | 2 +- ...ckoutAsCustomerUsingDefaultAddressTest.xml | 2 +- ...eCheckoutAsCustomerUsingNewAddressTest.xml | 2 +- ...utAsCustomerUsingNonDefaultAddressTest.xml | 2 +- .../OnePageCheckoutUsingSignInLinkTest.xml | 2 +- ...OnePageCheckoutWithAllProductTypesTest.xml | 2 +- ...CartAndMiniShoppingCartPerCustomerTest.xml | 4 +- ...ateShoppingCartWhileUpdateMinicartTest.xml | 2 +- ...BundleDynamicProductToShoppingCartTest.xml | 2 +- ...dConfigurableProductToShoppingCartTest.xml | 2 +- ...dDownloadableProductToShoppingCartTest.xml | 2 +- ...ontAddGroupedProductToShoppingCartTest.xml | 2 +- ...MultiSelectOptionToTheShoppingCartTest.xml | 2 +- ...ultiSelectOptionsToTheShoppingCartTest.xml | 2 +- ...ingAddressAndProductWithTierPricesTest.xml | 4 +- ...ssAndRegisterCustomerAfterCheckoutTest.xml | 4 +- ...ntCheckoutWithSpecialPriceProductsTest.xml | 4 +- ...erCheckoutDisabledProductAndCouponTest.xml | 2 +- ...OnLoginWhenGuestCheckoutIsDisabledTest.xml | 4 +- ...egistrationAndDisableGuestCheckoutTest.xml | 6 +- ...refrontCustomerLoginDuringCheckoutTest.xml | 2 +- ...OrderWithNewAddressesThatWasEditedTest.xml | 2 +- ...eBundleProductFromMiniShoppingCartTest.xml | 6 +- ...gurableProductFromMiniShoppingCartTest.xml | 8 +- ...oadableProductFromMiniShoppingCartTest.xml | 8 +- ...aultLimitationFromMiniShoppingCartTest.xml | 24 +- ...VirtualProductFromMiniShoppingCartTest.xml | 12 +- ...eSimpleProductFromMiniShoppingCartTest.xml | 8 +- ...tCheckoutUsingFreeShippingAndTaxesTest.xml | 4 +- ...tCheckoutWithCouponAndZeroSubtotalTest.xml | 4 +- ...ippingMethodInReviewAndPaymentStepTest.xml | 8 +- ...ngesInBackendAfterCustomerCheckoutTest.xml | 4 +- ...rontRefreshPageDuringGuestCheckoutTest.xml | 2 +- ...aultShippingAddressForVirtualQuoteTest.xml | 2 +- ...efrontUKCustomerCheckoutWithCouponTest.xml | 2 +- ...uctQuantityEqualsToOrderedQuantityTest.xml | 4 +- ...CouponAndBankTransferPaymentMethodTest.xml | 4 +- ...UpdateShoppingCartSimpleProductQtyTest.xml | 2 +- ...tSimpleWithCustomOptionsProductQtyTest.xml | 2 +- .../Mftf/Test/AdminRelatedProductsTest.xml | 4 +- ...ingCartBehaviorAfterSessionExpiredTest.xml | 2 +- .../ShippingQuotePersistedForGuestTest.xml | 4 +- ...CartPersistenceUnderLongTermCookieTest.xml | 20 +- ...eConditionAndFreeShippingIsAppliedTest.xml | 2 +- ...AndVerifyRuleConditionIsNotAppliedTest.xml | 2 +- ...talAndVerifyRuleConditionIsAppliedTest.xml | 2 +- ...oryAndVerifyRuleConditionIsAppliedTest.xml | 2 +- ...ghtAndVerifyRuleConditionIsAppliedTest.xml | 2 +- ...artPriceRuleForConfigurableProductTest.xml | 4 +- ...frontCartRuleCouponForFreeShippingTest.xml | 2 +- ...yRulesShouldApplyToComplexProductsTest.xml | 4 +- ...ductWithInvisibleIndividualProductTest.xml | 4 +- ...oppingCartForCustomerPhysicalQuoteTest.xml | 2 +- ...hoppingCartForCustomerVirtualQuoteTest.xml | 2 +- ...nShoppingCartForGuestPhysicalQuoteTest.xml | 2 +- ...InShoppingCartForGuestVirtualQuoteTest.xml | 2 +- .../Mftf/Test/StorefrontTaxQuoteCartTest.xml | 16 +- 117 files changed, 1323 insertions(+), 900 deletions(-) create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertMiniCartEmptyActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertOneProductNameInMiniCartActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontCheckoutPaymentSummarySubtotalActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontCheckoutPaymentSummaryTotalActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontCheckoutPaymentSummaryTotalMissingActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontMiniCartProductDetailsAbsentActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/ChangeSummaryQuoteAddressActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckBillingAddressInCheckoutActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckBillingAddressInCheckoutWithBillingAddressOnPaymentPageActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckOrderSummaryInCheckoutActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckProductInCheckoutCartItemsActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckSelectedShippingAddressInCheckoutActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckShipToInformationInCheckoutActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckShippingMethodInCheckoutActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckTotalsSortOrderInSummarySectionActionGroup.xml delete mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutPlaceOrderActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutSelectCheckMoneyOrderPaymentActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutSelectFlatRateShippingMethodActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/ClickPlaceOrderActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/ClickViewAndEditCartFromMiniCartActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/FillGuestCheckoutShippingAddressWithCountryActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/GoToCheckoutFromCartActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/GoToCheckoutFromMinicartActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillShippingNoWaitForPaymentActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillingShippingSectionActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillingShippingSectionUnavailablePaymentActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillingShippingSectionWithoutRegionActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutSelectPaymentAndFillNewBillingAddressActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutWithSpecificCountryOptionForPaymentMethodActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/LoggedInCheckoutFillNewBillingAddressActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/LoggedInCheckoutWithOneAddressFieldWithoutStateFieldActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/LoggedInUserCheckoutAddNewShippingSectionWithoutRegionActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/LoggedInUserCheckoutFillingShippingSectionActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/PlaceOrderWithLoggedUserActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/RemoveProductFromMiniCartActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddCategoryProductToCartActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddCategoryProductToCartWithQuantityActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddProductToCartActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckCartActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckCartSimpleProductActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckCartTotalWithDiscountCategoryActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckoutFillNewBillingAddressActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckoutForwardFromShippingStepActionGroup.xml delete mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontMiniCartActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontOpenCartFromMinicartActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontOpenMinicartAndCheckSimpleProductActionGroup.xml delete mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontProductCartActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontSignOutActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/VerifyTopDestinationsCountryActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/clearCheckoutAddressPopupFieldsActionGroup.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest.xml index 545e7c10379bf..8aeb85aa3d2c6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest.xml @@ -135,7 +135,7 @@ <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$$createSimpleProduct.name$$"/> </actionGroup> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToCheckoutFromMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToCheckoutFromMinicart"/> <seeInField userInput="10" selector="{{CheckoutCartProductSection.ProductQuantityByName($$createSimpleProduct.name$$)}}" stepKey="seeInQtyField10"/> <grabTextFrom selector="{{CheckoutCartProductSection.productSubtotalByName($$createSimpleProduct.name$$)}}" stepKey="grabTextFromSubtotalField1"/> <assertEquals message="Shopping cart should contain subtotal $1,000" stepKey="assertSubtotalField1"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminConfigureProductImagePlaceholderTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminConfigureProductImagePlaceholderTest.xml index 4d97dee56f059..b5ab36729c7fe 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminConfigureProductImagePlaceholderTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminConfigureProductImagePlaceholderTest.xml @@ -62,9 +62,9 @@ <deleteData createDataKey="productNoImages" stepKey="deleteProductNoImages"/> <deleteData createDataKey="productWithImages" stepKey="deleteProductWithImages"/> </after> - + <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminArea"/> - + <!--Admin area: configure Product Image Placeholders--> <comment userInput="Configure product image placeholders in store config" stepKey="configurePlaceholderComment"/> <amOnPage url="{{CatalogConfigPage.url}}" stepKey="goToCatalogConfigurationPage"/> @@ -120,7 +120,7 @@ <actualResult type="variable">$getThumbnailPlaceholderImageSrc</actualResult> <expectedResult type="string">{{placeholderThumbnailImage.name}}</expectedResult> </assertContains> - <actionGroup ref="removeProductFromMiniCart" stepKey="removeProductFromCart1"> + <actionGroup ref="RemoveProductFromMiniCartActionGroup" stepKey="removeProductFromCart1"> <argument name="productName" value="$$productNoImages.name$$"/> </actionGroup> <!--Product which is NOT using placeholder--> @@ -138,7 +138,7 @@ <actualResult type="variable">$getThumbnailImageSrc</actualResult> <expectedResult type="string">{{placeholderThumbnailImage.name}}</expectedResult> </assertNotContains> - <actionGroup ref="removeProductFromMiniCart" stepKey="removeProductFromCart2"> + <actionGroup ref="RemoveProductFromMiniCartActionGroup" stepKey="removeProductFromCart2"> <argument name="productName" value="$$productWithImages.name$$"/> </actionGroup> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/TieredPricingAndQuantityIncrementsWorkWithDecimalinventoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/TieredPricingAndQuantityIncrementsWorkWithDecimalinventoryTest.xml index 4d7c97b26457c..0413018128491 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/TieredPricingAndQuantityIncrementsWorkWithDecimalinventoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/TieredPricingAndQuantityIncrementsWorkWithDecimalinventoryTest.xml @@ -79,7 +79,7 @@ <waitForElementVisible selector="{{StorefrontProductPageSection.successMsg}}" time="30" stepKey="waitForProductAdded"/> <see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="You added $$createPreReqSimpleProduct.name$$ to your shopping cart." stepKey="seeAddedToCartMessage"/> <!--Step9. Click on *Cart* icon. Click on *View and Edit Cart* link. Change *Qty* value to *5.5*--> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> <fillField selector="{{CheckoutCartProductSection.ProductQuantityByName(('$$createPreReqSimpleProduct.name$$'))}}" userInput="5.5" stepKey="fillQty2"/> <click selector="{{CheckoutCartProductSection.updateShoppingCartButton}}" stepKey="clickOnUpdateShoppingCartButton"/> <seeInField userInput="5.5" selector="{{CheckoutCartProductSection.ProductQuantityByName(('$$createPreReqSimpleProduct.name$$'))}}" stepKey="seeInField2"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertMiniCartEmptyActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertMiniCartEmptyActionGroup.xml new file mode 100644 index 0000000000000..649421a53040b --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertMiniCartEmptyActionGroup.xml @@ -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="AssertMiniCartEmptyActionGroup"> + <annotations> + <description>Validates that the provided Product Count appears in the Storefront Header next to the Shopping Cart icon. Clicks on the Mini Shopping Cart icon. Validates that the 'No Items' message is present and correct in the Storefront Mini Shopping Cart.</description> + </annotations> + + <dontSeeElement selector="{{StorefrontMinicartSection.productCount}}" stepKey="dontSeeMinicartProductCount"/> + <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="expandMinicart"/> + <see selector="{{StorefrontMinicartSection.minicartContent}}" userInput="You have no items in your shopping cart." stepKey="seeEmptyCartMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertOneProductNameInMiniCartActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertOneProductNameInMiniCartActionGroup.xml new file mode 100644 index 0000000000000..de54c78fc28ff --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertOneProductNameInMiniCartActionGroup.xml @@ -0,0 +1,23 @@ +<?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="AssertOneProductNameInMiniCartActionGroup"> + <annotations> + <description>Validates that the provided Product Name is present in the Storefront Mini Shopping Cart.</description> + </annotations> + <arguments> + <argument name="productName"/> + </arguments> + + <conditionalClick selector="{{StorefrontMinicartSection.showCart}}" dependentSelector="{{StorefrontMinicartSection.miniCartOpened}}" visible="false" stepKey="openMiniCart"/> + <waitForElementVisible selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="waitForViewAndEditCartVisible"/> + <see selector="{{StorefrontMinicartSection.miniCartItemsText}}" userInput="{{productName}}" stepKey="seeInMiniCart"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontCheckoutPaymentSummarySubtotalActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontCheckoutPaymentSummarySubtotalActionGroup.xml new file mode 100644 index 0000000000000..bbf578fb8ca8f --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontCheckoutPaymentSummarySubtotalActionGroup.xml @@ -0,0 +1,19 @@ +<?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="AssertStorefrontCheckoutPaymentSummarySubtotalActionGroup"> + <arguments> + <argument name="orderSubtotal" type="string"/> + </arguments> + <waitForPageLoad time="30" stepKey="waitForCartFullyLoaded"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.orderSummarySubtotal}}" time="30" stepKey="waitForOrderSummaryBlock"/> + <see selector="{{CheckoutPaymentSection.orderSummarySubtotal}}" userInput="{{orderSubtotal}}" stepKey="seeCorrectSubtotal"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontCheckoutPaymentSummaryTotalActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontCheckoutPaymentSummaryTotalActionGroup.xml new file mode 100644 index 0000000000000..626e9d7a98183 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontCheckoutPaymentSummaryTotalActionGroup.xml @@ -0,0 +1,19 @@ +<?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="AssertStorefrontCheckoutPaymentSummaryTotalActionGroup"> + <arguments> + <argument name="orderTotal" type="string"/> + </arguments> + <waitForPageLoad time="30" stepKey="waitForCartFullyLoaded"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.orderSummaryTotal}}" time="30" stepKey="waitForOrderSummaryBlock"/> + <see selector="{{CheckoutPaymentSection.orderSummaryTotal}}" userInput="{{orderTotal}}" stepKey="seeCorrectOrderTotal"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontCheckoutPaymentSummaryTotalMissingActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontCheckoutPaymentSummaryTotalMissingActionGroup.xml new file mode 100644 index 0000000000000..874d2921022b1 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontCheckoutPaymentSummaryTotalMissingActionGroup.xml @@ -0,0 +1,15 @@ +<?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="AssertStorefrontCheckoutPaymentSummaryTotalMissingActionGroup"> + <waitForPageLoad time="30" stepKey="waitForCartFullyLoaded"/> + <dontSeeElement selector="{{CheckoutPaymentSection.orderSummaryTotal}}" stepKey="seeTotalElement"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontMiniCartItemsActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontMiniCartItemsActionGroup.xml index 8933ebbc1dd84..5545d7ad437a1 100644 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontMiniCartItemsActionGroup.xml +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontMiniCartItemsActionGroup.xml @@ -25,17 +25,4 @@ <seeElement selector="{{StorefrontMinicartSection.productImage}}" stepKey="seeProductImage"/> <see selector="{{StorefrontMinicartSection.productSubTotal}}" userInput="{{cartSubtotal}}" stepKey="seeSubTotal"/> </actionGroup> - - <actionGroup name="AssertStorefrontMiniCartProductDetailsAbsentActionGroup"> - <annotations> - <description>Validates that the provided Product details (Name, Price) are - not present in the Storefront Mini Shopping Cart.</description> - </annotations> - <arguments> - <argument name="productName" type="string"/> - <argument name="productPrice" type="string"/> - </arguments> - - <dontSee selector="{{StorefrontMinicartSection.productPriceByName(productName)}}" userInput="{{productPrice}}" stepKey="dontSeeProductPriceInMiniCart"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontMiniCartProductDetailsAbsentActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontMiniCartProductDetailsAbsentActionGroup.xml new file mode 100644 index 0000000000000..5d52feeaad9cc --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontMiniCartProductDetailsAbsentActionGroup.xml @@ -0,0 +1,23 @@ +<?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="AssertStorefrontMiniCartProductDetailsAbsentActionGroup"> + <annotations> + <description>Validates that the provided Product details (Name, Price) are + not present in the Storefront Mini Shopping Cart.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + <argument name="productPrice" type="string"/> + </arguments> + + <dontSee selector="{{StorefrontMinicartSection.productPriceByName(productName)}}" userInput="{{productPrice}}" stepKey="dontSeeProductPriceInMiniCart"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/ChangeSummaryQuoteAddressActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/ChangeSummaryQuoteAddressActionGroup.xml new file mode 100644 index 0000000000000..041d3530a7e82 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/ChangeSummaryQuoteAddressActionGroup.xml @@ -0,0 +1,25 @@ +<?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="ChangeSummaryQuoteAddressActionGroup"> + <annotations> + <description>Fills in the provided Address details (Country, State and Zip Code) under the 'Summary' section on the Storefront Shopping Cart page.</description> + </annotations> + <arguments> + <argument name="taxCode"/> + </arguments> + + <conditionalClick stepKey="openShippingDetails" selector="{{CheckoutCartSummarySection.shippingHeading}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false"/> + <selectOption stepKey="selectCountry" selector="{{CheckoutCartSummarySection.country}}" userInput="{{taxCode.country}}"/> + <selectOption stepKey="selectStateProvince" selector="{{CheckoutCartSummarySection.stateProvince}}" userInput="{{taxCode.state}}"/> + <fillField stepKey="fillZip" selector="{{CheckoutCartSummarySection.postcode}}" userInput="{{taxCode.zip}}"/> + <waitForPageLoad stepKey="waitForFormUpdate"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckBillingAddressInCheckoutActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckBillingAddressInCheckoutActionGroup.xml new file mode 100644 index 0000000000000..d0128a9913fe9 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckBillingAddressInCheckoutActionGroup.xml @@ -0,0 +1,29 @@ +<?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="CheckBillingAddressInCheckoutActionGroup"> + <annotations> + <description>Validates that the provided Customer and Address details are present on the Storefront Checkout page under the 'Payment Method' section.</description> + </annotations> + <arguments> + <argument name="customerVar"/> + <argument name="customerAddressVar"/> + </arguments> + + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> + <see userInput="{{customerVar.firstName}}" selector="{{CheckoutPaymentSection.billingAddress}}" stepKey="assertBillingAddressFirstName"/> + <see userInput="{{customerVar.lastName}}" selector="{{CheckoutPaymentSection.billingAddress}}" stepKey="assertBillingAddressLastName"/> + <see userInput="{{customerAddressVar.street[0]}}" selector="{{CheckoutPaymentSection.billingAddress}}" stepKey="assertBillingAddressStreet"/> + <see userInput="{{customerAddressVar.city}}" selector="{{CheckoutPaymentSection.billingAddress}}" stepKey="assertBillingAddressCity"/> + <see userInput="{{customerAddressVar.state}}" selector="{{CheckoutPaymentSection.billingAddress}}" stepKey="assertBillingAddressState"/> + <see userInput="{{customerAddressVar.postcode}}" selector="{{CheckoutPaymentSection.billingAddress}}" stepKey="assertBillingAddressPostcode"/> + <see userInput="{{customerAddressVar.telephone}}" selector="{{CheckoutPaymentSection.billingAddress}}" stepKey="assertBillingAddressTelephone"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckBillingAddressInCheckoutWithBillingAddressOnPaymentPageActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckBillingAddressInCheckoutWithBillingAddressOnPaymentPageActionGroup.xml new file mode 100644 index 0000000000000..adba81138c17d --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckBillingAddressInCheckoutWithBillingAddressOnPaymentPageActionGroup.xml @@ -0,0 +1,29 @@ +<?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="CheckBillingAddressInCheckoutWithBillingAddressOnPaymentPageActionGroup"> + <annotations> + <description>Validates that the provided Customer and Address details appear on the Storefront Checkout page under the 'Billing Address' section.</description> + </annotations> + <arguments> + <argument name="customerVar"/> + <argument name="customerAddressVar"/> + </arguments> + + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> + <see userInput="{{customerVar.firstName}}" selector="{{CheckoutPaymentWithDisplayBillingAddressOnPaymentPageSection.billingAddressDetails}}" stepKey="assertBillingAddressDetailsFirstName"/> + <see userInput="{{customerVar.lastName}}" selector="{{CheckoutPaymentWithDisplayBillingAddressOnPaymentPageSection.billingAddressDetails}}" stepKey="assertBillingAddressDetailsLastName"/> + <see userInput="{{customerAddressVar.street[0]}}" selector="{{CheckoutPaymentWithDisplayBillingAddressOnPaymentPageSection.billingAddressDetails}}" stepKey="assertBillingAddressDetailsStreet"/> + <see userInput="{{customerAddressVar.city}}" selector="{{CheckoutPaymentWithDisplayBillingAddressOnPaymentPageSection.billingAddressDetails}}" stepKey="assertBillingAddressDetailsCity"/> + <see userInput="{{customerAddressVar.state}}" selector="{{CheckoutPaymentWithDisplayBillingAddressOnPaymentPageSection.billingAddressDetails}}" stepKey="assertBillingAddressDetailsState"/> + <see userInput="{{customerAddressVar.postcode}}" selector="{{CheckoutPaymentWithDisplayBillingAddressOnPaymentPageSection.billingAddressDetails}}" stepKey="assertBillingAddressDetailsPostcode"/> + <see userInput="{{customerAddressVar.telephone}}" selector="{{CheckoutPaymentWithDisplayBillingAddressOnPaymentPageSection.billingAddressDetails}}" stepKey="assertBillingAddressDetailsTelephone"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckOrderSummaryInCheckoutActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckOrderSummaryInCheckoutActionGroup.xml new file mode 100644 index 0000000000000..9db5021e97322 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckOrderSummaryInCheckoutActionGroup.xml @@ -0,0 +1,28 @@ +<?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="CheckOrderSummaryInCheckoutActionGroup"> + <annotations> + <description>Validates that the provided Subtotal, Shipping Total, Shipping Method and Total are present and correct on the Storefront Checkout page under the 'Order Summary' section.</description> + </annotations> + <arguments> + <argument name="subtotal" type="string"/> + <argument name="shippingTotal" type="string"/> + <argument name="shippingMethod" type="string"/> + <argument name="total" type="string"/> + </arguments> + + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> + <see userInput="{{subtotal}}" selector="{{CheckoutPaymentSection.orderSummarySubtotal}}" stepKey="assertSubtotal"/> + <see userInput="{{shippingTotal}}" selector="{{CheckoutPaymentSection.orderSummaryShippingTotal}}" stepKey="assertShipping"/> + <see userInput="{{shippingMethod}}" selector="{{CheckoutPaymentSection.orderSummaryShippingMethod}}" stepKey="assertShippingMethod"/> + <see userInput="{{total}}" selector="{{CheckoutPaymentSection.orderSummaryTotal}}" stepKey="assertTotal"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckProductInCheckoutCartItemsActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckProductInCheckoutCartItemsActionGroup.xml new file mode 100644 index 0000000000000..85ec765ecd64f --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckProductInCheckoutCartItemsActionGroup.xml @@ -0,0 +1,25 @@ +<?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="CheckProductInCheckoutCartItemsActionGroup"> + <annotations> + <description>Validates the provided Product appears in the Storefront Checkout 'Order Summary' section.</description> + </annotations> + <arguments> + <argument name="productVar"/> + </arguments> + + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> + <conditionalClick selector="{{CheckoutPaymentSection.cartItemsArea}}" dependentSelector="{{CheckoutPaymentSection.cartItemsArea}}" visible="true" stepKey="exposeMiniCart"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskForCartItem"/> + <waitForElement selector="{{CheckoutPaymentSection.cartItemsAreaActive}}" time="30" stepKey="waitForCartItemsAreaActive"/> + <see selector="{{CheckoutPaymentSection.cartItems}}" userInput="{{productVar.name}}" stepKey="seeProductInCart"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckSelectedShippingAddressInCheckoutActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckSelectedShippingAddressInCheckoutActionGroup.xml new file mode 100644 index 0000000000000..0c952af6d53fa --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckSelectedShippingAddressInCheckoutActionGroup.xml @@ -0,0 +1,28 @@ +<?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="CheckSelectedShippingAddressInCheckoutActionGroup"> + <annotations> + <description>Validates that the provided Customer and Address details are listed on the Storefront Checkout page under the 'Shipping Address' section when multiple Addresses are present for a Customer.</description> + </annotations> + <arguments> + <argument name="customerVar"/> + <argument name="customerAddressVar"/> + </arguments> + + <waitForElement selector="{{CheckoutShippingSection.shippingTab}}" time="30" stepKey="waitForShippingSectionLoaded"/> + <see stepKey="VerifyFirstNameInSelectedAddress" selector="{{CheckoutShippingSection.selectedShippingAddress}}" userInput="{{customerVar.firstname}}"/> + <see stepKey="VerifyLastNameInSelectedAddress" selector="{{CheckoutShippingSection.selectedShippingAddress}}" userInput="{{customerVar.lastname}}"/> + <see stepKey="VerifyStreetInSelectedAddress" selector="{{CheckoutShippingSection.selectedShippingAddress}}" userInput="{{customerAddressVar.street[0]}}"/> + <see stepKey="VerifyCityInSelectedAddress" selector="{{CheckoutShippingSection.selectedShippingAddress}}" userInput="{{customerAddressVar.city}}"/> + <see stepKey="VerifyZipInSelectedAddress" selector="{{CheckoutShippingSection.selectedShippingAddress}}" userInput="{{customerAddressVar.postcode}}"/> + <see stepKey="VerifyPhoneInSelectedAddress" selector="{{CheckoutShippingSection.selectedShippingAddress}}" userInput="{{customerAddressVar.telephone}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckShipToInformationInCheckoutActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckShipToInformationInCheckoutActionGroup.xml new file mode 100644 index 0000000000000..f2ededd7f4b17 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckShipToInformationInCheckoutActionGroup.xml @@ -0,0 +1,29 @@ +<?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="CheckShipToInformationInCheckoutActionGroup"> + <annotations> + <description>Validates that the provided Customer and Address details are present and correct on the Storefront Checkout page under the 'Ship To' section.</description> + </annotations> + <arguments> + <argument name="customerVar"/> + <argument name="customerAddressVar"/> + </arguments> + + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> + <see userInput="{{customerVar.firstname}}" selector="{{CheckoutPaymentSection.shipToInformation}}" stepKey="assertShipToInformationFirstName"/> + <see userInput="{{customerVar.lastname}}" selector="{{CheckoutPaymentSection.shipToInformation}}" stepKey="assertShipToInformationLastName"/> + <see userInput="{{customerAddressVar.street[0]}}" selector="{{CheckoutPaymentSection.shipToInformation}}" stepKey="assertShipToInformationStreet"/> + <see userInput="{{customerAddressVar.city}}" selector="{{CheckoutPaymentSection.shipToInformation}}" stepKey="assertShipToInformationCity"/> + <see userInput="{{customerAddressVar.state}}" selector="{{CheckoutPaymentSection.shipToInformation}}" stepKey="assertShipToInformationState"/> + <see userInput="{{customerAddressVar.postcode}}" selector="{{CheckoutPaymentSection.shipToInformation}}" stepKey="assertShipToInformationPostcode"/> + <see userInput="{{customerAddressVar.telephone}}" selector="{{CheckoutPaymentSection.shipToInformation}}" stepKey="assertShipToInformationTelephone"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckShippingMethodInCheckoutActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckShippingMethodInCheckoutActionGroup.xml new file mode 100644 index 0000000000000..968ee8b46d0ba --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckShippingMethodInCheckoutActionGroup.xml @@ -0,0 +1,22 @@ +<?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="CheckShippingMethodInCheckoutActionGroup"> + <annotations> + <description>Validates that the provided Shipping Method Name is present on the Storefront Checkout page under the 'Shipping Method' section.</description> + </annotations> + <arguments> + <argument name="shippingMethod"/> + </arguments> + + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> + <see userInput="{{shippingMethod}}" selector="{{CheckoutPaymentSection.shippingMethodInformation}}" stepKey="assertshippingMethodInformation"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckTotalsSortOrderInSummarySectionActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckTotalsSortOrderInSummarySectionActionGroup.xml new file mode 100644 index 0000000000000..4bd2d40ab94f1 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckTotalsSortOrderInSummarySectionActionGroup.xml @@ -0,0 +1,22 @@ +<?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="CheckTotalsSortOrderInSummarySectionActionGroup"> + <annotations> + <description>Validates that the provided Element Name appears at the provided Position in the Storefront Checkout 'Order Summary' section.</description> + </annotations> + <arguments> + <argument name="elementName" type="string"/> + <argument name="positionNumber" type="string"/> + </arguments> + + <see userInput="{{elementName}}" selector="{{CheckoutCartSummarySection.elementPosition(positionNumber)}}" stepKey="assertElementPosition"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutActionGroup.xml deleted file mode 100644 index 4c7d4e31b2d6f..0000000000000 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutActionGroup.xml +++ /dev/null @@ -1,433 +0,0 @@ -<?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"> - <!-- Checkout select Flat Rate shipping method --> - <actionGroup name="CheckoutSelectFlatRateShippingMethodActionGroup"> - <annotations> - <description>Clicks on the 'Flat Rate' Shipping Method on the Storefront Checkout page.</description> - </annotations> - - <conditionalClick selector="{{CheckoutShippingMethodsSection.checkShippingMethodByName('Flat Rate')}}" dependentSelector="{{CheckoutShippingMethodsSection.checkShippingMethodByName('Flat Rate')}}" visible="true" stepKey="selectFlatRateShippingMethod"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskForNextButton"/> - </actionGroup> - - <!-- Go to checkout from minicart --> - <actionGroup name="GoToCheckoutFromMinicartActionGroup"> - <annotations> - <description>Clicks on the Storefront Mini Shopping Cart icon. Clicks on 'Proceed to Checkout'.</description> - </annotations> - - <waitForElementNotVisible selector="{{StorefrontMinicartSection.emptyCart}}" stepKey="waitUpdateQuantity"/> - <wait time="5" stepKey="waitMinicartRendering"/> - <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickCart"/> - <click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="goToCheckout"/> - </actionGroup> - - <!-- Go to checkout from cart --> - <actionGroup name="GoToCheckoutFromCartActionGroup"> - <annotations> - <description>Clicks on the 'View and Edit Cart' link in the Storefront Mini Shopping Cart. Validates that the Storefront Shopping Cart URL is present and correct. Clicks on 'Proceed to Checkout'.</description> - </annotations> - - <waitForElementNotVisible selector="{{StorefrontMinicartSection.emptyCart}}" stepKey="waitUpdateQuantity"/> - <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickCart"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> - <seeInCurrentUrl url="{{CheckoutCartPage.url}}" stepKey="assertCheckoutCartUrl"/> - <click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="goToCheckout"/> - </actionGroup> - - <!-- Guest checkout filling shipping section --> - <actionGroup name="GuestCheckoutFillingShippingSectionActionGroup"> - <annotations> - <description>Fills in the provided Customer/Address (Including Region) details on the Storefront Checkout page under the 'Shipping Address' section. Selects the provided Shipping Method. Clicks on Next. Validates that the URL is present and correct.</description> - </annotations> - <arguments> - <argument name="customerVar" defaultValue="CustomerEntityOne"/> - <argument name="customerAddressVar" defaultValue="CustomerAddressSimple"/> - <!--First available shipping method will be selected if value is not passed for shippingMethod--> - <argument name="shippingMethod" defaultValue="" type="string"/> - </arguments> - - <fillField selector="{{CheckoutShippingSection.email}}" userInput="{{customerVar.email}}" stepKey="enterEmail"/> - <fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{customerVar.firstname}}" stepKey="enterFirstName"/> - <fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{customerVar.lastname}}" stepKey="enterLastName"/> - <fillField selector="{{CheckoutShippingSection.street}}" userInput="{{customerAddressVar.street[0]}}" stepKey="enterStreet"/> - <fillField selector="{{CheckoutShippingSection.city}}" userInput="{{customerAddressVar.city}}" stepKey="enterCity"/> - <selectOption selector="{{CheckoutShippingSection.region}}" userInput="{{customerAddressVar.state}}" stepKey="selectRegion"/> - <fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{customerAddressVar.postcode}}" stepKey="enterPostcode"/> - <fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{customerAddressVar.telephone}}" stepKey="enterTelephone"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> - <waitForElement selector="{{CheckoutShippingMethodsSection.checkShippingMethodByName('shippingMethod')}}" stepKey="waitForShippingMethod"/> - <click selector="{{CheckoutShippingMethodsSection.checkShippingMethodByName('shippingMethod')}}" stepKey="selectShippingMethod"/> - <waitForElement selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/> - <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/> - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> - <seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/> - </actionGroup> - - <actionGroup name="GuestCheckoutFillShippingNoWaitForPaymentActionGroup" extends="GuestCheckoutFillingShippingSectionActionGroup"> - <annotations> - <description>EXTENDS: GuestCheckoutFillingShippingSectionActionGroup. Removed 'waitForPaymentSectionLoaded' and 'assertCheckoutPaymentUrl'.</description> - </annotations> - - <remove keyForRemoval="waitForPaymentSectionLoaded"/> - <remove keyForRemoval="assertCheckoutPaymentUrl"/> - </actionGroup> - - <!-- Guest checkout filling shipping section without region --> - <actionGroup name="GuestCheckoutFillingShippingSectionWithoutRegionActionGroup"> - <annotations> - <description>Fills in the provided Customer/Address (Excluding Region) details on the Storefront Checkout page under the 'Shipping Address' section. Selects the provided Shipping Method. Clicks on Next. Validates that the URL is present and correct.</description> - </annotations> - <arguments> - <argument name="customerVar"/> - <argument name="customerAddressVar"/> - </arguments> - - <fillField selector="{{CheckoutShippingSection.email}}" userInput="{{customerVar.email}}" stepKey="enterEmail"/> - <fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{customerVar.firstname}}" stepKey="enterFirstName"/> - <fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{customerVar.lastname}}" stepKey="enterLastName"/> - <fillField selector="{{CheckoutShippingSection.street}}" userInput="{{customerAddressVar.street[0]}}" stepKey="enterStreet"/> - <fillField selector="{{CheckoutShippingSection.city}}" userInput="{{customerAddressVar.city}}" stepKey="enterCity"/> - <fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{customerAddressVar.postcode}}" stepKey="enterPostcode"/> - <selectOption selector="{{CheckoutShippingSection.country}}" userInput="{{customerAddressVar.country_id}}" stepKey="enterCountry"/> - <fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{customerAddressVar.telephone}}" stepKey="enterTelephone"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> - <click selector="{{CheckoutShippingSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod"/> - <waitForElement selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/> - <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/> - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> - <seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/> - </actionGroup> - - <!-- Guest checkout filling shipping section with unavailable payments--> - <actionGroup name="GuestCheckoutFillingShippingSectionUnavailablePaymentActionGroup"> - <annotations> - <description>Fills in the provided Customer/Address (Including Region) details on the Storefront Checkout page under the 'Shipping Address' section. Selects the 1st Shipping Method. Clicks on Next. Validates that the Payment Error Message and URL are present and correct.</description> - </annotations> - <arguments> - <argument name="customerVar"/> - <argument name="customerAddressVar"/> - </arguments> - - <fillField selector="{{CheckoutShippingSection.email}}" userInput="{{customerVar.email}}" stepKey="enterEmail"/> - <fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{customerVar.firstname}}" stepKey="enterFirstName"/> - <fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{customerVar.lastname}}" stepKey="enterLastName"/> - <fillField selector="{{CheckoutShippingSection.street}}" userInput="{{customerAddressVar.street[0]}}" stepKey="enterStreet"/> - <fillField selector="{{CheckoutShippingSection.city}}" userInput="{{customerAddressVar.city}}" stepKey="enterCity"/> - <selectOption selector="{{CheckoutShippingSection.region}}" userInput="{{customerAddressVar.state}}" stepKey="selectRegion"/> - <fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{customerAddressVar.postcode}}" stepKey="enterPostcode"/> - <fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{customerAddressVar.telephone}}" stepKey="enterTelephone"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> - <click selector="{{CheckoutShippingSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod"/> - <waitForElement selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/> - <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/> - <seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/> - <waitForElementVisible selector="{{CheckoutPaymentSection.noQuotes}}" stepKey="waitMessage"/> - <see userInput="No Payment method available." stepKey="checkMessage"/> - </actionGroup> - - <actionGroup name="GuestCheckoutWithSpecificCountryOptionForPaymentMethodActionGroup" extends="GuestCheckoutFillingShippingSectionUnavailablePaymentActionGroup"> - <annotations> - <description>EXTENDS: GuestCheckoutFillingShippingSectionUnavailablePaymentActionGroup. Removes 'checkMessage'. Validates that the provided Payment Method Name is NOT present on the Storefront Checkout page.</description> - </annotations> - <arguments> - <argument name="paymentMethod" type="string"/> - </arguments> - - <remove keyForRemoval="checkMessage"/> - <dontSee selector="{{CheckoutPaymentSection.paymentMethodByName(paymentMethod)}}" stepKey="paymentMethodDoesNotAvailable"/> - </actionGroup> - - <!-- Logged in user checkout filling shipping section --> - <actionGroup name="LoggedInUserCheckoutFillingShippingSectionActionGroup"> - <annotations> - <description>Fills in the provided Customer/Address (Including Region) details on the Storefront Checkout page under the 'Shipping Address' section. Selects the 1st Shipping Method. Clicks on Next. Validates that the Payment Error Message and URL are present and correct.</description> - </annotations> - <arguments> - <argument name="customerVar" defaultValue="CustomerEntityOne"/> - <argument name="customerAddressVar" defaultValue="CustomerAddressSimple"/> - </arguments> - - <fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{customerVar.firstname}}" stepKey="enterFirstName"/> - <fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{customerVar.lastname}}" stepKey="enterLastName"/> - <fillField selector="{{CheckoutShippingSection.street}}" userInput="{{customerAddressVar.street[0]}}" stepKey="enterStreet"/> - <fillField selector="{{CheckoutShippingSection.city}}" userInput="{{customerAddressVar.city}}" stepKey="enterCity"/> - <selectOption selector="{{CheckoutShippingSection.region}}" userInput="{{customerAddressVar.state}}" stepKey="selectRegion"/> - <fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{customerAddressVar.postcode}}" stepKey="enterPostcode"/> - <fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{customerAddressVar.telephone}}" stepKey="enterTelephone"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> - <click selector="{{CheckoutShippingSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod"/> - <waitForElement selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/> - <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/> - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> - <seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/> - </actionGroup> - - <!-- Submit Shipping Address on Checkout Shipping page --> - <actionGroup name="StorefrontCheckoutForwardFromShippingStep"> - <annotations> - <description>Clicks next on Checkout Shipping step</description> - </annotations> - <waitForElementVisible selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/> - <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/> - </actionGroup> - - <!-- Logged in user checkout filling shipping section --> - <actionGroup name="LoggedInUserCheckoutAddNewShippingSectionWithoutRegionActionGroup"> - <annotations> - <description>Fills in the provided Customer/Address (Excluding Region) details on the Storefront Checkout page under the 'Shipping Address' section. Selects the 1st Shipping Method. Clicks on Next. Validates that the Payment Error Message and URL are present and correct.</description> - </annotations> - <arguments> - <argument name="customerVar"/> - <argument name="customerAddressVar"/> - </arguments> - - <fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{customerVar.firstname}}" stepKey="enterFirstName"/> - <fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{customerVar.lastname}}" stepKey="enterLastName"/> - <fillField selector="{{CheckoutShippingSection.street}}" userInput="{{customerAddressVar.street[0]}}" stepKey="enterStreet"/> - <fillField selector="{{CheckoutShippingSection.city}}" userInput="{{customerAddressVar.city}}" stepKey="enterCity"/> - <fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{customerAddressVar.postcode}}" stepKey="enterPostcode"/> - <selectOption selector="{{CheckoutShippingSection.country}}" userInput="{{customerAddressVar.country_id}}" stepKey="enterCountry"/> - <fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{customerAddressVar.telephone}}" stepKey="enterTelephone"/> - <click selector="{{CheckoutShippingSection.saveAddress}}" stepKey="clickSaveAddress"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> - <click selector="{{CheckoutShippingSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod"/> - <waitForElement selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/> - <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/> - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> - <seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/> - </actionGroup> - - <!-- Place order with logged the user --> - <actionGroup name="PlaceOrderWithLoggedUserActionGroup"> - <annotations> - <description>Clicks on 'Proceed to Checkout' on the Storefront Shopping Cart page. Selects the provided Shipping Method. Clicks on Next. Clicks on Place Order. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <!--First available shipping method will be selected if value is not passed for shippingMethod--> - <argument name="shippingMethod" defaultValue="" type="string"/> - </arguments> - - <waitForElementVisible selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="waitProceedToCheckout"/> - <click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="clickProceedToCheckout"/> - <click selector="{{CheckoutShippingMethodsSection.checkShippingMethodByName('shippingMethod')}}" stepKey="selectShippingMethod"/> - <waitForElement selector="{{CheckoutShippingSection.next}}" stepKey="waitForNextButton"/> - <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/> - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/> - <seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/> - <waitForElementVisible selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="waitForPlaceOrderButton"/> - <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> - <see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage"/> - </actionGroup> - - <!-- Check product in checkout cart items --> - <actionGroup name="CheckProductInCheckoutCartItemsActionGroup"> - <annotations> - <description>Validates the provided Product appears in the Storefront Checkout 'Order Summary' section.</description> - </annotations> - <arguments> - <argument name="productVar"/> - </arguments> - - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> - <conditionalClick selector="{{CheckoutPaymentSection.cartItemsArea}}" dependentSelector="{{CheckoutPaymentSection.cartItemsArea}}" visible="true" stepKey="exposeMiniCart"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskForCartItem"/> - <waitForElement selector="{{CheckoutPaymentSection.cartItemsAreaActive}}" time="30" stepKey="waitForCartItemsAreaActive"/> - <see selector="{{CheckoutPaymentSection.cartItems}}" userInput="{{productVar.name}}" stepKey="seeProductInCart"/> - </actionGroup> - - <!-- Check order summary in checkout --> - <actionGroup name="CheckOrderSummaryInCheckoutActionGroup"> - <annotations> - <description>Validates that the provided Subtotal, Shipping Total, Shipping Method and Total are present and correct on the Storefront Checkout page under the 'Order Summary' section.</description> - </annotations> - <arguments> - <argument name="subtotal" type="string"/> - <argument name="shippingTotal" type="string"/> - <argument name="shippingMethod" type="string"/> - <argument name="total" type="string"/> - </arguments> - - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> - <see userInput="{{subtotal}}" selector="{{CheckoutPaymentSection.orderSummarySubtotal}}" stepKey="assertSubtotal"/> - <see userInput="{{shippingTotal}}" selector="{{CheckoutPaymentSection.orderSummaryShippingTotal}}" stepKey="assertShipping"/> - <see userInput="{{shippingMethod}}" selector="{{CheckoutPaymentSection.orderSummaryShippingMethod}}" stepKey="assertShippingMethod"/> - <see userInput="{{total}}" selector="{{CheckoutPaymentSection.orderSummaryTotal}}" stepKey="assertTotal"/> - </actionGroup> - - <actionGroup name="CheckTotalsSortOrderInSummarySection"> - <annotations> - <description>Validates that the provided Element Name appears at the provided Position in the Storefront Checkout 'Order Summary' section.</description> - </annotations> - <arguments> - <argument name="elementName" type="string"/> - <argument name="positionNumber" type="string"/> - </arguments> - - <see userInput="{{elementName}}" selector="{{CheckoutCartSummarySection.elementPosition(positionNumber)}}" stepKey="assertElementPosition"/> - </actionGroup> - - <!-- Check ship to information in checkout --> - <actionGroup name="CheckShipToInformationInCheckoutActionGroup"> - <annotations> - <description>Validates that the provided Customer and Address details are present and correct on the Storefront Checkout page under the 'Ship To' section.</description> - </annotations> - <arguments> - <argument name="customerVar"/> - <argument name="customerAddressVar"/> - </arguments> - - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> - <see userInput="{{customerVar.firstname}}" selector="{{CheckoutPaymentSection.shipToInformation}}" stepKey="assertShipToInformationFirstName"/> - <see userInput="{{customerVar.lastname}}" selector="{{CheckoutPaymentSection.shipToInformation}}" stepKey="assertShipToInformationLastName"/> - <see userInput="{{customerAddressVar.street[0]}}" selector="{{CheckoutPaymentSection.shipToInformation}}" stepKey="assertShipToInformationStreet"/> - <see userInput="{{customerAddressVar.city}}" selector="{{CheckoutPaymentSection.shipToInformation}}" stepKey="assertShipToInformationCity"/> - <see userInput="{{customerAddressVar.state}}" selector="{{CheckoutPaymentSection.shipToInformation}}" stepKey="assertShipToInformationState"/> - <see userInput="{{customerAddressVar.postcode}}" selector="{{CheckoutPaymentSection.shipToInformation}}" stepKey="assertShipToInformationPostcode"/> - <see userInput="{{customerAddressVar.telephone}}" selector="{{CheckoutPaymentSection.shipToInformation}}" stepKey="assertShipToInformationTelephone"/> - </actionGroup> - - <!-- Check shipping method in checkout --> - <actionGroup name="CheckShippingMethodInCheckoutActionGroup"> - <annotations> - <description>Validates that the provided Shipping Method Name is present on the Storefront Checkout page under the 'Shipping Method' section.</description> - </annotations> - <arguments> - <argument name="shippingMethod"/> - </arguments> - - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> - <see userInput="{{shippingMethod}}" selector="{{CheckoutPaymentSection.shippingMethodInformation}}" stepKey="assertshippingMethodInformation"/> - </actionGroup> - - <!-- Checkout select Check/Money Order payment --> - <actionGroup name="CheckoutSelectCheckMoneyOrderPaymentActionGroup"> - <annotations> - <description>Selects the 'Check / Money Order' Payment Method on the Storefront Checkout page.</description> - </annotations> - - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <conditionalClick selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('Check / Money order')}}" dependentSelector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('Check / Money order')}}" visible="true" stepKey="selectCheckmoPaymentMethod"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskAfterPaymentMethodSelection"/> - </actionGroup> - - <!-- Check selected shipping address information on shipping information step --> - <actionGroup name="CheckSelectedShippingAddressInCheckoutActionGroup"> - <annotations> - <description>Validates that the provided Customer and Address details are listed on the Storefront Checkout page under the 'Shipping Address' section when multiple Addresses are present for a Customer.</description> - </annotations> - <arguments> - <argument name="customerVar"/> - <argument name="customerAddressVar"/> - </arguments> - - <waitForElement selector="{{CheckoutShippingSection.shippingTab}}" time="30" stepKey="waitForShippingSectionLoaded"/> - <see stepKey="VerifyFirstNameInSelectedAddress" selector="{{CheckoutShippingSection.selectedShippingAddress}}" userInput="{{customerVar.firstname}}"/> - <see stepKey="VerifyLastNameInSelectedAddress" selector="{{CheckoutShippingSection.selectedShippingAddress}}" userInput="{{customerVar.lastname}}"/> - <see stepKey="VerifyStreetInSelectedAddress" selector="{{CheckoutShippingSection.selectedShippingAddress}}" userInput="{{customerAddressVar.street[0]}}"/> - <see stepKey="VerifyCityInSelectedAddress" selector="{{CheckoutShippingSection.selectedShippingAddress}}" userInput="{{customerAddressVar.city}}"/> - <see stepKey="VerifyZipInSelectedAddress" selector="{{CheckoutShippingSection.selectedShippingAddress}}" userInput="{{customerAddressVar.postcode}}"/> - <see stepKey="VerifyPhoneInSelectedAddress" selector="{{CheckoutShippingSection.selectedShippingAddress}}" userInput="{{customerAddressVar.telephone}}"/> - </actionGroup> - - <!-- Check billing address in checkout --> - <actionGroup name="CheckBillingAddressInCheckoutActionGroup"> - <annotations> - <description>Validates that the provided Customer and Address details are present on the Storefront Checkout page under the 'Payment Method' section.</description> - </annotations> - <arguments> - <argument name="customerVar"/> - <argument name="customerAddressVar"/> - </arguments> - - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> - <see userInput="{{customerVar.firstName}}" selector="{{CheckoutPaymentSection.billingAddress}}" stepKey="assertBillingAddressFirstName"/> - <see userInput="{{customerVar.lastName}}" selector="{{CheckoutPaymentSection.billingAddress}}" stepKey="assertBillingAddressLastName"/> - <see userInput="{{customerAddressVar.street[0]}}" selector="{{CheckoutPaymentSection.billingAddress}}" stepKey="assertBillingAddressStreet"/> - <see userInput="{{customerAddressVar.city}}" selector="{{CheckoutPaymentSection.billingAddress}}" stepKey="assertBillingAddressCity"/> - <see userInput="{{customerAddressVar.state}}" selector="{{CheckoutPaymentSection.billingAddress}}" stepKey="assertBillingAddressState"/> - <see userInput="{{customerAddressVar.postcode}}" selector="{{CheckoutPaymentSection.billingAddress}}" stepKey="assertBillingAddressPostcode"/> - <see userInput="{{customerAddressVar.telephone}}" selector="{{CheckoutPaymentSection.billingAddress}}" stepKey="assertBillingAddressTelephone"/> - </actionGroup> - - <!-- Check billing address in checkout with billing address on payment page --> - <actionGroup name="CheckBillingAddressInCheckoutWithBillingAddressOnPaymentPageActionGroup"> - <annotations> - <description>Validates that the provided Customer and Address details appear on the Storefront Checkout page under the 'Billing Address' section.</description> - </annotations> - <arguments> - <argument name="customerVar"/> - <argument name="customerAddressVar"/> - </arguments> - - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> - <see userInput="{{customerVar.firstName}}" selector="{{CheckoutPaymentWithDisplayBillingAddressOnPaymentPageSection.billingAddressDetails}}" stepKey="assertBillingAddressDetailsFirstName"/> - <see userInput="{{customerVar.lastName}}" selector="{{CheckoutPaymentWithDisplayBillingAddressOnPaymentPageSection.billingAddressDetails}}" stepKey="assertBillingAddressDetailsLastName"/> - <see userInput="{{customerAddressVar.street[0]}}" selector="{{CheckoutPaymentWithDisplayBillingAddressOnPaymentPageSection.billingAddressDetails}}" stepKey="assertBillingAddressDetailsStreet"/> - <see userInput="{{customerAddressVar.city}}" selector="{{CheckoutPaymentWithDisplayBillingAddressOnPaymentPageSection.billingAddressDetails}}" stepKey="assertBillingAddressDetailsCity"/> - <see userInput="{{customerAddressVar.state}}" selector="{{CheckoutPaymentWithDisplayBillingAddressOnPaymentPageSection.billingAddressDetails}}" stepKey="assertBillingAddressDetailsState"/> - <see userInput="{{customerAddressVar.postcode}}" selector="{{CheckoutPaymentWithDisplayBillingAddressOnPaymentPageSection.billingAddressDetails}}" stepKey="assertBillingAddressDetailsPostcode"/> - <see userInput="{{customerAddressVar.telephone}}" selector="{{CheckoutPaymentWithDisplayBillingAddressOnPaymentPageSection.billingAddressDetails}}" stepKey="assertBillingAddressDetailsTelephone"/> - </actionGroup> - - <!-- Checkout place order --> - <actionGroup name="CheckoutPlaceOrderActionGroup"> - <annotations> - <description>Clicks on 'Place Order'. Validates that the provided Order ID and Email You messages are present and correct.</description> - </annotations> - <arguments> - <argument name="orderNumberMessage"/> - <argument name="emailYouMessage"/> - </arguments> - - <waitForElementVisible selector="{{CheckoutPaymentSection.placeOrder}}" time="30" stepKey="waitForPlaceOrderButton"/> - <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> - <see selector="{{CheckoutSuccessMainSection.success}}" userInput="{{orderNumberMessage}}" stepKey="seeOrderNumber"/> - <see selector="{{CheckoutSuccessMainSection.success}}" userInput="{{emailYouMessage}}" stepKey="seeEmailYou"/> - </actionGroup> - - <!--Verify country options in checkout top destination section--> - <actionGroup name="VerifyTopDestinationsCountry"> - <annotations> - <description>Validates that the provided Country is listed at the provided Index in 'Country' drop down menu on the Storefront Shopping Cart page under the 'Summary' section.</description> - </annotations> - <arguments> - <argument name="country" type="string"/> - <argument name="placeNumber"/> - </arguments> - - <conditionalClick selector="{{CheckoutCartSummarySection.shippingHeading}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false" stepKey="openShippingDetails"/> - <see selector="{{CheckoutCartSummarySection.countryParameterized('placeNumber')}}" userInput="{{country}}" stepKey="seeCountry"/> - </actionGroup> - - <actionGroup name="StorefrontSignOutActionGroup"> - <annotations> - <description>Clicks on the Customer Account link. Clicks on 'Sign Out'. Validates that the Signed Out message is present and correct.</description> - </annotations> - - <click selector="{{StoreFrontSignOutSection.customerAccount}}" stepKey="clickCustomerButton"/> - <click selector="{{StoreFrontSignOutSection.signOut}}" stepKey="clickToSignOut"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <see userInput="You are signed out" stepKey="signOut"/> - </actionGroup> - - <!--Click Place Order button--> - <actionGroup name="ClickPlaceOrderActionGroup"> - <annotations> - <description>Clicks on the 'Place Order' button. Validates that the Success Message is present and correct.</description> - </annotations> - - <waitForElement selector="{{CheckoutPaymentSection.placeOrder}}" time="30" stepKey="waitForPlaceOrderButton"/> - <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> - <see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutPlaceOrderActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutPlaceOrderActionGroup.xml new file mode 100644 index 0000000000000..48c515a3dd197 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutPlaceOrderActionGroup.xml @@ -0,0 +1,25 @@ +<?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="CheckoutPlaceOrderActionGroup"> + <annotations> + <description>Clicks on 'Place Order'. Validates that the provided Order ID and Email You messages are present and correct.</description> + </annotations> + <arguments> + <argument name="orderNumberMessage"/> + <argument name="emailYouMessage"/> + </arguments> + + <waitForElementVisible selector="{{CheckoutPaymentSection.placeOrder}}" time="30" stepKey="waitForPlaceOrderButton"/> + <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> + <see selector="{{CheckoutSuccessMainSection.success}}" userInput="{{orderNumberMessage}}" stepKey="seeOrderNumber"/> + <see selector="{{CheckoutSuccessMainSection.success}}" userInput="{{emailYouMessage}}" stepKey="seeEmailYou"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutSelectCheckMoneyOrderPaymentActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutSelectCheckMoneyOrderPaymentActionGroup.xml new file mode 100644 index 0000000000000..04e987fd10d98 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutSelectCheckMoneyOrderPaymentActionGroup.xml @@ -0,0 +1,21 @@ +<?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="CheckoutSelectCheckMoneyOrderPaymentActionGroup"> + <annotations> + <description>Selects the 'Check / Money Order' Payment Method on the Storefront Checkout page.</description> + </annotations> + + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <conditionalClick selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('Check / Money order')}}" dependentSelector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('Check / Money order')}}" visible="true" stepKey="selectCheckmoPaymentMethod"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskAfterPaymentMethodSelection"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutSelectFlatRateShippingMethodActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutSelectFlatRateShippingMethodActionGroup.xml new file mode 100644 index 0000000000000..a5dcec3b7cb37 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutSelectFlatRateShippingMethodActionGroup.xml @@ -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"> + <!-- Checkout select Flat Rate shipping method --> + <actionGroup name="CheckoutSelectFlatRateShippingMethodActionGroup"> + <annotations> + <description>Clicks on the 'Flat Rate' Shipping Method on the Storefront Checkout page.</description> + </annotations> + + <conditionalClick selector="{{CheckoutShippingMethodsSection.checkShippingMethodByName('Flat Rate')}}" dependentSelector="{{CheckoutShippingMethodsSection.checkShippingMethodByName('Flat Rate')}}" visible="true" stepKey="selectFlatRateShippingMethod"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskForNextButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/ClickPlaceOrderActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/ClickPlaceOrderActionGroup.xml new file mode 100644 index 0000000000000..079b89a879b77 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/ClickPlaceOrderActionGroup.xml @@ -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="ClickPlaceOrderActionGroup"> + <annotations> + <description>Clicks on the 'Place Order' button. Validates that the Success Message is present and correct.</description> + </annotations> + + <waitForElement selector="{{CheckoutPaymentSection.placeOrder}}" time="30" stepKey="waitForPlaceOrderButton"/> + <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> + <see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/ClickViewAndEditCartFromMiniCartActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/ClickViewAndEditCartFromMiniCartActionGroup.xml new file mode 100644 index 0000000000000..70aa5b49e4b98 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/ClickViewAndEditCartFromMiniCartActionGroup.xml @@ -0,0 +1,23 @@ +<?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="ClickViewAndEditCartFromMiniCartActionGroup"> + <annotations> + <description>Clicks on the Storefront Mini Shopping Cart icon. Clicks on the 'View and Edit Cart' link. Validates that the URL is present and correct. PLEASE NOTE: The URL is Hardcoded.</description> + </annotations> + + <scrollTo selector="{{StorefrontMinicartSection.showCart}}" stepKey="scrollToMiniCart"/> + <conditionalClick selector="{{StorefrontMinicartSection.showCart}}" dependentSelector="{{StorefrontMinicartSection.miniCartOpened}}" visible="false" stepKey="openMiniCart"/> + <waitForElementVisible selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="waitForViewAndEditCartVisible"/> + <click selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="viewAndEditCart"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <seeInCurrentUrl url="checkout/cart" stepKey="seeInCurrentUrl"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/FillGuestCheckoutShippingAddressFormActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/FillGuestCheckoutShippingAddressFormActionGroup.xml index 80fd604e752e9..527afdc26a5f4 100644 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/FillGuestCheckoutShippingAddressFormActionGroup.xml +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/FillGuestCheckoutShippingAddressFormActionGroup.xml @@ -21,7 +21,4 @@ <fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{customerAddress.postcode}}" stepKey="SetCustomerZipCode"/> <fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{customerAddress.telephone}}" stepKey="SetCustomerPhoneNumber"/> </actionGroup> - <actionGroup name="FillGuestCheckoutShippingAddressWithCountryActionGroup" extends="FillGuestCheckoutShippingAddressFormActionGroup"> - <selectOption selector="{{CheckoutShippingSection.country}}" userInput="{{customerAddress.country_id}}" stepKey="selectCustomerCountry" after="SetCustomerCity"/> - </actionGroup> -</actionGroups> \ No newline at end of file +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/FillGuestCheckoutShippingAddressWithCountryActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/FillGuestCheckoutShippingAddressWithCountryActionGroup.xml new file mode 100644 index 0000000000000..c5685f4a3a31f --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/FillGuestCheckoutShippingAddressWithCountryActionGroup.xml @@ -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="FillGuestCheckoutShippingAddressWithCountryActionGroup" extends="FillGuestCheckoutShippingAddressFormActionGroup"> + <selectOption selector="{{CheckoutShippingSection.country}}" userInput="{{customerAddress.country_id}}" stepKey="selectCustomerCountry" after="SetCustomerCity"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GoToCheckoutFromCartActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GoToCheckoutFromCartActionGroup.xml new file mode 100644 index 0000000000000..66db3895483c7 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GoToCheckoutFromCartActionGroup.xml @@ -0,0 +1,22 @@ +<?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="GoToCheckoutFromCartActionGroup"> + <annotations> + <description>Clicks on the 'View and Edit Cart' link in the Storefront Mini Shopping Cart. Validates that the Storefront Shopping Cart URL is present and correct. Clicks on 'Proceed to Checkout'.</description> + </annotations> + + <waitForElementNotVisible selector="{{StorefrontMinicartSection.emptyCart}}" stepKey="waitUpdateQuantity"/> + <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickCart"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> + <seeInCurrentUrl url="{{CheckoutCartPage.url}}" stepKey="assertCheckoutCartUrl"/> + <click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="goToCheckout"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GoToCheckoutFromMinicartActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GoToCheckoutFromMinicartActionGroup.xml new file mode 100644 index 0000000000000..d6bc6b6a0acb0 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GoToCheckoutFromMinicartActionGroup.xml @@ -0,0 +1,21 @@ +<?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="GoToCheckoutFromMinicartActionGroup"> + <annotations> + <description>Clicks on the Storefront Mini Shopping Cart icon. Clicks on 'Proceed to Checkout'.</description> + </annotations> + + <waitForElementNotVisible selector="{{StorefrontMinicartSection.emptyCart}}" stepKey="waitUpdateQuantity"/> + <wait time="5" stepKey="waitMinicartRendering"/> + <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickCart"/> + <click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="goToCheckout"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillNewBillingAddressActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillNewBillingAddressActionGroup.xml index 77734cc75497f..22f9f100ed08f 100644 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillNewBillingAddressActionGroup.xml +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillNewBillingAddressActionGroup.xml @@ -28,74 +28,4 @@ <fillField selector="{{CheckoutPaymentSection.guestPostcode}}" userInput="{{customerAddressVar.postcode}}" stepKey="enterPostcode"/> <fillField selector="{{CheckoutPaymentSection.guestTelephone}}" userInput="{{customerAddressVar.telephone}}" stepKey="enterTelephone"/> </actionGroup> - <actionGroup name="StorefrontCheckoutFillNewBillingAddressActionGroup" extends="GuestCheckoutFillNewBillingAddressActionGroup"> - <remove keyForRemoval="enterEmail"/> - <remove keyForRemoval="waitForLoading3"/> - </actionGroup> - - <actionGroup name="LoggedInCheckoutFillNewBillingAddressActionGroup"> - <annotations> - <description>Fills in the provided Address details on the Storefront Checkout Address sections based on the provided Class Prefix (i.e. '._show', '[aria-hidden=false]').</description> - </annotations> - <arguments> - <argument name="Address"/> - <!-- the classPrefix argument is to specifically select the inputs of the correct form - this is to prevent having 3 action groups doing essentially the same thing --> - <argument name="classPrefix" type="string" defaultValue=""/> - </arguments> - - <fillField stepKey="fillFirstName" selector="{{classPrefix}} {{CheckoutShippingSection.firstName}}" userInput="{{Address.firstname}}"/> - <fillField stepKey="fillLastName" selector="{{classPrefix}} {{CheckoutShippingSection.lastName}}" userInput="{{Address.lastname}}"/> - <fillField stepKey="fillCompany" selector="{{classPrefix}} {{CheckoutShippingSection.company}}" userInput="{{Address.company}}"/> - <fillField stepKey="fillPhoneNumber" selector="{{classPrefix}} {{CheckoutShippingSection.telephone}}" userInput="{{Address.telephone}}"/> - <fillField stepKey="fillStreetAddress1" selector="{{classPrefix}} {{CheckoutShippingSection.street}}" userInput="{{Address.street[0]}}"/> - <fillField stepKey="fillStreetAddress2" selector="{{classPrefix}} {{CheckoutShippingSection.street2}}" userInput="{{Address.street[1]}}"/> - <fillField stepKey="fillCityName" selector="{{classPrefix}} {{CheckoutShippingSection.city}}" userInput="{{Address.city}}"/> - <selectOption stepKey="selectState" selector="{{classPrefix}} {{CheckoutShippingSection.region}}" userInput="{{Address.state}}"/> - <fillField stepKey="fillZip" selector="{{classPrefix}} {{CheckoutShippingSection.postcode}}" userInput="{{Address.postcode}}"/> - <selectOption stepKey="selectCounty" selector="{{classPrefix}} {{CheckoutShippingSection.country}}" userInput="{{Address.country_id}}"/> - <waitForPageLoad stepKey="waitForFormUpdate2"/> - </actionGroup> - - <!--Filling address without second address field and without state field--> - <actionGroup name="LoggedInCheckoutWithOneAddressFieldWithoutStateField" extends="LoggedInCheckoutFillNewBillingAddressActionGroup"> - <annotations> - <description>EXTENDS: LoggedInCheckoutFillNewBillingAddressActionGroup. Removes 'fillStreetAddress2' and 'selectState'.</description> - </annotations> - - <remove keyForRemoval="fillStreetAddress2"/> - <remove keyForRemoval="selectState"/> - </actionGroup> - - <actionGroup name="clearCheckoutAddressPopupFieldsActionGroup"> - <annotations> - <description>Clears the fields for the Customer/Address fields on the Storefront Checkout Address sections based on the provided Class Prefix (i.e. '._show', '[aria-hidden=false]').</description> - </annotations> - <arguments> - <argument name="classPrefix" type="string" defaultValue=""/> - </arguments> - - <clearField selector="{{classPrefix}} {{CheckoutShippingSection.firstName}}" stepKey="clearFieldFirstName"/> - <clearField selector="{{classPrefix}} {{CheckoutShippingSection.lastName}}" stepKey="clearFieldLastName"/> - <clearField selector="{{classPrefix}} {{CheckoutShippingSection.company}}" stepKey="clearFieldCompany"/> - <clearField selector="{{classPrefix}} {{CheckoutShippingSection.street}}" stepKey="clearFieldStreetAddress1"/> - <clearField selector="{{classPrefix}} {{CheckoutShippingSection.street2}}" stepKey="clearFieldStreetAddress2"/> - <clearField selector="{{classPrefix}} {{CheckoutShippingSection.city}}" stepKey="clearFieldCityName"/> - <selectOption selector="{{classPrefix}} {{CheckoutShippingSection.region}}" userInput="" stepKey="clearFieldRegion"/> - <clearField selector="{{classPrefix}} {{CheckoutShippingSection.postcode}}" stepKey="clearFieldZip"/> - <selectOption selector="{{classPrefix}} {{CheckoutShippingSection.country}}" userInput="" stepKey="clearFieldCounty"/> - <clearField selector="{{classPrefix}} {{CheckoutShippingSection.telephone}}" stepKey="clearFieldPhoneNumber"/> - </actionGroup> - - <actionGroup name="GuestCheckoutSelectPaymentAndFillNewBillingAddressActionGroup" extends="GuestCheckoutFillNewBillingAddressActionGroup"> - <annotations> - <description>EXTENDS: GuestCheckoutFillNewBillingAddressActionGroup. Clicks on the provided Payment Method on the Storefront Checkout page.</description> - </annotations> - <arguments> - <argument name="paymentMethod" type="string"/> - </arguments> - - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" after="waitForLoading3" stepKey="waitForPaymentSectionLoaded"/> - <conditionalClick selector="{{CheckoutPaymentSection.paymentMethodByName(paymentMethod)}}" dependentSelector="{{CheckoutPaymentSection.billingAddress}}" visible="false" before="enterFirstName" stepKey="clickCheckMoneyOrderPayment"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillShippingNoWaitForPaymentActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillShippingNoWaitForPaymentActionGroup.xml new file mode 100644 index 0000000000000..ca9b7adf6c387 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillShippingNoWaitForPaymentActionGroup.xml @@ -0,0 +1,19 @@ +<?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="GuestCheckoutFillShippingNoWaitForPaymentActionGroup" extends="GuestCheckoutFillingShippingSectionActionGroup"> + <annotations> + <description>EXTENDS: GuestCheckoutFillingShippingSectionActionGroup. Removed 'waitForPaymentSectionLoaded' and 'assertCheckoutPaymentUrl'.</description> + </annotations> + + <remove keyForRemoval="waitForPaymentSectionLoaded"/> + <remove keyForRemoval="assertCheckoutPaymentUrl"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillingShippingSectionActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillingShippingSectionActionGroup.xml new file mode 100644 index 0000000000000..f020cb42725c8 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillingShippingSectionActionGroup.xml @@ -0,0 +1,38 @@ +<?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="GuestCheckoutFillingShippingSectionActionGroup"> + <annotations> + <description>Fills in the provided Customer/Address (Including Region) details on the Storefront Checkout page under the 'Shipping Address' section. Selects the provided Shipping Method. Clicks on Next. Validates that the URL is present and correct.</description> + </annotations> + <arguments> + <argument name="customerVar" defaultValue="CustomerEntityOne"/> + <argument name="customerAddressVar" defaultValue="CustomerAddressSimple"/> + <!--First available shipping method will be selected if value is not passed for shippingMethod--> + <argument name="shippingMethod" defaultValue="" type="string"/> + </arguments> + + <fillField selector="{{CheckoutShippingSection.email}}" userInput="{{customerVar.email}}" stepKey="enterEmail"/> + <fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{customerVar.firstname}}" stepKey="enterFirstName"/> + <fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{customerVar.lastname}}" stepKey="enterLastName"/> + <fillField selector="{{CheckoutShippingSection.street}}" userInput="{{customerAddressVar.street[0]}}" stepKey="enterStreet"/> + <fillField selector="{{CheckoutShippingSection.city}}" userInput="{{customerAddressVar.city}}" stepKey="enterCity"/> + <selectOption selector="{{CheckoutShippingSection.region}}" userInput="{{customerAddressVar.state}}" stepKey="selectRegion"/> + <fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{customerAddressVar.postcode}}" stepKey="enterPostcode"/> + <fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{customerAddressVar.telephone}}" stepKey="enterTelephone"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> + <waitForElement selector="{{CheckoutShippingMethodsSection.checkShippingMethodByName('shippingMethod')}}" stepKey="waitForShippingMethod"/> + <click selector="{{CheckoutShippingMethodsSection.checkShippingMethodByName('shippingMethod')}}" stepKey="selectShippingMethod"/> + <waitForElement selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/> + <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/> + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> + <seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillingShippingSectionUnavailablePaymentActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillingShippingSectionUnavailablePaymentActionGroup.xml new file mode 100644 index 0000000000000..9ce14338f1223 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillingShippingSectionUnavailablePaymentActionGroup.xml @@ -0,0 +1,36 @@ +<?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="GuestCheckoutFillingShippingSectionUnavailablePaymentActionGroup"> + <annotations> + <description>Fills in the provided Customer/Address (Including Region) details on the Storefront Checkout page under the 'Shipping Address' section. Selects the 1st Shipping Method. Clicks on Next. Validates that the Payment Error Message and URL are present and correct.</description> + </annotations> + <arguments> + <argument name="customerVar"/> + <argument name="customerAddressVar"/> + </arguments> + + <fillField selector="{{CheckoutShippingSection.email}}" userInput="{{customerVar.email}}" stepKey="enterEmail"/> + <fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{customerVar.firstname}}" stepKey="enterFirstName"/> + <fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{customerVar.lastname}}" stepKey="enterLastName"/> + <fillField selector="{{CheckoutShippingSection.street}}" userInput="{{customerAddressVar.street[0]}}" stepKey="enterStreet"/> + <fillField selector="{{CheckoutShippingSection.city}}" userInput="{{customerAddressVar.city}}" stepKey="enterCity"/> + <selectOption selector="{{CheckoutShippingSection.region}}" userInput="{{customerAddressVar.state}}" stepKey="selectRegion"/> + <fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{customerAddressVar.postcode}}" stepKey="enterPostcode"/> + <fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{customerAddressVar.telephone}}" stepKey="enterTelephone"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> + <click selector="{{CheckoutShippingSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod"/> + <waitForElement selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/> + <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/> + <seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.noQuotes}}" stepKey="waitMessage"/> + <see userInput="No Payment method available." stepKey="checkMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillingShippingSectionWithoutRegionActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillingShippingSectionWithoutRegionActionGroup.xml new file mode 100644 index 0000000000000..3db019c44dd0d --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillingShippingSectionWithoutRegionActionGroup.xml @@ -0,0 +1,35 @@ +<?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="GuestCheckoutFillingShippingSectionWithoutRegionActionGroup"> + <annotations> + <description>Fills in the provided Customer/Address (Excluding Region) details on the Storefront Checkout page under the 'Shipping Address' section. Selects the provided Shipping Method. Clicks on Next. Validates that the URL is present and correct.</description> + </annotations> + <arguments> + <argument name="customerVar"/> + <argument name="customerAddressVar"/> + </arguments> + + <fillField selector="{{CheckoutShippingSection.email}}" userInput="{{customerVar.email}}" stepKey="enterEmail"/> + <fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{customerVar.firstname}}" stepKey="enterFirstName"/> + <fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{customerVar.lastname}}" stepKey="enterLastName"/> + <fillField selector="{{CheckoutShippingSection.street}}" userInput="{{customerAddressVar.street[0]}}" stepKey="enterStreet"/> + <fillField selector="{{CheckoutShippingSection.city}}" userInput="{{customerAddressVar.city}}" stepKey="enterCity"/> + <fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{customerAddressVar.postcode}}" stepKey="enterPostcode"/> + <selectOption selector="{{CheckoutShippingSection.country}}" userInput="{{customerAddressVar.country_id}}" stepKey="enterCountry"/> + <fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{customerAddressVar.telephone}}" stepKey="enterTelephone"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> + <click selector="{{CheckoutShippingSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod"/> + <waitForElement selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/> + <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/> + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> + <seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutSelectPaymentAndFillNewBillingAddressActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutSelectPaymentAndFillNewBillingAddressActionGroup.xml new file mode 100644 index 0000000000000..73de73a2d1ed6 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutSelectPaymentAndFillNewBillingAddressActionGroup.xml @@ -0,0 +1,22 @@ +<?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="GuestCheckoutSelectPaymentAndFillNewBillingAddressActionGroup" extends="GuestCheckoutFillNewBillingAddressActionGroup"> + <annotations> + <description>EXTENDS: GuestCheckoutFillNewBillingAddressActionGroup. Clicks on the provided Payment Method on the Storefront Checkout page.</description> + </annotations> + <arguments> + <argument name="paymentMethod" type="string"/> + </arguments> + + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" after="waitForLoading3" stepKey="waitForPaymentSectionLoaded"/> + <conditionalClick selector="{{CheckoutPaymentSection.paymentMethodByName(paymentMethod)}}" dependentSelector="{{CheckoutPaymentSection.billingAddress}}" visible="false" before="enterFirstName" stepKey="clickCheckMoneyOrderPayment"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutWithSpecificCountryOptionForPaymentMethodActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutWithSpecificCountryOptionForPaymentMethodActionGroup.xml new file mode 100644 index 0000000000000..afa09150cfccd --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutWithSpecificCountryOptionForPaymentMethodActionGroup.xml @@ -0,0 +1,22 @@ +<?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="GuestCheckoutWithSpecificCountryOptionForPaymentMethodActionGroup" extends="GuestCheckoutFillingShippingSectionUnavailablePaymentActionGroup"> + <annotations> + <description>EXTENDS: GuestCheckoutFillingShippingSectionUnavailablePaymentActionGroup. Removes 'checkMessage'. Validates that the provided Payment Method Name is NOT present on the Storefront Checkout page.</description> + </annotations> + <arguments> + <argument name="paymentMethod" type="string"/> + </arguments> + + <remove keyForRemoval="checkMessage"/> + <dontSee selector="{{CheckoutPaymentSection.paymentMethodByName(paymentMethod)}}" stepKey="paymentMethodDoesNotAvailable"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/LoggedInCheckoutFillNewBillingAddressActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/LoggedInCheckoutFillNewBillingAddressActionGroup.xml new file mode 100644 index 0000000000000..29a71ac938ef6 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/LoggedInCheckoutFillNewBillingAddressActionGroup.xml @@ -0,0 +1,34 @@ +<?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="LoggedInCheckoutFillNewBillingAddressActionGroup"> + <annotations> + <description>Fills in the provided Address details on the Storefront Checkout Address sections based on the provided Class Prefix (i.e. '._show', '[aria-hidden=false]').</description> + </annotations> + <arguments> + <argument name="Address"/> + <!-- the classPrefix argument is to specifically select the inputs of the correct form + this is to prevent having 3 action groups doing essentially the same thing --> + <argument name="classPrefix" type="string" defaultValue=""/> + </arguments> + + <fillField stepKey="fillFirstName" selector="{{classPrefix}} {{CheckoutShippingSection.firstName}}" userInput="{{Address.firstname}}"/> + <fillField stepKey="fillLastName" selector="{{classPrefix}} {{CheckoutShippingSection.lastName}}" userInput="{{Address.lastname}}"/> + <fillField stepKey="fillCompany" selector="{{classPrefix}} {{CheckoutShippingSection.company}}" userInput="{{Address.company}}"/> + <fillField stepKey="fillPhoneNumber" selector="{{classPrefix}} {{CheckoutShippingSection.telephone}}" userInput="{{Address.telephone}}"/> + <fillField stepKey="fillStreetAddress1" selector="{{classPrefix}} {{CheckoutShippingSection.street}}" userInput="{{Address.street[0]}}"/> + <fillField stepKey="fillStreetAddress2" selector="{{classPrefix}} {{CheckoutShippingSection.street2}}" userInput="{{Address.street[1]}}"/> + <fillField stepKey="fillCityName" selector="{{classPrefix}} {{CheckoutShippingSection.city}}" userInput="{{Address.city}}"/> + <selectOption stepKey="selectState" selector="{{classPrefix}} {{CheckoutShippingSection.region}}" userInput="{{Address.state}}"/> + <fillField stepKey="fillZip" selector="{{classPrefix}} {{CheckoutShippingSection.postcode}}" userInput="{{Address.postcode}}"/> + <selectOption stepKey="selectCounty" selector="{{classPrefix}} {{CheckoutShippingSection.country}}" userInput="{{Address.country_id}}"/> + <waitForPageLoad stepKey="waitForFormUpdate2"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/LoggedInCheckoutWithOneAddressFieldWithoutStateFieldActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/LoggedInCheckoutWithOneAddressFieldWithoutStateFieldActionGroup.xml new file mode 100644 index 0000000000000..208dfc37cec74 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/LoggedInCheckoutWithOneAddressFieldWithoutStateFieldActionGroup.xml @@ -0,0 +1,19 @@ +<?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="LoggedInCheckoutWithOneAddressFieldWithoutStateFieldActionGroup" extends="LoggedInCheckoutFillNewBillingAddressActionGroup"> + <annotations> + <description>EXTENDS: LoggedInCheckoutFillNewBillingAddressActionGroup. Removes 'fillStreetAddress2' and 'selectState'.</description> + </annotations> + + <remove keyForRemoval="fillStreetAddress2"/> + <remove keyForRemoval="selectState"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/LoggedInUserCheckoutAddNewShippingSectionWithoutRegionActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/LoggedInUserCheckoutAddNewShippingSectionWithoutRegionActionGroup.xml new file mode 100644 index 0000000000000..0c4cea142b4e6 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/LoggedInUserCheckoutAddNewShippingSectionWithoutRegionActionGroup.xml @@ -0,0 +1,35 @@ +<?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="LoggedInUserCheckoutAddNewShippingSectionWithoutRegionActionGroup"> + <annotations> + <description>Fills in the provided Customer/Address (Excluding Region) details on the Storefront Checkout page under the 'Shipping Address' section. Selects the 1st Shipping Method. Clicks on Next. Validates that the Payment Error Message and URL are present and correct.</description> + </annotations> + <arguments> + <argument name="customerVar"/> + <argument name="customerAddressVar"/> + </arguments> + + <fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{customerVar.firstname}}" stepKey="enterFirstName"/> + <fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{customerVar.lastname}}" stepKey="enterLastName"/> + <fillField selector="{{CheckoutShippingSection.street}}" userInput="{{customerAddressVar.street[0]}}" stepKey="enterStreet"/> + <fillField selector="{{CheckoutShippingSection.city}}" userInput="{{customerAddressVar.city}}" stepKey="enterCity"/> + <fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{customerAddressVar.postcode}}" stepKey="enterPostcode"/> + <selectOption selector="{{CheckoutShippingSection.country}}" userInput="{{customerAddressVar.country_id}}" stepKey="enterCountry"/> + <fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{customerAddressVar.telephone}}" stepKey="enterTelephone"/> + <click selector="{{CheckoutShippingSection.saveAddress}}" stepKey="clickSaveAddress"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> + <click selector="{{CheckoutShippingSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod"/> + <waitForElement selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/> + <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/> + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> + <seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/LoggedInUserCheckoutFillingShippingSectionActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/LoggedInUserCheckoutFillingShippingSectionActionGroup.xml new file mode 100644 index 0000000000000..60188224871eb --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/LoggedInUserCheckoutFillingShippingSectionActionGroup.xml @@ -0,0 +1,34 @@ +<?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="LoggedInUserCheckoutFillingShippingSectionActionGroup"> + <annotations> + <description>Fills in the provided Customer/Address (Including Region) details on the Storefront Checkout page under the 'Shipping Address' section. Selects the 1st Shipping Method. Clicks on Next. Validates that the Payment Error Message and URL are present and correct.</description> + </annotations> + <arguments> + <argument name="customerVar" defaultValue="CustomerEntityOne"/> + <argument name="customerAddressVar" defaultValue="CustomerAddressSimple"/> + </arguments> + + <fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{customerVar.firstname}}" stepKey="enterFirstName"/> + <fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{customerVar.lastname}}" stepKey="enterLastName"/> + <fillField selector="{{CheckoutShippingSection.street}}" userInput="{{customerAddressVar.street[0]}}" stepKey="enterStreet"/> + <fillField selector="{{CheckoutShippingSection.city}}" userInput="{{customerAddressVar.city}}" stepKey="enterCity"/> + <selectOption selector="{{CheckoutShippingSection.region}}" userInput="{{customerAddressVar.state}}" stepKey="selectRegion"/> + <fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{customerAddressVar.postcode}}" stepKey="enterPostcode"/> + <fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{customerAddressVar.telephone}}" stepKey="enterTelephone"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> + <click selector="{{CheckoutShippingSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod"/> + <waitForElement selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/> + <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/> + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> + <seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/PlaceOrderWithLoggedUserActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/PlaceOrderWithLoggedUserActionGroup.xml new file mode 100644 index 0000000000000..2bd1ee0f7d809 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/PlaceOrderWithLoggedUserActionGroup.xml @@ -0,0 +1,31 @@ +<?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="PlaceOrderWithLoggedUserActionGroup"> + <annotations> + <description>Clicks on 'Proceed to Checkout' on the Storefront Shopping Cart page. Selects the provided Shipping Method. Clicks on Next. Clicks on Place Order. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <!--First available shipping method will be selected if value is not passed for shippingMethod--> + <argument name="shippingMethod" defaultValue="" type="string"/> + </arguments> + + <waitForElementVisible selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="waitProceedToCheckout"/> + <click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="clickProceedToCheckout"/> + <click selector="{{CheckoutShippingMethodsSection.checkShippingMethodByName('shippingMethod')}}" stepKey="selectShippingMethod"/> + <waitForElement selector="{{CheckoutShippingSection.next}}" stepKey="waitForNextButton"/> + <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/> + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/> + <seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="waitForPlaceOrderButton"/> + <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> + <see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/RemoveProductFromMiniCartActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/RemoveProductFromMiniCartActionGroup.xml new file mode 100644 index 0000000000000..e6626ec357d0e --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/RemoveProductFromMiniCartActionGroup.xml @@ -0,0 +1,27 @@ +<?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="RemoveProductFromMiniCartActionGroup"> + <annotations> + <description>Removed the provided Product from the Storefront Mini Shopping Cart.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + </arguments> + + <conditionalClick selector="{{StorefrontMinicartSection.showCart}}" dependentSelector="{{StorefrontMinicartSection.miniCartOpened}}" visible="false" stepKey="openMiniCart"/> + <waitForElementVisible selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="waitForMiniCartOpen"/> + <click selector="{{StorefrontMinicartSection.deleteMiniCartItemByName(productName)}}" stepKey="clickDelete"/> + <waitForElementVisible selector="{{StoreFrontRemoveItemModalSection.message}}" stepKey="waitForConfirmationModal"/> + <see selector="{{StoreFrontRemoveItemModalSection.message}}" userInput="Are you sure you would like to remove this item from the shopping cart?" stepKey="seeDeleteConfirmationMessage"/> + <click selector="{{StoreFrontRemoveItemModalSection.ok}}" stepKey="confirmDelete"/> + <waitForPageLoad stepKey="waitForDeleteToFinish"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddCategoryProductToCartActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddCategoryProductToCartActionGroup.xml new file mode 100644 index 0000000000000..7fbcb96c20d9e --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddCategoryProductToCartActionGroup.xml @@ -0,0 +1,28 @@ +<?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"> + <!-- Add Product to Cart from the category page and check message and product count in Minicart --> + <actionGroup name="StorefrontAddCategoryProductToCartActionGroup"> + <annotations> + <description>Adds the provided Product to the Cart from a Storefront Category page. Validates that the Success Message is present and correct. Validates that the Mini Shopping Cart contains the provided Product Count.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="productCount"/> + </arguments> + + <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct"/> + <click selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="clickAddToCart"/> + <waitForElementVisible selector="{{StorefrontCategoryMainSection.SuccessMsg}}" stepKey="waitForSuccessMessage"/> + <see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="You added {{product.name}} to your shopping cart." stepKey="assertSuccessMessage"/> + <seeLink stepKey="assertLinkToShoppingCart" url="{{_ENV.MAGENTO_BASE_URL}}checkout/cart/" userInput="shopping cart"/> + <waitForText userInput="{{productCount}}" selector="{{StorefrontMinicartSection.productCount}}" time="30" stepKey="assertProductCount"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddCategoryProductToCartWithQuantityActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddCategoryProductToCartWithQuantityActionGroup.xml new file mode 100644 index 0000000000000..c4fe115b70ae4 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddCategoryProductToCartWithQuantityActionGroup.xml @@ -0,0 +1,32 @@ +<?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="StorefrontAddCategoryProductToCartWithQuantityActionGroup"> + <annotations> + <description>Adds the provided Product to the Cart from a Storefront Category page. Validates that the Success Message is present and correct. Updates the Product Quantity using the provided Product Quantity. Validates that the provided Quantity is present and correct in the Mini Shopping Cart.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="quantity" defaultValue="1" type="string"/> + <argument name="checkQuantity" defaultValue="1" type="string"/> + </arguments> + + <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct"/> + <click selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="clickAddToCart"/> + <waitForElementVisible selector="{{StorefrontCategoryMainSection.SuccessMsg}}" stepKey="waitForSuccessMessage"/> + <see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="You added {{product.name}} to your shopping cart." stepKey="assertSuccessMessage"/> + <seeLink stepKey="assertLinkToShoppingCart" url="{{_ENV.MAGENTO_BASE_URL}}checkout/cart/" userInput="shopping cart"/> + <waitForText userInput="{{checkQuantity}}" selector="{{StorefrontMinicartSection.productCount}}" time="30" stepKey="assertProductCount"/> + <conditionalClick selector="{{StorefrontMinicartSection.showCart}}" dependentSelector="{{StorefrontMinicartSection.miniCartOpened}}" visible="false" stepKey="openMiniCart"/> + <waitForElementVisible selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="waitForViewAndEditCartVisible"/> + <fillField selector="{{StorefrontMinicartSection.itemQuantity(product.name)}}" userInput="{{quantity}}" stepKey="setProductQtyToFiftyInMiniCart"/> + <click selector="{{StorefrontMinicartSection.itemQuantityUpdate(product.name)}}" stepKey="updateQtyInMiniCart"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddProductToCartActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddProductToCartActionGroup.xml new file mode 100644 index 0000000000000..8c1ef9d973297 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddProductToCartActionGroup.xml @@ -0,0 +1,26 @@ +<?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="StorefrontAddProductToCartActionGroup"> + <annotations> + <description>Clicks on Add to Cart on a Storefront Product page. Validates that the Success Message is present and correct. Validates that the provided Product Count is present and correct in the Mini Shopping Cart.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="productCount" type="string"/> + </arguments> + + <click selector="{{StorefrontProductInfoMainSection.AddToCart}}" stepKey="clickAddToCart"/> + <waitForElementVisible selector="{{StorefrontCategoryMainSection.SuccessMsg}}" stepKey="waitForSuccessMessage"/> + <see selector="{{StorefrontProductPageSection.messagesBlock}}" userInput="You added {{product.name}} to your shopping cart." stepKey="assertSuccessMessage"/> + <seeLink stepKey="assertLinkToShoppingCart" url="{{_ENV.MAGENTO_BASE_URL}}checkout/cart/" userInput="shopping cart"/> + <waitForText userInput="{{productCount}}" selector="{{StorefrontMinicartSection.productCount}}" time="30" stepKey="assertProductCount"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckCartActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckCartActionGroup.xml new file mode 100644 index 0000000000000..bbad2579a47d2 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckCartActionGroup.xml @@ -0,0 +1,35 @@ +<?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="StorefrontCheckCartActionGroup"> + <annotations> + <description>Goes to the Storefront Shopping Cart page. Validates that the provided Subtotal, Shipping, Shipping Method and Total are present and correct.</description> + </annotations> + <arguments> + <argument name="subtotal" type="string"/> + <argument name="shipping" type="string"/> + <argument name="shippingMethod" type="string" defaultValue="Flat Rate - Fixed"/> + <argument name="total" type="string"/> + </arguments> + + <seeInCurrentUrl url="{{CheckoutCartPage.url}}" stepKey="assertUrl"/> + <waitForPageLoad stepKey="waitForCartPage"/> + <conditionalClick selector="{{CheckoutCartSummarySection.shippingHeading}}" dependentSelector="{{CheckoutCartSummarySection.shippingMethodForm}}" visible="false" stepKey="openEstimateShippingSection"/> + <waitForElementVisible selector="{{CheckoutCartSummarySection.flatRateShippingMethod}}" stepKey="waitForShippingSection"/> + <checkOption selector="{{CheckoutCartSummarySection.flatRateShippingMethod}}" stepKey="selectShippingMethod"/> + <scrollTo selector="{{CheckoutCartSummarySection.subtotal}}" stepKey="scrollToSummary"/> + <see userInput="{{subtotal}}" selector="{{CheckoutCartSummarySection.subtotal}}" stepKey="assertSubtotal"/> + <see userInput="({{shippingMethod}})" selector="{{CheckoutCartSummarySection.shippingMethod}}" stepKey="assertShippingMethod"/> + <reloadPage stepKey="reloadPage" after="assertShippingMethod" /> + <waitForPageLoad stepKey="WaitForPageLoaded" after="reloadPage" /> + <waitForText userInput="{{shipping}}" selector="{{CheckoutCartSummarySection.shipping}}" time="45" stepKey="assertShipping" after="WaitForPageLoaded"/> + <see userInput="{{total}}" selector="{{CheckoutCartSummarySection.total}}" stepKey="assertTotal" after="assertShipping"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckCartSimpleProductActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckCartSimpleProductActionGroup.xml new file mode 100644 index 0000000000000..083963f4cc487 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckCartSimpleProductActionGroup.xml @@ -0,0 +1,24 @@ +<?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="StorefrontCheckCartSimpleProductActionGroup"> + <annotations> + <description>Validates that the provided Product details (Name and Price) are present and correct in the Mini Shopping Cart. Validates that the provided Product Quantity is present and correct in the Mini Shopping Cart.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="productQuantity"/> + </arguments> + + <seeElement selector="{{CheckoutCartProductSection.ProductLinkByName(product.name)}}" stepKey="assertProductName"/> + <see userInput="${{product.price}}.00" selector="{{CheckoutCartProductSection.ProductPriceByName(product.name)}}" stepKey="assertProductPrice"/> + <seeInField userInput="{{productQuantity}}" selector="{{CheckoutCartProductSection.ProductQuantityByName(product.name)}}" stepKey="assertProductQuantity"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckCartTotalWithDiscountCategoryActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckCartTotalWithDiscountCategoryActionGroup.xml new file mode 100644 index 0000000000000..c5d2d054f2e8f --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckCartTotalWithDiscountCategoryActionGroup.xml @@ -0,0 +1,21 @@ +<?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="StorefrontCheckCartTotalWithDiscountCategoryActionGroup" extends="StorefrontCheckCartActionGroup"> + <annotations> + <description>EXTENDS: StorefrontCheckCartActionGroup. Validates that the provided Discount is present in the Storefront Shopping Cart.</description> + </annotations> + <arguments> + <argument name="discount" type="string" defaultValue="0"/> + </arguments> + <waitForElementVisible selector="{{CheckoutCartSummarySection.discountAmount}}" stepKey="waitForDiscount"/> + <see selector="{{CheckoutCartSummarySection.discountAmount}}" userInput="-${{discount}}" stepKey="assertDiscount"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckoutFillNewBillingAddressActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckoutFillNewBillingAddressActionGroup.xml new file mode 100644 index 0000000000000..e8949a1864663 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckoutFillNewBillingAddressActionGroup.xml @@ -0,0 +1,15 @@ +<?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="StorefrontCheckoutFillNewBillingAddressActionGroup" extends="GuestCheckoutFillNewBillingAddressActionGroup"> + <remove keyForRemoval="enterEmail"/> + <remove keyForRemoval="waitForLoading3"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckoutForwardFromShippingStepActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckoutForwardFromShippingStepActionGroup.xml new file mode 100644 index 0000000000000..524e3f784ed3f --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckoutForwardFromShippingStepActionGroup.xml @@ -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="StorefrontCheckoutForwardFromShippingStepActionGroup"> + <annotations> + <description>Clicks next on Checkout Shipping step</description> + </annotations> + <waitForElementVisible selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/> + <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontMiniCartActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontMiniCartActionGroup.xml deleted file mode 100644 index 6dc5cfd044924..0000000000000 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontMiniCartActionGroup.xml +++ /dev/null @@ -1,65 +0,0 @@ -<?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="clickViewAndEditCartFromMiniCart"> - <annotations> - <description>Clicks on the Storefront Mini Shopping Cart icon. Clicks on the 'View and Edit Cart' link. Validates that the URL is present and correct. PLEASE NOTE: The URL is Hardcoded.</description> - </annotations> - - <scrollTo selector="{{StorefrontMinicartSection.showCart}}" stepKey="scrollToMiniCart"/> - <conditionalClick selector="{{StorefrontMinicartSection.showCart}}" dependentSelector="{{StorefrontMinicartSection.miniCartOpened}}" visible="false" stepKey="openMiniCart"/> - <waitForElementVisible selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="waitForViewAndEditCartVisible"/> - <click selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="viewAndEditCart"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> - <seeInCurrentUrl url="checkout/cart" stepKey="seeInCurrentUrl"/> - </actionGroup> - - <actionGroup name="assertOneProductNameInMiniCart"> - <annotations> - <description>Validates that the provided Product Name is present in the Storefront Mini Shopping Cart.</description> - </annotations> - <arguments> - <argument name="productName"/> - </arguments> - - <conditionalClick selector="{{StorefrontMinicartSection.showCart}}" dependentSelector="{{StorefrontMinicartSection.miniCartOpened}}" visible="false" stepKey="openMiniCart"/> - <waitForElementVisible selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="waitForViewAndEditCartVisible"/> - <see selector="{{StorefrontMinicartSection.miniCartItemsText}}" userInput="{{productName}}" stepKey="seeInMiniCart"/> - </actionGroup> - - <!--Remove an item from the cart using minicart--> - <actionGroup name="removeProductFromMiniCart"> - <annotations> - <description>Removed the provided Product from the Storefront Mini Shopping Cart.</description> - </annotations> - <arguments> - <argument name="productName" type="string"/> - </arguments> - - <conditionalClick selector="{{StorefrontMinicartSection.showCart}}" dependentSelector="{{StorefrontMinicartSection.miniCartOpened}}" visible="false" stepKey="openMiniCart"/> - <waitForElementVisible selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="waitForMiniCartOpen"/> - <click selector="{{StorefrontMinicartSection.deleteMiniCartItemByName(productName)}}" stepKey="clickDelete"/> - <waitForElementVisible selector="{{StoreFrontRemoveItemModalSection.message}}" stepKey="waitForConfirmationModal"/> - <see selector="{{StoreFrontRemoveItemModalSection.message}}" userInput="Are you sure you would like to remove this item from the shopping cart?" stepKey="seeDeleteConfirmationMessage"/> - <click selector="{{StoreFrontRemoveItemModalSection.ok}}" stepKey="confirmDelete"/> - <waitForPageLoad stepKey="waitForDeleteToFinish"/> - </actionGroup> - - <!--Check that the minicart is empty--> - <actionGroup name="assertMiniCartEmpty"> - <annotations> - <description>Validates that the provided Product Count appears in the Storefront Header next to the Shopping Cart icon. Clicks on the Mini Shopping Cart icon. Validates that the 'No Items' message is present and correct in the Storefront Mini Shopping Cart.</description> - </annotations> - - <dontSeeElement selector="{{StorefrontMinicartSection.productCount}}" stepKey="dontSeeMinicartProductCount"/> - <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="expandMinicart"/> - <see selector="{{StorefrontMinicartSection.minicartContent}}" userInput="You have no items in your shopping cart." stepKey="seeEmptyCartMessage"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontOpenCartFromMinicartActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontOpenCartFromMinicartActionGroup.xml new file mode 100644 index 0000000000000..3161d1a63b6f8 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontOpenCartFromMinicartActionGroup.xml @@ -0,0 +1,21 @@ +<?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="StorefrontOpenCartFromMinicartActionGroup"> + <annotations> + <description>Clicks on the Storefront Mini Shopping Cart icon. Click on 'View and Edit Cart'.</description> + </annotations> + + <waitForElement selector="{{StorefrontMinicartSection.showCart}}" stepKey="waitForShowMinicart"/> + <waitForElement selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="waitForCartLink"/> + <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickShowMinicart"/> + <click selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="clickCart"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontOpenMinicartAndCheckSimpleProductActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontOpenMinicartAndCheckSimpleProductActionGroup.xml new file mode 100644 index 0000000000000..28e97dfca5158 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontOpenMinicartAndCheckSimpleProductActionGroup.xml @@ -0,0 +1,23 @@ +<?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="StorefrontOpenMinicartAndCheckSimpleProductActionGroup"> + <annotations> + <description>Clicks on the Storefront Mini Shopping Cart icon. Validates that the provided Product is present and correct in the Mini Shopping Cart.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <waitForElement selector="{{StorefrontMinicartSection.productLinkByName(product.name)}}" stepKey="waitForMinicartProduct"/> + <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickShowMinicart"/> + <see userInput="${{product.price}}.00" selector="{{StorefrontMinicartSection.productPriceByName(product.name)}}" stepKey="assertProductPrice"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontProductCartActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontProductCartActionGroup.xml deleted file mode 100644 index b07bcdccce674..0000000000000 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontProductCartActionGroup.xml +++ /dev/null @@ -1,161 +0,0 @@ -<?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"> - <!-- Add Product to Cart from the category page and check message and product count in Minicart --> - <actionGroup name="StorefrontAddCategoryProductToCartActionGroup"> - <annotations> - <description>Adds the provided Product to the Cart from a Storefront Category page. Validates that the Success Message is present and correct. Validates that the Mini Shopping Cart contains the provided Product Count.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="productCount"/> - </arguments> - - <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct"/> - <click selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="clickAddToCart"/> - <waitForElementVisible selector="{{StorefrontCategoryMainSection.SuccessMsg}}" stepKey="waitForSuccessMessage"/> - <see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="You added {{product.name}} to your shopping cart." stepKey="assertSuccessMessage"/> - <seeLink stepKey="assertLinkToShoppingCart" url="{{_ENV.MAGENTO_BASE_URL}}checkout/cart/" userInput="shopping cart"/> - <waitForText userInput="{{productCount}}" selector="{{StorefrontMinicartSection.productCount}}" time="30" stepKey="assertProductCount"/> - </actionGroup> - - <!-- Add Product to Cart from the category page with specified quantity and check message and product count in Minicart --> - <actionGroup name="StorefrontAddCategoryProductToCartWithQuantityActionGroup"> - <annotations> - <description>Adds the provided Product to the Cart from a Storefront Category page. Validates that the Success Message is present and correct. Updates the Product Quantity using the provided Product Quantity. Validates that the provided Quantity is present and correct in the Mini Shopping Cart.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="quantity" defaultValue="1" type="string"/> - <argument name="checkQuantity" defaultValue="1" type="string"/> - </arguments> - - <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct"/> - <click selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="clickAddToCart"/> - <waitForElementVisible selector="{{StorefrontCategoryMainSection.SuccessMsg}}" stepKey="waitForSuccessMessage"/> - <see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="You added {{product.name}} to your shopping cart." stepKey="assertSuccessMessage"/> - <seeLink stepKey="assertLinkToShoppingCart" url="{{_ENV.MAGENTO_BASE_URL}}checkout/cart/" userInput="shopping cart"/> - <waitForText userInput="{{checkQuantity}}" selector="{{StorefrontMinicartSection.productCount}}" time="30" stepKey="assertProductCount"/> - <conditionalClick selector="{{StorefrontMinicartSection.showCart}}" dependentSelector="{{StorefrontMinicartSection.miniCartOpened}}" visible="false" stepKey="openMiniCart"/> - <waitForElementVisible selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="waitForViewAndEditCartVisible"/> - <fillField selector="{{StorefrontMinicartSection.itemQuantity(product.name)}}" userInput="{{quantity}}" stepKey="setProductQtyToFiftyInMiniCart"/> - <click selector="{{StorefrontMinicartSection.itemQuantityUpdate(product.name)}}" stepKey="updateQtyInMiniCart"/> - </actionGroup> - - <!-- Add Product to Cart from the product page and check message and product count in Minicart --> - <actionGroup name="StorefrontAddProductToCartActionGroup"> - <annotations> - <description>Clicks on Add to Cart on a Storefront Product page. Validates that the Success Message is present and correct. Validates that the provided Product Count is present and correct in the Mini Shopping Cart.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="productCount" type="string"/> - </arguments> - - <click selector="{{StorefrontProductInfoMainSection.AddToCart}}" stepKey="clickAddToCart"/> - <waitForElementVisible selector="{{StorefrontCategoryMainSection.SuccessMsg}}" stepKey="waitForSuccessMessage"/> - <see selector="{{StorefrontProductPageSection.messagesBlock}}" userInput="You added {{product.name}} to your shopping cart." stepKey="assertSuccessMessage"/> - <seeLink stepKey="assertLinkToShoppingCart" url="{{_ENV.MAGENTO_BASE_URL}}checkout/cart/" userInput="shopping cart"/> - <waitForText userInput="{{productCount}}" selector="{{StorefrontMinicartSection.productCount}}" time="30" stepKey="assertProductCount"/> - </actionGroup> - - <!-- Open the Minicart and check Simple Product --> - <actionGroup name="StorefrontOpenMinicartAndCheckSimpleProductActionGroup"> - <annotations> - <description>Clicks on the Storefront Mini Shopping Cart icon. Validates that the provided Product is present and correct in the Mini Shopping Cart.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <waitForElement selector="{{StorefrontMinicartSection.productLinkByName(product.name)}}" stepKey="waitForMinicartProduct"/> - <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickShowMinicart"/> - <see userInput="${{product.price}}.00" selector="{{StorefrontMinicartSection.productPriceByName(product.name)}}" stepKey="assertProductPrice"/> - </actionGroup> - - <!-- Check Simple Product in the Cart --> - <actionGroup name="StorefrontCheckCartSimpleProductActionGroup"> - <annotations> - <description>Validates that the provided Product details (Name and Price) are present and correct in the Mini Shopping Cart. Validates that the provided Product Quantity is present and correct in the Mini Shopping Cart.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="productQuantity"/> - </arguments> - - <seeElement selector="{{CheckoutCartProductSection.ProductLinkByName(product.name)}}" stepKey="assertProductName"/> - <see userInput="${{product.price}}.00" selector="{{CheckoutCartProductSection.ProductPriceByName(product.name)}}" stepKey="assertProductPrice"/> - <seeInField userInput="{{productQuantity}}" selector="{{CheckoutCartProductSection.ProductQuantityByName(product.name)}}" stepKey="assertProductQuantity"/> - </actionGroup> - - <!-- Check the Cart --> - <actionGroup name="StorefrontCheckCartActionGroup"> - <annotations> - <description>Goes to the Storefront Shopping Cart page. Validates that the provided Subtotal, Shipping, Shipping Method and Total are present and correct.</description> - </annotations> - <arguments> - <argument name="subtotal" type="string"/> - <argument name="shipping" type="string"/> - <argument name="shippingMethod" type="string" defaultValue="Flat Rate - Fixed"/> - <argument name="total" type="string"/> - </arguments> - - <seeInCurrentUrl url="{{CheckoutCartPage.url}}" stepKey="assertUrl"/> - <waitForPageLoad stepKey="waitForCartPage"/> - <conditionalClick selector="{{CheckoutCartSummarySection.shippingHeading}}" dependentSelector="{{CheckoutCartSummarySection.shippingMethodForm}}" visible="false" stepKey="openEstimateShippingSection"/> - <waitForElementVisible selector="{{CheckoutCartSummarySection.flatRateShippingMethod}}" stepKey="waitForShippingSection"/> - <checkOption selector="{{CheckoutCartSummarySection.flatRateShippingMethod}}" stepKey="selectShippingMethod"/> - <scrollTo selector="{{CheckoutCartSummarySection.subtotal}}" stepKey="scrollToSummary"/> - <see userInput="{{subtotal}}" selector="{{CheckoutCartSummarySection.subtotal}}" stepKey="assertSubtotal"/> - <see userInput="({{shippingMethod}})" selector="{{CheckoutCartSummarySection.shippingMethod}}" stepKey="assertShippingMethod"/> - <reloadPage stepKey="reloadPage" after="assertShippingMethod" /> - <waitForPageLoad stepKey="WaitForPageLoaded" after="reloadPage" /> - <waitForText userInput="{{shipping}}" selector="{{CheckoutCartSummarySection.shipping}}" time="45" stepKey="assertShipping" after="WaitForPageLoaded"/> - <see userInput="{{total}}" selector="{{CheckoutCartSummarySection.total}}" stepKey="assertTotal" after="assertShipping"/> - </actionGroup> - - <!-- Open the Cart from Minicart--> - <actionGroup name="StorefrontOpenCartFromMinicartActionGroup"> - <annotations> - <description>Clicks on the Storefront Mini Shopping Cart icon. Click on 'View and Edit Cart'.</description> - </annotations> - - <waitForElement selector="{{StorefrontMinicartSection.showCart}}" stepKey="waitForShowMinicart"/> - <waitForElement selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="waitForCartLink"/> - <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickShowMinicart"/> - <click selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="clickCart"/> - </actionGroup> - - <actionGroup name="changeSummaryQuoteAddress"> - <annotations> - <description>Fills in the provided Address details (Country, State and Zip Code) under the 'Summary' section on the Storefront Shopping Cart page.</description> - </annotations> - <arguments> - <argument name="taxCode"/> - </arguments> - - <conditionalClick stepKey="openShippingDetails" selector="{{CheckoutCartSummarySection.shippingHeading}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false"/> - <selectOption stepKey="selectCountry" selector="{{CheckoutCartSummarySection.country}}" userInput="{{taxCode.country}}"/> - <selectOption stepKey="selectStateProvince" selector="{{CheckoutCartSummarySection.stateProvince}}" userInput="{{taxCode.state}}"/> - <fillField stepKey="fillZip" selector="{{CheckoutCartSummarySection.postcode}}" userInput="{{taxCode.zip}}"/> - <waitForPageLoad stepKey="waitForFormUpdate"/> - </actionGroup> - - <actionGroup name="StorefrontCheckCartTotalWithDiscountCategoryActionGroup" extends="StorefrontCheckCartActionGroup"> - <annotations> - <description>EXTENDS: StorefrontCheckCartActionGroup. Validates that the provided Discount is present in the Storefront Shopping Cart.</description> - </annotations> - <arguments> - <argument name="discount" type="string" defaultValue="0"/> - </arguments> - <waitForElementVisible selector="{{CheckoutCartSummarySection.discountAmount}}" stepKey="waitForDiscount"/> - <see selector="{{CheckoutCartSummarySection.discountAmount}}" userInput="-${{discount}}" stepKey="assertDiscount"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontSignOutActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontSignOutActionGroup.xml new file mode 100644 index 0000000000000..8eac90fff2268 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontSignOutActionGroup.xml @@ -0,0 +1,21 @@ +<?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="StorefrontSignOutActionGroup"> + <annotations> + <description>Clicks on the Customer Account link. Clicks on 'Sign Out'. Validates that the Signed Out message is present and correct.</description> + </annotations> + + <click selector="{{StoreFrontSignOutSection.customerAccount}}" stepKey="clickCustomerButton"/> + <click selector="{{StoreFrontSignOutSection.signOut}}" stepKey="clickToSignOut"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <see userInput="You are signed out" stepKey="signOut"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/VerifyCheckoutPaymentOrderSummaryActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/VerifyCheckoutPaymentOrderSummaryActionGroup.xml index 6d8d390d36701..0ae71884745c6 100644 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/VerifyCheckoutPaymentOrderSummaryActionGroup.xml +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/VerifyCheckoutPaymentOrderSummaryActionGroup.xml @@ -23,27 +23,4 @@ <see selector="{{CheckoutPaymentSection.orderSummaryShippingTotal}}" userInput="{{orderSummaryShippingTotal}}" stepKey="seeCorrectShipping"/> <see selector="{{CheckoutPaymentSection.orderSummaryTotal}}" userInput="{{orderSummaryTotal}}" stepKey="seeCorrectOrderTotal"/> </actionGroup> - <!-- Assert Order Summary SubTotal You should be on checkout page --> - <actionGroup name="AssertStorefrontCheckoutPaymentSummarySubtotalActionGroup"> - <arguments> - <argument name="orderSubtotal" type="string"/> - </arguments> - <waitForPageLoad time="30" stepKey="waitForCartFullyLoaded"/> - <waitForElementVisible selector="{{CheckoutPaymentSection.orderSummarySubtotal}}" time="30" stepKey="waitForOrderSummaryBlock"/> - <see selector="{{CheckoutPaymentSection.orderSummarySubtotal}}" userInput="{{orderSubtotal}}" stepKey="seeCorrectSubtotal"/> - </actionGroup> - <!-- Assert Order Summary Total You should be on checkout page --> - <actionGroup name="AssertStorefrontCheckoutPaymentSummaryTotalActionGroup"> - <arguments> - <argument name="orderTotal" type="string"/> - </arguments> - <waitForPageLoad time="30" stepKey="waitForCartFullyLoaded"/> - <waitForElementVisible selector="{{CheckoutPaymentSection.orderSummaryTotal}}" time="30" stepKey="waitForOrderSummaryBlock"/> - <see selector="{{CheckoutPaymentSection.orderSummaryTotal}}" userInput="{{orderTotal}}" stepKey="seeCorrectOrderTotal"/> - </actionGroup> - <!-- Assert Order Summary Total Is Not Shown You should be on checkout page --> - <actionGroup name="AssertStorefrontCheckoutPaymentSummaryTotalMissingActionGroup"> - <waitForPageLoad time="30" stepKey="waitForCartFullyLoaded"/> - <dontSeeElement selector="{{CheckoutPaymentSection.orderSummaryTotal}}" stepKey="seeTotalElement"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/VerifyTopDestinationsCountryActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/VerifyTopDestinationsCountryActionGroup.xml new file mode 100644 index 0000000000000..74f48ff2fc155 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/VerifyTopDestinationsCountryActionGroup.xml @@ -0,0 +1,23 @@ +<?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="VerifyTopDestinationsCountryActionGroup"> + <annotations> + <description>Validates that the provided Country is listed at the provided Index in 'Country' drop down menu on the Storefront Shopping Cart page under the 'Summary' section.</description> + </annotations> + <arguments> + <argument name="country" type="string"/> + <argument name="placeNumber"/> + </arguments> + + <conditionalClick selector="{{CheckoutCartSummarySection.shippingHeading}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false" stepKey="openShippingDetails"/> + <see selector="{{CheckoutCartSummarySection.countryParameterized('placeNumber')}}" userInput="{{country}}" stepKey="seeCountry"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/clearCheckoutAddressPopupFieldsActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/clearCheckoutAddressPopupFieldsActionGroup.xml new file mode 100644 index 0000000000000..f19d5b5e9cd41 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/clearCheckoutAddressPopupFieldsActionGroup.xml @@ -0,0 +1,30 @@ +<?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="clearCheckoutAddressPopupFieldsActionGroup"> + <annotations> + <description>Clears the fields for the Customer/Address fields on the Storefront Checkout Address sections based on the provided Class Prefix (i.e. '._show', '[aria-hidden=false]').</description> + </annotations> + <arguments> + <argument name="classPrefix" type="string" defaultValue=""/> + </arguments> + + <clearField selector="{{classPrefix}} {{CheckoutShippingSection.firstName}}" stepKey="clearFieldFirstName"/> + <clearField selector="{{classPrefix}} {{CheckoutShippingSection.lastName}}" stepKey="clearFieldLastName"/> + <clearField selector="{{classPrefix}} {{CheckoutShippingSection.company}}" stepKey="clearFieldCompany"/> + <clearField selector="{{classPrefix}} {{CheckoutShippingSection.street}}" stepKey="clearFieldStreetAddress1"/> + <clearField selector="{{classPrefix}} {{CheckoutShippingSection.street2}}" stepKey="clearFieldStreetAddress2"/> + <clearField selector="{{classPrefix}} {{CheckoutShippingSection.city}}" stepKey="clearFieldCityName"/> + <selectOption selector="{{classPrefix}} {{CheckoutShippingSection.region}}" userInput="" stepKey="clearFieldRegion"/> + <clearField selector="{{classPrefix}} {{CheckoutShippingSection.postcode}}" stepKey="clearFieldZip"/> + <selectOption selector="{{classPrefix}} {{CheckoutShippingSection.country}}" userInput="" stepKey="clearFieldCounty"/> + <clearField selector="{{classPrefix}} {{CheckoutShippingSection.telephone}}" stepKey="clearFieldPhoneNumber"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/CheckNotVisibleProductInMinicartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/CheckNotVisibleProductInMinicartTest.xml index 4b4ca1935fd78..952e4460faa00 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/CheckNotVisibleProductInMinicartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/CheckNotVisibleProductInMinicartTest.xml @@ -33,7 +33,7 @@ <!--Check simple product1 in minicart--> <comment userInput="Check simple product 1 in minicart" stepKey="commentCheckSimpleProduct1InMinicart" after="addToCartFromStorefrontProductPage1"/> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="assertProduct1NameInMiniCart"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="assertProduct1NameInMiniCart"> <argument name="productName" value="$$createSimpleProduct1.name$$"/> </actionGroup> @@ -53,13 +53,13 @@ <!--Check simple product1 in minicart--> <comment userInput="Check hidden simple product 1 in minicart" stepKey="commentCheckHiddenSimpleProduct1InMinicart" after="addToCartFromStorefrontProductPage2"/> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="assertHiddenProduct1NameInMiniCart"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="assertHiddenProduct1NameInMiniCart"> <argument name="productName" value="$$createSimpleProduct1.name$$"/> </actionGroup> <!--Check simple product2 in minicart--> <comment userInput="Check hidden simple product 2 in minicart" stepKey="commentCheckSimpleProduct2InMinicart" after="addToCartFromStorefrontProductPage2"/> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="assertProduct2NameInMiniCart"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="assertProduct2NameInMiniCart"> <argument name="productName" value="$$createSimpleProduct2.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/CheckoutSpecificDestinationsTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/CheckoutSpecificDestinationsTest.xml index f3807388399b8..8d069828c097c 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/CheckoutSpecificDestinationsTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/CheckoutSpecificDestinationsTest.xml @@ -51,7 +51,7 @@ <amOnPage url="{{CheckoutCartPage.url}}" stepKey="amOnPageShoppingCart"/> <!--Verify country options in checkout top destination section--> - <actionGroup ref="VerifyTopDestinationsCountry" stepKey="verifyTopDestinationsCountry"> + <actionGroup ref="VerifyTopDestinationsCountryActionGroup" stepKey="verifyTopDestinationsCountry"> <argument name="country" value="Bahamas"/> <argument name="placeNumber" value="2"/> </actionGroup> @@ -71,7 +71,7 @@ <amOnPage url="{{CheckoutCartPage.url}}" stepKey="amOnPageShoppingCart2"/> <!--Verify country options is shown by default--> - <actionGroup ref="VerifyTopDestinationsCountry" stepKey="verifyTopDestinationsCountry2"> + <actionGroup ref="VerifyTopDestinationsCountryActionGroup" stepKey="verifyTopDestinationsCountry2"> <argument name="country" value="Afghanistan"/> <argument name="placeNumber" value="2"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/DefaultBillingAddressShouldBeCheckedOnPaymentPageTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/DefaultBillingAddressShouldBeCheckedOnPaymentPageTest.xml index 166f5022d5aeb..08534351906ee 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/DefaultBillingAddressShouldBeCheckedOnPaymentPageTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/DefaultBillingAddressShouldBeCheckedOnPaymentPageTest.xml @@ -44,7 +44,7 @@ <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/> <!-- Click "+ New Address" and Fill new address--> <click selector="{{CheckoutShippingSection.newAddressButton}}" stepKey="addAddress"/> - <actionGroup ref="LoggedInCheckoutWithOneAddressFieldWithoutStateField" stepKey="changeAddress"> + <actionGroup ref="LoggedInCheckoutWithOneAddressFieldWithoutStateFieldActionGroup" stepKey="changeAddress"> <argument name="Address" value="UK_Not_Default_Address"/> <argument name="classPrefix" value="._show"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml index aa3665a81bbde..6202477f23f49 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml @@ -50,7 +50,7 @@ </actionGroup> <!-- Go to shopping cart --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> <actionGroup ref="FillShippingZipForm" stepKey="fillShippingZipForm"> <argument name="address" value="US_Address_CA"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNewAddressTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNewAddressTest.xml index bafad6f28a680..961780a329dea 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNewAddressTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNewAddressTest.xml @@ -50,7 +50,7 @@ </actionGroup> <!-- Go to shopping cart --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> <actionGroup ref="FillShippingZipForm" stepKey="fillShippingZipForm"> <argument name="address" value="US_Address_CA"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml index 2c341a5c4c1ab..3fc825f0d6405 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml @@ -50,7 +50,7 @@ </actionGroup> <!-- Go to shopping cart --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> <actionGroup ref="FillShippingZipForm" stepKey="fillShippingZipForm"> <argument name="address" value="US_Address_CA"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml index 990459d7c81b7..adb6120800a1e 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml @@ -50,7 +50,7 @@ </actionGroup> <!-- Go to shopping cart --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> <actionGroup ref="FillShippingZipForm" stepKey="fillShippingZipForm"> <argument name="address" value="US_Address_CA"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml index e85a47ab7a91d..f21e211193b26 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml @@ -159,7 +159,7 @@ </actionGroup> <!--Go to shopping cart--> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> <actionGroup ref="FillShippingZipForm" stepKey="fillShippingZipForm"> <argument name="address" value="US_Address_CA"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/ShoppingCartAndMiniShoppingCartPerCustomerTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/ShoppingCartAndMiniShoppingCartPerCustomerTest.xml index 84cdb8abd9344..f85264db07da6 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/ShoppingCartAndMiniShoppingCartPerCustomerTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/ShoppingCartAndMiniShoppingCartPerCustomerTest.xml @@ -137,10 +137,10 @@ <!-- Assert products in mini cart for first customer --> <amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToStoreFrontHomePage"/> <waitForPageLoad stepKey="waitForHomePageLoad"/> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="assertFirstProductInMiniCart"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="assertFirstProductInMiniCart"> <argument name="productName" value="$$createSimpleProduct.name$$"/> </actionGroup> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="assertSecondProductInMiniCart"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="assertSecondProductInMiniCart"> <argument name="productName" value="$$createSimpleProductWithCustomOptions.name$$"/> </actionGroup> <actionGroup ref="AssertMiniShoppingCartSubTotalActionGroup" stepKey="assertMiniCartSubTotal"> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontUpdateShoppingCartWhileUpdateMinicartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontUpdateShoppingCartWhileUpdateMinicartTest.xml index fb80b4880a6f4..9c5aef12237d7 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontUpdateShoppingCartWhileUpdateMinicartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontUpdateShoppingCartWhileUpdateMinicartTest.xml @@ -37,7 +37,7 @@ </actionGroup> <!--Go to Shopping cart and check Qty--> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCart"/> <grabValueFrom selector="{{CheckoutCartProductSection.ProductQuantityByName($$createProduct.name$$)}}" stepKey="grabQtyShoppingCart"/> <assertEquals expected="1" actual="$grabQtyShoppingCart" stepKey="assertQtyShoppingCart"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartTest.xml index 071311b78b3fa..bd2bad402d25e 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartTest.xml @@ -82,7 +82,7 @@ </actionGroup> <!-- Select Mini Cart and select 'View And Edit Cart' --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="selectViewAndEditCart"/> <!--Assert Shopping Cart Summary--> <actionGroup ref="AssertStorefrontShoppingCartSummaryWithShippingActionGroup" stepKey="AssertCartSummary" > diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddConfigurableProductToShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddConfigurableProductToShoppingCartTest.xml index e3090d6cb311b..e716ba294f578 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddConfigurableProductToShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddConfigurableProductToShoppingCartTest.xml @@ -131,7 +131,7 @@ </actionGroup> <!-- Select Mini Cart and select 'View And Edit Cart' --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="selectViewAndEditCart"/> <!--Assert Shopping Cart Summary --> <actionGroup ref="AssertStorefrontShoppingCartSummaryWithShippingActionGroup" stepKey="AssertCartSummary" > diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddDownloadableProductToShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddDownloadableProductToShoppingCartTest.xml index ec9852a6a939d..3c1421f2616aa 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddDownloadableProductToShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddDownloadableProductToShoppingCartTest.xml @@ -47,7 +47,7 @@ </actionGroup> <!-- Select Mini Cart and select 'View And Edit Cart' --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="selectViewAndEditCart"/> <!--Assert Shopping Cart Summary--> <actionGroup ref="AssertStorefrontShoppingCartSummaryItemsActionGroup" stepKey="AssertCartSummary" > diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddGroupedProductToShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddGroupedProductToShoppingCartTest.xml index b3762c7a582b7..0fc4cee5e0582 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddGroupedProductToShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddGroupedProductToShoppingCartTest.xml @@ -64,7 +64,7 @@ </actionGroup> <!-- Select Mini Cart and select 'View And Edit Cart' --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="selectViewAndEditCart"/> <!--Assert Product1 items in cart --> <actionGroup ref="AssertStorefrontCheckoutCartItemsActionGroup" stepKey="assertSimpleProduct1ItemsInCheckOutCart"> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddOneBundleMultiSelectOptionToTheShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddOneBundleMultiSelectOptionToTheShoppingCartTest.xml index 9b8e5a4521115..c7cd69bf8b01a 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddOneBundleMultiSelectOptionToTheShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddOneBundleMultiSelectOptionToTheShoppingCartTest.xml @@ -81,7 +81,7 @@ </actionGroup> <!-- Select Mini Cart and select 'View And Edit Cart' --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="selectViewAndEditCart"/> <!--Assert Shopping Cart Summary--> <actionGroup ref="AssertStorefrontShoppingCartSummaryWithShippingActionGroup" stepKey="AssertCartSummary" > diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddTwoBundleMultiSelectOptionsToTheShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddTwoBundleMultiSelectOptionsToTheShoppingCartTest.xml index 71e99f41f79e1..2dd9ed0907c90 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddTwoBundleMultiSelectOptionsToTheShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddTwoBundleMultiSelectOptionsToTheShoppingCartTest.xml @@ -79,7 +79,7 @@ </actionGroup> <!-- Select Mini Cart and select 'View And Edit Cart' --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="selectViewAndEditCart"/> <!--Assert Shopping Cart Summary--> <actionGroup ref="AssertStorefrontShoppingCartSummaryWithShippingActionGroup" stepKey="AssertCartSummary" > diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml index c5d1c34a93b32..20cd28b148df0 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml @@ -59,7 +59,7 @@ </actionGroup> <!--Open View and edit --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="clickMiniCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="clickMiniCart"/> <!-- Fill the Estimate Shipping and Tax section --> <actionGroup ref="CheckoutFillEstimateShippingAndTaxActionGroup" stepKey="fillEstimateShippingAndTaxFields"/> @@ -127,4 +127,4 @@ <!-- Assert order buttons --> <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest.xml index 34dc6617d25d5..87d5b9de911cb 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest.xml @@ -45,7 +45,7 @@ </actionGroup> <!--Open View and edit --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="clickMiniCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="clickMiniCart"/> <!-- Fill the Estimate Shipping and Tax section --> <actionGroup ref="CheckoutFillEstimateShippingAndTaxActionGroup" stepKey="fillEstimateShippingAndTaxFields"/> @@ -98,4 +98,4 @@ <!-- Assert order buttons --> <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml index 6ccb05bf4c4f7..5efeef7922a53 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml @@ -123,7 +123,7 @@ </actionGroup> <!--Open View and edit --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="clickMiniCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="clickMiniCart"/> <!-- Fill the Estimate Shipping and Tax section --> <actionGroup ref="CheckoutFillEstimateShippingAndTaxActionGroup" stepKey="fillEstimateShippingAndTaxFields"/> @@ -168,4 +168,4 @@ <!-- Assert order buttons --> <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutDisabledProductAndCouponTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutDisabledProductAndCouponTest.xml index 0e704e5336db9..a35e503a3958a 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutDisabledProductAndCouponTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutDisabledProductAndCouponTest.xml @@ -52,7 +52,7 @@ </actionGroup> <!-- Open View and edit --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="clickMiniCart1"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="clickMiniCart1"/> <!-- Fill the Estimate Shipping and Tax section --> <actionGroup ref="CheckoutFillEstimateShippingAndTaxActionGroup" stepKey="fillEstimateShippingAndTaxFields"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutOnLoginWhenGuestCheckoutIsDisabledTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutOnLoginWhenGuestCheckoutIsDisabledTest.xml index b0b72515611e8..50631ad6c4c3f 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutOnLoginWhenGuestCheckoutIsDisabledTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutOnLoginWhenGuestCheckoutIsDisabledTest.xml @@ -49,7 +49,7 @@ </actionGroup> <!--Open View and edit --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="clickMiniCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="clickMiniCart"/> <!-- Fill the Estimate Shipping and Tax section --> <actionGroup ref="CheckoutFillEstimateShippingAndTaxActionGroup" stepKey="fillEstimateShippingAndTaxFields"/> @@ -91,4 +91,4 @@ <!-- Ship the order and assert the shipping status --> <actionGroup ref="AdminShipThePendingOrderActionGroup" stepKey="shipTheOrder"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithNewCustomerRegistrationAndDisableGuestCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithNewCustomerRegistrationAndDisableGuestCheckoutTest.xml index f7e54867b1ae4..4907bc6672663 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithNewCustomerRegistrationAndDisableGuestCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithNewCustomerRegistrationAndDisableGuestCheckoutTest.xml @@ -49,7 +49,7 @@ </actionGroup> <!--Open View and edit --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="clickMiniCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="clickMiniCart"/> <click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="goToCheckout"/> <waitForPageLoad stepKey="waitForPageToLoad"/> @@ -83,7 +83,7 @@ <see userInput="You saved the address." stepKey="verifyAddressAdded"/> <!-- Open Edit and View from cart --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="openViewAndEditOption"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="openViewAndEditOption"/> <!-- Proceed to checkout --> <click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="goToCheckout1"/> @@ -129,4 +129,4 @@ <!-- Ship the order and assert the shipping status --> <actionGroup ref="AdminShipThePendingOrderActionGroup" stepKey="shipTheOrder"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerLoginDuringCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerLoginDuringCheckoutTest.xml index 3a0ba2302a6dc..afefbff5ea59a 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerLoginDuringCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerLoginDuringCheckoutTest.xml @@ -55,7 +55,7 @@ </actionGroup> <!-- Go to Checkout page --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> <click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="clickProceedToCheckout"/> <waitForPageLoad stepKey="waitForProceedToCheckout"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerPlaceOrderWithNewAddressesThatWasEditedTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerPlaceOrderWithNewAddressesThatWasEditedTest.xml index 651c5bd8d4375..f4dad72616038 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerPlaceOrderWithNewAddressesThatWasEditedTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerPlaceOrderWithNewAddressesThatWasEditedTest.xml @@ -46,7 +46,7 @@ <!-- Click "+ New Address" and Fill new address--> <click selector="{{CheckoutShippingSection.newAddressButton}}" stepKey="addAddress"/> - <actionGroup ref="LoggedInCheckoutWithOneAddressFieldWithoutStateField" stepKey="changeAddress"> + <actionGroup ref="LoggedInCheckoutWithOneAddressFieldWithoutStateFieldActionGroup" stepKey="changeAddress"> <argument name="Address" value="UK_Not_Default_Address"/> <argument name="classPrefix" value="._show"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteBundleProductFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteBundleProductFromMiniShoppingCartTest.xml index 8f3ddbb27f62f..a8aa61dd40366 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteBundleProductFromMiniShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteBundleProductFromMiniShoppingCartTest.xml @@ -75,18 +75,18 @@ </actionGroup> <!-- Select Mini Cart and select 'View And Edit Cart' --> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="seeProductInMiniCart"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="seeProductInMiniCart"> <argument name="productName" value="$$createBundleProduct.name$$"/> </actionGroup> <!--Remove an item from the cart using minicart--> - <actionGroup ref="removeProductFromMiniCart" stepKey="removeProductFromMiniCart"> + <actionGroup ref="RemoveProductFromMiniCartActionGroup" stepKey="removeProductFromMiniCart"> <argument name="productName" value="$$createBundleProduct.name$$"/> </actionGroup> <reloadPage stepKey="reloadPage"/> <!--Check the minicart is empty and verify AssertProductAbsentInMiniShoppingCart--> - <actionGroup ref="assertMiniCartEmpty" stepKey="miniCartEnpty"/> + <actionGroup ref="AssertMiniCartEmptyActionGroup" stepKey="miniCartEnpty"/> <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$createBundleProduct.name$$)}}" stepKey="verifyAssertProductAbsentInMiniShoppingCart"/> </test> </tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteConfigurableProductFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteConfigurableProductFromMiniShoppingCartTest.xml index f6357bcf4caa2..34264e5982651 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteConfigurableProductFromMiniShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteConfigurableProductFromMiniShoppingCartTest.xml @@ -83,18 +83,18 @@ </actionGroup> <!-- Select Mini Cart and select 'View And Edit Cart' --> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="seeProductInMiniCart"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="seeProductInMiniCart"> <argument name="productName" value="$$createConfigProduct.name$$"/> </actionGroup> <!--Remove an item from the cart using minicart--> - <actionGroup ref="removeProductFromMiniCart" stepKey="removeProductFromMiniCart"> + <actionGroup ref="RemoveProductFromMiniCartActionGroup" stepKey="removeProductFromMiniCart"> <argument name="productName" value="$$createConfigProduct.name$$"/> </actionGroup> <reloadPage stepKey="reloadPage"/> <!--Check the minicart is empty and verify AssertProductAbsentInMiniShoppingCart--> - <actionGroup ref="assertMiniCartEmpty" stepKey="miniCartEnpty"/> + <actionGroup ref="AssertMiniCartEmptyActionGroup" stepKey="miniCartEnpty"/> <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$createConfigProduct.name$$)}}" stepKey="verifyAssertProductAbsentInMiniShoppingCart"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteDownloadableProductFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteDownloadableProductFromMiniShoppingCartTest.xml index 0fa503e1783b5..dd9259833cbc4 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteDownloadableProductFromMiniShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteDownloadableProductFromMiniShoppingCartTest.xml @@ -46,7 +46,7 @@ </actionGroup> <!-- Select Mini Cart and select 'View And Edit Cart' --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="selectViewAndEditCart"/> <!-- Assert product details in Mini Cart --> <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickOnMiniCart"/> @@ -59,18 +59,18 @@ </actionGroup> <!-- Select Mini Cart and select 'View And Edit Cart' --> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="seeProductInMiniCart"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="seeProductInMiniCart"> <argument name="productName" value="$$createDownloadableProduct.name$$"/> </actionGroup> <!--Remove an item from the cart using minicart--> - <actionGroup ref="removeProductFromMiniCart" stepKey="removeProductFromMiniCart"> + <actionGroup ref="RemoveProductFromMiniCartActionGroup" stepKey="removeProductFromMiniCart"> <argument name="productName" value="$$createDownloadableProduct.name$$"/> </actionGroup> <reloadPage stepKey="reloadPage"/> <!--Check the minicart is empty and verify AssertProductAbsentInMiniShoppingCart--> - <actionGroup ref="assertMiniCartEmpty" stepKey="miniCartEnpty"/> + <actionGroup ref="AssertMiniCartEmptyActionGroup" stepKey="miniCartEnpty"/> <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$createDownloadableProduct.name$$)}}" stepKey="verifyAssertProductAbsentInMiniShoppingCart"/> </test> </tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteProductsWithCartItemsDisplayDefaultLimitationFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteProductsWithCartItemsDisplayDefaultLimitationFromMiniShoppingCartTest.xml index cca5268564b12..65f29dcd126d3 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteProductsWithCartItemsDisplayDefaultLimitationFromMiniShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteProductsWithCartItemsDisplayDefaultLimitationFromMiniShoppingCartTest.xml @@ -237,40 +237,40 @@ </actionGroup> <!--Remove products from minicart--> - <actionGroup ref="removeProductFromMiniCart" stepKey="removeProduct1FromMiniCart"> + <actionGroup ref="RemoveProductFromMiniCartActionGroup" stepKey="removeProduct1FromMiniCart"> <argument name="productName" value="$$simpleProduct10.name$$"/> </actionGroup> - <actionGroup ref="removeProductFromMiniCart" stepKey="removeProduct2FromMiniCart"> + <actionGroup ref="RemoveProductFromMiniCartActionGroup" stepKey="removeProduct2FromMiniCart"> <argument name="productName" value="$$simpleProduct9.name$$"/> </actionGroup> - <actionGroup ref="removeProductFromMiniCart" stepKey="removeProduct3FromMiniCart"> + <actionGroup ref="RemoveProductFromMiniCartActionGroup" stepKey="removeProduct3FromMiniCart"> <argument name="productName" value="$$simpleProduct8.name$$"/> </actionGroup> - <actionGroup ref="removeProductFromMiniCart" stepKey="removeProduct4FromMiniCart"> + <actionGroup ref="RemoveProductFromMiniCartActionGroup" stepKey="removeProduct4FromMiniCart"> <argument name="productName" value="$$simpleProduct7.name$$"/> </actionGroup> - <actionGroup ref="removeProductFromMiniCart" stepKey="removeProduct5FromMiniCart"> + <actionGroup ref="RemoveProductFromMiniCartActionGroup" stepKey="removeProduct5FromMiniCart"> <argument name="productName" value="$$simpleProduct6.name$$"/> </actionGroup> - <actionGroup ref="removeProductFromMiniCart" stepKey="removeProduct6FromMiniCart"> + <actionGroup ref="RemoveProductFromMiniCartActionGroup" stepKey="removeProduct6FromMiniCart"> <argument name="productName" value="$$simpleProduct5.name$$"/> </actionGroup> - <actionGroup ref="removeProductFromMiniCart" stepKey="removeProduct7FromMiniCart"> + <actionGroup ref="RemoveProductFromMiniCartActionGroup" stepKey="removeProduct7FromMiniCart"> <argument name="productName" value="$$simpleProduct4.name$$"/> </actionGroup> - <actionGroup ref="removeProductFromMiniCart" stepKey="removeProduct8FromMiniCart"> + <actionGroup ref="RemoveProductFromMiniCartActionGroup" stepKey="removeProduct8FromMiniCart"> <argument name="productName" value="$$simpleProduct3.name$$"/> </actionGroup> - <actionGroup ref="removeProductFromMiniCart" stepKey="removeProduct9FromMiniCart"> + <actionGroup ref="RemoveProductFromMiniCartActionGroup" stepKey="removeProduct9FromMiniCart"> <argument name="productName" value="$$simpleProduct2.name$$"/> </actionGroup> - <actionGroup ref="removeProductFromMiniCart" stepKey="removeProduct10FromMiniCart"> + <actionGroup ref="RemoveProductFromMiniCartActionGroup" stepKey="removeProduct10FromMiniCart"> <argument name="productName" value="$$simpleProduct1.name$$"/> </actionGroup> <reloadPage stepKey="reloadPage"/> <!--Check the minicart is empty and verify EmptyCartMessage and AssertProductAbsentInMiniShoppingCart--> - <actionGroup ref="assertMiniCartEmpty" stepKey="miniCartEnpty"/> + <actionGroup ref="AssertMiniCartEmptyActionGroup" stepKey="miniCartEnpty"/> <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$simpleProduct1.name$$)}}" stepKey="verifyAssertProduct1AbsentInMiniShoppingCart"/> <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$simpleProduct2.name$$)}}" stepKey="verifyAssertProduct2AbsentInMiniShoppingCart"/> <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$simpleProduct3.name$$)}}" stepKey="verifyAssertProduct3AbsentInMiniShoppingCart"/> @@ -282,4 +282,4 @@ <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$simpleProduct9.name$$)}}" stepKey="verifyAssertProduct9AbsentInMiniShoppingCart"/> <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$simpleProduct10.name$$)}}" stepKey="verifyAssertProduct10AbsentInMiniShoppingCart"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleAndVirtualProductFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleAndVirtualProductFromMiniShoppingCartTest.xml index b8092ccdcdce7..c2c939a19cc76 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleAndVirtualProductFromMiniShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleAndVirtualProductFromMiniShoppingCartTest.xml @@ -64,25 +64,25 @@ </actionGroup> <!-- Select mini Cart and verify Simple and Virtual products names in cart--> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="seeSimpleProductInMiniCart"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="seeSimpleProductInMiniCart"> <argument name="productName" value="$$simpleProduct.name$$"/> </actionGroup> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="seeVirtualProductInMiniCart"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="seeVirtualProductInMiniCart"> <argument name="productName" value="$$virtualProduct.name$$"/> </actionGroup> <!--Remove Simple and Virtual products from mini cart--> - <actionGroup ref="removeProductFromMiniCart" stepKey="removeProductFromMiniCart"> + <actionGroup ref="RemoveProductFromMiniCartActionGroup" stepKey="removeProductFromMiniCart"> <argument name="productName" value="$$simpleProduct.name$$"/> </actionGroup> - <actionGroup ref="removeProductFromMiniCart" stepKey="removeVirtualProductFromMiniCart"> + <actionGroup ref="RemoveProductFromMiniCartActionGroup" stepKey="removeVirtualProductFromMiniCart"> <argument name="productName" value="$$virtualProduct.name$$"/> </actionGroup> <reloadPage stepKey="reloadPage"/> <!--Check the minicart is empty and verify EmptyCartMessage and AssertProductAbsentInMiniShoppingCart--> - <actionGroup ref="assertMiniCartEmpty" stepKey="miniCartEnpty"/> + <actionGroup ref="AssertMiniCartEmptyActionGroup" stepKey="miniCartEnpty"/> <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$simpleProduct.name$$)}}" stepKey="verifyAssertSimpleProductAbsentInMiniShoppingCart"/> <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$virtualProduct.name$$)}}" stepKey="verifyAssertVirtualProductAbsentInMiniShoppingCart"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleProductFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleProductFromMiniShoppingCartTest.xml index 05198060f5de4..02943b7f203f7 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleProductFromMiniShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleProductFromMiniShoppingCartTest.xml @@ -46,18 +46,18 @@ </actionGroup> <!-- Select Mini Cart and select 'View And Edit Cart' --> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="seeProductInMiniCart"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="seeProductInMiniCart"> <argument name="productName" value="$$simpleProduct.name$$"/> </actionGroup> <!--Remove an item from the cart using minicart--> - <actionGroup ref="removeProductFromMiniCart" stepKey="removeProductFromMiniCart"> + <actionGroup ref="RemoveProductFromMiniCartActionGroup" stepKey="removeProductFromMiniCart"> <argument name="productName" value="$$simpleProduct.name$$"/> </actionGroup> <reloadPage stepKey="reloadPage"/> <!--Check the minicart is empty and verify AssertProductAbsentInMiniShoppingCart--> - <actionGroup ref="assertMiniCartEmpty" stepKey="miniCartEnpty"/> + <actionGroup ref="AssertMiniCartEmptyActionGroup" stepKey="miniCartEnpty"/> <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$simpleProduct.name$$)}}" stepKey="verifyAssertProductAbsentInMiniShoppingCart"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml index 2226e1ebc8292..fdcdcb1cbd9e3 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml @@ -161,7 +161,7 @@ </actionGroup> <!--Open View and edit --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="clickMiniCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="clickMiniCart"/> <!-- Fill the Estimate Shipping and Tax section --> <actionGroup ref="CheckoutFillEstimateShippingAndTaxActionGroup" stepKey="fillEstimateShippingAndTaxFields"> @@ -220,4 +220,4 @@ <argument name="customerGroup" value=""/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutWithCouponAndZeroSubtotalTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutWithCouponAndZeroSubtotalTest.xml index 33ec099aa2ace..45e1d2c10e8d2 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutWithCouponAndZeroSubtotalTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutWithCouponAndZeroSubtotalTest.xml @@ -41,7 +41,7 @@ </actionGroup> <!--Open View and edit --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="clickMiniCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="clickMiniCart"/> <!-- Fill the Estimate Shipping and Tax section --> <actionGroup ref="CheckoutFillEstimateShippingAndTaxActionGroup" stepKey="fillEstimateShippingAndTaxFields"/> @@ -90,4 +90,4 @@ <see selector="{{AdminOrderTotalSection.grandTotal}}" userInput="$0.00" stepKey="seeGrandTotal"/> <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Pending" stepKey="seeOrderStatus"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontNotApplicableShippingMethodInReviewAndPaymentStepTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontNotApplicableShippingMethodInReviewAndPaymentStepTest.xml index 0f07549ff7885..8a4d8944a1e11 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontNotApplicableShippingMethodInReviewAndPaymentStepTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontNotApplicableShippingMethodInReviewAndPaymentStepTest.xml @@ -112,7 +112,7 @@ </actionGroup> <!-- Go to Order review --> - <actionGroup ref="StorefrontCheckoutForwardFromShippingStep" stepKey="goToCheckoutReview"/> + <actionGroup ref="StorefrontCheckoutForwardFromShippingStepActionGroup" stepKey="goToCheckoutReview"/> <!-- Checkout select Check/Money Order payment --> <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment"/> @@ -142,7 +142,7 @@ </actionGroup> <!-- Go to Order review --> - <actionGroup ref="StorefrontCheckoutForwardFromShippingStep" stepKey="goToCheckoutReview2"/> + <actionGroup ref="StorefrontCheckoutForwardFromShippingStepActionGroup" stepKey="goToCheckoutReview2"/> <!-- Place order assert succeed --> <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="checkoutPlaceOrder"/> @@ -167,7 +167,7 @@ </actionGroup> <!-- Go to Order review --> - <actionGroup ref="StorefrontCheckoutForwardFromShippingStep" stepKey="goToCheckoutReview3"/> + <actionGroup ref="StorefrontCheckoutForwardFromShippingStepActionGroup" stepKey="goToCheckoutReview3"/> <!-- Checkout select Check/Money Order payment --> <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment2"/> @@ -198,7 +198,7 @@ </actionGroup> <!-- Go to Order review --> - <actionGroup ref="StorefrontCheckoutForwardFromShippingStep" stepKey="goToCheckoutReview4"/> + <actionGroup ref="StorefrontCheckoutForwardFromShippingStepActionGroup" stepKey="goToCheckoutReview4"/> <!-- Place order assert succeed --> <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="checkoutPlaceOrder2"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductQuantityChangesInBackendAfterCustomerCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductQuantityChangesInBackendAfterCustomerCheckoutTest.xml index 285dc28cb520e..3404bb4baac54 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductQuantityChangesInBackendAfterCustomerCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductQuantityChangesInBackendAfterCustomerCheckoutTest.xml @@ -42,7 +42,7 @@ </actionGroup> <!--Open View and edit --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="clickMiniCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="clickMiniCart"/> <!-- Fill the Estimate Shipping and Tax section --> <actionGroup ref="CheckoutFillEstimateShippingAndTaxActionGroup" stepKey="fillEstimateShippingAndTaxFields"/> @@ -102,4 +102,4 @@ </actionGroup> <see selector="{{StorefrontProductInfoMainSection.productStockStatus}}" userInput="Out Of Stock" stepKey="seeProductDisplayedAsOutOfStock"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontRefreshPageDuringGuestCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontRefreshPageDuringGuestCheckoutTest.xml index 1db460de44996..bb74726330b68 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontRefreshPageDuringGuestCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontRefreshPageDuringGuestCheckoutTest.xml @@ -41,7 +41,7 @@ </actionGroup> <!-- Go to Checkout page --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> <click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="clickProceedToCheckout"/> <waitForPageLoad stepKey="waitForProceedToCheckout"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontShoppingCartCheckCustomerDefaultShippingAddressForVirtualQuoteTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontShoppingCartCheckCustomerDefaultShippingAddressForVirtualQuoteTest.xml index b0e1dead1fff9..89e974892427d 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontShoppingCartCheckCustomerDefaultShippingAddressForVirtualQuoteTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontShoppingCartCheckCustomerDefaultShippingAddressForVirtualQuoteTest.xml @@ -39,7 +39,7 @@ <argument name="productCount" value="1"/> </actionGroup> <!-- Step 3: Go to Shopping Cart --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingcart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingcart"/> <!-- Step 4: Open Estimate Tax section --> <click selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" stepKey="openEstimateTaxSection"/> <seeOptionIsSelected selector="{{CheckoutCartSummarySection.country}}" userInput="{{US_Address_CA.country}}" stepKey="checkCountry"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKCustomerCheckoutWithCouponTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKCustomerCheckoutWithCouponTest.xml index 482e2fb6233a6..bf9c8e9e68a1b 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKCustomerCheckoutWithCouponTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKCustomerCheckoutWithCouponTest.xml @@ -67,7 +67,7 @@ </actionGroup> <!--Open View and edit --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="clickMiniCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="clickMiniCart"/> <!-- Apply Coupon --> <actionGroup ref="StorefrontApplyCouponActionGroup" stepKey="applyDiscount"> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKGuestCheckoutWithConditionProductQuantityEqualsToOrderedQuantityTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKGuestCheckoutWithConditionProductQuantityEqualsToOrderedQuantityTest.xml index deab32aede324..7b7d4202c3cd4 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKGuestCheckoutWithConditionProductQuantityEqualsToOrderedQuantityTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKGuestCheckoutWithConditionProductQuantityEqualsToOrderedQuantityTest.xml @@ -39,7 +39,7 @@ </actionGroup> <!--Open View and edit --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="clickMiniCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="clickMiniCart"/> <!-- Fill the Estimate Shipping and Tax section --> <actionGroup ref="CheckoutFillEstimateShippingAndTaxActionGroup" stepKey="fillEstimateShippingAndTaxFields"/> @@ -97,4 +97,4 @@ </actionGroup> <see selector="{{StorefrontProductInfoMainSection.productStockStatus}}" userInput="Out Of Stock" stepKey="seeProductDisplayedAsOutOfStock"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUSCustomerCheckoutWithCouponAndBankTransferPaymentMethodTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUSCustomerCheckoutWithCouponAndBankTransferPaymentMethodTest.xml index 6d5f79f3aadf4..c55e47a5a1ed1 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUSCustomerCheckoutWithCouponAndBankTransferPaymentMethodTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUSCustomerCheckoutWithCouponAndBankTransferPaymentMethodTest.xml @@ -46,7 +46,7 @@ </actionGroup> <!-- Open View and edit --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="clickMiniCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="clickMiniCart"/> <!-- Fill the Estimate Shipping and Tax section --> <actionGroup ref="CheckoutFillEstimateShippingAndTaxActionGroup" stepKey="fillEstimateShippingAndTaxFields"/> @@ -94,4 +94,4 @@ <!-- Assert order buttons --> <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdateShoppingCartSimpleProductQtyTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdateShoppingCartSimpleProductQtyTest.xml index 72f6cf95a6fbe..372d763bf2fb7 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdateShoppingCartSimpleProductQtyTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdateShoppingCartSimpleProductQtyTest.xml @@ -56,7 +56,7 @@ <see userInput="{{quoteQty3Price123.currency}}{{quoteQty3Price123.subtotal}}" selector="{{CheckoutCartSummarySection.subtotal}}" stepKey="assertCartSubtotal"/> <!-- Minicart product price and subtotal should be updated --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="openMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="openMinicart"/> <grabValueFrom selector="{{StorefrontMinicartSection.itemQuantity($$createProduct.name$$)}}" stepKey="grabProductQtyInMinicart"/> <assertEquals stepKey="assertProductQtyInMinicart"> <actualResult type="variable">grabProductQtyInMinicart</actualResult> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdateShoppingCartSimpleWithCustomOptionsProductQtyTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdateShoppingCartSimpleWithCustomOptionsProductQtyTest.xml index 7a653f13c4ee5..0b52b08980ded 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdateShoppingCartSimpleWithCustomOptionsProductQtyTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdateShoppingCartSimpleWithCustomOptionsProductQtyTest.xml @@ -61,7 +61,7 @@ <see userInput="{{quoteQty11Subtotal1320.currency}}{{quoteQty11Subtotal1320.subtotal}}" selector="{{CheckoutCartSummarySection.subtotal}}" stepKey="assertSubtotal"/> <!-- Minicart product price and subtotal should be updated --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="openMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="openMinicart"/> <grabValueFrom selector="{{StorefrontMinicartSection.itemQuantity($$createProduct.name$$)}}" stepKey="grabProductQtyInMinicart"/> <assertEquals stepKey="assertProductQtyInMinicart"> <expectedResult type="string">{{quoteQty11Subtotal1320.qty}}</expectedResult> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminRelatedProductsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminRelatedProductsTest.xml index aa34693ed82f0..7f85224933da2 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminRelatedProductsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminRelatedProductsTest.xml @@ -193,11 +193,11 @@ <see selector="{{StorefrontMinicartSection.quantity}}" userInput="2" stepKey="seeItemCounterInMiniCart"/> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="assertOneProductNameInMiniCart"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="assertOneProductNameInMiniCart"> <argument name="productName" value="$$baseConfigProductHandle.name$$"/> </actionGroup> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="assertOneProductNameInMiniCart2"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="assertOneProductNameInMiniCart2"> <argument name="productName" value="$$simple2Handle.name$$"/> </actionGroup> </test> diff --git a/app/code/Magento/Persistent/Test/Mftf/Test/CheckShoppingCartBehaviorAfterSessionExpiredTest.xml b/app/code/Magento/Persistent/Test/Mftf/Test/CheckShoppingCartBehaviorAfterSessionExpiredTest.xml index c66a2979aa7f5..9169023bbf2e0 100644 --- a/app/code/Magento/Persistent/Test/Mftf/Test/CheckShoppingCartBehaviorAfterSessionExpiredTest.xml +++ b/app/code/Magento/Persistent/Test/Mftf/Test/CheckShoppingCartBehaviorAfterSessionExpiredTest.xml @@ -46,7 +46,7 @@ <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart1"> <argument name="product" value="$$createProduct$$"/> </actionGroup> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> <!--Reset cookies and refresh the page--> <resetCookie userInput="PHPSESSID" stepKey="resetCookieForCart"/> <reloadPage stepKey="reloadPage"/> diff --git a/app/code/Magento/Persistent/Test/Mftf/Test/ShippingQuotePersistedForGuestTest.xml b/app/code/Magento/Persistent/Test/Mftf/Test/ShippingQuotePersistedForGuestTest.xml index d508ebaa26885..40c9d59dc766b 100644 --- a/app/code/Magento/Persistent/Test/Mftf/Test/ShippingQuotePersistedForGuestTest.xml +++ b/app/code/Magento/Persistent/Test/Mftf/Test/ShippingQuotePersistedForGuestTest.xml @@ -59,7 +59,7 @@ <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProductToCartAsGuestUser"> <argument name="productName" value="$$createProduct.name$$"/> </actionGroup> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartBeforeChangeShippingAndTaxSection"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartBeforeChangeShippingAndTaxSection"/> <!--Step 5: Open Estimate Shipping and Tax block and fill the sections--> <conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false" stepKey="expandEstimateShippingAndTax" /> <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> @@ -69,7 +69,7 @@ <!--Step 6: Go to Homepage--> <amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToHomePageAfterChangingShippingAndTaxSection"/> <!--Step 7: Go to shopping cart and check "Estimate Shipping and Tax" fields values are saved--> - <actionGroup ref="clickViewAndEditCartFromMiniCart" after="goToHomePageAfterChangingShippingAndTaxSection" stepKey="goToShoppingCartAfterChangingShippingAndTaxSection"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" after="goToHomePageAfterChangingShippingAndTaxSection" stepKey="goToShoppingCartAfterChangingShippingAndTaxSection"/> <conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false" stepKey="expandEstimateShippingAndTaxAfterChanging" /> <seeOptionIsSelected selector="{{CheckoutCartSummarySection.country}}" userInput="{{US_Address_CA.country}}" stepKey="checkCustomerCountry" /> <seeOptionIsSelected selector="{{CheckoutCartSummarySection.stateProvince}}" userInput="{{US_Address_CA.state}}" stepKey="checkCustomerRegion" /> diff --git a/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyShoppingCartPersistenceUnderLongTermCookieTest.xml b/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyShoppingCartPersistenceUnderLongTermCookieTest.xml index e50fc4af83107..aaba09b8088d6 100644 --- a/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyShoppingCartPersistenceUnderLongTermCookieTest.xml +++ b/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyShoppingCartPersistenceUnderLongTermCookieTest.xml @@ -67,7 +67,7 @@ <actionGroup ref="AddSimpleProductToCart" stepKey="addSimple1ProductToCartForJohnSmithCustomer"> <argument name="product" value="$$createSimple1$$"/> </actionGroup> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="checkSimple1InMiniCartForJohnSmithCustomer"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="checkSimple1InMiniCartForJohnSmithCustomer"> <argument name="productName" value="$$createSimple1.name$$"/> </actionGroup> @@ -79,7 +79,7 @@ <actionGroup ref="StorefrontAssertPersistentCustomerWelcomeMessageNotPresentActionGroup" stepKey="dontSeeWelcomeJohnSmithCustomerNotYouMessage"> <argument name="customerFullName" value="{{John_Smith_Customer.fullname}}"/> </actionGroup> - <actionGroup ref="assertMiniCartEmpty" stepKey="assertMiniCartEmptyAfterJohnSmithSignOut" /> + <actionGroup ref="AssertMiniCartEmptyActionGroup" stepKey="assertMiniCartEmptyAfterJohnSmithSignOut" /> <!-- 5. Click the Create an Account link again and fill fields for registration of another customer, set password and check the Remember Me checkbox --> <amOnPage url="{{StorefrontCustomerCreatePage.url}}" stepKey="amOnCustomerAccountCreatePage"/> @@ -96,7 +96,7 @@ <argument name="product" value="$$createSimple1$$"/> </actionGroup> <see selector="{{StorefrontMinicartSection.productCount}}" userInput="1" stepKey="miniCartContainsOneProductForJohnDoeCustomer"/> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="checkSimple1InMiniCartForJohnDoeCustomer"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="checkSimple1InMiniCartForJohnDoeCustomer"> <argument name="productName" value="$$createSimple1.name$$"/> </actionGroup> @@ -110,22 +110,22 @@ <waitForText selector="{{StorefrontCMSPageSection.mainContent}}" userInput="CMS homepage content goes here." stepKey="waitForLoadContentMessageOnHomePage"/> <waitForElementVisible selector="{{StorefrontMinicartSection.productCount}}" stepKey="waitForCartCounterVisible"/> <see selector="{{StorefrontMinicartSection.productCount}}" userInput="1" stepKey="miniCartContainsOneProductForGuest"/> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="checkSimple1InMiniCartForGuestCustomer"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="checkSimple1InMiniCartForGuestCustomer"> <argument name="productName" value="$$createSimple1.name$$"/> </actionGroup> <!-- 8. Go to Shopping Cart and verify Simple Product 1 is present there --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCart" /> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCart" /> <see selector="{{CheckoutCartProductSection.productName}}" userInput="$$createSimple1.name$$" stepKey="checkSimple1InShoppingCart"/> <!-- 9. Add Simple Product 2 to Shopping Cart --> <actionGroup ref="AddSimpleProductToCart" stepKey="addSimple2ProductToCartForGuest"> <argument name="product" value="$$createSimple2$$"/> </actionGroup> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="checkSimple1InMiniCartForGuestCustomerSecondTime"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="checkSimple1InMiniCartForGuestCustomerSecondTime"> <argument name="productName" value="$$createSimple1.name$$"/> </actionGroup> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="checkSimple2InMiniCartForGuestCustomer"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="checkSimple2InMiniCartForGuestCustomer"> <argument name="productName" value="$$createSimple2.name$$"/> </actionGroup> <see selector="{{StorefrontMinicartSection.productCount}}" userInput="2" stepKey="miniCartContainsTwoProductForGuest"/> @@ -140,10 +140,10 @@ <argument name="Customer" value="Simple_Customer_Without_Address"/> </actionGroup> <see selector="{{StorefrontMinicartSection.productCount}}" userInput="2" stepKey="miniCartContainsTwoProductForJohnDoeCustomer"/> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="checkSimple1InMiniCartForJohnDoeCustomerSecondTime"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="checkSimple1InMiniCartForJohnDoeCustomerSecondTime"> <argument name="productName" value="$$createSimple1.name$$"/> </actionGroup> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="checkSimple2InMiniCartForJohnDoeCustomer"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="checkSimple2InMiniCartForJohnDoeCustomer"> <argument name="productName" value="$$createSimple2.name$$"/> </actionGroup> @@ -154,6 +154,6 @@ <waitForText selector="{{StorefrontCMSPageSection.mainContent}}" userInput="CMS homepage content goes here." stepKey="waitForLoadMainContentMessageOnHomePage"/> <click selector="{{StorefrontPanelHeaderSection.notYouLink}}" stepKey="clickOnNotYouLink" /> <waitForPageLoad stepKey="waitForCustomerLoginPageLoad"/> - <actionGroup ref="assertMiniCartEmpty" stepKey="assertMiniCartEmptyAfterJohnDoeSignOut" /> + <actionGroup ref="AssertMiniCartEmptyActionGroup" stepKey="assertMiniCartEmptyAfterJohnDoeSignOut" /> </test> </tests> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleAndVerifyRuleConditionAndFreeShippingIsAppliedTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleAndVerifyRuleConditionAndFreeShippingIsAppliedTest.xml index b51027d51fd53..c35311e1948c1 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleAndVerifyRuleConditionAndFreeShippingIsAppliedTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleAndVerifyRuleConditionAndFreeShippingIsAppliedTest.xml @@ -91,7 +91,7 @@ </actionGroup> <!--Click on view and edit cart link--> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> <waitForPageLoad stepKey="waitForViewAndEditCartToOpen"/> <conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" visible="true" stepKey="clickEstimateShippingAndTaxToOpen"/> <waitForPageLoad stepKey="waitForEstimateShippingAndTaxToOpen"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleAndVerifyRuleConditionIsNotAppliedTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleAndVerifyRuleConditionIsNotAppliedTest.xml index 8969e9d9d4ceb..3ceff9dc23d4b 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleAndVerifyRuleConditionIsNotAppliedTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleAndVerifyRuleConditionIsNotAppliedTest.xml @@ -103,7 +103,7 @@ </actionGroup> <!--Click on view and edit cart link--> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> <waitForPageLoad stepKey="waitForViewAndEditCartToOpen"/> <!--Verify AssertCartPriceRuleConditionIsNotApplied(Shopping cart subtotal equals to grand total - price rule has not been applied)--> <actionGroup ref="StorefrontCheckCartActionGroup" stepKey="cartAssert"> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForMatchingSubtotalAndVerifyRuleConditionIsAppliedTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForMatchingSubtotalAndVerifyRuleConditionIsAppliedTest.xml index ab62e51414e85..04570742cd31c 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForMatchingSubtotalAndVerifyRuleConditionIsAppliedTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForMatchingSubtotalAndVerifyRuleConditionIsAppliedTest.xml @@ -101,7 +101,7 @@ </actionGroup> <!--Click on view and edit cart link--> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> <waitForPageLoad stepKey="waitForViewAndEditCartToOpen"/> <conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" visible="true" stepKey="clickEstimateShippingAndTaxToOpen"/> <waitForPageLoad stepKey="waitForEstimateShippingAndTaxToOpen"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingCategoryAndVerifyRuleConditionIsAppliedTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingCategoryAndVerifyRuleConditionIsAppliedTest.xml index 00f104885e0f0..bab2212e37892 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingCategoryAndVerifyRuleConditionIsAppliedTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingCategoryAndVerifyRuleConditionIsAppliedTest.xml @@ -110,7 +110,7 @@ </actionGroup> <!--Click on view and edit cart link--> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> <waitForPageLoad stepKey="waitForViewAndEditToOpen"/> <!--Verify AssertCartPriceRuleConditionIsApplied if condition category id is matching--> <actionGroup ref="StorefrontCheckCartActionGroup" stepKey="cartAssert"> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingTotalWeightAndVerifyRuleConditionIsAppliedTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingTotalWeightAndVerifyRuleConditionIsAppliedTest.xml index 43b92ee938978..ebb5aa97e4212 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingTotalWeightAndVerifyRuleConditionIsAppliedTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingTotalWeightAndVerifyRuleConditionIsAppliedTest.xml @@ -98,7 +98,7 @@ </actionGroup> <!--Click on view and edit cart link--> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> <waitForPageLoad stepKey="waitForViewAndEditCartToOpen"/> <!--Verify AssertCartPriceRuleConditionIsApplied if condition Total Weight equals 200 is true--> <actionGroup ref="StorefrontCheckCartActionGroup" stepKey="cartAssert"> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/CartPriceRuleForConfigurableProductTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/CartPriceRuleForConfigurableProductTest.xml index 1eba06126ff6f..27b42d2f77dfd 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/CartPriceRuleForConfigurableProductTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/CartPriceRuleForConfigurableProductTest.xml @@ -88,7 +88,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteApiCategory"/> <actionGroup ref="logout" stepKey="logout"/> </after> - + <!-- Create the rule --> <amOnPage url="{{AdminCartPriceRulesPage.url}}" stepKey="amOnCartPriceList"/> <waitForPageLoad stepKey="waitForRulesPage"/> @@ -131,7 +131,7 @@ <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage2"/> <!--View and edit cart--> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="clickViewAndEditCartFromMiniCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="clickViewAndEditCartFromMiniCart"/> <click selector="{{DiscountSection.DiscountTab}}" stepKey="scrollToDiscountTab" /> <fillField selector="{{DiscountSection.CouponInput}}" userInput="ABCD" stepKey="fillCouponCode" /> <click selector="{{DiscountSection.ApplyCodeBtn}}" stepKey="applyCode"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartRuleCouponForFreeShippingTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartRuleCouponForFreeShippingTest.xml index 9e95e39e4791e..3526ab20aa6b4 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartRuleCouponForFreeShippingTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartRuleCouponForFreeShippingTest.xml @@ -56,7 +56,7 @@ <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckout"/> <!-- Go to Order review --> - <actionGroup ref="StorefrontCheckoutForwardFromShippingStep" stepKey="goToCheckoutReview"/> + <actionGroup ref="StorefrontCheckoutForwardFromShippingStepActionGroup" stepKey="goToCheckoutReview"/> <!-- Apply Discount Coupon to the Order --> <actionGroup ref="StorefrontApplyDiscountCodeActionGroup" stepKey="applyDiscountCoupon"> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToComplexProductsTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToComplexProductsTest.xml index d8c5b42dbaaaf..717325ab89e6d 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToComplexProductsTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToComplexProductsTest.xml @@ -94,7 +94,7 @@ <argument name="product" value="$$createConfigProductCreateConfigurableProduct1$$"/> <argument name="productCount" value="2"/> </actionGroup> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToCart"/> <!-- Discount amount is not applied --> <dontSee selector="{{CheckoutCartSummarySection.discountLabel}}" stepKey="discountIsNotApply"/> <!-- 3: Open configurable product 2 and add all his child products to cart --> @@ -110,7 +110,7 @@ <argument name="productCount" value="4"/> </actionGroup> <!-- Discount amount is applied --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToCart2"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToCart2"/> <see selector="{{CheckoutCartSummarySection.discountTotal}}" userInput="-$100.00" stepKey="discountIsApply"/> </test> </tests> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToGroupedProductWithInvisibleIndividualProductTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToGroupedProductWithInvisibleIndividualProductTest.xml index 8900d838fb825..6a08724953395 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToGroupedProductWithInvisibleIndividualProductTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToGroupedProductWithInvisibleIndividualProductTest.xml @@ -90,7 +90,7 @@ <argument name="linkedProduct1Name" value="$createThirdSimpleProduct.name$"/> <argument name="linkedProduct2Name" value="$createFourthSimpleProduct.name$"/> </actionGroup> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="openTheCartWithSecondGroupedProduct"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="openTheCartWithSecondGroupedProduct"/> <!-- Discount amount is not applied --> <actionGroup ref="StorefrontCheckCartActionGroup" stepKey="checkDiscountIsNotApplied"> <argument name="subtotal" value="$700.00"/> @@ -105,7 +105,7 @@ <argument name="linkedProduct1Name" value="$createFirstSimpleProduct.name$"/> <argument name="linkedProduct2Name" value="$createSecondSimpleProduct.name$"/> </actionGroup> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="openTheCartWithFirstAndSecondGroupedProducts"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="openTheCartWithFirstAndSecondGroupedProducts"/> <!-- Discount amount is applied for product from first category only --> <actionGroup ref="StorefrontCheckCartTotalWithDiscountCategoryActionGroup" stepKey="checkDiscountIsApplied"> <argument name="subtotal" value="$1,000.00"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForCustomerPhysicalQuoteTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForCustomerPhysicalQuoteTest.xml index aa44593400a89..a329a3871b1a0 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForCustomerPhysicalQuoteTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForCustomerPhysicalQuoteTest.xml @@ -86,7 +86,7 @@ <argument name="productCount" value="1"/> </actionGroup> <!-- Step 3: Go to Shopping Cart --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> <!-- Step 4: Open Estimate Shipping and Tax section --> <conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false" stepKey="expandEstimateShippingandTax" /> <seeOptionIsSelected selector="{{CheckoutCartSummarySection.country}}" userInput="{{US_Address_CA.country}}" stepKey="checkCustomerCountry" /> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForCustomerVirtualQuoteTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForCustomerVirtualQuoteTest.xml index ac090fd4fe9c0..c62fc59a52e68 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForCustomerVirtualQuoteTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForCustomerVirtualQuoteTest.xml @@ -58,7 +58,7 @@ <argument name="productCount" value="1"/> </actionGroup> <!-- Step 3: Go to Shopping Cart --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> <!-- Step 4: Open Estimate Shipping and Tax section --> <conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false" stepKey="expandEstimateShippingandTax" /> <seeOptionIsSelected selector="{{CheckoutCartSummarySection.country}}" userInput="{{US_Address_NY.country}}" stepKey="checkCustomerCountry" /> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForGuestPhysicalQuoteTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForGuestPhysicalQuoteTest.xml index bce9d895e311e..06ef58f400598 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForGuestPhysicalQuoteTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForGuestPhysicalQuoteTest.xml @@ -81,7 +81,7 @@ <argument name="productCount" value="1"/> </actionGroup> <!-- Step 3: Go to Shopping Cart --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> <!-- Step 4: Open Estimate Shipping and Tax section --> <conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false" stepKey="expandEstimateShippingandTax" /> <selectOption selector="{{CheckoutCartSummarySection.country}}" userInput="United States" stepKey="selectUSCountry"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForGuestVirtualQuoteTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForGuestVirtualQuoteTest.xml index 74233bbff4a64..4b911cd6db32f 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForGuestVirtualQuoteTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForGuestVirtualQuoteTest.xml @@ -53,7 +53,7 @@ <argument name="productCount" value="1"/> </actionGroup> <!-- Step 3: Go to Shopping Cart --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> <!-- Step 4: Open Estimate Shipping and Tax section --> <conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false" stepKey="expandEstimateShippingandTax" /> <selectOption selector="{{CheckoutCartSummarySection.country}}" userInput="United States" stepKey="selectUSCountry"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest.xml index 05ced7e61b3b7..12cdba459f2ec 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest.xml @@ -103,7 +103,7 @@ <see stepKey="seeTotalExcl" selector="{{CheckoutPaymentSection.orderSummaryTotalExcluding}}" userInput="$128.00"/> <!-- Change the address --> - <actionGroup ref="changeSummaryQuoteAddress" stepKey="changeAddress"> + <actionGroup ref="ChangeSummaryQuoteAddressActionGroup" stepKey="changeAddress"> <argument name="taxCode" value="SimpleTaxSwiss"/> </actionGroup> @@ -113,7 +113,7 @@ <see stepKey="seeTotalExcl2" selector="{{CheckoutPaymentSection.orderSummaryTotalExcluding}}" userInput="$128.00"/> <!-- Change the address --> - <actionGroup ref="changeSummaryQuoteAddress" stepKey="changeAddress2"> + <actionGroup ref="ChangeSummaryQuoteAddressActionGroup" stepKey="changeAddress2"> <argument name="taxCode" value="SimpleTaxCA"/> </actionGroup> @@ -220,7 +220,7 @@ <see stepKey="seeTotalExcl" selector="{{CheckoutPaymentSection.orderSummaryTotalExcluding}}" userInput="$$virtualProduct1.price$$"/> <!-- Change the address --> - <actionGroup ref="changeSummaryQuoteAddress" stepKey="changeAddress"> + <actionGroup ref="ChangeSummaryQuoteAddressActionGroup" stepKey="changeAddress"> <argument name="taxCode" value="SimpleTaxSwiss"/> </actionGroup> @@ -230,7 +230,7 @@ <see stepKey="seeTotalExcl2" selector="{{CheckoutPaymentSection.orderSummaryTotalExcluding}}" userInput="$$$virtualProduct1.price$$"/> <!-- Change the address --> - <actionGroup ref="changeSummaryQuoteAddress" stepKey="changeAddress2"> + <actionGroup ref="ChangeSummaryQuoteAddressActionGroup" stepKey="changeAddress2"> <argument name="taxCode" value="SimpleTaxCA"/> </actionGroup> @@ -330,7 +330,7 @@ <see stepKey="seeTotalExcl3" selector="{{CheckoutPaymentSection.orderSummaryTotalExcluding}}" userInput="$128.00"/> <!-- Change the address --> - <actionGroup ref="changeSummaryQuoteAddress" stepKey="changeAddress"> + <actionGroup ref="ChangeSummaryQuoteAddressActionGroup" stepKey="changeAddress"> <argument name="taxCode" value="SimpleTaxSwiss"/> </actionGroup> @@ -340,7 +340,7 @@ <see stepKey="seeTotalExcl2" selector="{{CheckoutPaymentSection.orderSummaryTotalExcluding}}" userInput="$128.00"/> <!-- Change the address --> - <actionGroup ref="changeSummaryQuoteAddress" stepKey="changeAddress2"> + <actionGroup ref="ChangeSummaryQuoteAddressActionGroup" stepKey="changeAddress2"> <argument name="taxCode" value="SimpleTaxNY"/> </actionGroup> @@ -441,7 +441,7 @@ <see stepKey="seeTotalExcl3" selector="{{CheckoutPaymentSection.orderSummaryTotalExcluding}}" userInput="$$virtualProduct1.price$$"/> <!-- Change the address --> - <actionGroup ref="changeSummaryQuoteAddress" stepKey="changeAddress"> + <actionGroup ref="ChangeSummaryQuoteAddressActionGroup" stepKey="changeAddress"> <argument name="taxCode" value="SimpleTaxSwiss"/> </actionGroup> @@ -451,7 +451,7 @@ <see stepKey="seeTotalExcl2" selector="{{CheckoutPaymentSection.orderSummaryTotalExcluding}}" userInput="$$$virtualProduct1.price$$"/> <!-- Change the address --> - <actionGroup ref="changeSummaryQuoteAddress" stepKey="changeAddress2"> + <actionGroup ref="ChangeSummaryQuoteAddressActionGroup" stepKey="changeAddress2"> <argument name="taxCode" value="SimpleTaxNY"/> </actionGroup> From 54160b744adb3f03e9716f0dd813616bd922a015 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Fri, 29 Nov 2019 12:45:14 +0100 Subject: [PATCH 143/586] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- ...omerSearchBundleProductsByKeywordsTest.xml | 36 +-- .../AdminCatalogSearchTermActionGroup.xml | 73 ----- .../AssertSearchTermNotInGridActionGroup.xml | 28 ++ ...ertSearchTermNotOnFrontendActionGroup.xml} | 18 +- .../AssertSearchTermOnFrontendActionGroup.xml | 26 ++ ...earchTermSaveSuccessMessageActionGroup.xml | 33 +++ ...rchTermSuccessDeleteMessageActionGroup.xml | 32 ++ ...reViewAdvancedCatalogSearchActionGroup.xml | 19 ++ ...ontAddToCartFromQuickSearchActionGroup.xml | 25 ++ ...dCatalogSearchByDescriptionActionGroup.xml | 23 ++ ...dCatalogSearchByProductNameActionGroup.xml | 23 ++ ...ByProductNameAndDescriptionActionGroup.xml | 25 ++ ...SearchByProductNameAndPriceActionGroup.xml | 27 ++ ...edCatalogSearchByProductSkuActionGroup.xml | 23 ++ ...logSearchByShortDescriptionActionGroup.xml | 23 ++ .../StorefrontCatalogSearchActionGroup.xml | 273 ------------------ ...ntCheckAdvancedSearchResultActionGroup.xml | 20 ++ .../StorefrontCheckQuickSearchActionGroup.xml | 26 ++ ...frontCheckQuickSearchStringActionGroup.xml | 26 ++ ...torefrontCheckSearchIsEmptyActionGroup.xml | 18 ++ ...torefrontOpenAdvancedSearchActionGroup.xml | 21 ++ ...tOpenProductFromQuickSearchActionGroup.xml | 26 ++ ...earchCheckProductNameInGridActionGroup.xml | 22 ++ ...chCheckProductNameNotInGridActionGroup.xml | 21 ++ ...chRelatedSearchTermsAppearsActionGroup.xml | 20 ++ ...QuickSearchSeeProductByNameActionGroup.xml | 17 ++ ...ntQuickSearchTooShortStringActionGroup.xml | 21 ++ ...tSelectSearchFilterCategoryActionGroup.xml | 23 ++ .../Test/AdminCreateSearchTermEntityTest.xml | 6 +- .../Mftf/Test/AdminDeleteSearchTermTest.xml | 10 +- .../Mftf/Test/SearchEntityResultsTest.xml | 30 +- ...ntElasticsearch6SearchInvalidValueTest.xml | 6 +- .../AdminMassDeleteSearchTermEntityTest.xml | 12 +- 33 files changed, 619 insertions(+), 413 deletions(-) delete mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AdminCatalogSearchTermActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertSearchTermNotInGridActionGroup.xml rename app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/{StorefrontCatalogSearchTermActionGroup.xml => AssertSearchTermNotOnFrontendActionGroup.xml} (61%) create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertSearchTermOnFrontendActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertSearchTermSaveSuccessMessageActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertSearchTermSuccessDeleteMessageActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/GoToStoreViewAdvancedCatalogSearchActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAddToCartFromQuickSearchActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByDescriptionActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByProductNameActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByProductNameAndDescriptionActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByProductNameAndPriceActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByProductSkuActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByShortDescriptionActionGroup.xml delete mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCatalogSearchActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCheckAdvancedSearchResultActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCheckQuickSearchActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCheckQuickSearchStringActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCheckSearchIsEmptyActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontOpenAdvancedSearchActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontOpenProductFromQuickSearchActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchCheckProductNameInGridActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchCheckProductNameNotInGridActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchRelatedSearchTermsAppearsActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchSeeProductByNameActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchTooShortStringActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontSelectSearchFilterCategoryActionGroup.xml diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSearchBundleProductsByKeywordsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSearchBundleProductsByKeywordsTest.xml index 9ea0480e540ba..ae9d01a50f46e 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSearchBundleProductsByKeywordsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSearchBundleProductsByKeywordsTest.xml @@ -53,84 +53,84 @@ <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchDynamic"> <argument name="phrase" value="Dynamic"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="assertDynamicBundleInSearchResultByDynamic"> + <actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="assertDynamicBundleInSearchResultByDynamic"> <argument name="productName" value="$createDynamicBundle.name$"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="assertFixedBundleInSearchResultByDynamic"> + <actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGridActionGroup" stepKey="assertFixedBundleInSearchResultByDynamic"> <argument name="productName" value="$createFixedBundle.name$"/> </actionGroup> <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchByDescription"> <argument name="phrase" value="Dynamicscription"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="assertDynamicBundleInSearchResultByDescription"> + <actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="assertDynamicBundleInSearchResultByDescription"> <argument name="productName" value="$createDynamicBundle.name$"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="dontSeeFixedBundleInSearchResultByDescription"> + <actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGridActionGroup" stepKey="dontSeeFixedBundleInSearchResultByDescription"> <argument name="productName" value="$createFixedBundle.name$"/> </actionGroup> <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchShortDescription"> <argument name="phrase" value="Dynamictest"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="assertDynamicBundleInSearchResultByShortDescription"> + <actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="assertDynamicBundleInSearchResultByShortDescription"> <argument name="productName" value="$createDynamicBundle.name$"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="dontSeeFixedBundleInSearchResultByShortDescription"> + <actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGridActionGroup" stepKey="dontSeeFixedBundleInSearchResultByShortDescription"> <argument name="productName" value="$createFixedBundle.name$"/> </actionGroup> <!-- 3. Fill quick search bar with test values mutual for both products and click search --> <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchTest123"> <argument name="phrase" value="Test 123"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeDynamicBundleByTest123"> + <actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="seeDynamicBundleByTest123"> <argument name="productName" value="$createDynamicBundle.name$"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByTest123"> + <actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="seeFixedBundleByTest123"> <argument name="productName" value="$createFixedBundle.name$"/> </actionGroup> <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchTesting321"> <argument name="phrase" value="Testing 321"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeDynamicBundleByTesting321"> + <actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="seeDynamicBundleByTesting321"> <argument name="productName" value="$createDynamicBundle.name$"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByTesting321"> + <actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="seeFixedBundleByTesting321"> <argument name="productName" value="$createFixedBundle.name$"/> </actionGroup> <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchShort555"> <argument name="phrase" value="Short 555"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeDynamicBundleByShort555"> + <actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="seeDynamicBundleByShort555"> <argument name="productName" value="$createDynamicBundle.name$"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByShort555"> + <actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="seeFixedBundleByShort555"> <argument name="productName" value="$createFixedBundle.name$"/> </actionGroup> <!-- 4. Fill quick search bar with test values unique for fixed bundle product and click search --> <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchByFixed"> <argument name="phrase" value="Fixed"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByFixed"> + <actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="seeFixedBundleByFixed"> <argument name="productName" value="$createFixedBundle.name$"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="dontSeeDynamicBundleByFixed"> + <actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGridActionGroup" stepKey="dontSeeDynamicBundleByFixed"> <argument name="productName" value="$createDynamicBundle.name$"/> </actionGroup> <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchByDescriptionForFixed"> <argument name="phrase" value="Fixedscription"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByDescriptionForFixed"> + <actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="seeFixedBundleByDescriptionForFixed"> <argument name="productName" value="$createFixedBundle.name$"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="dontSeeDynamicProductByDescriptionForFixed"> + <actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGridActionGroup" stepKey="dontSeeDynamicProductByDescriptionForFixed"> <argument name="productName" value="$createDynamicBundle.name$"/> </actionGroup> <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchByShortDescriptionForFixed"> <argument name="phrase" value="Fixedtest"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByShortDescriptionForFixed"> + <actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="seeFixedBundleByShortDescriptionForFixed"> <argument name="productName" value="$createFixedBundle.name$"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="dontSeeDynamicBundleByShortDescriptionForFixed"> + <actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGridActionGroup" stepKey="dontSeeDynamicBundleByShortDescriptionForFixed"> <argument name="productName" value="$createDynamicBundle.name$"/> </actionGroup> </test> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AdminCatalogSearchTermActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AdminCatalogSearchTermActionGroup.xml deleted file mode 100644 index 932c45c0d5aeb..0000000000000 --- a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AdminCatalogSearchTermActionGroup.xml +++ /dev/null @@ -1,73 +0,0 @@ -<?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="AssertSearchTermSaveSuccessMessage"> - <annotations> - <description>Goes to the Catalog Search Term grid page. Adds the provided Search Term. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="searchQuery" type="string"/> - <argument name="storeValue" type="string"/> - <argument name="redirectUrl" type="string"/> - <argument name="displayInSuggestedTerm" type="string"/> - </arguments> - - <amOnPage url="{{AdminCatalogSearchTermIndexPage.url}}" stepKey="openAdminCatalogSearchTermIndexPage"/> - <waitForPageLoad stepKey="waitForAdminCatalogSearchTermIndexPageLoad"/> - <click selector="{{AdminCatalogSearchTermIndexSection.addNewSearchTermButton}}" stepKey="clickAddNewSearchTermButton"/> - <waitForPageLoad stepKey="waitForAdminCatalogSearchTermNewPageLoad"/> - <fillField selector="{{AdminCatalogSearchTermNewSection.searchQuery}}" userInput="{{searchQuery}}" stepKey="fillSearchQueryTextBox"/> - <selectOption selector="{{AdminCatalogSearchTermNewSection.store}}" userInput="{{storeValue}}" stepKey="selectStoreValue"/> - <fillField selector="{{AdminCatalogSearchTermNewSection.redirectUrl}}" userInput="{{redirectUrl}}" stepKey="fillRedirectUrl"/> - <selectOption selector="{{AdminCatalogSearchTermNewSection.displayInSuggestedTerm}}" userInput="{{displayInSuggestedTerm}}" stepKey="selectDisplayInSuggestedTerm"/> - <click selector="{{AdminCatalogSearchTermNewSection.saveSearchButton}}" stepKey="clickSaveSearchButton"/> - <see selector="{{AdminCatalogSearchTermMessagesSection.successMessage}}" userInput="You saved the search term." stepKey="seeSaveSuccessMessage"/> - </actionGroup> - - <actionGroup name="AssertSearchTermSuccessDeleteMessage"> - <annotations> - <description>Goes to the Catalog Search Term grid page. Deletes the provided Search Term. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="searchQuery" type="string"/> - </arguments> - - <amOnPage url="{{AdminCatalogSearchTermIndexPage.url}}" stepKey="openCatalogSearchIndexPage"/> - <waitForPageLoad stepKey="waitForAdminCatalogSearchTermIndexPageLoad"/> - <click selector="{{AdminCatalogSearchTermIndexSection.resetFilterButton}}" stepKey="clickOnResetButton"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> - <fillField selector="{{AdminCatalogSearchTermIndexSection.searchQuery}}" userInput="{{searchQuery}}" stepKey="fillSearchQuery"/> - <click selector="{{AdminCatalogSearchTermIndexSection.searchButton}}" stepKey="clickSearchButton"/> - <waitForPageLoad stepKey="waitForSearchResultLoad"/> - <click selector="{{AdminCatalogSearchTermIndexSection.nthRow('1')}}" stepKey="checkFirstRow"/> - <selectOption selector="{{AdminCatalogSearchTermIndexSection.massActions}}" userInput="delete" stepKey="selectDeleteOption"/> - <click selector="{{AdminCatalogSearchTermIndexSection.submit}}" stepKey="clickSubmitButton"/> - <click selector="{{AdminCatalogSearchTermIndexSection.okButton}}" stepKey="clickOkButton"/> - <see selector="{{AdminCatalogSearchTermMessagesSection.successMessage}}" userInput="Total of 1 record(s) were deleted." stepKey="seeSuccessMessage"/> - </actionGroup> - - <actionGroup name="AssertSearchTermNotInGrid"> - <annotations> - <description>Goes to the Catalog Search Term grid page. Searches for the provided Search Term. Validates that it is NOT present in the grid.</description> - </annotations> - <arguments> - <argument name="searchQuery" type="string"/> - </arguments> - - <amOnPage url="{{AdminCatalogSearchTermIndexPage.url}}" stepKey="openCatalogSearchIndexPage"/> - <waitForPageLoad stepKey="waitForAdminCatalogSearchTermIndexPageLoad"/> - <click selector="{{AdminCatalogSearchTermIndexSection.resetFilterButton}}" stepKey="clickOnResetButton"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> - <fillField selector="{{AdminCatalogSearchTermIndexSection.searchQuery}}" userInput="{{searchQuery}}" stepKey="fillSearchQuery"/> - <click selector="{{AdminCatalogSearchTermIndexSection.searchButton}}" stepKey="clickSearchButton"/> - <waitForPageLoad stepKey="waitForSearchResultToLoad"/> - <see selector="{{AdminCatalogSearchTermIndexSection.emptyRecords}}" userInput="We couldn't find any records." stepKey="seeEmptyRecordMessage"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertSearchTermNotInGridActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertSearchTermNotInGridActionGroup.xml new file mode 100644 index 0000000000000..6b8b94931b3f9 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertSearchTermNotInGridActionGroup.xml @@ -0,0 +1,28 @@ +<?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="AssertSearchTermNotInGridActionGroup"> + <annotations> + <description>Goes to the Catalog Search Term grid page. Searches for the provided Search Term. Validates that it is NOT present in the grid.</description> + </annotations> + <arguments> + <argument name="searchQuery" type="string"/> + </arguments> + + <amOnPage url="{{AdminCatalogSearchTermIndexPage.url}}" stepKey="openCatalogSearchIndexPage"/> + <waitForPageLoad stepKey="waitForAdminCatalogSearchTermIndexPageLoad"/> + <click selector="{{AdminCatalogSearchTermIndexSection.resetFilterButton}}" stepKey="clickOnResetButton"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <fillField selector="{{AdminCatalogSearchTermIndexSection.searchQuery}}" userInput="{{searchQuery}}" stepKey="fillSearchQuery"/> + <click selector="{{AdminCatalogSearchTermIndexSection.searchButton}}" stepKey="clickSearchButton"/> + <waitForPageLoad stepKey="waitForSearchResultToLoad"/> + <see selector="{{AdminCatalogSearchTermIndexSection.emptyRecords}}" userInput="We couldn't find any records." stepKey="seeEmptyRecordMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCatalogSearchTermActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertSearchTermNotOnFrontendActionGroup.xml similarity index 61% rename from app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCatalogSearchTermActionGroup.xml rename to app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertSearchTermNotOnFrontendActionGroup.xml index e1f0396b68c15..67e60a1603a9b 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCatalogSearchTermActionGroup.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertSearchTermNotOnFrontendActionGroup.xml @@ -9,7 +9,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <!--Verify AssertSearchTermNotOnFrontend--> - <actionGroup name="AssertSearchTermNotOnFrontend"> + <actionGroup name="AssertSearchTermNotOnFrontendActionGroup"> <annotations> <description>Goes to the Storefront. Fills the Search field with the provided Search Query. Clicks on Search. Validates that there are no results.</description> </annotations> @@ -26,20 +26,4 @@ <waitForPageLoad stepKey="waitForSearch"/> <see selector="{{StorefrontMessagesSection.noticeMessage}}" userInput="Your search returned no results." stepKey="seeAssertSearchTermNotOnFrontendNoticeMessage"/> </actionGroup> - - <actionGroup name="AssertSearchTermOnFrontend"> - <annotations> - <description>Fills the Storefront Search field with the provided Search Query. Clicks on Search. Validates that the URL is correct.</description> - </annotations> - <arguments> - <argument name="searchQuery" type="string"/> - <argument name="redirectUrl" type="string"/> - </arguments> - - <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{searchQuery}}" stepKey="fillSearchQuery"/> - <waitForPageLoad stepKey="waitForFillField"/> - <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> - <waitForPageLoad stepKey="waitForSearch"/> - <seeInCurrentUrl url="{{redirectUrl}}" stepKey="checkUrl"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertSearchTermOnFrontendActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertSearchTermOnFrontendActionGroup.xml new file mode 100644 index 0000000000000..cb2ce92531af8 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertSearchTermOnFrontendActionGroup.xml @@ -0,0 +1,26 @@ +<?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="AssertSearchTermOnFrontendActionGroup"> + <annotations> + <description>Fills the Storefront Search field with the provided Search Query. Clicks on Search. Validates that the URL is correct.</description> + </annotations> + <arguments> + <argument name="searchQuery" type="string"/> + <argument name="redirectUrl" type="string"/> + </arguments> + + <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{searchQuery}}" stepKey="fillSearchQuery"/> + <waitForPageLoad stepKey="waitForFillField"/> + <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> + <waitForPageLoad stepKey="waitForSearch"/> + <seeInCurrentUrl url="{{redirectUrl}}" stepKey="checkUrl"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertSearchTermSaveSuccessMessageActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertSearchTermSaveSuccessMessageActionGroup.xml new file mode 100644 index 0000000000000..4291bbff88aae --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertSearchTermSaveSuccessMessageActionGroup.xml @@ -0,0 +1,33 @@ +<?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="AssertSearchTermSaveSuccessMessageActionGroup"> + <annotations> + <description>Goes to the Catalog Search Term grid page. Adds the provided Search Term. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="searchQuery" type="string"/> + <argument name="storeValue" type="string"/> + <argument name="redirectUrl" type="string"/> + <argument name="displayInSuggestedTerm" type="string"/> + </arguments> + + <amOnPage url="{{AdminCatalogSearchTermIndexPage.url}}" stepKey="openAdminCatalogSearchTermIndexPage"/> + <waitForPageLoad stepKey="waitForAdminCatalogSearchTermIndexPageLoad"/> + <click selector="{{AdminCatalogSearchTermIndexSection.addNewSearchTermButton}}" stepKey="clickAddNewSearchTermButton"/> + <waitForPageLoad stepKey="waitForAdminCatalogSearchTermNewPageLoad"/> + <fillField selector="{{AdminCatalogSearchTermNewSection.searchQuery}}" userInput="{{searchQuery}}" stepKey="fillSearchQueryTextBox"/> + <selectOption selector="{{AdminCatalogSearchTermNewSection.store}}" userInput="{{storeValue}}" stepKey="selectStoreValue"/> + <fillField selector="{{AdminCatalogSearchTermNewSection.redirectUrl}}" userInput="{{redirectUrl}}" stepKey="fillRedirectUrl"/> + <selectOption selector="{{AdminCatalogSearchTermNewSection.displayInSuggestedTerm}}" userInput="{{displayInSuggestedTerm}}" stepKey="selectDisplayInSuggestedTerm"/> + <click selector="{{AdminCatalogSearchTermNewSection.saveSearchButton}}" stepKey="clickSaveSearchButton"/> + <see selector="{{AdminCatalogSearchTermMessagesSection.successMessage}}" userInput="You saved the search term." stepKey="seeSaveSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertSearchTermSuccessDeleteMessageActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertSearchTermSuccessDeleteMessageActionGroup.xml new file mode 100644 index 0000000000000..3d32b3c292305 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertSearchTermSuccessDeleteMessageActionGroup.xml @@ -0,0 +1,32 @@ +<?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="AssertSearchTermSuccessDeleteMessageActionGroup"> + <annotations> + <description>Goes to the Catalog Search Term grid page. Deletes the provided Search Term. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="searchQuery" type="string"/> + </arguments> + + <amOnPage url="{{AdminCatalogSearchTermIndexPage.url}}" stepKey="openCatalogSearchIndexPage"/> + <waitForPageLoad stepKey="waitForAdminCatalogSearchTermIndexPageLoad"/> + <click selector="{{AdminCatalogSearchTermIndexSection.resetFilterButton}}" stepKey="clickOnResetButton"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <fillField selector="{{AdminCatalogSearchTermIndexSection.searchQuery}}" userInput="{{searchQuery}}" stepKey="fillSearchQuery"/> + <click selector="{{AdminCatalogSearchTermIndexSection.searchButton}}" stepKey="clickSearchButton"/> + <waitForPageLoad stepKey="waitForSearchResultLoad"/> + <click selector="{{AdminCatalogSearchTermIndexSection.nthRow('1')}}" stepKey="checkFirstRow"/> + <selectOption selector="{{AdminCatalogSearchTermIndexSection.massActions}}" userInput="delete" stepKey="selectDeleteOption"/> + <click selector="{{AdminCatalogSearchTermIndexSection.submit}}" stepKey="clickSubmitButton"/> + <click selector="{{AdminCatalogSearchTermIndexSection.okButton}}" stepKey="clickOkButton"/> + <see selector="{{AdminCatalogSearchTermMessagesSection.successMessage}}" userInput="Total of 1 record(s) were deleted." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/GoToStoreViewAdvancedCatalogSearchActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/GoToStoreViewAdvancedCatalogSearchActionGroup.xml new file mode 100644 index 0000000000000..65ba0719af496 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/GoToStoreViewAdvancedCatalogSearchActionGroup.xml @@ -0,0 +1,19 @@ +<?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="GoToStoreViewAdvancedCatalogSearchActionGroup"> + <annotations> + <description>Goes to the Storefront 'Advanced Search' page.</description> + </annotations> + + <amOnPage url="{{StorefrontCatalogSearchAdvancedFormPage.url}}" stepKey="GoToStoreViewAdvancedCatalogSearchActionGroup"/> + <waitForPageLoad time="90" stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAddToCartFromQuickSearchActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAddToCartFromQuickSearchActionGroup.xml new file mode 100644 index 0000000000000..1ee9003a6bdb6 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAddToCartFromQuickSearchActionGroup.xml @@ -0,0 +1,25 @@ +<?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="StorefrontAddToCartFromQuickSearchActionGroup"> + <annotations> + <description>Adds the provided Product Name to the Shopping Cart from the Storefront Quick Search Results page. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + </arguments> + + <scrollTo selector="{{StorefrontQuickSearchResultsSection.productByName(productName)}}" stepKey="scrollToProduct"/> + <moveMouseOver stepKey="hoverOverProduct" selector="{{StorefrontQuickSearchResultsSection.productByName(productName)}}"/> + <click selector="{{StorefrontQuickSearchResultsSection.productByName(productName)}} {{StorefrontQuickSearchResultsSection.addToCartBtn}}" stepKey="addToCart"/> + <waitForElementVisible selector="{{StorefrontQuickSearchResultsSection.messageSection}}" time="30" stepKey="waitForProductAdded"/> + <see selector="{{StorefrontQuickSearchResultsSection.messageSection}}" userInput="You added {{productName}} to your shopping cart." stepKey="seeAddedToCartMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByDescriptionActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByDescriptionActionGroup.xml new file mode 100644 index 0000000000000..d342909d54723 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByDescriptionActionGroup.xml @@ -0,0 +1,23 @@ +<?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="StorefrontAdvancedCatalogSearchByDescriptionActionGroup"> + <annotations> + <description>Fills the Product Description field on the Storefront 'Advanced Search' page. Clicks on the Submit button.</description> + </annotations> + <arguments> + <argument name="description" type="string"/> + </arguments> + + <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.Description}}" userInput="{{description}}" stepKey="fill"/> + <click selector="{{StorefrontCatalogSearchAdvancedFormSection.SubmitButton}}" stepKey="clickSubmit"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByProductNameActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByProductNameActionGroup.xml new file mode 100644 index 0000000000000..491817dc6391c --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByProductNameActionGroup.xml @@ -0,0 +1,23 @@ +<?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="StorefrontAdvancedCatalogSearchByProductNameActionGroup"> + <annotations> + <description>Fills the Product Name field on the Storefront 'Advanced Search' page. Clicks on the Submit button.</description> + </annotations> + <arguments> + <argument name="name" type="string"/> + </arguments> + + <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.ProductName}}" userInput="{{name}}" stepKey="fill"/> + <click selector="{{StorefrontCatalogSearchAdvancedFormSection.SubmitButton}}" stepKey="clickSubmit"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByProductNameAndDescriptionActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByProductNameAndDescriptionActionGroup.xml new file mode 100644 index 0000000000000..377098dfc372a --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByProductNameAndDescriptionActionGroup.xml @@ -0,0 +1,25 @@ +<?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="StorefrontAdvancedCatalogSearchByProductNameAndDescriptionActionGroup"> + <annotations> + <description>Fills the Product Name and Description fields on the Storefront 'Advanced Search' page. Clicks on the Submit button.</description> + </annotations> + <arguments> + <argument name="name" type="string"/> + <argument name="description" type="string"/> + </arguments> + + <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.ProductName}}" userInput="{{name}}" stepKey="fillName"/> + <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.Description}}" userInput="{{description}}" stepKey="fillDescription"/> + <click selector="{{StorefrontCatalogSearchAdvancedFormSection.SubmitButton}}" stepKey="clickSubmit"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByProductNameAndPriceActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByProductNameAndPriceActionGroup.xml new file mode 100644 index 0000000000000..89e454db95615 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByProductNameAndPriceActionGroup.xml @@ -0,0 +1,27 @@ +<?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="StorefrontAdvancedCatalogSearchByProductNameAndPriceActionGroup"> + <annotations> + <description>Fills the Product Name, Price From and Price To fields on the Storefront 'Advanced Search' page. Clicks on the Submit button.</description> + </annotations> + <arguments> + <argument name="name" type="string"/> + <argument name="priceFrom" type="string"/> + <argument name="priceTo" type="string"/> + </arguments> + + <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.ProductName}}" userInput="{{name}}" stepKey="fillName"/> + <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.PriceFrom}}" userInput="{{priceFrom}}" stepKey="fillPriceFrom"/> + <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.PriceTo}}" userInput="{{priceTo}}" stepKey="fillPriceTo"/> + <click selector="{{StorefrontCatalogSearchAdvancedFormSection.SubmitButton}}" stepKey="clickSubmit"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByProductSkuActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByProductSkuActionGroup.xml new file mode 100644 index 0000000000000..328b57e8ca080 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByProductSkuActionGroup.xml @@ -0,0 +1,23 @@ +<?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="StorefrontAdvancedCatalogSearchByProductSkuActionGroup"> + <annotations> + <description>Fills the Product SKU field on the Storefront 'Advanced Search' page. Clicks on the Submit button.</description> + </annotations> + <arguments> + <argument name="sku" type="string"/> + </arguments> + + <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.SKU}}" userInput="{{sku}}" stepKey="fill"/> + <click selector="{{StorefrontCatalogSearchAdvancedFormSection.SubmitButton}}" stepKey="clickSubmit"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByShortDescriptionActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByShortDescriptionActionGroup.xml new file mode 100644 index 0000000000000..28b2be68018f4 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByShortDescriptionActionGroup.xml @@ -0,0 +1,23 @@ +<?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="StorefrontAdvancedCatalogSearchByShortDescriptionActionGroup"> + <annotations> + <description>Fills the Product Short Description field on the Storefront 'Advanced Search' page. Clicks on the Submit button.</description> + </annotations> + <arguments> + <argument name="shortDescription" type="string"/> + </arguments> + + <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.ShortDescription}}" userInput="{{shortDescription}}" stepKey="fill"/> + <click selector="{{StorefrontCatalogSearchAdvancedFormSection.SubmitButton}}" stepKey="clickSubmit"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCatalogSearchActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCatalogSearchActionGroup.xml deleted file mode 100644 index 2022f809139ec..0000000000000 --- a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCatalogSearchActionGroup.xml +++ /dev/null @@ -1,273 +0,0 @@ -<?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"> - <!-- Quick search the phrase and check if the result page contains correct information --> - <actionGroup name="StorefrontCheckQuickSearchActionGroup"> - <annotations> - <description>Submits Form POST for the Storefront Search feature. Validates that the URL is correct. Validates that the Title is present and correct.</description> - </annotations> - <arguments> - <argument name="phrase"/> - </arguments> - - <submitForm selector="{{StorefrontQuickSearchSection.searchMiniForm}}" parameterArray="['q' => {{phrase}}]" stepKey="fillQuickSearch"/> - <seeInCurrentUrl url="{{StorefrontCatalogSearchPage.url}}" stepKey="checkUrl"/> - <dontSeeInCurrentUrl url="form_key=" stepKey="checkUrlFormKey"/> - <seeInTitle userInput="Search results for: '{{phrase}}'" stepKey="assertQuickSearchTitle"/> - <see userInput="Search results for: '{{phrase}}'" selector="{{StorefrontCatalogSearchMainSection.SearchTitle}}" stepKey="assertQuickSearchName"/> - </actionGroup> - - <!-- Quick search the phrase and check if the result page contains correct information, usable with type="string" --> - <actionGroup name="StorefrontCheckQuickSearchStringActionGroup"> - <annotations> - <description>Fill the Storefront Search field. Submits the Form. Validates that the provided Search Phrase is present and correct.</description> - </annotations> - <arguments> - <argument name="phrase" type="string"/> - </arguments> - - <fillField stepKey="fillInput" selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{phrase}}"/> - <submitForm selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" parameterArray="[]" stepKey="submitQuickSearch"/> - <seeInCurrentUrl url="{{StorefrontCatalogSearchPage.url}}" stepKey="checkUrl"/> - <dontSeeInCurrentUrl url="form_key=" stepKey="checkUrlFormKey"/> - <seeInTitle userInput="Search results for: '{{phrase}}'" stepKey="assertQuickSearchTitle"/> - <see userInput="Search results for: '{{phrase}}'" selector="{{StorefrontCatalogSearchMainSection.SearchTitle}}" stepKey="assertQuickSearchName"/> - </actionGroup> - - <actionGroup name="StorefrontQuickSearchTooShortStringActionGroup" extends="StorefrontCheckQuickSearchStringActionGroup"> - <annotations> - <description>Fill the Storefront Search field. Submits the Form. Validates that 'Minimum Search query length' warning appears.</description> - </annotations> - <arguments> - <argument name="minQueryLength" type="string"/> - </arguments> - - <see selector="{{StorefrontQuickSearchResultsSection.messageSection}}" userInput="Minimum Search query length is {{minQueryLength}}" stepKey="assertQuickSearchNeedThreeOrMoreChars"/> - </actionGroup> - - <actionGroup name="StorefrontQuickSearchRelatedSearchTermsAppearsActionGroup"> - <arguments> - <argument name="term" type="string"/> - </arguments> - - <waitForElementVisible selector="{{StorefrontCatalogSearchMainSection.relatedSearchTermsTitle}}" stepKey="waitMessageAppears"/> - <see selector="{{StorefrontCatalogSearchMainSection.relatedSearchTermsTitle}}" userInput="Related search terms" stepKey="checkRelatedTermsTitle"/> - <see selector="{{StorefrontCatalogSearchMainSection.relatedSearchTerm}}" userInput="{{term}}" stepKey="checkRelatedTermExists"/> - </actionGroup> - - <!-- Opens product from QuickSearch and performs assertions--> - <actionGroup name="StorefrontOpenProductFromQuickSearch"> - <annotations> - <description>Clicks on the provided Product Name from the Storefront Quick Search Results page.</description> - </annotations> - <arguments> - <argument name="productName" type="string"/> - <argument name="productUrlKey" type="string"/> - </arguments> - - <scrollTo selector="{{StorefrontQuickSearchResultsSection.productByName(productName)}}" stepKey="scrollToProduct"/> - <click stepKey="openProduct" selector="{{StorefrontQuickSearchResultsSection.productByName(productName)}}"/> - <waitForPageLoad stepKey="waitForProductLoad"/> - <seeInCurrentUrl url="{{productUrlKey}}" stepKey="checkUrl"/> - <see stepKey="checkName" selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{productName}}"/> - </actionGroup> - - <!-- Adds product from Quick Search page and perform assertions--> - <actionGroup name="StorefrontAddToCartFromQuickSearch"> - <annotations> - <description>Adds the provided Product Name to the Shopping Cart from the Storefront Quick Search Results page. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="productName" type="string"/> - </arguments> - - <scrollTo selector="{{StorefrontQuickSearchResultsSection.productByName(productName)}}" stepKey="scrollToProduct"/> - <moveMouseOver stepKey="hoverOverProduct" selector="{{StorefrontQuickSearchResultsSection.productByName(productName)}}"/> - <click selector="{{StorefrontQuickSearchResultsSection.productByName(productName)}} {{StorefrontQuickSearchResultsSection.addToCartBtn}}" stepKey="addToCart"/> - <waitForElementVisible selector="{{StorefrontQuickSearchResultsSection.messageSection}}" time="30" stepKey="waitForProductAdded"/> - <see selector="{{StorefrontQuickSearchResultsSection.messageSection}}" userInput="You added {{productName}} to your shopping cart." stepKey="seeAddedToCartMessage"/> - </actionGroup> - - <actionGroup name="StorefrontQuickSearchCheckProductNameInGrid"> - <annotations> - <description>Validates that the provided Product Name appears at the correct index on the Storefront Quick Search page.</description> - </annotations> - <arguments> - <argument name="productName" type="string"/> - <argument name="index" type="string"/> - </arguments> - - <see selector="{{StorefrontQuickSearchResultsSection.productByIndex(index)}}" userInput="{{productName}}" stepKey="seeProductName"/> - </actionGroup> - - <actionGroup name="StorefrontQuickSearchSeeProductByName"> - <arguments> - <argument name="productName" type="string"/> - </arguments> - <see selector="{{StorefrontQuickSearchResultsSection.productByName(productName)}}" userInput="{{productName}}" stepKey="seeProductName"/> - </actionGroup> - - <actionGroup name="StorefrontQuickSearchCheckProductNameNotInGrid"> - <annotations> - <description>Validates that the provided Product Name does NOT appear on the Storefront Quick Search page.</description> - </annotations> - <arguments> - <argument name="productName" type="string"/> - </arguments> - - <dontSee selector="{{StorefrontQuickSearchResultsSection.allResults}}" userInput="{{productName}}" stepKey="dontSeeProductName"/> - </actionGroup> - - <!-- Open advanced search page --> - <actionGroup name="StorefrontOpenAdvancedSearchActionGroup"> - <annotations> - <description>Clicks on 'Advanced Search' in the Storefront Footer. Validates that the URL and Title are present and correct.</description> - </annotations> - - <click selector="{{StorefrontFooterSection.AdvancedSearch}}" stepKey="clickAdvancedSearchLink"/> - <seeInCurrentUrl url="{{StorefrontCatalogSearchAdvancedFormPage.url}}" stepKey="checkUrl"/> - <seeInTitle userInput="Advanced Search" stepKey="assertAdvancedSearchTitle1"/> - <see userInput="Advanced Search" selector="{{StorefrontCatalogSearchAdvancedFormSection.SearchTitle}}" stepKey="assertAdvancedSearchTitle2"/> - </actionGroup> - - <!-- Check that Advanced Search result page contains correct information --> - <actionGroup name="StorefrontCheckAdvancedSearchResultActionGroup"> - <annotations> - <description>Validates that the URL and Title are present and correct on the Storefront Advanced Search Results page.</description> - </annotations> - - <seeInCurrentUrl url="{{StorefrontCatalogSearchAdvancedResultPage.url}}" stepKey="checkUrl"/> - <seeInTitle userInput="Advanced Search Results" stepKey="assertAdvancedSearchTitle"/> - <see userInput="Catalog Advanced Search" selector="{{StorefrontCatalogSearchMainSection.SearchTitle}}" stepKey="assertAdvancedSearchName"/> - </actionGroup> - - <!-- Select the category in the filter --> - <actionGroup name="StorefrontSelectSearchFilterCategoryActionGroup"> - <annotations> - <description>Clicks on Category Filter. Clicks on the provided Category.</description> - </annotations> - <arguments> - <argument name="category"/> - </arguments> - - <click selector="{{StorefrontCategoryFilterSection.CategoryFilter}}" stepKey="clickCategoryFilterTitle"/> - <scrollTo selector="{{StorefrontCategoryFilterSection.CategoryByName(category.name)}}" stepKey="scrollToClickCategoryFilter"/> - <click selector="{{StorefrontCategoryFilterSection.CategoryByName(category.name)}}" stepKey="clickCategoryFilter"/> - </actionGroup> - - <!-- Go to store's advanced catalog search page --> - <actionGroup name="GoToStoreViewAdvancedCatalogSearchActionGroup"> - <annotations> - <description>Goes to the Storefront 'Advanced Search' page.</description> - </annotations> - - <amOnPage url="{{StorefrontCatalogSearchAdvancedFormPage.url}}" stepKey="GoToStoreViewAdvancedCatalogSearchActionGroup"/> - <waitForPageLoad time="90" stepKey="waitForPageLoad"/> - </actionGroup> - - <!-- Storefront advanced catalog search by product name --> - <actionGroup name="StorefrontAdvancedCatalogSearchByProductNameActionGroup"> - <annotations> - <description>Fills the Product Name field on the Storefront 'Advanced Search' page. Clicks on the Submit button.</description> - </annotations> - <arguments> - <argument name="name" type="string"/> - </arguments> - - <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.ProductName}}" userInput="{{name}}" stepKey="fill"/> - <click selector="{{StorefrontCatalogSearchAdvancedFormSection.SubmitButton}}" stepKey="clickSubmit"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - </actionGroup> - - <!-- Storefront advanced catalog search by product sku --> - <actionGroup name="StorefrontAdvancedCatalogSearchByProductSkuActionGroup"> - <annotations> - <description>Fills the Product SKU field on the Storefront 'Advanced Search' page. Clicks on the Submit button.</description> - </annotations> - <arguments> - <argument name="sku" type="string"/> - </arguments> - - <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.SKU}}" userInput="{{sku}}" stepKey="fill"/> - <click selector="{{StorefrontCatalogSearchAdvancedFormSection.SubmitButton}}" stepKey="clickSubmit"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - </actionGroup> - - <!-- Storefront advanced catalog search by product description --> - <actionGroup name="StorefrontAdvancedCatalogSearchByDescriptionActionGroup"> - <annotations> - <description>Fills the Product Description field on the Storefront 'Advanced Search' page. Clicks on the Submit button.</description> - </annotations> - <arguments> - <argument name="description" type="string"/> - </arguments> - - <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.Description}}" userInput="{{description}}" stepKey="fill"/> - <click selector="{{StorefrontCatalogSearchAdvancedFormSection.SubmitButton}}" stepKey="clickSubmit"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - </actionGroup> - - <!-- Storefront advanced catalog search by product short description --> - <actionGroup name="StorefrontAdvancedCatalogSearchByShortDescriptionActionGroup"> - <annotations> - <description>Fills the Product Short Description field on the Storefront 'Advanced Search' page. Clicks on the Submit button.</description> - </annotations> - <arguments> - <argument name="shortDescription" type="string"/> - </arguments> - - <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.ShortDescription}}" userInput="{{shortDescription}}" stepKey="fill"/> - <click selector="{{StorefrontCatalogSearchAdvancedFormSection.SubmitButton}}" stepKey="clickSubmit"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - </actionGroup> - - <!-- Storefront advanced catalog search by product name and price --> - <actionGroup name="StorefrontAdvancedCatalogSearchByProductNameAndPriceActionGroup"> - <annotations> - <description>Fills the Product Name, Price From and Price To fields on the Storefront 'Advanced Search' page. Clicks on the Submit button.</description> - </annotations> - <arguments> - <argument name="name" type="string"/> - <argument name="priceFrom" type="string"/> - <argument name="priceTo" type="string"/> - </arguments> - - <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.ProductName}}" userInput="{{name}}" stepKey="fillName"/> - <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.PriceFrom}}" userInput="{{priceFrom}}" stepKey="fillPriceFrom"/> - <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.PriceTo}}" userInput="{{priceTo}}" stepKey="fillPriceTo"/> - <click selector="{{StorefrontCatalogSearchAdvancedFormSection.SubmitButton}}" stepKey="clickSubmit"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - </actionGroup> - - <!-- Storefront advanced catalog search by product name and description --> - <actionGroup name="StorefrontAdvancedCatalogSearchByProductNameAndDescriptionActionGroup"> - <annotations> - <description>Fills the Product Name and Description fields on the Storefront 'Advanced Search' page. Clicks on the Submit button.</description> - </annotations> - <arguments> - <argument name="name" type="string"/> - <argument name="description" type="string"/> - </arguments> - - <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.ProductName}}" userInput="{{name}}" stepKey="fillName"/> - <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.Description}}" userInput="{{description}}" stepKey="fillDescription"/> - <click selector="{{StorefrontCatalogSearchAdvancedFormSection.SubmitButton}}" stepKey="clickSubmit"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - </actionGroup> - - <!-- Asserts that search results do not contain any results--> - <actionGroup name="StorefrontCheckSearchIsEmpty"> - <annotations> - <description>Validates that the 'No Results' message is present and correct on the Storefront Search Results page. PLEASE NOTE: The expected message is Hardcoded.</description> - </annotations> - - <see stepKey="checkEmpty" selector="{{StorefrontQuickSearchResultsSection.messageSection}}" userInput="Your search returned no results"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCheckAdvancedSearchResultActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCheckAdvancedSearchResultActionGroup.xml new file mode 100644 index 0000000000000..e26405bbafbea --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCheckAdvancedSearchResultActionGroup.xml @@ -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="StorefrontCheckAdvancedSearchResultActionGroup"> + <annotations> + <description>Validates that the URL and Title are present and correct on the Storefront Advanced Search Results page.</description> + </annotations> + + <seeInCurrentUrl url="{{StorefrontCatalogSearchAdvancedResultPage.url}}" stepKey="checkUrl"/> + <seeInTitle userInput="Advanced Search Results" stepKey="assertAdvancedSearchTitle"/> + <see userInput="Catalog Advanced Search" selector="{{StorefrontCatalogSearchMainSection.SearchTitle}}" stepKey="assertAdvancedSearchName"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCheckQuickSearchActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCheckQuickSearchActionGroup.xml new file mode 100644 index 0000000000000..4d97c2d37e7a1 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCheckQuickSearchActionGroup.xml @@ -0,0 +1,26 @@ +<?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"> + <!-- Quick search the phrase and check if the result page contains correct information --> + <actionGroup name="StorefrontCheckQuickSearchActionGroup"> + <annotations> + <description>Submits Form POST for the Storefront Search feature. Validates that the URL is correct. Validates that the Title is present and correct.</description> + </annotations> + <arguments> + <argument name="phrase"/> + </arguments> + + <submitForm selector="{{StorefrontQuickSearchSection.searchMiniForm}}" parameterArray="['q' => {{phrase}}]" stepKey="fillQuickSearch"/> + <seeInCurrentUrl url="{{StorefrontCatalogSearchPage.url}}" stepKey="checkUrl"/> + <dontSeeInCurrentUrl url="form_key=" stepKey="checkUrlFormKey"/> + <seeInTitle userInput="Search results for: '{{phrase}}'" stepKey="assertQuickSearchTitle"/> + <see userInput="Search results for: '{{phrase}}'" selector="{{StorefrontCatalogSearchMainSection.SearchTitle}}" stepKey="assertQuickSearchName"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCheckQuickSearchStringActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCheckQuickSearchStringActionGroup.xml new file mode 100644 index 0000000000000..097a02a81679d --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCheckQuickSearchStringActionGroup.xml @@ -0,0 +1,26 @@ +<?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="StorefrontCheckQuickSearchStringActionGroup"> + <annotations> + <description>Fill the Storefront Search field. Submits the Form. Validates that the provided Search Phrase is present and correct.</description> + </annotations> + <arguments> + <argument name="phrase" type="string"/> + </arguments> + + <fillField stepKey="fillInput" selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{phrase}}"/> + <submitForm selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" parameterArray="[]" stepKey="submitQuickSearch"/> + <seeInCurrentUrl url="{{StorefrontCatalogSearchPage.url}}" stepKey="checkUrl"/> + <dontSeeInCurrentUrl url="form_key=" stepKey="checkUrlFormKey"/> + <seeInTitle userInput="Search results for: '{{phrase}}'" stepKey="assertQuickSearchTitle"/> + <see userInput="Search results for: '{{phrase}}'" selector="{{StorefrontCatalogSearchMainSection.SearchTitle}}" stepKey="assertQuickSearchName"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCheckSearchIsEmptyActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCheckSearchIsEmptyActionGroup.xml new file mode 100644 index 0000000000000..c1df5d029d284 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCheckSearchIsEmptyActionGroup.xml @@ -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="StorefrontCheckSearchIsEmptyActionGroup"> + <annotations> + <description>Validates that the 'No Results' message is present and correct on the Storefront Search Results page. PLEASE NOTE: The expected message is Hardcoded.</description> + </annotations> + + <see stepKey="checkEmpty" selector="{{StorefrontQuickSearchResultsSection.messageSection}}" userInput="Your search returned no results"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontOpenAdvancedSearchActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontOpenAdvancedSearchActionGroup.xml new file mode 100644 index 0000000000000..84e4cb29b884d --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontOpenAdvancedSearchActionGroup.xml @@ -0,0 +1,21 @@ +<?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="StorefrontOpenAdvancedSearchActionGroup"> + <annotations> + <description>Clicks on 'Advanced Search' in the Storefront Footer. Validates that the URL and Title are present and correct.</description> + </annotations> + + <click selector="{{StorefrontFooterSection.AdvancedSearch}}" stepKey="clickAdvancedSearchLink"/> + <seeInCurrentUrl url="{{StorefrontCatalogSearchAdvancedFormPage.url}}" stepKey="checkUrl"/> + <seeInTitle userInput="Advanced Search" stepKey="assertAdvancedSearchTitle1"/> + <see userInput="Advanced Search" selector="{{StorefrontCatalogSearchAdvancedFormSection.SearchTitle}}" stepKey="assertAdvancedSearchTitle2"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontOpenProductFromQuickSearchActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontOpenProductFromQuickSearchActionGroup.xml new file mode 100644 index 0000000000000..348c5dabc65e0 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontOpenProductFromQuickSearchActionGroup.xml @@ -0,0 +1,26 @@ +<?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="StorefrontOpenProductFromQuickSearchActionGroup"> + <annotations> + <description>Clicks on the provided Product Name from the Storefront Quick Search Results page.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + <argument name="productUrlKey" type="string"/> + </arguments> + + <scrollTo selector="{{StorefrontQuickSearchResultsSection.productByName(productName)}}" stepKey="scrollToProduct"/> + <click stepKey="openProduct" selector="{{StorefrontQuickSearchResultsSection.productByName(productName)}}"/> + <waitForPageLoad stepKey="waitForProductLoad"/> + <seeInCurrentUrl url="{{productUrlKey}}" stepKey="checkUrl"/> + <see stepKey="checkName" selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{productName}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchCheckProductNameInGridActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchCheckProductNameInGridActionGroup.xml new file mode 100644 index 0000000000000..4f68d9b004c79 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchCheckProductNameInGridActionGroup.xml @@ -0,0 +1,22 @@ +<?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="StorefrontQuickSearchCheckProductNameInGridActionGroup"> + <annotations> + <description>Validates that the provided Product Name appears at the correct index on the Storefront Quick Search page.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + <argument name="index" type="string"/> + </arguments> + + <see selector="{{StorefrontQuickSearchResultsSection.productByIndex(index)}}" userInput="{{productName}}" stepKey="seeProductName"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchCheckProductNameNotInGridActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchCheckProductNameNotInGridActionGroup.xml new file mode 100644 index 0000000000000..493b266e2c368 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchCheckProductNameNotInGridActionGroup.xml @@ -0,0 +1,21 @@ +<?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="StorefrontQuickSearchCheckProductNameNotInGridActionGroup"> + <annotations> + <description>Validates that the provided Product Name does NOT appear on the Storefront Quick Search page.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + </arguments> + + <dontSee selector="{{StorefrontQuickSearchResultsSection.allResults}}" userInput="{{productName}}" stepKey="dontSeeProductName"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchRelatedSearchTermsAppearsActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchRelatedSearchTermsAppearsActionGroup.xml new file mode 100644 index 0000000000000..00a4f3e5d3917 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchRelatedSearchTermsAppearsActionGroup.xml @@ -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="StorefrontQuickSearchRelatedSearchTermsAppearsActionGroup"> + <arguments> + <argument name="term" type="string"/> + </arguments> + + <waitForElementVisible selector="{{StorefrontCatalogSearchMainSection.relatedSearchTermsTitle}}" stepKey="waitMessageAppears"/> + <see selector="{{StorefrontCatalogSearchMainSection.relatedSearchTermsTitle}}" userInput="Related search terms" stepKey="checkRelatedTermsTitle"/> + <see selector="{{StorefrontCatalogSearchMainSection.relatedSearchTerm}}" userInput="{{term}}" stepKey="checkRelatedTermExists"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchSeeProductByNameActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchSeeProductByNameActionGroup.xml new file mode 100644 index 0000000000000..a900dfce9c1fa --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchSeeProductByNameActionGroup.xml @@ -0,0 +1,17 @@ +<?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="StorefrontQuickSearchSeeProductByNameActionGroup"> + <arguments> + <argument name="productName" type="string"/> + </arguments> + <see selector="{{StorefrontQuickSearchResultsSection.productByName(productName)}}" userInput="{{productName}}" stepKey="seeProductName"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchTooShortStringActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchTooShortStringActionGroup.xml new file mode 100644 index 0000000000000..58ef412410c74 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchTooShortStringActionGroup.xml @@ -0,0 +1,21 @@ +<?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="StorefrontQuickSearchTooShortStringActionGroup" extends="StorefrontCheckQuickSearchStringActionGroup"> + <annotations> + <description>Fill the Storefront Search field. Submits the Form. Validates that 'Minimum Search query length' warning appears.</description> + </annotations> + <arguments> + <argument name="minQueryLength" type="string"/> + </arguments> + + <see selector="{{StorefrontQuickSearchResultsSection.messageSection}}" userInput="Minimum Search query length is {{minQueryLength}}" stepKey="assertQuickSearchNeedThreeOrMoreChars"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontSelectSearchFilterCategoryActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontSelectSearchFilterCategoryActionGroup.xml new file mode 100644 index 0000000000000..3048217f5dfda --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontSelectSearchFilterCategoryActionGroup.xml @@ -0,0 +1,23 @@ +<?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="StorefrontSelectSearchFilterCategoryActionGroup"> + <annotations> + <description>Clicks on Category Filter. Clicks on the provided Category.</description> + </annotations> + <arguments> + <argument name="category"/> + </arguments> + + <click selector="{{StorefrontCategoryFilterSection.CategoryFilter}}" stepKey="clickCategoryFilterTitle"/> + <scrollTo selector="{{StorefrontCategoryFilterSection.CategoryByName(category.name)}}" stepKey="scrollToClickCategoryFilter"/> + <click selector="{{StorefrontCategoryFilterSection.CategoryByName(category.name)}}" stepKey="clickCategoryFilter"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminCreateSearchTermEntityTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminCreateSearchTermEntityTest.xml index 2b425f34f8a5b..86a1d4321cba0 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminCreateSearchTermEntityTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminCreateSearchTermEntityTest.xml @@ -27,7 +27,7 @@ </before> <after> <!-- Delete created search term --> - <actionGroup ref="AssertSearchTermSuccessDeleteMessage" stepKey="deleteSearchTerm"> + <actionGroup ref="AssertSearchTermSuccessDeleteMessageActionGroup" stepKey="deleteSearchTerm"> <argument name="searchQuery" value="$$createSimpleProduct.sku$$"/> </actionGroup> @@ -39,7 +39,7 @@ </after> <!-- Go to the search terms page and create new search term --> - <actionGroup ref="AssertSearchTermSaveSuccessMessage" stepKey="createNewSearchTerm"> + <actionGroup ref="AssertSearchTermSaveSuccessMessageActionGroup" stepKey="createNewSearchTerm"> <argument name="searchQuery" value="$$createSimpleProduct.sku$$"/> <argument name="storeValue" value="{{SimpleTerm.store_id}}"/> <argument name="redirectUrl" value="{{SimpleTerm.redirect}}"/> @@ -51,7 +51,7 @@ <waitForPageLoad stepKey="waitForPageLoad"/> <!-- Assert created search term on storefront --> - <actionGroup ref="AssertSearchTermOnFrontend" stepKey="assertCreatedSearchTermOnFrontend"> + <actionGroup ref="AssertSearchTermOnFrontendActionGroup" stepKey="assertCreatedSearchTermOnFrontend"> <argument name="searchQuery" value="$$createSimpleProduct.sku$$"/> <argument name="redirectUrl" value="{{SimpleTerm.redirect}}"/> </actionGroup> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminDeleteSearchTermTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminDeleteSearchTermTest.xml index c72ed424ef307..b449d92d8e003 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminDeleteSearchTermTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminDeleteSearchTermTest.xml @@ -33,7 +33,7 @@ </after> <!--Add new search term--> - <actionGroup ref="AssertSearchTermSaveSuccessMessage" stepKey="addNewSearchTerm"> + <actionGroup ref="AssertSearchTermSaveSuccessMessageActionGroup" stepKey="addNewSearchTerm"> <argument name="searchQuery" value="{{SimpleTerm.search_query}}"/> <argument name="storeValue" value="{{SimpleTerm.store_id}}"/> <argument name="redirectUrl" value="{{SimpleTerm.redirect}}"/> @@ -41,19 +41,19 @@ </actionGroup> <!--Search and delete search term and AssertSearchTermSuccessDeleteMessage--> - <actionGroup ref="AssertSearchTermSuccessDeleteMessage" stepKey="deleteSearchTerm"> + <actionGroup ref="AssertSearchTermSuccessDeleteMessageActionGroup" stepKey="deleteSearchTerm"> <argument name="searchQuery" value="{{SimpleTerm.search_query}}"/> </actionGroup> <!--Verify deleted search term in grid and AssertSearchTermNotInGrid--> - <actionGroup ref="AssertSearchTermNotInGrid" stepKey="verifyDeletedSearchTermNotInGrid"> + <actionGroup ref="AssertSearchTermNotInGridActionGroup" stepKey="verifyDeletedSearchTermNotInGrid"> <argument name="searchQuery" value="{{SimpleTerm.search_query}}"/> </actionGroup> <!--Go to storefront and Verify AssertSearchTermNotOnFrontend--> - <actionGroup ref="AssertSearchTermNotOnFrontend" stepKey="verifySearchTermNotOnFrontend"> + <actionGroup ref="AssertSearchTermNotOnFrontendActionGroup" stepKey="verifySearchTermNotOnFrontend"> <argument name="searchQuery" value="{{SimpleTerm.search_query}}"/> <argument name="url_key" value="$$simpleProduct.custom_attributes[url_key]$$"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml index 3b60e4b09de28..02738c118dcc9 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml @@ -36,7 +36,7 @@ <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchStorefront"> <argument name="phrase" value="$createSimpleProduct.sku$"/> </actionGroup> - <actionGroup ref="StorefrontOpenProductFromQuickSearch" stepKey="openAndCheckProduct"> + <actionGroup ref="StorefrontOpenProductFromQuickSearchActionGroup" stepKey="openAndCheckProduct"> <argument name="productName" value="$createSimpleProduct.name$"/> <argument name="productUrlKey" value="$createSimpleProduct.custom_attributes[url_key]$"/> </actionGroup> @@ -106,7 +106,7 @@ <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchStorefront"> <argument name="phrase" value="ThisShouldn'tReturnAnything"/> </actionGroup> - <actionGroup ref="StorefrontCheckSearchIsEmpty" stepKey="checkEmpty"/> + <actionGroup ref="StorefrontCheckSearchIsEmptyActionGroup" stepKey="checkEmpty"/> </test> <test name="QuickSearchWithTwoCharsEmptyResults" extends="QuickSearchEmptyResults"> @@ -254,11 +254,11 @@ <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchStorefront"> <argument name="phrase" value="{{_defaultProduct.name}}"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchCheckProductNameInGrid" stepKey="assertProduct1Position"> + <actionGroup ref="StorefrontQuickSearchCheckProductNameInGridActionGroup" stepKey="assertProduct1Position"> <argument name="productName" value="$product1.name$"/> <argument name="index" value="2"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchCheckProductNameInGrid" stepKey="assertProduct2Position"> + <actionGroup ref="StorefrontQuickSearchCheckProductNameInGridActionGroup" stepKey="assertProduct2Position"> <argument name="productName" value="$product2.name$"/> <argument name="index" value="1"/> </actionGroup> @@ -283,11 +283,11 @@ <argument name="defaultValue" value="{{_defaultProduct.name}}"/> </actionGroup> </before> - <actionGroup ref="StorefrontQuickSearchCheckProductNameInGrid" stepKey="assertProduct1Position"> + <actionGroup ref="StorefrontQuickSearchCheckProductNameInGridActionGroup" stepKey="assertProduct1Position"> <argument name="productName" value="$product1.name$"/> <argument name="index" value="1"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchCheckProductNameInGrid" stepKey="assertProduct2Position"> + <actionGroup ref="StorefrontQuickSearchCheckProductNameInGridActionGroup" stepKey="assertProduct2Position"> <argument name="productName" value="$product2.name$"/> <argument name="index" value="2"/> </actionGroup> @@ -317,7 +317,7 @@ <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchStorefront"> <argument name="phrase" value="$createSimpleProduct.name$"/> </actionGroup> - <actionGroup ref="StorefrontAddToCartFromQuickSearch" stepKey="addProductToCart"> + <actionGroup ref="StorefrontAddToCartFromQuickSearchActionGroup" stepKey="addProductToCart"> <argument name="productName" value="$createSimpleProduct.name$"/> </actionGroup> </test> @@ -349,7 +349,7 @@ <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchStorefront"> <argument name="phrase" value="$createVirtualProduct.name$"/> </actionGroup> - <actionGroup ref="StorefrontAddToCartFromQuickSearch" stepKey="addProductToCart"> + <actionGroup ref="StorefrontAddToCartFromQuickSearchActionGroup" stepKey="addProductToCart"> <argument name="productName" value="$createVirtualProduct.name$"/> </actionGroup> </test> @@ -387,7 +387,7 @@ <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchStorefront"> <argument name="phrase" value="{{_defaultProduct.name}}"/> </actionGroup> - <actionGroup ref="StorefrontOpenProductFromQuickSearch" stepKey="openAndCheckProduct"> + <actionGroup ref="StorefrontOpenProductFromQuickSearchActionGroup" stepKey="openAndCheckProduct"> <argument name="productName" value="{{_defaultProduct.name}}"/> <argument name="productUrlKey" value="{{_defaultProduct.urlKey}}"/> </actionGroup> @@ -430,7 +430,7 @@ <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchStorefront"> <argument name="phrase" value="$createProduct.name$"/> </actionGroup> - <actionGroup ref="StorefrontAddToCartFromQuickSearch" stepKey="addProductToCart"> + <actionGroup ref="StorefrontAddToCartFromQuickSearchActionGroup" stepKey="addProductToCart"> <argument name="productName" value="$createProduct.name$"/> </actionGroup> </test> @@ -467,7 +467,7 @@ <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchStorefront"> <argument name="phrase" value=""$createProduct.name$""/> </actionGroup> - <actionGroup ref="StorefrontAddToCartFromQuickSearch" stepKey="addProductToCart"> + <actionGroup ref="StorefrontAddToCartFromQuickSearchActionGroup" stepKey="addProductToCart"> <argument name="productName" value="$createProduct.name$"/> </actionGroup> </test> @@ -519,7 +519,7 @@ <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchStorefront"> <argument name="phrase" value="$createBundleProduct.name$"/> </actionGroup> - <actionGroup ref="StorefrontOpenProductFromQuickSearch" stepKey="openAndCheckProduct"> + <actionGroup ref="StorefrontOpenProductFromQuickSearchActionGroup" stepKey="openAndCheckProduct"> <argument name="productName" value="$createBundleProduct.name$"/> <argument name="productUrlKey" value="$createBundleProduct.custom_attributes[url_key]$"/> </actionGroup> @@ -589,7 +589,7 @@ <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchStorefront"> <argument name="phrase" value="$createBundleProduct.name$"/> </actionGroup> - <actionGroup ref="StorefrontOpenProductFromQuickSearch" stepKey="openAndCheckProduct"> + <actionGroup ref="StorefrontOpenProductFromQuickSearchActionGroup" stepKey="openAndCheckProduct"> <argument name="productName" value="$createBundleProduct.name$"/> <argument name="productUrlKey" value="$createBundleProduct.custom_attributes[url_key]$"/> </actionGroup> @@ -676,7 +676,7 @@ <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchStorefront"> <argument name="phrase" value="$createConfigProduct.name$"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchCheckProductNameInGrid" stepKey="seeProductInGrid"> + <actionGroup ref="StorefrontQuickSearchCheckProductNameInGridActionGroup" stepKey="seeProductInGrid"> <argument name="productName" value="$createConfigProduct.name$"/> <argument name="index" value="1"/> </actionGroup> @@ -692,7 +692,7 @@ <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchStorefrontAgain"> <argument name="phrase" value="$createConfigProduct.name$"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="dontSeeProductAnymore"> + <actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGridActionGroup" stepKey="dontSeeProductAnymore"> <argument name="productName" value="$createConfigProduct.name$"/> </actionGroup> </test> diff --git a/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearch6SearchInvalidValueTest.xml b/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearch6SearchInvalidValueTest.xml index a144a4849db60..0417d1eee1ae2 100644 --- a/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearch6SearchInvalidValueTest.xml +++ b/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearch6SearchInvalidValueTest.xml @@ -92,7 +92,7 @@ <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchForSecondSearchTerm"> <argument name="phrase" value="?;"/> </actionGroup> - <actionGroup ref="StorefrontCheckSearchIsEmpty" stepKey="checkEmptyForSecondSearchTerm"/> + <actionGroup ref="StorefrontCheckSearchIsEmptyActionGroup" stepKey="checkEmptyForSecondSearchTerm"/> <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchProductForWithSpecialSymbols"> <argument name="phrase" value="?{{ProductWithSpecialSymbols.name}};"/> </actionGroup> @@ -104,10 +104,10 @@ <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchForThirdSearchTerm"> <argument name="phrase" value="?anythingcangobetween;"/> </actionGroup> - <actionGroup ref="StorefrontCheckSearchIsEmpty" stepKey="checkEmptyForThirdSearchTerm"/> + <actionGroup ref="StorefrontCheckSearchIsEmptyActionGroup" stepKey="checkEmptyForThirdSearchTerm"/> <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchForForthSearchTerm"> <argument name="phrase" value="? anything at all ;"/> </actionGroup> - <actionGroup ref="StorefrontCheckSearchIsEmpty" stepKey="checkEmptyForForthSearchTerm"/> + <actionGroup ref="StorefrontCheckSearchIsEmptyActionGroup" stepKey="checkEmptyForForthSearchTerm"/> </test> </tests> diff --git a/app/code/Magento/Search/Test/Mftf/Test/AdminMassDeleteSearchTermEntityTest.xml b/app/code/Magento/Search/Test/Mftf/Test/AdminMassDeleteSearchTermEntityTest.xml index 67ccb51bf401e..57f34b41a967f 100644 --- a/app/code/Magento/Search/Test/Mftf/Test/AdminMassDeleteSearchTermEntityTest.xml +++ b/app/code/Magento/Search/Test/Mftf/Test/AdminMassDeleteSearchTermEntityTest.xml @@ -52,13 +52,13 @@ <actionGroup ref="deleteSearchTerm" stepKey="deleteSearchTerms"/> <!-- Assert search terms are absent on the search term page --> - <actionGroup ref="AssertSearchTermNotInGrid" stepKey="assertFirstSearchTermNotInGrid"> + <actionGroup ref="AssertSearchTermNotInGridActionGroup" stepKey="assertFirstSearchTermNotInGrid"> <argument name="searchQuery" value="$$createFirstSearchTerm.query_text$$"/> </actionGroup> - <actionGroup ref="AssertSearchTermNotInGrid" stepKey="assertSecondSearchTermNotInGrid"> + <actionGroup ref="AssertSearchTermNotInGridActionGroup" stepKey="assertSecondSearchTermNotInGrid"> <argument name="searchQuery" value="$$createSecondSearchTerm.query_text$$"/> </actionGroup> - <actionGroup ref="AssertSearchTermNotInGrid" stepKey="assertThirdSearchTermNotInGrid"> + <actionGroup ref="AssertSearchTermNotInGridActionGroup" stepKey="assertThirdSearchTermNotInGrid"> <argument name="searchQuery" value="$$createThirdSearchTerm.query_text$$"/> </actionGroup> @@ -70,14 +70,14 @@ <actionGroup ref="StorefrontCheckQuickSearchActionGroup" stepKey="quickSearchForFirstSearchTerm"> <argument name="phrase" value="$$createFirstSearchTerm.query_text$$"/> </actionGroup> - <actionGroup ref="StorefrontCheckSearchIsEmpty" stepKey="checkEmptyForFirstSearchTerm"/> + <actionGroup ref="StorefrontCheckSearchIsEmptyActionGroup" stepKey="checkEmptyForFirstSearchTerm"/> <actionGroup ref="StorefrontCheckQuickSearchActionGroup" stepKey="quickSearchForSecondSearchTerm"> <argument name="phrase" value="$$createSecondSearchTerm.query_text$$"/> </actionGroup> - <actionGroup ref="StorefrontCheckSearchIsEmpty" stepKey="checkEmptyForSecondSearchTerm"/> + <actionGroup ref="StorefrontCheckSearchIsEmptyActionGroup" stepKey="checkEmptyForSecondSearchTerm"/> <actionGroup ref="StorefrontCheckQuickSearchActionGroup" stepKey="quickSearchForThirdSearchTerm"> <argument name="phrase" value="$$createThirdSearchTerm.query_text$$"/> </actionGroup> - <actionGroup ref="StorefrontCheckSearchIsEmpty" stepKey="checkEmptyForThirdSearchTerm"/> + <actionGroup ref="StorefrontCheckSearchIsEmptyActionGroup" stepKey="checkEmptyForThirdSearchTerm"/> </test> </tests> From 26fc7c187010101ba1367f640c929ac7a1ee3550 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Fri, 29 Nov 2019 13:06:37 +0100 Subject: [PATCH 144/586] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- ...talogPriceRuleWithConditionActionGroup.xml | 28 +++ ...ipleWebsiteCatalogPriceRuleActionGroup.xml | 15 ++ ...minFillCatalogRuleConditionActionGroup.xml | 35 +++ .../ApplyCatalogPriceRulesActionGroup.xml | 21 ++ .../CatalogPriceRuleActionGroup.xml | 214 +----------------- .../CreateCatalogPriceRuleActionGroup.xml | 29 +++ ...eRuleConditionWithAttributeActionGroup.xml | 31 +++ ...ateCatalogPriceRuleViaTheUiActionGroup.xml | 30 +++ ...ByUIWithConditionIsCategoryActionGroup.xml | 28 +++ ...eRuleByUIWithConditionIsSKUActionGroup.xml | 28 +++ ...logPriceRuleWithInvalidDataActionGroup.xml | 29 +++ .../OpenCatalogPriceRuleActionGroup.xml | 22 ++ .../RemoveCatalogPriceRuleActionGroup.xml | 18 ++ .../SelectGeneralCustomerGroupActionGroup.xml | 18 ++ ...ectNotLoggedInCustomerGroupActionGroup.xml | 18 ++ ...nfigurableProductWithSpecialPricesTest.xml | 4 +- .../Test/AdminCreateCatalogPriceRuleTest.xml | 12 +- .../AdminDeleteCatalogPriceRuleEntityTest.xml | 4 +- .../Test/AdminDeleteCatalogPriceRuleTest.xml | 2 +- ...tributeIsUndefinedCatalogPriceRuleTest.xml | 12 +- ...uleForSimpleAndConfigurableProductTest.xml | 4 +- ...RuleForSimpleProductAndFixedMethodTest.xml | 8 +- ...orSimpleProductForNewCustomerGroupTest.xml | 2 +- ...eForSimpleProductWithCustomOptionsTest.xml | 4 +- ...hipArePersistedUnderLongTermCookieTest.xml | 4 +- .../StorefrontInactiveCatalogRuleTest.xml | 2 +- ...eProductWithAssignedSimpleProductsTest.xml | 2 +- ...eForConfigurableProductWithOptionsTest.xml | 6 +- ...ConfigurableWithCatalogRuleAppliedTest.xml | 2 +- 29 files changed, 385 insertions(+), 247 deletions(-) create mode 100644 app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminCreateCatalogPriceRuleWithConditionActionGroup.xml create mode 100644 app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminCreateMultipleWebsiteCatalogPriceRuleActionGroup.xml create mode 100644 app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminFillCatalogRuleConditionActionGroup.xml create mode 100644 app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/ApplyCatalogPriceRulesActionGroup.xml create mode 100644 app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CreateCatalogPriceRuleActionGroup.xml create mode 100644 app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CreateCatalogPriceRuleConditionWithAttributeActionGroup.xml create mode 100644 app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CreateCatalogPriceRuleViaTheUiActionGroup.xml create mode 100644 app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/NewCatalogPriceRuleByUIWithConditionIsCategoryActionGroup.xml create mode 100644 app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/NewCatalogPriceRuleByUIWithConditionIsSKUActionGroup.xml create mode 100644 app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/NewCatalogPriceRuleWithInvalidDataActionGroup.xml create mode 100644 app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/OpenCatalogPriceRuleActionGroup.xml create mode 100644 app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/RemoveCatalogPriceRuleActionGroup.xml create mode 100644 app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/SelectGeneralCustomerGroupActionGroup.xml create mode 100644 app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/SelectNotLoggedInCustomerGroupActionGroup.xml diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminCreateCatalogPriceRuleWithConditionActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminCreateCatalogPriceRuleWithConditionActionGroup.xml new file mode 100644 index 0000000000000..eebc1175f1894 --- /dev/null +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminCreateCatalogPriceRuleWithConditionActionGroup.xml @@ -0,0 +1,28 @@ +<?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="AdminCreateCatalogPriceRuleWithConditionActionGroup" extends="CreateCatalogPriceRuleActionGroup"> + <arguments> + <argument name="catalogRuleType" type="entity" defaultValue="PriceRuleWithCondition"/> + </arguments> + <waitForPageLoad stepKey="waitForPageLoad" after="addNewRule"/> + <click selector="{{AdminNewCatalogPriceRule.conditionsTab}}" stepKey="expandConditions" before="openActionDropdown"/> + <scrollTo selector="{{AdminNewCatalogPriceRule.conditionsTab}}" stepKey="scrollToConditionsTab" after="expandConditions"/> + <waitForElementVisible selector="{{PriceRuleConditionsSection.createNewRule}}" stepKey="waitForNewRule" after="scrollToConditionsTab"/> + <click selector="{{PriceRuleConditionsSection.createNewRule}}" stepKey="clickNewRule" after="waitForNewRule"/> + <selectOption selector="{{AdminNewCatalogPriceRuleConditions.conditionsDropdown}}" userInput="{{ProductAttributeFrontendLabel.label}}" stepKey="selectProductAttribute" after="clickNewRule"/> + <waitForPageLoad stepKey="waitForAttributeLoad" after="selectProductAttribute"/> + <!--Assert that attribute contains today date without time--> + <comment userInput="Assert that attribute contains today date without time" stepKey="assertDate" after="waitForAttributeLoad"/> + <generateDate date="now" format="Y-m-d" stepKey="today" after="assertDate"/> + <grabTextFrom selector="{{PriceRuleConditionsSection.firstProductAttributeSelected}}" stepKey="grabTextFromSelectedAttribute" after="today"/> + <assertEquals expected="$today" actual="$grabTextFromSelectedAttribute" stepKey="assertTodayDate" after="grabTextFromSelectedAttribute"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminCreateMultipleWebsiteCatalogPriceRuleActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminCreateMultipleWebsiteCatalogPriceRuleActionGroup.xml new file mode 100644 index 0000000000000..06887a6aaba96 --- /dev/null +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminCreateMultipleWebsiteCatalogPriceRuleActionGroup.xml @@ -0,0 +1,15 @@ +<?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="AdminCreateMultipleWebsiteCatalogPriceRuleActionGroup" extends="CreateCatalogPriceRuleActionGroup"> + <remove keyForRemoval="selectSite"/> + <selectOption selector="{{AdminNewCatalogPriceRule.websites}}" parameterArray="['FirstWebsite', 'SecondWebsite']" stepKey="selectWebsite"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminFillCatalogRuleConditionActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminFillCatalogRuleConditionActionGroup.xml new file mode 100644 index 0000000000000..fd173acfa434c --- /dev/null +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminFillCatalogRuleConditionActionGroup.xml @@ -0,0 +1,35 @@ +<?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="AdminFillCatalogRuleConditionActionGroup"> + <annotations> + <description>Clicks on the Conditions tab. Fills in the provided condition for Catalog Price Rule.</description> + </annotations> + <arguments> + <argument name="condition" type="string" defaultValue="{{CatalogRuleProductConditions.categoryIds}}"/> + <argument name="conditionOperator" type="string" defaultValue="is"/> + <argument name="conditionValue" type="string" defaultValue="2"/> + </arguments> + + <conditionalClick selector="{{AdminNewCatalogPriceRule.conditionsTab}}" dependentSelector="{{AdminNewCatalogPriceRuleConditions.newCondition}}" visible="false" stepKey="openConditionsTab"/> + <waitForElementVisible selector="{{AdminNewCatalogPriceRuleConditions.newCondition}}" stepKey="waitForAddConditionButton"/> + <click selector="{{AdminNewCatalogPriceRuleConditions.newCondition}}" stepKey="addNewCondition"/> + <selectOption selector="{{AdminNewCatalogPriceRuleConditions.conditionSelect('1')}}" userInput="{{condition}}" stepKey="selectTypeCondition"/> + <click selector="{{AdminNewCatalogPriceRuleConditions.condition('is')}}" stepKey="clickOnOperator"/> + <selectOption selector="{{AdminNewCatalogPriceRuleConditions.activeOperatorSelect}}" userInput="{{conditionOperator}}" stepKey="selectCondition"/> + <!-- In case we are choosing already selected value - select is not closed automatically --> + <conditionalClick selector="{{AdminNewCatalogPriceRuleConditions.condition('...')}}" dependentSelector="{{AdminNewCatalogPriceRuleConditions.activeOperatorSelect}}" visible="true" stepKey="closeSelect"/> + <click selector="{{AdminNewCatalogPriceRuleConditions.condition('...')}}" stepKey="clickToChooseOption3"/> + <waitForElementVisible selector="{{AdminNewCatalogPriceRuleConditions.activeValueInput}}" stepKey="waitForValueInput"/> + <fillField selector="{{AdminNewCatalogPriceRuleConditions.activeValueInput}}" userInput="{{conditionValue}}" stepKey="fillConditionValue"/> + <click selector="{{AdminNewCatalogPriceRuleConditions.activeConditionApplyButton}}" stepKey="clickApply"/> + <waitForElementNotVisible selector="{{AdminNewCatalogPriceRuleConditions.activeConditionApplyButton}}" stepKey="waitForApplyButtonInvisibility"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/ApplyCatalogPriceRulesActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/ApplyCatalogPriceRulesActionGroup.xml new file mode 100644 index 0000000000000..0b74558599fbd --- /dev/null +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/ApplyCatalogPriceRulesActionGroup.xml @@ -0,0 +1,21 @@ +<?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="ApplyCatalogPriceRulesActionGroup"> + <annotations> + <description>Goes to the Catalog Price Rule grid page. Clicks on Apply Rules. Validates that the Success Message is present and correct.</description> + </annotations> + + <amOnPage stepKey="goToPriceRulePage" url="{{CatalogRulePage.url}}"/> + <waitForPageLoad stepKey="waitForPriceRulePage"/> + <click stepKey="applyRules" selector="{{AdminCatalogPriceRuleGrid.applyRules}}"/> + <see stepKey="assertSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="Updated rules applied."/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CatalogPriceRuleActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CatalogPriceRuleActionGroup.xml index 50b4165a3f34b..e0d02a280bf6c 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CatalogPriceRuleActionGroup.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CatalogPriceRuleActionGroup.xml @@ -9,7 +9,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <!-- action group to create a new catalog price rule giving a catalogRule entity --> - <actionGroup name="newCatalogPriceRuleByUI"> + <actionGroup name="NewCatalogPriceRuleByUIActionGroup"> <annotations> <description>Goes to the Catalog Price Rule grid. Clicks on Add. Fills in the provided Catalog Rule details.</description> </annotations> @@ -40,216 +40,4 @@ <scrollToTopOfPage stepKey="scrollToTop"/> <waitForPageLoad stepKey="waitForApplied"/> </actionGroup> - - <actionGroup name="createCatalogPriceRule"> - <annotations> - <description>Clicks on the Add button. Fills Rule Name, Description, Website and Discount Value.</description> - </annotations> - <arguments> - <argument name="catalogRule" defaultValue="_defaultCatalogRule"/> - </arguments> - <click stepKey="addNewRule" selector="{{AdminGridMainControls.add}}"/> - <fillField selector="{{AdminNewCatalogPriceRule.ruleName}}" userInput="{{catalogRule.name}}" stepKey="fillName" /> - <click stepKey="selectActive" selector="{{AdminCategoryBasicFieldSection.enableCategoryLabel}}"/> - <fillField selector="{{AdminNewCatalogPriceRule.description}}" userInput="{{catalogRule.description}}" stepKey="fillDescription" /> - <selectOption selector="{{AdminNewCatalogPriceRule.websites}}" parameterArray="{{catalogRule.website_ids}}" stepKey="selectSite" /> - <click stepKey="openActionDropdown" selector="{{AdminNewCatalogPriceRule.actionsTab}}"/> - <fillField stepKey="fillDiscountValue" selector="{{AdminNewCatalogPriceRuleActions.discountAmount}}" userInput="{{catalogRule.discount_amount}}"/> - <scrollToTopOfPage stepKey="scrollToTop"/> - <click selector="{{AdminNewCatalogPriceRule.save}}" stepKey="clickSave"/> - <waitForPageLoad stepKey="waitForApplied"/> - </actionGroup> - - <actionGroup name="AdminCreateCatalogPriceRuleWithConditionActionGroup" extends="createCatalogPriceRule"> - <arguments> - <argument name="catalogRuleType" type="entity" defaultValue="PriceRuleWithCondition"/> - </arguments> - <waitForPageLoad stepKey="waitForPageLoad" after="addNewRule"/> - <click selector="{{AdminNewCatalogPriceRule.conditionsTab}}" stepKey="expandConditions" before="openActionDropdown"/> - <scrollTo selector="{{AdminNewCatalogPriceRule.conditionsTab}}" stepKey="scrollToConditionsTab" after="expandConditions"/> - <waitForElementVisible selector="{{PriceRuleConditionsSection.createNewRule}}" stepKey="waitForNewRule" after="scrollToConditionsTab"/> - <click selector="{{PriceRuleConditionsSection.createNewRule}}" stepKey="clickNewRule" after="waitForNewRule"/> - <selectOption selector="{{AdminNewCatalogPriceRuleConditions.conditionsDropdown}}" userInput="{{ProductAttributeFrontendLabel.label}}" stepKey="selectProductAttribute" after="clickNewRule"/> - <waitForPageLoad stepKey="waitForAttributeLoad" after="selectProductAttribute"/> - <!--Assert that attribute contains today date without time--> - <comment userInput="Assert that attribute contains today date without time" stepKey="assertDate" after="waitForAttributeLoad"/> - <generateDate date="now" format="Y-m-d" stepKey="today" after="assertDate"/> - <grabTextFrom selector="{{PriceRuleConditionsSection.firstProductAttributeSelected}}" stepKey="grabTextFromSelectedAttribute" after="today"/> - <assertEquals expected="$today" actual="$grabTextFromSelectedAttribute" stepKey="assertTodayDate" after="grabTextFromSelectedAttribute"/> - </actionGroup> - <actionGroup name="AdminCreateMultipleWebsiteCatalogPriceRule" extends="createCatalogPriceRule"> - <remove keyForRemoval="selectSite"/> - <selectOption selector="{{AdminNewCatalogPriceRule.websites}}" parameterArray="['FirstWebsite', 'SecondWebsite']" stepKey="selectWebsite"/> - </actionGroup> - <actionGroup name="CreateCatalogPriceRuleViaTheUi"> - <arguments> - <argument name="catalogRule" defaultValue="_defaultCatalogRule"/> - <argument name="customerGroup" defaultValue="General" type="string"/> - <argument name="disregardRules" defaultValue="Yes" type="string"/> - </arguments> - - <fillField selector="{{AdminNewCatalogPriceRule.ruleName}}" userInput="{{catalogRule.name}}" stepKey="fillName1"/> - <fillField selector="{{AdminNewCatalogPriceRule.description}}" userInput="{{catalogRule.description}}" stepKey="fillDescription1"/> - <selectOption selector="{{AdminNewCatalogPriceRule.websites}}" userInput="{{catalogRule.website_ids[0]}}" stepKey="selectWebSite1"/> - <selectOption selector="{{AdminNewCatalogPriceRule.customerGroups}}" userInput="{{customerGroup}}" stepKey="selectCustomerGroup1"/> - <scrollTo selector="{{AdminNewCatalogPriceRule.actionsTab}}" stepKey="scrollToActionTab1"/> - <click selector="{{AdminNewCatalogPriceRule.actionsTab}}" stepKey="openActionDropdown1"/> - <selectOption selector="{{AdminNewCatalogPriceRuleActions.apply}}" userInput="{{catalogRule.simple_action}}" stepKey="discountType1"/> - <fillField selector="{{AdminNewCatalogPriceRuleActions.discountAmount}}" userInput="{{catalogRule.discount_amount}}" stepKey="fillDiscountValue1"/> - <selectOption selector="{{AdminNewCatalogPriceRuleActions.disregardRules}}" userInput="{{disregardRules}}" stepKey="discardSubsequentRules1"/> - <waitForPageLoad stepKey="waitForPageToLoad1"/> - <scrollToTopOfPage stepKey="scrollToTop1"/> - </actionGroup> - - <actionGroup name="CreateCatalogPriceRuleConditionWithAttribute"> - <annotations> - <description>Add Conditional Requirements to a Catalog Price Rule from the creation/edit page.</description> - </annotations> - <arguments> - <argument name="attributeName" type="string"/> - <argument name="targetValue" type="string"/> - <argument name="targetSelectValue" type="string"/> - </arguments> - - <click selector="{{AdminNewCatalogPriceRule.conditionsTab}}" stepKey="openConditionsTab"/> - <waitForPageLoad stepKey="waitForConditionTabOpened"/> - <click selector="{{AdminNewCatalogPriceRuleConditions.newCondition}}" stepKey="addNewCondition"/> - <selectOption selector="{{AdminNewCatalogPriceRuleConditions.conditionSelect('1')}}" userInput="{{attributeName}}" stepKey="selectTypeCondition"/> - <waitForElement selector="{{AdminNewCatalogPriceRuleConditions.targetEllipsisValue('1', targetValue)}}" stepKey="waitForIsTarget"/> - <click selector="{{AdminNewCatalogPriceRuleConditions.targetEllipsisValue('1', 'is')}}" stepKey="clickOnIs"/> - <selectOption selector="{{AdminNewCatalogPriceRuleConditions.targetSelect('1')}}" userInput="{{targetSelectValue}}" stepKey="selectTargetCondition"/> - <click selector="{{AdminNewCatalogPriceRule.fromDateButton}}" stepKey="clickFromCalender"/> - <click selector="{{AdminNewCatalogPriceRule.todayDate}}" stepKey="clickFromToday"/> - </actionGroup> - - <!-- Apply all of the saved catalog price rules --> - <actionGroup name="applyCatalogPriceRules"> - <annotations> - <description>Goes to the Catalog Price Rule grid page. Clicks on Apply Rules. Validates that the Success Message is present and correct.</description> - </annotations> - - <amOnPage stepKey="goToPriceRulePage" url="{{CatalogRulePage.url}}"/> - <waitForPageLoad stepKey="waitForPriceRulePage"/> - <click stepKey="applyRules" selector="{{AdminCatalogPriceRuleGrid.applyRules}}"/> - <see stepKey="assertSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="Updated rules applied."/> - </actionGroup> - - <!--Add Catalog Rule Condition With product SKU--> - <actionGroup name="newCatalogPriceRuleByUIWithConditionIsSKU" extends="newCatalogPriceRuleByUI"> - <annotations> - <description>EXTENDS: newCatalogPriceRuleByUI. Add a Catalog Price Rule Condition based on the provided SKU.</description> - </annotations> - <arguments> - <argument name="productSku"/> - </arguments> - - <click selector="{{AdminNewCatalogPriceRule.conditionsTab}}" after="discardSubsequentRules" stepKey="openConditionsTab"/> - <waitForPageLoad after="openConditionsTab" stepKey="waitForConditionTabOpened"/> - <click selector="{{AdminNewCatalogPriceRuleConditions.newCondition}}" after="waitForConditionTabOpened" stepKey="addNewCondition"/> - <selectOption selector="{{AdminNewCatalogPriceRuleConditions.conditionSelect('1')}}" userInput="Magento\CatalogRule\Model\Rule\Condition\Product|sku" after="addNewCondition" stepKey="selectTypeCondition"/> - <waitForPageLoad after="selectTypeCondition" stepKey="waitForConditionChosed"/> - <click selector="{{AdminNewCatalogPriceRuleConditions.targetEllipsis('1')}}" after="waitForConditionChosed" stepKey="clickEllipsis"/> - <fillField selector="{{AdminNewCatalogPriceRuleConditions.targetInput('1', '1')}}" userInput="{{productSku}}" after="clickEllipsis" stepKey="fillProductSku"/> - <click selector="{{AdminNewCatalogPriceRuleConditions.applyButton('1', '1')}}" after="fillProductSku" stepKey="clickApply"/> - </actionGroup> - - <!--Add Catalog Rule Condition With Category--> - <actionGroup name="newCatalogPriceRuleByUIWithConditionIsCategory" extends="newCatalogPriceRuleByUI"> - <annotations> - <description>EXTENDS: newCatalogPriceRuleByUI. Add a Catalog Price Rule Condition based on the provided Category ID.</description> - </annotations> - <arguments> - <argument name="categoryId"/> - </arguments> - - <click selector="{{AdminNewCatalogPriceRule.conditionsTab}}" after="discardSubsequentRules" stepKey="openConditionsTab"/> - <waitForPageLoad after="openConditionsTab" stepKey="waitForConditionTabOpened"/> - <click selector="{{AdminNewCatalogPriceRuleConditions.newCondition}}" after="waitForConditionTabOpened" stepKey="addNewCondition"/> - <selectOption selector="{{AdminNewCatalogPriceRuleConditions.conditionSelect('1')}}" userInput="Magento\CatalogRule\Model\Rule\Condition\Product|category_ids" after="addNewCondition" stepKey="selectTypeCondition"/> - <waitForPageLoad after="selectTypeCondition" stepKey="waitForConditionChosed"/> - <click selector="{{AdminNewCatalogPriceRuleConditions.targetEllipsis('1')}}" after="waitForConditionChosed" stepKey="clickEllipsis"/> - <fillField selector="{{AdminNewCatalogPriceRuleConditions.targetInput('1', '1')}}" userInput="{{categoryId}}" after="clickEllipsis" stepKey="fillCategoryId"/> - <click selector="{{AdminNewCatalogPriceRuleConditions.applyButton('1', '1')}}" after="fillCategoryId" stepKey="clickApply"/> - </actionGroup> - - <actionGroup name="selectGeneralCustomerGroupActionGroup"> - <annotations> - <description>Selects the 'General' Customer Group for a Catalog Price Rule on the creation/edit page.</description> - </annotations> - - <selectOption selector="{{AdminNewCatalogPriceRule.customerGroups}}" userInput="General" stepKey="selectCustomerGroup"/> - </actionGroup> - - <actionGroup name="selectNotLoggedInCustomerGroupActionGroup"> - <annotations> - <description>Selects the 'NOT LOGGED IN' Customer Group for a Catalog Price Rule on the creation/edit page.</description> - </annotations> - - <selectOption selector="{{AdminNewCatalogPriceRule.customerGroups}}" userInput="NOT LOGGED IN" stepKey="selectCustomerGroup"/> - </actionGroup> - - <!-- Open rule for Edit --> - <actionGroup name="OpenCatalogPriceRule"> - <arguments> - <argument name="ruleName" type="string" defaultValue="CustomCatalogRule.name"/> - </arguments> - <amOnPage url="{{AdminCatalogPriceRuleGridPage.url}}" stepKey="goToAdminCatalogPriceRuleGridPage"/> - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingFilters"/> - <fillField selector="{{AdminCatalogPriceRuleGridSection.filterByRuleName}}" userInput="{{ruleName}}" stepKey="filterByRuleName"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearch"/> - <click selector="{{AdminGridTableSection.row('1')}}" stepKey="clickEdit"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - </actionGroup> - - <actionGroup name="RemoveCatalogPriceRule" extends="OpenCatalogPriceRule"> - <click selector="{{AdminMainActionsSection.delete}}" after="waitForPageLoad" stepKey="clickToDelete"/> - <waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" after="clickToDelete" stepKey="waitForElementVisible"/> - <click selector="{{AdminConfirmationModalSection.ok}}" after="waitForElementVisible" stepKey="clickToConfirm"/> - <waitForElementVisible selector="{{AdminMessagesSection.success}}" after="clickToConfirm" stepKey="waitForSuccessMessage"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You deleted the rule." after="waitForSuccessMessage" stepKey="verifyRuleIsDeleted"/> - </actionGroup> - - <actionGroup name="AdminFillCatalogRuleConditionActionGroup"> - <annotations> - <description>Clicks on the Conditions tab. Fills in the provided condition for Catalog Price Rule.</description> - </annotations> - <arguments> - <argument name="condition" type="string" defaultValue="{{CatalogRuleProductConditions.categoryIds}}"/> - <argument name="conditionOperator" type="string" defaultValue="is"/> - <argument name="conditionValue" type="string" defaultValue="2"/> - </arguments> - - <conditionalClick selector="{{AdminNewCatalogPriceRule.conditionsTab}}" dependentSelector="{{AdminNewCatalogPriceRuleConditions.newCondition}}" visible="false" stepKey="openConditionsTab"/> - <waitForElementVisible selector="{{AdminNewCatalogPriceRuleConditions.newCondition}}" stepKey="waitForAddConditionButton"/> - <click selector="{{AdminNewCatalogPriceRuleConditions.newCondition}}" stepKey="addNewCondition"/> - <selectOption selector="{{AdminNewCatalogPriceRuleConditions.conditionSelect('1')}}" userInput="{{condition}}" stepKey="selectTypeCondition"/> - <click selector="{{AdminNewCatalogPriceRuleConditions.condition('is')}}" stepKey="clickOnOperator"/> - <selectOption selector="{{AdminNewCatalogPriceRuleConditions.activeOperatorSelect}}" userInput="{{conditionOperator}}" stepKey="selectCondition"/> - <!-- In case we are choosing already selected value - select is not closed automatically --> - <conditionalClick selector="{{AdminNewCatalogPriceRuleConditions.condition('...')}}" dependentSelector="{{AdminNewCatalogPriceRuleConditions.activeOperatorSelect}}" visible="true" stepKey="closeSelect"/> - <click selector="{{AdminNewCatalogPriceRuleConditions.condition('...')}}" stepKey="clickToChooseOption3"/> - <waitForElementVisible selector="{{AdminNewCatalogPriceRuleConditions.activeValueInput}}" stepKey="waitForValueInput"/> - <fillField selector="{{AdminNewCatalogPriceRuleConditions.activeValueInput}}" userInput="{{conditionValue}}" stepKey="fillConditionValue"/> - <click selector="{{AdminNewCatalogPriceRuleConditions.activeConditionApplyButton}}" stepKey="clickApply"/> - <waitForElementNotVisible selector="{{AdminNewCatalogPriceRuleConditions.activeConditionApplyButton}}" stepKey="waitForApplyButtonInvisibility"/> - </actionGroup> - - <actionGroup name="newCatalogPriceRuleWithInvalidData"> - <annotations> - <description>Goes to the Catalog Price Rule grid. Clicks on Add. Fills in the provided Catalog Rule details with invalid data.</description> - </annotations> - <arguments> - <argument name="catalogRule" defaultValue="catalogRuleWithInvalid"/> - </arguments> - - <!-- Go to the admin Catalog rule grid and add a new one --> - <amOnPage stepKey="goToPriceRulePage" url="{{CatalogRulePage.url}}"/> - <waitForPageLoad stepKey="waitForPriceRulePage"/> - - <click stepKey="addNewRule" selector="{{AdminGridMainControls.add}}"/> - <fillField stepKey="fillPriority" selector="{{AdminNewCatalogPriceRule.priority}}" userInput="{{catalogRule.priority}}"/> - <scrollToTopOfPage stepKey="scrollToTop"/> - <click selector="{{AdminNewCatalogPriceRule.save}}" stepKey="clickSave"/> - <waitForPageLoad stepKey="waitForApplied"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CreateCatalogPriceRuleActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CreateCatalogPriceRuleActionGroup.xml new file mode 100644 index 0000000000000..f43cd44c50de2 --- /dev/null +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CreateCatalogPriceRuleActionGroup.xml @@ -0,0 +1,29 @@ +<?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="CreateCatalogPriceRuleActionGroup"> + <annotations> + <description>Clicks on the Add button. Fills Rule Name, Description, Website and Discount Value.</description> + </annotations> + <arguments> + <argument name="catalogRule" defaultValue="_defaultCatalogRule"/> + </arguments> + <click stepKey="addNewRule" selector="{{AdminGridMainControls.add}}"/> + <fillField selector="{{AdminNewCatalogPriceRule.ruleName}}" userInput="{{catalogRule.name}}" stepKey="fillName" /> + <click stepKey="selectActive" selector="{{AdminCategoryBasicFieldSection.enableCategoryLabel}}"/> + <fillField selector="{{AdminNewCatalogPriceRule.description}}" userInput="{{catalogRule.description}}" stepKey="fillDescription" /> + <selectOption selector="{{AdminNewCatalogPriceRule.websites}}" parameterArray="{{catalogRule.website_ids}}" stepKey="selectSite" /> + <click stepKey="openActionDropdown" selector="{{AdminNewCatalogPriceRule.actionsTab}}"/> + <fillField stepKey="fillDiscountValue" selector="{{AdminNewCatalogPriceRuleActions.discountAmount}}" userInput="{{catalogRule.discount_amount}}"/> + <scrollToTopOfPage stepKey="scrollToTop"/> + <click selector="{{AdminNewCatalogPriceRule.save}}" stepKey="clickSave"/> + <waitForPageLoad stepKey="waitForApplied"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CreateCatalogPriceRuleConditionWithAttributeActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CreateCatalogPriceRuleConditionWithAttributeActionGroup.xml new file mode 100644 index 0000000000000..97d1324f7c4fa --- /dev/null +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CreateCatalogPriceRuleConditionWithAttributeActionGroup.xml @@ -0,0 +1,31 @@ +<?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="CreateCatalogPriceRuleConditionWithAttributeActionGroup"> + <annotations> + <description>Add Conditional Requirements to a Catalog Price Rule from the creation/edit page.</description> + </annotations> + <arguments> + <argument name="attributeName" type="string"/> + <argument name="targetValue" type="string"/> + <argument name="targetSelectValue" type="string"/> + </arguments> + + <click selector="{{AdminNewCatalogPriceRule.conditionsTab}}" stepKey="openConditionsTab"/> + <waitForPageLoad stepKey="waitForConditionTabOpened"/> + <click selector="{{AdminNewCatalogPriceRuleConditions.newCondition}}" stepKey="addNewCondition"/> + <selectOption selector="{{AdminNewCatalogPriceRuleConditions.conditionSelect('1')}}" userInput="{{attributeName}}" stepKey="selectTypeCondition"/> + <waitForElement selector="{{AdminNewCatalogPriceRuleConditions.targetEllipsisValue('1', targetValue)}}" stepKey="waitForIsTarget"/> + <click selector="{{AdminNewCatalogPriceRuleConditions.targetEllipsisValue('1', 'is')}}" stepKey="clickOnIs"/> + <selectOption selector="{{AdminNewCatalogPriceRuleConditions.targetSelect('1')}}" userInput="{{targetSelectValue}}" stepKey="selectTargetCondition"/> + <click selector="{{AdminNewCatalogPriceRule.fromDateButton}}" stepKey="clickFromCalender"/> + <click selector="{{AdminNewCatalogPriceRule.todayDate}}" stepKey="clickFromToday"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CreateCatalogPriceRuleViaTheUiActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CreateCatalogPriceRuleViaTheUiActionGroup.xml new file mode 100644 index 0000000000000..f549102ecd140 --- /dev/null +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CreateCatalogPriceRuleViaTheUiActionGroup.xml @@ -0,0 +1,30 @@ +<?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="CreateCatalogPriceRuleViaTheUiActionGroup"> + <arguments> + <argument name="catalogRule" defaultValue="_defaultCatalogRule"/> + <argument name="customerGroup" defaultValue="General" type="string"/> + <argument name="disregardRules" defaultValue="Yes" type="string"/> + </arguments> + + <fillField selector="{{AdminNewCatalogPriceRule.ruleName}}" userInput="{{catalogRule.name}}" stepKey="fillName1"/> + <fillField selector="{{AdminNewCatalogPriceRule.description}}" userInput="{{catalogRule.description}}" stepKey="fillDescription1"/> + <selectOption selector="{{AdminNewCatalogPriceRule.websites}}" userInput="{{catalogRule.website_ids[0]}}" stepKey="selectWebSite1"/> + <selectOption selector="{{AdminNewCatalogPriceRule.customerGroups}}" userInput="{{customerGroup}}" stepKey="selectCustomerGroup1"/> + <scrollTo selector="{{AdminNewCatalogPriceRule.actionsTab}}" stepKey="scrollToActionTab1"/> + <click selector="{{AdminNewCatalogPriceRule.actionsTab}}" stepKey="openActionDropdown1"/> + <selectOption selector="{{AdminNewCatalogPriceRuleActions.apply}}" userInput="{{catalogRule.simple_action}}" stepKey="discountType1"/> + <fillField selector="{{AdminNewCatalogPriceRuleActions.discountAmount}}" userInput="{{catalogRule.discount_amount}}" stepKey="fillDiscountValue1"/> + <selectOption selector="{{AdminNewCatalogPriceRuleActions.disregardRules}}" userInput="{{disregardRules}}" stepKey="discardSubsequentRules1"/> + <waitForPageLoad stepKey="waitForPageToLoad1"/> + <scrollToTopOfPage stepKey="scrollToTop1"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/NewCatalogPriceRuleByUIWithConditionIsCategoryActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/NewCatalogPriceRuleByUIWithConditionIsCategoryActionGroup.xml new file mode 100644 index 0000000000000..9b5a482c214d4 --- /dev/null +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/NewCatalogPriceRuleByUIWithConditionIsCategoryActionGroup.xml @@ -0,0 +1,28 @@ +<?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="NewCatalogPriceRuleByUIWithConditionIsCategoryActionGroup" extends="NewCatalogPriceRuleByUIActionGroup"> + <annotations> + <description>EXTENDS: newCatalogPriceRuleByUI. Add a Catalog Price Rule Condition based on the provided Category ID.</description> + </annotations> + <arguments> + <argument name="categoryId"/> + </arguments> + + <click selector="{{AdminNewCatalogPriceRule.conditionsTab}}" after="discardSubsequentRules" stepKey="openConditionsTab"/> + <waitForPageLoad after="openConditionsTab" stepKey="waitForConditionTabOpened"/> + <click selector="{{AdminNewCatalogPriceRuleConditions.newCondition}}" after="waitForConditionTabOpened" stepKey="addNewCondition"/> + <selectOption selector="{{AdminNewCatalogPriceRuleConditions.conditionSelect('1')}}" userInput="Magento\CatalogRule\Model\Rule\Condition\Product|category_ids" after="addNewCondition" stepKey="selectTypeCondition"/> + <waitForPageLoad after="selectTypeCondition" stepKey="waitForConditionChosed"/> + <click selector="{{AdminNewCatalogPriceRuleConditions.targetEllipsis('1')}}" after="waitForConditionChosed" stepKey="clickEllipsis"/> + <fillField selector="{{AdminNewCatalogPriceRuleConditions.targetInput('1', '1')}}" userInput="{{categoryId}}" after="clickEllipsis" stepKey="fillCategoryId"/> + <click selector="{{AdminNewCatalogPriceRuleConditions.applyButton('1', '1')}}" after="fillCategoryId" stepKey="clickApply"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/NewCatalogPriceRuleByUIWithConditionIsSKUActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/NewCatalogPriceRuleByUIWithConditionIsSKUActionGroup.xml new file mode 100644 index 0000000000000..9d25ffa948ad1 --- /dev/null +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/NewCatalogPriceRuleByUIWithConditionIsSKUActionGroup.xml @@ -0,0 +1,28 @@ +<?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="NewCatalogPriceRuleByUIWithConditionIsSKUActionGroup" extends="NewCatalogPriceRuleByUIActionGroup"> + <annotations> + <description>EXTENDS: newCatalogPriceRuleByUI. Add a Catalog Price Rule Condition based on the provided SKU.</description> + </annotations> + <arguments> + <argument name="productSku"/> + </arguments> + + <click selector="{{AdminNewCatalogPriceRule.conditionsTab}}" after="discardSubsequentRules" stepKey="openConditionsTab"/> + <waitForPageLoad after="openConditionsTab" stepKey="waitForConditionTabOpened"/> + <click selector="{{AdminNewCatalogPriceRuleConditions.newCondition}}" after="waitForConditionTabOpened" stepKey="addNewCondition"/> + <selectOption selector="{{AdminNewCatalogPriceRuleConditions.conditionSelect('1')}}" userInput="Magento\CatalogRule\Model\Rule\Condition\Product|sku" after="addNewCondition" stepKey="selectTypeCondition"/> + <waitForPageLoad after="selectTypeCondition" stepKey="waitForConditionChosed"/> + <click selector="{{AdminNewCatalogPriceRuleConditions.targetEllipsis('1')}}" after="waitForConditionChosed" stepKey="clickEllipsis"/> + <fillField selector="{{AdminNewCatalogPriceRuleConditions.targetInput('1', '1')}}" userInput="{{productSku}}" after="clickEllipsis" stepKey="fillProductSku"/> + <click selector="{{AdminNewCatalogPriceRuleConditions.applyButton('1', '1')}}" after="fillProductSku" stepKey="clickApply"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/NewCatalogPriceRuleWithInvalidDataActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/NewCatalogPriceRuleWithInvalidDataActionGroup.xml new file mode 100644 index 0000000000000..5fd56c81734b6 --- /dev/null +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/NewCatalogPriceRuleWithInvalidDataActionGroup.xml @@ -0,0 +1,29 @@ +<?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="NewCatalogPriceRuleWithInvalidDataActionGroup"> + <annotations> + <description>Goes to the Catalog Price Rule grid. Clicks on Add. Fills in the provided Catalog Rule details with invalid data.</description> + </annotations> + <arguments> + <argument name="catalogRule" defaultValue="catalogRuleWithInvalid"/> + </arguments> + + <!-- Go to the admin Catalog rule grid and add a new one --> + <amOnPage stepKey="goToPriceRulePage" url="{{CatalogRulePage.url}}"/> + <waitForPageLoad stepKey="waitForPriceRulePage"/> + + <click stepKey="addNewRule" selector="{{AdminGridMainControls.add}}"/> + <fillField stepKey="fillPriority" selector="{{AdminNewCatalogPriceRule.priority}}" userInput="{{catalogRule.priority}}"/> + <scrollToTopOfPage stepKey="scrollToTop"/> + <click selector="{{AdminNewCatalogPriceRule.save}}" stepKey="clickSave"/> + <waitForPageLoad stepKey="waitForApplied"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/OpenCatalogPriceRuleActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/OpenCatalogPriceRuleActionGroup.xml new file mode 100644 index 0000000000000..c810d9579df92 --- /dev/null +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/OpenCatalogPriceRuleActionGroup.xml @@ -0,0 +1,22 @@ +<?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="OpenCatalogPriceRuleActionGroup"> + <arguments> + <argument name="ruleName" type="string" defaultValue="CustomCatalogRule.name"/> + </arguments> + <amOnPage url="{{AdminCatalogPriceRuleGridPage.url}}" stepKey="goToAdminCatalogPriceRuleGridPage"/> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingFilters"/> + <fillField selector="{{AdminCatalogPriceRuleGridSection.filterByRuleName}}" userInput="{{ruleName}}" stepKey="filterByRuleName"/> + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearch"/> + <click selector="{{AdminGridTableSection.row('1')}}" stepKey="clickEdit"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/RemoveCatalogPriceRuleActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/RemoveCatalogPriceRuleActionGroup.xml new file mode 100644 index 0000000000000..7c7ecba3ff74f --- /dev/null +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/RemoveCatalogPriceRuleActionGroup.xml @@ -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="RemoveCatalogPriceRuleActionGroup" extends="OpenCatalogPriceRuleActionGroup"> + <click selector="{{AdminMainActionsSection.delete}}" after="waitForPageLoad" stepKey="clickToDelete"/> + <waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" after="clickToDelete" stepKey="waitForElementVisible"/> + <click selector="{{AdminConfirmationModalSection.ok}}" after="waitForElementVisible" stepKey="clickToConfirm"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" after="clickToConfirm" stepKey="waitForSuccessMessage"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You deleted the rule." after="waitForSuccessMessage" stepKey="verifyRuleIsDeleted"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/SelectGeneralCustomerGroupActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/SelectGeneralCustomerGroupActionGroup.xml new file mode 100644 index 0000000000000..cc4981f73f3f8 --- /dev/null +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/SelectGeneralCustomerGroupActionGroup.xml @@ -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="SelectGeneralCustomerGroupActionGroup"> + <annotations> + <description>Selects the 'General' Customer Group for a Catalog Price Rule on the creation/edit page.</description> + </annotations> + + <selectOption selector="{{AdminNewCatalogPriceRule.customerGroups}}" userInput="General" stepKey="selectCustomerGroup"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/SelectNotLoggedInCustomerGroupActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/SelectNotLoggedInCustomerGroupActionGroup.xml new file mode 100644 index 0000000000000..38b64803acadd --- /dev/null +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/SelectNotLoggedInCustomerGroupActionGroup.xml @@ -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="SelectNotLoggedInCustomerGroupActionGroup"> + <annotations> + <description>Selects the 'NOT LOGGED IN' Customer Group for a Catalog Price Rule on the creation/edit page.</description> + </annotations> + + <selectOption selector="{{AdminNewCatalogPriceRule.customerGroups}}" userInput="NOT LOGGED IN" stepKey="selectCustomerGroup"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithSpecialPricesTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithSpecialPricesTest.xml index 4df08fcca696b..41fbc33bbbec0 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithSpecialPricesTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithSpecialPricesTest.xml @@ -112,12 +112,12 @@ <actionGroup ref="saveProductForm" stepKey="saveSecondProduct"/> <!-- Create a new catalog price rule --> - <actionGroup ref="newCatalogPriceRuleByUIWithConditionIsCategory" stepKey="newCatalogPriceRuleByUIWithConditionIsCategory"> + <actionGroup ref="NewCatalogPriceRuleByUIWithConditionIsCategoryActionGroup" stepKey="newCatalogPriceRuleByUIWithConditionIsCategory"> <argument name="categoryId" value="$createCategory.id$"/> </actionGroup> <!-- Select not logged in customer group --> - <actionGroup ref="selectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroup"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroup"/> <!-- Save and apply the new catalog price rule --> <actionGroup ref="SaveAndApplyCatalogPriceRuleActionGroup" stepKey="saveAndApplyCatalogPriceRule"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest.xml index ee61af180d350..4cd7df106a131 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest.xml @@ -31,7 +31,7 @@ <!-- log in and create the price rule --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup stepKey="createNewPriceRule" ref="newCatalogPriceRuleByUI"/> + <actionGroup stepKey="createNewPriceRule" ref="NewCatalogPriceRuleByUIActionGroup"/> <actionGroup stepKey="selectNotLoggedInCustomerGroup" ref="selectNotLoggedInCustomerGroup"/> <click stepKey="saveAndApply" selector="{{AdminNewCatalogPriceRule.saveAndApply}}"/> <see stepKey="assertSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the rule."/> @@ -80,7 +80,7 @@ <group value="CatalogRule"/> </annotations> <before> - <actionGroup stepKey="createNewPriceRule" ref="newCatalogPriceRuleByUI"> + <actionGroup stepKey="createNewPriceRule" ref="NewCatalogPriceRuleByUIActionGroup"> <argument name="catalogRule" value="CatalogRuleByFixed"/> </actionGroup> </before> @@ -103,7 +103,7 @@ <group value="CatalogRule"/> </annotations> <before> - <actionGroup stepKey="createNewPriceRule" ref="newCatalogPriceRuleByUI"> + <actionGroup stepKey="createNewPriceRule" ref="NewCatalogPriceRuleByUIActionGroup"> <argument name="catalogRule" value="CatalogRuleToPercent"/> </actionGroup> </before> @@ -126,7 +126,7 @@ <group value="CatalogRule"/> </annotations> <before> - <actionGroup stepKey="createNewPriceRule" ref="newCatalogPriceRuleByUI"> + <actionGroup stepKey="createNewPriceRule" ref="NewCatalogPriceRuleByUIActionGroup"> <argument name="catalogRule" value="CatalogRuleToFixed"/> </actionGroup> </before> @@ -172,7 +172,7 @@ </after> <!-- Create a catalog rule for the NOT LOGGED IN customer group --> - <actionGroup ref="newCatalogPriceRuleByUI" stepKey="createNewPriceRule"/> + <actionGroup ref="NewCatalogPriceRuleByUIActionGroup" stepKey="createNewPriceRule"/> <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroup"/> <click selector="{{AdminNewCatalogPriceRule.saveAndApply}}" stepKey="saveAndApply"/> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the rule." stepKey="assertSuccess"/> @@ -213,7 +213,7 @@ <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> </after> - <actionGroup ref="newCatalogPriceRuleWithInvalidData" stepKey="createNewPriceRule"> + <actionGroup ref="NewCatalogPriceRuleWithInvalidDataActionGroup" stepKey="createNewPriceRule"> <argument name="catalogRule" value="catalogRuleWithInvalid"/> </actionGroup> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest.xml index d80759531ecae..e3c5862d4f0e9 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest.xml @@ -31,7 +31,7 @@ <amOnPage url="{{AdminNewCatalogPriceRulePage.url}}" stepKey="openNewCatalogPriceRulePage"/> <waitForPageLoad stepKey="waitForPageToLoad1"/> - <actionGroup ref="CreateCatalogPriceRuleViaTheUi" stepKey="createCatalogPriceRuleViaTheUi1"> + <actionGroup ref="CreateCatalogPriceRuleViaTheUiActionGroup" stepKey="createCatalogPriceRuleViaTheUi1"> <argument name="catalogRule" value="DeleteActiveCatalogPriceRuleWithConditions"/> <argument name="customerGroup" value="General"/> <argument name="disregardRules" value="Yes"/> @@ -163,7 +163,7 @@ <amOnPage url="{{AdminNewCatalogPriceRulePage.url}}" stepKey="openNewCatalogPriceRulePage"/> <waitForPageLoad stepKey="waitForPageToLoad1"/> - <actionGroup ref="CreateCatalogPriceRuleViaTheUi" stepKey="createCatalogPriceRuleViaTheUi1"> + <actionGroup ref="CreateCatalogPriceRuleViaTheUiActionGroup" stepKey="createCatalogPriceRuleViaTheUi1"> <argument name="catalogRule" value="DeleteActiveCatalogPriceRuleWithConditions"/> <argument name="customerGroup" value="General"/> <argument name="disregardRules" value="Yes"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml index 16fbca2697702..71bbeccaaf541 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml @@ -47,7 +47,7 @@ </after> <!-- Create a catalog price rule --> - <actionGroup ref="newCatalogPriceRuleByUI" stepKey="createNewPriceRule"/> + <actionGroup ref="NewCatalogPriceRuleByUIActionGroup" stepKey="createNewPriceRule"/> <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroup"/> <click selector="{{AdminNewCatalogPriceRule.saveAndApply}}" stepKey="saveAndApply"/> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the rule." stepKey="assertSuccess"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminEnableAttributeIsUndefinedCatalogPriceRuleTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminEnableAttributeIsUndefinedCatalogPriceRuleTest.xml index 54bf243c4cde6..da855b08cf390 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminEnableAttributeIsUndefinedCatalogPriceRuleTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminEnableAttributeIsUndefinedCatalogPriceRuleTest.xml @@ -70,11 +70,11 @@ <!--Create catalog price rule--> <amOnPage url="{{CatalogRulePage.url}}" stepKey="goToPriceRulePage"/> <waitForPageLoad stepKey="waitForPriceRulePage"/> - <actionGroup ref="createCatalogPriceRule" stepKey="createCatalogPriceRule"> + <actionGroup ref="CreateCatalogPriceRuleActionGroup" stepKey="createCatalogPriceRule"> <argument name="catalogRule" value="CatalogRuleWithAllCustomerGroups"/> </actionGroup> - <actionGroup ref="selectNotLoggedInCustomerGroupActionGroup" stepKey="selectCustomerGroup"/> - <actionGroup ref="CreateCatalogPriceRuleConditionWithAttribute" stepKey="createCatalogPriceRuleCondition"> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectCustomerGroup"/> + <actionGroup ref="CreateCatalogPriceRuleConditionWithAttributeActionGroup" stepKey="createCatalogPriceRuleCondition"> <argument name="attributeName" value="$$createProductAttribute.attribute[frontend_labels][0][label]$$"/> <argument name="targetValue" value="is"/> <argument name="targetSelectValue" value="is undefined"/> @@ -113,11 +113,11 @@ <!--Create new Catalog Price Rule--> <amOnPage url="{{CatalogRulePage.url}}" stepKey="goToPriceRulePage1"/> <waitForPageLoad stepKey="waitForPriceRulePage1"/> - <actionGroup ref="createCatalogPriceRule" stepKey="createCatalogPriceRule1"> + <actionGroup ref="CreateCatalogPriceRuleActionGroup" stepKey="createCatalogPriceRule1"> <argument name="catalogRule" value="CatalogRuleWithAllCustomerGroups"/> </actionGroup> - <actionGroup ref="selectNotLoggedInCustomerGroupActionGroup" stepKey="selectCustomerGroup1"/> - <actionGroup ref="CreateCatalogPriceRuleConditionWithAttribute" stepKey="createCatalogPriceRuleCondition1"> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectCustomerGroup1"/> + <actionGroup ref="CreateCatalogPriceRuleConditionWithAttributeActionGroup" stepKey="createCatalogPriceRuleCondition1"> <argument name="attributeName" value="$$createSecondProductAttribute.attribute[frontend_labels][0][label]$$"/> <argument name="targetValue" value="is"/> <argument name="targetSelectValue" value="is undefined"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleAndConfigurableProductTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleAndConfigurableProductTest.xml index b9e7bfb4d41e4..2f12df8b75fc6 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleAndConfigurableProductTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleAndConfigurableProductTest.xml @@ -101,12 +101,12 @@ <deleteData createDataKey="createCategory" stepKey="deleteApiCategory"/> </after> <!-- Begin creating a new catalog price rule --> - <actionGroup ref="newCatalogPriceRuleByUIWithConditionIsCategory" stepKey="newCatalogPriceRuleByUIWithConditionIsCategory"> + <actionGroup ref="NewCatalogPriceRuleByUIWithConditionIsCategoryActionGroup" stepKey="newCatalogPriceRuleByUIWithConditionIsCategory"> <argument name ="categoryId" value="$createCategory.id$"/> </actionGroup> <!-- Select not logged in customer group --> - <actionGroup ref="selectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroup"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroup"/> <!-- Save and apply the new catalog price rule --> <actionGroup ref="SaveAndApplyCatalogPriceRuleActionGroup" stepKey="saveAndApplyCatalogPriceRule"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductAndFixedMethodTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductAndFixedMethodTest.xml index 3405d0c4e776d..956a2e07fc6b4 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductAndFixedMethodTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductAndFixedMethodTest.xml @@ -53,22 +53,22 @@ <actionGroup ref="logout" stepKey="logout"/> </after> <!-- 1. Begin creating a new catalog price rule --> - <actionGroup ref="newCatalogPriceRuleByUIWithConditionIsCategory" stepKey="newCatalogPriceRuleByUIWithConditionIsCategory"> + <actionGroup ref="NewCatalogPriceRuleByUIWithConditionIsCategoryActionGroup" stepKey="newCatalogPriceRuleByUIWithConditionIsCategory"> <argument name ="categoryId" value="$createCategory.id$"/> <argument name ="catalogRule" value="CatalogRuleByFixed"/> </actionGroup> <!-- Select not logged in customer group --> - <actionGroup ref="selectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroup"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroup"/> <!-- Save and apply the new catalog price rule --> <actionGroup ref="SaveAndApplyCatalogPriceRuleActionGroup" stepKey="saveAndApplyCatalogPriceRule"/> <magentoCLI command="indexer:reindex" stepKey="reindex"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> - + <!-- Navigate to category on store front --> <amOnPage url="{{StorefrontProductPage.url($createCategory.name$)}}" stepKey="goToCategoryPage"/> - + <!-- Check product 1 name on store front category page --> <actionGroup ref="AssertProductDetailsOnStorefrontActionGroup" stepKey="storefrontProduct1Name"> <argument name="productInfo" value="$createProduct1.name$"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductForNewCustomerGroupTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductForNewCustomerGroupTest.xml index c3bcde92bd1f2..e5e3cf9ead5e5 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductForNewCustomerGroupTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductForNewCustomerGroupTest.xml @@ -64,7 +64,7 @@ <actionGroup ref="logout" stepKey="logout"/> </after> <!-- 1. Begin creating a new catalog price rule --> - <actionGroup ref="newCatalogPriceRuleByUIWithConditionIsCategory" stepKey="newCatalogPriceRuleByUIWithConditionIsCategory"> + <actionGroup ref="NewCatalogPriceRuleByUIWithConditionIsCategoryActionGroup" stepKey="newCatalogPriceRuleByUIWithConditionIsCategory"> <argument name ="categoryId" value="$createCategory.id$"/> <argument name="catalogRule" value="CatalogRuleByFixed"/> </actionGroup> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductWithCustomOptionsTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductWithCustomOptionsTest.xml index a251ee1e235d0..166d202ec2410 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductWithCustomOptionsTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductWithCustomOptionsTest.xml @@ -66,12 +66,12 @@ <actionGroup ref="logout" stepKey="logout"/> </after> <!-- 1. Begin creating a new catalog price rule --> - <actionGroup ref="newCatalogPriceRuleByUIWithConditionIsCategory" stepKey="newCatalogPriceRuleByUIWithConditionIsCategory"> + <actionGroup ref="NewCatalogPriceRuleByUIWithConditionIsCategoryActionGroup" stepKey="newCatalogPriceRuleByUIWithConditionIsCategory"> <argument name ="categoryId" value="$createCategory.id$"/> </actionGroup> <!-- Select not logged in customer group --> - <actionGroup ref="selectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroup"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroup"/> <!-- Save and apply the new catalog price rule --> <actionGroup ref="SaveAndApplyCatalogPriceRuleActionGroup" stepKey="saveAndApplyCatalogPriceRule"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/CatalogPriceRuleAndCustomerGroupMembershipArePersistedUnderLongTermCookieTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/CatalogPriceRuleAndCustomerGroupMembershipArePersistedUnderLongTermCookieTest.xml index 738f193fcc511..86d3dccba7595 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/CatalogPriceRuleAndCustomerGroupMembershipArePersistedUnderLongTermCookieTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/CatalogPriceRuleAndCustomerGroupMembershipArePersistedUnderLongTermCookieTest.xml @@ -32,11 +32,11 @@ <actionGroup ref="LoginAsAdmin" stepKey="login"/> <!--Create Catalog Rule--> - <actionGroup ref="newCatalogPriceRuleByUIWithConditionIsCategory" stepKey="createCatalogPriceRule"> + <actionGroup ref="NewCatalogPriceRuleByUIWithConditionIsCategoryActionGroup" stepKey="createCatalogPriceRule"> <argument name="catalogRule" value="_defaultCatalogRule"/> <argument name="categoryId" value="$$createCategory.id$$"/> </actionGroup> - <actionGroup ref="selectGeneralCustomerGroupActionGroup" stepKey="selectCustomerGroup"/> + <actionGroup ref="SelectGeneralCustomerGroupActionGroup" stepKey="selectCustomerGroup"/> <click selector="{{AdminNewCatalogPriceRule.saveAndApply}}" stepKey="clickSaveAndApplyRules"/> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the rule." stepKey="assertSuccess"/> <magentoCLI command="indexer:reindex" stepKey="reindex"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/StorefrontInactiveCatalogRuleTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/StorefrontInactiveCatalogRuleTest.xml index 08e59c6316411..1f9c8df60492e 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/StorefrontInactiveCatalogRuleTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/StorefrontInactiveCatalogRuleTest.xml @@ -24,7 +24,7 @@ <createData entity="ApiSimpleProduct" stepKey="createProduct"> <requiredEntity createDataKey="createCategory"/> </createData> - <actionGroup stepKey="createNewPriceRule" ref="newCatalogPriceRuleByUI"/> + <actionGroup stepKey="createNewPriceRule" ref="NewCatalogPriceRuleByUIActionGroup"/> <actionGroup stepKey="selectLoggedInCustomers" ref="selectNotLoggedInCustomerGroup"/> <scrollToTopOfPage stepKey="scrollToTop"/> <click stepKey="setInactive" selector="{{AdminCategoryBasicFieldSection.enableCategoryLabel}}"/> diff --git a/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithAssignedSimpleProductsTest.xml b/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithAssignedSimpleProductsTest.xml index 3e700b5bcfb1b..71ab764453b20 100644 --- a/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithAssignedSimpleProductsTest.xml +++ b/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithAssignedSimpleProductsTest.xml @@ -178,7 +178,7 @@ <actionGroup ref="logout" stepKey="logout"/> </after> <!-- Create price rule --> - <actionGroup ref="newCatalogPriceRuleByUI" stepKey="createPriceRule"> + <actionGroup ref="NewCatalogPriceRuleByUIActionGroup" stepKey="createPriceRule"> <argument name="catalogRule" value="CatalogRuleToFixed"/> </actionGroup> <actionGroup ref="CatalogSelectCustomerGroupActionGroup" stepKey="addCustomerGroup"> diff --git a/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithOptionsTest.xml b/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithOptionsTest.xml index e53e51c626aa9..6fda432ce7905 100644 --- a/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithOptionsTest.xml +++ b/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithOptionsTest.xml @@ -126,7 +126,7 @@ </after> <!-- Create price rule for first configurable product option --> - <actionGroup ref="newCatalogPriceRuleByUI" stepKey="createFirstPriceRule"> + <actionGroup ref="NewCatalogPriceRuleByUIActionGroup" stepKey="createFirstPriceRule"> <argument name="catalogRule" value="CatalogRuleToFixed"/> </actionGroup> <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroupForFirstPriceRule"/> @@ -140,7 +140,7 @@ <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the rule." stepKey="assertSuccessMessageForFirstPriceRule"/> <!-- Create price rule for second configurable product option --> - <actionGroup ref="newCatalogPriceRuleByUI" stepKey="createSecondPriceRule"> + <actionGroup ref="NewCatalogPriceRuleByUIActionGroup" stepKey="createSecondPriceRule"> <argument name="catalogRule" value="_defaultCatalogRule"/> </actionGroup> <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroupForSecondPriceRule"/> @@ -154,7 +154,7 @@ <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the rule." stepKey="assertSuccessMessageForSecondPriceRule"/> <!-- Create price rule for third configurable product option --> - <actionGroup ref="newCatalogPriceRuleByUI" stepKey="createThirdPriceRule"> + <actionGroup ref="NewCatalogPriceRuleByUIActionGroup" stepKey="createThirdPriceRule"> <argument name="catalogRule" value="CatalogRuleWithoutDiscount"/> </actionGroup> <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroupForThirdPriceRule"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml index bc8f3e49272b7..275147549c178 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml @@ -132,7 +132,7 @@ <see selector="{{StorefrontCategoryMainSection.lineProductName('3')}}" userInput="$$createSimpleProduct.name$$" stepKey="seeSimpleProduct"/> <!--Create and apply catalog price rule--> - <actionGroup ref="newCatalogPriceRuleByUIWithConditionIsSKU" stepKey="createCatalogPriceRule"> + <actionGroup ref="NewCatalogPriceRuleByUIWithConditionIsSKUActionGroup" stepKey="createCatalogPriceRule"> <argument name="catalogRule" value="CatalogRuleByPercentWith96Amount" /> <argument name="productSku" value="$$createConfigChildProduct3.sku$$" /> </actionGroup> From 3aebff43b3511862dcbeec352d00e4eb407ce61a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Fri, 29 Nov 2019 13:13:55 +0100 Subject: [PATCH 145/586] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- ...wedInShoppingCartValidationActionGroup.xml | 20 ++++++++++++++++ ...axQtyAllowedInShoppingCartActionGroup.xml} | 10 +------- .../DisplayOutOfStockProductActionGroup.xml | 18 ++------------ .../NoDisplayOutOfStockProductActionGroup.xml | 24 +++++++++++++++++++ ...eroMaximumQtyAllowedInShoppingCartTest.xml | 2 +- ...roductWithDisabledChildrenProductsTest.xml | 4 ++-- ...eeProductDisplayOutOfStockProductsTest.xml | 6 ++--- 7 files changed, 53 insertions(+), 31 deletions(-) create mode 100644 app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminProductMaxQtyAllowedInShoppingCartValidationActionGroup.xml rename app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/{AdminProductActionGroup.xml => AdminProductSetMaxQtyAllowedInShoppingCartActionGroup.xml} (64%) create mode 100644 app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/NoDisplayOutOfStockProductActionGroup.xml diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminProductMaxQtyAllowedInShoppingCartValidationActionGroup.xml b/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminProductMaxQtyAllowedInShoppingCartValidationActionGroup.xml new file mode 100644 index 0000000000000..1dbc0256be7d8 --- /dev/null +++ b/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminProductMaxQtyAllowedInShoppingCartValidationActionGroup.xml @@ -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="AdminProductMaxQtyAllowedInShoppingCartValidationActionGroup" extends="AdminProductSetMaxQtyAllowedInShoppingCartActionGroup"> + <arguments> + <argument name="qty" type="string"/> + <argument name="errorMessage" type="string"/> + </arguments> + + <waitForElementVisible selector="{{AdminProductFormAdvancedInventorySection.maxiQtyAllowedInCartError}}" after="clickDone" stepKey="waitProductValidationErrorMessageAppears"/> + <see selector="{{AdminProductFormAdvancedInventorySection.maxiQtyAllowedInCartError}}" userInput="{{errorMessage}}" after="waitProductValidationErrorMessageAppears" stepKey="checkProductValidationErrorMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminProductActionGroup.xml b/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminProductSetMaxQtyAllowedInShoppingCartActionGroup.xml similarity index 64% rename from app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminProductActionGroup.xml rename to app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminProductSetMaxQtyAllowedInShoppingCartActionGroup.xml index 84dc6b93c885f..a5e4d3e9c2af7 100644 --- a/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminProductActionGroup.xml +++ b/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminProductSetMaxQtyAllowedInShoppingCartActionGroup.xml @@ -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="AdminProductSetMaxQtyAllowedInShoppingCart"> + <actionGroup name="AdminProductSetMaxQtyAllowedInShoppingCartActionGroup"> <arguments> <argument name="qty" type="string"/> </arguments> @@ -19,13 +19,5 @@ <click selector="{{AdminSlideOutDialogSection.doneButton}}" stepKey="clickDone"/> </actionGroup> - <actionGroup name="AdminProductMaxQtyAllowedInShoppingCartValidationActionGroup" extends="AdminProductSetMaxQtyAllowedInShoppingCart"> - <arguments> - <argument name="qty" type="string"/> - <argument name="errorMessage" type="string"/> - </arguments> - <waitForElementVisible selector="{{AdminProductFormAdvancedInventorySection.maxiQtyAllowedInCartError}}" after="clickDone" stepKey="waitProductValidationErrorMessageAppears"/> - <see selector="{{AdminProductFormAdvancedInventorySection.maxiQtyAllowedInCartError}}" userInput="{{errorMessage}}" after="waitProductValidationErrorMessageAppears" stepKey="checkProductValidationErrorMessage"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/DisplayOutOfStockProductActionGroup.xml b/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/DisplayOutOfStockProductActionGroup.xml index 13cb9089bf920..a6fe2b49508ff 100644 --- a/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/DisplayOutOfStockProductActionGroup.xml +++ b/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/DisplayOutOfStockProductActionGroup.xml @@ -8,11 +8,11 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="displayOutOfStockProduct"> + <actionGroup name="DisplayOutOfStockProductActionGroup"> <annotations> <description>Goes to the 'Configuration' page for 'Inventory'. Enables 'Display Out of Stock Products'. Clicks on the Save button.</description> </annotations> - + <amOnPage url="{{InventoryConfigurationPage.url}}" stepKey="navigateToInventoryConfigurationPage"/> <waitForPageLoad stepKey="waitForConfigPageToLoad"/> <conditionalClick stepKey="expandProductStockOptions" selector="{{InventoryConfigSection.ProductStockOptionsTab}}" dependentSelector="{{InventoryConfigSection.CheckIfProductStockOptionsTabExpanded}}" visible="true"/> @@ -22,18 +22,4 @@ <selectOption selector="{{InventoryConfigSection.DisplayOutOfStockDropdown}}" userInput="Yes" stepKey="switchToYes"/> <click selector="{{ContentManagementSection.Save}}" stepKey="clickSaveConfig"/> </actionGroup> - - <actionGroup name="noDisplayOutOfStockProduct"> - <annotations> - <description>Goes to the 'Configuration' page for 'Inventory'. Disables 'Display Out of Stock Products'. Clicks on the Save button.</description> - </annotations> - - <amOnPage url="{{InventoryConfigurationPage.url}}" stepKey="navigateToInventoryConfigurationPage"/> - <waitForPageLoad stepKey="waitForConfigPageToLoad"/> - <conditionalClick stepKey="expandProductStockOptions" selector="{{InventoryConfigSection.ProductStockOptionsTab}}" dependentSelector="{{InventoryConfigSection.CheckIfProductStockOptionsTabExpanded}}" visible="true"/> - <uncheckOption selector="{{InventoryConfigSection.DisplayOutOfStockSystemValue}}" stepKey="uncheckUseSystemValue"/> - <waitForElementVisible selector="{{InventoryConfigSection.DisplayOutOfStockDropdown}}" stepKey="waitForSwitcherDropdown"/> - <selectOption selector="{{InventoryConfigSection.DisplayOutOfStockDropdown}}" userInput="No" stepKey="switchToNo"/> - <click selector="{{ContentManagementSection.Save}}" stepKey="clickSaveConfig"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/NoDisplayOutOfStockProductActionGroup.xml b/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/NoDisplayOutOfStockProductActionGroup.xml new file mode 100644 index 0000000000000..6f6b7ae20987f --- /dev/null +++ b/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/NoDisplayOutOfStockProductActionGroup.xml @@ -0,0 +1,24 @@ +<?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="NoDisplayOutOfStockProductActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'Inventory'. Disables 'Display Out of Stock Products'. Clicks on the Save button.</description> + </annotations> + + <amOnPage url="{{InventoryConfigurationPage.url}}" stepKey="navigateToInventoryConfigurationPage"/> + <waitForPageLoad stepKey="waitForConfigPageToLoad"/> + <conditionalClick stepKey="expandProductStockOptions" selector="{{InventoryConfigSection.ProductStockOptionsTab}}" dependentSelector="{{InventoryConfigSection.CheckIfProductStockOptionsTabExpanded}}" visible="true"/> + <uncheckOption selector="{{InventoryConfigSection.DisplayOutOfStockSystemValue}}" stepKey="uncheckUseSystemValue"/> + <waitForElementVisible selector="{{InventoryConfigSection.DisplayOutOfStockDropdown}}" stepKey="waitForSwitcherDropdown"/> + <selectOption selector="{{InventoryConfigSection.DisplayOutOfStockDropdown}}" userInput="No" stepKey="switchToNo"/> + <click selector="{{ContentManagementSection.Save}}" stepKey="clickSaveConfig"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/Test/AdminCreateProductWithZeroMaximumQtyAllowedInShoppingCartTest.xml b/app/code/Magento/CatalogInventory/Test/Mftf/Test/AdminCreateProductWithZeroMaximumQtyAllowedInShoppingCartTest.xml index f7cf0a4deba4b..92265afb03528 100644 --- a/app/code/Magento/CatalogInventory/Test/Mftf/Test/AdminCreateProductWithZeroMaximumQtyAllowedInShoppingCartTest.xml +++ b/app/code/Magento/CatalogInventory/Test/Mftf/Test/AdminCreateProductWithZeroMaximumQtyAllowedInShoppingCartTest.xml @@ -71,7 +71,7 @@ <argument name="errorMessage" value="Please enter a valid number in this field."/> </actionGroup> <!-- Fill correct value --> - <actionGroup ref="AdminProductSetMaxQtyAllowedInShoppingCart" stepKey="setProductMaxQtyAllowedInShoppingCartToCorrectNumber"> + <actionGroup ref="AdminProductSetMaxQtyAllowedInShoppingCartActionGroup" stepKey="setProductMaxQtyAllowedInShoppingCartToCorrectNumber"> <argument name="qty" value="50"/> </actionGroup> <waitForElementNotVisible selector="{{AdminProductFormAdvancedInventorySection.advancedInventoryModal}}" stepKey="waitForModalFormToDisappear"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithDisabledChildrenProductsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithDisabledChildrenProductsTest.xml index 49f3f8b5ea931..dd1ca79147140 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithDisabledChildrenProductsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithDisabledChildrenProductsTest.xml @@ -40,7 +40,7 @@ </before> <after> <!-- Don't display out of stock product --> - <actionGroup ref="noDisplayOutOfStockProduct" stepKey="revertDisplayOutOfStockProduct"/> + <actionGroup ref="NoDisplayOutOfStockProductActionGroup" stepKey="revertDisplayOutOfStockProduct"/> <!-- Delete configurable product --> <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> @@ -105,7 +105,7 @@ <see userInput="$$createSimpleProduct.name$$" selector="{{AdminProductFormConfigurationsSection.currentVariationsNameCells}}" stepKey="seeProductNameInConfigurations"/> <!-- Display out of stock product --> - <actionGroup ref="displayOutOfStockProduct" stepKey="displayOutOfStockProduct"/> + <actionGroup ref="DisplayOutOfStockProductActionGroup" stepKey="displayOutOfStockProduct"/> <!-- Flash cache --> <magentoCLI command="cache:flush" stepKey="flushCache"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDisplayOutOfStockProductsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDisplayOutOfStockProductsTest.xml index 308e256543736..1f0cc7b65aa7b 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDisplayOutOfStockProductsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDisplayOutOfStockProductsTest.xml @@ -61,7 +61,7 @@ </before> <after> <!-- Don't display out of stock product --> - <actionGroup ref="noDisplayOutOfStockProduct" stepKey="revertDisplayOutOfStockProduct"/> + <actionGroup ref="NoDisplayOutOfStockProductActionGroup" stepKey="revertDisplayOutOfStockProduct"/> <!-- Delete configurable product --> <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> @@ -119,7 +119,7 @@ <actionGroup ref="saveProductForm" stepKey="saveConfigurableProduct"/> <!-- Display out of stock product --> - <actionGroup ref="displayOutOfStockProduct" stepKey="displayOutOfStockProduct"/> + <actionGroup ref="DisplayOutOfStockProductActionGroup" stepKey="displayOutOfStockProduct"/> <!-- Flash cache --> <magentoCLI command="cache:flush" stepKey="flushCache"/> @@ -137,4 +137,4 @@ <waitForPageLoad stepKey="waitForProductPageLoad"/> <see userInput="$$createConfigProductAttributeOptionThree.option[store_labels][1][label]$$" selector="{{StorefrontProductInfoMainSection.optionByAttributeId($$createConfigProductAttribute.attribute_id$$)}}" stepKey="assertOptionNotAvailable" /> </test> -</tests> \ No newline at end of file +</tests> From ca6a5ab3bf9d25ba6ae69d300eba483954afa1d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Fri, 29 Nov 2019 13:22:52 +0100 Subject: [PATCH 146/586] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- .../ActionGroup/AdminExportActionGroup.xml | 102 ------------------ .../DeleteAllExportedFilesActionGroup.xml | 32 ++++++ .../DeleteExportedFileActionGroup.xml | 28 +++++ .../DownloadFileByRowIndexActionGroup.xml | 24 +++++ .../ExportAllProductsActionGroup.xml | 24 +++++ ...rtProductsFilterByAttributeActionGroup.xml | 31 ++++++ .../Test/AdminExportBundleProductTest.xml | 8 +- ...portGroupedProductWithSpecialPriceTest.xml | 8 +- ...mportConfigurableProductWithImagesTest.xml | 6 +- ...figurableProductsWithCustomOptionsTest.xml | 8 +- ...igurableProductsWithAssignedImagesTest.xml | 8 +- ...ableProductAssignedToCustomWebsiteTest.xml | 8 +- ...rtSimpleProductWithCustomAttributeTest.xml | 8 +- 13 files changed, 166 insertions(+), 129 deletions(-) delete mode 100644 app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/AdminExportActionGroup.xml create mode 100644 app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/DeleteAllExportedFilesActionGroup.xml create mode 100644 app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/DeleteExportedFileActionGroup.xml create mode 100644 app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/DownloadFileByRowIndexActionGroup.xml create mode 100644 app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/ExportAllProductsActionGroup.xml create mode 100644 app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/ExportProductsFilterByAttributeActionGroup.xml diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/AdminExportActionGroup.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/AdminExportActionGroup.xml deleted file mode 100644 index c56bc667e2494..0000000000000 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/AdminExportActionGroup.xml +++ /dev/null @@ -1,102 +0,0 @@ -<?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"> - <!-- Export products using filtering by attribute --> - <actionGroup name="exportProductsFilterByAttribute"> - <annotations> - <description>Filters Products by the provided Attribute. Exports the filtered Products list. Validates that the Success Message is present.</description> - </annotations> - <arguments> - <argument name="attribute" type="string"/> - <argument name="attributeData" type="string"/> - </arguments> - - <selectOption selector="{{AdminExportMainSection.entityType}}" userInput="Products" stepKey="selectProductsOption"/> - <waitForElementVisible selector="{{AdminExportMainSection.entityAttributes}}" stepKey="waitForElementVisible"/> - <scrollTo selector="{{AdminExportAttributeSection.chooseAttribute('attribute')}}" stepKey="scrollToAttribute"/> - <checkOption selector="{{AdminExportAttributeSection.chooseAttribute('attribute')}}" stepKey="selectAttribute"/> - <fillField selector="{{AdminExportAttributeSection.fillFilter('attribute')}}" userInput="{{attributeData}}" stepKey="setDataInField"/> - <waitForPageLoad stepKey="waitForUserInput"/> - <scrollTo selector="{{AdminExportAttributeSection.continueBtn}}" stepKey="scrollToContinue"/> - <click selector="{{AdminExportAttributeSection.continueBtn}}" stepKey="clickContinueButton"/> - <see selector="{{AdminMessagesSection.success}}" userInput="Message is added to queue, wait to get your file soon" stepKey="seeSuccessMessage"/> - </actionGroup> - - <!-- Export products without filtering --> - <actionGroup name="exportAllProducts"> - <annotations> - <description>Exports the unfiltered Products list. Validates that the Success Message is present.</description> - </annotations> - - <selectOption selector="{{AdminExportMainSection.entityType}}" userInput="Products" stepKey="selectProductsOption"/> - <waitForElementVisible selector="{{AdminExportMainSection.entityAttributes}}" stepKey="waitForElementVisible" time="5"/> - <scrollTo selector="{{AdminExportAttributeSection.continueBtn}}" stepKey="scrollToContinue"/> - <wait stepKey="waitForScroll" time="5"/> - <click selector="{{AdminExportAttributeSection.continueBtn}}" stepKey="clickContinueButton"/> - <wait stepKey="waitForClick" time="5"/> - <see selector="{{AdminMessagesSection.success}}" userInput="Message is added to queue, wait to get your file soon. Make sure your cron job is running to export the file" stepKey="seeSuccessMessage"/> - </actionGroup> - - <!-- Download first file in the grid --> - <actionGroup name="downloadFileByRowIndex"> - <annotations> - <description>Downloads the provided Grid Index on the Exports grid page.</description> - </annotations> - <arguments> - <argument name="rowIndex" type="string"/> - </arguments> - - <reloadPage stepKey="refreshPage"/> - <waitForPageLoad stepKey="waitFormReload"/> - <click stepKey="clickSelectBtn" selector="{{AdminExportAttributeSection.selectByIndex(rowIndex)}}"/> - <click stepKey="clickOnDownload" selector="{{AdminExportAttributeSection.download(rowIndex)}}" after="clickSelectBtn"/> - </actionGroup> - - <!-- Delete exported file --> - <actionGroup name="deleteExportedFile"> - <annotations> - <description>Deletes the provided Grid Index on the Exports grid page.</description> - </annotations> - <arguments> - <argument name="rowIndex" type="string"/> - </arguments> - - <amOnPage url="{{AdminExportIndexPage.url}}" stepKey="goToExportIndexPage"/> - <waitForPageLoad time="30" stepKey="waitFormReload"/> - <click stepKey="clickSelectBtn" selector="{{AdminExportAttributeSection.selectByIndex(rowIndex)}}"/> - <click stepKey="clickOnDelete" selector="{{AdminExportAttributeSection.delete(rowIndex)}}" after="clickSelectBtn"/> - <waitForElementVisible selector="{{AdminProductGridConfirmActionSection.title}}" stepKey="waitForConfirmModal"/> - <click selector="{{AdminProductGridConfirmActionSection.ok}}" stepKey="confirmDelete"/> - <waitForElementVisible selector="{{AdminDataGridTableSection.dataGridEmpty}}" stepKey="waitDataGridEmptyMessageAppears"/> - <see selector="{{AdminDataGridTableSection.dataGridEmpty}}" userInput="We couldn't find any records." stepKey="assertDataGridEmptyMessage"/> - </actionGroup> - - <actionGroup name="deleteAllExportedFiles"> - <amOnPage url="{{AdminExportIndexPage.url}}" stepKey="goToExportIndexPage"/> - <executeInSelenium - function=" - function ($webdriver) use ($I) { - $buttons = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::xpath('//tr[@data-repeat-index=\'0\']//button')); - while(!empty($buttons)) { - $buttons[0]->click(); - $I->waitForElementVisible('//tr[@data-repeat-index=\'0\']//a[text()=\'Delete\']', 10); - $deleteButton = $webdriver->findElement(\Facebook\WebDriver\WebDriverBy::xpath('//tr[@data-repeat-index=\'0\']//a[text()=\'Delete\']')); - $deleteButton->click(); - $I->waitForElementVisible('.modal-popup.confirm button.action-accept', 10); - $I->click('.modal-popup.confirm button.action-accept'); - $I->waitForPageLoad(60); - $buttons = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::xpath('//tr[@data-repeat-index=\'0\']//button')); - } - }" - stepKey="deleteAllExportedFilesOneByOne"/> - <waitForElementVisible selector="{{AdminDataGridTableSection.dataGridEmpty}}" stepKey="waitDataGridEmptyMessageAppears"/> - <see selector="{{AdminDataGridTableSection.dataGridEmpty}}" userInput="We couldn't find any records." stepKey="assertDataGridEmptyMessage"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/DeleteAllExportedFilesActionGroup.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/DeleteAllExportedFilesActionGroup.xml new file mode 100644 index 0000000000000..aa8fad2a1d575 --- /dev/null +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/DeleteAllExportedFilesActionGroup.xml @@ -0,0 +1,32 @@ +<?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="DeleteAllExportedFilesActionGroup"> + <amOnPage url="{{AdminExportIndexPage.url}}" stepKey="goToExportIndexPage"/> + <executeInSelenium + function=" + function ($webdriver) use ($I) { + $buttons = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::xpath('//tr[@data-repeat-index=\'0\']//button')); + while(!empty($buttons)) { + $buttons[0]->click(); + $I->waitForElementVisible('//tr[@data-repeat-index=\'0\']//a[text()=\'Delete\']', 10); + $deleteButton = $webdriver->findElement(\Facebook\WebDriver\WebDriverBy::xpath('//tr[@data-repeat-index=\'0\']//a[text()=\'Delete\']')); + $deleteButton->click(); + $I->waitForElementVisible('.modal-popup.confirm button.action-accept', 10); + $I->click('.modal-popup.confirm button.action-accept'); + $I->waitForPageLoad(60); + $buttons = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::xpath('//tr[@data-repeat-index=\'0\']//button')); + } + }" + stepKey="deleteAllExportedFilesOneByOne"/> + <waitForElementVisible selector="{{AdminDataGridTableSection.dataGridEmpty}}" stepKey="waitDataGridEmptyMessageAppears"/> + <see selector="{{AdminDataGridTableSection.dataGridEmpty}}" userInput="We couldn't find any records." stepKey="assertDataGridEmptyMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/DeleteExportedFileActionGroup.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/DeleteExportedFileActionGroup.xml new file mode 100644 index 0000000000000..78d7293b7437b --- /dev/null +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/DeleteExportedFileActionGroup.xml @@ -0,0 +1,28 @@ +<?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="DeleteExportedFileActionGroup"> + <annotations> + <description>Deletes the provided Grid Index on the Exports grid page.</description> + </annotations> + <arguments> + <argument name="rowIndex" type="string"/> + </arguments> + + <amOnPage url="{{AdminExportIndexPage.url}}" stepKey="goToExportIndexPage"/> + <waitForPageLoad time="30" stepKey="waitFormReload"/> + <click stepKey="clickSelectBtn" selector="{{AdminExportAttributeSection.selectByIndex(rowIndex)}}"/> + <click stepKey="clickOnDelete" selector="{{AdminExportAttributeSection.delete(rowIndex)}}" after="clickSelectBtn"/> + <waitForElementVisible selector="{{AdminProductGridConfirmActionSection.title}}" stepKey="waitForConfirmModal"/> + <click selector="{{AdminProductGridConfirmActionSection.ok}}" stepKey="confirmDelete"/> + <waitForElementVisible selector="{{AdminDataGridTableSection.dataGridEmpty}}" stepKey="waitDataGridEmptyMessageAppears"/> + <see selector="{{AdminDataGridTableSection.dataGridEmpty}}" userInput="We couldn't find any records." stepKey="assertDataGridEmptyMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/DownloadFileByRowIndexActionGroup.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/DownloadFileByRowIndexActionGroup.xml new file mode 100644 index 0000000000000..ec164ff172625 --- /dev/null +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/DownloadFileByRowIndexActionGroup.xml @@ -0,0 +1,24 @@ +<?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="DownloadFileByRowIndexActionGroup"> + <annotations> + <description>Downloads the provided Grid Index on the Exports grid page.</description> + </annotations> + <arguments> + <argument name="rowIndex" type="string"/> + </arguments> + + <reloadPage stepKey="refreshPage"/> + <waitForPageLoad stepKey="waitFormReload"/> + <click stepKey="clickSelectBtn" selector="{{AdminExportAttributeSection.selectByIndex(rowIndex)}}"/> + <click stepKey="clickOnDownload" selector="{{AdminExportAttributeSection.download(rowIndex)}}" after="clickSelectBtn"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/ExportAllProductsActionGroup.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/ExportAllProductsActionGroup.xml new file mode 100644 index 0000000000000..3edbb1b821843 --- /dev/null +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/ExportAllProductsActionGroup.xml @@ -0,0 +1,24 @@ +<?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="ExportAllProductsActionGroup"> + <annotations> + <description>Exports the unfiltered Products list. Validates that the Success Message is present.</description> + </annotations> + + <selectOption selector="{{AdminExportMainSection.entityType}}" userInput="Products" stepKey="selectProductsOption"/> + <waitForElementVisible selector="{{AdminExportMainSection.entityAttributes}}" stepKey="waitForElementVisible" time="5"/> + <scrollTo selector="{{AdminExportAttributeSection.continueBtn}}" stepKey="scrollToContinue"/> + <wait stepKey="waitForScroll" time="5"/> + <click selector="{{AdminExportAttributeSection.continueBtn}}" stepKey="clickContinueButton"/> + <wait stepKey="waitForClick" time="5"/> + <see selector="{{AdminMessagesSection.success}}" userInput="Message is added to queue, wait to get your file soon. Make sure your cron job is running to export the file" stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/ExportProductsFilterByAttributeActionGroup.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/ExportProductsFilterByAttributeActionGroup.xml new file mode 100644 index 0000000000000..f3ca894202893 --- /dev/null +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/ExportProductsFilterByAttributeActionGroup.xml @@ -0,0 +1,31 @@ +<?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"> + <!-- Export products using filtering by attribute --> + <actionGroup name="ExportProductsFilterByAttributeActionGroup"> + <annotations> + <description>Filters Products by the provided Attribute. Exports the filtered Products list. Validates that the Success Message is present.</description> + </annotations> + <arguments> + <argument name="attribute" type="string"/> + <argument name="attributeData" type="string"/> + </arguments> + + <selectOption selector="{{AdminExportMainSection.entityType}}" userInput="Products" stepKey="selectProductsOption"/> + <waitForElementVisible selector="{{AdminExportMainSection.entityAttributes}}" stepKey="waitForElementVisible"/> + <scrollTo selector="{{AdminExportAttributeSection.chooseAttribute('attribute')}}" stepKey="scrollToAttribute"/> + <checkOption selector="{{AdminExportAttributeSection.chooseAttribute('attribute')}}" stepKey="selectAttribute"/> + <fillField selector="{{AdminExportAttributeSection.fillFilter('attribute')}}" userInput="{{attributeData}}" stepKey="setDataInField"/> + <waitForPageLoad stepKey="waitForUserInput"/> + <scrollTo selector="{{AdminExportAttributeSection.continueBtn}}" stepKey="scrollToContinue"/> + <click selector="{{AdminExportAttributeSection.continueBtn}}" stepKey="clickContinueButton"/> + <see selector="{{AdminMessagesSection.success}}" userInput="Message is added to queue, wait to get your file soon" stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportBundleProductTest.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportBundleProductTest.xml index 74345e64a7c9a..369805a94dd84 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportBundleProductTest.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportBundleProductTest.xml @@ -86,7 +86,7 @@ <!-- Login as admin --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="deleteAllExportedFiles" stepKey="clearExportedFilesList"/> + <actionGroup ref="DeleteAllExportedFilesActionGroup" stepKey="clearExportedFilesList"/> </before> <after> <!-- Delete products creations --> @@ -102,7 +102,7 @@ <deleteData createDataKey="createProductAttribute" stepKey="deleteProductAttribute"/> <!-- Delete exported file --> - <actionGroup ref="deleteExportedFile" stepKey="deleteExportedFile"> + <actionGroup ref="DeleteExportedFileActionGroup" stepKey="deleteExportedFile"> <argument name="rowIndex" value="0"/> </actionGroup> <!-- Log out --> @@ -113,14 +113,14 @@ <amOnPage url="{{AdminExportIndexPage.url}}" stepKey="goToExportIndexPage"/> <!-- Export created below products --> - <actionGroup ref="exportAllProducts" stepKey="exportCreatedProducts"/> + <actionGroup ref="ExportAllProductsActionGroup" stepKey="exportCreatedProducts"/> <!-- Run cron --> <magentoCLI command="cron:run" stepKey="runCron3"/> <magentoCLI command="cron:run" stepKey="runCron4"/> <!-- Download product --> - <actionGroup ref="downloadFileByRowIndex" stepKey="downloadCreatedProducts"> + <actionGroup ref="DownloadFileByRowIndexActionGroup" stepKey="downloadCreatedProducts"> <argument name="rowIndex" value="0"/> </actionGroup> </test> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportGroupedProductWithSpecialPriceTest.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportGroupedProductWithSpecialPriceTest.xml index b0ac6a4bc95ac..d9b93196db060 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportGroupedProductWithSpecialPriceTest.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportGroupedProductWithSpecialPriceTest.xml @@ -54,7 +54,7 @@ <!-- Login as admin --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="deleteAllExportedFiles" stepKey="clearExportedFilesList"/> + <actionGroup ref="DeleteAllExportedFilesActionGroup" stepKey="clearExportedFilesList"/> </before> <after> <!-- Deleted created products --> @@ -66,7 +66,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete exported file --> - <actionGroup ref="deleteExportedFile" stepKey="deleteExportedFile"> + <actionGroup ref="DeleteExportedFileActionGroup" stepKey="deleteExportedFile"> <argument name="rowIndex" value="0"/> </actionGroup> <!-- Log out --> @@ -78,14 +78,14 @@ <waitForPageLoad stepKey="waitForExportIndexPageLoad"/> <!-- Export created below products --> - <actionGroup ref="exportAllProducts" stepKey="exportCreatedProducts"/> + <actionGroup ref="ExportAllProductsActionGroup" stepKey="exportCreatedProducts"/> <!-- Run cron --> <magentoCLI command="cron:run" stepKey="runCron3"/> <magentoCLI command="cron:run" stepKey="runCron4"/> <!-- Download product --> - <actionGroup ref="downloadFileByRowIndex" stepKey="downloadCreatedProducts"> + <actionGroup ref="DownloadFileByRowIndexActionGroup" stepKey="downloadCreatedProducts"> <argument name="rowIndex" value="0"/> </actionGroup> </test> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportImportConfigurableProductWithImagesTest.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportImportConfigurableProductWithImagesTest.xml index f0ec7dbd0706b..4a22d3d3d43f0 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportImportConfigurableProductWithImagesTest.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportImportConfigurableProductWithImagesTest.xml @@ -128,7 +128,7 @@ <!-- Login as admin --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="deleteAllExportedFiles" stepKey="clearExportedFilesList"/> + <actionGroup ref="DeleteAllExportedFilesActionGroup" stepKey="clearExportedFilesList"/> </before> <after> <!-- Remove downloadable domains --> @@ -159,7 +159,7 @@ <amOnPage url="{{AdminExportIndexPage.url}}" stepKey="goToExportIndexPage"/> <!-- Set Export Settings: Entity Type > Products, SKU > ConfProd's sku and press "Continue" --> - <actionGroup ref="exportProductsFilterByAttribute" stepKey="exportProductBySku"> + <actionGroup ref="ExportProductsFilterByAttributeActionGroup" stepKey="exportProductBySku"> <argument name="attribute" value="sku"/> <argument name="attributeData" value="$$createExportImportConfigurableProduct.sku$$"/> </actionGroup> @@ -169,7 +169,7 @@ <magentoCLI command="cron:run" stepKey="runCronSecondTime"/> <!-- Save exported file: file successfully downloaded --> - <actionGroup ref="downloadFileByRowIndex" stepKey="downloadCreatedProducts"> + <actionGroup ref="DownloadFileByRowIndexActionGroup" stepKey="downloadCreatedProducts"> <argument name="rowIndex" value="0"/> </actionGroup> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleAndConfigurableProductsWithCustomOptionsTest.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleAndConfigurableProductsWithCustomOptionsTest.xml index 1870cb21bd55b..397c1ee57e7f5 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleAndConfigurableProductsWithCustomOptionsTest.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleAndConfigurableProductsWithCustomOptionsTest.xml @@ -79,7 +79,7 @@ <!-- Login as admin --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="deleteAllExportedFiles" stepKey="clearExportedFilesList"/> + <actionGroup ref="DeleteAllExportedFilesActionGroup" stepKey="clearExportedFilesList"/> </before> <after> <!-- Delete configurable product creation --> @@ -90,7 +90,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete exported file --> - <actionGroup ref="deleteExportedFile" stepKey="deleteExportedFile"> + <actionGroup ref="DeleteExportedFileActionGroup" stepKey="deleteExportedFile"> <argument name="rowIndex" value="0"/> </actionGroup> <!-- Log out --> @@ -102,7 +102,7 @@ <waitForPageLoad stepKey="waitForExportIndexPageLoad"/> <!-- Fill entity attributes data --> - <actionGroup ref="exportProductsFilterByAttribute" stepKey="exportProductBySku"> + <actionGroup ref="ExportProductsFilterByAttributeActionGroup" stepKey="exportProductBySku"> <argument name="attribute" value="sku"/> <argument name="attributeData" value="$$createConfigProduct.sku$$"/> </actionGroup> @@ -112,7 +112,7 @@ <magentoCLI command="cron:run" stepKey="runCron4"/> <!-- Download product --> - <actionGroup ref="downloadFileByRowIndex" stepKey="downloadCreatedProducts"> + <actionGroup ref="DownloadFileByRowIndexActionGroup" stepKey="downloadCreatedProducts"> <argument name="rowIndex" value="0"/> </actionGroup> </test> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAndConfigurableProductsWithAssignedImagesTest.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAndConfigurableProductsWithAssignedImagesTest.xml index f6690199d63fe..e00346654ecf4 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAndConfigurableProductsWithAssignedImagesTest.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAndConfigurableProductsWithAssignedImagesTest.xml @@ -95,7 +95,7 @@ <!-- Login as admin --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="deleteAllExportedFiles" stepKey="clearExportedFilesList"/> + <actionGroup ref="DeleteAllExportedFilesActionGroup" stepKey="clearExportedFilesList"/> </before> <after> <!-- Delete configurable product creation --> @@ -106,7 +106,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete exported file --> - <actionGroup ref="deleteExportedFile" stepKey="deleteExportedFile"> + <actionGroup ref="DeleteExportedFileActionGroup" stepKey="deleteExportedFile"> <argument name="rowIndex" value="0"/> </actionGroup> <!-- Log out --> @@ -117,7 +117,7 @@ <amOnPage url="{{AdminExportIndexPage.url}}" stepKey="goToExportIndexPage"/> <!-- Fill entity attributes data --> - <actionGroup ref="exportProductsFilterByAttribute" stepKey="exportProductBySku"> + <actionGroup ref="ExportProductsFilterByAttributeActionGroup" stepKey="exportProductBySku"> <argument name="attribute" value="sku"/> <argument name="attributeData" value="$$createConfigProduct.sku$$"/> </actionGroup> @@ -127,7 +127,7 @@ <magentoCLI command="cron:run" stepKey="runCron4"/> <!-- Download product --> - <actionGroup ref="downloadFileByRowIndex" stepKey="downloadCreatedProducts"> + <actionGroup ref="DownloadFileByRowIndexActionGroup" stepKey="downloadCreatedProducts"> <argument name="rowIndex" value="0"/> </actionGroup> </test> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAssignedToMainWebsiteAndConfigurableProductAssignedToCustomWebsiteTest.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAssignedToMainWebsiteAndConfigurableProductAssignedToCustomWebsiteTest.xml index 271b4621d1a96..04be8f3ae823e 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAssignedToMainWebsiteAndConfigurableProductAssignedToCustomWebsiteTest.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAssignedToMainWebsiteAndConfigurableProductAssignedToCustomWebsiteTest.xml @@ -77,7 +77,7 @@ <!-- Login as admin --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="deleteAllExportedFiles" stepKey="clearExportedFilesList"/> + <actionGroup ref="DeleteAllExportedFilesActionGroup" stepKey="clearExportedFilesList"/> </before> <after> <!-- Delete simple product --> @@ -91,7 +91,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete exported file --> - <actionGroup ref="deleteExportedFile" stepKey="deleteExportedFile"> + <actionGroup ref="DeleteExportedFileActionGroup" stepKey="deleteExportedFile"> <argument name="rowIndex" value="0"/> </actionGroup> <!-- Log out --> @@ -103,14 +103,14 @@ <waitForPageLoad stepKey="waitForExportIndexPageLoad"/> <!-- Export created below products --> - <actionGroup ref="exportAllProducts" stepKey="exportCreatedProducts"/> + <actionGroup ref="ExportAllProductsActionGroup" stepKey="exportCreatedProducts"/> <!-- Run cron --> <magentoCLI command="cron:run" stepKey="runCron3"/> <magentoCLI command="cron:run" stepKey="runCron4"/> <!-- Download product --> - <actionGroup ref="downloadFileByRowIndex" stepKey="downloadCreatedProducts"> + <actionGroup ref="DownloadFileByRowIndexActionGroup" stepKey="downloadCreatedProducts"> <argument name="rowIndex" value="0"/> </actionGroup> </test> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductWithCustomAttributeTest.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductWithCustomAttributeTest.xml index 238a3286dc40d..8553fb8a2cf7e 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductWithCustomAttributeTest.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductWithCustomAttributeTest.xml @@ -34,7 +34,7 @@ <!-- Login as admin --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="deleteAllExportedFiles" stepKey="clearExportedFilesList"/> + <actionGroup ref="DeleteAllExportedFilesActionGroup" stepKey="clearExportedFilesList"/> </before> <after> <!-- Delete product creations --> @@ -43,7 +43,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete exported file --> - <actionGroup ref="deleteExportedFile" stepKey="deleteExportedFile"> + <actionGroup ref="DeleteExportedFileActionGroup" stepKey="deleteExportedFile"> <argument name="rowIndex" value="0"/> </actionGroup> <!-- Log out --> @@ -55,14 +55,14 @@ <waitForPageLoad stepKey="waitForExportIndexPageLoad"/> <!-- Export created below products --> - <actionGroup ref="exportAllProducts" stepKey="exportCreatedProducts"/> + <actionGroup ref="ExportAllProductsActionGroup" stepKey="exportCreatedProducts"/> <!-- Run cron --> <magentoCLI command="cron:run" stepKey="runCron3"/> <magentoCLI command="cron:run" stepKey="runCron4"/> <!-- Download product --> - <actionGroup ref="downloadFileByRowIndex" stepKey="downloadCreatedProducts"> + <actionGroup ref="DownloadFileByRowIndexActionGroup" stepKey="downloadCreatedProducts"> <argument name="rowIndex" value="0"/> </actionGroup> </test> From 0262f1428561f5c329a50bfbd62714fa58e175be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Fri, 29 Nov 2019 17:26:23 +0100 Subject: [PATCH 147/586] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- .../Test/AdminDashboardWithChartsChart.xml | 2 +- ...thOnlinePaymentIncludingTaxAndDiscount.xml | 2 +- .../Mftf/Test/AdminAddBundleItemsTest.xml | 10 +- ...undleProductToCartFromWishListPageTest.xml | 2 +- .../AdminAddDefaultImageBundleProductTest.xml | 18 +- .../AdminAddDefaultVideoBundleProductTest.xml | 10 +- ...inAssociateBundleProductToWebsitesTest.xml | 10 +- .../Test/AdminAttributeSetSelectionTest.xml | 4 +- .../AdminBasicBundleProductAttributesTest.xml | 6 +- .../AdminBundleProductSetEditContentTest.xml | 6 +- ...CreateAndEditBundleProductSettingsTest.xml | 18 +- .../Mftf/Test/AdminDeleteABundleProduct.xml | 6 +- .../AdminDeleteBundleDynamicProductTest.xml | 2 +- .../AdminDeleteBundleFixedProductTest.xml | 2 +- .../AdminEditRelatedBundleProductTest.xml | 10 +- .../AdminFilterProductListByBundleProduct.xml | 4 +- .../Test/AdminMassDeleteBundleProducts.xml | 8 +- .../Test/AdminProductBundleCreationTest.xml | 6 +- ...minRemoveDefaultImageBundleProductTest.xml | 24 +- ...minRemoveDefaultVideoBundleProductTest.xml | 10 +- ...sUpdateAttributesForBundleProductsTest.xml | 6 +- .../Test/BundleProductFixedPricingTest.xml | 8 +- .../BundleProductWithTierPriceInCartTest.xml | 4 +- ...urrencyChangingBundleProductInCartTest.xml | 4 +- .../EnableDisableBundleProductStatusTest.xml | 6 +- .../Test/Mftf/Test/EndToEndB2CAdminTest.xml | 8 +- .../MassEnableDisableBundleProductsTest.xml | 8 +- .../Test/NewBundleProductSelectionTest.xml | 2 +- ...NewProductsListWidgetBundleProductTest.xml | 4 +- .../StorefrontAddBundleOptionsToCartTest.xml | 8 +- .../Mftf/Test/StorefrontAdminEditDataTest.xml | 12 +- .../Mftf/Test/StorefrontBundleCartTest.xml | 12 +- .../StorefrontBundleProductDetailsTest.xml | 6 +- ...undleProductShownInCategoryListAndGrid.xml | 6 +- ...rontCheckBundleProductOptionTierPrices.xml | 4 +- ...tCustomerSelectAndSetBundleOptionsTest.xml | 8 +- .../Test/StorefrontEditBundleProductTest.xml | 10 +- ...ontGoToDetailsPageWhenAddingToCartTest.xml | 4 +- ...torefrontSortBundleProductsByPriceTest.xml | 2 +- ...oductPricesForCombinationOfOptionsTest.xml | 2 +- .../AddCategoryImageActionGroup.xml | 31 + .../AddCrossSellProductBySkuActionGroup.xml | 32 + ...ductAttributeInProductModalActionGroup.xml | 28 + ...AddProductCustomOptionFieldActionGroup.xml | 31 + .../AddProductCustomOptionFileActionGroup.xml | 30 + .../AddProductImageActionGroup.xml | 26 + ...rtFromStorefrontProductPageActionGroup.xml | 22 + .../AddRelatedProductBySkuActionGroup.xml | 32 + ... => AddSimpleProductToCartActionGroup.xml} | 8 +- .../AddSpecialPriceToProductActionGroup.xml | 28 + ...rtFromStorefrontProductPageActionGroup.xml | 28 + .../AddUpSellProductBySkuActionGroup.xml | 26 + ...AdvancedPricingToTheProductActionGroup.xml | 12 - ...PricingToTheProductExtendedActionGroup.xml | 21 + ...dUnassignedAttributeToGroupActionGroup.xml | 21 + ...tProductCustomOptionVisibleActionGroup.xml | 19 + ...ertProductHasNoCustomOptionActionGroup.xml | 15 + ...rtProductHasNoCustomOptionsActionGroup.xml | 16 + ...dminAssignProductToCategoryActionGroup.xml | 25 + .../ActionGroup/AdminCategoryActionGroup.xml | 459 ----------- .../AdminCategoryAssignProductActionGroup.xml | 25 + ...singInCategoryProductsGridActionGroup.xml} | 9 +- ...itionInCategoryProductsGridActionGroup.xml | 18 + ...ckOnAdvancedInventoryButtonActionGroup.xml | 19 + ...lickOnAdvancedInventoryLinkActionGroup.xml | 11 - ...ateAttributeFromProductPageActionGroup.xml | 27 + ...uteFromProductPageWithScopeActionGroup.xml | 18 + ...teAttributeWithSearchWeightActionGroup.xml | 27 + ...TwoStoreViesFromProductPageActionGroup.xml | 35 + ...CreateCatalogProductWidgetActionGroup.xml} | 12 - ...reateRecentlyProductsWidgetActionGroup.xml | 22 + ...eSearchableProductAttributeActionGroup.xml | 16 + ...ductWithTextOptionCharLimitActionGroup.xml | 47 ++ ...leteAllProductCustomOptionsActionGroup.xml | 26 + .../AdminDeleteCategoryByNameActionGroup.xml | 23 + ...inDeleteProductCustomOptionActionGroup.xml | 15 + ...lProductAttributePropertiesActionGroup.xml | 12 - ...ProductCountryOfManufactureActionGroup.xml | 17 + ...AdminProcessProductWebsitesActionGroup.xml | 17 + .../ActionGroup/AdminProductActionGroup.xml | 759 ------------------ ...AdminProductAddSpecialPriceActionGroup.xml | 28 + ...ricingNewCustomerGroupPriceActionGroup.xml | 24 + .../AdminProductAttributeActionGroup.xml | 379 --------- .../AdminProductAttributeSetActionGroup.xml | 126 +-- .../AdminProductGridActionGroup.xml | 445 ---------- ...teAttributeSetWithAttributeActionGroup.xml | 35 + ...illTextAttributeValueByNameActionGroup.xml | 23 + ...oductPageSelectAttributeSetActionGroup.xml | 23 + .../AdminSetProductDisabledActionGroup.xml | 15 + ...tchScopeForProductAttributeActionGroup.xml | 19 + ...scountsPercentageOfProductsActionGroup.xml | 27 + ...escriptionInProductEditFormActionGroup.xml | 18 + ...roductImageAdminProductPageActionGroup.xml | 23 + ...tImageNotInAdminProductPageActionGroup.xml | 23 + ...NotInStorefrontProductPage2ActionGroup.xml | 24 + ...eNotInStorefrontProductPageActionGroup.xml | 24 + ...ImageStorefrontProductPage2ActionGroup.xml | 24 + ...tImageStorefrontProductPageActionGroup.xml | 24 + ...ductInStorefrontProductPageActionGroup.xml | 34 +- ...tProductIsAssignedToWebsiteActionGroup.xml | 15 + ...oductIsNotAssignedToWebsiteActionGroup.xml | 15 + ...dSkuInStorefrontProductPageActionGroup.xml | 26 + ...PageByCustomAttributeUrlKeyActionGroup.xml | 26 + ...roductNameInProductEditFormActionGroup.xml | 17 + .../AssertProductOnAdminGridActionGroup.xml | 2 +- ...AssertProductOnCategoryPageActionGroup.xml | 19 + ...latedUpSellCrossSellSectionActionGroup.xml | 24 + ...sAvailableInProductWebsitesActionGroup.xml | 19 + ...tAvailableInProductWebsitesActionGroup.xml | 15 + .../CategoryPresentActionGroup.xml | 26 + .../ChangeSeoUrlKeyActionGroup.xml | 24 + ...angeSeoUrlKeyForSubCategoryActionGroup.xml | 25 + ...atusProductUsingProductGridActionGroup.xml | 38 + ...eConditionsProductAttributeActionGroup.xml | 25 + ...tributeInMoreInformationTabActionGroup.xml | 24 + ...buteNotInMoreInformationTabActionGroup.xml | 22 + .../CheckCategoryImageInAdminActionGroup.xml | 28 + ...CategoryNameIsRequiredFieldActionGroup.xml | 23 + .../CheckCategoryOnStorefrontActionGroup.xml | 24 + ...eckCustomizableOptionImportActionGroup.xml | 27 + ...RequiredFieldsInProductFormActionGroup.xml | 25 + .../ClearProductsFilterActionGroup.xml | 20 + ...ConfirmChangeInputTypeModalActionGroup.xml | 20 + ...eAttributeDropdownNthOptionActionGroup.xml | 26 + ...eDropdownNthOptionAsDefaultActionGroup.xml | 18 + .../ActionGroup/CreateCategoryActionGroup.xml | 30 + .../CreateCustomRadioOptionsActionGroup.xml | 43 + .../CreateDefaultAttributeSetActionGroup.xml | 25 + .../CreateProductAttributeActionGroup.xml | 25 + ...oductAttributeWithDateFieldActionGroup.xml | 23 + ...oductAttributeWithTextFieldActionGroup.xml | 20 + ...impleProductAndAddToWebsiteActionGroup.xml | 34 + ...atedProductConnectToWebsiteActionGroup.xml | 29 + .../ActionGroup/CustomOptionsActionGroup.xml | 172 ---- ...cateProductUsingProductGridActionGroup.xml | 21 + ...AllProductsUsingProductGridActionGroup.xml | 29 + .../DeleteAttributeSetByLabelActionGroup.xml | 30 + .../ActionGroup/DeleteCategoryActionGroup.xml | 31 + ...leteDefaultCategoryChildrenActionGroup.xml | 35 + .../DeleteMostRecentCategoryActionGroup.xml | 25 + .../DeleteProductAttributeActionGroup.xml | 21 + ...uctAttributeByAttributeCodeActionGroup.xml | 18 +- ...leteProductAttributeByLabelActionGroup.xml | 29 + .../DeleteProductByNameActionGroup.xml | 25 + .../DeleteProductBySkuActionGroup.xml | 34 + ...leteProductUsingProductGridActionGroup.xml | 35 + .../DeleteProductsByKeywordActionGroup.xml | 31 + .../DeleteProductsIfTheyExistActionGroup.xml | 24 + .../ExpandAdminProductSectionActionGroup.xml | 25 + .../FillAdminSimpleProductFormActionGroup.xml | 38 + .../FillCategoryFormActionGroup.xml | 23 + ...ategoryNameAndUrlKeyAndSaveActionGroup.xml | 29 + .../FillMainProductFormActionGroup.xml | 28 + ...FillMainProductFormByStringActionGroup.xml | 32 + ...FillMainProductFormNoWeightActionGroup.xml | 26 + .../FillNewProductCategoryActionGroup.xml | 34 + ...ductNameAndSkuInProductFormActionGroup.xml | 22 + .../FilterAndSelectProductActionGroup.xml | 30 + ...uctAttributeByAttributeCodeActionGroup.xml | 24 + ...ctAttributeByAttributeLabelActionGroup.xml | 23 + ...ductAttributeByDefaultLabelActionGroup.xml | 24 + ...teSetGridByAttributeSetNameActionGroup.xml | 25 + ...ProductGridByDisabledStatusActionGroup.xml | 22 + ...rProductGridByEnabledStatusActionGroup.xml | 22 + .../FilterProductGridByName2ActionGroup.xml | 25 + .../FilterProductGridByNameActionGroup.xml | 25 + ...lterProductGridByPriceRangeActionGroup.xml | 26 + ...ProductGridBySetNewFromDateActionGroup.xml | 22 + .../FilterProductGridBySku2ActionGroup.xml | 25 + .../FilterProductGridBySkuActionGroup.xml | 25 + ...lterProductGridBySkuAndNameActionGroup.xml | 25 + .../GoToAdminCategoryPageByIdActionGroup.xml | 23 + .../GoToAttributeGridPageActionGroup.xml | 18 + .../GoToAttributeSetByNameActionGroup.xml | 25 + .../GoToCreateCategoryPageActionGroup.xml | 25 + .../GoToCreateProductPageActionGroup.xml | 27 + .../GoToProductCatalogPageActionGroup.xml | 20 + .../GoToProductPageViaIDActionGroup.xml | 21 + ...oSpecifiedCreateProductPageActionGroup.xml | 25 + ...ontCategoryPageByParametersActionGroup.xml | 28 + .../GoToSubCategoryPageActionGroup.xml | 29 + ...tProductCustomizableOptionsActionGroup.xml | 29 + ...tAttributeGridToDefaultViewActionGroup.xml | 21 + ...setProductGridToDefaultViewActionGroup.xml | 19 + .../NavigateToCreatedCategoryActionGroup.xml | 26 + ...teToCreatedProductAttributeActionGroup.xml | 25 + ...ateToCreatedProductEditPageActionGroup.xml | 37 + ...igateToEditProductAttributeActionGroup.xml | 26 + .../NavigateToMediaGalleryActionGroup.xml | 25 + ...penCategoryFromCategoryTreeActionGroup.xml | 27 + ...ingRowXColumnYInProductGridActionGroup.xml | 22 + .../ProductSetAdvancedPricingActionGroup.xml | 38 + ...SetAdvancedTierFixedPricingActionGroup.xml | 15 + .../ProductSetWebsiteActionGroup.xml | 28 + .../RemoveCategoryFromProductActionGroup.xml | 19 + .../RemoveCategoryImageActionGroup.xml | 24 + .../RemoveProductImageActionGroup.xml | 20 + .../RemoveProductImageByNameActionGroup.xml | 21 + .../ResetImportOptionFilterActionGroup.xml | 20 + ...setProductGridToDefaultViewActionGroup.xml | 23 + .../SaveAttributeSetActionGroup.xml | 19 + .../SaveCategoryFormActionGroup.xml | 20 + .../SaveProductAttributeActionGroup.xml | 21 + .../SaveProductAttributeInUseActionGroup.xml | 21 + .../SaveProductFormActionGroup.xml | 22 + ...veProductFormNoSuccessCheckActionGroup.xml | 19 + .../SearchForProductOnBackendActionGroup.xml | 22 - ...chForProductOnBackendByNameActionGroup.xml | 22 + ...SearchProductGridByKeyword2ActionGroup.xml | 23 + .../SearchProductGridByKeywordActionGroup.xml | 23 + .../SelectProductInWebsitesActionGroup.xml | 24 + .../SetCategoryByNameActionGroup.xml | 21 + .../SetProductUrlKeyActionGroup.xml | 22 + .../SetProductUrlKeyByStringActionGroup.xml | 22 + .../SortProductsByIdAscendingActionGroup.xml | 19 + .../SortProductsByIdDescendingActionGroup.xml | 19 + ...AddCategoryProductToCompareActionGroup.xml | 25 + ...orefrontAddProductToCompareActionGroup.xml | 23 + ...rontAddSimpleProductWithQtyActionGroup.xml | 17 + ...ontAssertActiveProductImageActionGroup.xml | 17 + ...rtFotoramaImageAvailabilityActionGroup.xml | 17 + ...tProductImagesOnProductPageActionGroup.xml | 8 - ...uctInRecentlyComparedWidgetActionGroup.xml | 22 + ...ductInRecentlyOrderedWidgetActionGroup.xml | 22 + ...efrontAssertProductInWidgetActionGroup.xml | 26 - ...tProductPriceOnCategoryPageActionGroup.xml | 21 + .../StorefrontCategoryActionGroup.xml | 124 --- ...ntCategoryPageSortAscendingActionGroup.xml | 17 + ...tCategoryPageSortDescendingActionGroup.xml | 17 + ...rontCategoryPageSortProductActionGroup.xml | 12 - ...CheckAddToCartButtonAbsenceActionGroup.xml | 18 + .../StorefrontCheckCategoryActionGroup.xml | 25 + ...tCheckCategorySimpleProductActionGroup.xml | 26 + ...tCheckCompareSidebarProductActionGroup.xml | 21 + ...ntCheckCompareSimpleProductActionGroup.xml | 25 + ...ssingInCategoryProductsPageActionGroup.xml | 7 - ...refrontCheckProductPositionActionGroup.xml | 18 + ...CheckProductPriceInCategoryActionGroup.xml | 12 +- ...torefrontCheckSimpleProductActionGroup.xml | 30 + .../StorefrontClearCompareActionGroup.xml | 24 + .../StorefrontCompareActionGroup.xml | 95 --- .../StorefrontGoToCategoryPageActionGroup.xml | 9 +- ...orefrontGoToSubCategoryPageActionGroup.xml | 18 + ...rontOpenAndCheckComparisionActionGroup.xml | 22 + .../StorefrontOpenProductPageActionGroup.xml | 11 - ...penProductPageOnSecondStoreActionGroup.xml | 22 + .../StorefrontProductActionGroup.xml | 90 --- .../StorefrontProductPageActionGroup.xml | 87 -- ...witchCategoryViewToListModeActionGroup.xml | 19 + .../SwitchCategoryStoreViewActionGroup.xml | 33 + ...witchCategoryToAllStoreViewActionGroup.xml | 31 + .../SwitchToTheNewStoreViewActionGroup.xml | 26 + .../TestDynamicValidationHintActionGroup.xml | 30 + .../ToggleProductEnabledActionGroup.xml | 18 + .../UnassignAttributeFromGroupActionGroup.xml | 26 + .../UnassignWebsiteFromProductActionGroup.xml | 15 + ...erifyCategoryPageParametersActionGroup.xml | 29 + .../ViewProductInAdminGridActionGroup.xml | 31 + .../Test/Mftf/Test/AddToCartCrossSellTest.xml | 10 +- .../AdminAddDefaultImageSimpleProductTest.xml | 16 +- ...AdminAddDefaultImageVirtualProductTest.xml | 16 +- .../AdminAddDefaultVideoSimpleProductTest.xml | 10 +- ...AdminAddDefaultVideoVirtualProductTest.xml | 6 +- .../Test/AdminAddImageForCategoryTest.xml | 16 +- .../AdminAddImageToWYSIWYGCatalogTest.xml | 2 +- .../AdminAddImageToWYSIWYGProductTest.xml | 2 +- .../AdminAddInStockProductToTheCartTest.xml | 2 +- .../Test/AdminApplyTierPriceToProductTest.xml | 18 +- ...signProductAttributeToAttributeSetTest.xml | 4 +- ...inBackorderAllowedAddProductToCartTest.xml | 2 +- .../Test/AdminChangeProductAttributeSet.xml | 4 +- ...oductPriceWithDisabledChildProductTest.xml | 2 +- ...StockProductIsNotVisibleInCategoryTest.xml | 2 +- ...tOfStockProductIsVisibleInCategoryTest.xml | 2 +- .../AdminCloneProductWithDuplicateUrlTest.xml | 12 +- ...CreateAndEditSimpleProductSettingsTest.xml | 16 +- ...reateAndEditVirtualProductSettingsTest.xml | 18 +- .../Test/AdminCreateAndSwitchProductType.xml | 26 +- .../AdminCreateAttributeSetEntityTest.xml | 8 +- ...AdminCreateCategoryFromProductPageTest.xml | 8 +- ...AdminCreateCategoryWithAnchorFieldTest.xml | 2 +- ...eateCategoryWithCustomRootCategoryTest.xml | 4 +- ...CreateCategoryWithInactiveCategoryTest.xml | 2 +- ...eCategoryWithInactiveIncludeInMenuTest.xml | 2 +- ...inCreateCategoryWithProductsGridFilter.xml | 8 +- ...inCreateCategoryWithRequiredFieldsTest.xml | 2 +- ...mProductAttributeWithDropdownFieldTest.xml | 4 +- ...dminCreateDropdownProductAttributeTest.xml | 6 +- ...ibleInStorefrontAdvancedSearchFormTest.xml | 6 +- .../Test/AdminCreateDuplicateCategoryTest.xml | 4 +- .../Test/AdminCreateDuplicateProductTest.xml | 10 +- ...ibleInStorefrontAdvancedSearchFormTest.xml | 6 +- ...nCreateNewAttributeFromProductPageTest.xml | 4 +- ...AdminCreateNewAttributeFromProductTest.xml | 4 +- ...AdminCreateNewGroupForAttributeSetTest.xml | 14 +- ...ateProductAttributeFromProductPageTest.xml | 4 +- ...eProductAttributeRequiredTextFieldTest.xml | 4 +- .../AdminCreateProductCustomAttributeSet.xml | 4 +- .../AdminCreateProductDuplicateUrlkeyTest.xml | 2 +- ...CreateRootCategoryAndSubcategoriesTest.xml | 12 +- ...inCreateRootCategoryRequiredFieldsTest.xml | 2 +- .../Test/AdminCreateSimpleProductTest.xml | 4 +- ...untryOfManufactureAttributeSKUMaskTest.xml | 2 +- ...dminCreateSimpleProductWithUnicodeTest.xml | 4 +- ...inCreateTextEditorProductAttributeTest.xml | 18 +- ...tualProductOutOfStockWithTierPriceTest.xml | 2 +- ...CustomOptionsSuiteAndImportOptionsTest.xml | 2 +- ...roductWithTierPriceForGeneralGroupTest.xml | 2 +- .../Mftf/Test/AdminDeleteAttributeSetTest.xml | 2 +- ...minDeleteConfigurableChildProductsTest.xml | 4 +- ...wnProductAttributeFromAttributeSetTest.xml | 6 +- .../Test/AdminDeleteProductAttributeTest.xml | 8 +- ...AdminDeleteProductWithCustomOptionTest.xml | 2 +- ...roductsImageInCaseOfMultipleStoresTest.xml | 40 +- .../Test/AdminDeleteSimpleProductTest.xml | 2 +- ...ldProductAttributeFromAttributeSetTest.xml | 8 +- .../Test/AdminDeleteVirtualProductTest.xml | 2 +- ...sableProductOnChangingAttributeSetTest.xml | 2 +- ...dminEditTextEditorProductAttributeTest.xml | 2 +- ...lterByNameByStoreViewOnProductGridTest.xml | 6 +- ...CategoryProductsUsingScopeSelectorTest.xml | 6 +- ...dPageNumberAfterSaveAndCloseActionTest.xml | 4 +- ...CustomizableOptionToProductWithSKUTest.xml | 10 +- .../AdminMassChangeProductsStatusTest.xml | 4 +- .../Test/AdminMassProductPriceUpdateTest.xml | 4 +- ...UpdateProductAttributesGlobalScopeTest.xml | 6 +- ...ductAttributesMissingRequiredFieldTest.xml | 2 +- ...ateProductAttributesStoreViewScopeTest.xml | 8 +- ...sUpdateProductStatusStoreViewScopeTest.xml | 18 +- ...CategoryFromParentAnchoredCategoryTest.xml | 2 +- ...oryToAnotherPositionInCategoryTreeTest.xml | 2 +- .../AdminMoveProductBetweenCategoriesTest.xml | 8 +- ...dminNavigateMultipleUpSellProductsTest.xml | 10 +- ...egoryIndexerInUpdateOnScheduleModeTest.xml | 6 +- ...nAssignedToCategoryWithoutCustomURLKey.xml | 10 +- ...ductGridFilteringByCustomAttributeTest.xml | 10 +- ...roductGridFilteringByDateAttributeTest.xml | 4 +- ...ctImageAssignmentForMultipleStoresTest.xml | 12 +- ...AdminProductTypeSwitchingOnEditingTest.xml | 8 +- ...dminRemoveCustomOptionsFromProductTest.xml | 38 +- ...minRemoveDefaultImageSimpleProductTest.xml | 20 +- ...inRemoveDefaultImageVirtualProductTest.xml | 20 +- ...minRemoveDefaultVideoSimpleProductTest.xml | 10 +- ...inRemoveDefaultVideoVirtualProductTest.xml | 6 +- .../AdminRemoveImageAffectsAllScopesTest.xml | 22 +- .../Test/AdminRemoveImageFromCategoryTest.xml | 20 +- ...ctedUserAddCategoryFromProductPageTest.xml | 16 +- ...ToAssociateSimpleProductToWebsitesTest.xml | 6 +- .../Test/AdminSimpleProductImagesTest.xml | 36 +- .../AdminSimpleProductSetEditContentTest.xml | 6 +- .../AdminSimpleSetEditRelatedProductsTest.xml | 20 +- .../Mftf/Test/AdminSortingByWebsitesTest.xml | 4 +- ...gnProductAttributeFromAttributeSetTest.xml | 6 +- .../AdminUpdateCategoryStoreUrlKeyTest.xml | 10 +- ...rifyDataOverridingOnStoreViewLevelTest.xml | 4 +- ...rifyDataOverridingOnStoreViewLevelTest.xml | 4 +- ...dminUpdateSimpleProductTieredPriceTest.xml | 4 +- ...RegularPriceInStockDisabledProductTest.xml | 4 +- ...WithRegularPriceInStockEnabledFlatTest.xml | 4 +- ...PriceInStockNotVisibleIndividuallyTest.xml | 4 +- ...arPriceInStockUnassignFromCategoryTest.xml | 4 +- ...ceInStockVisibleInCatalogAndSearchTest.xml | 4 +- ...arPriceInStockVisibleInCatalogOnlyTest.xml | 4 +- ...larPriceInStockVisibleInSearchOnlyTest.xml | 4 +- ...gularPriceInStockWithCustomOptionsTest.xml | 4 +- ...eProductWithRegularPriceOutOfStockTest.xml | 4 +- ...rPriceInStockVisibleInCategoryOnlyTest.xml | 2 +- ...eInStockVisibleInCategoryAndSearchTest.xml | 2 +- ...rPriceInStockVisibleInCategoryOnlyTest.xml | 2 +- ...tOfStockVisibleInCategoryAndSearchTest.xml | 2 +- .../Mftf/Test/AdminVerifyProductOrderTest.xml | 2 +- .../AdminVirtualProductSetEditContentTest.xml | 6 +- ...AdminVirtualSetEditRelatedProductsTest.xml | 6 +- .../AdvanceCatalogSearchSimpleProductTest.xml | 4 +- .../Test/CheckTierPricingOfProductsTest.xml | 16 +- ...bleOptionTextInputLengthValidationHint.xml | 6 +- .../Test/CreateProductAttributeEntityTest.xml | 68 +- .../Test/Mftf/Test/DeleteCategoriesTest.xml | 18 +- ...UsedInConfigurableProductAttributeTest.xml | 4 +- ...cheAfterChangingCategoryPageLayoutTest.xml | 2 +- .../Test/Mftf/Test/EndToEndB2CAdminTest.xml | 64 +- .../Mftf/Test/EndToEndB2CGuestUserTest.xml | 28 +- .../Mftf/Test/EndToEndB2CLoggedInUserTest.xml | 14 +- .../SimpleProductTwoCustomOptionsTest.xml | 10 +- ...rontCatalogNavigationMenuUIDesktopTest.xml | 4 +- ...chorIsVisibleOnViewportOnceClickedTest.xml | 10 +- .../StorefrontProductNameWithDoubleQuote.xml | 10 +- ...torefrontProductWithEmptyAttributeTest.xml | 4 +- ...orefrontRememberCategoryPaginationTest.xml | 136 ++-- ...ceForDifferentTimezonesForWebsitesTest.xml | 2 +- ...ctAndProductCategoryPartialReindexTest.xml | 8 +- ...ldCategoriesShouldNotIncludeInMenuTest.xml | 8 +- ...mportConfigurableProductWithImagesTest.xml | 10 +- ...eroMaximumQtyAllowedInShoppingCartTest.xml | 2 +- ...nfigurableProductWithSpecialPricesTest.xml | 8 +- .../AdminDeleteCatalogPriceRuleEntityTest.xml | 2 +- .../Test/AdminDeleteCatalogPriceRuleTest.xml | 2 +- ...CatalogPriceRuleByProductAttributeTest.xml | 22 +- .../Mftf/Test/EndToEndB2CGuestUserTest.xml | 16 +- .../Mftf/Test/EndToEndB2CLoggedInUserTest.xml | 8 +- .../LayerNavigationOfCatalogSearchTest.xml | 4 +- .../Mftf/Test/SearchEntityResultsTest.xml | 46 +- ...tAdvancedSearchEntitySimpleProductTest.xml | 2 +- ...goryWithRestrictedUrlKeyNotCreatedTest.xml | 40 +- ...minUrlForProductRewrittenCorrectlyTest.xml | 6 +- ...iteStoreLevelUrlKeyOfChildCategoryTest.xml | 134 ++-- .../Test/CheckCheckoutSuccessPageTest.xml | 10 +- .../CheckNotVisibleProductInMinicartTest.xml | 4 +- ...guringInstantPurchaseFunctionalityTest.xml | 2 +- ...ddressShouldBeCheckedOnPaymentPageTest.xml | 2 +- ...ndleDynamicProductFromShoppingCartTest.xml | 2 +- ...BundleFixedProductFromShoppingCartTest.xml | 2 +- ...ownloadableProductFromShoppingCartTest.xml | 2 +- ...leteVirtualProductFromShoppingCartTest.xml | 2 +- .../Mftf/Test/EndToEndB2CGuestUserTest.xml | 28 +- .../Mftf/Test/EndToEndB2CLoggedInUserTest.xml | 14 +- ...OfDefaultBillingAndShippingAddressTest.xml | 2 +- ...ckoutAsCustomerUsingDefaultAddressTest.xml | 2 +- ...eCheckoutAsCustomerUsingNewAddressTest.xml | 2 +- ...utAsCustomerUsingNonDefaultAddressTest.xml | 2 +- .../OnePageCheckoutUsingSignInLinkTest.xml | 2 +- ...OnePageCheckoutWithAllProductTypesTest.xml | 10 +- ...CartAndMiniShoppingCartPerCustomerTest.xml | 4 +- ...oppingCartWithoutAnySelectedOptionTest.xml | 2 +- ...ontCheckCustomerInfoCreatedByGuestTest.xml | 2 +- ...ateShoppingCartWhileUpdateMinicartTest.xml | 2 +- ...BundleDynamicProductToShoppingCartTest.xml | 2 +- ...pingCartWithDisableMiniCartSidebarTest.xml | 2 +- ...MultiSelectOptionToTheShoppingCartTest.xml | 2 +- ...pesOfCustomOptionToTheShoppingCartTest.xml | 4 +- ...ultiSelectOptionsToTheShoppingCartTest.xml | 2 +- ...efrontApplyPromoCodeDuringCheckoutTest.xml | 2 +- ...rontCheckCartAndCheckoutItemsCountTest.xml | 4 +- ...isplayWithDefaultDisplayLimitationTest.xml | 40 +- ...edToTheCartThanDefaultDisplayLimitTest.xml | 44 +- ...isplayLimitAndDefaultTotalQuantityTest.xml | 40 +- ...ShoppingCartWithMoreThan20ProductsTest.xml | 42 +- ...rtItemDisplayWithDefaultLimitationTest.xml | 44 +- ...playWithCustomDisplayConfigurationTest.xml | 16 +- ...ingAddressAndProductWithTierPricesTest.xml | 8 +- ...ssAndRegisterCustomerAfterCheckoutTest.xml | 4 +- ...ntCheckoutWithSpecialPriceProductsTest.xml | 8 +- ...erCheckoutDisabledProductAndCouponTest.xml | 4 +- ...OnLoginWhenGuestCheckoutIsDisabledTest.xml | 4 +- ...egistrationAndDisableGuestCheckoutTest.xml | 4 +- ...frontCustomerCheckoutWithoutRegionTest.xml | 2 +- ...OrderWithNewAddressesThatWasEditedTest.xml | 2 +- ...eBundleProductFromMiniShoppingCartTest.xml | 2 +- ...aultLimitationFromMiniShoppingCartTest.xml | 42 +- ...VirtualProductFromMiniShoppingCartTest.xml | 6 +- ...eSimpleProductFromMiniShoppingCartTest.xml | 4 +- ...StorefrontGuestCheckoutDataPersistTest.xml | 4 +- ...tCheckoutUsingFreeShippingAndTaxesTest.xml | 6 +- ...tCheckoutWithCouponAndZeroSubtotalTest.xml | 6 +- ...ingPagerShoppingCartWith20ProductsTest.xml | 40 +- ...ntOnePageCheckoutDataWhenChangeQtyTest.xml | 2 +- ...refrontOnePageCheckoutJsValidationTest.xml | 2 +- ...aForGuestCustomerWithPhysicalQuoteTest.xml | 2 +- ...tOnCheckoutPageDifferentStoreViewsTest.xml | 4 +- ...ngesInBackendAfterCustomerCheckoutTest.xml | 8 +- ...PagerForOneItemPerPageAnd2ProductsTest.xml | 4 +- ...efrontUKCustomerCheckoutWithCouponTest.xml | 4 +- ...uctQuantityEqualsToOrderedQuantityTest.xml | 8 +- ...CouponAndBankTransferPaymentMethodTest.xml | 4 +- ...riceInShoppingCartAfterProductSaveTest.xml | 4 +- ...UpdateShoppingCartSimpleProductQtyTest.xml | 2 +- ...eProductFromMiniShoppingCartEntityTest.xml | 2 +- ...SubtotalOrdersWithProcessingStatusTest.xml | 2 +- .../AdminAddDefaultImageConfigurableTest.xml | 16 +- ...agesAndPricesToConfigurableProductTest.xml | 2 +- ...hangedWhenSavingProductWithSameSkuTest.xml | 8 +- ...bleProductAttributeValueUniquenessTest.xml | 6 +- ...CheckResultsOfColorAndOtherFiltersTest.xml | 16 +- ...nCheckValidatorConfigurableProductTest.xml | 6 +- .../AdminConfigurableProductCreateTest.xml | 2 +- .../AdminConfigurableProductDeleteTest.xml | 4 +- .../AdminConfigurableProductLongSkuTest.xml | 2 +- ...AdminConfigurableProductOutOfStockTest.xml | 12 +- .../AdminConfigurableProductSearchTest.xml | 2 +- ...nConfigurableProductSetEditContentTest.xml | 6 +- ...ConfigurableProductUpdateAttributeTest.xml | 6 +- .../AdminConfigurableProductUpdateTest.xml | 2 +- ...ConfigurableSetEditRelatedProductsTest.xml | 2 +- ...AndEditConfigurableProductSettingsTest.xml | 10 +- .../Test/AdminCreateAndSwitchProductType.xml | 34 +- ...onfigurableProductBasedOnParentSkuTest.xml | 14 +- ...ctWithCreatingCategoryAndAttributeTest.xml | 14 +- ...roductWithDisabledChildrenProductsTest.xml | 10 +- ...reateConfigurableProductWithImagesTest.xml | 10 +- ...eeProductDisplayOutOfStockProductsTest.xml | 10 +- ...oductDontDisplayOutOfStockProductsTest.xml | 10 +- ...ableProductWithTierPriceForOneItemTest.xml | 8 +- ...ctWithTwoOptionsAssignedToCategoryTest.xml | 20 +- ...woOptionsWithoutAssignedToCategoryTest.xml | 20 +- .../AdminDeleteConfigurableProductTest.xml | 2 +- ...AdminProductTypeSwitchingOnEditingTest.xml | 12 +- .../Mftf/Test/AdminRelatedProductsTest.xml | 30 +- ...dminRemoveDefaultImageConfigurableTest.xml | 20 +- .../Test/Mftf/Test/EndToEndB2CAdminTest.xml | 10 +- ...vailableToConfigureDisabledProductTest.xml | 4 +- .../ProductsQtyReturnAfterOrderCancelTest.xml | 4 +- ...urableProductCategoryViewChildOnlyTest.xml | 4 +- ...rontConfigurableProductChildSearchTest.xml | 6 +- ...orefrontConfigurableProductDetailsTest.xml | 18 +- .../StorefrontConfigurableProductViewTest.xml | 2 +- ...gurableProductWithFileCustomOptionTest.xml | 4 +- ...ConfigurableWithCatalogRuleAppliedTest.xml | 12 +- ...nfigurableProductLayeredNavigationTest.xml | 2 +- ...efrontVisibilityOfDuplicateProductTest.xml | 26 +- ...ayWhenChooseThreeAllowedCurrenciesTest.xml | 2 +- .../AdminOrderRateDisplayedInOneLineTest.xml | 2 +- ...ectNavigateFromCustomerViewCartProduct.xml | 2 +- .../Mftf/Test/PasswordAutocompleteOffTest.xml | 2 +- ...AddDefaultImageDownloadableProductTest.xml | 16 +- ...AddDefaultVideoDownloadableProductTest.xml | 6 +- ...AndEditDownloadableProductSettingsTest.xml | 10 +- .../Test/AdminCreateAndSwitchProductType.xml | 4 +- ...bleProductAndAssignItToCustomStoreTest.xml | 10 +- ...wnloadableProductWithCustomOptionsTest.xml | 10 +- ...loadableProductWithDefaultSetLinksTest.xml | 12 +- ...eDownloadableProductWithGroupPriceTest.xml | 12 +- ...bleProductWithInvalidDomainLinkUrlTest.xml | 6 +- ...nCreateDownloadableProductWithLinkTest.xml | 10 +- ...DownloadableProductWithManageStockTest.xml | 10 +- ...oadableProductWithOutOfStockStatusTest.xml | 10 +- ...ownloadableProductWithSpecialPriceTest.xml | 12 +- ...ductWithoutFillingQuantityAndStockTest.xml | 10 +- ...wnloadableProductWithoutTaxClassIdTest.xml | 12 +- .../AdminDeleteDownloadableProductTest.xml | 2 +- ...nDownloadableProductSetEditContentTest.xml | 6 +- ...DownloadableSetEditRelatedProductsTest.xml | 6 +- ...AdminProductTypeSwitchingOnEditingTest.xml | 6 +- ...oveDefaultImageDownloadableProductTest.xml | 18 +- ...oveDefaultVideoDownloadableProductTest.xml | 6 +- ...leProductWithSeparateLinksFromCartTest.xml | 8 +- .../Test/Mftf/Test/EndToEndB2CAdminTest.xml | 8 +- ...wnloadableLinksDownloadableProductTest.xml | 8 +- ...wnloadableLinksDownloadableProductTest.xml | 8 +- ...ableProductSamplesAreNotAccessibleTest.xml | 6 +- ...ntElasticsearch6SearchInvalidValueTest.xml | 18 +- .../Test/AdminCreatingShippingLabelTest.xml | 2 +- ...edProductWithTwoLinksToCartActionGroup.xml | 2 +- ...AdminAddDefaultImageGroupedProductTest.xml | 18 +- ...AdminAddDefaultVideoGroupedProductTest.xml | 8 +- ...nAssociateGroupedProductToWebsitesTest.xml | 10 +- ...reateAndEditGroupedProductSettingsTest.xml | 16 +- .../Test/AdminDeleteGroupedProductTest.xml | 2 +- .../AdminGroupedProductSetEditContentTest.xml | 6 +- .../Test/AdminGroupedProductsListTest.xml | 8 +- ...AdminGroupedSetEditRelatedProductsTest.xml | 4 +- ...inRemoveDefaultImageGroupedProductTest.xml | 20 +- ...inRemoveDefaultVideoGroupedProductTest.xml | 8 +- .../AdminSortingAssociatedProductsTest.xml | 14 +- .../Test/Mftf/Test/EndToEndB2CAdminTest.xml | 10 +- ...ewProductsListWidgetGroupedProductTest.xml | 2 +- .../AdminCheckDoubleImportOfProductsTest.xml | 4 +- ...utesChangedValueToEmptyAfterImportTest.xml | 16 +- ...dminImportProductsWithErrorEntriesTest.xml | 2 +- ...lityDifferentStoreViewsAfterImportTest.xml | 8 +- .../Test/Mftf/Test/ShopByButtonInMobile.xml | 2 +- ...hMapAssignedConfigProductIsCorrectTest.xml | 4 +- ...toreFrontCheckingWithMultishipmentTest.xml | 4 +- ...oreFrontCheckingWithSingleShipmentTest.xml | 4 +- ...toreFrontMinicartWithMultishipmentTest.xml | 4 +- ...oreFrontMyAccountWithMultishipmentTest.xml | 4 +- ...frontCheckoutWithMultipleAddressesTest.xml | 6 +- ...ingCartBehaviorAfterSessionExpiredTest.xml | 2 +- ...GuestCheckoutWithEnabledPersistentTest.xml | 2 +- .../ShippingQuotePersistedForGuestTest.xml | 4 +- ...CartPersistenceUnderLongTermCookieTest.xml | 6 +- ...listIsPersistedUnderLongTermCookieTest.xml | 4 +- ...inValidateUrlOnGetVideoInformationTest.xml | 2 +- .../YoutubeVideoWindowOnProductPageTest.xml | 6 +- ...efrontGuestCheckoutDisabledProductTest.xml | 12 +- ...erWithCheckMoneyOrderPaymentMethodTest.xml | 8 +- ...WithProductQtyWithoutStockDecreaseTest.xml | 8 +- ...ectnessInvoicedItemInBundleProductTest.xml | 2 +- .../Test/Mftf/Test/AdminCreateInvoiceTest.xml | 2 +- ...rderCreationWithMultiWebsiteConfigTest.xml | 4 +- .../Test/StorefrontPrintOrderGuestTest.xml | 6 +- ...inCartRulesAppliedForProductInCartTest.xml | 8 +- .../Mftf/Test/AdminCreateBuyXGetYFreeTest.xml | 2 +- ...eConditionAndFreeShippingIsAppliedTest.xml | 2 +- ...AndVerifyRuleConditionIsNotAppliedTest.xml | 2 +- ...inCreateCartPriceRuleForCouponCodeTest.xml | 2 +- ...ateCartPriceRuleForGeneratedCouponTest.xml | 2 +- ...talAndVerifyRuleConditionIsAppliedTest.xml | 2 +- ...oryAndVerifyRuleConditionIsAppliedTest.xml | 6 +- ...ghtAndVerifyRuleConditionIsAppliedTest.xml | 2 +- .../AdminCreateFixedAmountDiscountTest.xml | 2 +- ...CreateFixedAmountWholeCartDiscountTest.xml | 2 +- .../AdminCreatePercentOfProductPriceTest.xml | 2 +- ...iveSalesRuleAndVerifyDeleteMessageTest.xml | 4 +- ...yRulesShouldApplyToComplexProductsTest.xml | 12 +- .../AdminGlobalSearchOnProductPageTest.xml | 12 +- ...archSuggestionByProductDescriptionTest.xml | 2 +- ...ustomStoreShippingMethodTableRatesTest.xml | 4 +- ...splayTableRatesShippingMethodForAETest.xml | 2 +- .../Mftf/Test/AdminCreateImageSwatchTest.xml | 4 +- .../Mftf/Test/AdminCreateTextSwatchTest.xml | 4 +- ...ateVisualSwatchWithNonValidOptionsTest.xml | 6 +- ...uctWithAttributesImagesAndSwatchesTest.xml | 14 +- ...figurableProductSwatchMinimumPriceTest.xml | 6 +- ...ntDisplayAllCharactersOnTextSwatchTest.xml | 2 +- .../StorefrontFilterByImageSwatchTest.xml | 16 +- .../Test/StorefrontFilterByTextSwatchTest.xml | 4 +- .../StorefrontFilterByVisualSwatchTest.xml | 4 +- ...tImageColorWhenFilterByColorFilterTest.xml | 6 +- ...oductImagesMatchingProductSwatchesTest.xml | 20 +- ...SwatchAttributesDisplayInWidgetCMSTest.xml | 8 +- ...tSwatchProductWithFileCustomOptionTest.xml | 10 +- .../Test/Mftf/Test/AdminTaxReportGridTest.xml | 12 +- ...oppingCartForCustomerPhysicalQuoteTest.xml | 4 +- ...nShoppingCartForGuestPhysicalQuoteTest.xml | 4 +- ...esignConfigMediaGalleryImageUploadTest.xml | 2 +- .../AdminInlineTranslationOnCheckoutTest.xml | 6 +- ...StorefrontButtonsInlineTranslationTest.xml | 2 +- ...dFilterDeleteAndVerifyErrorMessageTest.xml | 4 +- ...ateURLRewriteWhenCategoryIsDeletedTest.xml | 4 +- ...tipleStoreviewsDuringProductImportTest.xml | 20 +- ...rlKeyForStoreViewAndMovingCategoryTest.xml | 6 +- ...CategoryUrlRewriteAndAddNoRedirectTest.xml | 2 +- ...yUrlRewriteAndAddPermanentRedirectTest.xml | 2 +- ...tUrlRewriteAndAddTemporaryRedirectTest.xml | 2 +- ...eProductURLRewriteAndAddNoRedirectTest.xml | 4 +- ...ithCategoryAndAddTemporaryRedirectTest.xml | 6 +- ...tUrLRewriteAndAddPermanentRedirectTest.xml | 4 +- ...tUrLRewriteAndAddTemporaryRedirectTest.xml | 4 +- ...SeveralWebsitesAndCheckURLRewritesTest.xml | 8 +- ...CreateUrlRewriteForCustomStoreViewTest.xml | 8 +- ...oryUrlRewriteAndAddAspxRequestPathTest.xml | 2 +- ...CategoryUrlRewriteAndAddNoRedirectTest.xml | 2 +- ...yUrlRewriteAndAddPermanentRedirectTest.xml | 2 +- ...yUrlRewriteAndAddTemporaryRedirectTest.xml | 2 +- ...inUpdateCustomURLRewritesTemporaryTest.xml | 4 +- ...writesForProductInAnchorCategoriesTest.xml | 8 +- ...FixedTaxValSavedForSpecificWebsiteTest.xml | 8 +- ...inRemoveProductWeeeAttributeOptionTest.xml | 6 +- ...ddToCartWishListWithUnselectedAttrTest.xml | 2 +- ...tChildImageShouldBeShownOnWishListTest.xml | 12 +- ...uctsToCartFromWishlistUsingSidebarTest.xml | 4 +- ...teBundleDynamicProductFromWishlistTest.xml | 6 +- ...veProductsFromWishlistUsingSidebarTest.xml | 4 +- .../Test/WishListWithDisabledProductTest.xml | 4 +- 644 files changed, 6491 insertions(+), 4779 deletions(-) create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddCategoryImageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddCrossSellProductBySkuActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductAttributeInProductModalActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductCustomOptionFieldActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductCustomOptionFileActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductImageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductWithQtyToCartFromStorefrontProductPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddRelatedProductBySkuActionGroup.xml rename app/code/Magento/Catalog/Test/Mftf/ActionGroup/{AddProductToCartActionGroup.xml => AddSimpleProductToCartActionGroup.xml} (80%) create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddSpecialPriceToProductActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddToCartFromStorefrontProductPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddUpSellProductBySkuActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAddAdvancedPricingToTheProductExtendedActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAddUnassignedAttributeToGroupActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductCustomOptionVisibleActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductHasNoCustomOptionActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductHasNoCustomOptionsActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssignProductToCategoryActionGroup.xml delete mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryAssignProductActionGroup.xml rename app/code/Magento/Catalog/Test/Mftf/ActionGroup/{AdminCheckProductsInGridActionGroup.xml => AdminCheckProductIsMissingInCategoryProductsGridActionGroup.xml} (61%) create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckProductPositionInCategoryProductsGridActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickOnAdvancedInventoryButtonActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateAttributeFromProductPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateAttributeFromProductPageWithScopeActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateAttributeWithSearchWeightActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateAttributeWithValueWithTwoStoreViesFromProductPageActionGroup.xml rename app/code/Magento/Catalog/Test/Mftf/ActionGroup/{AdminCreateWidgetActionGroup.xml => AdminCreateCatalogProductWidgetActionGroup.xml} (64%) create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateRecentlyProductsWidgetActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateSearchableProductAttributeActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateSimpleProductWithTextOptionCharLimitActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductCustomOptionsActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteCategoryByNameActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteProductCustomOptionActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillProductCountryOfManufactureActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProcessProductWebsitesActionGroup.xml delete mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAddSpecialPriceActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAdvancedPricingNewCustomerGroupPriceActionGroup.xml delete mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml delete mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductGridActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductPageCreateAttributeSetWithAttributeActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductPageFillTextAttributeValueByNameActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductPageSelectAttributeSetActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSetProductDisabledActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSwitchScopeForProductAttributeActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertDiscountsPercentageOfProductsActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductDescriptionInProductEditFormActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageAdminProductPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageNotInAdminProductPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageNotInStorefrontProductPage2ActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageNotInStorefrontProductPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageStorefrontProductPage2ActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageStorefrontProductPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductIsAssignedToWebsiteActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductIsNotAssignedToWebsiteActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductNameAndSkuInStorefrontProductPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductNameInProductEditFormActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductOnCategoryPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertTextInAdminProductRelatedUpSellCrossSellSectionActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertWebsiteIsAvailableInProductWebsitesActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertWebsiteIsNotAvailableInProductWebsitesActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/CategoryPresentActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/ChangeSeoUrlKeyActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/ChangeSeoUrlKeyForSubCategoryActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/ChangeStatusProductUsingProductGridActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/ChangeUseForPromoRuleConditionsProductAttributeActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckAttributeInMoreInformationTabActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckAttributeNotInMoreInformationTabActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckCategoryImageInAdminActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckCategoryNameIsRequiredFieldActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckCategoryOnStorefrontActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckCustomizableOptionImportActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckRequiredFieldsInProductFormActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/ClearProductsFilterActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/ConfirmChangeInputTypeModalActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateAttributeDropdownNthOptionActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateAttributeDropdownNthOptionAsDefaultActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateCategoryActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateCustomRadioOptionsActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateDefaultAttributeSetActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeWithDateFieldActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeWithTextFieldActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateSimpleProductAndAddToWebsiteActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreatedProductConnectToWebsiteActionGroup.xml delete mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/CustomOptionsActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteAllDuplicateProductUsingProductGridActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteAllProductsUsingProductGridActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteAttributeSetByLabelActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteCategoryActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteDefaultCategoryChildrenActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteMostRecentCategoryActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByLabelActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductByNameActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductBySkuActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductUsingProductGridActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductsByKeywordActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductsIfTheyExistActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/ExpandAdminProductSectionActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillAdminSimpleProductFormActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillCategoryFormActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillCategoryNameAndUrlKeyAndSaveActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillMainProductFormActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillMainProductFormByStringActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillMainProductFormNoWeightActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillNewProductCategoryActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillProductNameAndSkuInProductFormActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterAndSelectProductActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductAttributeByAttributeCodeActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductAttributeByAttributeLabelActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductAttributeByDefaultLabelActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductAttributeSetGridByAttributeSetNameActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByDisabledStatusActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByEnabledStatusActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByName2ActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByNameActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByPriceRangeActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridBySetNewFromDateActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridBySku2ActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridBySkuActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridBySkuAndNameActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToAdminCategoryPageByIdActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToAttributeGridPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToAttributeSetByNameActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToCreateCategoryPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToCreateProductPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToProductCatalogPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToProductPageViaIDActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToSpecifiedCreateProductPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToStorefrontCategoryPageByParametersActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToSubCategoryPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/ImportProductCustomizableOptionsActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToAndResetProductAttributeGridToDefaultViewActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToAndResetProductGridToDefaultViewActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToCreatedCategoryActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToCreatedProductAttributeActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToCreatedProductEditPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToEditProductAttributeActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToMediaGalleryActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/OpenCategoryFromCategoryTreeActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/OpenProductForEditByClickingRowXColumnYInProductGridActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/ProductSetAdvancedPricingActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/ProductSetAdvancedTierFixedPricingActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/ProductSetWebsiteActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/RemoveCategoryFromProductActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/RemoveCategoryImageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/RemoveProductImageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/RemoveProductImageByNameActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/ResetImportOptionFilterActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/ResetProductGridToDefaultViewActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveAttributeSetActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveCategoryFormActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductAttributeActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductAttributeInUseActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductFormActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductFormNoSuccessCheckActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchForProductOnBackendByNameActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchProductGridByKeyword2ActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchProductGridByKeywordActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/SelectProductInWebsitesActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/SetCategoryByNameActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/SetProductUrlKeyActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/SetProductUrlKeyByStringActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/SortProductsByIdAscendingActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/SortProductsByIdDescendingActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAddCategoryProductToCompareActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAddProductToCompareActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAddSimpleProductWithQtyActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertActiveProductImageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertFotoramaImageAvailabilityActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductInRecentlyComparedWidgetActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductInRecentlyOrderedWidgetActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductPriceOnCategoryPageActionGroup.xml delete mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCategoryActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCategoryPageSortAscendingActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCategoryPageSortDescendingActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckAddToCartButtonAbsenceActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckCategoryActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckCategorySimpleProductActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckCompareSidebarProductActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckCompareSimpleProductActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckProductPositionActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckSimpleProductActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontClearCompareActionGroup.xml delete mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCompareActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontGoToSubCategoryPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontOpenAndCheckComparisionActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontOpenProductPageOnSecondStoreActionGroup.xml delete mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontProductActionGroup.xml delete mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontProductPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontSwitchCategoryViewToListModeActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/SwitchCategoryStoreViewActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/SwitchCategoryToAllStoreViewActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/SwitchToTheNewStoreViewActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/TestDynamicValidationHintActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/ToggleProductEnabledActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/UnassignAttributeFromGroupActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/UnassignWebsiteFromProductActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/VerifyCategoryPageParametersActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/ViewProductInAdminGridActionGroup.xml diff --git a/app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardWithChartsChart.xml b/app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardWithChartsChart.xml index f48c7752efc7a..dde24d9f1c602 100644 --- a/app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardWithChartsChart.xml +++ b/app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardWithChartsChart.xml @@ -54,7 +54,7 @@ <comment userInput="Add product to the shopping cart" stepKey="addProductToCart"/> <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToSimpleProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$$createProduct.name$$"/> </actionGroup> <!--Go to Checkout--> diff --git a/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml b/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml index 8f0ce4918b978..5d52fe26d39e0 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml +++ b/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml @@ -95,7 +95,7 @@ <!--Adding Special price to product--> <amOnPage url="{{AdminProductEditPage.url($$simpleProduct.id$$)}}" stepKey="openAdminProductEditPage"/> <actionGroup ref="AddSpecialPriceToProductActionGroup" stepKey="addSpecialPrice"/> - <actionGroup ref="saveProductForm" stepKey="saveProductForm"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> <!--Create New Order--> <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml index 401d360a34c64..c494f29f1a604 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml @@ -51,11 +51,11 @@ <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/> <waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct0$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> @@ -91,7 +91,7 @@ <waitForPageLoad stepKey="WaitForPageToLoad"/> <conditionalClick selector="{{AdminProductFiltersSection.filtersClear}}" dependentSelector="{{AdminProductFiltersSection.filtersClear}}" visible="true" stepKey="ClickOnButtonToRemoveFiltersIfPresent"/> <waitForPageLoad stepKey="WaitForClear"/> - <actionGroup ref="filterProductGridByName" stepKey="filterBundleProductOptionsDownToName"> + <actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterBundleProductOptionsDownToName"> <argument name="product" value="BundleProduct"/> </actionGroup> <click selector="{{AdminProductFormBundleSection.addOptions}}" stepKey="clickOnBundleProductToEdit"/> @@ -103,11 +103,11 @@ <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToNewBundle"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToNewOption"/> <waitForPageLoad stepKey="waitForPageLoadAfterNewBundleProducts"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterNewBundleProductOptions"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterNewBundleProductOptions"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="//div[@class='admin__data-grid-outer-wrap']//tr[@data-repeat-index='0']//input[@type='checkbox']" stepKey="selectNewFirstGridRow"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterNewBundleProductOptions2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterNewBundleProductOptions2"> <argument name="product" value="$$simpleProduct3$$"/> </actionGroup> <checkOption selector="{{AdminProductFormBundleSection.firstProductOption}}" stepKey="selectNewFirstGridRow2"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleProductToCartFromWishListPageTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleProductToCartFromWishListPageTest.xml index 2a4b119a5cabc..b2d3c376d9b5a 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleProductToCartFromWishListPageTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleProductToCartFromWishListPageTest.xml @@ -51,7 +51,7 @@ <requiredEntity createDataKey="createSimpleProduct2"/> </createData> <amOnPage url="{{AdminProductEditPage.url($$createProduct.id$$)}}" stepKey="goToProductEditPage"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> </before> <after> <!-- Delete created data --> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultImageBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultImageBundleProductTest.xml index 21e6be98b3169..3770e47079c98 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultImageBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultImageBundleProductTest.xml @@ -32,11 +32,11 @@ <!-- Create a bundle product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageBundle"/> <waitForPageLoad stepKey="waitForProductPageLoadBundle"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateBundleProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateBundleProduct"> <argument name="product" value="BundleProduct"/> </actionGroup> - <actionGroup ref="fillProductNameAndSkuInProductForm" stepKey="fillBundleProductNameAndSku"> + <actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillBundleProductNameAndSku"> <argument name="product" value="BundleProduct"/> </actionGroup> @@ -51,11 +51,11 @@ <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/> <waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> @@ -64,23 +64,23 @@ <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> <!-- Add image to product --> - <actionGroup ref="addProductImage" stepKey="addImageForProduct"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageForProduct"> <argument name="image" value="MagentoLogo"/> </actionGroup> <!--Save product--> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Assert product image in admin product form --> - <actionGroup ref="assertProductImageAdminProductPage" stepKey="assertProductImageAdminProductPage"/> + <actionGroup ref="AssertProductImageAdminProductPageActionGroup" stepKey="assertProductImageAdminProductPage"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="BundleProduct"/> </actionGroup> <!-- Assert product image in storefront product page --> - <actionGroup ref="assertProductImageStorefrontProductPage" stepKey="assertProductImageStorefrontProductPage"> + <actionGroup ref="AssertProductImageStorefrontProductPageActionGroup" stepKey="assertProductImageStorefrontProductPage"> <argument name="product" value="BundleProduct"/> <argument name="image" value="MagentoLogo"/> </actionGroup> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultVideoBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultVideoBundleProductTest.xml index c49202f31aefb..66443e130ed08 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultVideoBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultVideoBundleProductTest.xml @@ -29,10 +29,10 @@ <!-- Create a bundle product --> <!-- Replacing steps in base AdminAddDefaultVideoSimpleProductTest --> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProductPage"> <argument name="product" value="BundleProduct"/> </actionGroup> - <actionGroup ref="fillProductNameAndSkuInProductForm" stepKey="fillMainProductForm"> + <actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillMainProductForm"> <argument name="product" value="BundleProduct"/> </actionGroup> @@ -46,11 +46,11 @@ <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProducts" after="selectOptionBundleTitle"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProducts" after="waitForAddProducts"/> <waitForPageLoad stepKey="waitForPageLoad" after="clickAddProducts"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku1" after="waitForPageLoad"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku1" after="waitForPageLoad"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="checkOption1" after="filterProductGridBySku1"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku2" after="checkOption1"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku2" after="checkOption1"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="checkOption2" after="filterProductGridBySku2"/> @@ -59,7 +59,7 @@ <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillQty2" before="saveProductForm"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="BundleProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAssociateBundleProductToWebsitesTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAssociateBundleProductToWebsitesTest.xml index 505a319c5c44f..b58637cf2e81d 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAssociateBundleProductToWebsitesTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAssociateBundleProductToWebsitesTest.xml @@ -79,14 +79,14 @@ <argument name="websiteName" value="{{secondCustomWebsite.name}}"/> </actionGroup> - <actionGroup ref="NavigateToAndResetProductGridToDefaultView" stepKey="resetProductGridFilter"/> + <actionGroup ref="NavigateToAndResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridFilter"/> <!-- Admin logout --> <actionGroup ref="logout" stepKey="adminLogout"/> </after> <!-- Open product page and assign grouped project to second website --> - <actionGroup ref="filterAndSelectProduct" stepKey="openAdminProductPage"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="openAdminProductPage"> <argument name="productSku" value="$$createBundleProduct.sku$$"/> </actionGroup> <actionGroup ref="AdminAssignProductInWebsiteActionGroup" stepKey="assignProductToSecondWebsite"> @@ -95,15 +95,15 @@ <actionGroup ref="AdminUnassignProductInWebsiteActionGroup" stepKey="unassignProductFromDefaultWebsite"> <argument name="website" value="{{_defaultWebsite.name}}"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveGroupedProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveGroupedProduct"/> <!-- Assert product is assigned to Second website --> - <actionGroup ref="AssertProductIsAssignedToWebsite" stepKey="seeCustomWebsiteIsChecked"> + <actionGroup ref="AssertProductIsAssignedToWebsiteActionGroup" stepKey="seeCustomWebsiteIsChecked"> <argument name="website" value="{{secondCustomWebsite.name}}"/> </actionGroup> <!-- Assert product is not assigned to Main website --> - <actionGroup ref="AssertProductIsNotAssignedToWebsite" stepKey="seeMainWebsiteIsNotChecked"> + <actionGroup ref="AssertProductIsNotAssignedToWebsiteActionGroup" stepKey="seeMainWebsiteIsNotChecked"> <argument name="website" value="{{_defaultWebsite.name}}"/> </actionGroup> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAttributeSetSelectionTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAttributeSetSelectionTest.xml index 1d2f21b7d15f9..c8977cbae1957 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAttributeSetSelectionTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAttributeSetSelectionTest.xml @@ -56,7 +56,7 @@ <!--Set filter to product name--> <amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="GoToCatalogProductPage"/> <waitForPageLoad stepKey="WaitForPageToLoad"/> - <actionGroup ref="filterProductGridByName" stepKey="filterBundleProductOptionsDownToName"> + <actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterBundleProductOptionsDownToName"> <argument name="product" value="BundleProduct"/> </actionGroup> <seeElement selector="{{AdminProductFiltersSection.attributeSetOfFirstRow(ProductAttributeFrontendLabel.label)}}" stepKey="seeAttributeSet"/> @@ -77,7 +77,7 @@ <!--Set filter to product name--> <amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="GoToCatalogProductPage2"/> <waitForPageLoad stepKey="WaitForPageToLoad2"/> - <actionGroup ref="filterProductGridByName" stepKey="filterBundleProductOptionsDownToName2"> + <actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterBundleProductOptionsDownToName2"> <argument name="product" value="BundleProduct"/> </actionGroup> <seeElement selector="{{AdminProductFiltersSection.attributeSetOfFirstRow(BundleProduct.defaultAttribute)}}" stepKey="seeAttributeSet2"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminBasicBundleProductAttributesTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminBasicBundleProductAttributesTest.xml index c6a07f7ed95c3..fcfd80ac8533c 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminBasicBundleProductAttributesTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminBasicBundleProductAttributesTest.xml @@ -24,7 +24,7 @@ <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> </after> <!--Create attribute set--> - <actionGroup ref="CreateDefaultAttributeSet" stepKey="createDefaultAttributeSet"> + <actionGroup ref="CreateDefaultAttributeSetActionGroup" stepKey="createDefaultAttributeSet"> <argument name="label" value="{{ProductAttributeFrontendLabel.label}}"/> </actionGroup> @@ -91,14 +91,14 @@ <seeOptionIsSelected selector="{{AdminProductFormBundleSection.countryOfManufactureDropDown}}" userInput="Italy" stepKey="seeCountryOfManufacture"/> <!--Create second attribute set for edit--> - <actionGroup ref="CreateDefaultAttributeSet" stepKey="createSecondAttributeSet"> + <actionGroup ref="CreateDefaultAttributeSetActionGroup" stepKey="createSecondAttributeSet"> <argument name="label" value="{{ProductAttributeFrontendLabelTwo.label}}"/> </actionGroup> <!--Filter catalog--> <amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="goToCatalogProductPage"/> <waitForPageLoad stepKey="WaitForPageToLoad"/> - <actionGroup ref="filterProductGridByName" stepKey="filterBundleProductOptionsDownToName"> + <actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterBundleProductOptionsDownToName"> <argument name="product" value="BundleProduct"/> </actionGroup> <click selector="{{AdminProductFiltersSection.attributeSetOfFirstRow(ProductAttributeFrontendLabel.label)}}" stepKey="clickAttributeSet2"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminBundleProductSetEditContentTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminBundleProductSetEditContentTest.xml index 65733a5bcc037..788dc4a848fd3 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminBundleProductSetEditContentTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminBundleProductSetEditContentTest.xml @@ -21,16 +21,16 @@ </annotations> <after> <!-- Delete bundle product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="BundleProduct"/> </actionGroup> </after> <!-- Create product --> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="BundleProduct"/> </actionGroup> - <actionGroup ref="fillProductNameAndSkuInProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="BundleProduct"/> </actionGroup> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminCreateAndEditBundleProductSettingsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminCreateAndEditBundleProductSettingsTest.xml index 42584a31651d7..9d5b1be6fae04 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminCreateAndEditBundleProductSettingsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminCreateAndEditBundleProductSettingsTest.xml @@ -42,7 +42,7 @@ </after> <!-- Create new bundle product --> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createBundleProduct"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createBundleProduct"> <argument name="productType" value="bundle"/> </actionGroup> @@ -75,7 +75,7 @@ </actionGroup> <!-- Save product form --> - <actionGroup ref="saveProductForm" stepKey="clickSaveButton"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveButton"/> <!-- Open product page --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage"> @@ -101,7 +101,7 @@ </actionGroup> <!-- Assert product in assigned to Website --> - <actionGroup ref="AssertProductIsAssignedToWebsite" stepKey="seeCustomWebsiteIsChecked"> + <actionGroup ref="AssertProductIsAssignedToWebsiteActionGroup" stepKey="seeCustomWebsiteIsChecked"> <argument name="website" value="$createWebsite.website[name]$"/> </actionGroup> @@ -122,7 +122,7 @@ <actionGroup ref="AdminSwitchProductGiftMessageStatusActionGroup" stepKey="disableGiftMessageSettings"/> <!-- Save product form --> - <actionGroup ref="saveProductForm" stepKey="clickSaveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveProduct"/> <!-- Verify Url Key after changing --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> @@ -137,7 +137,7 @@ <dontSeeElement selector="{{StorefrontProductCartGiftOptionSection.giftOptions}}" stepKey="dontSeeGiftOptionBtn"/> <!-- Delete created bundle product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="BundleProduct"/> </actionGroup> </test> @@ -184,7 +184,7 @@ </after> <!-- Create new bundle product --> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createBundleProduct"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createBundleProduct"> <argument name="productType" value="bundle"/> </actionGroup> @@ -227,7 +227,7 @@ </actionGroup> <!-- Save product form --> - <actionGroup ref="saveProductForm" stepKey="saveWithThreeOptions"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveWithThreeOptions"/> <!-- Open created product --> <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForSimpleProduct"> @@ -243,12 +243,12 @@ </actionGroup> <!-- Save product form --> - <actionGroup ref="saveProductForm" stepKey="clickSaveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveProduct"/> <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveWithTwoOptions"/> <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="messageYouSavedTheProductIsShown"/> <!-- Delete created bundle product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="BundleProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteABundleProduct.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteABundleProduct.xml index 86db6f372b5f8..e0558177e4c3e 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteABundleProduct.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteABundleProduct.xml @@ -40,11 +40,11 @@ <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/> <waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> @@ -64,7 +64,7 @@ <waitForPageLoad stepKey="Loading"/> <!--Apply Name Filter--> - <actionGroup ref="filterProductGridByName" stepKey="filterBundleProductOptionsDownToName"> + <actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterBundleProductOptionsDownToName"> <argument name="product" value="BundleProduct"/> </actionGroup> <click selector="{{AdminProductFiltersSection.allCheckbox}}" stepKey="SelectAllOnly1"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleDynamicProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleDynamicProductTest.xml index a4e26256e9773..51821b136ba26 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleDynamicProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleDynamicProductTest.xml @@ -31,7 +31,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <actionGroup ref="logout" stepKey="logout"/> </after> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteBundleProductFilteredBySkuAndName"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteBundleProductFilteredBySkuAndName"> <argument name="product" value="$$createDynamicBundleProduct$$"/> </actionGroup> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleFixedProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleFixedProductTest.xml index 2527dae7eadf8..dcd53fff6f6dd 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleFixedProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleFixedProductTest.xml @@ -28,7 +28,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <actionGroup ref="logout" stepKey="logout"/> </after> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteBundleProductFilteredBySkuAndName"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteBundleProductFilteredBySkuAndName"> <argument name="product" value="$$createFixedBundleProduct$$"/> </actionGroup> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminEditRelatedBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminEditRelatedBundleProductTest.xml index 08faa9d2444df..632ba194cf8de 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminEditRelatedBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminEditRelatedBundleProductTest.xml @@ -26,7 +26,7 @@ </before> <after> <!-- Delete the bundled product --> - <actionGroup stepKey="deleteBundle" ref="deleteProductUsingProductGrid"> + <actionGroup stepKey="deleteBundle" ref="DeleteProductUsingProductGridActionGroup"> <argument name="product" value="BundleProduct"/> </actionGroup> <!--Logging out--> @@ -38,15 +38,15 @@ <!-- Create a bundle product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageBundle"/> <waitForPageLoad stepKey="waitForProductPageLoadBundle"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateBundleProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateBundleProduct"> <argument name="product" value="BundleProduct"/> </actionGroup> - <actionGroup ref="fillProductNameAndSkuInProductForm" stepKey="fillBundleProductNameAndSku"> + <actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillBundleProductNameAndSku"> <argument name="product" value="BundleProduct"/> </actionGroup> - <actionGroup ref="addRelatedProductBySku" stepKey="addRelatedProduct0"> + <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addRelatedProduct0"> <argument name="sku" value="$$simpleProduct0.sku$$"/> </actionGroup> @@ -54,7 +54,7 @@ <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the product." stepKey="messageYouSavedTheProductIsShown"/> - <actionGroup ref="addRelatedProductBySku" stepKey="addRelatedProduct1"> + <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addRelatedProduct1"> <argument name="sku" value="$$simpleProduct1.sku$$"/> </actionGroup> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminFilterProductListByBundleProduct.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminFilterProductListByBundleProduct.xml index 40a6e1b75c60a..ff5c909077e47 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminFilterProductListByBundleProduct.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminFilterProductListByBundleProduct.xml @@ -40,11 +40,11 @@ <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/> <waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProducts.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProducts.xml index 2f891fcc8f169..1cad591d257d3 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProducts.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProducts.xml @@ -48,11 +48,11 @@ <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/> <waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> @@ -83,11 +83,11 @@ <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle2"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption2"/> <waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts2"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptionsx2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptionsx2"> <argument name="product" value="$$simpleProduct3$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRowx2"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions22"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions22"> <argument name="product" value="$$simpleProduct4$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow22"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminProductBundleCreationTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminProductBundleCreationTest.xml index 1f46e1fc9f0b1..ea3b671417fb6 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminProductBundleCreationTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminProductBundleCreationTest.xml @@ -32,7 +32,7 @@ <deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/> <deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/> <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndexPage"/> - <actionGroup ref="deleteProductsIfTheyExist" stepKey="deleteAllProducts"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteAllProducts"/> <actionGroup ref="logout" stepKey="logout"/> </after> <!-- go to bundle product creation page--> @@ -48,11 +48,11 @@ <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/> <waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminRemoveDefaultImageBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminRemoveDefaultImageBundleProductTest.xml index 730df90b31be6..77be5b879b1c6 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminRemoveDefaultImageBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminRemoveDefaultImageBundleProductTest.xml @@ -25,7 +25,7 @@ </before> <after> <!-- Delete the bundled product we created in the test body --> - <actionGroup ref="deleteProductBySku" stepKey="deleteBundleProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteBundleProduct"> <argument name="sku" value="{{BundleProduct.sku}}"/> </actionGroup> <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> @@ -36,11 +36,11 @@ <!-- Create a bundle product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageBundle"/> <waitForPageLoad stepKey="waitForProductPageLoadBundle"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateBundleProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateBundleProduct"> <argument name="product" value="BundleProduct"/> </actionGroup> - <actionGroup ref="fillProductNameAndSkuInProductForm" stepKey="fillBundleProductNameAndSku"> + <actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillBundleProductNameAndSku"> <argument name="product" value="BundleProduct"/> </actionGroup> @@ -55,11 +55,11 @@ <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/> <waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> @@ -68,27 +68,27 @@ <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> <!-- Add image to product --> - <actionGroup ref="addProductImage" stepKey="addImageForProduct"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageForProduct"> <argument name="image" value="MagentoLogo"/> </actionGroup> <!--Save product--> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Remove image from product --> - <actionGroup ref="removeProductImage" stepKey="removeProductImage"/> + <actionGroup ref="RemoveProductImageActionGroup" stepKey="removeProductImage"/> - <actionGroup ref="saveProductForm" stepKey="saveProductFormAfterRemove"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductFormAfterRemove"/> <!-- Assert product image not in admin product form --> - <actionGroup ref="assertProductImageNotInAdminProductPage" stepKey="assertProductImageNotInAdminProductPage"/> + <actionGroup ref="AssertProductImageNotInAdminProductPageActionGroup" stepKey="assertProductImageNotInAdminProductPage"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPageAfterRemove"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPageAfterRemove"> <argument name="product" value="BundleProduct"/> </actionGroup> <!-- Assert product image not in storefront product page --> - <actionGroup ref="assertProductImageNotInStorefrontProductPage" stepKey="assertProductImageNotInStorefrontProductPage"> + <actionGroup ref="AssertProductImageNotInStorefrontProductPageActionGroup" stepKey="assertProductImageNotInStorefrontProductPage"> <argument name="product" value="BundleProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminRemoveDefaultVideoBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminRemoveDefaultVideoBundleProductTest.xml index d050c5443d1fe..0de9f4ee75a4d 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminRemoveDefaultVideoBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminRemoveDefaultVideoBundleProductTest.xml @@ -29,10 +29,10 @@ <!-- Create a bundle product --> <!-- Replacing steps in base AdminRemoveDefaultVideoSimpleProductTest --> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProductPage"> <argument name="product" value="BundleProduct"/> </actionGroup> - <actionGroup ref="fillProductNameAndSkuInProductForm" stepKey="fillMainProductForm"> + <actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillMainProductForm"> <argument name="product" value="BundleProduct"/> </actionGroup> @@ -46,11 +46,11 @@ <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProducts" after="selectOptionBundleTitle"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProducts" after="waitForAddProducts"/> <waitForPageLoad stepKey="waitForPageLoad" after="clickAddProducts"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku1" after="waitForPageLoad"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku1" after="waitForPageLoad"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="checkOption1" after="filterProductGridBySku1"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku2" after="checkOption1"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku2" after="checkOption1"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="checkOption2" after="filterProductGridBySku2"/> @@ -59,7 +59,7 @@ <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillQty2" before="saveProductForm"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="BundleProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminShouldBeAbleToMassUpdateAttributesForBundleProductsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminShouldBeAbleToMassUpdateAttributesForBundleProductsTest.xml index fe55fda4d0e05..994a10ae02692 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminShouldBeAbleToMassUpdateAttributesForBundleProductsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminShouldBeAbleToMassUpdateAttributesForBundleProductsTest.xml @@ -59,17 +59,17 @@ <magentoCLI command="cron:run" stepKey="cronRun"/> <magentoCLI command="cron:run" stepKey="cronRunTwice"/> <!-- Search for a product with a new name and Open Product --> - <actionGroup ref="filterProductGridByName" stepKey="searchWithNewProductName"> + <actionGroup ref="FilterProductGridByNameActionGroup" stepKey="searchWithNewProductName"> <argument name="product" value="UpdateAttributeNameAndDescription"/> </actionGroup> <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openProductPage"> <argument name="product" value="$$createFixedBundleProduct$$"/> </actionGroup> <!-- Assert product name and description --> - <actionGroup ref="AssertProductNameInProductEditForm" stepKey="assertProductName"> + <actionGroup ref="AssertProductNameInProductEditFormActionGroup" stepKey="assertProductName"> <argument name="productName" value="{{UpdateAttributeNameAndDescription.name}}"/> </actionGroup> - <actionGroup ref="AssertProductDescriptionInProductEditForm" stepKey="assertProductDescription"> + <actionGroup ref="AssertProductDescriptionInProductEditFormActionGroup" stepKey="assertProductDescription"> <argument name="productDescription" value="{{UpdateAttributeNameAndDescription.description}}"/> </actionGroup> </test> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductFixedPricingTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductFixedPricingTest.xml index c922b981aecd9..2259e91deb2b4 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductFixedPricingTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductFixedPricingTest.xml @@ -32,7 +32,7 @@ <deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/> <deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/> <!-- Delete the bundled product we created in the test body --> - <actionGroup ref="deleteProductBySku" stepKey="deleteBundleProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteBundleProduct"> <argument name="sku" value="{{BundleProduct.sku}}"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -50,11 +50,11 @@ <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/> <waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> @@ -82,7 +82,7 @@ <waitForPageLoad stepKey="WaitForPageToLoad"/> <conditionalClick selector="{{AdminProductFiltersSection.filtersClear}}" dependentSelector="{{AdminProductFiltersSection.filtersClear}}" visible="true" stepKey="ClickOnButtonToRemoveFiltersIfPresent"/> <waitForPageLoad stepKey="WaitForClear"/> - <actionGroup ref="filterProductGridByName" stepKey="filterBundleProductOptionsDownToName"> + <actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterBundleProductOptionsDownToName"> <argument name="product" value="BundleProduct"/> </actionGroup> <seeElement selector="{{AdminProductFiltersSection.priceOfFirstRow(BundleProduct.fixedPrice)}}" stepKey="seePrice"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductWithTierPriceInCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductWithTierPriceInCartTest.xml index 46c6114637af6..a27d5a832ed21 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductWithTierPriceInCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductWithTierPriceInCartTest.xml @@ -26,7 +26,7 @@ <deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/> <deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/> <actionGroup ref="StorefrontSignOutActionGroup" stepKey="StorefrontSignOutActionGroup"/> - <actionGroup stepKey="deleteBundle" ref="deleteProductUsingProductGrid"> + <actionGroup stepKey="deleteBundle" ref="DeleteProductUsingProductGridActionGroup"> <argument name="product" value="BundleProduct"/> </actionGroup> <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearFiltersAfter"/> @@ -55,7 +55,7 @@ <argument name="inputType" value="checkbox"/> </actionGroup> <scrollToTopOfPage stepKey="scrollTopPageProduct"/> - <actionGroup ref="ProductSetAdvancedPricing" stepKey="addTierPriceProduct"> + <actionGroup ref="ProductSetAdvancedPricingActionGroup" stepKey="addTierPriceProduct"> <argument name="group" value="ALL GROUPS"/> <argument name="quantity" value="1"/> <argument name="price" value="Discount"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/CurrencyChangingBundleProductInCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/CurrencyChangingBundleProductInCartTest.xml index ded8bb3c83337..915ccbf2cac09 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/CurrencyChangingBundleProductInCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/CurrencyChangingBundleProductInCartTest.xml @@ -24,7 +24,7 @@ </before> <after> <!-- Delete the bundled product --> - <actionGroup stepKey="deleteBundle" ref="deleteProductUsingProductGrid"> + <actionGroup stepKey="deleteBundle" ref="DeleteProductUsingProductGridActionGroup"> <argument name="product" value="BundleProduct"/> </actionGroup> <actionGroup ref="AdminClearFiltersActionGroup" stepKey="ClearFiltersAfter"/> @@ -58,7 +58,7 @@ </actionGroup> <checkOption selector="{{AdminProductFormBundleSection.userDefinedQuantity('0', '0')}}" stepKey="userDefinedQuantitiyOptionProduct0"/> <checkOption selector="{{AdminProductFormBundleSection.userDefinedQuantity('0', '1')}}" stepKey="userDefinedQuantitiyOptionProduct1"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <amOnPage url="{{ConfigCurrencySetupPage.url}}" stepKey="navigateToConfigCurrencySetupPage"/> <waitForPageLoad stepKey="waitForConfigCurrencySetupPage"/> <conditionalClick selector="{{CurrencySetupSection.currencyOptions}}" dependentSelector="{{CurrencySetupSection.allowCurrencies}}" visible="false" stepKey="openOptions"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/EnableDisableBundleProductStatusTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/EnableDisableBundleProductStatusTest.xml index 0cfd1f99a8ce0..1e16a82ed8714 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/EnableDisableBundleProductStatusTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/EnableDisableBundleProductStatusTest.xml @@ -46,11 +46,11 @@ <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/> <waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> @@ -77,7 +77,7 @@ <!--Testing disabled view--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="GoToProductCatalog"/> <waitForPageLoad stepKey="WaitForCatalogProductPageToLoad"/> - <actionGroup ref="filterProductGridBySku" stepKey="FindProductEditPage"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="FindProductEditPage"> <argument name="product" value="BundleProduct"/> </actionGroup> <click selector="{{AdminDataGridTableSection.rowViewAction('1')}}" stepKey="ClickProductInGrid"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/EndToEndB2CAdminTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/EndToEndB2CAdminTest.xml index 9040d675be34f..5f7a1827a6156 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/EndToEndB2CAdminTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/EndToEndB2CAdminTest.xml @@ -11,7 +11,7 @@ <!--Create Bundle Product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageBundle" after="seeSimpleProductInGrid"/> <waitForPageLoad stepKey="waitForProductPageLoadBundle" after="visitAdminProductPageBundle"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateBundleProduct" after="waitForProductPageLoadBundle"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateBundleProduct" after="waitForProductPageLoadBundle"> <argument name="product" value="BundleProduct"/> </actionGroup> @@ -24,20 +24,20 @@ <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle" after="selectInputType"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption" after="waitForAddProductsToBundle"/> <waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts" after="clickAddProductsToOption"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions" after="waitForPageLoadAfterBundleProducts"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions" after="waitForPageLoadAfterBundleProducts"> <argument name="product" value="SimpleProduct"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow" after="filterBundleProductOptions"/> <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts" after="selectFirstGridRow"/> <fillField selector="{{AdminProductFormBundleSection.firstProductQuantity}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty" after="clickAddSelectedBundleProducts"/> - <actionGroup ref="saveProductForm" stepKey="saveBundleProduct" after="fillProductDefaultQty"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveBundleProduct" after="fillProductDefaultQty"/> <actionGroup ref="viewBundleProductInAdminGrid" stepKey="viewBundleProductInGrid" after="saveBundleProduct"> <argument name="product" value="BundleProduct"/> </actionGroup> <!--@TODO Move cleanup to "after" when MQE-830 is resolved--> <comment userInput="Clean up bundle product" stepKey="cleanUpBundleProduct" after="deleteSimpleProduct"/> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteBundleProduct" after="cleanUpBundleProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteBundleProduct" after="cleanUpBundleProduct"> <argument name="product" value="BundleProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml index ff192538637ef..b689587bcd8eb 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml @@ -48,11 +48,11 @@ <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/> <waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> @@ -80,11 +80,11 @@ <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle2"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption2"/> <waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts2"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptionsx2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptionsx2"> <argument name="product" value="$$simpleProduct3$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRowx2"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions22"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions22"> <argument name="product" value="$$simpleProduct4$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow22"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/NewBundleProductSelectionTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/NewBundleProductSelectionTest.xml index e0a6a9afd648e..2b948ff02d38c 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/NewBundleProductSelectionTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/NewBundleProductSelectionTest.xml @@ -27,7 +27,7 @@ <amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="GoToCatalogProductPage"/> <waitForPageLoad stepKey="WaitForPageToLoad"/> <!--Selecting new bundle product--> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateBundleProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateBundleProduct"> <argument name="product" value="BundleProduct"/> </actionGroup> <!--Testing if on the bundle product creation page--> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/NewProductsListWidgetBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/NewProductsListWidgetBundleProductTest.xml index 8efe32a7d84c0..27369d38f0c35 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/NewProductsListWidgetBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/NewProductsListWidgetBundleProductTest.xml @@ -52,11 +52,11 @@ <selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType('0')}}" userInput="checkbox" stepKey="selectInputType"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/> <waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleOptionsToCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleOptionsToCartTest.xml index a1630128638d9..810f84baed906 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleOptionsToCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleOptionsToCartTest.xml @@ -43,7 +43,7 @@ <deleteData createDataKey="simpleProduct9" stepKey="deleteSimpleProduct9"/> <deleteData createDataKey="simpleProduct10" stepKey="deleteSimpleProduct10"/> <!--delete created bundle product--> - <actionGroup stepKey="deleteProduct1" ref="deleteProductBySku"> + <actionGroup stepKey="deleteProduct1" ref="DeleteProductBySkuActionGroup"> <argument name="sku" value="{{BundleProduct.sku}}"/> </actionGroup> <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" @@ -54,10 +54,10 @@ <!-- Start creating a bundle product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductList"/> <waitForPageLoad stepKey="waitForProductList"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="BundleProduct"/> </actionGroup> - <actionGroup ref="fillProductNameAndSkuInProductForm" stepKey="fillNameAndSku"> + <actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillNameAndSku"> <argument name="product" value="BundleProduct"/> </actionGroup> @@ -97,7 +97,7 @@ </actionGroup> <!-- Save product--> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!--Go to Storefront and open Bundle Product page--> <amOnPage url="{{BundleProduct.sku}}.html" stepKey="goToStorefront"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAdminEditDataTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAdminEditDataTest.xml index 40132ea956584..75e1fa5d7cd4d 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAdminEditDataTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAdminEditDataTest.xml @@ -32,11 +32,11 @@ <!-- Create a bundle product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageBundle"/> <waitForPageLoad stepKey="waitForProductPageLoadBundle"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateBundleProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateBundleProduct"> <argument name="product" value="BundleProduct"/> </actionGroup> - <actionGroup ref="fillProductNameAndSkuInProductForm" stepKey="fillBundleProductNameAndSku"> + <actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillBundleProductNameAndSku"> <argument name="product" value="BundleProduct"/> </actionGroup> @@ -50,11 +50,11 @@ <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/> <waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> @@ -87,7 +87,7 @@ <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> <waitForPageLoad stepKey="waitForAdminProductPageLoad"/> <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedProduct"> <argument name="product" value="BundleProduct"/> </actionGroup> <waitForPageLoad stepKey="waitForProductFilterLoad"/> @@ -106,7 +106,7 @@ <assertNotEquals expected="{$grabTotalBefore}" expectedType="string" actual="{$grabTotalAfter}" actualType="string" stepKey="assertNotEquals"/> <!-- Delete the bundled product --> - <actionGroup stepKey="deleteBundle" ref="deleteProductUsingProductGrid"> + <actionGroup stepKey="deleteBundle" ref="DeleteProductUsingProductGridActionGroup"> <argument name="product" value="BundleProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleCartTest.xml index 695c3a8bf7dbb..9d1008875e57f 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleCartTest.xml @@ -32,10 +32,10 @@ <!-- Start creating a bundle product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductList"/> <waitForPageLoad stepKey="waitForProductList"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="BundleProduct"/> </actionGroup> - <actionGroup ref="fillProductNameAndSkuInProductForm" stepKey="fillNameAndSku"> + <actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillNameAndSku"> <argument name="product" value="BundleProduct"/> </actionGroup> @@ -80,7 +80,7 @@ </actionGroup> <!-- Save product and go to storefront --> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <amOnPage url="{{BundleProduct.sku}}.html" stepKey="goToStorefront"/> <waitForPageLoad stepKey="waitForStorefront"/> <click selector="{{StorefrontBundledSection.addToCart}}" stepKey="clickCustomize"/> @@ -149,10 +149,10 @@ <!-- Start creating a bundle product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductList"/> <waitForPageLoad stepKey="waitForProductList"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="BundleProduct"/> </actionGroup> - <actionGroup ref="fillProductNameAndSkuInProductForm" stepKey="fillNameAndSku"> + <actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillNameAndSku"> <argument name="product" value="BundleProduct"/> </actionGroup> @@ -197,7 +197,7 @@ </actionGroup> <!-- Save product and go to storefront --> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <amOnPage url="{{BundleProduct.sku}}.html" stepKey="goToStorefront"/> <waitForPageLoad stepKey="waitForStorefront"/> <click selector="{{StorefrontBundledSection.addToCart}}" stepKey="clickCustomize"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml index d7394b2dbf32e..35f3cb527628b 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml @@ -33,7 +33,7 @@ <deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/> <deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/> <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndexPage"/> - <actionGroup ref="deleteProductsIfTheyExist" stepKey="deleteAllProducts"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteAllProducts"/> <actionGroup ref="logout" stepKey="logout"/> </after> <!-- go to bundle product creation page--> @@ -55,11 +55,11 @@ <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/> <waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductShownInCategoryListAndGrid.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductShownInCategoryListAndGrid.xml index 88db5b64fa42d..ff25b3f1407c4 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductShownInCategoryListAndGrid.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductShownInCategoryListAndGrid.xml @@ -37,7 +37,7 @@ <!--Make category--> <amOnPage url="{{AdminCategoryPage.url}}" stepKey="goToCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> - <actionGroup ref="CreateCategory" stepKey="createASubcategory"> + <actionGroup ref="CreateCategoryActionGroup" stepKey="createASubcategory"> <argument name="categoryEntity" value="SimpleSubCategory"/> </actionGroup> @@ -59,11 +59,11 @@ <selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType('0')}}" userInput="{{BundleProduct.optionInputType1}}" stepKey="selectInputType"/> <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCheckBundleProductOptionTierPrices.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCheckBundleProductOptionTierPrices.xml index 532af1ea76dca..0487668c10094 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCheckBundleProductOptionTierPrices.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCheckBundleProductOptionTierPrices.xml @@ -28,7 +28,7 @@ <!-- Simple product 1 --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <amOnPage url="{{AdminProductEditPage.url($$simpleProduct1CreateBundleProduct.id$$)}}" stepKey="openAdminEditPageProduct1"/> - <actionGroup ref="ProductSetAdvancedPricing" stepKey="addTierPriceProduct1"> + <actionGroup ref="ProductSetAdvancedPricingActionGroup" stepKey="addTierPriceProduct1"> <argument name="group" value="ALL GROUPS"/> <argument name="quantity" value="5"/> <argument name="price" value="Discount"/> @@ -36,7 +36,7 @@ </actionGroup> <!-- Simple product 2 --> <amOnPage url="{{AdminProductEditPage.url($$simpleProduct2CreateBundleProduct.id$$)}}" stepKey="openAdminEditPageProduct2"/> - <actionGroup ref="ProductSetAdvancedPricing" stepKey="addTierPriceProduct2"> + <actionGroup ref="ProductSetAdvancedPricingActionGroup" stepKey="addTierPriceProduct2"> <argument name="group" value="ALL GROUPS"/> <argument name="quantity" value="7"/> <argument name="price" value="Discount"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSelectAndSetBundleOptionsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSelectAndSetBundleOptionsTest.xml index 5e6e891541420..9998e202fce24 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSelectAndSetBundleOptionsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSelectAndSetBundleOptionsTest.xml @@ -25,7 +25,7 @@ </before> <after> <!-- Delete the bundled product --> - <actionGroup stepKey="deleteBundle" ref="deleteProductUsingProductGrid"> + <actionGroup stepKey="deleteBundle" ref="DeleteProductUsingProductGridActionGroup"> <argument name="product" value="BundleProduct"/> </actionGroup> <amOnPage url="{{AdminLogoutPage.url}}" stepKey="logout"/> @@ -36,10 +36,10 @@ <!-- Start creating a bundle product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductList"/> <waitForPageLoad stepKey="waitForProductList"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="BundleProduct"/> </actionGroup> - <actionGroup ref="fillProductNameAndSkuInProductForm" stepKey="fillNameAndSku"> + <actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillNameAndSku"> <argument name="product" value="BundleProduct"/> </actionGroup> @@ -88,7 +88,7 @@ </actionGroup> <!-- Save product and go to storefront --> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <amOnPage url="{{BundleProduct.sku}}.html" stepKey="goToStorefront"/> <waitForPageLoad stepKey="waitForStorefront"/> <click selector="{{StorefrontBundledSection.addToCart}}" stepKey="clickCustomize"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontEditBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontEditBundleProductTest.xml index 58806126aee30..0ac47a27f1f95 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontEditBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontEditBundleProductTest.xml @@ -32,11 +32,11 @@ <!-- Create a bundle product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageBundle"/> <waitForPageLoad stepKey="waitForProductPageLoadBundle"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateBundleProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateBundleProduct"> <argument name="product" value="BundleProduct"/> </actionGroup> - <actionGroup ref="fillProductNameAndSkuInProductForm" stepKey="fillBundleProductNameAndSku"> + <actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillBundleProductNameAndSku"> <argument name="product" value="BundleProduct"/> </actionGroup> @@ -50,11 +50,11 @@ <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/> <waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> @@ -116,7 +116,7 @@ <assertNotEquals expected="{$grabTotalBefore}" expectedType="string" actual="{$grabTotalAfter}" actualType="string" stepKey="assertNotEquals"/> <!-- Delete the bundled product --> - <actionGroup stepKey="deleteBundle" ref="deleteProductUsingProductGrid"> + <actionGroup stepKey="deleteBundle" ref="DeleteProductUsingProductGridActionGroup"> <argument name="product" value="BundleProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml index ccd6a58223b3c..8f47bd7962bea 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml @@ -48,11 +48,11 @@ <selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType('0')}}" userInput="{{BundleProduct.optionInputType1}}" stepKey="selectInputType"/> <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontSortBundleProductsByPriceTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontSortBundleProductsByPriceTest.xml index 18316e41241e4..8bf0de7530e64 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontSortBundleProductsByPriceTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontSortBundleProductsByPriceTest.xml @@ -156,7 +156,7 @@ </actionGroup> <!-- Switch category view to List mode --> - <actionGroup ref="StorefrontSwitchCategoryViewToListMode" stepKey="switchCategoryViewToListMode"/> + <actionGroup ref="StorefrontSwitchCategoryViewToListModeActionGroup" stepKey="switchCategoryViewToListMode"/> <!-- Sort products By Price --> <actionGroup ref="StorefrontCategoryPageSortProductActionGroup" stepKey="sortProductByPrice"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontVerifyDynamicBundleProductPricesForCombinationOfOptionsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontVerifyDynamicBundleProductPricesForCombinationOfOptionsTest.xml index 31a5f9bab7758..c78796d2fd8b4 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontVerifyDynamicBundleProductPricesForCombinationOfOptionsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontVerifyDynamicBundleProductPricesForCombinationOfOptionsTest.xml @@ -42,7 +42,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <amOnPage url="{{AdminProductEditPage.url($$simpleProduct5.id$$)}}" stepKey="openAdminEditPage"/> <actionGroup ref="AddSpecialPriceToProductActionGroup" stepKey="addSpecialPrice"/> - <actionGroup ref="saveProductForm" stepKey="saveProductForm"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> <!--Create Bundle product--> <createData entity="ApiBundleProductPriceViewRange" stepKey="createBundleProduct"> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddCategoryImageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddCategoryImageActionGroup.xml new file mode 100644 index 0000000000000..5837891667cc9 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddCategoryImageActionGroup.xml @@ -0,0 +1,31 @@ +<?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="AddCategoryImageActionGroup"> + <annotations> + <description>Requires navigation to the Category creation/edit page. Adds the provided image to a Category. Validates that the Image exists.</description> + </annotations> + <arguments> + <argument name="image" defaultValue="ProductImage"/> + </arguments> + + <conditionalClick selector="{{AdminCategoryContentSection.sectionHeader}}" dependentSelector="{{AdminCategoryContentSection.uploadButton}}" visible="false" stepKey="openContentSection"/> + <waitForPageLoad time="30" stepKey="waitForPageLoad"/> + <waitForElementVisible selector="{{AdminCategoryContentSection.uploadButton}}" stepKey="seeImageSectionIsReady"/> + <attachFile selector="{{AdminCategoryContentSection.uploadImageFile}}" userInput="{{image.file}}" stepKey="uploadFile"/> + <waitForAjaxLoad time="30" stepKey="waitForAjaxUpload"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoading"/> + <grabTextFrom selector="{{AdminCategoryContentSection.imageFileName}}" stepKey="grabCategoryFileName"/> + <assertRegExp stepKey="assertEquals" message="pass"> + <expectedResult type="string">/magento-logo(_[0-9]+)*?\.png$/</expectedResult> + <actualResult type="variable">grabCategoryFileName</actualResult> + </assertRegExp> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddCrossSellProductBySkuActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddCrossSellProductBySkuActionGroup.xml new file mode 100644 index 0000000000000..bf238a0b88417 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddCrossSellProductBySkuActionGroup.xml @@ -0,0 +1,32 @@ +<?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="AddCrossSellProductBySkuActionGroup"> + <annotations> + <description>Adds the provided Product SKU as a Cross Sell Product on the Admin Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="sku"/> + </arguments> + + <!--Scroll up to avoid error--> + <scrollTo selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" x="0" y="-100" stepKey="scrollTo"/> + <conditionalClick selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" dependentSelector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDependent}}" visible="false" stepKey="openDropDownIfClosedRelatedUpSellCrossSell"/> + <click selector="{{AdminProductFormRelatedUpSellCrossSellSection.AddCrossSellProductsButton}}" stepKey="clickAddCrossSellButton"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <click selector="{{AdminProductModalSlideGridSection.productGridXRowYColumnButton('1', '1')}}" stepKey="selectProduct"/> + <click selector="{{AdminProductCrossSellModalSection.addSelectedProducts}}" stepKey="addRelatedProductSelected"/> + <waitForPageLoad stepKey="waitForModalDisappear"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductAttributeInProductModalActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductAttributeInProductModalActionGroup.xml new file mode 100644 index 0000000000000..0b8721c589706 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductAttributeInProductModalActionGroup.xml @@ -0,0 +1,28 @@ +<?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="AddProductAttributeInProductModalActionGroup"> + <annotations> + <description>Adds the provided Attribute Code to the Product on the Admin Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="attributeCode" type="string"/> + </arguments> + + <click stepKey="addAttribute" selector="{{AdminProductFormActionSection.addAttributeButton}}"/> + <conditionalClick selector="{{AdminProductAddAttributeModalSection.clearFilters}}" dependentSelector="{{AdminProductAddAttributeModalSection.clearFilters}}" visible="true" stepKey="clearFilters"/> + <click stepKey="clickFilters" selector="{{AdminProductAddAttributeModalSection.filters}}"/> + <fillField stepKey="fillCode" selector="{{AdminProductAddAttributeModalSection.attributeCodeFilter}}" userInput="{{attributeCode}}"/> + <click stepKey="clickApply" selector="{{AdminProductAddAttributeModalSection.applyFilters}}"/> + <waitForPageLoad stepKey="waitForFilters"/> + <checkOption selector="{{AdminProductAddAttributeModalSection.firstRowCheckBox}}" stepKey="checkAttribute"/> + <click stepKey="addSelected" selector="{{AdminProductAddAttributeModalSection.addSelected}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductCustomOptionFieldActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductCustomOptionFieldActionGroup.xml new file mode 100644 index 0000000000000..784a30de3d3c0 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductCustomOptionFieldActionGroup.xml @@ -0,0 +1,31 @@ +<?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="AddProductCustomOptionFieldActionGroup"> + <annotations> + <description>Add a custom Field Product Option to a Product based on the provided Option.</description> + </annotations> + <arguments> + <argument name="option" defaultValue="ProductOptionField"/> + </arguments> + + <scrollTo selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" stepKey="scrollToAddButtonOption"/> + <conditionalClick selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" dependentSelector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" visible="false" stepKey="openCustomOptionSection"/> + <click selector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" stepKey="clickAddOption"/> + <waitForElementVisible selector="{{AdminProductCustomizableOptionsSection.lastOptionTitle}}" stepKey="waitForOption"/> + <fillField selector="{{AdminProductCustomizableOptionsSection.lastOptionTitle}}" userInput="{{option.title}}" stepKey="fillTitle"/> + <click selector="{{AdminProductCustomizableOptionsSection.lastOptionTypeParent}}" stepKey="openTypeSelect"/> + <click selector="{{AdminProductCustomizableOptionsSection.optionType('Field')}}" stepKey="selectTypeFile"/> + <waitForElementVisible selector="{{AdminProductCustomizableOptionsSection.optionPriceByTitle(option.title)}}" stepKey="waitForElements"/> + <fillField selector="{{AdminProductCustomizableOptionsSection.optionPriceByTitle(option.title)}}" userInput="{{option.price}}" stepKey="fillPrice"/> + <selectOption selector="{{AdminProductCustomizableOptionsSection.optionPriceTypeByTitle(option.title)}}" userInput="{{option.price_type}}" stepKey="selectPriceType"/> + <fillField selector="{{AdminProductCustomizableOptionsSection.optionSkuByTitle(option.title)}}" userInput="{{option.title}}" stepKey="fillSku"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductCustomOptionFileActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductCustomOptionFileActionGroup.xml new file mode 100644 index 0000000000000..961493d06f494 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductCustomOptionFileActionGroup.xml @@ -0,0 +1,30 @@ +<?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="AddProductCustomOptionFileActionGroup"> + <annotations> + <description>Add a custom File Product Option to a Product based on the provided File.</description> + </annotations> + <arguments> + <argument name="option" defaultValue="ProductOptionFile"/> + </arguments> + + <conditionalClick selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" dependentSelector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" visible="false" stepKey="openCustomOptionSection"/> + <click selector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" stepKey="clickAddOption"/> + <waitForElementVisible selector="{{AdminProductCustomizableOptionsSection.lastOptionTitle}}" stepKey="waitForOption"/> + <fillField selector="{{AdminProductCustomizableOptionsSection.lastOptionTitle}}" userInput="{{option.title}}" stepKey="fillTitle"/> + <click selector="{{AdminProductCustomizableOptionsSection.lastOptionTypeParent}}" stepKey="openTypeSelect"/> + <click selector="{{AdminProductCustomizableOptionsSection.optionType('File')}}" stepKey="selectTypeFile"/> + <waitForElementVisible selector="{{AdminProductCustomizableOptionsSection.optionPriceByTitle(option.title)}}" stepKey="waitForElements"/> + <fillField selector="{{AdminProductCustomizableOptionsSection.optionPriceByTitle(option.title)}}" userInput="{{option.price}}" stepKey="fillPrice"/> + <selectOption selector="{{AdminProductCustomizableOptionsSection.optionPriceTypeByTitle(option.title)}}" userInput="{{option.price_type}}" stepKey="selectPriceType"/> + <fillField selector="{{AdminProductCustomizableOptionsSection.optionFileExtensionByTitle(option.title)}}" userInput="{{option.file_extension}}" stepKey="fillCompatibleExtensions"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductImageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductImageActionGroup.xml new file mode 100644 index 0000000000000..2efeca44003b3 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductImageActionGroup.xml @@ -0,0 +1,26 @@ +<?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="AddProductImageActionGroup"> + <annotations> + <description>Adds the provided Product Image on the Admin Products creation/edit page.</description> + </annotations> + <arguments> + <argument name="image" defaultValue="ProductImage"/> + </arguments> + + <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductImagesSection"/> + <waitForPageLoad time="30" stepKey="waitForPageRefresh"/> + <waitForElementVisible selector="{{AdminProductImagesSection.imageUploadButton}}" stepKey="seeImageSectionIsReady"/> + <attachFile selector="{{AdminProductImagesSection.imageFileUpload}}" userInput="{{image.file}}" stepKey="uploadFile"/> + <waitForElementNotVisible selector="{{AdminProductImagesSection.uploadProgressBar}}" stepKey="waitForUpload"/> + <waitForElementVisible selector="{{AdminProductImagesSection.imageFile(image.fileName)}}" stepKey="waitForThumbnail"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductWithQtyToCartFromStorefrontProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductWithQtyToCartFromStorefrontProductPageActionGroup.xml new file mode 100644 index 0000000000000..237db68dcf953 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductWithQtyToCartFromStorefrontProductPageActionGroup.xml @@ -0,0 +1,22 @@ +<?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="AddProductWithQtyToCartFromStorefrontProductPageActionGroup" extends="AddToCartFromStorefrontProductPageActionGroup"> + <annotations> + <description>EXTENDS: addToCartFromStorefrontProductPage. Fills in the provided Product Quantity for the provided Product Name.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + <argument name="productQty" type="string"/> + </arguments> + + <fillField selector="{{StorefrontProductActionSection.quantity}}" userInput="{{productQty}}" stepKey="fillProductQuantity" before="addToCart"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddRelatedProductBySkuActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddRelatedProductBySkuActionGroup.xml new file mode 100644 index 0000000000000..ce62acf6dd32a --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddRelatedProductBySkuActionGroup.xml @@ -0,0 +1,32 @@ +<?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="AddRelatedProductBySkuActionGroup"> + <annotations> + <description>Adds the provided Product SKU as a Related Product on the Admin Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="sku"/> + </arguments> + + <!--Scroll up to avoid error--> + <scrollTo selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" x="0" y="-100" stepKey="scrollTo"/> + <conditionalClick selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" dependentSelector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDependent}}" visible="false" stepKey="openDropDownIfClosedRelatedUpSellCrossSell"/> + <click selector="{{AdminProductFormRelatedUpSellCrossSellSection.AddRelatedProductsButton}}" stepKey="clickAddRelatedProductButton"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <click selector="{{AdminProductModalSlideGridSection.productGridXRowYColumnButton('1', '1')}}" stepKey="selectProduct"/> + <click selector="{{AdminAddRelatedProductsModalSection.AddSelectedProductsButton}}" stepKey="addRelatedProductSelected"/> + <waitForElementNotVisible selector="{{AdminAddRelatedProductsModalSection.AddSelectedProductsButton}}" stepKey="waitForElementNotVisible"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductToCartActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddSimpleProductToCartActionGroup.xml similarity index 80% rename from app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductToCartActionGroup.xml rename to app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddSimpleProductToCartActionGroup.xml index bc7288d33bcb3..81e3b8c99d9d2 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductToCartActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddSimpleProductToCartActionGroup.xml @@ -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="AddSimpleProductToCart"> + <actionGroup name="AddSimpleProductToCartActionGroup"> <annotations> <description>Navigates to the Storefront Product page. Then adds the Product to the Cart. Validates that the Success Message is present and correct.</description> </annotations> @@ -26,10 +26,4 @@ <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" time="30" stepKey="waitForProductAddedMessage"/> <see selector="{{StorefrontMessagesSection.success}}" userInput="You added {{product.name}} to your shopping cart." stepKey="seeAddToCartSuccessMessage"/> </actionGroup> - <actionGroup name="StorefrontAddSimpleProductWithQtyActionGroup" extends="AddSimpleProductToCart"> - <arguments> - <argument name="quantity" type="string" defaultValue="1"/> - </arguments> - <fillField userInput="{{quantity}}" selector="{{StorefrontProductPageSection.qtyInput}}" stepKey="fillProductQty" after="goToProductPage"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddSpecialPriceToProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddSpecialPriceToProductActionGroup.xml new file mode 100644 index 0000000000000..dde25104b64dd --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddSpecialPriceToProductActionGroup.xml @@ -0,0 +1,28 @@ +<?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="AddSpecialPriceToProductActionGroup"> + <annotations> + <description>Sets the provided Special Price on the Admin Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="price" type="string" defaultValue="8"/> + </arguments> + + <waitForPageLoad stepKey="waitForPageLoad"/> + <click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickAdvancedPricingLink"/> + <waitForPageLoad stepKey="waitForAdvancedPricingModal"/> + <waitForElementVisible selector="{{AdminProductFormAdvancedPricingSection.specialPrice}}" stepKey="waitSpecialPrice"/> + <fillField userInput="{{price}}" selector="{{AdminProductFormAdvancedPricingSection.specialPrice}}" stepKey="fillSpecialPrice"/> + <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDone"/> + <waitForPageLoad stepKey="waitForAdvancedPricingModalGone"/> + <waitForElementNotVisible selector="{{AdminProductFormAdvancedPricingSection.specialPrice}}" stepKey="waitForCloseModalWindow"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddToCartFromStorefrontProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddToCartFromStorefrontProductPageActionGroup.xml new file mode 100644 index 0000000000000..b27bda2b7c8f1 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddToCartFromStorefrontProductPageActionGroup.xml @@ -0,0 +1,28 @@ +<?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"> + <!--Click Add to Cart button in storefront product page--> + <actionGroup name="AddToCartFromStorefrontProductPageActionGroup"> + <annotations> + <description>Click on the Add to Cart button. Validates that the Success Message is present.</description> + </annotations> + <arguments> + <argument name="productName"/> + </arguments> + + <click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="addToCart"/> + <waitForPageLoad stepKey="waitForAddToCart"/> + <waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdding}}" stepKey="waitForElementNotVisibleAddToCartButtonTitleIsAdding"/> + <waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdded}}" stepKey="waitForElementNotVisibleAddToCartButtonTitleIsAdded"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/> + <see selector="{{StorefrontMessagesSection.success}}" userInput="You added {{productName}} to your shopping cart." stepKey="seeAddToCartSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddUpSellProductBySkuActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddUpSellProductBySkuActionGroup.xml new file mode 100644 index 0000000000000..b107aab956beb --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddUpSellProductBySkuActionGroup.xml @@ -0,0 +1,26 @@ +<?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="AddUpSellProductBySkuActionGroup" extends="AddRelatedProductBySkuActionGroup"> + <annotations> + <description>EXTENDS: addRelatedProductBySku. Add the provided Product as an Up Sell Product.</description> + </annotations> + + <click selector="{{AdminProductFormRelatedUpSellCrossSellSection.AddUpSellProductsButton}}" stepKey="clickAddRelatedProductButton"/> + <conditionalClick selector="{{AdminAddUpSellProductsModalSection.Modal}} {{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminAddUpSellProductsModalSection.Modal}} {{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <click selector="{{AdminAddUpSellProductsModalSection.Modal}} {{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminAddUpSellProductsModalSection.Modal}} {{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/> + <click selector="{{AdminAddUpSellProductsModalSection.Modal}} {{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <click selector="{{AdminAddUpSellProductsModalSection.Modal}}{{AdminProductModalSlideGridSection.productGridXRowYColumnButton('1', '1')}}" stepKey="selectProduct"/> + <click selector="{{AdminAddUpSellProductsModalSection.AddSelectedProductsButton}}" stepKey="addRelatedProductSelected"/> + <waitForPageLoad stepKey="waitForPageToLoad1"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAddAdvancedPricingToTheProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAddAdvancedPricingToTheProductActionGroup.xml index f5e5957507eeb..958549d5768a8 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAddAdvancedPricingToTheProductActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAddAdvancedPricingToTheProductActionGroup.xml @@ -28,16 +28,4 @@ <fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPriceFixedPriceInput(index)}}" userInput="{{groupPrice.price}}" stepKey="selectProductTierPriceFixedPrice"/> <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton"/> </actionGroup> - - <!-- Customer group is selected in different way for B2B --> - <actionGroup name="AdminAddAdvancedPricingToTheProductExtendedActionGroup" extends="AdminAddAdvancedPricingToTheProductActionGroup"> - <annotations> - <description>EXTENDS: AdminAddAdvancedPricingToTheProductActionGroup. Removes 'selectProductTierPriceCustomerGroupInput'. Selects the provided Group Price at the provided Index for B2B.</description> - </annotations> - - <remove keyForRemoval="selectProductTierPriceCustomerGroupInput"/> - <click selector="{{AdminProductFormAdvancedPricingSection.productTierPriceCustGroupSelect(index)}}" stepKey="clickProductTierPriceCustGroupSelect" after="selectProductTierPriceWebsiteInput"/> - <waitForElement selector="{{AdminProductFormAdvancedPricingSection.productTierPriceGroupOrCatalogOption(groupPrice.customer_group)}}" time="30" stepKey="waitProductTierPriceGroupOrCatalogOption" after="clickProductTierPriceCustGroupSelect"/> - <click selector="{{AdminProductFormAdvancedPricingSection.productTierPriceGroupOrCatalogOption(groupPrice.customer_group)}}" stepKey="clickAllGroupsOption" after="waitProductTierPriceGroupOrCatalogOption"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAddAdvancedPricingToTheProductExtendedActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAddAdvancedPricingToTheProductExtendedActionGroup.xml new file mode 100644 index 0000000000000..cf8a3879886f1 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAddAdvancedPricingToTheProductExtendedActionGroup.xml @@ -0,0 +1,21 @@ +<?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="AdminAddAdvancedPricingToTheProductExtendedActionGroup" extends="AdminAddAdvancedPricingToTheProductActionGroup"> + <annotations> + <description>EXTENDS: AdminAddAdvancedPricingToTheProductActionGroup. Removes 'selectProductTierPriceCustomerGroupInput'. Selects the provided Group Price at the provided Index for B2B.</description> + </annotations> + + <remove keyForRemoval="selectProductTierPriceCustomerGroupInput"/> + <click selector="{{AdminProductFormAdvancedPricingSection.productTierPriceCustGroupSelect(index)}}" stepKey="clickProductTierPriceCustGroupSelect" after="selectProductTierPriceWebsiteInput"/> + <waitForElement selector="{{AdminProductFormAdvancedPricingSection.productTierPriceGroupOrCatalogOption(groupPrice.customer_group)}}" time="30" stepKey="waitProductTierPriceGroupOrCatalogOption" after="clickProductTierPriceCustGroupSelect"/> + <click selector="{{AdminProductFormAdvancedPricingSection.productTierPriceGroupOrCatalogOption(groupPrice.customer_group)}}" stepKey="clickAllGroupsOption" after="waitProductTierPriceGroupOrCatalogOption"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAddUnassignedAttributeToGroupActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAddUnassignedAttributeToGroupActionGroup.xml new file mode 100644 index 0000000000000..2815bb7a00abf --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAddUnassignedAttributeToGroupActionGroup.xml @@ -0,0 +1,21 @@ +<?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="AdminAddUnassignedAttributeToGroupActionGroup" extends="CreateDefaultAttributeSetActionGroup"> + <arguments> + <argument name="firstOption" type="string" defaultValue="color"/> + <argument name="secondOption" type="string" defaultValue="material"/> + <argument name="group" type="string" defaultValue="Product Details"/> + </arguments> + <dragAndDrop selector1="{{AdminProductAttributeSetSection.attribute(firstOption)}}" selector2="{{AdminProductAttributeSetSection.attribute(group)}}" stepKey="unassign1"/> + <dragAndDrop selector1="{{AdminProductAttributeSetSection.attribute(secondOption)}}" selector2="{{AdminProductAttributeSetSection.attribute(group)}}" stepKey="unassign2"/> + <click selector="{{AdminProductAttributeSetSection.saveBtn}}" stepKey="clickSaveButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductCustomOptionVisibleActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductCustomOptionVisibleActionGroup.xml new file mode 100644 index 0000000000000..c00d214d53984 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductCustomOptionVisibleActionGroup.xml @@ -0,0 +1,19 @@ +<?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="AdminAssertProductCustomOptionVisibleActionGroup"> + <arguments> + <argument name="option" defaultValue="ProductOptionField"/> + </arguments> + <conditionalClick selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" dependentSelector="{{AdminProductCustomizableOptionsSection.checkIfCustomizableOptionsTabOpen}}" visible="true" stepKey="expandContentTab"/> + <waitForPageLoad time="10" stepKey="waitCustomizableOptionsTabOpened"/> + <seeElement selector="{{AdminProductCustomizableOptionsSection.fillOptionTitle(option.title)}}" stepKey="assertCustomOptionVisible"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductHasNoCustomOptionActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductHasNoCustomOptionActionGroup.xml new file mode 100644 index 0000000000000..d4d10efb697a1 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductHasNoCustomOptionActionGroup.xml @@ -0,0 +1,15 @@ +<?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="AdminAssertProductHasNoCustomOptionActionGroup" extends="AdminAssertProductCustomOptionVisibleActionGroup"> + <remove keyForRemoval="assertCustomOptionVisible"/> + <dontSeeElement selector="{{AdminProductCustomizableOptionsSection.fillOptionTitle(option.title)}}" after="waitCustomizableOptionsTabOpened" stepKey="assertNoCustomOption"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductHasNoCustomOptionsActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductHasNoCustomOptionsActionGroup.xml new file mode 100644 index 0000000000000..f1a41b4922c5a --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductHasNoCustomOptionsActionGroup.xml @@ -0,0 +1,16 @@ +<?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="AdminAssertProductHasNoCustomOptionsActionGroup"> + <conditionalClick selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" dependentSelector="{{AdminProductCustomizableOptionsSection.checkIfCustomizableOptionsTabOpen}}" visible="true" stepKey="expandContentTab"/> + <waitForPageLoad time="10" stepKey="waitCustomizableOptionsTabOpened"/> + <dontSeeElement selector="{{AdminProductCustomizableOptionsSection.customOption}}" stepKey="assertNoCustomOptions"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssignProductToCategoryActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssignProductToCategoryActionGroup.xml new file mode 100644 index 0000000000000..b88129f382263 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssignProductToCategoryActionGroup.xml @@ -0,0 +1,25 @@ +<?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="AdminAssignProductToCategoryActionGroup"> + <annotations> + <description>Navigates to existing product page. Changes the category and saves the product.</description> + </annotations> + <arguments> + <argument name="productId" type="string"/> + <argument name="categoryName" type="string"/> + </arguments> + + <amOnPage url="{{AdminProductEditPage.url(productId)}}" stepKey="amOnPage"/> + <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{categoryName}}]" stepKey="selectCategory"/> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You saved the product." stepKey="seeSaveProductMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryActionGroup.xml deleted file mode 100644 index afc332cc28378..0000000000000 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryActionGroup.xml +++ /dev/null @@ -1,459 +0,0 @@ -<?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"> - <!--Create a new category--> - <actionGroup name="CreateCategory"> - <annotations> - <description>Requires navigation to the Category creation page. Adds a new Subcategory. Validates that the Category was created.</description> - </annotations> - <arguments> - <argument name="categoryEntity" defaultValue="_defaultCategory"/> - </arguments> - - <seeInCurrentUrl url="{{AdminCategoryPage.url}}" stepKey="seeOnCategoryPage"/> - <click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategory"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Category" stepKey="seeCategoryPageTitle"/> - <fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{categoryEntity.name}}" stepKey="enterCategoryName"/> - <click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="openSEO"/> - <fillField selector="{{AdminCategorySEOSection.UrlKeyInput}}" userInput="{{categoryEntity.name_lwr}}" stepKey="enterURLKey"/> - <click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategory"/> - <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="assertSuccess"/> - <seeInTitle userInput="{{categoryEntity.name}}" stepKey="seeNewCategoryPageTitle"/> - <seeElement selector="{{AdminCategorySidebarTreeSection.categoryInTree(categoryEntity.name)}}" stepKey="seeCategoryInTree"/> - </actionGroup> - - <!-- Go to create new root or sub category page --> - <actionGroup name="goToCreateCategoryPage"> - <annotations> - <description>Goes to the Category grid page. Clicks the Add Subcategory button.</description> - </annotations> - <arguments> - <argument name="selector" defaultValue="AdminCategorySidebarActionSection.AddSubcategoryButton"/> - </arguments> - - <amOnPage url="{{AdminCategoryPage.url}}" stepKey="amOnAdminCategoryPage"/> - <scrollToTopOfPage stepKey="scrollToTopOfPage"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <click selector="{{selector}}" stepKey="clickOnAddCategory"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Category" stepKey="seeCategoryPageTitle"/> - </actionGroup> - - <!-- Go to admin category page by id --> - <actionGroup name="goToAdminCategoryPageById"> - <annotations> - <description>Goes to the Category edit page for a specified Category ID.</description> - </annotations> - <arguments> - <argument name="id" type="string"/> - </arguments> - - <amOnPage url="{{AdminCategoryEditPage.url(id)}}" stepKey="amOnAdminCategoryPage"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="{{id}}" stepKey="seeCategoryPageTitle"/> - </actionGroup> - - <!-- Fill category fields --> - <actionGroup name="fillCategoryForm"> - <annotations> - <description>Requires navigation to the Subcategory creation/edit page. Fills the Subcategory Name. Fills the Search Engine Optimization.</description> - </annotations> - <arguments> - <argument name="categoryEntity" defaultValue="_defaultCategory"/> - </arguments> - - <fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{categoryEntity.name}}" stepKey="enterCategoryName"/> - <click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="openSEO"/> - <fillField selector="{{AdminCategorySEOSection.UrlKeyInput}}" userInput="{{categoryEntity.name_lwr}}" stepKey="enterURLKey"/> - </actionGroup> - - <!-- Save category form --> - <actionGroup name="saveCategoryForm"> - <annotations> - <description>Requires navigation to the Category creation/edit page. Checks that the url contains the AdminCategoryPage url. Saves the Category.</description> - </annotations> - - <seeInCurrentUrl url="{{AdminCategoryPage.url}}" stepKey="seeOnCategoryPage"/> - <click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategory"/> - <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="assertSuccess"/> - </actionGroup> - - <!--Upload image for category --> - <actionGroup name="addCategoryImage"> - <annotations> - <description>Requires navigation to the Category creation/edit page. Adds the provided image to a Category. Validates that the Image exists.</description> - </annotations> - <arguments> - <argument name="image" defaultValue="ProductImage"/> - </arguments> - - <conditionalClick selector="{{AdminCategoryContentSection.sectionHeader}}" dependentSelector="{{AdminCategoryContentSection.uploadButton}}" visible="false" stepKey="openContentSection"/> - <waitForPageLoad time="30" stepKey="waitForPageLoad"/> - <waitForElementVisible selector="{{AdminCategoryContentSection.uploadButton}}" stepKey="seeImageSectionIsReady"/> - <attachFile selector="{{AdminCategoryContentSection.uploadImageFile}}" userInput="{{image.file}}" stepKey="uploadFile"/> - <waitForAjaxLoad time="30" stepKey="waitForAjaxUpload"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoading"/> - <grabTextFrom selector="{{AdminCategoryContentSection.imageFileName}}" stepKey="grabCategoryFileName"/> - <assertRegExp stepKey="assertEquals" message="pass"> - <expectedResult type="string">/magento-logo(_[0-9]+)*?\.png$/</expectedResult> - <actualResult type="variable">grabCategoryFileName</actualResult> - </assertRegExp> - </actionGroup> - - <!-- Remove image from category --> - <actionGroup name="removeCategoryImage"> - <annotations> - <description>Requires navigation to the Category creation/edit page. Removes the current Category image. Validates that the Image does not exist.</description> - </annotations> - - <conditionalClick selector="{{AdminCategoryContentSection.sectionHeader}}" dependentSelector="{{AdminCategoryContentSection.uploadButton}}" visible="false" stepKey="openContentSection"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <waitForElementVisible selector="{{AdminCategoryContentSection.uploadButton}}" stepKey="seeImageSectionIsReady"/> - <click selector="{{AdminCategoryContentSection.removeImageButton}}" stepKey="clickRemoveImage"/> - <waitForAjaxLoad time="30" stepKey="waitForAjaxUpload"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoading"/> - <dontSee selector="{{AdminCategoryContentSection.imageFileName}}" stepKey="dontSeeImage"/> - </actionGroup> - - <actionGroup name="checkCategoryImageInAdmin"> - <annotations> - <description>Requires navigation to the Category creation/edit page. Click on the Upload button. Validates that the Image exists.</description> - </annotations> - <arguments> - <argument name="image" defaultValue="ProductImage"/> - </arguments> - - <conditionalClick selector="{{AdminCategoryContentSection.sectionHeader}}" dependentSelector="{{AdminCategoryContentSection.uploadButton}}" visible="false" stepKey="openContentSection"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <waitForElementVisible selector="{{AdminCategoryContentSection.uploadButton}}" stepKey="seeImageSectionIsReady"/> - <grabTextFrom selector="{{AdminCategoryContentSection.imageFileName}}" stepKey="grabCategoryFileName"/> - <assertRegExp stepKey="assertEquals" message="pass"> - <expectedResult type="string">/magento-logo(_[0-9]+)*?\.png$/</expectedResult> - <actualResult type="variable">grabCategoryFileName</actualResult> - </assertRegExp> - </actionGroup> - - <!-- Action to navigate to Media Gallery. Used in tests to cleanup uploaded images --> - <actionGroup name="navigateToMediaGallery"> - <annotations> - <description>Navigates to the category page and Opens the Media Gallery.</description> - </annotations> - - <amOnPage url="{{AdminCategoryPage.url}}" stepKey="amOnAdminCategoryPage"/> - <waitForElementVisible selector="{{AdminCategoryContentSection.sectionHeader}}" stepKey="waitForContentSection"/> - <conditionalClick selector="{{AdminCategoryContentSection.sectionHeader}}" dependentSelector="{{AdminCategoryContentSection.uploadButton}}" visible="false" stepKey="openContentSection"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - <waitForElementVisible selector="{{AdminCategoryContentSection.selectFromGalleryButton}}" stepKey="waitForSelectFromGalleryButton"/> - <click selector="{{AdminCategoryContentSection.selectFromGalleryButton}}" stepKey="clickSelectFromGalleryButton"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/> - </actionGroup> - - <!--Actions to check if a category exists on StoreFront--> - <actionGroup name="CheckCategoryOnStorefront"> - <annotations> - <description>Navigates to the category page on the storefront and asserts that the title is correct for page and browser.</description> - </annotations> - <arguments> - <argument name="categoryEntity" defaultValue="_defaultCategory"/> - </arguments> - - <amOnPage url="/{{categoryEntity.name_lwr}}.html" stepKey="goToCategoryFrontPage"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - <see selector="{{StorefrontCategoryMainSection.CategoryTitle}}" userInput="{{categoryEntity.name_lwr}}" stepKey="assertCategoryOnStorefront"/> - <seeInTitle userInput="{{categoryEntity.name}}" stepKey="seeCategoryNameInTitle"/> - </actionGroup> - - <!--Actions to delete category--> - <actionGroup name="DeleteCategory"> - <annotations> - <description>Navigates to the category page and deletes the specified category.</description> - </annotations> - <arguments> - <argument name="categoryEntity" defaultValue="_defaultCategory"/> - </arguments> - - <amOnPage url="{{AdminCategoryPage.url}}" stepKey="goToCategoryPage"/> - <waitForPageLoad time="60" stepKey="waitForCategoryPageLoad"/> - <click selector="{{AdminCategorySidebarTreeSection.categoryInTree(categoryEntity.name)}}" stepKey="clickCategoryLink"/> - <click selector="{{AdminCategoryMainActionsSection.DeleteButton}}" stepKey="clickDelete"/> - <waitForElementVisible selector="{{AdminCategoryModalSection.message}}" stepKey="waitForConfirmationModal"/> - <see selector="{{AdminCategoryModalSection.message}}" userInput="Are you sure you want to delete this category?" stepKey="seeDeleteConfirmationMessage"/> - <click selector="{{AdminCategoryModalSection.ok}}" stepKey="confirmDelete"/> - <waitForPageLoad time="60" stepKey="waitForDeleteToFinish"/> - <see selector="You deleted the category." stepKey="seeDeleteSuccess"/> - <click selector="{{AdminCategorySidebarTreeSection.expandAll}}" stepKey="expandToSeeAllCategories"/> - <dontSee selector="{{AdminCategorySidebarTreeSection.categoryInTree(categoryEntity.name)}}" stepKey="dontSeeCategoryInTree"/> - </actionGroup> - <actionGroup name="AdminDeleteCategoryByName" extends="DeleteCategory"> - <arguments> - <argument name="categoryName" type="string" defaultValue="category1"/> - </arguments> - <remove keyForRemoval="clickCategoryLink"/> - <remove keyForRemoval="dontSeeCategoryInTree"/> - <remove keyForRemoval="expandToSeeAllCategories"/> - <conditionalClick selector="{{AdminCategorySidebarTreeSection.expandAll}}" dependentSelector="{{AdminCategorySidebarTreeSection.categoryByName(categoryName)}}" visible="false" stepKey="expandCategories" after="waitForCategoryPageLoad"/> - <click selector="{{AdminCategorySidebarTreeSection.categoryByName(categoryName)}}" stepKey="clickCategory" after="expandCategories"/> - <conditionalClick selector="{{AdminCategorySidebarTreeSection.expandAll}}" dependentSelector="{{AdminCategorySidebarTreeSection.categoryByName(categoryName)}}" visible="false" stepKey="expandCategoriesToSeeAll" after="seeDeleteSuccess"/> - <dontSee selector="{{AdminCategorySidebarTreeSection.categoryByName(categoryName)}}" stepKey="dontSeeCategory" after="expandCategoriesToSeeAll"/> - </actionGroup> - - <!-- Actions to fill out a new category from the product page--> - <!-- The action assumes that you are already on an admin product configuration page --> - <actionGroup name="FillNewProductCategory" > - <annotations> - <description>Actions to fill out a new category from the product page with specified category and parent category names.</description> - </annotations> - <arguments> - <argument name="categoryName" defaultValue="Test Category" type="string"/> - <argument name="parentCategoryName" defaultValue="default" type="string"/> - </arguments> - - <!-- Click on new Category --> - <click stepKey="clickNewCategory" selector="{{AdminProductCategoryCreationSection.newCategory}}"/> - <waitForPageLoad stepKey="waitForFieldSet"/> - <fillField stepKey="fillCategoryName" selector="{{AdminProductCategoryCreationSection.nameInput}}" userInput="{{categoryName}}"/> - - <!-- Search and select a parent category for the product --> - <click stepKey="clickParentCategory" selector="{{AdminProductCategoryCreationSection.parentCategory}}"/> - <waitForPageLoad stepKey="waitForDropDownVisible"/> - <fillField stepKey="searchForParent" userInput="{{parentCategoryName}}" selector="{{AdminProductCategoryCreationSection.parentSearch}}"/> - <waitForPageLoad stepKey="waitForFieldResults"/> - <click stepKey="clickParent" selector="{{AdminProductCategoryCreationSection.parentSearchResult}}"/> - <click stepKey="createCategory" selector="{{AdminProductCategoryCreationSection.createCategory}}"/> - <waitForPageLoad stepKey="waitForCategoryCreated"/> - </actionGroup> - - <!-- Actions to delete the category last made --> - <actionGroup name="DeleteMostRecentCategory"> - <annotations> - <description>Actions to delete the category last made (the last category on the list).</description> - </annotations> - - <amOnPage url="/{{AdminCategoryPage.url}}" stepKey="goToCategoryFrontPage"/> - <waitForPageLoad stepKey="waitForCategoryPageLoad"/> - <click stepKey="goToCreateCategory" selector="{{AdminCategorySidebarTreeSection.lastCreatedCategory}}"/> - <waitForPageLoad stepKey="waitForCreatedCategoryPageLoad"/> - <click stepKey="clickDeleteCategory" selector="{{AdminCategoryMainActionsSection.DeleteButton}}"/> - <waitForPageLoad stepKey="waitForModalVisible"/> - <click stepKey="clickOkToDelete" selector="{{AdminCategoryModalSection.ok}}"/> - <waitForPageLoad stepKey="waitForModalNotVisible"/> - </actionGroup> - - <!-- Actions to check if a certain category is present on the page --> - <actionGroup name="CategoryPresent" > - <annotations> - <description>Navigates to category page, asserts category is there. Navigates to storefront category page and asserts category is there. This action group will not work categories where name does NOT equal SEO.</description> - </annotations> - <arguments> - <argument name="categoryName" defaultValue="Test Category" type="string"/> - </arguments> - - <amOnPage url="{{AdminCategoryPage.url}}" stepKey="goToCategoryAdminPage"/> - <waitForPageLoad stepKey="waitForCategoryAdminPageLoad"/> - <see userInput="{{categoryName}}" stepKey="assertCategoryOnAdminPage" selector="{{AdminCategorySidebarTreeSection.treeContainer}}"/> - <amOnPage url="/{{categoryName}}.html" stepKey="goToCustomerFrontPage"/> - <see userInput="{{categoryName}}" stepKey="assertCategoryNameOnStorefront" selector="{{StorefrontCategoryMainSection.CategoryTitle}}"/> - <waitForPageLoad stepKey="waitForCustomerCategoryPageLoad"/> - </actionGroup> - - <!--Check that name field is required--> - <actionGroup name="CheckCategoryNameIsRequiredField"> - <annotations> - <description>Navigates to category page, attempts to add subcategory without name. Expects required field prompt.</description> - </annotations> - - <seeInCurrentUrl url="{{AdminCategoryPage.url}}" stepKey="seeOnCategoryPage"/> - <click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategory"/> - <clearField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" stepKey="makeNameFieldEmpty"/> - <click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategory"/> - <seeInCurrentUrl url="{{AdminCategoryPage.url}}add" stepKey="seeBackOnCreateCategoryPage"/> - <see selector="{{AdminCategoryBasicFieldSection.FieldError('uid')}}" userInput="This is a required field." stepKey="seeErrorMessage"/> - </actionGroup> - - <actionGroup name="switchCategoryStoreView"> - <annotations> - <description>Navigates to category page, selects a category and changes store view to specified store.</description> - </annotations> - <arguments> - <argument name="Store"/> - <argument name="CatName"/> - </arguments> - - <amOnPage url="{{AdminCategoryPage.page}}" stepKey="amOnCategoryPage"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - <click selector="{{AdminCategorySidebarTreeSection.categoryInTree(CatName)}}" stepKey="navigateToCreatedCategory"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - <waitForLoadingMaskToDisappear stepKey="waitForSpinner"/> - <scrollToTopOfPage stepKey="scrollToToggle"/> - <click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewDropdownToggle}}" stepKey="openStoreViewDropDown"/> - <click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewOption(Store)}}" stepKey="selectStoreView"/> - <waitForPageLoad stepKey="waitForPageLoad3"/> - <waitForLoadingMaskToDisappear stepKey="waitForSpinner2"/> - <click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewModalAccept}}" stepKey="selectStoreViewAccept"/> - <waitForPageLoad stepKey="waitForStoreViewChangeLoad"/> - </actionGroup> - - <actionGroup name="switchCategoryToAllStoreView"> - <annotations> - <description>Navigates to category page, selects a category and changes store view to all stores.</description> - </annotations> - <arguments> - <argument name="CatName"/> - </arguments> - - <click selector="{{AdminCategorySidebarTreeSection.categoryInTree(CatName)}}" stepKey="navigateToCreatedCategory"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - <waitForLoadingMaskToDisappear stepKey="waitForSpinner1"/> - <scrollToTopOfPage stepKey="scrollToToggle"/> - <click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewDropdownToggle}}" stepKey="openStoreViewDropDown"/> - <click selector="{{AdminCategoryMainActionsSection.allStoreViews}}" stepKey="clickStoreViewByName"/> - <see selector="{{AdminCategoryMainActionsSection.storeSwitcher}}" userInput="All Store Views" stepKey="seeAllStoreView"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - <waitForLoadingMaskToDisappear stepKey="waitForSpinner2"/> - <click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewModalAccept}}" stepKey="selectStoreViewAccept"/> - <waitForPageLoad stepKey="waitForStoreViewChangeLoad"/> - </actionGroup> - - <actionGroup name="navigateToCreatedCategory"> - <annotations> - <description>Navigates to category page, selects a category by specified category.</description> - </annotations> - <arguments> - <argument name="Category"/> - </arguments> - - <amOnPage url="{{AdminCategoryPage.page}}" stepKey="amOnCategoryPage"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - <click selector="{{AdminCategorySidebarTreeSection.expandAll}}" stepKey="expandAll"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - <click selector="{{AdminCategorySidebarTreeSection.categoryInTree(Category.Name)}}" stepKey="navigateToCreatedCategory"/> - <waitForLoadingMaskToDisappear stepKey="waitForSpinner"/> - </actionGroup> - - <actionGroup name="ChangeSeoUrlKey"> - <annotations> - <description>Requires navigation to category creation/edit. Updates the Search Engine Optimization.</description> - </annotations> - <arguments> - <argument name="value" type="string"/> - </arguments> - - <click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="openSeoSection"/> - <fillField selector="{{AdminCategorySEOSection.UrlKeyInput}}" userInput="{{value}}" stepKey="enterURLKey"/> - <click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategory"/> - <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="assertSuccessMessage"/> - </actionGroup> - - <actionGroup name="ChangeSeoUrlKeyForSubCategory"> - <annotations> - <description>Requires navigation to subcategory creation/edit. Updates the Search Engine Optimization.</description> - </annotations> - <arguments> - <argument name="value" type="string"/> - </arguments> - - <click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="openSeoSection"/> - <uncheckOption selector="{{AdminCategorySEOSection.UrlKeyDefaultValueCheckbox}}" stepKey="uncheckDefaultValue"/> - <fillField selector="{{AdminCategorySEOSection.UrlKeyInput}}" userInput="{{value}}" stepKey="enterURLKey"/> - <click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategory"/> - <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="assertSuccessMessage"/> - </actionGroup> - - <actionGroup name="OpenCategoryFromCategoryTree"> - <annotations> - <description>Navigates to category page, selects a category by specified category. Replicates actionGroup:navigateToCreatedCategory.</description> - </annotations> - <arguments> - <argument name="category" type="string"/> - </arguments> - - <amOnPage url="{{AdminCategoryPage.url}}" stepKey="openAdminCategoryIndexPage"/> - <waitForPageLoad stepKey="waitForCategoryPageToLoad"/> - <click selector="{{AdminCategorySidebarTreeSection.expandAll}}" stepKey="clickOnExpandTree"/> - <waitForPageLoad stepKey="waitForCategoryToLoad"/> - <click selector="{{AdminCategorySidebarTreeSection.categoryInTree(category)}}" stepKey="selectCategory"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> - <waitForElementVisible selector="{{AdminCategoryContentSection.categoryPageTitle}}" stepKey="waitForCategoryTitle"/> - </actionGroup> - - <actionGroup name="AdminAssignProductToCategory"> - <annotations> - <description>Navigates to existing product page. Changes the category and saves the product.</description> - </annotations> - <arguments> - <argument name="productId" type="string"/> - <argument name="categoryName" type="string"/> - </arguments> - - <amOnPage url="{{AdminProductEditPage.url(productId)}}" stepKey="amOnPage"/> - <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{categoryName}}]" stepKey="selectCategory"/> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You saved the product." stepKey="seeSaveProductMessage"/> - </actionGroup> - - <actionGroup name="FillCategoryNameAndUrlKeyAndSave"> - <annotations> - <description>Requires navigation to subcategory creation/edit. Fills the name, and sets the Search Engine Optimization for the category.</description> - </annotations> - <arguments> - <argument name="categoryName" type="string"/> - <argument name="categoryUrlKey" type="string"/> - </arguments> - - <fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{categoryName}}" stepKey="enterCategoryName"/> - <scrollTo selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="scrollToSearchEngineOptimization"/> - <click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="openSEO"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> - <fillField selector="{{AdminCategorySEOSection.UrlKeyInput}}" userInput="{{categoryUrlKey}}" stepKey="enterURLKey"/> - <scrollToTopOfPage stepKey="scrollToTheTopOfPage"/> - <click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategory"/> - <waitForPageLoad stepKey="waitForPageToLoad1"/> - </actionGroup> - - <actionGroup name="AdminCategoryAssignProduct"> - <annotations> - <description>Requires navigation to category creation/edit page. Assign products to category - using "Products in Category" tab.</description> - </annotations> - <arguments> - <argument name="productSku" type="string"/> - </arguments> - - <conditionalClick selector="{{AdminCategoryBasicFieldSection.productsInCategory}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="false" stepKey="clickOnProductInCategory"/> - <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickOnResetFilter"/> - <fillField selector="{{AdminCategoryContentSection.productTableColumnSku}}" userInput="{{productSku}}" stepKey="fillSkuFilter"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearchButton"/> - <click selector="{{AdminCategoryContentSection.productTableRow}}" stepKey="selectProductFromTableRow"/> - </actionGroup> - - <actionGroup name="DeleteDefaultCategoryChildren"> - <annotations> - <description>Deletes all children categories of Default Root Category.</description> - </annotations> - - <amOnPage url="{{AdminCategoryPage.url}}" stepKey="navigateToAdminCategoryPage"/> - <executeInSelenium function="function ($webdriver) use ($I) { - $children = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::xpath('//ul[contains(@class, \'x-tree-node-ct\')]/li[@class=\'x-tree-node\' and contains(., - \'{{DefaultCategory.name}}\')]/ul[contains(@class, \'x-tree-node-ct\')]/li//a')); - while (!empty($children)) { - $I->click('//ul[contains(@class, \'x-tree-node-ct\')]/li[@class=\'x-tree-node\' and contains(., - \'{{DefaultCategory.name}}\')]/ul[contains(@class, \'x-tree-node-ct\')]/li//a'); - $I->waitForPageLoad(30); - $I->click('#delete'); - $I->waitForElementVisible('aside.confirm .modal-footer button.action-accept'); - $I->click('aside.confirm .modal-footer button.action-accept'); - $I->waitForPageLoad(30); - $I->waitForElementVisible('#messages div.message-success', 30); - $I->see('You deleted the category.', '#messages div.message-success'); - $children = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::xpath('//ul[contains(@class, \'x-tree-node-ct\')]/li[@class=\'x-tree-node\' and contains(., - \'{{DefaultCategory.name}}\')]/ul[contains(@class, \'x-tree-node-ct\')]/li//a')); - } - }" stepKey="deleteAllChildCategories"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryAssignProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryAssignProductActionGroup.xml new file mode 100644 index 0000000000000..9dc661ae5ecad --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryAssignProductActionGroup.xml @@ -0,0 +1,25 @@ +<?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="AdminCategoryAssignProductActionGroup"> + <annotations> + <description>Requires navigation to category creation/edit page. Assign products to category - using "Products in Category" tab.</description> + </annotations> + <arguments> + <argument name="productSku" type="string"/> + </arguments> + + <conditionalClick selector="{{AdminCategoryBasicFieldSection.productsInCategory}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="false" stepKey="clickOnProductInCategory"/> + <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickOnResetFilter"/> + <fillField selector="{{AdminCategoryContentSection.productTableColumnSku}}" userInput="{{productSku}}" stepKey="fillSkuFilter"/> + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearchButton"/> + <click selector="{{AdminCategoryContentSection.productTableRow}}" stepKey="selectProductFromTableRow"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckProductsInGridActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckProductIsMissingInCategoryProductsGridActionGroup.xml similarity index 61% rename from app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckProductsInGridActionGroup.xml rename to app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckProductIsMissingInCategoryProductsGridActionGroup.xml index 440739875c0c1..4b360cde1485a 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckProductsInGridActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckProductIsMissingInCategoryProductsGridActionGroup.xml @@ -8,17 +8,10 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminCheckProductIsMissingInCategoryProductsGrid"> + <actionGroup name="AdminCheckProductIsMissingInCategoryProductsGridActionGroup"> <arguments> <argument name="productName" type="string"/> </arguments> <dontSee selector="{{AdminCategoryProductsGridSection.nameColumn}}" userInput="{{productName}}" stepKey="dontSeeProduct"/> </actionGroup> - <actionGroup name="AdminCheckProductPositionInCategoryProductsGrid"> - <arguments> - <argument name="position" type="string"/> - <argument name="productName" type="string"/> - </arguments> - <see selector="{{AdminCategoryProductsGridSection.rowProductName(position)}}" userInput="{{productName}}" stepKey="assertProductPosition"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckProductPositionInCategoryProductsGridActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckProductPositionInCategoryProductsGridActionGroup.xml new file mode 100644 index 0000000000000..2c0832e0ee877 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckProductPositionInCategoryProductsGridActionGroup.xml @@ -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="AdminCheckProductPositionInCategoryProductsGridActionGroup"> + <arguments> + <argument name="position" type="string"/> + <argument name="productName" type="string"/> + </arguments> + <see selector="{{AdminCategoryProductsGridSection.rowProductName(position)}}" userInput="{{productName}}" stepKey="assertProductPosition"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickOnAdvancedInventoryButtonActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickOnAdvancedInventoryButtonActionGroup.xml new file mode 100644 index 0000000000000..33b99cef6d650 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickOnAdvancedInventoryButtonActionGroup.xml @@ -0,0 +1,19 @@ +<?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="AdminClickOnAdvancedInventoryButtonActionGroup"> + <annotations> + <description>Clicks on the 'Advanced Inventory' link on the Admin Product creation/edit page.</description> + </annotations> + + <click selector="{{AdminProductFormSection.advancedInventoryButton}}" stepKey="clickOnAdvancedInventoryLink"/> + <waitForPageLoad stepKey="waitForAdvancedInventoryPageToLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickOnAdvancedInventoryLinkActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickOnAdvancedInventoryLinkActionGroup.xml index a0cff133cbbed..60438e23e084c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickOnAdvancedInventoryLinkActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickOnAdvancedInventoryLinkActionGroup.xml @@ -18,15 +18,4 @@ <click selector="{{AdminProductFormSection.advancedInventoryLink}}" stepKey="clickOnAdvancedInventoryLink"/> <waitForPageLoad stepKey="waitForAdvancedInventoryPageToLoad"/> </actionGroup> - - <!-- ActionGroup click on Advanced Inventory Button in product form; - You must already be on the product form page --> - <actionGroup name="AdminClickOnAdvancedInventoryButtonActionGroup"> - <annotations> - <description>Clicks on the 'Advanced Inventory' link on the Admin Product creation/edit page.</description> - </annotations> - - <click selector="{{AdminProductFormSection.advancedInventoryButton}}" stepKey="clickOnAdvancedInventoryLink"/> - <waitForPageLoad stepKey="waitForAdvancedInventoryPageToLoad"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateAttributeFromProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateAttributeFromProductPageActionGroup.xml new file mode 100644 index 0000000000000..ae8e8a84149e1 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateAttributeFromProductPageActionGroup.xml @@ -0,0 +1,27 @@ +<?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="AdminCreateAttributeFromProductPageActionGroup"> + <annotations> + <description>From the Product creation/edit page, under 'Configurations', Clicks on 'Create Configurations'. Clicks on 'Create New Attribute'. Fills Label. Selects Type. Clicks on Save.</description> + </annotations> + <arguments> + <argument name="attributeName" type="string"/> + <argument name="attributeType" type="string" defaultValue="TextField"/> + </arguments> + + <click selector="{{AdminProductFormSection.addAttributeBtn}}" stepKey="clickAddAttributeBtn"/> + <see userInput="Select Attribute" stepKey="checkNewAttributePopUpAppeared"/> + <click selector="{{AdminProductFormAttributeSection.createNewAttribute}}" stepKey="clickCreateNewAttribute"/> + <fillField selector="{{AdminProductFormNewAttributeSection.attributeLabel}}" userInput="{{attributeName}}" stepKey="fillAttributeLabel"/> + <selectOption selector="{{AdminProductFormNewAttributeSection.attributeType}}" userInput="{{attributeType}}" stepKey="selectAttributeType"/> + <click selector="{{AdminProductFormNewAttributeSection.saveAttribute}}" stepKey="saveAttribute"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateAttributeFromProductPageWithScopeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateAttributeFromProductPageWithScopeActionGroup.xml new file mode 100644 index 0000000000000..2ee84fcb24b68 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateAttributeFromProductPageWithScopeActionGroup.xml @@ -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="AdminCreateAttributeFromProductPageWithScopeActionGroup" extends="AdminCreateAttributeFromProductPageActionGroup" insertAfter="selectAttributeType"> + <arguments> + <argument name="scope" type="string" defaultValue="Store View"/> + </arguments> + <conditionalClick selector="{{AdminProductFormNewAttributeAdvancedSection.sectionHeader}}" dependentSelector="{{AdminProductFormNewAttributeAdvancedSection.scope}}" visible="false" stepKey="openAttributeAdvancedSection"/> + <selectOption selector="{{AdminProductFormNewAttributeAdvancedSection.scope}}" userInput="{{scope}}" stepKey="selectScope"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateAttributeWithSearchWeightActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateAttributeWithSearchWeightActionGroup.xml new file mode 100644 index 0000000000000..2ca4c9b616862 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateAttributeWithSearchWeightActionGroup.xml @@ -0,0 +1,27 @@ +<?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="AdminCreateAttributeWithSearchWeightActionGroup" extends="AdminProductPageCreateAttributeSetWithAttributeActionGroup" insertAfter="selectAttributeType"> + <annotations> + <description>EXTENDS: AdminProductPageCreateAttributeSetWithAttribute. Sets the provided Search Weight and Default Values.</description> + </annotations> + <arguments> + <argument name="weight" type="string" defaultValue="1"/> + <argument name="defaultValue" type="string" defaultValue="default"/> + </arguments> + + <click selector="{{AdminProductFormNewAttributeAdvancedSection.sectionHeader}}" stepKey="openAdvancedSection"/> + <fillField selector="{{AdminProductFormNewAttributeAdvancedSection.defaultValue}}" userInput="{{defaultValue}}" stepKey="inputDefault"/> + <click selector="{{AdminProductFormNewAttributeStorefrontSection.sectionHeader}}" stepKey="openStorefrontSection"/> + <checkOption selector="{{AdminProductFormNewAttributeStorefrontSection.useInSearch}}" stepKey="checkUseInSearch"/> + <waitForElementVisible selector="{{AdminProductFormNewAttributeStorefrontSection.searchWeight}}" stepKey="waitForSearchWeight"/> + <selectOption selector="{{AdminProductFormNewAttributeStorefrontSection.searchWeight}}" userInput="{{weight}}" stepKey="selectWeight"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateAttributeWithValueWithTwoStoreViesFromProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateAttributeWithValueWithTwoStoreViesFromProductPageActionGroup.xml new file mode 100644 index 0000000000000..ec02df1fbf327 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateAttributeWithValueWithTwoStoreViesFromProductPageActionGroup.xml @@ -0,0 +1,35 @@ +<?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="AdminCreateAttributeWithValueWithTwoStoreViesFromProductPageActionGroup" extends="AdminCreateAttributeFromProductPageActionGroup"> + <remove keyForRemoval="saveAttribute"/> + <annotations> + <description>EXTENDS: AdminCreateAttributeFromProductPage. Adds the 2 provided Store Views to a Product. Clicks on Save.</description> + </annotations> + <arguments> + <argument name="firstStoreViewName" type="string"/> + <argument name="secondStoreViewName" type="string"/> + </arguments> + + <click selector="{{AdminProductFormNewAttributeSection.addValue}}" stepKey="addValue" after="selectAttributeType"/> + <seeElement selector="{{AdminProductFormNewAttributeSection.optionViewName(firstStoreViewName))}}" stepKey="seeFirstStoreView"/> + <seeElement selector="{{AdminProductFormNewAttributeSection.optionViewName(firstStoreViewName))}}" stepKey="seeSecondStoreView"/> + <fillField selector="{{AdminProductFormNewAttributeSection.optionValue('1'))}}" userInput="default" stepKey="fillDefaultStoreView"/> + <fillField selector="{{AdminProductFormNewAttributeSection.optionValue('2'))}}" userInput="admin" stepKey="fillAdminStoreView"/> + <fillField selector="{{AdminProductFormNewAttributeSection.optionValue('3'))}}" userInput="view1" stepKey="fillFirstStoreView"/> + <fillField selector="{{AdminProductFormNewAttributeSection.optionValue('4'))}}" userInput="view2" stepKey="fillSecondStoreView"/> + + <!--Check store view in Manage Titles section--> + <click selector="{{AdminProductFormNewAttributeSection.manageTitlesHeader}}" stepKey="openManageTitlesSection"/> + <seeElement selector="{{AdminProductFormNewAttributeSection.manageTitlesViewName(customStoreEN.name)}}" stepKey="seeFirstStoreViewName"/> + <seeElement selector="{{AdminProductFormNewAttributeSection.manageTitlesViewName(customStoreFR.name)}}" stepKey="seeSecondStoreViewName"/> + <click selector="{{AdminProductFormNewAttributeSection.saveAttribute}}" stepKey="saveAttribute1"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateWidgetActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateCatalogProductWidgetActionGroup.xml similarity index 64% rename from app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateWidgetActionGroup.xml rename to app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateCatalogProductWidgetActionGroup.xml index f3ebbc6370f87..1b9b9d60b36e2 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateWidgetActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateCatalogProductWidgetActionGroup.xml @@ -8,18 +8,6 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminCreateRecentlyProductsWidgetActionGroup" extends="AdminCreateWidgetActionGroup"> - <annotations> - <description>EXTENDS: AdminCreateWidgetActionGroup. Adds Product Attributes/Buttons to a Widget. Clicks on the Save button.</description> - </annotations> - - <selectOption selector="{{AdminCatalogProductWidgetSection.productAttributesToShow}}" parameterArray="['Name', 'Image', 'Price']" stepKey="selectAllProductAttributes"/> - <selectOption selector="{{AdminCatalogProductWidgetSection.productButtonsToShow}}" parameterArray="['Add to Cart', 'Add to Compare', 'Add to Wishlist']" stepKey="selectAllProductButtons"/> - <click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveWidget"/> - <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessageAppears"/> - <see selector="{{AdminMessagesSection.success}}" userInput="The widget instance has been saved" stepKey="seeSuccess"/> - </actionGroup> - <actionGroup name="AdminCreateCatalogProductWidgetActionGroup" extends="AdminCreateWidgetActionGroup"> <annotations> <description>EXTENDS: AdminCreateWidgetActionGroup. Creates Catalog Category Link Widget.</description> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateRecentlyProductsWidgetActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateRecentlyProductsWidgetActionGroup.xml new file mode 100644 index 0000000000000..e22620790ef70 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateRecentlyProductsWidgetActionGroup.xml @@ -0,0 +1,22 @@ +<?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="AdminCreateRecentlyProductsWidgetActionGroup" extends="AdminCreateWidgetActionGroup"> + <annotations> + <description>EXTENDS: AdminCreateWidgetActionGroup. Adds Product Attributes/Buttons to a Widget. Clicks on the Save button.</description> + </annotations> + + <selectOption selector="{{AdminCatalogProductWidgetSection.productAttributesToShow}}" parameterArray="['Name', 'Image', 'Price']" stepKey="selectAllProductAttributes"/> + <selectOption selector="{{AdminCatalogProductWidgetSection.productButtonsToShow}}" parameterArray="['Add to Cart', 'Add to Compare', 'Add to Wishlist']" stepKey="selectAllProductButtons"/> + <click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveWidget"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessageAppears"/> + <see selector="{{AdminMessagesSection.success}}" userInput="The widget instance has been saved" stepKey="seeSuccess"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateSearchableProductAttributeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateSearchableProductAttributeActionGroup.xml new file mode 100644 index 0000000000000..1e1418b3e0e75 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateSearchableProductAttributeActionGroup.xml @@ -0,0 +1,16 @@ +<?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="AdminCreateSearchableProductAttributeActionGroup" extends="CreateProductAttributeActionGroup" insertAfter="checkRequired"> + <click selector="{{StorefrontPropertiesSection.StoreFrontPropertiesTab}}" stepKey="goToStorefrontPropertiesTab"/> + <waitForElementVisible selector="{{StorefrontPropertiesSection.PageTitle}}" stepKey="waitTabLoad"/> + <selectOption selector="{{AdvancedAttributePropertiesSection.UseInSearch}}" userInput="Yes" stepKey="setSearchable"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateSimpleProductWithTextOptionCharLimitActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateSimpleProductWithTextOptionCharLimitActionGroup.xml new file mode 100644 index 0000000000000..66620e3d9dd07 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateSimpleProductWithTextOptionCharLimitActionGroup.xml @@ -0,0 +1,47 @@ +<?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="AdminCreateSimpleProductWithTextOptionCharLimitActionGroup"> + <annotations> + <description>Goes to the Admin Product grid page. Clicks on Add. Fills the provided Product details (Name, SKU, Price, Quantity, Category and URL). Adds a Text Product Option with the provided Char Limits. Clicks on Save. Validates that the Product details are present and correct.</description> + </annotations> + <arguments> + <argument name="category"/> + <argument name="simpleProduct"/> + <argument name="charLimit"/> + </arguments> + + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> + <click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductDropdown"/> + <click selector="{{AdminProductGridActionSection.addSimpleProduct}}" stepKey="clickAddSimpleProduct"/> + <fillField userInput="{{simpleProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/> + <fillField userInput="{{simpleProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="fillSKU"/> + <fillField userInput="{{simpleProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="fillPrice"/> + <fillField userInput="{{simpleProduct.quantity}}" selector="{{AdminProductFormSection.productQuantity}}" stepKey="fillQuantity"/> + <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{category.name}}]" stepKey="searchAndSelectCategory"/> + <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/> + <fillField userInput="{{simpleProduct.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/> + + <click selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" stepKey="openCustomOptionsSection"/> + <click selector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" stepKey="clickAddOption"/> + <fillField selector="{{AdminProductCustomizableOptionsSection.optionTitleInput('0')}}" userInput="option1" stepKey="fillOptionTitle"/> + <click selector="{{AdminProductCustomizableOptionsSection.optionTypeOpenDropDown}}" stepKey="openTypeDropDown"/> + <click selector="{{AdminProductCustomizableOptionsSection.optionTypeTextField}}" stepKey="selectTypeTextField"/> + <fillField userInput="20" selector="{{AdminProductCustomizableOptionsSection.maxCharactersInput}}" stepKey="fillMaxChars"/> + + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct"/> + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="assertSaveMessageSuccess"/> + <seeInField userInput="{{simpleProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="assertFieldName"/> + <seeInField userInput="{{simpleProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="assertFieldSku"/> + <seeInField userInput="{{simpleProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="assertFieldPrice"/> + <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSectionAssert"/> + <seeInField userInput="{{simpleProduct.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="assertFieldUrlKey"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductCustomOptionsActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductCustomOptionsActionGroup.xml new file mode 100644 index 0000000000000..103c25b2c6f50 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductCustomOptionsActionGroup.xml @@ -0,0 +1,26 @@ +<?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="AdminDeleteAllProductCustomOptionsActionGroup"> + <conditionalClick selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" dependentSelector="{{AdminProductCustomizableOptionsSection.checkIfCustomizableOptionsTabOpen}}" visible="true" stepKey="expandContentTab"/> + <waitForPageLoad time="10" stepKey="waitCustomizableOptionsTabOpened"/> + <executeInSelenium function="function($webdriver) use ($I) { + $buttons = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::cssSelector('[data-index=\'options\'] [data-index=\'delete_button\']')); + while(!empty($buttons)) { + $button = reset($buttons); + $I->executeJS('arguments[0].scrollIntoView(false)', [$button]); + $button->click(); + $webdriver->wait()->until(\Facebook\WebDriver\WebDriverExpectedCondition::stalenessOf($button)); + $buttons = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::cssSelector('[data-index=\'options\'] [data-index=\'delete_button\']')); + } + }" stepKey="deleteCustomOptions"/> + <dontSeeElement selector="{{AdminProductCustomizableOptionsSection.customOptionButtonDelete}}" stepKey="assertNoCustomOptions"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteCategoryByNameActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteCategoryByNameActionGroup.xml new file mode 100644 index 0000000000000..de7f569074ac3 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteCategoryByNameActionGroup.xml @@ -0,0 +1,23 @@ +<?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="AdminDeleteCategoryByNameActionGroup" extends="DeleteCategoryActionGroup"> + <arguments> + <argument name="categoryName" type="string" defaultValue="category1"/> + </arguments> + <remove keyForRemoval="clickCategoryLink"/> + <remove keyForRemoval="dontSeeCategoryInTree"/> + <remove keyForRemoval="expandToSeeAllCategories"/> + <conditionalClick selector="{{AdminCategorySidebarTreeSection.expandAll}}" dependentSelector="{{AdminCategorySidebarTreeSection.categoryByName(categoryName)}}" visible="false" stepKey="expandCategories" after="waitForCategoryPageLoad"/> + <click selector="{{AdminCategorySidebarTreeSection.categoryByName(categoryName)}}" stepKey="clickCategory" after="expandCategories"/> + <conditionalClick selector="{{AdminCategorySidebarTreeSection.expandAll}}" dependentSelector="{{AdminCategorySidebarTreeSection.categoryByName(categoryName)}}" visible="false" stepKey="expandCategoriesToSeeAll" after="seeDeleteSuccess"/> + <dontSee selector="{{AdminCategorySidebarTreeSection.categoryByName(categoryName)}}" stepKey="dontSeeCategory" after="expandCategoriesToSeeAll"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteProductCustomOptionActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteProductCustomOptionActionGroup.xml new file mode 100644 index 0000000000000..22c4ef6a7d568 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteProductCustomOptionActionGroup.xml @@ -0,0 +1,15 @@ +<?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="AdminDeleteProductCustomOptionActionGroup" extends="AdminAssertProductCustomOptionVisibleActionGroup"> + <remove keyForRemoval="assertCustomOptionVisible"/> + <click selector="{{AdminProductCustomizableOptionsSection.deleteCustomOptions(option.title)}}" after="waitCustomizableOptionsTabOpened" stepKey="clickDeleteCustomOption"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillProductAttributePropertiesActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillProductAttributePropertiesActionGroup.xml index ec73001976dc6..cd850f8a7004d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillProductAttributePropertiesActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillProductAttributePropertiesActionGroup.xml @@ -15,16 +15,4 @@ <fillField selector="{{AttributePropertiesSection.DefaultLabel}}" userInput="{{attributeName}}" stepKey="fillDefaultLabel"/> <selectOption selector="{{AttributePropertiesSection.InputType}}" userInput="{{attributeType}}" stepKey="selectInputType"/> </actionGroup> - - <!--You are on AdminProductEditPage--> - <!-- Switch scope for product attribute--> - <!-- !Note! Scope : 0 - Store View; 1 - Global; 2 - Website; --> - <actionGroup name="AdminSwitchScopeForProductAttributeActionGroup"> - <arguments> - <argument name="scope" type="string" defaultValue="1"/> - </arguments> - <click selector="{{AttributePropertiesSection.AdvancedProperties}}" stepKey="expandAdvancedProperties"/> - <waitForElementVisible selector="{{AttributePropertiesSection.Scope}}" stepKey="waitOpenAdvancedProperties"/> - <selectOption selector="{{AttributePropertiesSection.Scope}}" userInput="1" stepKey="selectNecessaryScope"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillProductCountryOfManufactureActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillProductCountryOfManufactureActionGroup.xml new file mode 100644 index 0000000000000..7642bb5f6635d --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillProductCountryOfManufactureActionGroup.xml @@ -0,0 +1,17 @@ +<?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="AdminFillProductCountryOfManufactureActionGroup"> + <arguments> + <argument name="countryId" type="string" defaultValue="US"/> + </arguments> + <selectOption selector="{{AdminProductFormBundleSection.countryOfManufactureDropDown}}" userInput="{{countryId}}" stepKey="countryOfManufactureDropDown"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProcessProductWebsitesActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProcessProductWebsitesActionGroup.xml new file mode 100644 index 0000000000000..fbd49224231f3 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProcessProductWebsitesActionGroup.xml @@ -0,0 +1,17 @@ +<?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="AdminProcessProductWebsitesActionGroup" extends="CreatedProductConnectToWebsiteActionGroup"> + <arguments> + <argument name="websiteToUnassign"/> + </arguments> + <uncheckOption selector="{{ProductInWebsitesSection.website(websiteToUnassign.name)}}" after="SelectWebsite" stepKey="uncheckWebsite"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml deleted file mode 100644 index 428b3828901cd..0000000000000 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml +++ /dev/null @@ -1,759 +0,0 @@ -<?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"> - <!--Navigate to create product page from product grid page--> - <actionGroup name="goToCreateProductPage"> - <annotations> - <description>Clicks on the 'Add Product' toggle on the Admin Products grid page. Clicks on the provided Product (Type).</description> - </annotations> - <arguments> - <argument name="product" defaultValue="_defaultProduct"/> - </arguments> - - <click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductToggle"/> - <waitForElementVisible selector="{{AdminProductGridActionSection.addTypeProduct(product.type_id)}}" stepKey="waitForAddProductDropdown" time="30"/> - <click selector="{{AdminProductGridActionSection.addTypeProduct(product.type_id)}}" stepKey="clickAddProductType"/> - <waitForPageLoad time="30" stepKey="waitForCreateProductPageLoad"/> - <seeInCurrentUrl url="{{AdminProductCreatePage.url(AddToDefaultSet.attributeSetId, product.type_id)}}" stepKey="seeNewProductUrl"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Product" stepKey="seeNewProductTitle"/> - </actionGroup> - - <!--Navigate to create product page directly via ID--> - <actionGroup name="goToProductPageViaID"> - <annotations> - <description>Goes to the Product edit page for the provided Product ID.</description> - </annotations> - <arguments> - <argument name="productId" type="string"/> - </arguments> - - <amOnPage url="{{AdminProductEditPage.url(productId)}}" stepKey="goToProduct"/> - </actionGroup> - - <!-- Fill main fields in create product form using a product entity --> - <actionGroup name="fillMainProductForm"> - <annotations> - <description>Fills in the provided Product details (Name, SKU, Price, Quantity, Stock Status, Weight Type and Weight) on the Admin Products creation/edit page.</description> - </annotations> - <arguments> - <argument name="product" defaultValue="_defaultProduct"/> - </arguments> - - <scrollToTopOfPage stepKey="scrollToTopOfPage"/> - <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductName"/> - <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductSku"/> - <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{product.price}}" stepKey="fillProductPrice"/> - <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{product.quantity}}" stepKey="fillProductQty"/> - <selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{product.status}}" stepKey="selectStockStatus"/> - <selectOption selector="{{AdminProductFormSection.productWeightSelect}}" userInput="This item has weight" stepKey="selectWeight"/> - <fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{product.weight}}" stepKey="fillProductWeight"/> - </actionGroup> - - <!-- Fill main fields in create product form using strings for flexibility --> - <actionGroup name="FillMainProductFormByString"> - <annotations> - <description>Fills in the provided Product Name, SKU, Price, Quantity, Stock Status and Weight on the Admin Products creation/edit page.</description> - </annotations> - <arguments> - <argument name="productName" type="string"/> - <argument name="productSku" type="string"/> - <argument name="productPrice" type="string"/> - <argument name="productQuantity" type="string"/> - <argument name="productStatus" type="string"/> - <argument name="productWeight" type="string"/> - </arguments> - - <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{productName}}" stepKey="fillProductName"/> - <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{productSku}}" stepKey="fillProductSku"/> - <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{productPrice}}" stepKey="fillProductPrice"/> - <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{productQuantity}}" stepKey="fillProductQty"/> - <selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{productStatus}}" stepKey="selectStockStatus"/> - <selectOption selector="{{AdminProductFormSection.productWeightSelect}}" userInput="This item has weight" stepKey="selectWeight"/> - <fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{productWeight}}" stepKey="fillProductWeight"/> - </actionGroup> - - <!--Fill main fields in create product form with no weight, useful for virtual and downloadable products --> - <actionGroup name="fillMainProductFormNoWeight"> - <annotations> - <description>Fills in the provided Product details (Name, SKU, Price, Quantity, Stock Status and Weight Type) on the Admin Products creation/edit page.</description> - </annotations> - <arguments> - <argument name="product" defaultValue="DownloadableProduct"/> - </arguments> - - <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductName"/> - <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductSku"/> - <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{product.price}}" stepKey="fillProductPrice"/> - <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{product.quantity}}" stepKey="fillProductQty"/> - <selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{product.status}}" stepKey="selectStockStatus"/> - <selectOption selector="{{AdminProductFormSection.productWeightSelect}}" userInput="This item has no weight" stepKey="selectWeight"/> - </actionGroup> - - <!--Fill main fields in create product form with name and sku --> - <actionGroup name="fillProductNameAndSkuInProductForm"> - <annotations> - <description>Fills in the provided Product details (Name and SKU) on the Admin Products creation and edit page.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductName"/> - <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductSku"/> - </actionGroup> - <actionGroup name="AdminFillProductCountryOfManufactureActionGroup"> - <arguments> - <argument name="countryId" type="string" defaultValue="US"/> - </arguments> - <selectOption selector="{{AdminProductFormBundleSection.countryOfManufactureDropDown}}" userInput="{{countryId}}" stepKey="countryOfManufactureDropDown"/> - </actionGroup> - - <!--Check that required fields are actually required--> - <actionGroup name="checkRequiredFieldsInProductForm"> - <annotations> - <description>Validates that the 'Required Field' error message is present and correct for the Product Name, SKU and Price fields.</description> - </annotations> - - <clearField selector="{{AdminProductFormSection.productName}}" stepKey="clearProductName"/> - <clearField selector="{{AdminProductFormSection.productSku}}" stepKey="clearProductSku"/> - <clearField selector="{{AdminProductFormSection.productPrice}}" stepKey="clearProductPrice"/> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Product" stepKey="seeStillOnEditPage"/> - <see selector="{{AdminProductFormSection.fieldError('name')}}" userInput="This is a required field." stepKey="seeNameRequired"/> - <see selector="{{AdminProductFormSection.fieldError('sku')}}" userInput="This is a required field." stepKey="seeSkuRequired"/> - <see selector="{{AdminProductFormSection.priceFieldError}}" userInput="This is a required field." stepKey="seePriceRequired"/> - </actionGroup> - - <!--Save product and see success message--> - <actionGroup name="saveProductForm"> - <annotations> - <description>Clicks on the Save button. Validates that the Success Message is present and correct.</description> - </annotations> - - <scrollToTopOfPage stepKey="scrollTopPageProduct"/> - <waitForElementVisible selector="{{AdminProductFormActionSection.saveButton}}" stepKey="waitForSaveProductButton"/> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveProduct"/> - <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitProductSaveSuccessMessage"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You saved the product." stepKey="seeSaveConfirmation"/> - </actionGroup> - - <actionGroup name="toggleProductEnabled"> - <annotations> - <description>Clicks on the Enable Product toggle.</description> - </annotations> - - <click selector="{{AdminProductFormSection.enableProductLabel}}" stepKey="toggleEnabled"/> - </actionGroup> - - <!-- Save product but do not expect a success message --> - <actionGroup name="SaveProductFormNoSuccessCheck" extends="saveProductForm"> - <annotations> - <description>EXTENDS: saveProductForm. Removes 'waitProductSaveSuccessMessage' and 'seeSaveConfirmation'.</description> - </annotations> - - <remove keyForRemoval="waitProductSaveSuccessMessage"/> - <remove keyForRemoval="seeSaveConfirmation"/> - </actionGroup> - - <!--Upload image for product--> - <actionGroup name="addProductImage"> - <annotations> - <description>Adds the provided Product Image on the Admin Products creation/edit page.</description> - </annotations> - <arguments> - <argument name="image" defaultValue="ProductImage"/> - </arguments> - - <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductImagesSection"/> - <waitForPageLoad time="30" stepKey="waitForPageRefresh"/> - <waitForElementVisible selector="{{AdminProductImagesSection.imageUploadButton}}" stepKey="seeImageSectionIsReady"/> - <attachFile selector="{{AdminProductImagesSection.imageFileUpload}}" userInput="{{image.file}}" stepKey="uploadFile"/> - <waitForElementNotVisible selector="{{AdminProductImagesSection.uploadProgressBar}}" stepKey="waitForUpload"/> - <waitForElementVisible selector="{{AdminProductImagesSection.imageFile(image.fileName)}}" stepKey="waitForThumbnail"/> - </actionGroup> - - <!--Remove image for product--> - <actionGroup name="removeProductImage"> - <annotations> - <description>Removes a Product Image on the Admin Products creation/edit page.</description> - </annotations> - - <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductImagesSection"/> - <waitForPageLoad time="30" stepKey="waitForPageRefresh"/> - <click selector="{{AdminProductImagesSection.removeImageButton}}" stepKey="clickRemoveImage"/> - </actionGroup> - - <!--Remove Product image by name--> - <actionGroup name="RemoveProductImageByName" extends="removeProductImage"> - <annotations> - <description>Removes a Product Image on the Admin Products creation/edit page by name.</description> - </annotations> - - <arguments> - <argument name="image" defaultValue="ProductImage"/> - </arguments> - <click selector="{{AdminProductImagesSection.removeImageButtonForExactImage(image.fileName)}}" stepKey="clickRemoveImage"/> - </actionGroup> - - <!-- Assert product image in Admin Product page --> - <actionGroup name="assertProductImageAdminProductPage"> - <annotations> - <description>Validates that the provided Product Image is present and correct.</description> - </annotations> - <arguments> - <argument name="image" defaultValue="MagentoLogo"/> - </arguments> - - <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductImagesSection"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <seeElement selector="{{AdminProductImagesSection.imageFile(image.filename)}}" stepKey="seeImage"/> - </actionGroup> - - <!-- Assert no product image in Admin Product page --> - <actionGroup name="assertProductImageNotInAdminProductPage"> - <annotations> - <description>Validates that the provided Product Image is NOT present.</description> - </annotations> - <arguments> - <argument name="image" defaultValue="MagentoLogo"/> - </arguments> - - <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductImagesSection"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <dontSeeElement selector="{{AdminProductImagesSection.imageFile(image.filename)}}" stepKey="seeImage"/> - </actionGroup> - - <!--Fill fields for simple product in a category in Admin--> - <actionGroup name="FillAdminSimpleProductForm"> - <annotations> - <description>Goes to the Admin Product grid page. Clicks on Add. Fills the provided Product details (Name, SKU, Price, Quantity, Category and URL). Clicks on Save. Validates that the Product details are present and correct.</description> - </annotations> - <arguments> - <argument name="category"/> - <argument name="simpleProduct"/> - </arguments> - - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> - <click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductDropdown"/> - <click selector="{{AdminProductGridActionSection.addSimpleProduct}}" stepKey="clickAddSimpleProduct"/> - <fillField userInput="{{simpleProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/> - <fillField userInput="{{simpleProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="fillSKU"/> - <fillField userInput="{{simpleProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="fillPrice"/> - <fillField userInput="{{simpleProduct.quantity}}" selector="{{AdminProductFormSection.productQuantity}}" stepKey="fillQuantity"/> - <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{category.name}}]" stepKey="searchAndSelectCategory"/> - <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/> - <fillField userInput="{{simpleProduct.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct"/> - <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="assertSaveMessageSuccess"/> - <seeInField userInput="{{simpleProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="assertFieldName"/> - <seeInField userInput="{{simpleProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="assertFieldSku"/> - <seeInField userInput="{{simpleProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="assertFieldPrice"/> - <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSectionAssert"/> - <seeInField userInput="{{simpleProduct.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="assertFieldUrlKey"/> - </actionGroup> - - <!--Fill fields for simple product in a category in Admin, including text option with char limit--> - <actionGroup name="AdminCreateSimpleProductWithTextOptionCharLimit"> - <annotations> - <description>Goes to the Admin Product grid page. Clicks on Add. Fills the provided Product details (Name, SKU, Price, Quantity, Category and URL). Adds a Text Product Option with the provided Char Limits. Clicks on Save. Validates that the Product details are present and correct.</description> - </annotations> - <arguments> - <argument name="category"/> - <argument name="simpleProduct"/> - <argument name="charLimit"/> - </arguments> - - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> - <click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductDropdown"/> - <click selector="{{AdminProductGridActionSection.addSimpleProduct}}" stepKey="clickAddSimpleProduct"/> - <fillField userInput="{{simpleProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/> - <fillField userInput="{{simpleProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="fillSKU"/> - <fillField userInput="{{simpleProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="fillPrice"/> - <fillField userInput="{{simpleProduct.quantity}}" selector="{{AdminProductFormSection.productQuantity}}" stepKey="fillQuantity"/> - <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{category.name}}]" stepKey="searchAndSelectCategory"/> - <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/> - <fillField userInput="{{simpleProduct.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/> - - <click selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" stepKey="openCustomOptionsSection"/> - <click selector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" stepKey="clickAddOption"/> - <fillField selector="{{AdminProductCustomizableOptionsSection.optionTitleInput('0')}}" userInput="option1" stepKey="fillOptionTitle"/> - <click selector="{{AdminProductCustomizableOptionsSection.optionTypeOpenDropDown}}" stepKey="openTypeDropDown"/> - <click selector="{{AdminProductCustomizableOptionsSection.optionTypeTextField}}" stepKey="selectTypeTextField"/> - <fillField userInput="20" selector="{{AdminProductCustomizableOptionsSection.maxCharactersInput}}" stepKey="fillMaxChars"/> - - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct"/> - <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="assertSaveMessageSuccess"/> - <seeInField userInput="{{simpleProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="assertFieldName"/> - <seeInField userInput="{{simpleProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="assertFieldSku"/> - <seeInField userInput="{{simpleProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="assertFieldPrice"/> - <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSectionAssert"/> - <seeInField userInput="{{simpleProduct.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="assertFieldUrlKey"/> - </actionGroup> - - <actionGroup name="ProductSetWebsite"> - <annotations> - <description>Sets the provided Website on the Admin Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="website" type="string"/> - </arguments> - - <scrollTo selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="scrollToWebsites"/> - <conditionalClick selector="{{ProductInWebsitesSection.sectionHeader}}" dependentSelector="{{ProductInWebsitesSection.website(website)}}" visible="false" stepKey="clickToOpenProductInWebsite"/> - <waitForPageLoad stepKey="waitForPageOpened"/> - <click selector="{{ProductInWebsitesSection.website(website)}}" stepKey="selectWebsite"/> - <click selector="{{AdminProductFormAdvancedPricingSection.save}}" stepKey="clickSaveProduct"/> - <waitForPageLoad time='60' stepKey="waitForProducrSaved"/> - <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSaveSuccessMessage"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You saved the product." stepKey="seeSaveSuccessMessage"/> - </actionGroup> - - <actionGroup name="ProductSetAdvancedPricing"> - <annotations> - <description>Sets the provided Advanced Pricing on the Admin Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="website" type="string" defaultValue=""/> - <argument name="group" type="string" defaultValue="Retailer"/> - <argument name="quantity" type="string" defaultValue="1"/> - <argument name="price" type="string" defaultValue="Discount"/> - <argument name="amount" type="string" defaultValue="45"/> - </arguments> - - <click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickOnAdvancedPricingButton"/> - <waitForElement selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="waitForCustomerGroupPriceAddButton"/> - <click selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="addCustomerGroupAllGroupsQty1PriceDiscountAnd10percent"/> - <waitForElement selector="{{AdminProductFormAdvancedPricingSection.productTierPriceCustGroupSelect('0')}}" stepKey="waitForSelectCustomerGroupNameAttribute2"/> - <selectOption selector="{{AdminProductFormAdvancedPricingSection.productTierPriceWebsiteSelect('0')}}" userInput="{{website}}" stepKey="selectProductWebsiteValue"/> - <selectOption selector="{{AdminProductFormAdvancedPricingSection.productTierPriceCustGroupSelect('0')}}" userInput="{{group}}" stepKey="selectProductCustomGroupValue"/> - <fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPriceQtyInput('0')}}" userInput="{{quantity}}" stepKey="fillProductTierPriceQtyInput"/> - <selectOption selector="{{AdminProductFormAdvancedPricingSection.productTierPriceValueTypeSelect('0')}}" userInput="{{price}}" stepKey="selectProductTierPriceValueType"/> - <fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPricePercentageValuePriceInput('0')}}" userInput="{{amount}}" stepKey="selectProductTierPricePriceInput"/> - <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton"/> - <waitForPageLoad stepKey="WaitForProductSave"/> - <click selector="{{AdminProductFormAdvancedPricingSection.save}}" stepKey="clickSaveProduct1"/> - <waitForPageLoad time="60" stepKey="WaitForProductSave1"/> - <see userInput="You saved the product." stepKey="seeSaveConfirmation"/> - </actionGroup> - <actionGroup name="ProductSetAdvancedTierFixedPricing" extends="ProductSetAdvancedPricing"> - <remove keyForRemoval="selectProductTierPricePriceInput"/> - <fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPriceFixedPriceInput('0')}}" userInput="{{amount}}" stepKey="selectProductTierPricePriceInput" after="selectProductTierPriceValueType"/> - </actionGroup> - - <!--Assert text in Related, Up-Sell or Cross-Sell section in Admin Product page--> - <actionGroup name="AssertTextInAdminProductRelatedUpSellCrossSellSection"> - <annotations> - <description>Validates that provided Text appears in the provided Element on the Admin Product creation/edit page under 'Related Products, Up-Sells, and Cross-Sells' section.</description> - </annotations> - <arguments> - <argument name="element" defaultValue="AdminProductFormRelatedUpSellCrossSellSection.relatedProductSectionText"/> - <argument name="expectedText"/> - </arguments> - - <conditionalClick selector="{{AdminProductFormSection.productFormTab('Related Products')}}" dependentSelector="{{AdminProductFormSection.productFormTabState('Related Products', 'closed')}}" visible="true" stepKey="openTab"/> - <waitForPageLoad time="30" stepKey="waitForPageLoad"/> - <see selector="{{element}}" userInput="{{expectedText}}" stepKey="assertText"/> - </actionGroup> - - <!--Related products--> - <actionGroup name="addRelatedProductBySku"> - <annotations> - <description>Adds the provided Product SKU as a Related Product on the Admin Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="sku"/> - </arguments> - - <!--Scroll up to avoid error--> - <scrollTo selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" x="0" y="-100" stepKey="scrollTo"/> - <conditionalClick selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" dependentSelector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDependent}}" visible="false" stepKey="openDropDownIfClosedRelatedUpSellCrossSell"/> - <click selector="{{AdminProductFormRelatedUpSellCrossSellSection.AddRelatedProductsButton}}" stepKey="clickAddRelatedProductButton"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> - <click selector="{{AdminProductModalSlideGridSection.productGridXRowYColumnButton('1', '1')}}" stepKey="selectProduct"/> - <click selector="{{AdminAddRelatedProductsModalSection.AddSelectedProductsButton}}" stepKey="addRelatedProductSelected"/> - <waitForElementNotVisible selector="{{AdminAddRelatedProductsModalSection.AddSelectedProductsButton}}" stepKey="waitForElementNotVisible"/> - </actionGroup> - - <!--Click AddCrossSellProducts and adds product by SKU--> - <actionGroup name="addCrossSellProductBySku"> - <annotations> - <description>Adds the provided Product SKU as a Cross Sell Product on the Admin Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="sku"/> - </arguments> - - <!--Scroll up to avoid error--> - <scrollTo selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" x="0" y="-100" stepKey="scrollTo"/> - <conditionalClick selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" dependentSelector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDependent}}" visible="false" stepKey="openDropDownIfClosedRelatedUpSellCrossSell"/> - <click selector="{{AdminProductFormRelatedUpSellCrossSellSection.AddCrossSellProductsButton}}" stepKey="clickAddCrossSellButton"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> - <click selector="{{AdminProductModalSlideGridSection.productGridXRowYColumnButton('1', '1')}}" stepKey="selectProduct"/> - <click selector="{{AdminProductCrossSellModalSection.addSelectedProducts}}" stepKey="addRelatedProductSelected"/> - <waitForPageLoad stepKey="waitForModalDisappear"/> - </actionGroup> - - <!--Add special price to product in Admin product page--> - <actionGroup name="AddSpecialPriceToProductActionGroup"> - <annotations> - <description>Sets the provided Special Price on the Admin Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="price" type="string" defaultValue="8"/> - </arguments> - - <waitForPageLoad stepKey="waitForPageLoad"/> - <click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickAdvancedPricingLink"/> - <waitForPageLoad stepKey="waitForAdvancedPricingModal"/> - <waitForElementVisible selector="{{AdminProductFormAdvancedPricingSection.specialPrice}}" stepKey="waitSpecialPrice"/> - <fillField userInput="{{price}}" selector="{{AdminProductFormAdvancedPricingSection.specialPrice}}" stepKey="fillSpecialPrice"/> - <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDone"/> - <waitForPageLoad stepKey="waitForAdvancedPricingModalGone"/> - <waitForElementNotVisible selector="{{AdminProductFormAdvancedPricingSection.specialPrice}}" stepKey="waitForCloseModalWindow"/> - </actionGroup> - - <!--Select Product In Websites--> - <actionGroup name="SelectProductInWebsitesActionGroup"> - <annotations> - <description>Sets the provided Website on the Admin Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="website" type="string"/> - </arguments> - - <scrollTo selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="scrollToWebsites"/> - <conditionalClick selector="{{ProductInWebsitesSection.sectionHeader}}" dependentSelector="{{AdminProductContentSection.sectionHeaderShow}}" visible="false" stepKey="expandSection"/> - <waitForPageLoad stepKey="waitForPageOpened"/> - <checkOption selector="{{ProductInWebsitesSection.website(website)}}" stepKey="selectWebsite"/> - </actionGroup> - <actionGroup name="unassignWebsiteFromProductActionGroup" extends="SelectProductInWebsitesActionGroup"> - <remove keyForRemoval="selectWebsite"/> - <uncheckOption selector="{{ProductInWebsitesSection.website(website)}}" stepKey="unSelectWebsite" after="waitForPageOpened"/> - </actionGroup> - - <actionGroup name="AdminProductAddSpecialPrice"> - <annotations> - <description>Sets the provided Special Price on the Admin Product creation/edit page. Clicks on Save.</description> - </annotations> - <arguments> - <argument name="specialPrice" type="string"/> - </arguments> - - <click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickAdvancedPricingLink1"/> - <waitForElementVisible selector="{{AdminProductFormAdvancedPricingSection.specialPrice}}" stepKey="waitSpecialPrice1"/> - <click selector="{{AdminProductFormAdvancedPricingSection.useDefaultPrice}}" stepKey="checkUseDefault"/> - <fillField userInput="{{specialPrice}}" selector="{{AdminProductFormAdvancedPricingSection.specialPrice}}" stepKey="fillSpecialPrice"/> - <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDone"/> - <waitForElementNotVisible selector="{{AdminProductFormAdvancedPricingSection.specialPrice}}" stepKey="waitForCloseModalWindow"/> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton"/> - <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/> - </actionGroup> - - <!--Switch to New Store view--> - <actionGroup name="SwitchToTheNewStoreView"> - <annotations> - <description>Switches the New Store View.</description> - </annotations> - <arguments> - <argument name="storeViewName" type="string"/> - </arguments> - - <scrollTo selector="{{AdminProductContentSection.pageHeader}}" stepKey="scrollToUp"/> - <waitForElementVisible selector="{{AdminProductFormActionSection.changeStoreButton}}" stepKey="waitForElementBecomeVisible"/> - <click selector="{{AdminProductFormActionSection.changeStoreButton}}" stepKey="clickStoreviewSwitcher"/> - <click selector="{{AdminProductFormActionSection.selectStoreView(storeViewName)}}" stepKey="chooseStoreView"/> - <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="acceptStoreSwitchingMessage"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - </actionGroup> - - <!--Create a Simple Product--> - <actionGroup name="createSimpleProductAndAddToWebsite"> - <annotations> - <description>Goes to the Admin Product grid page. Clicks on Add Product. Fills the provided Product Details (Name, SKU, Price, Quantity and Website). Clicks on Save.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="website" type="string"/> - </arguments> - - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToCatalogProductGrid"/> - <waitForPageLoad stepKey="waitForProductGrid"/> - <click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductDropdown"/> - <click selector="{{AdminProductGridActionSection.addSimpleProduct}}" stepKey="clickAddSimpleProduct"/> - <fillField userInput="{{product.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillProductName"/> - <fillField userInput="{{product.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="fillProductSKU"/> - <fillField userInput="{{product.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="fillProductPrice"/> - <fillField userInput="{{product.quantity}}" selector="{{AdminProductFormSection.productQuantity}}" stepKey="fillProductQuantity"/> - <click selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="openProductInWebsites"/> - <click selector="{{ProductInWebsitesSection.website(website)}}" stepKey="selectWebsite"/> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSave"/> - <waitForLoadingMaskToDisappear stepKey="waitForProductPageSave"/> - <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/> - </actionGroup> - - <actionGroup name="CreatedProductConnectToWebsite"> - <annotations> - <description>Clicks on 'Edit' for the provided Product. Clicks on the provided Website. Clicks on Save.</description> - </annotations> - <arguments> - <argument name="website"/> - <argument name="product"/> - </arguments> - - <click stepKey="openProduct" selector="{{AdminProductGridActionSection.productName(product.sku)}}"/> - <waitForPageLoad stepKey="waitForProductPage"/> - <scrollTo selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="ScrollToWebsites"/> - <click selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="openWebsitesList"/> - <waitForPageLoad stepKey="waitForWebsitesList"/> - <click selector="{{ProductInWebsitesSection.website(website.name)}}" stepKey="SelectWebsite"/> - <click selector="{{AdminProductFormAdvancedPricingSection.save}}" stepKey="clickSaveProduct"/> - <waitForPageLoad stepKey="waitForSave"/> - </actionGroup> - - <!-- Action group assign to one website and unassign from another --> - <actionGroup name="AdminProcessProductWebsitesActionGroup" extends="CreatedProductConnectToWebsite"> - <arguments> - <argument name="websiteToUnassign"/> - </arguments> - <uncheckOption selector="{{ProductInWebsitesSection.website(websiteToUnassign.name)}}" after="SelectWebsite" stepKey="uncheckWebsite"/> - </actionGroup> - - <!--Check tier price with a discount percentage on product--> - <actionGroup name="AssertDiscountsPercentageOfProducts"> - <annotations> - <description>Validates that the provided Product Tier Price is present and correct.</description> - </annotations> - <arguments> - <argument name="amount" type="string" defaultValue="45"/> - </arguments> - - <click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickOnAdvancedPricingButton"/> - <waitForElement selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="waitForCustomerGroupPriceAddButton"/> - <grabValueFrom selector="{{AdminProductFormAdvancedPricingSection.productTierPricePercentageValuePriceInput('0')}}" stepKey="grabProductTierPriceInput"/> - <assertEquals stepKey="assertProductTierPriceInput"> - <expectedResult type="string">{{amount}}</expectedResult> - <actualResult type="string">$grabProductTierPriceInput</actualResult> - </assertEquals> - </actionGroup> - - <!-- This action group goes to the product index page, opens the drop down and clicks the specified product type for adding a product --> - <actionGroup name="GoToSpecifiedCreateProductPage"> - <annotations> - <description>Goes to the Admin Product grid page. Clicks on the Add Product toggle. Clicks on the provided Product Type.</description> - </annotations> - <arguments> - <argument type="string" name="productType" defaultValue="simple"/> - </arguments> - - <comment userInput="actionGroup:GoToSpecifiedCreateProductPage" stepKey="actionGroupComment"/> - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> - <click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductDropdown"/> - <click selector="{{AdminProductGridActionSection.addTypeProduct(productType)}}" stepKey="clickAddProduct"/> - <waitForPageLoad stepKey="waitForFormToLoad"/> - </actionGroup> - - <!-- This action group simply navigates to the product catalog page --> - <actionGroup name="GoToProductCatalogPage"> - <annotations> - <description>Goes to the Admin Products grid page.</description> - </annotations> - - <comment userInput="actionGroup:GoToProductCatalogPage" stepKey="actionGroupComment"/> - <amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="GoToCatalogProductPage"/> - <waitForPageLoad stepKey="WaitForPageToLoad"/> - </actionGroup> - - <actionGroup name="SetProductUrlKey"> - <annotations> - <description>Fills the Product details (URL) for the SEO section.</description> - </annotations> - <arguments> - <argument name="product" defaultValue="_defaultProduct"/> - </arguments> - - <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/> - <fillField userInput="{{product.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/> - </actionGroup> - - <actionGroup name="SetProductUrlKeyByString"> - <annotations> - <description>Fills the Product SEO URL Key.</description> - </annotations> - <arguments> - <argument name="urlKey" type="string"/> - </arguments> - - <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/> - <fillField userInput="{{urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/> - </actionGroup> - - <actionGroup name="SetCategoryByName"> - <annotations> - <description>Sets the provided Category Name for a Product on the Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="categoryName" type="string"/> - </arguments> - - <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{categoryName}}]" stepKey="searchAndSelectCategory"/> - </actionGroup> - <!--Remove category from product in ProductFrom Page--> - <actionGroup name="removeCategoryFromProduct"> - <arguments> - <argument name="categoryName" type="string" defaultValue="{{_defaultCategory.name}}"/> - </arguments> - <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDown"/> - <click selector="{{AdminProductFormSection.unselectCategories(categoryName)}}" stepKey="unselectCategories"/> - <click selector="{{AdminProductFormSection.done}}" stepKey="clickOnDoneAdvancedCategory"/> - </actionGroup> - - <actionGroup name="expandAdminProductSection"> - <annotations> - <description>Expand the provided Section Selector based on the provided dependant Section Selector.</description> - </annotations> - <arguments> - <argument name="sectionSelector" defaultValue="{{AdminProductContentSection.sectionHeader}}" type="string"/> - <argument name="sectionDependentSelector" defaultValue="{{AdminProductContentSection.sectionHeaderShow}}" type="string"/> - </arguments> - - <scrollToTopOfPage stepKey="scrollToTopOfPage"/> - <waitForElementVisible time="30" selector="{{sectionSelector}}" stepKey="waitForSection"/> - <conditionalClick selector="{{sectionSelector}}" dependentSelector="{{sectionDependentSelector}}" visible="false" stepKey="expandSection"/> - <waitForPageLoad time="30" stepKey="waitForSectionToExpand"/> - </actionGroup> - - <actionGroup name="navigateToCreatedProductEditPage"> - <annotations> - <description>Goes to the Admin Product grid page. Filters the Product grid based on the provided Product details (SKU). Edits the provided Product. Validates that the Product SKU is present and correct.</description> - </annotations> - <arguments> - <argument name="product" defaultValue="_defaultProduct"/> - </arguments> - - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToAdminProductIndexPage"/> - <waitForPageLoad stepKey="waitForProductIndexPageToLoad"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> - <waitForPageLoad stepKey="waitForClearFilters"/> - <dontSeeElement selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="dontSeeClearFilters"/> - <click selector="{{AdminProductGridFilterSection.viewDropdown}}" stepKey="openViewBookmarksTab"/> - <click selector="{{AdminProductGridFilterSection.viewBookmark('Default View')}}" stepKey="resetToDefaultGridView"/> - <waitForPageLoad stepKey="waitForResetToDefaultView"/> - <see selector="{{AdminProductGridFilterSection.viewDropdown}}" userInput="Default View" stepKey="seeDefaultViewSelected"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <waitForPageLoad stepKey="waitForFilterOnGrid"/> - <click selector="{{AdminProductGridSection.selectRowBasedOnName(product.name)}}" stepKey="clickProduct"/> - <waitForPageLoad stepKey="waitForProductEditPageLoad"/> - <waitForElementVisible selector="{{AdminProductFormBundleSection.productSku}}" stepKey="waitForProductSKUField"/> - <seeInField selector="{{AdminProductFormBundleSection.productSku}}" userInput="{{product.sku}}" stepKey="seeProductSKU"/> - </actionGroup> - - <actionGroup name="addUpSellProductBySku" extends="addRelatedProductBySku"> - <annotations> - <description>EXTENDS: addRelatedProductBySku. Add the provided Product as an Up Sell Product.</description> - </annotations> - - <click selector="{{AdminProductFormRelatedUpSellCrossSellSection.AddUpSellProductsButton}}" stepKey="clickAddRelatedProductButton"/> - <conditionalClick selector="{{AdminAddUpSellProductsModalSection.Modal}} {{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminAddUpSellProductsModalSection.Modal}} {{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> - <click selector="{{AdminAddUpSellProductsModalSection.Modal}} {{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminAddUpSellProductsModalSection.Modal}} {{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/> - <click selector="{{AdminAddUpSellProductsModalSection.Modal}} {{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> - <click selector="{{AdminAddUpSellProductsModalSection.Modal}}{{AdminProductModalSlideGridSection.productGridXRowYColumnButton('1', '1')}}" stepKey="selectProduct"/> - <click selector="{{AdminAddUpSellProductsModalSection.AddSelectedProductsButton}}" stepKey="addRelatedProductSelected"/> - <waitForPageLoad stepKey="waitForPageToLoad1"/> - </actionGroup> - <actionGroup name="adminProductAdvancedPricingNewCustomerGroupPrice"> - <arguments> - <argument name="qty" type="string" defaultValue="2"/> - <argument name="priceType" type="string" defaultValue="Discount"/> - <argument name="discount" type="string" defaultValue="75"/> - <argument name="customerGroup" type="string" defaultValue="0"/> - </arguments> - <click selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="addCustomerGroup"/> - <fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPriceQtyInput(customerGroup)}}" userInput="{{qty}}" stepKey="fillProductTierPriceQtyInput1"/> - <selectOption selector="{{AdminProductFormAdvancedPricingSection.productTierPriceValueTypeSelect(customerGroup)}}" userInput="{{priceType}}" stepKey="selectProductTierPriceValueType1"/> - <fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPricePercentageValuePriceInput(customerGroup)}}" userInput="{{discount}}" stepKey="selectProductTierPricePriceInput"/> - <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton1"/> - </actionGroup> - <actionGroup name="AdminSetProductDisabled"> - <conditionalClick selector="{{AdminProductFormSection.enableProductLabel}}" dependentSelector="{{AdminProductFormSection.productStatusValue('1')}}" visible="true" stepKey="disableProduct"/> - <seeElement selector="{{AdminProductFormSection.productStatusValue('2')}}" stepKey="assertThatProductSetToDisabled"/> - </actionGroup> - - <!-- You are on product Edit Page --> - <!-- Assert checkbox available for website in Product In Websites --> - <actionGroup name="AssertWebsiteIsAvailableInProductWebsites"> - <arguments> - <argument name="website" type="string"/> - </arguments> - <scrollTo selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="scrollToProductInWebsitesSection"/> - <conditionalClick selector="{{ProductInWebsitesSection.sectionHeader}}" dependentSelector="{{ProductInWebsitesSection.sectionHeaderOpened}}" visible="false" stepKey="expandProductWebsitesSection"/> - <seeElement selector="{{ProductInWebsitesSection.website(website)}}" stepKey="seeCheckboxForWebsite"/> - </actionGroup> - - <!-- You are on product Edit Page --> - <!-- Assert checkbox not available for website in Product In Websites --> - <actionGroup name="AssertWebsiteIsNotAvailableInProductWebsites" extends="AssertWebsiteIsAvailableInProductWebsites"> - <remove keyForRemoval="seeCheckboxForWebsite"/> - <dontSeeElement selector="{{ProductInWebsitesSection.website(website)}}" after="expandProductWebsitesSection" stepKey="dontSeeCheckboxForWebsite"/> - </actionGroup> - - <!-- You are on product Edit Page --> - <!-- Assert checkbox Is checked for website in Product In Websites --> - <actionGroup name="AssertProductIsAssignedToWebsite" extends="AssertWebsiteIsAvailableInProductWebsites"> - <remove keyForRemoval="seeCheckboxForWebsite"/> - <seeCheckboxIsChecked selector="{{ProductInWebsitesSection.website(website)}}" after="expandProductWebsitesSection" stepKey="seeCustomWebsiteIsChecked"/> - </actionGroup> - - <!-- You are on product Edit Page --> - <!-- Assert checkbox is not checked for website in Product In Websites --> - <actionGroup name="AssertProductIsNotAssignedToWebsite" extends="AssertWebsiteIsAvailableInProductWebsites"> - <remove keyForRemoval="seeCheckboxForWebsite"/> - <dontSeeCheckboxIsChecked selector="{{ProductInWebsitesSection.website(website)}}" after="expandProductWebsitesSection" stepKey="seeCustomWebsiteIsNotChecked"/> - </actionGroup> - - <!-- You are on product Edit Page --> - <!-- Assert Product Name in admin Product page --> - <actionGroup name="AssertProductNameInProductEditForm"> - <arguments> - <argument name="productName" type="string"/> - </arguments> - <seeInField selector="{{AdminProductFormSection.productName}}" userInput="{{productName}}" stepKey="seeProductNameOnEditProductPage"/> - </actionGroup> - - <!-- You are on product Edit Page --> - <!-- Assert Product Description in admin Product page --> - <actionGroup name="AssertProductDescriptionInProductEditForm"> - <arguments> - <argument name="productDescription" type="string"/> - </arguments> - <conditionalClick selector="{{AdminProductContentSection.sectionHeader}}" dependentSelector="{{AdminProductContentSection.sectionHeaderShow}}" visible="false" stepKey="expandContentSection"/> - <seeInField selector="{{AdminProductContentSection.descriptionTextArea}}" userInput="{{productDescription}}" stepKey="seeProductDescription"/> - </actionGroup> - - <!-- You are on StorefrontProductPage --> - <!-- Check active product image --> - <actionGroup name="StorefrontAssertActiveProductImage"> - <arguments> - <argument name="fileName" defaultValue="magento-logo" type="string"/> - </arguments> - <seeElement selector="{{StorefrontProductMediaSection.productImageActive(fileName)}}" stepKey="seeActiveImageDefault"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAddSpecialPriceActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAddSpecialPriceActionGroup.xml new file mode 100644 index 0000000000000..fc0f908ff5fbe --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAddSpecialPriceActionGroup.xml @@ -0,0 +1,28 @@ +<?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="AdminProductAddSpecialPriceActionGroup"> + <annotations> + <description>Sets the provided Special Price on the Admin Product creation/edit page. Clicks on Save.</description> + </annotations> + <arguments> + <argument name="specialPrice" type="string"/> + </arguments> + + <click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickAdvancedPricingLink1"/> + <waitForElementVisible selector="{{AdminProductFormAdvancedPricingSection.specialPrice}}" stepKey="waitSpecialPrice1"/> + <click selector="{{AdminProductFormAdvancedPricingSection.useDefaultPrice}}" stepKey="checkUseDefault"/> + <fillField userInput="{{specialPrice}}" selector="{{AdminProductFormAdvancedPricingSection.specialPrice}}" stepKey="fillSpecialPrice"/> + <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDone"/> + <waitForElementNotVisible selector="{{AdminProductFormAdvancedPricingSection.specialPrice}}" stepKey="waitForCloseModalWindow"/> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton"/> + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAdvancedPricingNewCustomerGroupPriceActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAdvancedPricingNewCustomerGroupPriceActionGroup.xml new file mode 100644 index 0000000000000..f465eceb8f008 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAdvancedPricingNewCustomerGroupPriceActionGroup.xml @@ -0,0 +1,24 @@ +<?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="AdminProductAdvancedPricingNewCustomerGroupPriceActionGroup"> + <arguments> + <argument name="qty" type="string" defaultValue="2"/> + <argument name="priceType" type="string" defaultValue="Discount"/> + <argument name="discount" type="string" defaultValue="75"/> + <argument name="customerGroup" type="string" defaultValue="0"/> + </arguments> + <click selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="addCustomerGroup"/> + <fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPriceQtyInput(customerGroup)}}" userInput="{{qty}}" stepKey="fillProductTierPriceQtyInput1"/> + <selectOption selector="{{AdminProductFormAdvancedPricingSection.productTierPriceValueTypeSelect(customerGroup)}}" userInput="{{priceType}}" stepKey="selectProductTierPriceValueType1"/> + <fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPricePercentageValuePriceInput(customerGroup)}}" userInput="{{discount}}" stepKey="selectProductTierPricePriceInput"/> + <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton1"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml deleted file mode 100644 index 42e0bb24c744f..0000000000000 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml +++ /dev/null @@ -1,379 +0,0 @@ -<?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="navigateToCreatedProductAttribute"> - <annotations> - <description>Goes to the Product Attributes grid page. Filters the grid based on the provided Product Attribute. Clicks on the 1st row.</description> - </annotations> - <arguments> - <argument name="ProductAttribute"/> - </arguments> - - <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> - <fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="{{ProductAttribute.attribute_code}}" stepKey="setAttributeCode"/> - <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/> - <click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="clickOnAttributeRow"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - </actionGroup> - - <actionGroup name="navigateToEditProductAttribute"> - <annotations> - <description>Goes to the Product Attributes grid page. Filters the grid based on the provided Product Attribute. Clicks on the 1st row.</description> - </annotations> - <arguments> - <argument name="ProductAttribute" type="string"/> - </arguments> - - <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> - <fillField selector="{{AdminProductAttributeGridSection.GridFilterFrontEndLabel}}" userInput="{{ProductAttribute}}" stepKey="navigateToAttributeEditPage1"/> - <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="navigateToAttributeEditPage2"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - <click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="navigateToAttributeEditPage3"/> - <waitForPageLoad stepKey="waitForPageLoad3"/> - </actionGroup> - - <actionGroup name="AdminCreateAttributeFromProductPage"> - <annotations> - <description>From the Product creation/edit page, under 'Configurations', Clicks on 'Create Configurations'. Clicks on 'Create New Attribute'. Fills Label. Selects Type. Clicks on Save.</description> - </annotations> - <arguments> - <argument name="attributeName" type="string"/> - <argument name="attributeType" type="string" defaultValue="TextField"/> - </arguments> - - <click selector="{{AdminProductFormSection.addAttributeBtn}}" stepKey="clickAddAttributeBtn"/> - <see userInput="Select Attribute" stepKey="checkNewAttributePopUpAppeared"/> - <click selector="{{AdminProductFormAttributeSection.createNewAttribute}}" stepKey="clickCreateNewAttribute"/> - <fillField selector="{{AdminProductFormNewAttributeSection.attributeLabel}}" userInput="{{attributeName}}" stepKey="fillAttributeLabel"/> - <selectOption selector="{{AdminProductFormNewAttributeSection.attributeType}}" userInput="{{attributeType}}" stepKey="selectAttributeType"/> - <click selector="{{AdminProductFormNewAttributeSection.saveAttribute}}" stepKey="saveAttribute"/> - </actionGroup> - <actionGroup name="AdminCreateAttributeFromProductPageWithScope" extends="AdminCreateAttributeFromProductPage" insertAfter="selectAttributeType"> - <arguments> - <argument name="scope" type="string" defaultValue="Store View"/> - </arguments> - <conditionalClick selector="{{AdminProductFormNewAttributeAdvancedSection.sectionHeader}}" dependentSelector="{{AdminProductFormNewAttributeAdvancedSection.scope}}" visible="false" stepKey="openAttributeAdvancedSection"/> - <selectOption selector="{{AdminProductFormNewAttributeAdvancedSection.scope}}" userInput="{{scope}}" stepKey="selectScope"/> - </actionGroup> - - <actionGroup name="AdminCreateAttributeWithValueWithTwoStoreViesFromProductPage" extends="AdminCreateAttributeFromProductPage"> - <remove keyForRemoval="saveAttribute"/> - <annotations> - <description>EXTENDS: AdminCreateAttributeFromProductPage. Adds the 2 provided Store Views to a Product. Clicks on Save.</description> - </annotations> - <arguments> - <argument name="firstStoreViewName" type="string"/> - <argument name="secondStoreViewName" type="string"/> - </arguments> - - <click selector="{{AdminProductFormNewAttributeSection.addValue}}" stepKey="addValue" after="selectAttributeType"/> - <seeElement selector="{{AdminProductFormNewAttributeSection.optionViewName(firstStoreViewName))}}" stepKey="seeFirstStoreView"/> - <seeElement selector="{{AdminProductFormNewAttributeSection.optionViewName(firstStoreViewName))}}" stepKey="seeSecondStoreView"/> - <fillField selector="{{AdminProductFormNewAttributeSection.optionValue('1'))}}" userInput="default" stepKey="fillDefaultStoreView"/> - <fillField selector="{{AdminProductFormNewAttributeSection.optionValue('2'))}}" userInput="admin" stepKey="fillAdminStoreView"/> - <fillField selector="{{AdminProductFormNewAttributeSection.optionValue('3'))}}" userInput="view1" stepKey="fillFirstStoreView"/> - <fillField selector="{{AdminProductFormNewAttributeSection.optionValue('4'))}}" userInput="view2" stepKey="fillSecondStoreView"/> - - <!--Check store view in Manage Titles section--> - <click selector="{{AdminProductFormNewAttributeSection.manageTitlesHeader}}" stepKey="openManageTitlesSection"/> - <seeElement selector="{{AdminProductFormNewAttributeSection.manageTitlesViewName(customStoreEN.name)}}" stepKey="seeFirstStoreViewName"/> - <seeElement selector="{{AdminProductFormNewAttributeSection.manageTitlesViewName(customStoreFR.name)}}" stepKey="seeSecondStoreViewName"/> - <click selector="{{AdminProductFormNewAttributeSection.saveAttribute}}" stepKey="saveAttribute1"/> - </actionGroup> - - <!-- Creates attribute and attribute set from the product page--> - <actionGroup name="AdminProductPageCreateAttributeSetWithAttribute"> - <annotations> - <description>Adds the provided Product Attribute Set to a Product on the Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="attributeName" type="string"/> - <argument name="attributeSetName" type="string"/> - <argument name="attributeType" type="string" defaultValue="TextField"/> - </arguments> - - <click selector="{{AdminProductFormSection.addAttributeBtn}}" stepKey="clickAddAttributeBtn"/> - <waitForPageLoad stepKey="waitForSidePanel"/> - <see userInput="Select Attribute" stepKey="checkNewAttributePopUpAppeared"/> - <click selector="{{AdminProductFormAttributeSection.createNewAttribute}}" stepKey="clickCreateNewAttribute"/> - <fillField selector="{{AdminProductFormNewAttributeSection.attributeLabel}}" userInput="{{attributeName}}" stepKey="fillAttributeLabel"/> - <selectOption selector="{{AdminProductFormNewAttributeSection.attributeType}}" userInput="{{attributeType}}" stepKey="selectAttributeType"/> - <click selector="{{AdminProductFormNewAttributeSection.saveInNewSet}}" stepKey="saveAttribute"/> - <fillField selector="{{AdminProductFormNewAttributeNewSetSection.setName}}" userInput="{{attributeSetName}}" stepKey="fillSetName"/> - <click selector="{{AdminProductFormNewAttributeNewSetSection.accept}}" stepKey="acceptPopup"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingToFinish"/> - <!-- Product page will hang if there is no reload--> - <reloadPage stepKey="reloadPage"/> - <waitForPageLoad stepKey="waitForReload"/> - </actionGroup> - - <!-- Create attribute and set with given search weight and defaultValue from the Edit Product Page --> - <actionGroup name="AdminCreateAttributeWithSearchWeight" extends="AdminProductPageCreateAttributeSetWithAttribute" insertAfter="selectAttributeType"> - <annotations> - <description>EXTENDS: AdminProductPageCreateAttributeSetWithAttribute. Sets the provided Search Weight and Default Values.</description> - </annotations> - <arguments> - <argument name="weight" type="string" defaultValue="1"/> - <argument name="defaultValue" type="string" defaultValue="default"/> - </arguments> - - <click selector="{{AdminProductFormNewAttributeAdvancedSection.sectionHeader}}" stepKey="openAdvancedSection"/> - <fillField selector="{{AdminProductFormNewAttributeAdvancedSection.defaultValue}}" userInput="{{defaultValue}}" stepKey="inputDefault"/> - <click selector="{{AdminProductFormNewAttributeStorefrontSection.sectionHeader}}" stepKey="openStorefrontSection"/> - <checkOption selector="{{AdminProductFormNewAttributeStorefrontSection.useInSearch}}" stepKey="checkUseInSearch"/> - <waitForElementVisible selector="{{AdminProductFormNewAttributeStorefrontSection.searchWeight}}" stepKey="waitForSearchWeight"/> - <selectOption selector="{{AdminProductFormNewAttributeStorefrontSection.searchWeight}}" userInput="{{weight}}" stepKey="selectWeight"/> - </actionGroup> - - <actionGroup name="AdminProductPageSelectAttributeSet"> - <annotations> - <description>Selects the provided Attribute Set from the Admin Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="attributeSetName" type="string"/> - </arguments> - - <click stepKey="openDropdown" selector="{{AdminProductFormSection.attributeSet}}"/> - <fillField stepKey="filter" selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{attributeSetName}}"/> - <click stepKey="clickResult" selector="{{AdminProductFormSection.attributeSetFilterResult}}"/> - </actionGroup> - - <actionGroup name="AdminProductPageFillTextAttributeValueByName"> - <annotations> - <description>Fills in the Attribute Name field with the provided value.</description> - </annotations> - <arguments> - <argument name="attributeName" type="string"/> - <argument name="value" type="string"/> - </arguments> - - <click stepKey="openSection" selector="{{AdminProductAttributeSection.attributeSectionHeader}}"/> - <fillField stepKey="fillValue" selector="{{AdminProductAttributeSection.textAttributeByName(attributeName)}}" userInput="{{value}}"/> - </actionGroup> - - <actionGroup name="changeUseForPromoRuleConditionsProductAttribute"> - <annotations> - <description>Select the provided value for the 'Use for Promo Rule Conditions' dropdown menu. Clicks on Save. Validates that the Save message is present.</description> - </annotations> - <arguments> - <argument name="option" type="string"/> - </arguments> - - <click selector="{{StorefrontPropertiesSection.StoreFrontPropertiesTab}}" stepKey="clickStoreFrontPropertiesTab"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <selectOption selector="{{StorefrontPropertiesSection.useForPromoRuleConditions}}" userInput="{{option}}" stepKey="changeOption"/> - <click selector="{{AttributePropertiesSection.Save}}" stepKey="saveAttribute"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You saved the product attribute." stepKey="successMessage"/> - </actionGroup> - - <actionGroup name="deleteProductAttribute" extends="navigateToCreatedProductAttribute"> - <annotations> - <description>EXTENDS: navigateToCreatedProductAttribute. Deletes the Product Attribute. Validates that the success message is present.</description> - </annotations> - - <click selector="{{AttributePropertiesSection.DeleteAttribute}}" stepKey="deleteAttribute"/> - <click selector="{{ModalConfirmationSection.OkButton}}" stepKey="ClickOnDeleteButton"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/> - </actionGroup> - - <actionGroup name="deleteProductAttributeByLabel"> - <annotations> - <description>Goes to the Admin Product Attributes grid page. Filters the grid for the provided Product Attribute (Label). Deletes the Product Attribute from the grid. Validates that the Success Message is present.</description> - </annotations> - <arguments> - <argument name="ProductAttribute"/> - </arguments> - - <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> - <fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="{{ProductAttribute.default_label}}" stepKey="setAttributeCode"/> - <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/> - <click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="clickOnAttributeRow"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <click selector="{{AttributePropertiesSection.DeleteAttribute}}" stepKey="deleteAttribute"/> - <click selector="{{ModalConfirmationSection.OkButton}}" stepKey="ClickOnDeleteButton"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/> - </actionGroup> - - <!-- Delete product attribute by Attribute Code --> - <actionGroup name="deleteProductAttributeByAttributeCode"> - <annotations> - <description>Goes to the Admin Product Attributes grid page. Filters the grid for the provided Product Attribute Code. Deletes the Product Attribute from the grid. Validates that the Success Message is present.</description> - </annotations> - <arguments> - <argument name="ProductAttributeCode" type="string"/> - </arguments> - - <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> - <waitForPageLoad stepKey="waitForAttributeGridPageLoad"/> - <fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="{{ProductAttributeCode}}" stepKey="setAttributeCode"/> - <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/> - <click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="clickOnAttributeRow"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - <click selector="{{AttributePropertiesSection.DeleteAttribute}}" stepKey="deleteAttribute"/> - <click selector="{{ModalConfirmationSection.OkButton}}" stepKey="ClickOnDeleteButton"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/> - </actionGroup> - - <!--Filter product attribute by Attribute Code --> - <actionGroup name="filterProductAttributeByAttributeCode"> - <annotations> - <description>Filters the Product Attributes grid by the provided Product Attribute Code.</description> - </annotations> - <arguments> - <argument name="ProductAttributeCode" type="string"/> - </arguments> - - <click selector="{{AdminProductAttributeGridSection.ResetFilter}}" stepKey="resetFiltersOnGrid"/> - <fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="{{ProductAttributeCode}}" stepKey="setAttributeCode"/> - <waitForPageLoad stepKey="waitForUserInput"/> - <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/> - </actionGroup> - - <!--Filter product attribute by Default Label --> - <actionGroup name="filterProductAttributeByDefaultLabel"> - <annotations> - <description>Filters the Product Attributes grid by the provided Product Attribute Label.</description> - </annotations> - <arguments> - <argument name="productAttributeLabel" type="string"/> - </arguments> - - <click selector="{{AdminProductAttributeGridSection.ResetFilter}}" stepKey="resetFiltersOnGrid"/> - <fillField selector="{{AdminProductAttributeGridSection.GridFilterFrontEndLabel}}" userInput="{{productAttributeLabel}}" stepKey="setDefaultLabel"/> - <waitForPageLoad stepKey="waitForUserInput"/> - <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/> - </actionGroup> - - <actionGroup name="saveProductAttribute"> - <annotations> - <description>Clicks on Save. Validates that the Success Message is present.</description> - </annotations> - - <waitForElementVisible selector="{{AttributePropertiesSection.Save}}" stepKey="waitForSaveButton"/> - <click selector="{{AttributePropertiesSection.Save}}" stepKey="clickSaveButton"/> - <waitForPageLoad stepKey="waitForAttributeToSave"/> - <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSuccessMessage"/> - </actionGroup> - - <actionGroup name="confirmChangeInputTypeModal"> - <annotations> - <description>Clicks on the Confirm button for the 'Product Data My Be Lost' modal.</description> - </annotations> - - <waitForElementVisible selector="{{AdminEditProductAttributesSection.ProductDataMayBeLostConfirmButton}}" stepKey="waitForChangeInputTypeButton"/> - <click selector="{{AdminEditProductAttributesSection.ProductDataMayBeLostConfirmButton}}" stepKey="clickChangeInputTypeButton"/> - <waitForElementNotVisible selector="{{AdminEditProductAttributesSection.ProductDataMayBeLostModal}}" stepKey="waitForChangeInputTypeModalGone"/> - </actionGroup> - - <actionGroup name="saveProductAttributeInUse"> - <annotations> - <description>Clicks on Save. Validates that the Success Message is present.</description> - </annotations> - - <waitForElementVisible selector="{{AttributePropertiesSection.Save}}" stepKey="waitForSaveButton"/> - <click selector="{{AttributePropertiesSection.Save}}" stepKey="clickSaveButton"/> - <waitForPageLoad stepKey="waitForAttributeToSave"/> - <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSuccessMessage"/> - </actionGroup> - - <!--Clicks Add Attribute and adds the given attribute--> - <actionGroup name="addProductAttributeInProductModal"> - <annotations> - <description>Adds the provided Attribute Code to the Product on the Admin Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="attributeCode" type="string"/> - </arguments> - - <click stepKey="addAttribute" selector="{{AdminProductFormActionSection.addAttributeButton}}"/> - <conditionalClick selector="{{AdminProductAddAttributeModalSection.clearFilters}}" dependentSelector="{{AdminProductAddAttributeModalSection.clearFilters}}" visible="true" stepKey="clearFilters"/> - <click stepKey="clickFilters" selector="{{AdminProductAddAttributeModalSection.filters}}"/> - <fillField stepKey="fillCode" selector="{{AdminProductAddAttributeModalSection.attributeCodeFilter}}" userInput="{{attributeCode}}"/> - <click stepKey="clickApply" selector="{{AdminProductAddAttributeModalSection.applyFilters}}"/> - <waitForPageLoad stepKey="waitForFilters"/> - <checkOption selector="{{AdminProductAddAttributeModalSection.firstRowCheckBox}}" stepKey="checkAttribute"/> - <click stepKey="addSelected" selector="{{AdminProductAddAttributeModalSection.addSelected}}"/> - </actionGroup> - - <!--Clicks createNewAttribute and fills out form--> - <actionGroup name="createProductAttribute"> - <annotations> - <description>Clicks on 'Add New Attribute'. Fills in the Attribute Details (Label, Input Type and Value Required). Clicks on Save.</description> - </annotations> - <arguments> - <argument name="attribute" type="entity" defaultValue="productAttributeWysiwyg"/> - </arguments> - - <click stepKey="createNewAttribute" selector="{{AdminProductAttributeGridSection.createNewAttributeBtn}}"/> - <fillField stepKey="fillDefaultLabel" selector="{{AttributePropertiesSection.DefaultLabel}}" userInput="{{attribute.attribute_code}}"/> - <selectOption selector="{{AttributePropertiesSection.InputType}}" stepKey="checkInputType" userInput="{{attribute.frontend_input}}"/> - <selectOption selector="{{AttributePropertiesSection.ValueRequired}}" stepKey="checkRequired" userInput="{{attribute.is_required_admin}}"/> - <click stepKey="saveAttribute" selector="{{AttributePropertiesSection.Save}}"/> - </actionGroup> - <actionGroup name="AdminCreateSearchableProductAttribute" extends="createProductAttribute" insertAfter="checkRequired"> - <click selector="{{StorefrontPropertiesSection.StoreFrontPropertiesTab}}" stepKey="goToStorefrontPropertiesTab"/> - <waitForElementVisible selector="{{StorefrontPropertiesSection.PageTitle}}" stepKey="waitTabLoad"/> - <selectOption selector="{{AdvancedAttributePropertiesSection.UseInSearch}}" userInput="Yes" stepKey="setSearchable"/> - </actionGroup> - - <!-- Inputs text default value and attribute code--> - <actionGroup name="createProductAttributeWithTextField" extends="createProductAttribute" insertAfter="checkRequired"> - <annotations> - <description>EXTENDS: createProductAttribute. Fills in the Attribute Code and Default Value (Attribute Type: Text Field).</description> - </annotations> - - <click stepKey="openAdvancedProperties" selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}"/> - <fillField stepKey="fillCode" selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" userInput="{{attribute.attribute_code}}"/> - <fillField stepKey="fillDefaultValue" selector="{{AdvancedAttributePropertiesSection.DefaultValueText}}" userInput="{{attribute.default_value}}"/> - </actionGroup> - - <!-- Inputs date default value and attribute code--> - <actionGroup name="createProductAttributeWithDateField" extends="createProductAttribute" insertAfter="checkRequired"> - <annotations> - <description>EXTENDS: createProductAttribute. Fills in the Attribute Code and Default Value (Attribute Type: Date Field).</description> - </annotations> - <arguments> - <argument name="date" type="string"/> - </arguments> - - <click stepKey="openAdvancedProperties" selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}"/> - <fillField stepKey="fillCode" selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" userInput="{{attribute.attribute_code}}"/> - <fillField stepKey="fillDefaultValue" selector="{{AdvancedAttributePropertiesSection.DefaultValueDate}}" userInput="{{date}}"/> - </actionGroup> - - <!-- Creates dropdown option at row without saving--> - <actionGroup name="createAttributeDropdownNthOption"> - <annotations> - <description>Creates an Option for a Product Attribute (Attribute Type: Dropdown).</description> - </annotations> - <arguments> - <argument name="row" type="string"/> - <argument name="adminName" type="string"/> - <argument name="frontName" type="string"/> - </arguments> - - <click stepKey="clickAddOptions" selector="{{AttributePropertiesSection.dropdownAddOptions}}"/> - <waitForPageLoad stepKey="waitForNewOption"/> - <fillField stepKey="fillAdmin" selector="{{AttributePropertiesSection.dropdownNthOptionAdmin(row)}}" userInput="{{adminName}}"/> - <fillField stepKey="fillStoreView" selector="{{AttributePropertiesSection.dropdownNthOptionDefaultStoreView(row)}}" userInput="{{frontName}}"/> - </actionGroup> - - <!-- Creates dropdown option at row as default--> - <actionGroup name="createAttributeDropdownNthOptionAsDefault" extends="createAttributeDropdownNthOption"> - <annotations> - <description>EXTENDS: createAttributeDropdownNthOption. Checks the 'Is Default' option.</description> - </annotations> - - <checkOption selector="{{AttributePropertiesSection.dropdownNthOptionIsDefault(row)}}" stepKey="setAsDefault" after="fillStoreView"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeSetActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeSetActionGroup.xml index a7d5a3864c052..6e05fa614dfb9 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeSetActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeSetActionGroup.xml @@ -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="AssignAttributeToGroup"> + <actionGroup name="AssignAttributeToGroupActionGroup"> <annotations> <description>Assign the provided Attribute to an Attribute Set from the Attribute Sets creation/edit page.</description> </annotations> @@ -23,128 +23,4 @@ <waitForPageLoad stepKey="waitForPageLoad2"/> <see userInput="{{attribute}}" selector="{{AdminProductAttributeSetEditSection.groupTree}}" stepKey="seeAttributeInGroup"/> </actionGroup> - - <actionGroup name="UnassignAttributeFromGroup"> - <annotations> - <description>Unassign the provided Attribute from an Attribute Set from the Attribute Sets creation/edit page.</description> - </annotations> - <arguments> - <argument name="group" type="string"/> - <argument name="attribute" type="string"/> - </arguments> - - <conditionalClick selector="{{AdminProductAttributeSetEditSection.attributeGroupExtender(group)}}" dependentSelector="{{AdminProductAttributeSetEditSection.attributeGroupCollapsed(group)}}" visible="true" stepKey="extendGroup"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - <dragAndDrop selector1="{{AdminProductAttributeSetEditSection.assignedAttribute(attribute)}}" selector2="{{AdminProductAttributeSetEditSection.xThLineItemUnassignedAttribute('1')}}" stepKey="dragAndDropToUnassigned"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - <see userInput="{{attribute}}" selector="{{AdminProductAttributeSetEditSection.unassignedAttributesTree}}" stepKey="seeAttributeInUnassigned"/> - </actionGroup> - - <actionGroup name="SaveAttributeSet"> - <annotations> - <description>Save an Attribute Set on the Attribute Set creation/edit page.</description> - </annotations> - - <click selector="{{AdminProductAttributeSetActionSection.save}}" stepKey="clickSave"/> - <see userInput="You saved the attribute set" selector="{{AdminMessagesSection.success}}" stepKey="successMessage"/> - </actionGroup> - - <!--Generic attribute set creation--> - <actionGroup name="CreateDefaultAttributeSet"> - <annotations> - <description>Goes to the Attribute Sets grid page. Clicks on Add. Fill Name. Clicks on Save.</description> - </annotations> - <arguments> - <argument name="label" type="string"/> - </arguments> - - <amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSets"/> - <waitForPageLoad stepKey="wait1"/> - <click selector="{{AdminProductAttributeSetGridSection.addAttributeSetBtn}}" stepKey="clickAddAttributeSet"/> - <fillField selector="{{AdminProductAttributeSetSection.name}}" userInput="{{label}}" stepKey="fillName"/> - <click selector="{{AdminProductAttributeSetSection.saveBtn}}" stepKey="clickSave1"/> - </actionGroup> - <actionGroup name="AdminAddUnassignedAttributeToGroup" extends="CreateDefaultAttributeSet"> - <arguments> - <argument name="firstOption" type="string" defaultValue="color"/> - <argument name="secondOption" type="string" defaultValue="material"/> - <argument name="group" type="string" defaultValue="Product Details"/> - </arguments> - <dragAndDrop selector1="{{AdminProductAttributeSetSection.attribute(firstOption)}}" selector2="{{AdminProductAttributeSetSection.attribute(group)}}" stepKey="unassign1"/> - <dragAndDrop selector1="{{AdminProductAttributeSetSection.attribute(secondOption)}}" selector2="{{AdminProductAttributeSetSection.attribute(group)}}" stepKey="unassign2"/> - <click selector="{{AdminProductAttributeSetSection.saveBtn}}" stepKey="clickSaveButton"/> - </actionGroup> - - <actionGroup name="goToAttributeGridPage"> - <annotations> - <description>Goes to the Attribute Sets grid page.</description> - </annotations> - - <amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSets"/> - </actionGroup> - - <actionGroup name="goToAttributeSetByName"> - <annotations> - <description>Searches for the provided Attribute Sets Name. Clicks on the 1st row.</description> - </annotations> - <arguments> - <argument name="name" type="string"/> - </arguments> - - <click selector="{{AdminProductAttributeSetGridSection.resetFilter}}" stepKey="clickResetButton"/> - <fillField selector="{{AdminProductAttributeSetGridSection.filter}}" userInput="{{name}}" stepKey="filterByName"/> - <click selector="{{AdminProductAttributeSetGridSection.searchBtn}}" stepKey="clickSearch"/> - <click selector="{{AdminProductAttributeSetGridSection.nthRow('1')}}" stepKey="clickFirstRow"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - </actionGroup> - - <!-- Filter By Attribute Label --> - <actionGroup name="filterProductAttributeByAttributeLabel"> - <annotations> - <description>Searches the Attribute Sets grid page for the provided Attribute Set Name.</description> - </annotations> - <arguments> - <argument name="productAttributeLabel" type="string"/> - </arguments> - - <fillField selector="{{AdminProductAttributeGridSection.attributeLabelFilter}}" userInput="{{productAttributeLabel}}" stepKey="setAttributeLabel"/> - <waitForPageLoad stepKey="waitForUserInput"/> - <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/> - </actionGroup> - - <actionGroup name="FilterProductAttributeSetGridByAttributeSetName"> - <annotations> - <description>Filters the Attribute Sets grid page for the provided Attribute Set Name.</description> - </annotations> - <arguments> - <argument name="name" type="string"/> - </arguments> - - <click selector="{{AdminProductAttributeSetGridSection.resetFilter}}" stepKey="clickResetButton"/> - <fillField selector="{{AdminProductAttributeSetGridSection.filter}}" userInput="{{name}}" stepKey="filterByName"/> - <click selector="{{AdminProductAttributeSetGridSection.searchBtn}}" stepKey="clickSearch"/> - <click selector="{{AdminProductAttributeSetGridSection.nthRow('1')}}" stepKey="clickFirstRow"/> - <waitForPageLoad time="30" stepKey="waitForPageLoad1"/> - </actionGroup> - - <!-- Delete attribute set --> - <actionGroup name="deleteAttributeSetByLabel"> - <annotations> - <description>Deletes the provided Attribute Set Name from the Attribute Sets grid page.</description> - </annotations> - <arguments> - <argument name="label" type="string"/> - </arguments> - - <amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSets"/> - <waitForPageLoad stepKey="waitForAttributeSetPageLoad"/> - <fillField selector="{{AdminProductAttributeSetGridSection.filter}}" userInput="{{label}}" stepKey="filterByName"/> - <click selector="{{AdminProductAttributeSetGridSection.searchBtn}}" stepKey="clickSearch"/> - <click selector="{{AdminProductAttributeSetGridSection.nthRow('1')}}" stepKey="clickFirstRow"/> - <waitForPageLoad stepKey="waitForClick"/> - <click selector="{{AdminProductAttributeSetSection.deleteBtn}}" stepKey="clickDelete"/> - <click selector="{{AdminProductAttributeSetSection.modalOk}}" stepKey="confirmDelete"/> - <waitForPageLoad stepKey="waitForDeleteToFinish"/> - <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="The attribute set has been removed." stepKey="seeDeleteMessage"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductGridActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductGridActionGroup.xml deleted file mode 100644 index 320a322fc5f8e..0000000000000 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductGridActionGroup.xml +++ /dev/null @@ -1,445 +0,0 @@ -<?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"> - <!--Reset the product grid to the default view--> - <actionGroup name="resetProductGridToDefaultView"> - <annotations> - <description>Sets the Admin Products grid view to the 'Default View'.</description> - </annotations> - - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> - <click selector="{{AdminProductGridFilterSection.viewDropdown}}" stepKey="openViewBookmarksTab"/> - <click selector="{{AdminProductGridFilterSection.viewBookmark('Default View')}}" stepKey="resetToDefaultGridView"/> - <waitForPageLoad stepKey="waitForProductGridLoad"/> - <see selector="{{AdminProductGridFilterSection.viewDropdown}}" userInput="Default View" stepKey="seeDefaultViewSelected"/> - </actionGroup> - - <!--Filter the product grid by the SKU field--> - <actionGroup name="filterProductGridBySku"> - <annotations> - <description>Filters the Admin Products grid by the provided Product (SKU).</description> - </annotations> - <arguments> - <argument name="product" defaultValue="_defaultProduct"/> - </arguments> - - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/> - </actionGroup> - - <!--Filter the product grid by the SKU string --> - <actionGroup name="filterProductGridBySku2"> - <annotations> - <description>Filters the Admin Products grid by the provided Product SKU.</description> - </annotations> - <arguments> - <argument name="sku" type="string"/> - </arguments> - - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/> - </actionGroup> - - <!--Filter the product grid by the Name field--> - <actionGroup name="filterProductGridByName"> - <annotations> - <description>Filters the Admin Products grid by the provided Product (Name).</description> - </annotations> - <arguments> - <argument name="product" defaultValue="_defaultProduct"/> - </arguments> - - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{product.name}}" stepKey="fillProductNameFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/> - </actionGroup> - - <!--Filter the product grid by the Name field--> - <actionGroup name="filterProductGridByName2"> - <annotations> - <description>Filters the Admin Products grid by the provided Product Name.</description> - </annotations> - <arguments> - <argument name="name" type="string"/> - </arguments> - - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{name}}" stepKey="fillProductNameFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/> - </actionGroup> - - <!--Filter the product grid by new from date filter--> - <actionGroup name="filterProductGridBySetNewFromDate"> - <annotations> - <description>Filters the Admin Products grid by the New From Data field. PLEASE NOTE: The Start Date is Hardcoded.</description> - </annotations> - - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.newFromDateFilter}}" userInput="05/16/2018" stepKey="fillSetAsNewProductFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/> - </actionGroup> - - <!--Filter the product grid by a price range--> - <actionGroup name="filterProductGridByPriceRange"> - <annotations> - <description>Filters the Admin Products grid by the provided Price Filter.</description> - </annotations> - <arguments> - <argument name="filter"/> - </arguments> - - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.priceFilterFrom}}" userInput="{{filter.from}}" stepKey="fillProductPriceFromFilter"/> - <fillField selector="{{AdminProductGridFilterSection.priceFilterTo}}" userInput="{{filter.to}}" stepKey="fillProductPriceToFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/> - </actionGroup> - - <!--Filter the product grid to Enabled products--> - <actionGroup name="filterProductGridByEnabledStatus"> - <annotations> - <description>Filters the Admin Products grid by the 'Enabled' Status. PLEASE NOTE: The Filter is Hardcoded.</description> - </annotations> - - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <selectOption selector="{{AdminProductGridFilterSection.statusFilter}}" userInput="Enabled" stepKey="selectEnabledStatusFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/> - </actionGroup> - - <!--Filter the product grid to Disabled products--> - <actionGroup name="filterProductGridByDisabledStatus"> - <annotations> - <description>Filters the Admin Products grid by the 'Disabled' Status. PLEASE NOTE: The Filter is Hardcoded.</description> - </annotations> - - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <selectOption selector="{{AdminProductGridFilterSection.statusFilter}}" userInput="Disabled" stepKey="selectDisabledStatusFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/> - </actionGroup> - - <!--Search product grid with keyword search--> - <actionGroup name="searchProductGridByKeyword"> - <annotations> - <description>Searches the Admin Products grid for the provided Keyword.</description> - </annotations> - <arguments> - <argument name="keyword"/> - </arguments> - - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <fillField selector="{{AdminProductGridFilterSection.keywordSearch}}" userInput="{{keyword}}" stepKey="fillKeywordSearchField"/> - <click selector="{{AdminProductGridFilterSection.keywordSearchButton}}" stepKey="clickKeywordSearch"/> - </actionGroup> - - <!--Search product grid with keyword search--> - <!-- Argument type: string (see more in MQE-965) --> - <actionGroup name="searchProductGridByKeyword2"> - <annotations> - <description>Searches the Admin Products grid for the provided Keyword.</description> - </annotations> - <arguments> - <argument name="keyword" type="string"/> - </arguments> - - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <fillField selector="{{AdminProductGridFilterSection.keywordSearch}}" userInput="{{keyword}}" stepKey="fillKeywordSearchField"/> - <click selector="{{AdminProductGridFilterSection.keywordSearchButton}}" stepKey="clickKeywordSearch"/> - </actionGroup> - - <!--Filter product grid by name, sku, and type; and see expected product--> - <actionGroup name="viewProductInAdminGrid"> - <annotations> - <description>Filters the Admin Products grid by the provided Product (Name, SKU and Type).</description> - </annotations> - <arguments> - <argument name="product" defaultValue="_defaultProduct"/> - </arguments> - - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> - <waitForPageLoad stepKey="waitForPageLoadInitial"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{product.name}}" stepKey="fillProductNameFilter"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> - <selectOption selector="{{AdminProductGridFilterSection.typeFilter}}" userInput="{{product.type_id}}" stepKey="selectionProductType"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <see selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="{{product.name}}" stepKey="seeProductNameInGrid"/> - <see selector="{{AdminProductGridSection.productGridCell('1', 'Price')}}" userInput="{{product.price}}" stepKey="seeProductPriceInGrid"/> - <click selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="clickClearFiltersAfter"/> - </actionGroup> - - <!-- Filter product grid by sku, name --> - <actionGroup name="filterProductGridBySkuAndName"> - <annotations> - <description>Filters the Admin Products grid by the provided Product (Name and SKU).</description> - </annotations> - <arguments> - <argument name="product" defaultValue="_defaultProduct"/> - </arguments> - - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> - <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{product.name}}" stepKey="fillProductNameFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - </actionGroup> - - <!--Delete a product by filtering grid and using delete action--> - <actionGroup name="deleteProductUsingProductGrid"> - <annotations> - <description>Deletes the provided Product from the Admin Products grid page.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <!--TODO use other action group for filtering grid when MQE-539 is implemented --> - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> - <waitForPageLoad time="60" stepKey="waitForPageLoadInitial"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> - <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{product.name}}" stepKey="fillProductNameFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <see selector="{{AdminProductGridSection.productGridCell('1', 'SKU')}}" userInput="{{product.sku}}" stepKey="seeProductSkuInGrid"/> - <click selector="{{AdminProductGridSection.multicheckDropdown}}" stepKey="openMulticheckDropdown"/> - <click selector="{{AdminProductGridSection.multicheckOption('Select All')}}" stepKey="selectAllProductInFilteredGrid"/> - <click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickActionDropdown"/> - <click selector="{{AdminProductGridSection.bulkActionOption('Delete')}}" stepKey="clickDeleteAction"/> - <waitForElementVisible selector="{{AdminProductGridConfirmActionSection.title}}" stepKey="waitForConfirmModal"/> - <click selector="{{AdminProductGridConfirmActionSection.ok}}" stepKey="confirmProductDelete"/> - </actionGroup> - - <!--Delete all products by filtering grid and using mass delete action--> - <actionGroup name="deleteAllDuplicateProductUsingProductGrid" extends="deleteProductUsingProductGrid"> - <annotations> - <description>EXTENDS: deleteProductUsingProductGrid. Removes 'seeProductSkuInGrid'.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <remove keyForRemoval="seeProductSkuInGrid"/> - </actionGroup> - - <!--Delete a product by filtering grid and using delete action--> - <actionGroup name="deleteProductBySku"> - <annotations> - <description>Goes to the Admin Products grid page. Deletes the provided Product SKU.</description> - </annotations> - <arguments> - <argument name="sku" type="string"/> - </arguments> - - <!--TODO use other action group for filtering grid when MQE-539 is implemented --> - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <see selector="{{AdminProductGridSection.productGridCell('1', 'SKU')}}" userInput="{{sku}}" stepKey="seeProductSkuInGrid"/> - <click selector="{{AdminProductGridSection.multicheckDropdown}}" stepKey="openMulticheckDropdown"/> - <click selector="{{AdminProductGridSection.multicheckOption('Select All')}}" stepKey="selectAllProductInFilteredGrid"/> - <click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickActionDropdown"/> - <click selector="{{AdminProductGridSection.bulkActionOption('Delete')}}" stepKey="clickDeleteAction"/> - <waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitForConfirmModal"/> - <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmProductDelete"/> - <see selector="{{AdminMessagesSection.success}}" userInput="record(s) have been deleted." stepKey="seeSuccessMessage"/> - </actionGroup> - - <actionGroup name="deleteProductByName" extends="deleteProductBySku"> - <annotations> - <description>EXTENDS: deleteProductBySku. Deletes the provided Product Name.</description> - </annotations> - <arguments> - <argument name="sku" type="string" defaultValue=""/> - <argument name="name" type="string"/> - </arguments> - - <remove keyForRemoval="fillProductSkuFilter"/> - <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{name}}" stepKey="fillProductSkuFilter" after="openProductFilters"/> - <remove keyForRemoval="seeProductSkuInGrid"/> - <see selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="{{name}}" stepKey="seeProductNameInGrid" after="clickApplyFilters"/> - </actionGroup> - - <actionGroup name="deleteProductsByKeyword"> - <annotations> - <description>Delete products by keyword</description> - </annotations> - <arguments> - <argument name="keyword" type="string"/> - </arguments> - - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> - <fillField selector="{{AdminProductGridFilterSection.keywordSearch}}" userInput="{{keyword}}" stepKey="fillKeywordField"/> - <click selector="{{AdminProductGridFilterSection.keywordSearchButton}}" stepKey="keywordSearchButton"/> - <click selector="{{AdminProductGridSection.multicheckDropdown}}" stepKey="openMulticheckDropdown"/> - <click selector="{{AdminProductGridSection.multicheckOption('Select All')}}" stepKey="selectAllProductInFilteredGrid"/> - <click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickActionDropdown"/> - <click selector="{{AdminProductGridSection.bulkActionOption('Delete')}}" stepKey="clickDeleteAction"/> - <waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitForConfirmModal"/> - <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmProductDelete"/> - <see selector="{{AdminMessagesSection.success}}" userInput="record(s) have been deleted." stepKey="seeSuccessMessage"/> - </actionGroup> - - <!--Open product for edit by clicking row X and column Y in product grid--> - <actionGroup name="openProducForEditByClickingRowXColumnYInProductGrid"> - <annotations> - <description>Clicks on the 'Edit' button in the Admin Products grid by the provided Grid coordinates (X, Y).</description> - </annotations> - <arguments> - <argument name="X" type="string" defaultValue="1"/> - <argument name="Y" type="string" defaultValue="2"/> - </arguments> - - <click selector="{{AdminProductGridSection.productGridXRowYColumnButton(X, Y)}}" stepKey="openProductForEdit"/> - </actionGroup> - - <!-- Sort products by ID descending --> - <actionGroup name="sortProductsByIdDescending"> - <annotations> - <description>Filters the ID column in Descending Order.</description> - </annotations> - - <conditionalClick selector="{{AdminProductGridTableHeaderSection.id('ascend')}}" dependentSelector="{{AdminProductGridTableHeaderSection.id('descend')}}" visible="false" stepKey="sortById"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - </actionGroup> - - <!-- Sort products by ID ascending --> - <actionGroup name="sortProductsByIdAscending"> - <annotations> - <description>Filters the ID column in Ascending Order.</description> - </annotations> - - <conditionalClick selector="{{AdminProductGridTableHeaderSection.id('descend')}}" dependentSelector="{{AdminProductGridTableHeaderSection.id('ascend')}}" visible="false" stepKey="sortById"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - </actionGroup> - - <!--Disabled a product by filtering grid and using change status action--> - <actionGroup name="ChangeStatusProductUsingProductGridActionGroup"> - <annotations> - <description>Goes to the Admin Products grid page. Changes the Product Status to the provided Status. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="status" defaultValue="Enable" type="string"/> - </arguments> - - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> - <waitForPageLoad time="60" stepKey="waitForPageLoadInitial"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <see selector="{{AdminProductGridSection.productGridCell('1', 'SKU')}}" userInput="{{product.sku}}" stepKey="seeProductSkuInGrid"/> - <click selector="{{AdminProductGridSection.multicheckDropdown}}" stepKey="openMulticheckDropdown"/> - <click selector="{{AdminProductGridSection.multicheckOption('Select All')}}" stepKey="selectAllProductInFilteredGrid"/> - - <click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickActionDropdown"/> - <click selector="{{AdminProductGridSection.bulkActionOption('Change status')}}" stepKey="clickChangeStatusAction"/> - <click selector="{{AdminProductGridSection.changeStatus('status')}}" stepKey="clickChangeStatusDisabled"/> - <waitForPageLoad stepKey="waitForStatusToBeChanged"/> - <see selector="{{AdminMessagesSection.success}}" userInput="A total of 1 record(s) have been updated." stepKey="seeSuccessMessage"/> - <waitForLoadingMaskToDisappear stepKey="waitForMaskToDisappear"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial2"/> - </actionGroup> - - <actionGroup name="NavigateToAndResetProductGridToDefaultView" extends="resetProductGridToDefaultView"> - <annotations> - <description>EXTENDS: resetProductGridToDefaultView. Adds an action to go to the Admin Products grid page.</description> - </annotations> - - <amOnPage url="{{AdminProductIndexPage.url}}" before="clickClearFilters" stepKey="goToAdminProductIndexPage"/> - <waitForPageLoad after="goToAdminProductIndexPage" stepKey="waitForProductIndexPageToLoad"/> - </actionGroup> - - <actionGroup name="NavigateToAndResetProductAttributeGridToDefaultView"> - <annotations> - <description>Goes to the Product Attributes grid. Clicks on 'Clear Filters'.</description> - </annotations> - - <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> - <waitForPageLoad stepKey="waitForGridLoad"/> - </actionGroup> - - <!--Filter and select the product --> - <actionGroup name="filterAndSelectProduct"> - <annotations> - <description>Goes to the Admin Products grid. Filters the Product grid by the provided Product SKU.</description> - </annotations> - <arguments> - <argument name="productSku" type="string"/> - </arguments> - - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> - <waitForPageLoad stepKey="waitForProductIndexPageToLoad"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{productSku}}" stepKey="fillProductSkuFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/> - <click stepKey="openSelectedProduct" selector="{{AdminProductGridSection.productRowBySku(productSku)}}"/> - <waitForPageLoad stepKey="waitForProductToLoad"/> - <waitForElementVisible selector="{{AdminHeaderSection.pageTitle}}" stepKey="waitForProductTitle"/> - </actionGroup> - - <actionGroup name="deleteProductsIfTheyExist"> - <annotations> - <description>Deletes all Products in the Admin Products grid.</description> - </annotations> - - <conditionalClick selector="{{AdminProductGridSection.multicheckDropdown}}" dependentSelector="{{AdminProductGridSection.firstProductRow}}" visible="true" stepKey="openMulticheckDropdown"/> - <conditionalClick selector="{{AdminProductGridSection.multicheckOption('Select All')}}" dependentSelector="{{AdminProductGridSection.firstProductRow}}" visible="true" stepKey="selectAllProductInFilteredGrid"/> - <click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickActionDropdown"/> - <click selector="{{AdminProductGridSection.bulkActionOption('Delete')}}" stepKey="clickDeleteAction"/> - <waitForElementVisible selector="{{AdminProductGridConfirmActionSection.ok}}" stepKey="waitForModalPopUp"/> - <click selector="{{AdminProductGridConfirmActionSection.ok}}" stepKey="confirmProductDelete"/> - <waitForPageLoad stepKey="waitForGridLoad"/> - </actionGroup> - - <actionGroup name="deleteAllProductsUsingProductGrid"> - <annotations> - <description>Deletes all products in Admin Products grid page.</description> - </annotations> - - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="openAdminGridProductsPage"/> - <waitForPageLoad time="60" stepKey="waitForPageFullyLoad"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clearGridFilters"/> - - <conditionalClick selector="{{AdminProductGridSection.multicheckDropdown}}" dependentSelector="{{AdminDataGridTableSection.dataGridEmpty}}" visible="false" stepKey="openMulticheckDropdown"/> - <conditionalClick selector="{{AdminProductGridSection.multicheckOption('Select All')}}" dependentSelector="{{AdminDataGridTableSection.dataGridEmpty}}" visible="false" stepKey="selectAllProductsInGrid"/> - <click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickActionDropdown"/> - <click selector="{{AdminProductGridSection.bulkActionOption('Delete')}}" stepKey="clickDeleteAction"/> - - <waitForElementVisible selector="{{AdminConfirmationModalSection.message}}" stepKey="waitForConfirmModal"/> - <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmDelete"/> - <waitForElementVisible selector="{{AdminDataGridTableSection.dataGridEmpty}}" stepKey="waitGridIsEmpty"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductPageCreateAttributeSetWithAttributeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductPageCreateAttributeSetWithAttributeActionGroup.xml new file mode 100644 index 0000000000000..bdf59b20f8e38 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductPageCreateAttributeSetWithAttributeActionGroup.xml @@ -0,0 +1,35 @@ +<?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="AdminProductPageCreateAttributeSetWithAttributeActionGroup"> + <annotations> + <description>Adds the provided Product Attribute Set to a Product on the Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="attributeName" type="string"/> + <argument name="attributeSetName" type="string"/> + <argument name="attributeType" type="string" defaultValue="TextField"/> + </arguments> + + <click selector="{{AdminProductFormSection.addAttributeBtn}}" stepKey="clickAddAttributeBtn"/> + <waitForPageLoad stepKey="waitForSidePanel"/> + <see userInput="Select Attribute" stepKey="checkNewAttributePopUpAppeared"/> + <click selector="{{AdminProductFormAttributeSection.createNewAttribute}}" stepKey="clickCreateNewAttribute"/> + <fillField selector="{{AdminProductFormNewAttributeSection.attributeLabel}}" userInput="{{attributeName}}" stepKey="fillAttributeLabel"/> + <selectOption selector="{{AdminProductFormNewAttributeSection.attributeType}}" userInput="{{attributeType}}" stepKey="selectAttributeType"/> + <click selector="{{AdminProductFormNewAttributeSection.saveInNewSet}}" stepKey="saveAttribute"/> + <fillField selector="{{AdminProductFormNewAttributeNewSetSection.setName}}" userInput="{{attributeSetName}}" stepKey="fillSetName"/> + <click selector="{{AdminProductFormNewAttributeNewSetSection.accept}}" stepKey="acceptPopup"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingToFinish"/> + <!-- Product page will hang if there is no reload--> + <reloadPage stepKey="reloadPage"/> + <waitForPageLoad stepKey="waitForReload"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductPageFillTextAttributeValueByNameActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductPageFillTextAttributeValueByNameActionGroup.xml new file mode 100644 index 0000000000000..336ab90ccec73 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductPageFillTextAttributeValueByNameActionGroup.xml @@ -0,0 +1,23 @@ +<?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="AdminProductPageFillTextAttributeValueByNameActionGroup"> + <annotations> + <description>Fills in the Attribute Name field with the provided value.</description> + </annotations> + <arguments> + <argument name="attributeName" type="string"/> + <argument name="value" type="string"/> + </arguments> + + <click stepKey="openSection" selector="{{AdminProductAttributeSection.attributeSectionHeader}}"/> + <fillField stepKey="fillValue" selector="{{AdminProductAttributeSection.textAttributeByName(attributeName)}}" userInput="{{value}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductPageSelectAttributeSetActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductPageSelectAttributeSetActionGroup.xml new file mode 100644 index 0000000000000..0b58c65386951 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductPageSelectAttributeSetActionGroup.xml @@ -0,0 +1,23 @@ +<?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="AdminProductPageSelectAttributeSetActionGroup"> + <annotations> + <description>Selects the provided Attribute Set from the Admin Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="attributeSetName" type="string"/> + </arguments> + + <click stepKey="openDropdown" selector="{{AdminProductFormSection.attributeSet}}"/> + <fillField stepKey="filter" selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{attributeSetName}}"/> + <click stepKey="clickResult" selector="{{AdminProductFormSection.attributeSetFilterResult}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSetProductDisabledActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSetProductDisabledActionGroup.xml new file mode 100644 index 0000000000000..a8b413d523ff0 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSetProductDisabledActionGroup.xml @@ -0,0 +1,15 @@ +<?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="AdminSetProductDisabledActionGroup"> + <conditionalClick selector="{{AdminProductFormSection.enableProductLabel}}" dependentSelector="{{AdminProductFormSection.productStatusValue('1')}}" visible="true" stepKey="disableProduct"/> + <seeElement selector="{{AdminProductFormSection.productStatusValue('2')}}" stepKey="assertThatProductSetToDisabled"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSwitchScopeForProductAttributeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSwitchScopeForProductAttributeActionGroup.xml new file mode 100644 index 0000000000000..bd2414ae6e6c5 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSwitchScopeForProductAttributeActionGroup.xml @@ -0,0 +1,19 @@ +<?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="AdminSwitchScopeForProductAttributeActionGroup"> + <arguments> + <argument name="scope" type="string" defaultValue="1"/> + </arguments> + <click selector="{{AttributePropertiesSection.AdvancedProperties}}" stepKey="expandAdvancedProperties"/> + <waitForElementVisible selector="{{AttributePropertiesSection.Scope}}" stepKey="waitOpenAdvancedProperties"/> + <selectOption selector="{{AttributePropertiesSection.Scope}}" userInput="1" stepKey="selectNecessaryScope"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertDiscountsPercentageOfProductsActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertDiscountsPercentageOfProductsActionGroup.xml new file mode 100644 index 0000000000000..e32c423fb09a3 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertDiscountsPercentageOfProductsActionGroup.xml @@ -0,0 +1,27 @@ +<?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="AssertDiscountsPercentageOfProductsActionGroup"> + <annotations> + <description>Validates that the provided Product Tier Price is present and correct.</description> + </annotations> + <arguments> + <argument name="amount" type="string" defaultValue="45"/> + </arguments> + + <click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickOnAdvancedPricingButton"/> + <waitForElement selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="waitForCustomerGroupPriceAddButton"/> + <grabValueFrom selector="{{AdminProductFormAdvancedPricingSection.productTierPricePercentageValuePriceInput('0')}}" stepKey="grabProductTierPriceInput"/> + <assertEquals stepKey="assertProductTierPriceInput"> + <expectedResult type="string">{{amount}}</expectedResult> + <actualResult type="string">$grabProductTierPriceInput</actualResult> + </assertEquals> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductDescriptionInProductEditFormActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductDescriptionInProductEditFormActionGroup.xml new file mode 100644 index 0000000000000..f1bca0c36a57e --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductDescriptionInProductEditFormActionGroup.xml @@ -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="AssertProductDescriptionInProductEditFormActionGroup"> + <arguments> + <argument name="productDescription" type="string"/> + </arguments> + <conditionalClick selector="{{AdminProductContentSection.sectionHeader}}" dependentSelector="{{AdminProductContentSection.sectionHeaderShow}}" visible="false" stepKey="expandContentSection"/> + <seeInField selector="{{AdminProductContentSection.descriptionTextArea}}" userInput="{{productDescription}}" stepKey="seeProductDescription"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageAdminProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageAdminProductPageActionGroup.xml new file mode 100644 index 0000000000000..6ea154d2b01d3 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageAdminProductPageActionGroup.xml @@ -0,0 +1,23 @@ +<?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="AssertProductImageAdminProductPageActionGroup"> + <annotations> + <description>Validates that the provided Product Image is present and correct.</description> + </annotations> + <arguments> + <argument name="image" defaultValue="MagentoLogo"/> + </arguments> + + <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductImagesSection"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <seeElement selector="{{AdminProductImagesSection.imageFile(image.filename)}}" stepKey="seeImage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageNotInAdminProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageNotInAdminProductPageActionGroup.xml new file mode 100644 index 0000000000000..a761f20b4cc5f --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageNotInAdminProductPageActionGroup.xml @@ -0,0 +1,23 @@ +<?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="AssertProductImageNotInAdminProductPageActionGroup"> + <annotations> + <description>Validates that the provided Product Image is NOT present.</description> + </annotations> + <arguments> + <argument name="image" defaultValue="MagentoLogo"/> + </arguments> + + <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductImagesSection"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <dontSeeElement selector="{{AdminProductImagesSection.imageFile(image.filename)}}" stepKey="seeImage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageNotInStorefrontProductPage2ActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageNotInStorefrontProductPage2ActionGroup.xml new file mode 100644 index 0000000000000..4c7fca97a078a --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageNotInStorefrontProductPage2ActionGroup.xml @@ -0,0 +1,24 @@ +<?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="AssertProductImageNotInStorefrontProductPage2ActionGroup"> + <annotations> + <description>Validates that the provided Product Image is not present.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="image" defaultValue="MagentoLogo"/> + </arguments> + + <seeInCurrentUrl url="/{{product.custom_attributes[url_key]}}.html" stepKey="checkUrl"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <dontSeeElement selector="{{StorefrontProductMediaSection.imageFile(image.filename)}}" stepKey="seeImage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageNotInStorefrontProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageNotInStorefrontProductPageActionGroup.xml new file mode 100644 index 0000000000000..72febb053046e --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageNotInStorefrontProductPageActionGroup.xml @@ -0,0 +1,24 @@ +<?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="AssertProductImageNotInStorefrontProductPageActionGroup"> + <annotations> + <description>Validates that the provided Product Image is not present.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="image" defaultValue="MagentoLogo"/> + </arguments> + + <seeInCurrentUrl url="/{{product.urlKey}}.html" stepKey="checkUrl"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <dontSeeElement selector="{{StorefrontProductMediaSection.imageFile(image.filename)}}" stepKey="seeImage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageStorefrontProductPage2ActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageStorefrontProductPage2ActionGroup.xml new file mode 100644 index 0000000000000..a4769e675e607 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageStorefrontProductPage2ActionGroup.xml @@ -0,0 +1,24 @@ +<?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="AssertProductImageStorefrontProductPage2ActionGroup"> + <annotations> + <description>Validates that the provided Product Image is present.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="image" defaultValue="MagentoLogo"/> + </arguments> + + <seeInCurrentUrl url="/{{product.custom_attributes[url_key]}}.html" stepKey="checkUrl"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <seeElement selector="{{StorefrontProductMediaSection.imageFile(image.filename)}}" stepKey="seeImage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageStorefrontProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageStorefrontProductPageActionGroup.xml new file mode 100644 index 0000000000000..12be0a3d199dc --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageStorefrontProductPageActionGroup.xml @@ -0,0 +1,24 @@ +<?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="AssertProductImageStorefrontProductPageActionGroup"> + <annotations> + <description>Validates that the provided Product Image is present.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="image" defaultValue="MagentoLogo"/> + </arguments> + + <seeInCurrentUrl url="/{{product.urlKey}}.html" stepKey="checkUrl"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <seeElement selector="{{StorefrontProductMediaSection.imageFile(image.filename)}}" stepKey="seeImage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductInStorefrontProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductInStorefrontProductPageActionGroup.xml index 8db64ce7c49ac..28ceb82ec6d2e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductInStorefrontProductPageActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductInStorefrontProductPageActionGroup.xml @@ -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="AssertProductInStorefrontProductPage"> + <actionGroup name="AssertProductInStorefrontProductPageActionGroup"> <annotations> <description>Goes to the Storefront page. Validates that the provided Product details are present.</description> </annotations> @@ -24,36 +24,4 @@ <see userInput="{{product.price}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="assertProductPrice"/> <see userInput="{{product.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="assertProductSku"/> </actionGroup> - - <actionGroup name="AssertProductNameAndSkuInStorefrontProductPage"> - <annotations> - <description>Goes to the Storefront Product page for the provided Product. Validates that the Product details are present and correct.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <!-- Go to storefront product page, assert product name and sku --> - <amOnPage url="{{product.urlKey}}.html" stepKey="navigateToProductPage"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - <seeInTitle userInput="{{product.name}}" stepKey="assertProductNameTitle"/> - <see userInput="{{product.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertProductName"/> - <see userInput="{{product.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="assertProductSku"/> - </actionGroup> - - <actionGroup name="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey"> - <annotations> - <description>Goes to the Storefront Product page for the provided Product. Validates that the Product details are present and correct.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <!-- Go to storefront product page, assert product name and sku --> - <amOnPage url="{{product.custom_attributes[url_key]}}.html" stepKey="navigateToProductPage"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - <seeInTitle userInput="{{product.name}}" stepKey="assertProductNameTitle"/> - <see userInput="{{product.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertProductName"/> - <see userInput="{{product.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="assertProductSku"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductIsAssignedToWebsiteActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductIsAssignedToWebsiteActionGroup.xml new file mode 100644 index 0000000000000..23937af41ae51 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductIsAssignedToWebsiteActionGroup.xml @@ -0,0 +1,15 @@ +<?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="AssertProductIsAssignedToWebsiteActionGroup" extends="AssertWebsiteIsAvailableInProductWebsitesActionGroup"> + <remove keyForRemoval="seeCheckboxForWebsite"/> + <seeCheckboxIsChecked selector="{{ProductInWebsitesSection.website(website)}}" after="expandProductWebsitesSection" stepKey="seeCustomWebsiteIsChecked"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductIsNotAssignedToWebsiteActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductIsNotAssignedToWebsiteActionGroup.xml new file mode 100644 index 0000000000000..8963d06e9248f --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductIsNotAssignedToWebsiteActionGroup.xml @@ -0,0 +1,15 @@ +<?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="AssertProductIsNotAssignedToWebsiteActionGroup" extends="AssertWebsiteIsAvailableInProductWebsitesActionGroup"> + <remove keyForRemoval="seeCheckboxForWebsite"/> + <dontSeeCheckboxIsChecked selector="{{ProductInWebsitesSection.website(website)}}" after="expandProductWebsitesSection" stepKey="seeCustomWebsiteIsNotChecked"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductNameAndSkuInStorefrontProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductNameAndSkuInStorefrontProductPageActionGroup.xml new file mode 100644 index 0000000000000..23b7701010f35 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductNameAndSkuInStorefrontProductPageActionGroup.xml @@ -0,0 +1,26 @@ +<?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="AssertProductNameAndSkuInStorefrontProductPageActionGroup"> + <annotations> + <description>Goes to the Storefront Product page for the provided Product. Validates that the Product details are present and correct.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <!-- Go to storefront product page, assert product name and sku --> + <amOnPage url="{{product.urlKey}}.html" stepKey="navigateToProductPage"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + <seeInTitle userInput="{{product.name}}" stepKey="assertProductNameTitle"/> + <see userInput="{{product.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertProductName"/> + <see userInput="{{product.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="assertProductSku"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup.xml new file mode 100644 index 0000000000000..e50e5974023f8 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup.xml @@ -0,0 +1,26 @@ +<?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="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup"> + <annotations> + <description>Goes to the Storefront Product page for the provided Product. Validates that the Product details are present and correct.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <!-- Go to storefront product page, assert product name and sku --> + <amOnPage url="{{product.custom_attributes[url_key]}}.html" stepKey="navigateToProductPage"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + <seeInTitle userInput="{{product.name}}" stepKey="assertProductNameTitle"/> + <see userInput="{{product.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertProductName"/> + <see userInput="{{product.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="assertProductSku"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductNameInProductEditFormActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductNameInProductEditFormActionGroup.xml new file mode 100644 index 0000000000000..00f940cd4c3c8 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductNameInProductEditFormActionGroup.xml @@ -0,0 +1,17 @@ +<?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="AssertProductNameInProductEditFormActionGroup"> + <arguments> + <argument name="productName" type="string"/> + </arguments> + <seeInField selector="{{AdminProductFormSection.productName}}" userInput="{{productName}}" stepKey="seeProductNameOnEditProductPage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductOnAdminGridActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductOnAdminGridActionGroup.xml index 95f1cc2c23a37..a384e993405b9 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductOnAdminGridActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductOnAdminGridActionGroup.xml @@ -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="AssertProductOnAdminGridActionGroup" extends="viewProductInAdminGrid"> + <actionGroup name="AssertProductOnAdminGridActionGroup" extends="ViewProductInAdminGridActionGroup"> <annotations> <description>EXTENDS: viewProductInAdminGrid. Removes the 'clickClearFiltersAfter' step from the Action Group.</description> </annotations> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductOnCategoryPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductOnCategoryPageActionGroup.xml new file mode 100644 index 0000000000000..d35d6a4778dd6 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductOnCategoryPageActionGroup.xml @@ -0,0 +1,19 @@ +<?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="AssertProductOnCategoryPageActionGroup" extends="StorefrontCheckCategorySimpleProductActionGroup"> + <annotations> + <description>EXTENDS:StorefrontCheckCategorySimpleProduct. Removes 'AssertProductPrice', 'moveMouseOverProduct', 'AssertAddToCart'</description> + </annotations> + <remove keyForRemoval="AssertProductPrice"/> + <remove keyForRemoval="moveMouseOverProduct"/> + <remove keyForRemoval="AssertAddToCart"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertTextInAdminProductRelatedUpSellCrossSellSectionActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertTextInAdminProductRelatedUpSellCrossSellSectionActionGroup.xml new file mode 100644 index 0000000000000..e59f923464250 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertTextInAdminProductRelatedUpSellCrossSellSectionActionGroup.xml @@ -0,0 +1,24 @@ +<?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="AssertTextInAdminProductRelatedUpSellCrossSellSectionActionGroup"> + <annotations> + <description>Validates that provided Text appears in the provided Element on the Admin Product creation/edit page under 'Related Products, Up-Sells, and Cross-Sells' section.</description> + </annotations> + <arguments> + <argument name="element" defaultValue="AdminProductFormRelatedUpSellCrossSellSection.relatedProductSectionText"/> + <argument name="expectedText"/> + </arguments> + + <conditionalClick selector="{{AdminProductFormSection.productFormTab('Related Products')}}" dependentSelector="{{AdminProductFormSection.productFormTabState('Related Products', 'closed')}}" visible="true" stepKey="openTab"/> + <waitForPageLoad time="30" stepKey="waitForPageLoad"/> + <see selector="{{element}}" userInput="{{expectedText}}" stepKey="assertText"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertWebsiteIsAvailableInProductWebsitesActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertWebsiteIsAvailableInProductWebsitesActionGroup.xml new file mode 100644 index 0000000000000..4bd9ce0e09581 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertWebsiteIsAvailableInProductWebsitesActionGroup.xml @@ -0,0 +1,19 @@ +<?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="AssertWebsiteIsAvailableInProductWebsitesActionGroup"> + <arguments> + <argument name="website" type="string"/> + </arguments> + <scrollTo selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="scrollToProductInWebsitesSection"/> + <conditionalClick selector="{{ProductInWebsitesSection.sectionHeader}}" dependentSelector="{{ProductInWebsitesSection.sectionHeaderOpened}}" visible="false" stepKey="expandProductWebsitesSection"/> + <seeElement selector="{{ProductInWebsitesSection.website(website)}}" stepKey="seeCheckboxForWebsite"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertWebsiteIsNotAvailableInProductWebsitesActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertWebsiteIsNotAvailableInProductWebsitesActionGroup.xml new file mode 100644 index 0000000000000..14eb5a40b184e --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertWebsiteIsNotAvailableInProductWebsitesActionGroup.xml @@ -0,0 +1,15 @@ +<?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="AssertWebsiteIsNotAvailableInProductWebsitesActionGroup" extends="AssertWebsiteIsAvailableInProductWebsitesActionGroup"> + <remove keyForRemoval="seeCheckboxForWebsite"/> + <dontSeeElement selector="{{ProductInWebsitesSection.website(website)}}" after="expandProductWebsitesSection" stepKey="dontSeeCheckboxForWebsite"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CategoryPresentActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CategoryPresentActionGroup.xml new file mode 100644 index 0000000000000..76aec793c4eca --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CategoryPresentActionGroup.xml @@ -0,0 +1,26 @@ +<?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="CategoryPresentActionGroup" > + <annotations> + <description>Navigates to category page, asserts category is there. Navigates to storefront category page and asserts category is there. This action group will not work categories where name does NOT equal SEO.</description> + </annotations> + <arguments> + <argument name="categoryName" defaultValue="Test Category" type="string"/> + </arguments> + + <amOnPage url="{{AdminCategoryPage.url}}" stepKey="goToCategoryAdminPage"/> + <waitForPageLoad stepKey="waitForCategoryAdminPageLoad"/> + <see userInput="{{categoryName}}" stepKey="assertCategoryOnAdminPage" selector="{{AdminCategorySidebarTreeSection.treeContainer}}"/> + <amOnPage url="/{{categoryName}}.html" stepKey="goToCustomerFrontPage"/> + <see userInput="{{categoryName}}" stepKey="assertCategoryNameOnStorefront" selector="{{StorefrontCategoryMainSection.CategoryTitle}}"/> + <waitForPageLoad stepKey="waitForCustomerCategoryPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ChangeSeoUrlKeyActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ChangeSeoUrlKeyActionGroup.xml new file mode 100644 index 0000000000000..7107cc2a560d1 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ChangeSeoUrlKeyActionGroup.xml @@ -0,0 +1,24 @@ +<?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="ChangeSeoUrlKeyActionGroup"> + <annotations> + <description>Requires navigation to category creation/edit. Updates the Search Engine Optimization.</description> + </annotations> + <arguments> + <argument name="value" type="string"/> + </arguments> + + <click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="openSeoSection"/> + <fillField selector="{{AdminCategorySEOSection.UrlKeyInput}}" userInput="{{value}}" stepKey="enterURLKey"/> + <click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategory"/> + <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="assertSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ChangeSeoUrlKeyForSubCategoryActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ChangeSeoUrlKeyForSubCategoryActionGroup.xml new file mode 100644 index 0000000000000..42813aef05be5 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ChangeSeoUrlKeyForSubCategoryActionGroup.xml @@ -0,0 +1,25 @@ +<?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="ChangeSeoUrlKeyForSubCategoryActionGroup"> + <annotations> + <description>Requires navigation to subcategory creation/edit. Updates the Search Engine Optimization.</description> + </annotations> + <arguments> + <argument name="value" type="string"/> + </arguments> + + <click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="openSeoSection"/> + <uncheckOption selector="{{AdminCategorySEOSection.UrlKeyDefaultValueCheckbox}}" stepKey="uncheckDefaultValue"/> + <fillField selector="{{AdminCategorySEOSection.UrlKeyInput}}" userInput="{{value}}" stepKey="enterURLKey"/> + <click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategory"/> + <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="assertSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ChangeStatusProductUsingProductGridActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ChangeStatusProductUsingProductGridActionGroup.xml new file mode 100644 index 0000000000000..b8e8556f53813 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ChangeStatusProductUsingProductGridActionGroup.xml @@ -0,0 +1,38 @@ +<?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="ChangeStatusProductUsingProductGridActionGroup"> + <annotations> + <description>Goes to the Admin Products grid page. Changes the Product Status to the provided Status. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="status" defaultValue="Enable" type="string"/> + </arguments> + + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> + <waitForPageLoad time="60" stepKey="waitForPageLoadInitial"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <see selector="{{AdminProductGridSection.productGridCell('1', 'SKU')}}" userInput="{{product.sku}}" stepKey="seeProductSkuInGrid"/> + <click selector="{{AdminProductGridSection.multicheckDropdown}}" stepKey="openMulticheckDropdown"/> + <click selector="{{AdminProductGridSection.multicheckOption('Select All')}}" stepKey="selectAllProductInFilteredGrid"/> + + <click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickActionDropdown"/> + <click selector="{{AdminProductGridSection.bulkActionOption('Change status')}}" stepKey="clickChangeStatusAction"/> + <click selector="{{AdminProductGridSection.changeStatus('status')}}" stepKey="clickChangeStatusDisabled"/> + <waitForPageLoad stepKey="waitForStatusToBeChanged"/> + <see selector="{{AdminMessagesSection.success}}" userInput="A total of 1 record(s) have been updated." stepKey="seeSuccessMessage"/> + <waitForLoadingMaskToDisappear stepKey="waitForMaskToDisappear"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial2"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ChangeUseForPromoRuleConditionsProductAttributeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ChangeUseForPromoRuleConditionsProductAttributeActionGroup.xml new file mode 100644 index 0000000000000..5282fe2740fc7 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ChangeUseForPromoRuleConditionsProductAttributeActionGroup.xml @@ -0,0 +1,25 @@ +<?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="ChangeUseForPromoRuleConditionsProductAttributeActionGroup"> + <annotations> + <description>Select the provided value for the 'Use for Promo Rule Conditions' dropdown menu. Clicks on Save. Validates that the Save message is present.</description> + </annotations> + <arguments> + <argument name="option" type="string"/> + </arguments> + + <click selector="{{StorefrontPropertiesSection.StoreFrontPropertiesTab}}" stepKey="clickStoreFrontPropertiesTab"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <selectOption selector="{{StorefrontPropertiesSection.useForPromoRuleConditions}}" userInput="{{option}}" stepKey="changeOption"/> + <click selector="{{AttributePropertiesSection.Save}}" stepKey="saveAttribute"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You saved the product attribute." stepKey="successMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckAttributeInMoreInformationTabActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckAttributeInMoreInformationTabActionGroup.xml new file mode 100644 index 0000000000000..548d7de79d599 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckAttributeInMoreInformationTabActionGroup.xml @@ -0,0 +1,24 @@ +<?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="CheckAttributeInMoreInformationTabActionGroup"> + <annotations> + <description>Validates that the Product More Information area contains the provided Text.</description> + </annotations> + <arguments> + <argument name="attributeLabel" type="string"/> + <argument name="attributeValue" type="string"/> + </arguments> + + <click selector="{{StorefrontProductMoreInformationSection.moreInformation}}" stepKey="clickTab"/> + <see userInput="{{attributeLabel}}" selector="{{StorefrontProductMoreInformationSection.moreInformationTextArea}}" stepKey="seeAttributeLabel"/> + <see userInput="{{attributeValue}}" selector="{{StorefrontProductMoreInformationSection.moreInformationTextArea}}" stepKey="seeAttributeValue"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckAttributeNotInMoreInformationTabActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckAttributeNotInMoreInformationTabActionGroup.xml new file mode 100644 index 0000000000000..a6d744ebe92be --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckAttributeNotInMoreInformationTabActionGroup.xml @@ -0,0 +1,22 @@ +<?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="CheckAttributeNotInMoreInformationTabActionGroup"> + <annotations> + <description>Validate that the More Information area does not contain the provided Text.</description> + </annotations> + <arguments> + <argument name="attributeLabel" type="string"/> + </arguments> + + <click selector="{{StorefrontProductMoreInformationSection.moreInformation}}" stepKey="clickTab"/> + <dontSee userInput="{{attributeLabel}}" selector="{{StorefrontProductMoreInformationSection.moreInformationTextArea}}" stepKey="seeAttributeLabel"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckCategoryImageInAdminActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckCategoryImageInAdminActionGroup.xml new file mode 100644 index 0000000000000..fd01d4db5babb --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckCategoryImageInAdminActionGroup.xml @@ -0,0 +1,28 @@ +<?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="CheckCategoryImageInAdminActionGroup"> + <annotations> + <description>Requires navigation to the Category creation/edit page. Click on the Upload button. Validates that the Image exists.</description> + </annotations> + <arguments> + <argument name="image" defaultValue="ProductImage"/> + </arguments> + + <conditionalClick selector="{{AdminCategoryContentSection.sectionHeader}}" dependentSelector="{{AdminCategoryContentSection.uploadButton}}" visible="false" stepKey="openContentSection"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <waitForElementVisible selector="{{AdminCategoryContentSection.uploadButton}}" stepKey="seeImageSectionIsReady"/> + <grabTextFrom selector="{{AdminCategoryContentSection.imageFileName}}" stepKey="grabCategoryFileName"/> + <assertRegExp stepKey="assertEquals" message="pass"> + <expectedResult type="string">/magento-logo(_[0-9]+)*?\.png$/</expectedResult> + <actualResult type="variable">grabCategoryFileName</actualResult> + </assertRegExp> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckCategoryNameIsRequiredFieldActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckCategoryNameIsRequiredFieldActionGroup.xml new file mode 100644 index 0000000000000..44e1951a0463b --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckCategoryNameIsRequiredFieldActionGroup.xml @@ -0,0 +1,23 @@ +<?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="CheckCategoryNameIsRequiredFieldActionGroup"> + <annotations> + <description>Navigates to category page, attempts to add subcategory without name. Expects required field prompt.</description> + </annotations> + + <seeInCurrentUrl url="{{AdminCategoryPage.url}}" stepKey="seeOnCategoryPage"/> + <click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategory"/> + <clearField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" stepKey="makeNameFieldEmpty"/> + <click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategory"/> + <seeInCurrentUrl url="{{AdminCategoryPage.url}}add" stepKey="seeBackOnCreateCategoryPage"/> + <see selector="{{AdminCategoryBasicFieldSection.FieldError('uid')}}" userInput="This is a required field." stepKey="seeErrorMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckCategoryOnStorefrontActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckCategoryOnStorefrontActionGroup.xml new file mode 100644 index 0000000000000..134b3897b5e02 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckCategoryOnStorefrontActionGroup.xml @@ -0,0 +1,24 @@ +<?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="CheckCategoryOnStorefrontActionGroup"> + <annotations> + <description>Navigates to the category page on the storefront and asserts that the title is correct for page and browser.</description> + </annotations> + <arguments> + <argument name="categoryEntity" defaultValue="_defaultCategory"/> + </arguments> + + <amOnPage url="/{{categoryEntity.name_lwr}}.html" stepKey="goToCategoryFrontPage"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <see selector="{{StorefrontCategoryMainSection.CategoryTitle}}" userInput="{{categoryEntity.name_lwr}}" stepKey="assertCategoryOnStorefront"/> + <seeInTitle userInput="{{categoryEntity.name}}" stepKey="seeCategoryNameInTitle"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckCustomizableOptionImportActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckCustomizableOptionImportActionGroup.xml new file mode 100644 index 0000000000000..efd0986efca06 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckCustomizableOptionImportActionGroup.xml @@ -0,0 +1,27 @@ +<?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="CheckCustomizableOptionImportActionGroup"> + <annotations> + <description>Validate that the Custom Product Option Import value is present and correct.</description> + </annotations> + <arguments> + <argument name="option" defaultValue="ProductOptionField"/> + <argument name="optionIndex" type="string"/> + </arguments> + + <grabValueFrom selector="{{AdminProductCustomizableOptionsSection.optionTitleInput(optionIndex)}}" stepKey="grabOptionTitle"/> + <grabValueFrom selector="{{AdminProductCustomizableOptionsSection.optionPrice(optionIndex)}}" stepKey="grabOptionPrice"/> + <grabValueFrom selector="{{AdminProductCustomizableOptionsSection.optionSku(optionIndex)}}" stepKey="grabOptionSku"/> + <assertEquals expected="{{option.title}}" expectedType="string" actual="$grabOptionTitle" stepKey="assertOptionTitle"/> + <assertEquals expected="{{option.price}}" expectedType="string" actual="$grabOptionPrice" stepKey="assertOptionPrice"/> + <assertEquals expected="{{option.title}}" expectedType="string" actual="$grabOptionSku" stepKey="assertOptionSku"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckRequiredFieldsInProductFormActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckRequiredFieldsInProductFormActionGroup.xml new file mode 100644 index 0000000000000..6aaa66dc70803 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckRequiredFieldsInProductFormActionGroup.xml @@ -0,0 +1,25 @@ +<?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="CheckRequiredFieldsInProductFormActionGroup"> + <annotations> + <description>Validates that the 'Required Field' error message is present and correct for the Product Name, SKU and Price fields.</description> + </annotations> + + <clearField selector="{{AdminProductFormSection.productName}}" stepKey="clearProductName"/> + <clearField selector="{{AdminProductFormSection.productSku}}" stepKey="clearProductSku"/> + <clearField selector="{{AdminProductFormSection.productPrice}}" stepKey="clearProductPrice"/> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Product" stepKey="seeStillOnEditPage"/> + <see selector="{{AdminProductFormSection.fieldError('name')}}" userInput="This is a required field." stepKey="seeNameRequired"/> + <see selector="{{AdminProductFormSection.fieldError('sku')}}" userInput="This is a required field." stepKey="seeSkuRequired"/> + <see selector="{{AdminProductFormSection.priceFieldError}}" userInput="This is a required field." stepKey="seePriceRequired"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ClearProductsFilterActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ClearProductsFilterActionGroup.xml new file mode 100644 index 0000000000000..46960b5e25d51 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ClearProductsFilterActionGroup.xml @@ -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="ClearProductsFilterActionGroup"> + <annotations> + <description>Goto the Product grid page. Clear the Search Filters for the grid.</description> + </annotations> + + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> + <waitForPageLoad time="30" stepKey="waitForProductsPageToLoad"/> + <conditionalClick selector="{{AdminProductFiltersSection.clearFiltersButton}}" dependentSelector="{{AdminProductFiltersSection.clearFiltersButton}}" visible="true" stepKey="cleanFiltersIfTheySet"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ConfirmChangeInputTypeModalActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ConfirmChangeInputTypeModalActionGroup.xml new file mode 100644 index 0000000000000..d207073a01fc0 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ConfirmChangeInputTypeModalActionGroup.xml @@ -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="ConfirmChangeInputTypeModalActionGroup"> + <annotations> + <description>Clicks on the Confirm button for the 'Product Data My Be Lost' modal.</description> + </annotations> + + <waitForElementVisible selector="{{AdminEditProductAttributesSection.ProductDataMayBeLostConfirmButton}}" stepKey="waitForChangeInputTypeButton"/> + <click selector="{{AdminEditProductAttributesSection.ProductDataMayBeLostConfirmButton}}" stepKey="clickChangeInputTypeButton"/> + <waitForElementNotVisible selector="{{AdminEditProductAttributesSection.ProductDataMayBeLostModal}}" stepKey="waitForChangeInputTypeModalGone"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateAttributeDropdownNthOptionActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateAttributeDropdownNthOptionActionGroup.xml new file mode 100644 index 0000000000000..2bf79ca980a44 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateAttributeDropdownNthOptionActionGroup.xml @@ -0,0 +1,26 @@ +<?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="CreateAttributeDropdownNthOptionActionGroup"> + <annotations> + <description>Creates an Option for a Product Attribute (Attribute Type: Dropdown).</description> + </annotations> + <arguments> + <argument name="row" type="string"/> + <argument name="adminName" type="string"/> + <argument name="frontName" type="string"/> + </arguments> + + <click stepKey="clickAddOptions" selector="{{AttributePropertiesSection.dropdownAddOptions}}"/> + <waitForPageLoad stepKey="waitForNewOption"/> + <fillField stepKey="fillAdmin" selector="{{AttributePropertiesSection.dropdownNthOptionAdmin(row)}}" userInput="{{adminName}}"/> + <fillField stepKey="fillStoreView" selector="{{AttributePropertiesSection.dropdownNthOptionDefaultStoreView(row)}}" userInput="{{frontName}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateAttributeDropdownNthOptionAsDefaultActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateAttributeDropdownNthOptionAsDefaultActionGroup.xml new file mode 100644 index 0000000000000..e9e8a98ac86a6 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateAttributeDropdownNthOptionAsDefaultActionGroup.xml @@ -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="CreateAttributeDropdownNthOptionAsDefaultActionGroup" extends="CreateAttributeDropdownNthOptionActionGroup"> + <annotations> + <description>EXTENDS: createAttributeDropdownNthOption. Checks the 'Is Default' option.</description> + </annotations> + + <checkOption selector="{{AttributePropertiesSection.dropdownNthOptionIsDefault(row)}}" stepKey="setAsDefault" after="fillStoreView"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateCategoryActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateCategoryActionGroup.xml new file mode 100644 index 0000000000000..660b475c02ab0 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateCategoryActionGroup.xml @@ -0,0 +1,30 @@ +<?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="CreateCategoryActionGroup"> + <annotations> + <description>Requires navigation to the Category creation page. Adds a new Subcategory. Validates that the Category was created.</description> + </annotations> + <arguments> + <argument name="categoryEntity" defaultValue="_defaultCategory"/> + </arguments> + + <seeInCurrentUrl url="{{AdminCategoryPage.url}}" stepKey="seeOnCategoryPage"/> + <click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategory"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Category" stepKey="seeCategoryPageTitle"/> + <fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{categoryEntity.name}}" stepKey="enterCategoryName"/> + <click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="openSEO"/> + <fillField selector="{{AdminCategorySEOSection.UrlKeyInput}}" userInput="{{categoryEntity.name_lwr}}" stepKey="enterURLKey"/> + <click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategory"/> + <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="assertSuccess"/> + <seeInTitle userInput="{{categoryEntity.name}}" stepKey="seeNewCategoryPageTitle"/> + <seeElement selector="{{AdminCategorySidebarTreeSection.categoryInTree(categoryEntity.name)}}" stepKey="seeCategoryInTree"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateCustomRadioOptionsActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateCustomRadioOptionsActionGroup.xml new file mode 100644 index 0000000000000..8ac87a30afbf6 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateCustomRadioOptionsActionGroup.xml @@ -0,0 +1,43 @@ +<?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="CreateCustomRadioOptionsActionGroup"> + <annotations> + <description>Adds a custom Radio Product Option with 3 Radio Options to a Product based on the provided Options.</description> + </annotations> + <!-- ActionGroup will add a single custom option to a product --> + <!-- You must already be on the product creation page --> + <arguments> + <argument name="customOptionName"/> + <argument name="productOption"/> + <argument name="productOption2"/> + </arguments> + + <click stepKey="clickAddOptions" selector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}"/> + <waitForPageLoad stepKey="waitForAddProductPageLoad"/> + + <!-- Fill in the option and select the type of radio (once) --> + <fillField stepKey="fillInOptionTitle" selector="{{AdminProductCustomizableOptionsSection.lastOptionTitle}}" userInput="{{customOptionName}}"/> + <click stepKey="clickOptionTypeParent" selector="{{AdminProductCustomizableOptionsSection.lastOptionTypeParent}}"/> + <waitForPageLoad stepKey="waitForDropdownOpen"/> + <click stepKey="clickOptionType" selector="{{AdminProductCustomizableOptionsSection.optionType('Radio Buttons')}}"/> + + <!-- Add three radio options based on the parameter --> + <click stepKey="clickAddValue" selector="{{AdminProductCustomizableOptionsSection.addValue}}"/> + + <fillField stepKey="fillInValueTitle" selector="{{AdminProductCustomizableOptionsSection.valueTitle}}" userInput="{{productOption.title}}"/> + <fillField stepKey="fillInValuePrice" selector="{{AdminProductCustomizableOptionsSection.valuePrice}}" userInput="{{productOption.price}}"/> + + <click stepKey="clickAddValue2" selector="{{AdminProductCustomizableOptionsSection.addValue}}"/> + + <fillField stepKey="fillInValueTitle2" selector="{{AdminProductCustomizableOptionsSection.valueTitle}}" userInput="{{productOption2.title}}"/> + <fillField stepKey="fillInValuePrice2" selector="{{AdminProductCustomizableOptionsSection.valuePrice}}" userInput="{{productOption2.price}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateDefaultAttributeSetActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateDefaultAttributeSetActionGroup.xml new file mode 100644 index 0000000000000..8b95a77465b01 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateDefaultAttributeSetActionGroup.xml @@ -0,0 +1,25 @@ +<?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="CreateDefaultAttributeSetActionGroup"> + <annotations> + <description>Goes to the Attribute Sets grid page. Clicks on Add. Fill Name. Clicks on Save.</description> + </annotations> + <arguments> + <argument name="label" type="string"/> + </arguments> + + <amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSets"/> + <waitForPageLoad stepKey="wait1"/> + <click selector="{{AdminProductAttributeSetGridSection.addAttributeSetBtn}}" stepKey="clickAddAttributeSet"/> + <fillField selector="{{AdminProductAttributeSetSection.name}}" userInput="{{label}}" stepKey="fillName"/> + <click selector="{{AdminProductAttributeSetSection.saveBtn}}" stepKey="clickSave1"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeActionGroup.xml new file mode 100644 index 0000000000000..0a0c95fdb33cc --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeActionGroup.xml @@ -0,0 +1,25 @@ +<?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="CreateProductAttributeActionGroup"> + <annotations> + <description>Clicks on 'Add New Attribute'. Fills in the Attribute Details (Label, Input Type and Value Required). Clicks on Save.</description> + </annotations> + <arguments> + <argument name="attribute" type="entity" defaultValue="productAttributeWysiwyg"/> + </arguments> + + <click stepKey="createNewAttribute" selector="{{AdminProductAttributeGridSection.createNewAttributeBtn}}"/> + <fillField stepKey="fillDefaultLabel" selector="{{AttributePropertiesSection.DefaultLabel}}" userInput="{{attribute.attribute_code}}"/> + <selectOption selector="{{AttributePropertiesSection.InputType}}" stepKey="checkInputType" userInput="{{attribute.frontend_input}}"/> + <selectOption selector="{{AttributePropertiesSection.ValueRequired}}" stepKey="checkRequired" userInput="{{attribute.is_required_admin}}"/> + <click stepKey="saveAttribute" selector="{{AttributePropertiesSection.Save}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeWithDateFieldActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeWithDateFieldActionGroup.xml new file mode 100644 index 0000000000000..13b1bca0ad40b --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeWithDateFieldActionGroup.xml @@ -0,0 +1,23 @@ +<?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="CreateProductAttributeWithDateFieldActionGroup" extends="CreateProductAttributeActionGroup" insertAfter="checkRequired"> + <annotations> + <description>EXTENDS: createProductAttribute. Fills in the Attribute Code and Default Value (Attribute Type: Date Field).</description> + </annotations> + <arguments> + <argument name="date" type="string"/> + </arguments> + + <click stepKey="openAdvancedProperties" selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}"/> + <fillField stepKey="fillCode" selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" userInput="{{attribute.attribute_code}}"/> + <fillField stepKey="fillDefaultValue" selector="{{AdvancedAttributePropertiesSection.DefaultValueDate}}" userInput="{{date}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeWithTextFieldActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeWithTextFieldActionGroup.xml new file mode 100644 index 0000000000000..fccb8ad2413f8 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeWithTextFieldActionGroup.xml @@ -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="CreateProductAttributeWithTextFieldActionGroup" extends="CreateProductAttributeActionGroup" insertAfter="checkRequired"> + <annotations> + <description>EXTENDS: createProductAttribute. Fills in the Attribute Code and Default Value (Attribute Type: Text Field).</description> + </annotations> + + <click stepKey="openAdvancedProperties" selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}"/> + <fillField stepKey="fillCode" selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" userInput="{{attribute.attribute_code}}"/> + <fillField stepKey="fillDefaultValue" selector="{{AdvancedAttributePropertiesSection.DefaultValueText}}" userInput="{{attribute.default_value}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateSimpleProductAndAddToWebsiteActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateSimpleProductAndAddToWebsiteActionGroup.xml new file mode 100644 index 0000000000000..97c7072abe42f --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateSimpleProductAndAddToWebsiteActionGroup.xml @@ -0,0 +1,34 @@ +<?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="CreateSimpleProductAndAddToWebsiteActionGroup"> + <annotations> + <description>Goes to the Admin Product grid page. Clicks on Add Product. Fills the provided Product Details (Name, SKU, Price, Quantity and Website). Clicks on Save.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="website" type="string"/> + </arguments> + + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToCatalogProductGrid"/> + <waitForPageLoad stepKey="waitForProductGrid"/> + <click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductDropdown"/> + <click selector="{{AdminProductGridActionSection.addSimpleProduct}}" stepKey="clickAddSimpleProduct"/> + <fillField userInput="{{product.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillProductName"/> + <fillField userInput="{{product.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="fillProductSKU"/> + <fillField userInput="{{product.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="fillProductPrice"/> + <fillField userInput="{{product.quantity}}" selector="{{AdminProductFormSection.productQuantity}}" stepKey="fillProductQuantity"/> + <click selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="openProductInWebsites"/> + <click selector="{{ProductInWebsitesSection.website(website)}}" stepKey="selectWebsite"/> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSave"/> + <waitForLoadingMaskToDisappear stepKey="waitForProductPageSave"/> + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreatedProductConnectToWebsiteActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreatedProductConnectToWebsiteActionGroup.xml new file mode 100644 index 0000000000000..d605aa1910134 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreatedProductConnectToWebsiteActionGroup.xml @@ -0,0 +1,29 @@ +<?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="CreatedProductConnectToWebsiteActionGroup"> + <annotations> + <description>Clicks on 'Edit' for the provided Product. Clicks on the provided Website. Clicks on Save.</description> + </annotations> + <arguments> + <argument name="website"/> + <argument name="product"/> + </arguments> + + <click stepKey="openProduct" selector="{{AdminProductGridActionSection.productName(product.sku)}}"/> + <waitForPageLoad stepKey="waitForProductPage"/> + <scrollTo selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="ScrollToWebsites"/> + <click selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="openWebsitesList"/> + <waitForPageLoad stepKey="waitForWebsitesList"/> + <click selector="{{ProductInWebsitesSection.website(website.name)}}" stepKey="SelectWebsite"/> + <click selector="{{AdminProductFormAdvancedPricingSection.save}}" stepKey="clickSaveProduct"/> + <waitForPageLoad stepKey="waitForSave"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CustomOptionsActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CustomOptionsActionGroup.xml deleted file mode 100644 index 753f06cd75e3e..0000000000000 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CustomOptionsActionGroup.xml +++ /dev/null @@ -1,172 +0,0 @@ -<?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="CreateCustomRadioOptions"> - <annotations> - <description>Adds a custom Radio Product Option with 3 Radio Options to a Product based on the provided Options.</description> - </annotations> - <!-- ActionGroup will add a single custom option to a product --> - <!-- You must already be on the product creation page --> - <arguments> - <argument name="customOptionName"/> - <argument name="productOption"/> - <argument name="productOption2"/> - </arguments> - - <click stepKey="clickAddOptions" selector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}"/> - <waitForPageLoad stepKey="waitForAddProductPageLoad"/> - - <!-- Fill in the option and select the type of radio (once) --> - <fillField stepKey="fillInOptionTitle" selector="{{AdminProductCustomizableOptionsSection.lastOptionTitle}}" userInput="{{customOptionName}}"/> - <click stepKey="clickOptionTypeParent" selector="{{AdminProductCustomizableOptionsSection.lastOptionTypeParent}}"/> - <waitForPageLoad stepKey="waitForDropdownOpen"/> - <click stepKey="clickOptionType" selector="{{AdminProductCustomizableOptionsSection.optionType('Radio Buttons')}}"/> - - <!-- Add three radio options based on the parameter --> - <click stepKey="clickAddValue" selector="{{AdminProductCustomizableOptionsSection.addValue}}"/> - - <fillField stepKey="fillInValueTitle" selector="{{AdminProductCustomizableOptionsSection.valueTitle}}" userInput="{{productOption.title}}"/> - <fillField stepKey="fillInValuePrice" selector="{{AdminProductCustomizableOptionsSection.valuePrice}}" userInput="{{productOption.price}}"/> - - <click stepKey="clickAddValue2" selector="{{AdminProductCustomizableOptionsSection.addValue}}"/> - - <fillField stepKey="fillInValueTitle2" selector="{{AdminProductCustomizableOptionsSection.valueTitle}}" userInput="{{productOption2.title}}"/> - <fillField stepKey="fillInValuePrice2" selector="{{AdminProductCustomizableOptionsSection.valuePrice}}" userInput="{{productOption2.price}}"/> - </actionGroup> - - <!--Add a custom option of type "file" to a product--> - <actionGroup name="AddProductCustomOptionFile"> - <annotations> - <description>Add a custom File Product Option to a Product based on the provided File.</description> - </annotations> - <arguments> - <argument name="option" defaultValue="ProductOptionFile"/> - </arguments> - - <conditionalClick selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" dependentSelector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" visible="false" stepKey="openCustomOptionSection"/> - <click selector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" stepKey="clickAddOption"/> - <waitForElementVisible selector="{{AdminProductCustomizableOptionsSection.lastOptionTitle}}" stepKey="waitForOption"/> - <fillField selector="{{AdminProductCustomizableOptionsSection.lastOptionTitle}}" userInput="{{option.title}}" stepKey="fillTitle"/> - <click selector="{{AdminProductCustomizableOptionsSection.lastOptionTypeParent}}" stepKey="openTypeSelect"/> - <click selector="{{AdminProductCustomizableOptionsSection.optionType('File')}}" stepKey="selectTypeFile"/> - <waitForElementVisible selector="{{AdminProductCustomizableOptionsSection.optionPriceByTitle(option.title)}}" stepKey="waitForElements"/> - <fillField selector="{{AdminProductCustomizableOptionsSection.optionPriceByTitle(option.title)}}" userInput="{{option.price}}" stepKey="fillPrice"/> - <selectOption selector="{{AdminProductCustomizableOptionsSection.optionPriceTypeByTitle(option.title)}}" userInput="{{option.price_type}}" stepKey="selectPriceType"/> - <fillField selector="{{AdminProductCustomizableOptionsSection.optionFileExtensionByTitle(option.title)}}" userInput="{{option.file_extension}}" stepKey="fillCompatibleExtensions"/> - </actionGroup> - - <actionGroup name="AddProductCustomOptionField"> - <annotations> - <description>Add a custom Field Product Option to a Product based on the provided Option.</description> - </annotations> - <arguments> - <argument name="option" defaultValue="ProductOptionField"/> - </arguments> - - <scrollTo selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" stepKey="scrollToAddButtonOption"/> - <conditionalClick selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" dependentSelector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" visible="false" stepKey="openCustomOptionSection"/> - <click selector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" stepKey="clickAddOption"/> - <waitForElementVisible selector="{{AdminProductCustomizableOptionsSection.lastOptionTitle}}" stepKey="waitForOption"/> - <fillField selector="{{AdminProductCustomizableOptionsSection.lastOptionTitle}}" userInput="{{option.title}}" stepKey="fillTitle"/> - <click selector="{{AdminProductCustomizableOptionsSection.lastOptionTypeParent}}" stepKey="openTypeSelect"/> - <click selector="{{AdminProductCustomizableOptionsSection.optionType('Field')}}" stepKey="selectTypeFile"/> - <waitForElementVisible selector="{{AdminProductCustomizableOptionsSection.optionPriceByTitle(option.title)}}" stepKey="waitForElements"/> - <fillField selector="{{AdminProductCustomizableOptionsSection.optionPriceByTitle(option.title)}}" userInput="{{option.price}}" stepKey="fillPrice"/> - <selectOption selector="{{AdminProductCustomizableOptionsSection.optionPriceTypeByTitle(option.title)}}" userInput="{{option.price_type}}" stepKey="selectPriceType"/> - <fillField selector="{{AdminProductCustomizableOptionsSection.optionSkuByTitle(option.title)}}" userInput="{{option.title}}" stepKey="fillSku"/> - </actionGroup> - - <actionGroup name="importProductCustomizableOptions"> - <annotations> - <description>Import custom Product Options for the provided Product Name.</description> - </annotations> - <arguments> - <argument name="productName" type="string"/> - </arguments> - - <click selector="{{AdminProductCustomizableOptionsSection.importOptions}}" stepKey="clickImportOptions"/> - <waitForElementVisible selector="{{AdminProductImportOptionsSection.selectProductTitle}}" stepKey="waitForTitleVisible"/> - <conditionalClick selector="{{AdminProductImportOptionsSection.resetFiltersButton}}" dependentSelector="{{AdminProductImportOptionsSection.resetFiltersButton}}" visible="true" stepKey="clickResetFilters"/> - <click selector="{{AdminProductImportOptionsSection.filterButton}}" stepKey="clickFilterButton"/> - <waitForElementVisible selector="{{AdminProductImportOptionsSection.nameField}}" stepKey="waitForNameField"/> - <fillField selector="{{AdminProductImportOptionsSection.nameField}}" userInput="{{productName}}" stepKey="fillProductName"/> - <click selector="{{AdminProductImportOptionsSection.applyFiltersButton}}" stepKey="clickApplyFilters"/> - <checkOption selector="{{AdminProductImportOptionsSection.firstRowItemCheckbox}}" stepKey="checkProductCheckbox"/> - <click selector="{{AdminProductImportOptionsSection.importButton}}" stepKey="clickImport"/> - </actionGroup> - - <actionGroup name="resetImportOptionFilter"> - <annotations> - <description>Click on the Reset Filters button for the Import Options filters on the Product grid page.</description> - </annotations> - - <conditionalClick selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" dependentSelector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" visible="false" stepKey="openCustomOptionSection"/> - <click selector="{{AdminProductCustomizableOptionsSection.importOptions}}" stepKey="clickImportOptions"/> - <click selector="{{AdminProductImportOptionsSection.resetFiltersButton}}" stepKey="clickResetFilterButton"/> - </actionGroup> - - <actionGroup name="checkCustomizableOptionImport"> - <annotations> - <description>Validate that the Custom Product Option Import value is present and correct.</description> - </annotations> - <arguments> - <argument name="option" defaultValue="ProductOptionField"/> - <argument name="optionIndex" type="string"/> - </arguments> - - <grabValueFrom selector="{{AdminProductCustomizableOptionsSection.optionTitleInput(optionIndex)}}" stepKey="grabOptionTitle"/> - <grabValueFrom selector="{{AdminProductCustomizableOptionsSection.optionPrice(optionIndex)}}" stepKey="grabOptionPrice"/> - <grabValueFrom selector="{{AdminProductCustomizableOptionsSection.optionSku(optionIndex)}}" stepKey="grabOptionSku"/> - <assertEquals expected="{{option.title}}" expectedType="string" actual="$grabOptionTitle" stepKey="assertOptionTitle"/> - <assertEquals expected="{{option.price}}" expectedType="string" actual="$grabOptionPrice" stepKey="assertOptionPrice"/> - <assertEquals expected="{{option.title}}" expectedType="string" actual="$grabOptionSku" stepKey="assertOptionSku"/> - </actionGroup> - <!-- Assumes we are on product edit page --> - <actionGroup name="AdminDeleteAllProductCustomOptions"> - <conditionalClick selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" dependentSelector="{{AdminProductCustomizableOptionsSection.checkIfCustomizableOptionsTabOpen}}" visible="true" stepKey="expandContentTab"/> - <waitForPageLoad time="10" stepKey="waitCustomizableOptionsTabOpened"/> - <executeInSelenium function="function($webdriver) use ($I) { - $buttons = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::cssSelector('[data-index=\'options\'] [data-index=\'delete_button\']')); - while(!empty($buttons)) { - $button = reset($buttons); - $I->executeJS('arguments[0].scrollIntoView(false)', [$button]); - $button->click(); - $webdriver->wait()->until(\Facebook\WebDriver\WebDriverExpectedCondition::stalenessOf($button)); - $buttons = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::cssSelector('[data-index=\'options\'] [data-index=\'delete_button\']')); - } - }" stepKey="deleteCustomOptions"/> - <dontSeeElement selector="{{AdminProductCustomizableOptionsSection.customOptionButtonDelete}}" stepKey="assertNoCustomOptions"/> - </actionGroup> - <!-- Assumes we are on product edit page --> - <actionGroup name="AdminAssertProductHasNoCustomOptions"> - <conditionalClick selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" dependentSelector="{{AdminProductCustomizableOptionsSection.checkIfCustomizableOptionsTabOpen}}" visible="true" stepKey="expandContentTab"/> - <waitForPageLoad time="10" stepKey="waitCustomizableOptionsTabOpened"/> - <dontSeeElement selector="{{AdminProductCustomizableOptionsSection.customOption}}" stepKey="assertNoCustomOptions"/> - </actionGroup> - <!-- Assumes we are on product edit page --> - <actionGroup name="AdminAssertProductHasNoCustomOption" extends="AdminAssertProductCustomOptionVisible"> - <remove keyForRemoval="assertCustomOptionVisible"/> - <dontSeeElement selector="{{AdminProductCustomizableOptionsSection.fillOptionTitle(option.title)}}" after="waitCustomizableOptionsTabOpened" stepKey="assertNoCustomOption"/> - </actionGroup> - <!-- Assumes we are on product edit page --> - <actionGroup name="AdminAssertProductCustomOptionVisible"> - <arguments> - <argument name="option" defaultValue="ProductOptionField"/> - </arguments> - <conditionalClick selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" dependentSelector="{{AdminProductCustomizableOptionsSection.checkIfCustomizableOptionsTabOpen}}" visible="true" stepKey="expandContentTab"/> - <waitForPageLoad time="10" stepKey="waitCustomizableOptionsTabOpened"/> - <seeElement selector="{{AdminProductCustomizableOptionsSection.fillOptionTitle(option.title)}}" stepKey="assertCustomOptionVisible"/> - </actionGroup> - <!-- Assumes we are on product edit page --> - <actionGroup name="AdminDeleteProductCustomOption" extends="AdminAssertProductCustomOptionVisible"> - <remove keyForRemoval="assertCustomOptionVisible"/> - <click selector="{{AdminProductCustomizableOptionsSection.deleteCustomOptions(option.title)}}" after="waitCustomizableOptionsTabOpened" stepKey="clickDeleteCustomOption"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteAllDuplicateProductUsingProductGridActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteAllDuplicateProductUsingProductGridActionGroup.xml new file mode 100644 index 0000000000000..8dabf2037bf39 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteAllDuplicateProductUsingProductGridActionGroup.xml @@ -0,0 +1,21 @@ +<?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="DeleteAllDuplicateProductUsingProductGridActionGroup" extends="DeleteProductUsingProductGridActionGroup"> + <annotations> + <description>EXTENDS: deleteProductUsingProductGrid. Removes 'seeProductSkuInGrid'.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <remove keyForRemoval="seeProductSkuInGrid"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteAllProductsUsingProductGridActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteAllProductsUsingProductGridActionGroup.xml new file mode 100644 index 0000000000000..3609d992a9f0b --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteAllProductsUsingProductGridActionGroup.xml @@ -0,0 +1,29 @@ +<?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="DeleteAllProductsUsingProductGridActionGroup"> + <annotations> + <description>Deletes all products in Admin Products grid page.</description> + </annotations> + + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="openAdminGridProductsPage"/> + <waitForPageLoad time="60" stepKey="waitForPageFullyLoad"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clearGridFilters"/> + + <conditionalClick selector="{{AdminProductGridSection.multicheckDropdown}}" dependentSelector="{{AdminDataGridTableSection.dataGridEmpty}}" visible="false" stepKey="openMulticheckDropdown"/> + <conditionalClick selector="{{AdminProductGridSection.multicheckOption('Select All')}}" dependentSelector="{{AdminDataGridTableSection.dataGridEmpty}}" visible="false" stepKey="selectAllProductsInGrid"/> + <click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickActionDropdown"/> + <click selector="{{AdminProductGridSection.bulkActionOption('Delete')}}" stepKey="clickDeleteAction"/> + + <waitForElementVisible selector="{{AdminConfirmationModalSection.message}}" stepKey="waitForConfirmModal"/> + <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmDelete"/> + <waitForElementVisible selector="{{AdminDataGridTableSection.dataGridEmpty}}" stepKey="waitGridIsEmpty"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteAttributeSetByLabelActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteAttributeSetByLabelActionGroup.xml new file mode 100644 index 0000000000000..c0586367fcaf6 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteAttributeSetByLabelActionGroup.xml @@ -0,0 +1,30 @@ +<?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="DeleteAttributeSetByLabelActionGroup"> + <annotations> + <description>Deletes the provided Attribute Set Name from the Attribute Sets grid page.</description> + </annotations> + <arguments> + <argument name="label" type="string"/> + </arguments> + + <amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSets"/> + <waitForPageLoad stepKey="waitForAttributeSetPageLoad"/> + <fillField selector="{{AdminProductAttributeSetGridSection.filter}}" userInput="{{label}}" stepKey="filterByName"/> + <click selector="{{AdminProductAttributeSetGridSection.searchBtn}}" stepKey="clickSearch"/> + <click selector="{{AdminProductAttributeSetGridSection.nthRow('1')}}" stepKey="clickFirstRow"/> + <waitForPageLoad stepKey="waitForClick"/> + <click selector="{{AdminProductAttributeSetSection.deleteBtn}}" stepKey="clickDelete"/> + <click selector="{{AdminProductAttributeSetSection.modalOk}}" stepKey="confirmDelete"/> + <waitForPageLoad stepKey="waitForDeleteToFinish"/> + <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="The attribute set has been removed." stepKey="seeDeleteMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteCategoryActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteCategoryActionGroup.xml new file mode 100644 index 0000000000000..a84e92fcbb0f5 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteCategoryActionGroup.xml @@ -0,0 +1,31 @@ +<?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="DeleteCategoryActionGroup"> + <annotations> + <description>Navigates to the category page and deletes the specified category.</description> + </annotations> + <arguments> + <argument name="categoryEntity" defaultValue="_defaultCategory"/> + </arguments> + + <amOnPage url="{{AdminCategoryPage.url}}" stepKey="goToCategoryPage"/> + <waitForPageLoad time="60" stepKey="waitForCategoryPageLoad"/> + <click selector="{{AdminCategorySidebarTreeSection.categoryInTree(categoryEntity.name)}}" stepKey="clickCategoryLink"/> + <click selector="{{AdminCategoryMainActionsSection.DeleteButton}}" stepKey="clickDelete"/> + <waitForElementVisible selector="{{AdminCategoryModalSection.message}}" stepKey="waitForConfirmationModal"/> + <see selector="{{AdminCategoryModalSection.message}}" userInput="Are you sure you want to delete this category?" stepKey="seeDeleteConfirmationMessage"/> + <click selector="{{AdminCategoryModalSection.ok}}" stepKey="confirmDelete"/> + <waitForPageLoad time="60" stepKey="waitForDeleteToFinish"/> + <see selector="You deleted the category." stepKey="seeDeleteSuccess"/> + <click selector="{{AdminCategorySidebarTreeSection.expandAll}}" stepKey="expandToSeeAllCategories"/> + <dontSee selector="{{AdminCategorySidebarTreeSection.categoryInTree(categoryEntity.name)}}" stepKey="dontSeeCategoryInTree"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteDefaultCategoryChildrenActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteDefaultCategoryChildrenActionGroup.xml new file mode 100644 index 0000000000000..2fb4e0e05887a --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteDefaultCategoryChildrenActionGroup.xml @@ -0,0 +1,35 @@ +<?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="DeleteDefaultCategoryChildrenActionGroup"> + <annotations> + <description>Deletes all children categories of Default Root Category.</description> + </annotations> + + <amOnPage url="{{AdminCategoryPage.url}}" stepKey="navigateToAdminCategoryPage"/> + <executeInSelenium function="function ($webdriver) use ($I) { + $children = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::xpath('//ul[contains(@class, \'x-tree-node-ct\')]/li[@class=\'x-tree-node\' and contains(., + \'{{DefaultCategory.name}}\')]/ul[contains(@class, \'x-tree-node-ct\')]/li//a')); + while (!empty($children)) { + $I->click('//ul[contains(@class, \'x-tree-node-ct\')]/li[@class=\'x-tree-node\' and contains(., + \'{{DefaultCategory.name}}\')]/ul[contains(@class, \'x-tree-node-ct\')]/li//a'); + $I->waitForPageLoad(30); + $I->click('#delete'); + $I->waitForElementVisible('aside.confirm .modal-footer button.action-accept'); + $I->click('aside.confirm .modal-footer button.action-accept'); + $I->waitForPageLoad(30); + $I->waitForElementVisible('#messages div.message-success', 30); + $I->see('You deleted the category.', '#messages div.message-success'); + $children = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::xpath('//ul[contains(@class, \'x-tree-node-ct\')]/li[@class=\'x-tree-node\' and contains(., + \'{{DefaultCategory.name}}\')]/ul[contains(@class, \'x-tree-node-ct\')]/li//a')); + } + }" stepKey="deleteAllChildCategories"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteMostRecentCategoryActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteMostRecentCategoryActionGroup.xml new file mode 100644 index 0000000000000..8b47b6375c21c --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteMostRecentCategoryActionGroup.xml @@ -0,0 +1,25 @@ +<?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="DeleteMostRecentCategoryActionGroup"> + <annotations> + <description>Actions to delete the category last made (the last category on the list).</description> + </annotations> + + <amOnPage url="/{{AdminCategoryPage.url}}" stepKey="goToCategoryFrontPage"/> + <waitForPageLoad stepKey="waitForCategoryPageLoad"/> + <click stepKey="goToCreateCategory" selector="{{AdminCategorySidebarTreeSection.lastCreatedCategory}}"/> + <waitForPageLoad stepKey="waitForCreatedCategoryPageLoad"/> + <click stepKey="clickDeleteCategory" selector="{{AdminCategoryMainActionsSection.DeleteButton}}"/> + <waitForPageLoad stepKey="waitForModalVisible"/> + <click stepKey="clickOkToDelete" selector="{{AdminCategoryModalSection.ok}}"/> + <waitForPageLoad stepKey="waitForModalNotVisible"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeActionGroup.xml new file mode 100644 index 0000000000000..8ea0e43d0307f --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeActionGroup.xml @@ -0,0 +1,21 @@ +<?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="DeleteProductAttributeActionGroup" extends="NavigateToCreatedProductAttributeActionGroup"> + <annotations> + <description>EXTENDS: navigateToCreatedProductAttribute. Deletes the Product Attribute. Validates that the success message is present.</description> + </annotations> + + <click selector="{{AttributePropertiesSection.DeleteAttribute}}" stepKey="deleteAttribute"/> + <click selector="{{ModalConfirmationSection.OkButton}}" stepKey="ClickOnDeleteButton"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByAttributeCodeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByAttributeCodeActionGroup.xml index 66d4378872605..7fbf6a9b2a178 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByAttributeCodeActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByAttributeCodeActionGroup.xml @@ -10,15 +10,21 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="DeleteProductAttributeByAttributeCodeActionGroup"> <annotations> - <description>Delete a Product Attribute from the Product Attribute creation/edit page.</description> + <description>Goes to the Admin Product Attributes grid page. Filters the grid for the provided Product Attribute Code. Deletes the Product Attribute from the grid. Validates that the Success Message is present.</description> </annotations> <arguments> - <argument name="productAttributeCode" type="string"/> + <argument name="ProductAttributeCode" type="string"/> </arguments> - - <waitForPageLoad stepKey="waitForViewAdminProductAttributeLoad" time="30"/> + + <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> + <waitForPageLoad stepKey="waitForAttributeGridPageLoad"/> + <fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="{{ProductAttributeCode}}" stepKey="setAttributeCode"/> + <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/> + <click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="clickOnAttributeRow"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> <click selector="{{AttributePropertiesSection.DeleteAttribute}}" stepKey="deleteAttribute"/> - <click selector="{{ModalConfirmationSection.OkButton}}" stepKey="clickOnConfirmOk"/> - <waitForPageLoad stepKey="waitForViewProductAttributePageLoad"/> + <click selector="{{ModalConfirmationSection.OkButton}}" stepKey="ClickOnDeleteButton"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByLabelActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByLabelActionGroup.xml new file mode 100644 index 0000000000000..fb78909eab0b6 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByLabelActionGroup.xml @@ -0,0 +1,29 @@ +<?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="DeleteProductAttributeByLabelActionGroup"> + <annotations> + <description>Goes to the Admin Product Attributes grid page. Filters the grid for the provided Product Attribute (Label). Deletes the Product Attribute from the grid. Validates that the Success Message is present.</description> + </annotations> + <arguments> + <argument name="ProductAttribute"/> + </arguments> + + <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> + <fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="{{ProductAttribute.default_label}}" stepKey="setAttributeCode"/> + <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/> + <click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="clickOnAttributeRow"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <click selector="{{AttributePropertiesSection.DeleteAttribute}}" stepKey="deleteAttribute"/> + <click selector="{{ModalConfirmationSection.OkButton}}" stepKey="ClickOnDeleteButton"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductByNameActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductByNameActionGroup.xml new file mode 100644 index 0000000000000..0541a5ba67d30 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductByNameActionGroup.xml @@ -0,0 +1,25 @@ +<?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="DeleteProductByNameActionGroup" extends="DeleteProductBySkuActionGroup"> + <annotations> + <description>EXTENDS: deleteProductBySku. Deletes the provided Product Name.</description> + </annotations> + <arguments> + <argument name="sku" type="string" defaultValue=""/> + <argument name="name" type="string"/> + </arguments> + + <remove keyForRemoval="fillProductSkuFilter"/> + <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{name}}" stepKey="fillProductSkuFilter" after="openProductFilters"/> + <remove keyForRemoval="seeProductSkuInGrid"/> + <see selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="{{name}}" stepKey="seeProductNameInGrid" after="clickApplyFilters"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductBySkuActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductBySkuActionGroup.xml new file mode 100644 index 0000000000000..c1f22920ceb99 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductBySkuActionGroup.xml @@ -0,0 +1,34 @@ +<?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="DeleteProductBySkuActionGroup"> + <annotations> + <description>Goes to the Admin Products grid page. Deletes the provided Product SKU.</description> + </annotations> + <arguments> + <argument name="sku" type="string"/> + </arguments> + + <!--TODO use other action group for filtering grid when MQE-539 is implemented --> + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <see selector="{{AdminProductGridSection.productGridCell('1', 'SKU')}}" userInput="{{sku}}" stepKey="seeProductSkuInGrid"/> + <click selector="{{AdminProductGridSection.multicheckDropdown}}" stepKey="openMulticheckDropdown"/> + <click selector="{{AdminProductGridSection.multicheckOption('Select All')}}" stepKey="selectAllProductInFilteredGrid"/> + <click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickActionDropdown"/> + <click selector="{{AdminProductGridSection.bulkActionOption('Delete')}}" stepKey="clickDeleteAction"/> + <waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitForConfirmModal"/> + <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmProductDelete"/> + <see selector="{{AdminMessagesSection.success}}" userInput="record(s) have been deleted." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductUsingProductGridActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductUsingProductGridActionGroup.xml new file mode 100644 index 0000000000000..95ad1d743690e --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductUsingProductGridActionGroup.xml @@ -0,0 +1,35 @@ +<?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="DeleteProductUsingProductGridActionGroup"> + <annotations> + <description>Deletes the provided Product from the Admin Products grid page.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <!--TODO use other action group for filtering grid when MQE-539 is implemented --> + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> + <waitForPageLoad time="60" stepKey="waitForPageLoadInitial"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> + <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{product.name}}" stepKey="fillProductNameFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <see selector="{{AdminProductGridSection.productGridCell('1', 'SKU')}}" userInput="{{product.sku}}" stepKey="seeProductSkuInGrid"/> + <click selector="{{AdminProductGridSection.multicheckDropdown}}" stepKey="openMulticheckDropdown"/> + <click selector="{{AdminProductGridSection.multicheckOption('Select All')}}" stepKey="selectAllProductInFilteredGrid"/> + <click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickActionDropdown"/> + <click selector="{{AdminProductGridSection.bulkActionOption('Delete')}}" stepKey="clickDeleteAction"/> + <waitForElementVisible selector="{{AdminProductGridConfirmActionSection.title}}" stepKey="waitForConfirmModal"/> + <click selector="{{AdminProductGridConfirmActionSection.ok}}" stepKey="confirmProductDelete"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductsByKeywordActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductsByKeywordActionGroup.xml new file mode 100644 index 0000000000000..6b181d5f93be2 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductsByKeywordActionGroup.xml @@ -0,0 +1,31 @@ +<?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="DeleteProductsByKeywordActionGroup"> + <annotations> + <description>Delete products by keyword</description> + </annotations> + <arguments> + <argument name="keyword" type="string"/> + </arguments> + + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <fillField selector="{{AdminProductGridFilterSection.keywordSearch}}" userInput="{{keyword}}" stepKey="fillKeywordField"/> + <click selector="{{AdminProductGridFilterSection.keywordSearchButton}}" stepKey="keywordSearchButton"/> + <click selector="{{AdminProductGridSection.multicheckDropdown}}" stepKey="openMulticheckDropdown"/> + <click selector="{{AdminProductGridSection.multicheckOption('Select All')}}" stepKey="selectAllProductInFilteredGrid"/> + <click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickActionDropdown"/> + <click selector="{{AdminProductGridSection.bulkActionOption('Delete')}}" stepKey="clickDeleteAction"/> + <waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitForConfirmModal"/> + <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmProductDelete"/> + <see selector="{{AdminMessagesSection.success}}" userInput="record(s) have been deleted." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductsIfTheyExistActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductsIfTheyExistActionGroup.xml new file mode 100644 index 0000000000000..3ef0de8b27a65 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductsIfTheyExistActionGroup.xml @@ -0,0 +1,24 @@ +<?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="DeleteProductsIfTheyExistActionGroup"> + <annotations> + <description>Deletes all Products in the Admin Products grid.</description> + </annotations> + + <conditionalClick selector="{{AdminProductGridSection.multicheckDropdown}}" dependentSelector="{{AdminProductGridSection.firstProductRow}}" visible="true" stepKey="openMulticheckDropdown"/> + <conditionalClick selector="{{AdminProductGridSection.multicheckOption('Select All')}}" dependentSelector="{{AdminProductGridSection.firstProductRow}}" visible="true" stepKey="selectAllProductInFilteredGrid"/> + <click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickActionDropdown"/> + <click selector="{{AdminProductGridSection.bulkActionOption('Delete')}}" stepKey="clickDeleteAction"/> + <waitForElementVisible selector="{{AdminProductGridConfirmActionSection.ok}}" stepKey="waitForModalPopUp"/> + <click selector="{{AdminProductGridConfirmActionSection.ok}}" stepKey="confirmProductDelete"/> + <waitForPageLoad stepKey="waitForGridLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ExpandAdminProductSectionActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ExpandAdminProductSectionActionGroup.xml new file mode 100644 index 0000000000000..a181cce591e09 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ExpandAdminProductSectionActionGroup.xml @@ -0,0 +1,25 @@ +<?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="ExpandAdminProductSectionActionGroup"> + <annotations> + <description>Expand the provided Section Selector based on the provided dependant Section Selector.</description> + </annotations> + <arguments> + <argument name="sectionSelector" defaultValue="{{AdminProductContentSection.sectionHeader}}" type="string"/> + <argument name="sectionDependentSelector" defaultValue="{{AdminProductContentSection.sectionHeaderShow}}" type="string"/> + </arguments> + + <scrollToTopOfPage stepKey="scrollToTopOfPage"/> + <waitForElementVisible time="30" selector="{{sectionSelector}}" stepKey="waitForSection"/> + <conditionalClick selector="{{sectionSelector}}" dependentSelector="{{sectionDependentSelector}}" visible="false" stepKey="expandSection"/> + <waitForPageLoad time="30" stepKey="waitForSectionToExpand"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillAdminSimpleProductFormActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillAdminSimpleProductFormActionGroup.xml new file mode 100644 index 0000000000000..2abfc546e6bb3 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillAdminSimpleProductFormActionGroup.xml @@ -0,0 +1,38 @@ +<?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="FillAdminSimpleProductFormActionGroup"> + <annotations> + <description>Goes to the Admin Product grid page. Clicks on Add. Fills the provided Product details (Name, SKU, Price, Quantity, Category and URL). Clicks on Save. Validates that the Product details are present and correct.</description> + </annotations> + <arguments> + <argument name="category"/> + <argument name="simpleProduct"/> + </arguments> + + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> + <click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductDropdown"/> + <click selector="{{AdminProductGridActionSection.addSimpleProduct}}" stepKey="clickAddSimpleProduct"/> + <fillField userInput="{{simpleProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/> + <fillField userInput="{{simpleProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="fillSKU"/> + <fillField userInput="{{simpleProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="fillPrice"/> + <fillField userInput="{{simpleProduct.quantity}}" selector="{{AdminProductFormSection.productQuantity}}" stepKey="fillQuantity"/> + <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{category.name}}]" stepKey="searchAndSelectCategory"/> + <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/> + <fillField userInput="{{simpleProduct.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct"/> + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="assertSaveMessageSuccess"/> + <seeInField userInput="{{simpleProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="assertFieldName"/> + <seeInField userInput="{{simpleProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="assertFieldSku"/> + <seeInField userInput="{{simpleProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="assertFieldPrice"/> + <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSectionAssert"/> + <seeInField userInput="{{simpleProduct.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="assertFieldUrlKey"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillCategoryFormActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillCategoryFormActionGroup.xml new file mode 100644 index 0000000000000..37989ed9ddc44 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillCategoryFormActionGroup.xml @@ -0,0 +1,23 @@ +<?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="FillCategoryFormActionGroup"> + <annotations> + <description>Requires navigation to the Subcategory creation/edit page. Fills the Subcategory Name. Fills the Search Engine Optimization.</description> + </annotations> + <arguments> + <argument name="categoryEntity" defaultValue="_defaultCategory"/> + </arguments> + + <fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{categoryEntity.name}}" stepKey="enterCategoryName"/> + <click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="openSEO"/> + <fillField selector="{{AdminCategorySEOSection.UrlKeyInput}}" userInput="{{categoryEntity.name_lwr}}" stepKey="enterURLKey"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillCategoryNameAndUrlKeyAndSaveActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillCategoryNameAndUrlKeyAndSaveActionGroup.xml new file mode 100644 index 0000000000000..bd62dd9e83e55 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillCategoryNameAndUrlKeyAndSaveActionGroup.xml @@ -0,0 +1,29 @@ +<?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="FillCategoryNameAndUrlKeyAndSaveActionGroup"> + <annotations> + <description>Requires navigation to subcategory creation/edit. Fills the name, and sets the Search Engine Optimization for the category.</description> + </annotations> + <arguments> + <argument name="categoryName" type="string"/> + <argument name="categoryUrlKey" type="string"/> + </arguments> + + <fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{categoryName}}" stepKey="enterCategoryName"/> + <scrollTo selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="scrollToSearchEngineOptimization"/> + <click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="openSEO"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <fillField selector="{{AdminCategorySEOSection.UrlKeyInput}}" userInput="{{categoryUrlKey}}" stepKey="enterURLKey"/> + <scrollToTopOfPage stepKey="scrollToTheTopOfPage"/> + <click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategory"/> + <waitForPageLoad stepKey="waitForPageToLoad1"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillMainProductFormActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillMainProductFormActionGroup.xml new file mode 100644 index 0000000000000..f53059b3de063 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillMainProductFormActionGroup.xml @@ -0,0 +1,28 @@ +<?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="FillMainProductFormActionGroup"> + <annotations> + <description>Fills in the provided Product details (Name, SKU, Price, Quantity, Stock Status, Weight Type and Weight) on the Admin Products creation/edit page.</description> + </annotations> + <arguments> + <argument name="product" defaultValue="_defaultProduct"/> + </arguments> + + <scrollToTopOfPage stepKey="scrollToTopOfPage"/> + <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductName"/> + <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductSku"/> + <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{product.price}}" stepKey="fillProductPrice"/> + <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{product.quantity}}" stepKey="fillProductQty"/> + <selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{product.status}}" stepKey="selectStockStatus"/> + <selectOption selector="{{AdminProductFormSection.productWeightSelect}}" userInput="This item has weight" stepKey="selectWeight"/> + <fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{product.weight}}" stepKey="fillProductWeight"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillMainProductFormByStringActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillMainProductFormByStringActionGroup.xml new file mode 100644 index 0000000000000..4f3157292d356 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillMainProductFormByStringActionGroup.xml @@ -0,0 +1,32 @@ +<?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="FillMainProductFormByStringActionGroup"> + <annotations> + <description>Fills in the provided Product Name, SKU, Price, Quantity, Stock Status and Weight on the Admin Products creation/edit page.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + <argument name="productSku" type="string"/> + <argument name="productPrice" type="string"/> + <argument name="productQuantity" type="string"/> + <argument name="productStatus" type="string"/> + <argument name="productWeight" type="string"/> + </arguments> + + <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{productName}}" stepKey="fillProductName"/> + <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{productSku}}" stepKey="fillProductSku"/> + <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{productPrice}}" stepKey="fillProductPrice"/> + <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{productQuantity}}" stepKey="fillProductQty"/> + <selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{productStatus}}" stepKey="selectStockStatus"/> + <selectOption selector="{{AdminProductFormSection.productWeightSelect}}" userInput="This item has weight" stepKey="selectWeight"/> + <fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{productWeight}}" stepKey="fillProductWeight"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillMainProductFormNoWeightActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillMainProductFormNoWeightActionGroup.xml new file mode 100644 index 0000000000000..b3cc110224b25 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillMainProductFormNoWeightActionGroup.xml @@ -0,0 +1,26 @@ +<?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="FillMainProductFormNoWeightActionGroup"> + <annotations> + <description>Fills in the provided Product details (Name, SKU, Price, Quantity, Stock Status and Weight Type) on the Admin Products creation/edit page.</description> + </annotations> + <arguments> + <argument name="product" defaultValue="DownloadableProduct"/> + </arguments> + + <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductName"/> + <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductSku"/> + <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{product.price}}" stepKey="fillProductPrice"/> + <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{product.quantity}}" stepKey="fillProductQty"/> + <selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{product.status}}" stepKey="selectStockStatus"/> + <selectOption selector="{{AdminProductFormSection.productWeightSelect}}" userInput="This item has no weight" stepKey="selectWeight"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillNewProductCategoryActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillNewProductCategoryActionGroup.xml new file mode 100644 index 0000000000000..9edcfca9416f2 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillNewProductCategoryActionGroup.xml @@ -0,0 +1,34 @@ +<?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="FillNewProductCategoryActionGroup"> + <annotations> + <description>Actions to fill out a new category from the product page with specified category and parent category names.</description> + </annotations> + <arguments> + <argument name="categoryName" defaultValue="Test Category" type="string"/> + <argument name="parentCategoryName" defaultValue="default" type="string"/> + </arguments> + + <!-- Click on new Category --> + <click stepKey="clickNewCategory" selector="{{AdminProductCategoryCreationSection.newCategory}}"/> + <waitForPageLoad stepKey="waitForFieldSet"/> + <fillField stepKey="fillCategoryName" selector="{{AdminProductCategoryCreationSection.nameInput}}" userInput="{{categoryName}}"/> + + <!-- Search and select a parent category for the product --> + <click stepKey="clickParentCategory" selector="{{AdminProductCategoryCreationSection.parentCategory}}"/> + <waitForPageLoad stepKey="waitForDropDownVisible"/> + <fillField stepKey="searchForParent" userInput="{{parentCategoryName}}" selector="{{AdminProductCategoryCreationSection.parentSearch}}"/> + <waitForPageLoad stepKey="waitForFieldResults"/> + <click stepKey="clickParent" selector="{{AdminProductCategoryCreationSection.parentSearchResult}}"/> + <click stepKey="createCategory" selector="{{AdminProductCategoryCreationSection.createCategory}}"/> + <waitForPageLoad stepKey="waitForCategoryCreated"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillProductNameAndSkuInProductFormActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillProductNameAndSkuInProductFormActionGroup.xml new file mode 100644 index 0000000000000..822b74d9e9e6b --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillProductNameAndSkuInProductFormActionGroup.xml @@ -0,0 +1,22 @@ +<?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="FillProductNameAndSkuInProductFormActionGroup"> + <annotations> + <description>Fills in the provided Product details (Name and SKU) on the Admin Products creation and edit page.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductName"/> + <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductSku"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterAndSelectProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterAndSelectProductActionGroup.xml new file mode 100644 index 0000000000000..2cd64ddc2855f --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterAndSelectProductActionGroup.xml @@ -0,0 +1,30 @@ +<?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="FilterAndSelectProductActionGroup"> + <annotations> + <description>Goes to the Admin Products grid. Filters the Product grid by the provided Product SKU.</description> + </annotations> + <arguments> + <argument name="productSku" type="string"/> + </arguments> + + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> + <waitForPageLoad stepKey="waitForProductIndexPageToLoad"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{productSku}}" stepKey="fillProductSkuFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/> + <click stepKey="openSelectedProduct" selector="{{AdminProductGridSection.productRowBySku(productSku)}}"/> + <waitForPageLoad stepKey="waitForProductToLoad"/> + <waitForElementVisible selector="{{AdminHeaderSection.pageTitle}}" stepKey="waitForProductTitle"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductAttributeByAttributeCodeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductAttributeByAttributeCodeActionGroup.xml new file mode 100644 index 0000000000000..efd1d50cb4929 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductAttributeByAttributeCodeActionGroup.xml @@ -0,0 +1,24 @@ +<?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="FilterProductAttributeByAttributeCodeActionGroup"> + <annotations> + <description>Filters the Product Attributes grid by the provided Product Attribute Code.</description> + </annotations> + <arguments> + <argument name="ProductAttributeCode" type="string"/> + </arguments> + + <click selector="{{AdminProductAttributeGridSection.ResetFilter}}" stepKey="resetFiltersOnGrid"/> + <fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="{{ProductAttributeCode}}" stepKey="setAttributeCode"/> + <waitForPageLoad stepKey="waitForUserInput"/> + <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductAttributeByAttributeLabelActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductAttributeByAttributeLabelActionGroup.xml new file mode 100644 index 0000000000000..8d2c966de6074 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductAttributeByAttributeLabelActionGroup.xml @@ -0,0 +1,23 @@ +<?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="FilterProductAttributeByAttributeLabelActionGroup"> + <annotations> + <description>Searches the Attribute Sets grid page for the provided Attribute Set Name.</description> + </annotations> + <arguments> + <argument name="productAttributeLabel" type="string"/> + </arguments> + + <fillField selector="{{AdminProductAttributeGridSection.attributeLabelFilter}}" userInput="{{productAttributeLabel}}" stepKey="setAttributeLabel"/> + <waitForPageLoad stepKey="waitForUserInput"/> + <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductAttributeByDefaultLabelActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductAttributeByDefaultLabelActionGroup.xml new file mode 100644 index 0000000000000..31702bfdca212 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductAttributeByDefaultLabelActionGroup.xml @@ -0,0 +1,24 @@ +<?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="FilterProductAttributeByDefaultLabelActionGroup"> + <annotations> + <description>Filters the Product Attributes grid by the provided Product Attribute Label.</description> + </annotations> + <arguments> + <argument name="productAttributeLabel" type="string"/> + </arguments> + + <click selector="{{AdminProductAttributeGridSection.ResetFilter}}" stepKey="resetFiltersOnGrid"/> + <fillField selector="{{AdminProductAttributeGridSection.GridFilterFrontEndLabel}}" userInput="{{productAttributeLabel}}" stepKey="setDefaultLabel"/> + <waitForPageLoad stepKey="waitForUserInput"/> + <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductAttributeSetGridByAttributeSetNameActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductAttributeSetGridByAttributeSetNameActionGroup.xml new file mode 100644 index 0000000000000..c8aa8eb286fc3 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductAttributeSetGridByAttributeSetNameActionGroup.xml @@ -0,0 +1,25 @@ +<?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="FilterProductAttributeSetGridByAttributeSetNameActionGroup"> + <annotations> + <description>Filters the Attribute Sets grid page for the provided Attribute Set Name.</description> + </annotations> + <arguments> + <argument name="name" type="string"/> + </arguments> + + <click selector="{{AdminProductAttributeSetGridSection.resetFilter}}" stepKey="clickResetButton"/> + <fillField selector="{{AdminProductAttributeSetGridSection.filter}}" userInput="{{name}}" stepKey="filterByName"/> + <click selector="{{AdminProductAttributeSetGridSection.searchBtn}}" stepKey="clickSearch"/> + <click selector="{{AdminProductAttributeSetGridSection.nthRow('1')}}" stepKey="clickFirstRow"/> + <waitForPageLoad time="30" stepKey="waitForPageLoad1"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByDisabledStatusActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByDisabledStatusActionGroup.xml new file mode 100644 index 0000000000000..52b6972ec92e6 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByDisabledStatusActionGroup.xml @@ -0,0 +1,22 @@ +<?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="FilterProductGridByDisabledStatusActionGroup"> + <annotations> + <description>Filters the Admin Products grid by the 'Disabled' Status. PLEASE NOTE: The Filter is Hardcoded.</description> + </annotations> + + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <selectOption selector="{{AdminProductGridFilterSection.statusFilter}}" userInput="Disabled" stepKey="selectDisabledStatusFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByEnabledStatusActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByEnabledStatusActionGroup.xml new file mode 100644 index 0000000000000..1e4d2315bf75e --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByEnabledStatusActionGroup.xml @@ -0,0 +1,22 @@ +<?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="FilterProductGridByEnabledStatusActionGroup"> + <annotations> + <description>Filters the Admin Products grid by the 'Enabled' Status. PLEASE NOTE: The Filter is Hardcoded.</description> + </annotations> + + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <selectOption selector="{{AdminProductGridFilterSection.statusFilter}}" userInput="Enabled" stepKey="selectEnabledStatusFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByName2ActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByName2ActionGroup.xml new file mode 100644 index 0000000000000..850ea3e167daa --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByName2ActionGroup.xml @@ -0,0 +1,25 @@ +<?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="FilterProductGridByName2ActionGroup"> + <annotations> + <description>Filters the Admin Products grid by the provided Product Name.</description> + </annotations> + <arguments> + <argument name="name" type="string"/> + </arguments> + + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{name}}" stepKey="fillProductNameFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByNameActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByNameActionGroup.xml new file mode 100644 index 0000000000000..efd2f1c7be08a --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByNameActionGroup.xml @@ -0,0 +1,25 @@ +<?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="FilterProductGridByNameActionGroup"> + <annotations> + <description>Filters the Admin Products grid by the provided Product (Name).</description> + </annotations> + <arguments> + <argument name="product" defaultValue="_defaultProduct"/> + </arguments> + + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{product.name}}" stepKey="fillProductNameFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByPriceRangeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByPriceRangeActionGroup.xml new file mode 100644 index 0000000000000..d3405f977ccc4 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByPriceRangeActionGroup.xml @@ -0,0 +1,26 @@ +<?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="FilterProductGridByPriceRangeActionGroup"> + <annotations> + <description>Filters the Admin Products grid by the provided Price Filter.</description> + </annotations> + <arguments> + <argument name="filter"/> + </arguments> + + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.priceFilterFrom}}" userInput="{{filter.from}}" stepKey="fillProductPriceFromFilter"/> + <fillField selector="{{AdminProductGridFilterSection.priceFilterTo}}" userInput="{{filter.to}}" stepKey="fillProductPriceToFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridBySetNewFromDateActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridBySetNewFromDateActionGroup.xml new file mode 100644 index 0000000000000..db12d6f9d8440 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridBySetNewFromDateActionGroup.xml @@ -0,0 +1,22 @@ +<?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="FilterProductGridBySetNewFromDateActionGroup"> + <annotations> + <description>Filters the Admin Products grid by the New From Data field. PLEASE NOTE: The Start Date is Hardcoded.</description> + </annotations> + + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.newFromDateFilter}}" userInput="05/16/2018" stepKey="fillSetAsNewProductFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridBySku2ActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridBySku2ActionGroup.xml new file mode 100644 index 0000000000000..eb5f20b7c84e3 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridBySku2ActionGroup.xml @@ -0,0 +1,25 @@ +<?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="FilterProductGridBySku2ActionGroup"> + <annotations> + <description>Filters the Admin Products grid by the provided Product SKU.</description> + </annotations> + <arguments> + <argument name="sku" type="string"/> + </arguments> + + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridBySkuActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridBySkuActionGroup.xml new file mode 100644 index 0000000000000..d216b0f976efe --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridBySkuActionGroup.xml @@ -0,0 +1,25 @@ +<?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="FilterProductGridBySkuActionGroup"> + <annotations> + <description>Filters the Admin Products grid by the provided Product (SKU).</description> + </annotations> + <arguments> + <argument name="product" defaultValue="_defaultProduct"/> + </arguments> + + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridBySkuAndNameActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridBySkuAndNameActionGroup.xml new file mode 100644 index 0000000000000..80e8e2c7c3133 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridBySkuAndNameActionGroup.xml @@ -0,0 +1,25 @@ +<?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="FilterProductGridBySkuAndNameActionGroup"> + <annotations> + <description>Filters the Admin Products grid by the provided Product (Name and SKU).</description> + </annotations> + <arguments> + <argument name="product" defaultValue="_defaultProduct"/> + </arguments> + + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> + <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{product.name}}" stepKey="fillProductNameFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToAdminCategoryPageByIdActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToAdminCategoryPageByIdActionGroup.xml new file mode 100644 index 0000000000000..b1914118cd034 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToAdminCategoryPageByIdActionGroup.xml @@ -0,0 +1,23 @@ +<?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="GoToAdminCategoryPageByIdActionGroup"> + <annotations> + <description>Goes to the Category edit page for a specified Category ID.</description> + </annotations> + <arguments> + <argument name="id" type="string"/> + </arguments> + + <amOnPage url="{{AdminCategoryEditPage.url(id)}}" stepKey="amOnAdminCategoryPage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="{{id}}" stepKey="seeCategoryPageTitle"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToAttributeGridPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToAttributeGridPageActionGroup.xml new file mode 100644 index 0000000000000..2b5fe9d76875c --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToAttributeGridPageActionGroup.xml @@ -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="GoToAttributeGridPageActionGroup"> + <annotations> + <description>Goes to the Attribute Sets grid page.</description> + </annotations> + + <amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSets"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToAttributeSetByNameActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToAttributeSetByNameActionGroup.xml new file mode 100644 index 0000000000000..e732f1bd7341e --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToAttributeSetByNameActionGroup.xml @@ -0,0 +1,25 @@ +<?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="GoToAttributeSetByNameActionGroup"> + <annotations> + <description>Searches for the provided Attribute Sets Name. Clicks on the 1st row.</description> + </annotations> + <arguments> + <argument name="name" type="string"/> + </arguments> + + <click selector="{{AdminProductAttributeSetGridSection.resetFilter}}" stepKey="clickResetButton"/> + <fillField selector="{{AdminProductAttributeSetGridSection.filter}}" userInput="{{name}}" stepKey="filterByName"/> + <click selector="{{AdminProductAttributeSetGridSection.searchBtn}}" stepKey="clickSearch"/> + <click selector="{{AdminProductAttributeSetGridSection.nthRow('1')}}" stepKey="clickFirstRow"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToCreateCategoryPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToCreateCategoryPageActionGroup.xml new file mode 100644 index 0000000000000..346f47006cf37 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToCreateCategoryPageActionGroup.xml @@ -0,0 +1,25 @@ +<?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="GoToCreateCategoryPageActionGroup"> + <annotations> + <description>Goes to the Category grid page. Clicks the Add Subcategory button.</description> + </annotations> + <arguments> + <argument name="selector" defaultValue="AdminCategorySidebarActionSection.AddSubcategoryButton"/> + </arguments> + + <amOnPage url="{{AdminCategoryPage.url}}" stepKey="amOnAdminCategoryPage"/> + <scrollToTopOfPage stepKey="scrollToTopOfPage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <click selector="{{selector}}" stepKey="clickOnAddCategory"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Category" stepKey="seeCategoryPageTitle"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToCreateProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToCreateProductPageActionGroup.xml new file mode 100644 index 0000000000000..7f95765337189 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToCreateProductPageActionGroup.xml @@ -0,0 +1,27 @@ +<?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"> + <!--Navigate to create product page from product grid page--> + <actionGroup name="GoToCreateProductPageActionGroup"> + <annotations> + <description>Clicks on the 'Add Product' toggle on the Admin Products grid page. Clicks on the provided Product (Type).</description> + </annotations> + <arguments> + <argument name="product" defaultValue="_defaultProduct"/> + </arguments> + + <click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductToggle"/> + <waitForElementVisible selector="{{AdminProductGridActionSection.addTypeProduct(product.type_id)}}" stepKey="waitForAddProductDropdown" time="30"/> + <click selector="{{AdminProductGridActionSection.addTypeProduct(product.type_id)}}" stepKey="clickAddProductType"/> + <waitForPageLoad time="30" stepKey="waitForCreateProductPageLoad"/> + <seeInCurrentUrl url="{{AdminProductCreatePage.url(AddToDefaultSet.attributeSetId, product.type_id)}}" stepKey="seeNewProductUrl"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Product" stepKey="seeNewProductTitle"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToProductCatalogPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToProductCatalogPageActionGroup.xml new file mode 100644 index 0000000000000..08bf948c2223b --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToProductCatalogPageActionGroup.xml @@ -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="GoToProductCatalogPageActionGroup"> + <annotations> + <description>Goes to the Admin Products grid page.</description> + </annotations> + + <comment userInput="actionGroup:GoToProductCatalogPage" stepKey="actionGroupComment"/> + <amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="GoToCatalogProductPage"/> + <waitForPageLoad stepKey="WaitForPageToLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToProductPageViaIDActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToProductPageViaIDActionGroup.xml new file mode 100644 index 0000000000000..104ef83771e9d --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToProductPageViaIDActionGroup.xml @@ -0,0 +1,21 @@ +<?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="GoToProductPageViaIDActionGroup"> + <annotations> + <description>Goes to the Product edit page for the provided Product ID.</description> + </annotations> + <arguments> + <argument name="productId" type="string"/> + </arguments> + + <amOnPage url="{{AdminProductEditPage.url(productId)}}" stepKey="goToProduct"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToSpecifiedCreateProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToSpecifiedCreateProductPageActionGroup.xml new file mode 100644 index 0000000000000..26041974dbc80 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToSpecifiedCreateProductPageActionGroup.xml @@ -0,0 +1,25 @@ +<?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="GoToSpecifiedCreateProductPageActionGroup"> + <annotations> + <description>Goes to the Admin Product grid page. Clicks on the Add Product toggle. Clicks on the provided Product Type.</description> + </annotations> + <arguments> + <argument type="string" name="productType" defaultValue="simple"/> + </arguments> + + <comment userInput="actionGroup:GoToSpecifiedCreateProductPage" stepKey="actionGroupComment"/> + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> + <click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductDropdown"/> + <click selector="{{AdminProductGridActionSection.addTypeProduct(productType)}}" stepKey="clickAddProduct"/> + <waitForPageLoad stepKey="waitForFormToLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToStorefrontCategoryPageByParametersActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToStorefrontCategoryPageByParametersActionGroup.xml new file mode 100644 index 0000000000000..816aeaa09ee9b --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToStorefrontCategoryPageByParametersActionGroup.xml @@ -0,0 +1,28 @@ +<?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"> + <!-- Go to storefront category product page by given parameters --> + <actionGroup name="GoToStorefrontCategoryPageByParametersActionGroup"> + <annotations> + <description>Goes to the Storefront Category page using URI Search Parameters.</description> + </annotations> + <arguments> + <argument name="category" type="string"/> + <argument name="mode" type="string"/> + <argument name="numOfProductsPerPage" type="string"/> + <argument name="sortBy" type="string" defaultValue="position"/> + <argument name="sort" type="string" defaultValue="asc"/> + </arguments> + + <!-- Go to storefront category page --> + <amOnPage url="{{StorefrontCategoryPage.url(category)}}?product_list_limit={{numOfProductsPerPage}}&product_list_mode={{mode}}&product_list_order={{sortBy}}&product_list_dir={{sort}}" stepKey="onCategoryPage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToSubCategoryPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToSubCategoryPageActionGroup.xml new file mode 100644 index 0000000000000..8c35c88f151d5 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToSubCategoryPageActionGroup.xml @@ -0,0 +1,29 @@ +<?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="GoToSubCategoryPageActionGroup"> + <annotations> + <description>Goes to the Storefront page. Open the Parent Category menu in the Top Nav Menu. Click on a Subcategory. Validate that the Subcategory is present and correct.</description> + </annotations> + <arguments> + <argument name="parentCategory"/> + <argument name="subCategory"/> + <argument name="urlPath" type="string"/> + </arguments> + + <moveMouseOver selector="{{StorefrontHeaderSection.NavigationCategoryByName(parentCategory.name)}}" stepKey="moveMouseOnMainCategory"/> + <waitForElementVisible selector="{{StorefrontHeaderSection.NavigationCategoryByName(subCategory.name)}}" stepKey="waitForSubCategoryVisible"/> + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName(subCategory.name)}}" stepKey="goToCategory"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <seeInCurrentUrl url="{{urlPath}}.html" stepKey="checkUrl"/> + <seeInTitle userInput="{{subCategory.name}}" stepKey="assertCategoryNameInTitle"/> + <see userInput="{{subCategory.name}}" selector="{{StorefrontCategoryMainSection.CategoryTitle}}" stepKey="assertCategoryName"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ImportProductCustomizableOptionsActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ImportProductCustomizableOptionsActionGroup.xml new file mode 100644 index 0000000000000..2a847034add1d --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ImportProductCustomizableOptionsActionGroup.xml @@ -0,0 +1,29 @@ +<?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="ImportProductCustomizableOptionsActionGroup"> + <annotations> + <description>Import custom Product Options for the provided Product Name.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + </arguments> + + <click selector="{{AdminProductCustomizableOptionsSection.importOptions}}" stepKey="clickImportOptions"/> + <waitForElementVisible selector="{{AdminProductImportOptionsSection.selectProductTitle}}" stepKey="waitForTitleVisible"/> + <conditionalClick selector="{{AdminProductImportOptionsSection.resetFiltersButton}}" dependentSelector="{{AdminProductImportOptionsSection.resetFiltersButton}}" visible="true" stepKey="clickResetFilters"/> + <click selector="{{AdminProductImportOptionsSection.filterButton}}" stepKey="clickFilterButton"/> + <waitForElementVisible selector="{{AdminProductImportOptionsSection.nameField}}" stepKey="waitForNameField"/> + <fillField selector="{{AdminProductImportOptionsSection.nameField}}" userInput="{{productName}}" stepKey="fillProductName"/> + <click selector="{{AdminProductImportOptionsSection.applyFiltersButton}}" stepKey="clickApplyFilters"/> + <checkOption selector="{{AdminProductImportOptionsSection.firstRowItemCheckbox}}" stepKey="checkProductCheckbox"/> + <click selector="{{AdminProductImportOptionsSection.importButton}}" stepKey="clickImport"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToAndResetProductAttributeGridToDefaultViewActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToAndResetProductAttributeGridToDefaultViewActionGroup.xml new file mode 100644 index 0000000000000..6d0091d90175b --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToAndResetProductAttributeGridToDefaultViewActionGroup.xml @@ -0,0 +1,21 @@ +<?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="NavigateToAndResetProductAttributeGridToDefaultViewActionGroup"> + <annotations> + <description>Goes to the Product Attributes grid. Clicks on 'Clear Filters'.</description> + </annotations> + + <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <waitForPageLoad stepKey="waitForGridLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToAndResetProductGridToDefaultViewActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToAndResetProductGridToDefaultViewActionGroup.xml new file mode 100644 index 0000000000000..c67c0c0e61ab7 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToAndResetProductGridToDefaultViewActionGroup.xml @@ -0,0 +1,19 @@ +<?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="NavigateToAndResetProductGridToDefaultViewActionGroup" extends="ResetProductGridToDefaultViewActionGroup"> + <annotations> + <description>EXTENDS: resetProductGridToDefaultView. Adds an action to go to the Admin Products grid page.</description> + </annotations> + + <amOnPage url="{{AdminProductIndexPage.url}}" before="clickClearFilters" stepKey="goToAdminProductIndexPage"/> + <waitForPageLoad after="goToAdminProductIndexPage" stepKey="waitForProductIndexPageToLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToCreatedCategoryActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToCreatedCategoryActionGroup.xml new file mode 100644 index 0000000000000..b1638909652f6 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToCreatedCategoryActionGroup.xml @@ -0,0 +1,26 @@ +<?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="NavigateToCreatedCategoryActionGroup"> + <annotations> + <description>Navigates to category page, selects a category by specified category.</description> + </annotations> + <arguments> + <argument name="Category"/> + </arguments> + + <amOnPage url="{{AdminCategoryPage.page}}" stepKey="amOnCategoryPage"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <click selector="{{AdminCategorySidebarTreeSection.expandAll}}" stepKey="expandAll"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + <click selector="{{AdminCategorySidebarTreeSection.categoryInTree(Category.Name)}}" stepKey="navigateToCreatedCategory"/> + <waitForLoadingMaskToDisappear stepKey="waitForSpinner"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToCreatedProductAttributeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToCreatedProductAttributeActionGroup.xml new file mode 100644 index 0000000000000..850939501eb81 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToCreatedProductAttributeActionGroup.xml @@ -0,0 +1,25 @@ +<?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="NavigateToCreatedProductAttributeActionGroup"> + <annotations> + <description>Goes to the Product Attributes grid page. Filters the grid based on the provided Product Attribute. Clicks on the 1st row.</description> + </annotations> + <arguments> + <argument name="ProductAttribute"/> + </arguments> + + <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> + <fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="{{ProductAttribute.attribute_code}}" stepKey="setAttributeCode"/> + <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/> + <click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="clickOnAttributeRow"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToCreatedProductEditPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToCreatedProductEditPageActionGroup.xml new file mode 100644 index 0000000000000..0c9b5fc1c40e6 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToCreatedProductEditPageActionGroup.xml @@ -0,0 +1,37 @@ +<?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="NavigateToCreatedProductEditPageActionGroup"> + <annotations> + <description>Goes to the Admin Product grid page. Filters the Product grid based on the provided Product details (SKU). Edits the provided Product. Validates that the Product SKU is present and correct.</description> + </annotations> + <arguments> + <argument name="product" defaultValue="_defaultProduct"/> + </arguments> + + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToAdminProductIndexPage"/> + <waitForPageLoad stepKey="waitForProductIndexPageToLoad"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <waitForPageLoad stepKey="waitForClearFilters"/> + <dontSeeElement selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="dontSeeClearFilters"/> + <click selector="{{AdminProductGridFilterSection.viewDropdown}}" stepKey="openViewBookmarksTab"/> + <click selector="{{AdminProductGridFilterSection.viewBookmark('Default View')}}" stepKey="resetToDefaultGridView"/> + <waitForPageLoad stepKey="waitForResetToDefaultView"/> + <see selector="{{AdminProductGridFilterSection.viewDropdown}}" userInput="Default View" stepKey="seeDefaultViewSelected"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <waitForPageLoad stepKey="waitForFilterOnGrid"/> + <click selector="{{AdminProductGridSection.selectRowBasedOnName(product.name)}}" stepKey="clickProduct"/> + <waitForPageLoad stepKey="waitForProductEditPageLoad"/> + <waitForElementVisible selector="{{AdminProductFormBundleSection.productSku}}" stepKey="waitForProductSKUField"/> + <seeInField selector="{{AdminProductFormBundleSection.productSku}}" userInput="{{product.sku}}" stepKey="seeProductSKU"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToEditProductAttributeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToEditProductAttributeActionGroup.xml new file mode 100644 index 0000000000000..9a348d2be8208 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToEditProductAttributeActionGroup.xml @@ -0,0 +1,26 @@ +<?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="NavigateToEditProductAttributeActionGroup"> + <annotations> + <description>Goes to the Product Attributes grid page. Filters the grid based on the provided Product Attribute. Clicks on the 1st row.</description> + </annotations> + <arguments> + <argument name="ProductAttribute" type="string"/> + </arguments> + + <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> + <fillField selector="{{AdminProductAttributeGridSection.GridFilterFrontEndLabel}}" userInput="{{ProductAttribute}}" stepKey="navigateToAttributeEditPage1"/> + <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="navigateToAttributeEditPage2"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + <click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="navigateToAttributeEditPage3"/> + <waitForPageLoad stepKey="waitForPageLoad3"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToMediaGalleryActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToMediaGalleryActionGroup.xml new file mode 100644 index 0000000000000..fea652311d7c1 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToMediaGalleryActionGroup.xml @@ -0,0 +1,25 @@ +<?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="NavigateToMediaGalleryActionGroup"> + <annotations> + <description>Navigates to the category page and Opens the Media Gallery.</description> + </annotations> + + <amOnPage url="{{AdminCategoryPage.url}}" stepKey="amOnAdminCategoryPage"/> + <waitForElementVisible selector="{{AdminCategoryContentSection.sectionHeader}}" stepKey="waitForContentSection"/> + <conditionalClick selector="{{AdminCategoryContentSection.sectionHeader}}" dependentSelector="{{AdminCategoryContentSection.uploadButton}}" visible="false" stepKey="openContentSection"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <waitForElementVisible selector="{{AdminCategoryContentSection.selectFromGalleryButton}}" stepKey="waitForSelectFromGalleryButton"/> + <click selector="{{AdminCategoryContentSection.selectFromGalleryButton}}" stepKey="clickSelectFromGalleryButton"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/OpenCategoryFromCategoryTreeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/OpenCategoryFromCategoryTreeActionGroup.xml new file mode 100644 index 0000000000000..d172b9b24ab3e --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/OpenCategoryFromCategoryTreeActionGroup.xml @@ -0,0 +1,27 @@ +<?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="OpenCategoryFromCategoryTreeActionGroup"> + <annotations> + <description>Navigates to category page, selects a category by specified category. Replicates actionGroup:navigateToCreatedCategory.</description> + </annotations> + <arguments> + <argument name="category" type="string"/> + </arguments> + + <amOnPage url="{{AdminCategoryPage.url}}" stepKey="openAdminCategoryIndexPage"/> + <waitForPageLoad stepKey="waitForCategoryPageToLoad"/> + <click selector="{{AdminCategorySidebarTreeSection.expandAll}}" stepKey="clickOnExpandTree"/> + <waitForPageLoad stepKey="waitForCategoryToLoad"/> + <click selector="{{AdminCategorySidebarTreeSection.categoryInTree(category)}}" stepKey="selectCategory"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <waitForElementVisible selector="{{AdminCategoryContentSection.categoryPageTitle}}" stepKey="waitForCategoryTitle"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/OpenProductForEditByClickingRowXColumnYInProductGridActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/OpenProductForEditByClickingRowXColumnYInProductGridActionGroup.xml new file mode 100644 index 0000000000000..d5b6520cb33bb --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/OpenProductForEditByClickingRowXColumnYInProductGridActionGroup.xml @@ -0,0 +1,22 @@ +<?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="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup"> + <annotations> + <description>Clicks on the 'Edit' button in the Admin Products grid by the provided Grid coordinates (X, Y).</description> + </annotations> + <arguments> + <argument name="X" type="string" defaultValue="1"/> + <argument name="Y" type="string" defaultValue="2"/> + </arguments> + + <click selector="{{AdminProductGridSection.productGridXRowYColumnButton(X, Y)}}" stepKey="openProductForEdit"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ProductSetAdvancedPricingActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ProductSetAdvancedPricingActionGroup.xml new file mode 100644 index 0000000000000..95bda64202159 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ProductSetAdvancedPricingActionGroup.xml @@ -0,0 +1,38 @@ +<?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="ProductSetAdvancedPricingActionGroup"> + <annotations> + <description>Sets the provided Advanced Pricing on the Admin Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="website" type="string" defaultValue=""/> + <argument name="group" type="string" defaultValue="Retailer"/> + <argument name="quantity" type="string" defaultValue="1"/> + <argument name="price" type="string" defaultValue="Discount"/> + <argument name="amount" type="string" defaultValue="45"/> + </arguments> + + <click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickOnAdvancedPricingButton"/> + <waitForElement selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="waitForCustomerGroupPriceAddButton"/> + <click selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="addCustomerGroupAllGroupsQty1PriceDiscountAnd10percent"/> + <waitForElement selector="{{AdminProductFormAdvancedPricingSection.productTierPriceCustGroupSelect('0')}}" stepKey="waitForSelectCustomerGroupNameAttribute2"/> + <selectOption selector="{{AdminProductFormAdvancedPricingSection.productTierPriceWebsiteSelect('0')}}" userInput="{{website}}" stepKey="selectProductWebsiteValue"/> + <selectOption selector="{{AdminProductFormAdvancedPricingSection.productTierPriceCustGroupSelect('0')}}" userInput="{{group}}" stepKey="selectProductCustomGroupValue"/> + <fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPriceQtyInput('0')}}" userInput="{{quantity}}" stepKey="fillProductTierPriceQtyInput"/> + <selectOption selector="{{AdminProductFormAdvancedPricingSection.productTierPriceValueTypeSelect('0')}}" userInput="{{price}}" stepKey="selectProductTierPriceValueType"/> + <fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPricePercentageValuePriceInput('0')}}" userInput="{{amount}}" stepKey="selectProductTierPricePriceInput"/> + <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton"/> + <waitForPageLoad stepKey="WaitForProductSave"/> + <click selector="{{AdminProductFormAdvancedPricingSection.save}}" stepKey="clickSaveProduct1"/> + <waitForPageLoad time="60" stepKey="WaitForProductSave1"/> + <see userInput="You saved the product." stepKey="seeSaveConfirmation"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ProductSetAdvancedTierFixedPricingActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ProductSetAdvancedTierFixedPricingActionGroup.xml new file mode 100644 index 0000000000000..97d09fb3e1018 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ProductSetAdvancedTierFixedPricingActionGroup.xml @@ -0,0 +1,15 @@ +<?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="ProductSetAdvancedTierFixedPricingActionGroup" extends="ProductSetAdvancedPricingActionGroup"> + <remove keyForRemoval="selectProductTierPricePriceInput"/> + <fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPriceFixedPriceInput('0')}}" userInput="{{amount}}" stepKey="selectProductTierPricePriceInput" after="selectProductTierPriceValueType"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ProductSetWebsiteActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ProductSetWebsiteActionGroup.xml new file mode 100644 index 0000000000000..a2439a34bc7be --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ProductSetWebsiteActionGroup.xml @@ -0,0 +1,28 @@ +<?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="ProductSetWebsiteActionGroup"> + <annotations> + <description>Sets the provided Website on the Admin Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="website" type="string"/> + </arguments> + + <scrollTo selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="scrollToWebsites"/> + <conditionalClick selector="{{ProductInWebsitesSection.sectionHeader}}" dependentSelector="{{ProductInWebsitesSection.website(website)}}" visible="false" stepKey="clickToOpenProductInWebsite"/> + <waitForPageLoad stepKey="waitForPageOpened"/> + <click selector="{{ProductInWebsitesSection.website(website)}}" stepKey="selectWebsite"/> + <click selector="{{AdminProductFormAdvancedPricingSection.save}}" stepKey="clickSaveProduct"/> + <waitForPageLoad time='60' stepKey="waitForProducrSaved"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSaveSuccessMessage"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You saved the product." stepKey="seeSaveSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/RemoveCategoryFromProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/RemoveCategoryFromProductActionGroup.xml new file mode 100644 index 0000000000000..37e7d6173d3a4 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/RemoveCategoryFromProductActionGroup.xml @@ -0,0 +1,19 @@ +<?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="RemoveCategoryFromProductActionGroup"> + <arguments> + <argument name="categoryName" type="string" defaultValue="{{_defaultCategory.name}}"/> + </arguments> + <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDown"/> + <click selector="{{AdminProductFormSection.unselectCategories(categoryName)}}" stepKey="unselectCategories"/> + <click selector="{{AdminProductFormSection.done}}" stepKey="clickOnDoneAdvancedCategory"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/RemoveCategoryImageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/RemoveCategoryImageActionGroup.xml new file mode 100644 index 0000000000000..4febb8fd82c91 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/RemoveCategoryImageActionGroup.xml @@ -0,0 +1,24 @@ +<?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="RemoveCategoryImageActionGroup"> + <annotations> + <description>Requires navigation to the Category creation/edit page. Removes the current Category image. Validates that the Image does not exist.</description> + </annotations> + + <conditionalClick selector="{{AdminCategoryContentSection.sectionHeader}}" dependentSelector="{{AdminCategoryContentSection.uploadButton}}" visible="false" stepKey="openContentSection"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <waitForElementVisible selector="{{AdminCategoryContentSection.uploadButton}}" stepKey="seeImageSectionIsReady"/> + <click selector="{{AdminCategoryContentSection.removeImageButton}}" stepKey="clickRemoveImage"/> + <waitForAjaxLoad time="30" stepKey="waitForAjaxUpload"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoading"/> + <dontSee selector="{{AdminCategoryContentSection.imageFileName}}" stepKey="dontSeeImage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/RemoveProductImageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/RemoveProductImageActionGroup.xml new file mode 100644 index 0000000000000..6a56828b30308 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/RemoveProductImageActionGroup.xml @@ -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="RemoveProductImageActionGroup"> + <annotations> + <description>Removes a Product Image on the Admin Products creation/edit page.</description> + </annotations> + + <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductImagesSection"/> + <waitForPageLoad time="30" stepKey="waitForPageRefresh"/> + <click selector="{{AdminProductImagesSection.removeImageButton}}" stepKey="clickRemoveImage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/RemoveProductImageByNameActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/RemoveProductImageByNameActionGroup.xml new file mode 100644 index 0000000000000..fc931cbe37b25 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/RemoveProductImageByNameActionGroup.xml @@ -0,0 +1,21 @@ +<?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="RemoveProductImageByNameActionGroup" extends="RemoveProductImageActionGroup"> + <annotations> + <description>Removes a Product Image on the Admin Products creation/edit page by name.</description> + </annotations> + + <arguments> + <argument name="image" defaultValue="ProductImage"/> + </arguments> + <click selector="{{AdminProductImagesSection.removeImageButtonForExactImage(image.fileName)}}" stepKey="clickRemoveImage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ResetImportOptionFilterActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ResetImportOptionFilterActionGroup.xml new file mode 100644 index 0000000000000..f73a4f4ed5e4f --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ResetImportOptionFilterActionGroup.xml @@ -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="ResetImportOptionFilterActionGroup"> + <annotations> + <description>Click on the Reset Filters button for the Import Options filters on the Product grid page.</description> + </annotations> + + <conditionalClick selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" dependentSelector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" visible="false" stepKey="openCustomOptionSection"/> + <click selector="{{AdminProductCustomizableOptionsSection.importOptions}}" stepKey="clickImportOptions"/> + <click selector="{{AdminProductImportOptionsSection.resetFiltersButton}}" stepKey="clickResetFilterButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ResetProductGridToDefaultViewActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ResetProductGridToDefaultViewActionGroup.xml new file mode 100644 index 0000000000000..441fe377bd435 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ResetProductGridToDefaultViewActionGroup.xml @@ -0,0 +1,23 @@ +<?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"> + <!--Reset the product grid to the default view--> + <actionGroup name="ResetProductGridToDefaultViewActionGroup"> + <annotations> + <description>Sets the Admin Products grid view to the 'Default View'.</description> + </annotations> + + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <click selector="{{AdminProductGridFilterSection.viewDropdown}}" stepKey="openViewBookmarksTab"/> + <click selector="{{AdminProductGridFilterSection.viewBookmark('Default View')}}" stepKey="resetToDefaultGridView"/> + <waitForPageLoad stepKey="waitForProductGridLoad"/> + <see selector="{{AdminProductGridFilterSection.viewDropdown}}" userInput="Default View" stepKey="seeDefaultViewSelected"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveAttributeSetActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveAttributeSetActionGroup.xml new file mode 100644 index 0000000000000..4e8efe0885425 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveAttributeSetActionGroup.xml @@ -0,0 +1,19 @@ +<?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="SaveAttributeSetActionGroup"> + <annotations> + <description>Save an Attribute Set on the Attribute Set creation/edit page.</description> + </annotations> + + <click selector="{{AdminProductAttributeSetActionSection.save}}" stepKey="clickSave"/> + <see userInput="You saved the attribute set" selector="{{AdminMessagesSection.success}}" stepKey="successMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveCategoryFormActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveCategoryFormActionGroup.xml new file mode 100644 index 0000000000000..ff6afb4aaf0e9 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveCategoryFormActionGroup.xml @@ -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="SaveCategoryFormActionGroup"> + <annotations> + <description>Requires navigation to the Category creation/edit page. Checks that the url contains the AdminCategoryPage url. Saves the Category.</description> + </annotations> + + <seeInCurrentUrl url="{{AdminCategoryPage.url}}" stepKey="seeOnCategoryPage"/> + <click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategory"/> + <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="assertSuccess"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductAttributeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductAttributeActionGroup.xml new file mode 100644 index 0000000000000..e1bf2dea21318 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductAttributeActionGroup.xml @@ -0,0 +1,21 @@ +<?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="SaveProductAttributeActionGroup"> + <annotations> + <description>Clicks on Save. Validates that the Success Message is present.</description> + </annotations> + + <waitForElementVisible selector="{{AttributePropertiesSection.Save}}" stepKey="waitForSaveButton"/> + <click selector="{{AttributePropertiesSection.Save}}" stepKey="clickSaveButton"/> + <waitForPageLoad stepKey="waitForAttributeToSave"/> + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductAttributeInUseActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductAttributeInUseActionGroup.xml new file mode 100644 index 0000000000000..4da8232e8405d --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductAttributeInUseActionGroup.xml @@ -0,0 +1,21 @@ +<?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="SaveProductAttributeInUseActionGroup"> + <annotations> + <description>Clicks on Save. Validates that the Success Message is present.</description> + </annotations> + + <waitForElementVisible selector="{{AttributePropertiesSection.Save}}" stepKey="waitForSaveButton"/> + <click selector="{{AttributePropertiesSection.Save}}" stepKey="clickSaveButton"/> + <waitForPageLoad stepKey="waitForAttributeToSave"/> + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductFormActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductFormActionGroup.xml new file mode 100644 index 0000000000000..f2524d6e68bfc --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductFormActionGroup.xml @@ -0,0 +1,22 @@ +<?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="SaveProductFormActionGroup"> + <annotations> + <description>Clicks on the Save button. Validates that the Success Message is present and correct.</description> + </annotations> + + <scrollToTopOfPage stepKey="scrollTopPageProduct"/> + <waitForElementVisible selector="{{AdminProductFormActionSection.saveButton}}" stepKey="waitForSaveProductButton"/> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveProduct"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitProductSaveSuccessMessage"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You saved the product." stepKey="seeSaveConfirmation"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductFormNoSuccessCheckActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductFormNoSuccessCheckActionGroup.xml new file mode 100644 index 0000000000000..eb1cc33de9de8 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductFormNoSuccessCheckActionGroup.xml @@ -0,0 +1,19 @@ +<?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="SaveProductFormNoSuccessCheckActionGroup" extends="SaveProductFormActionGroup"> + <annotations> + <description>EXTENDS: saveProductForm. Removes 'waitProductSaveSuccessMessage' and 'seeSaveConfirmation'.</description> + </annotations> + + <remove keyForRemoval="waitProductSaveSuccessMessage"/> + <remove keyForRemoval="seeSaveConfirmation"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchForProductOnBackendActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchForProductOnBackendActionGroup.xml index 8b289f21f76b4..4c34feff4c943 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchForProductOnBackendActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchForProductOnBackendActionGroup.xml @@ -23,26 +23,4 @@ <fillField userInput="{{product.sku}}" selector="{{AdminProductFiltersSection.skuInput}}" stepKey="fillSkuFieldOnFiltersSection"/> <click selector="{{AdminProductFiltersSection.apply}}" stepKey="clickApplyFiltersButton"/> </actionGroup> - - <actionGroup name="SearchForProductOnBackendByNameActionGroup" extends="SearchForProductOnBackendActionGroup"> - <annotations> - <description>Search for the provided Product Name.</description> - </annotations> - <arguments> - <argument name="productName" type="string"/> - </arguments> - - <remove keyForRemoval="fillSkuFieldOnFiltersSection"/> - <fillField userInput="{{productName}}" selector="{{AdminProductFiltersSection.nameInput}}" after="cleanFiltersIfTheySet" stepKey="fillNameFieldOnFiltersSection"/> - </actionGroup> - - <actionGroup name="ClearProductsFilterActionGroup"> - <annotations> - <description>Goto the Product grid page. Clear the Search Filters for the grid.</description> - </annotations> - - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> - <waitForPageLoad time="30" stepKey="waitForProductsPageToLoad"/> - <conditionalClick selector="{{AdminProductFiltersSection.clearFiltersButton}}" dependentSelector="{{AdminProductFiltersSection.clearFiltersButton}}" visible="true" stepKey="cleanFiltersIfTheySet"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchForProductOnBackendByNameActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchForProductOnBackendByNameActionGroup.xml new file mode 100644 index 0000000000000..b46a3f5818aff --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchForProductOnBackendByNameActionGroup.xml @@ -0,0 +1,22 @@ +<?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="SearchForProductOnBackendByNameActionGroup" extends="SearchForProductOnBackendActionGroup"> + <annotations> + <description>Search for the provided Product Name.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + </arguments> + + <remove keyForRemoval="fillSkuFieldOnFiltersSection"/> + <fillField userInput="{{productName}}" selector="{{AdminProductFiltersSection.nameInput}}" after="cleanFiltersIfTheySet" stepKey="fillNameFieldOnFiltersSection"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchProductGridByKeyword2ActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchProductGridByKeyword2ActionGroup.xml new file mode 100644 index 0000000000000..bf9ca75f144b5 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchProductGridByKeyword2ActionGroup.xml @@ -0,0 +1,23 @@ +<?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="SearchProductGridByKeyword2ActionGroup"> + <annotations> + <description>Searches the Admin Products grid for the provided Keyword.</description> + </annotations> + <arguments> + <argument name="keyword" type="string"/> + </arguments> + + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> + <fillField selector="{{AdminProductGridFilterSection.keywordSearch}}" userInput="{{keyword}}" stepKey="fillKeywordSearchField"/> + <click selector="{{AdminProductGridFilterSection.keywordSearchButton}}" stepKey="clickKeywordSearch"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchProductGridByKeywordActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchProductGridByKeywordActionGroup.xml new file mode 100644 index 0000000000000..e3370864e7f61 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchProductGridByKeywordActionGroup.xml @@ -0,0 +1,23 @@ +<?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="SearchProductGridByKeywordActionGroup"> + <annotations> + <description>Searches the Admin Products grid for the provided Keyword.</description> + </annotations> + <arguments> + <argument name="keyword"/> + </arguments> + + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> + <fillField selector="{{AdminProductGridFilterSection.keywordSearch}}" userInput="{{keyword}}" stepKey="fillKeywordSearchField"/> + <click selector="{{AdminProductGridFilterSection.keywordSearchButton}}" stepKey="clickKeywordSearch"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SelectProductInWebsitesActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SelectProductInWebsitesActionGroup.xml new file mode 100644 index 0000000000000..bc3a865c3c365 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SelectProductInWebsitesActionGroup.xml @@ -0,0 +1,24 @@ +<?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="SelectProductInWebsitesActionGroup"> + <annotations> + <description>Sets the provided Website on the Admin Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="website" type="string"/> + </arguments> + + <scrollTo selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="scrollToWebsites"/> + <conditionalClick selector="{{ProductInWebsitesSection.sectionHeader}}" dependentSelector="{{AdminProductContentSection.sectionHeaderShow}}" visible="false" stepKey="expandSection"/> + <waitForPageLoad stepKey="waitForPageOpened"/> + <checkOption selector="{{ProductInWebsitesSection.website(website)}}" stepKey="selectWebsite"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SetCategoryByNameActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SetCategoryByNameActionGroup.xml new file mode 100644 index 0000000000000..feca7e59e7b23 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SetCategoryByNameActionGroup.xml @@ -0,0 +1,21 @@ +<?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="SetCategoryByNameActionGroup"> + <annotations> + <description>Sets the provided Category Name for a Product on the Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="categoryName" type="string"/> + </arguments> + + <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{categoryName}}]" stepKey="searchAndSelectCategory"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SetProductUrlKeyActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SetProductUrlKeyActionGroup.xml new file mode 100644 index 0000000000000..a75e8f6b764b1 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SetProductUrlKeyActionGroup.xml @@ -0,0 +1,22 @@ +<?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="SetProductUrlKeyActionGroup"> + <annotations> + <description>Fills the Product details (URL) for the SEO section.</description> + </annotations> + <arguments> + <argument name="product" defaultValue="_defaultProduct"/> + </arguments> + + <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/> + <fillField userInput="{{product.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SetProductUrlKeyByStringActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SetProductUrlKeyByStringActionGroup.xml new file mode 100644 index 0000000000000..d4c654523a40b --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SetProductUrlKeyByStringActionGroup.xml @@ -0,0 +1,22 @@ +<?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="SetProductUrlKeyByStringActionGroup"> + <annotations> + <description>Fills the Product SEO URL Key.</description> + </annotations> + <arguments> + <argument name="urlKey" type="string"/> + </arguments> + + <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/> + <fillField userInput="{{urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SortProductsByIdAscendingActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SortProductsByIdAscendingActionGroup.xml new file mode 100644 index 0000000000000..38585277476f8 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SortProductsByIdAscendingActionGroup.xml @@ -0,0 +1,19 @@ +<?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="SortProductsByIdAscendingActionGroup"> + <annotations> + <description>Filters the ID column in Ascending Order.</description> + </annotations> + + <conditionalClick selector="{{AdminProductGridTableHeaderSection.id('descend')}}" dependentSelector="{{AdminProductGridTableHeaderSection.id('ascend')}}" visible="false" stepKey="sortById"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SortProductsByIdDescendingActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SortProductsByIdDescendingActionGroup.xml new file mode 100644 index 0000000000000..635e36c458519 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SortProductsByIdDescendingActionGroup.xml @@ -0,0 +1,19 @@ +<?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="SortProductsByIdDescendingActionGroup"> + <annotations> + <description>Filters the ID column in Descending Order.</description> + </annotations> + + <conditionalClick selector="{{AdminProductGridTableHeaderSection.id('ascend')}}" dependentSelector="{{AdminProductGridTableHeaderSection.id('descend')}}" visible="false" stepKey="sortById"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAddCategoryProductToCompareActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAddCategoryProductToCompareActionGroup.xml new file mode 100644 index 0000000000000..d4678a97c5bc2 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAddCategoryProductToCompareActionGroup.xml @@ -0,0 +1,25 @@ +<?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"> + <!-- Add Product to Compare from the category page and check message --> + <actionGroup name="StorefrontAddCategoryProductToCompareActionGroup"> + <annotations> + <description>Add a Product to the Compare Product list from a Category page.</description> + </annotations> + <arguments> + <argument name="productVar"/> + </arguments> + + <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(productVar.name)}}" stepKey="moveMouseOverProduct"/> + <click selector="{{StorefrontCategoryProductSection.ProductAddToCompareByName(productVar.name)}}" stepKey="clickAddProductToCompare"/> + <waitForElement selector="{{StorefrontMessagesSection.success}}" time="30" stepKey="waitForAddCategoryProductToCompareSuccessMessage"/> + <see selector="{{StorefrontMessagesSection.success}}" userInput="You added product {{productVar.name}} to the comparison list." stepKey="assertAddCategoryProductToCompareSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAddProductToCompareActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAddProductToCompareActionGroup.xml new file mode 100644 index 0000000000000..ee3a5067449dc --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAddProductToCompareActionGroup.xml @@ -0,0 +1,23 @@ +<?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="StorefrontAddProductToCompareActionGroup"> + <annotations> + <description>Add a Product to the Compare Product list. Validate that the Success Message is present.</description> + </annotations> + <arguments> + <argument name="productVar"/> + </arguments> + + <click selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="clickAddToCompare"/> + <waitForElement selector="{{StorefrontMessagesSection.success}}" time="30" stepKey="waitForAddProductToCompareSuccessMessage"/> + <see selector="{{StorefrontMessagesSection.success}}" userInput="You added product {{productVar.name}} to the comparison list." stepKey="assertAddProductToCompareSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAddSimpleProductWithQtyActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAddSimpleProductWithQtyActionGroup.xml new file mode 100644 index 0000000000000..273893aa49445 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAddSimpleProductWithQtyActionGroup.xml @@ -0,0 +1,17 @@ +<?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="StorefrontAddSimpleProductWithQtyActionGroup" extends="AddSimpleProductToCartActionGroup"> + <arguments> + <argument name="quantity" type="string" defaultValue="1"/> + </arguments> + <fillField userInput="{{quantity}}" selector="{{StorefrontProductPageSection.qtyInput}}" stepKey="fillProductQty" after="goToProductPage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertActiveProductImageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertActiveProductImageActionGroup.xml new file mode 100644 index 0000000000000..0e7da54bd4028 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertActiveProductImageActionGroup.xml @@ -0,0 +1,17 @@ +<?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="StorefrontAssertActiveProductImageActionGroup"> + <arguments> + <argument name="fileName" defaultValue="magento-logo" type="string"/> + </arguments> + <seeElement selector="{{StorefrontProductMediaSection.productImageActive(fileName)}}" stepKey="seeActiveImageDefault"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertFotoramaImageAvailabilityActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertFotoramaImageAvailabilityActionGroup.xml new file mode 100644 index 0000000000000..79ea22403646f --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertFotoramaImageAvailabilityActionGroup.xml @@ -0,0 +1,17 @@ +<?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="StorefrontAssertFotoramaImageAvailabilityActionGroup"> + <arguments> + <argument name="fileName" type="string" defaultValue="magento-logo"/> + </arguments> + <seeElement selector="{{StorefrontProductMediaSection.productImageInFotorama(fileName)}}" stepKey="seeActiveImageDefault"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductImagesOnProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductImagesOnProductPageActionGroup.xml index ad9fa9a576c7d..d15686ec3bddc 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductImagesOnProductPageActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductImagesOnProductPageActionGroup.xml @@ -24,12 +24,4 @@ <click selector="{{StorefrontProductMediaSection.closeFullscreenImage}}" stepKey="closeFullScreenImage"/> <waitForPageLoad stepKey="waitForGalleryDisappear"/> </actionGroup> - - <!--Check availability image in fotorama--> - <actionGroup name="StorefrontAssertFotoramaImageAvailablity"> - <arguments> - <argument name="fileName" type="string" defaultValue="magento-logo"/> - </arguments> - <seeElement selector="{{StorefrontProductMediaSection.productImageInFotorama(fileName)}}" stepKey="seeActiveImageDefault"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductInRecentlyComparedWidgetActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductInRecentlyComparedWidgetActionGroup.xml new file mode 100644 index 0000000000000..43db9d96a4f50 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductInRecentlyComparedWidgetActionGroup.xml @@ -0,0 +1,22 @@ +<?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="StorefrontAssertProductInRecentlyComparedWidgetActionGroup"> + <annotations> + <description>Validate that the provided Product appears in the Recently Compared Products widget.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <waitForElementVisible selector="{{StorefrontWidgetsSection.widgetRecentlyComparedProductsGrid}}" stepKey="waitWidgetRecentlyComparedProductsGrid"/> + <see selector="{{StorefrontWidgetsSection.widgetRecentlyComparedProductsGrid}}" userInput="{{product.name}}" stepKey="seeProductInRecentlyComparedWidget"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductInRecentlyOrderedWidgetActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductInRecentlyOrderedWidgetActionGroup.xml new file mode 100644 index 0000000000000..de0cb05f7c5a1 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductInRecentlyOrderedWidgetActionGroup.xml @@ -0,0 +1,22 @@ +<?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="StorefrontAssertProductInRecentlyOrderedWidgetActionGroup"> + <annotations> + <description>Validate that the provided Product appears in the Recently Ordered Products widget.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <waitForElementVisible selector="{{StorefrontWidgetsSection.widgetRecentlyOrderedProductsGrid}}" stepKey="waitWidgetRecentlyOrderedProductsGrid"/> + <see selector="{{StorefrontWidgetsSection.widgetRecentlyOrderedProductsGrid}}" userInput="{{product.name}}" stepKey="seeProductInRecentlyOrderedWidget"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductInWidgetActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductInWidgetActionGroup.xml index 3caa58e16654f..81bce368a0c06 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductInWidgetActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductInWidgetActionGroup.xml @@ -20,30 +20,4 @@ <waitForElementVisible selector="{{StorefrontWidgetsSection.widgetRecentlyViewedProductsGrid}}" stepKey="waitWidgetRecentlyViewedProductsGrid"/> <see selector="{{StorefrontWidgetsSection.widgetRecentlyViewedProductsGrid}}" userInput="{{product.name}}" stepKey="seeProductInRecentlyViewedWidget"/> </actionGroup> - - <!-- Check the product in recently compared widget --> - <actionGroup name="StorefrontAssertProductInRecentlyComparedWidgetActionGroup"> - <annotations> - <description>Validate that the provided Product appears in the Recently Compared Products widget.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <waitForElementVisible selector="{{StorefrontWidgetsSection.widgetRecentlyComparedProductsGrid}}" stepKey="waitWidgetRecentlyComparedProductsGrid"/> - <see selector="{{StorefrontWidgetsSection.widgetRecentlyComparedProductsGrid}}" userInput="{{product.name}}" stepKey="seeProductInRecentlyComparedWidget"/> - </actionGroup> - - <!-- Check the product in recently ordered widget --> - <actionGroup name="StorefrontAssertProductInRecentlyOrderedWidgetActionGroup"> - <annotations> - <description>Validate that the provided Product appears in the Recently Ordered Products widget.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <waitForElementVisible selector="{{StorefrontWidgetsSection.widgetRecentlyOrderedProductsGrid}}" stepKey="waitWidgetRecentlyOrderedProductsGrid"/> - <see selector="{{StorefrontWidgetsSection.widgetRecentlyOrderedProductsGrid}}" userInput="{{product.name}}" stepKey="seeProductInRecentlyOrderedWidget"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductPriceOnCategoryPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductPriceOnCategoryPageActionGroup.xml new file mode 100644 index 0000000000000..bc341fa09bfab --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductPriceOnCategoryPageActionGroup.xml @@ -0,0 +1,21 @@ +<?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="StorefrontAssertProductPriceOnCategoryPageActionGroup" extends="StorefrontAssertProductPriceOnProductPageActionGroup"> + <annotations> + <description>Validate that the provided Product Price is correct on category page.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + </arguments> + + <see userInput="{{productPrice}}" selector="{{StorefrontCategoryProductSection.ProductPriceByName(productName)}}" stepKey="seeProductPrice"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCategoryActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCategoryActionGroup.xml deleted file mode 100644 index 9393669f6e46d..0000000000000 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCategoryActionGroup.xml +++ /dev/null @@ -1,124 +0,0 @@ -<?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"> - <!-- Go to storefront category product page by given parameters --> - <actionGroup name="GoToStorefrontCategoryPageByParameters"> - <annotations> - <description>Goes to the Storefront Category page using URI Search Parameters.</description> - </annotations> - <arguments> - <argument name="category" type="string"/> - <argument name="mode" type="string"/> - <argument name="numOfProductsPerPage" type="string"/> - <argument name="sortBy" type="string" defaultValue="position"/> - <argument name="sort" type="string" defaultValue="asc"/> - </arguments> - - <!-- Go to storefront category page --> - <amOnPage url="{{StorefrontCategoryPage.url(category)}}?product_list_limit={{numOfProductsPerPage}}&product_list_mode={{mode}}&product_list_order={{sortBy}}&product_list_dir={{sort}}" stepKey="onCategoryPage"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - </actionGroup> - - <actionGroup name="VerifyCategoryPageParameters"> - <annotations> - <description>Validate that the Category Page parameters are present and correct.</description> - </annotations> - <arguments> - <argument name="category"/> - <argument name="mode" type="string"/> - <argument name="numOfProductsPerPage" type="string"/> - <argument name="sortBy" type="string" defaultValue="position"/> - </arguments> - - <seeInCurrentUrl url="/{{category.custom_attributes[url_key]}}.html" stepKey="checkUrl"/> - <seeInTitle userInput="{{category.name}}" stepKey="assertCategoryNameInTitle"/> - <see userInput="{{category.name}}" selector="{{StorefrontCategoryMainSection.CategoryTitle}}" stepKey="assertCategoryName"/> - <see userInput="{{mode}}" selector="{{StorefrontCategoryMainSection.modeGridIsActive}}" stepKey="assertViewMode"/> - <see userInput="{{numOfProductsPerPage}}" selector="{{StorefrontCategoryMainSection.perPage}}" stepKey="assertNumberOfProductsPerPage"/> - <see userInput="{{sortBy}}" selector="{{StorefrontCategoryMainSection.sortedBy}}" stepKey="assertSortedBy"/> - </actionGroup> - - <!-- Check the category page --> - <actionGroup name="StorefrontCheckCategoryActionGroup"> - <annotations> - <description>Validate that the Storefront Category is present and correct.</description> - </annotations> - <arguments> - <argument name="category"/> - <argument name="productCount" type="string"/> - </arguments> - - <seeInCurrentUrl url="/{{category.custom_attributes[url_key]}}.html" stepKey="checkUrl"/> - <seeInTitle userInput="{{category.name}}" stepKey="assertCategoryNameInTitle"/> - <see userInput="{{category.name}}" selector="{{StorefrontCategoryMainSection.CategoryTitle}}" stepKey="assertCategoryName"/> - <see userInput="{{productCount}}" selector="{{StorefrontCategoryMainSection.productCount}} span" stepKey="assertProductCount"/> - </actionGroup> - - <!-- Check simple product on the category page --> - <actionGroup name="StorefrontCheckCategorySimpleProduct"> - <annotations> - <description>Validate that the provided Simple Product is present and correct on a Category page.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <seeElement selector="{{StorefrontCategoryProductSection.ProductTitleByName(product.name)}}" stepKey="assertProductName"/> - <see userInput="${{product.price}}.00" selector="{{StorefrontCategoryProductSection.ProductPriceByName(product.name)}}" stepKey="AssertProductPrice"/> - <!-- @TODO: MAGETWO-80272 Move to Magento_Checkout --> - <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct"/> - <!-- @TODO: MAGETWO-80272 Move to Magento_Checkout --> - <seeElement selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="AssertAddToCart"/> - </actionGroup> - - <actionGroup name="AssertProductOnCategoryPageActionGroup" extends="StorefrontCheckCategorySimpleProduct"> - <annotations> - <description>EXTENDS:StorefrontCheckCategorySimpleProduct. Removes 'AssertProductPrice', 'moveMouseOverProduct', 'AssertAddToCart'</description> - </annotations> - <remove keyForRemoval="AssertProductPrice"/> - <remove keyForRemoval="moveMouseOverProduct"/> - <remove keyForRemoval="AssertAddToCart"/> - </actionGroup> - - <actionGroup name="StorefrontCheckAddToCartButtonAbsence"> - <arguments> - <argument name="product" defaultValue="_defaultProduct"/> - </arguments> - <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct" /> - <dontSeeElement selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="checkAddToCartButtonAbsence"/> - </actionGroup> - <actionGroup name="StorefrontSwitchCategoryViewToListMode"> - <annotations> - <description>Switch the Storefront Category view to List.</description> - </annotations> - - <click selector="{{StorefrontCategoryMainSection.modeListButton}}" stepKey="switchCategoryViewToListMode"/> - <waitForElement selector="{{StorefrontCategoryMainSection.CategoryTitle}}" time="30" stepKey="waitForCategoryReload"/> - </actionGroup> - - <actionGroup name="GoToSubCategoryPage"> - <annotations> - <description>Goes to the Storefront page. Open the Parent Category menu in the Top Nav Menu. Click on a Subcategory. Validate that the Subcategory is present and correct.</description> - </annotations> - <arguments> - <argument name="parentCategory"/> - <argument name="subCategory"/> - <argument name="urlPath" type="string"/> - </arguments> - - <moveMouseOver selector="{{StorefrontHeaderSection.NavigationCategoryByName(parentCategory.name)}}" stepKey="moveMouseOnMainCategory"/> - <waitForElementVisible selector="{{StorefrontHeaderSection.NavigationCategoryByName(subCategory.name)}}" stepKey="waitForSubCategoryVisible"/> - <click selector="{{StorefrontHeaderSection.NavigationCategoryByName(subCategory.name)}}" stepKey="goToCategory"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <seeInCurrentUrl url="{{urlPath}}.html" stepKey="checkUrl"/> - <seeInTitle userInput="{{subCategory.name}}" stepKey="assertCategoryNameInTitle"/> - <see userInput="{{subCategory.name}}" selector="{{StorefrontCategoryMainSection.CategoryTitle}}" stepKey="assertCategoryName"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCategoryPageSortAscendingActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCategoryPageSortAscendingActionGroup.xml new file mode 100644 index 0000000000000..f456ca6bece55 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCategoryPageSortAscendingActionGroup.xml @@ -0,0 +1,17 @@ +<?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="StorefrontCategoryPageSortAscendingActionGroup"> + <annotations> + <description>Set Ascending Direction for sorting Products on Category page</description> + </annotations> + <click selector="{{StorefrontCategoryTopToolbarSection.sortDirectionAsc}}" stepKey="setAscendingDirection"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCategoryPageSortDescendingActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCategoryPageSortDescendingActionGroup.xml new file mode 100644 index 0000000000000..839260b3339c8 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCategoryPageSortDescendingActionGroup.xml @@ -0,0 +1,17 @@ +<?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="StorefrontCategoryPageSortDescendingActionGroup"> + <annotations> + <description>Set Descending Direction for sorting Products on Category page</description> + </annotations> + <click selector="{{StorefrontCategoryTopToolbarSection.sortDirectionDesc}}" stepKey="setDescendingDirection"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCategoryPageSortProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCategoryPageSortProductActionGroup.xml index 64dd2c97a382f..5744ddaf6c69a 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCategoryPageSortProductActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCategoryPageSortProductActionGroup.xml @@ -17,16 +17,4 @@ </arguments> <selectOption selector="{{StorefrontCategoryTopToolbarSection.sortByDropdown}}" userInput="{{sortBy}}" stepKey="selectSortByParameter"/> </actionGroup> - <actionGroup name="StorefrontCategoryPageSortAscendingActionGroup"> - <annotations> - <description>Set Ascending Direction for sorting Products on Category page</description> - </annotations> - <click selector="{{StorefrontCategoryTopToolbarSection.sortDirectionAsc}}" stepKey="setAscendingDirection"/> - </actionGroup> - <actionGroup name="StorefrontCategoryPageSortDescendingActionGroup"> - <annotations> - <description>Set Descending Direction for sorting Products on Category page</description> - </annotations> - <click selector="{{StorefrontCategoryTopToolbarSection.sortDirectionDesc}}" stepKey="setDescendingDirection"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckAddToCartButtonAbsenceActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckAddToCartButtonAbsenceActionGroup.xml new file mode 100644 index 0000000000000..66eb61b4aa8ec --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckAddToCartButtonAbsenceActionGroup.xml @@ -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="StorefrontCheckAddToCartButtonAbsenceActionGroup"> + <arguments> + <argument name="product" defaultValue="_defaultProduct"/> + </arguments> + <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct" /> + <dontSeeElement selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="checkAddToCartButtonAbsence"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckCategoryActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckCategoryActionGroup.xml new file mode 100644 index 0000000000000..695ba39f5d397 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckCategoryActionGroup.xml @@ -0,0 +1,25 @@ +<?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="StorefrontCheckCategoryActionGroup"> + <annotations> + <description>Validate that the Storefront Category is present and correct.</description> + </annotations> + <arguments> + <argument name="category"/> + <argument name="productCount" type="string"/> + </arguments> + + <seeInCurrentUrl url="/{{category.custom_attributes[url_key]}}.html" stepKey="checkUrl"/> + <seeInTitle userInput="{{category.name}}" stepKey="assertCategoryNameInTitle"/> + <see userInput="{{category.name}}" selector="{{StorefrontCategoryMainSection.CategoryTitle}}" stepKey="assertCategoryName"/> + <see userInput="{{productCount}}" selector="{{StorefrontCategoryMainSection.productCount}} span" stepKey="assertProductCount"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckCategorySimpleProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckCategorySimpleProductActionGroup.xml new file mode 100644 index 0000000000000..1f8234498ffa7 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckCategorySimpleProductActionGroup.xml @@ -0,0 +1,26 @@ +<?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="StorefrontCheckCategorySimpleProductActionGroup"> + <annotations> + <description>Validate that the provided Simple Product is present and correct on a Category page.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <seeElement selector="{{StorefrontCategoryProductSection.ProductTitleByName(product.name)}}" stepKey="assertProductName"/> + <see userInput="${{product.price}}.00" selector="{{StorefrontCategoryProductSection.ProductPriceByName(product.name)}}" stepKey="AssertProductPrice"/> + <!-- @TODO: MAGETWO-80272 Move to Magento_Checkout --> + <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct"/> + <!-- @TODO: MAGETWO-80272 Move to Magento_Checkout --> + <seeElement selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="AssertAddToCart"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckCompareSidebarProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckCompareSidebarProductActionGroup.xml new file mode 100644 index 0000000000000..220fe29337d5a --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckCompareSidebarProductActionGroup.xml @@ -0,0 +1,21 @@ +<?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="StorefrontCheckCompareSidebarProductActionGroup"> + <annotations> + <description>Validate that the Product Name is present and correct in the Compare Product list.</description> + </annotations> + <arguments> + <argument name="productVar"/> + </arguments> + + <waitForElement selector="{{StorefrontComparisonSidebarSection.ProductTitleByName(productVar.name)}}" stepKey="waitForProduct"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckCompareSimpleProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckCompareSimpleProductActionGroup.xml new file mode 100644 index 0000000000000..d7515d19ffbbd --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckCompareSimpleProductActionGroup.xml @@ -0,0 +1,25 @@ +<?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="StorefrontCheckCompareSimpleProductActionGroup"> + <annotations> + <description>Validate that the Simple Product is present and correct in the Compare Product area.</description> + </annotations> + <arguments> + <argument name="productVar"/> + </arguments> + + <seeElement selector="{{StorefrontProductCompareMainSection.ProductLinkByName(productVar.name)}}" stepKey="assertProductName"/> + <see userInput="${{productVar.price}}.00" selector="{{StorefrontProductCompareMainSection.ProductPriceByName(productVar.name)}}" stepKey="assertProductPrice1"/> + <see userInput="{{productVar.sku}}" selector="{{StorefrontProductCompareMainSection.ProductAttributeByCodeAndProductName('SKU', productVar.name)}}" stepKey="assertProductPrice2"/> + <!-- @TODO: MAGETWO-80272 Move to Magento_Checkout --> + <seeElement selector="{{StorefrontProductCompareMainSection.ProductAddToCartByName(productVar.name)}}" stepKey="assertProductAddToCart"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckProductIsMissingInCategoryProductsPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckProductIsMissingInCategoryProductsPageActionGroup.xml index 01751a32d2e06..a386d81f31999 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckProductIsMissingInCategoryProductsPageActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckProductIsMissingInCategoryProductsPageActionGroup.xml @@ -15,11 +15,4 @@ </arguments> <dontSee selector="{{StorefrontCategoryProductSection.ProductTitleByName(productName)}}" stepKey="dontSeeCorrectProductsOnStorefront"/> </actionGroup> - <actionGroup name="StorefrontCheckProductPositionActionGroup"> - <arguments> - <argument name="position" type="string"/> - <argument name="productName" type="string"/> - </arguments> - <see selector="{{StorefrontCategoryProductSection.ProductInfoByNumber(position)}}" userInput="{{productName}}" stepKey="assertProductPosition"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckProductPositionActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckProductPositionActionGroup.xml new file mode 100644 index 0000000000000..ce92966eb1fbf --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckProductPositionActionGroup.xml @@ -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="StorefrontCheckProductPositionActionGroup"> + <arguments> + <argument name="position" type="string"/> + <argument name="productName" type="string"/> + </arguments> + <see selector="{{StorefrontCategoryProductSection.ProductInfoByNumber(position)}}" userInput="{{productName}}" stepKey="assertProductPosition"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckProductPriceInCategoryActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckProductPriceInCategoryActionGroup.xml index ac33727564505..fd843a68b9720 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckProductPriceInCategoryActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckProductPriceInCategoryActionGroup.xml @@ -9,7 +9,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <!-- You must already be on the category page --> - <actionGroup name="StorefrontCheckProductPriceInCategoryActionGroup" extends="StorefrontCheckCategorySimpleProduct"> + <actionGroup name="StorefrontCheckProductPriceInCategoryActionGroup" extends="StorefrontCheckCategorySimpleProductActionGroup"> <annotations> <description>EXTENDS: StorefrontCheckCategorySimpleProduct. Removes 'AssertProductPrice'. Validates that the provided Product Price is present and correct on a Storefront Product page.</description> </annotations> @@ -17,14 +17,4 @@ <remove keyForRemoval="AssertProductPrice"/> <see userInput="{{product.price}}" selector="{{StorefrontCategoryProductSection.ProductPriceByName(product.name)}}" stepKey="AssertProductPrice"/> </actionGroup> - <actionGroup name="StorefrontAssertProductPriceOnCategoryPageActionGroup" extends="StorefrontAssertProductPriceOnProductPageActionGroup"> - <annotations> - <description>Validate that the provided Product Price is correct on category page.</description> - </annotations> - <arguments> - <argument name="productName" type="string"/> - </arguments> - - <see userInput="{{productPrice}}" selector="{{StorefrontCategoryProductSection.ProductPriceByName(productName)}}" stepKey="seeProductPrice"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckSimpleProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckSimpleProductActionGroup.xml new file mode 100644 index 0000000000000..a2ebf93805819 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckSimpleProductActionGroup.xml @@ -0,0 +1,30 @@ +<?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"> + <!-- Check the simple product on the product page --> + <actionGroup name="StorefrontCheckSimpleProductActionGroup"> + <annotations> + <description>Validates that the provided Simple Product information is present and correct.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <seeInCurrentUrl url="/{{product.custom_attributes[url_key]}}.html" stepKey="checkUrl"/> + <seeInTitle userInput="{{product.name}}" stepKey="AssertProductNameInTitle"/> + <see userInput="{{product.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertProductName"/> + <see userInput="{{product.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="assertProductSku"/> + <see userInput="${{product.price}}.00" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="assertProductPrice"/> + <see userInput="IN STOCK" selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="assertInStock"/> + <seeElement selector="{{StorefrontProductInfoMainSection.AddToCart}}" stepKey="assertAddToCart"/> + <see userInput="{{product.custom_attributes[description]}}" selector="{{StorefrontProductInfoMainSection.productDescription}}" stepKey="assertProductDescription"/> + <see userInput="{{product.custom_attributes[short_description]}}" selector="{{StorefrontProductInfoMainSection.productShortDescription}}" stepKey="assertProductShortDescription"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontClearCompareActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontClearCompareActionGroup.xml new file mode 100644 index 0000000000000..995bf7efd3f39 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontClearCompareActionGroup.xml @@ -0,0 +1,24 @@ +<?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="StorefrontClearCompareActionGroup"> + <annotations> + <description>Clear the Compare Products list. Validate that the Compare Products list is empty.</description> + </annotations> + + <waitForElementVisible selector="{{StorefrontComparisonSidebarSection.ClearAll}}" time="30" stepKey="waitForClearAll"/> + <click selector="{{StorefrontComparisonSidebarSection.ClearAll}}" stepKey="clickClearAll"/> + <waitForElementVisible selector="{{ModalConfirmationSection.OkButton}}" time="30" stepKey="waitForClearOk"/> + <scrollTo selector="{{ModalConfirmationSection.OkButton}}" stepKey="scrollToClearOk"/> + <click selector="{{ModalConfirmationSection.OkButton}}" stepKey="clickClearOk"/> + <waitForElement selector="{{StorefrontMessagesSection.message('You cleared the comparison list.')}}" time="30" stepKey="AssertMessageCleared"/> + <waitForElement selector="{{StorefrontComparisonSidebarSection.NoItemsMessage}}" time="30" stepKey="assertNoItems"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCompareActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCompareActionGroup.xml deleted file mode 100644 index b10b74c919918..0000000000000 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCompareActionGroup.xml +++ /dev/null @@ -1,95 +0,0 @@ -<?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"> - <!-- Add Product to Compare from the category page and check message --> - <actionGroup name="StorefrontAddCategoryProductToCompareActionGroup"> - <annotations> - <description>Add a Product to the Compare Product list from a Category page.</description> - </annotations> - <arguments> - <argument name="productVar"/> - </arguments> - - <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(productVar.name)}}" stepKey="moveMouseOverProduct"/> - <click selector="{{StorefrontCategoryProductSection.ProductAddToCompareByName(productVar.name)}}" stepKey="clickAddProductToCompare"/> - <waitForElement selector="{{StorefrontMessagesSection.success}}" time="30" stepKey="waitForAddCategoryProductToCompareSuccessMessage"/> - <see selector="{{StorefrontMessagesSection.success}}" userInput="You added product {{productVar.name}} to the comparison list." stepKey="assertAddCategoryProductToCompareSuccessMessage"/> - </actionGroup> - - <!-- Add Product to Compare from the product page and check message --> - <actionGroup name="StorefrontAddProductToCompareActionGroup"> - <annotations> - <description>Add a Product to the Compare Product list. Validate that the Success Message is present.</description> - </annotations> - <arguments> - <argument name="productVar"/> - </arguments> - - <click selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="clickAddToCompare"/> - <waitForElement selector="{{StorefrontMessagesSection.success}}" time="30" stepKey="waitForAddProductToCompareSuccessMessage"/> - <see selector="{{StorefrontMessagesSection.success}}" userInput="You added product {{productVar.name}} to the comparison list." stepKey="assertAddProductToCompareSuccessMessage"/> - </actionGroup> - - <!-- Check the product in compare sidebar --> - <actionGroup name="StorefrontCheckCompareSidebarProductActionGroup"> - <annotations> - <description>Validate that the Product Name is present and correct in the Compare Product list.</description> - </annotations> - <arguments> - <argument name="productVar"/> - </arguments> - - <waitForElement selector="{{StorefrontComparisonSidebarSection.ProductTitleByName(productVar.name)}}" stepKey="waitForProduct"/> - </actionGroup> - - <!-- Open and check comparison page --> - <actionGroup name="StorefrontOpenAndCheckComparisionActionGroup"> - <annotations> - <description>Open the Storefront Compare Product page. Validate that the Compare Product fields are present.</description> - </annotations> - - <click selector="{{StorefrontComparisonSidebarSection.Compare}}" stepKey="clickCompare"/> - <waitForLoadingMaskToDisappear stepKey="waitForComparePageloaded"/> - <seeInCurrentUrl url="{{StorefrontProductComparePage.url}}" stepKey="checkUrl"/> - <seeInTitle userInput="Products Comparison List" stepKey="assertPageNameInTitle"/> - <see userInput="Compare Products" selector="{{StorefrontProductCompareMainSection.PageName}}" stepKey="assertPageName"/> - </actionGroup> - - <!-- Check the simple product in comparison page --> - <actionGroup name="StorefrontCheckCompareSimpleProductActionGroup"> - <annotations> - <description>Validate that the Simple Product is present and correct in the Compare Product area.</description> - </annotations> - <arguments> - <argument name="productVar"/> - </arguments> - - <seeElement selector="{{StorefrontProductCompareMainSection.ProductLinkByName(productVar.name)}}" stepKey="assertProductName"/> - <see userInput="${{productVar.price}}.00" selector="{{StorefrontProductCompareMainSection.ProductPriceByName(productVar.name)}}" stepKey="assertProductPrice1"/> - <see userInput="{{productVar.sku}}" selector="{{StorefrontProductCompareMainSection.ProductAttributeByCodeAndProductName('SKU', productVar.name)}}" stepKey="assertProductPrice2"/> - <!-- @TODO: MAGETWO-80272 Move to Magento_Checkout --> - <seeElement selector="{{StorefrontProductCompareMainSection.ProductAddToCartByName(productVar.name)}}" stepKey="assertProductAddToCart"/> - </actionGroup> - - <!-- Clear the compare list --> - <actionGroup name="StorefrontClearCompareActionGroup"> - <annotations> - <description>Clear the Compare Products list. Validate that the Compare Products list is empty.</description> - </annotations> - - <waitForElementVisible selector="{{StorefrontComparisonSidebarSection.ClearAll}}" time="30" stepKey="waitForClearAll"/> - <click selector="{{StorefrontComparisonSidebarSection.ClearAll}}" stepKey="clickClearAll"/> - <waitForElementVisible selector="{{ModalConfirmationSection.OkButton}}" time="30" stepKey="waitForClearOk"/> - <scrollTo selector="{{ModalConfirmationSection.OkButton}}" stepKey="scrollToClearOk"/> - <click selector="{{ModalConfirmationSection.OkButton}}" stepKey="clickClearOk"/> - <waitForElement selector="{{StorefrontMessagesSection.message('You cleared the comparison list.')}}" time="30" stepKey="AssertMessageCleared"/> - <waitForElement selector="{{StorefrontComparisonSidebarSection.NoItemsMessage}}" time="30" stepKey="assertNoItems"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontGoToCategoryPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontGoToCategoryPageActionGroup.xml index e8be0db38fe2c..080f3264c037b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontGoToCategoryPageActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontGoToCategoryPageActionGroup.xml @@ -17,11 +17,4 @@ <click selector="{{StorefrontHeaderSection.NavigationCategoryByName(categoryName)}}" stepKey="toCategory"/> <waitForPageLoad stepKey="waitForCategoryPage"/> </actionGroup> - <actionGroup name="StorefrontGoToSubCategoryPageActionGroup" extends="StorefrontGoToCategoryPageActionGroup"> - <arguments> - <argument name="subCategoryName" type="string"/> - </arguments> - <moveMouseOver selector="{{StorefrontHeaderSection.NavigationCategoryByName(categoryName)}}" stepKey="toCategory"/> - <click selector="{{StorefrontHeaderSection.NavigationCategoryByName(subCategoryName)}}" stepKey="openSubCategory" after="toCategory"/> - </actionGroup> -</actionGroups> \ No newline at end of file +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontGoToSubCategoryPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontGoToSubCategoryPageActionGroup.xml new file mode 100644 index 0000000000000..71c51a9b9f567 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontGoToSubCategoryPageActionGroup.xml @@ -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="StorefrontGoToSubCategoryPageActionGroup" extends="StorefrontGoToCategoryPageActionGroup"> + <arguments> + <argument name="subCategoryName" type="string"/> + </arguments> + <moveMouseOver selector="{{StorefrontHeaderSection.NavigationCategoryByName(categoryName)}}" stepKey="toCategory"/> + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName(subCategoryName)}}" stepKey="openSubCategory" after="toCategory"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontOpenAndCheckComparisionActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontOpenAndCheckComparisionActionGroup.xml new file mode 100644 index 0000000000000..1bb58d15bc096 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontOpenAndCheckComparisionActionGroup.xml @@ -0,0 +1,22 @@ +<?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="StorefrontOpenAndCheckComparisionActionGroup"> + <annotations> + <description>Open the Storefront Compare Product page. Validate that the Compare Product fields are present.</description> + </annotations> + + <click selector="{{StorefrontComparisonSidebarSection.Compare}}" stepKey="clickCompare"/> + <waitForLoadingMaskToDisappear stepKey="waitForComparePageloaded"/> + <seeInCurrentUrl url="{{StorefrontProductComparePage.url}}" stepKey="checkUrl"/> + <seeInTitle userInput="Products Comparison List" stepKey="assertPageNameInTitle"/> + <see userInput="Compare Products" selector="{{StorefrontProductCompareMainSection.PageName}}" stepKey="assertPageName"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontOpenProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontOpenProductPageActionGroup.xml index e0229906ad558..899603aa27d75 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontOpenProductPageActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontOpenProductPageActionGroup.xml @@ -18,15 +18,4 @@ <amOnPage url="{{StorefrontProductPage.url(productUrl)}}" stepKey="openProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoaded"/> </actionGroup> - <actionGroup name="StorefrontOpenProductPageOnSecondStore"> - <annotations> - <description>Goes to the Storefront Product page for the provided store code and Product URL.</description> - </annotations> - <arguments> - <argument name="storeCode" type="string"/> - <argument name="productUrl" type="string"/> - </arguments> - - <amOnPage url="{{StorefrontStoreViewProductPage.url(storeCode,productUrl)}}" stepKey="openProductPage"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontOpenProductPageOnSecondStoreActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontOpenProductPageOnSecondStoreActionGroup.xml new file mode 100644 index 0000000000000..00956e2099085 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontOpenProductPageOnSecondStoreActionGroup.xml @@ -0,0 +1,22 @@ +<?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="StorefrontOpenProductPageOnSecondStoreActionGroup"> + <annotations> + <description>Goes to the Storefront Product page for the provided store code and Product URL.</description> + </annotations> + <arguments> + <argument name="storeCode" type="string"/> + <argument name="productUrl" type="string"/> + </arguments> + + <amOnPage url="{{StorefrontStoreViewProductPage.url(storeCode,productUrl)}}" stepKey="openProductPage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontProductActionGroup.xml deleted file mode 100644 index 403b5b853d80c..0000000000000 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontProductActionGroup.xml +++ /dev/null @@ -1,90 +0,0 @@ -<?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"> - <!-- Check the simple product on the product page --> - <actionGroup name="StorefrontCheckSimpleProduct"> - <annotations> - <description>Validates that the provided Simple Product information is present and correct.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <seeInCurrentUrl url="/{{product.custom_attributes[url_key]}}.html" stepKey="checkUrl"/> - <seeInTitle userInput="{{product.name}}" stepKey="AssertProductNameInTitle"/> - <see userInput="{{product.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertProductName"/> - <see userInput="{{product.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="assertProductSku"/> - <see userInput="${{product.price}}.00" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="assertProductPrice"/> - <see userInput="IN STOCK" selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="assertInStock"/> - <seeElement selector="{{StorefrontProductInfoMainSection.AddToCart}}" stepKey="assertAddToCart"/> - <see userInput="{{product.custom_attributes[description]}}" selector="{{StorefrontProductInfoMainSection.productDescription}}" stepKey="assertProductDescription"/> - <see userInput="{{product.custom_attributes[short_description]}}" selector="{{StorefrontProductInfoMainSection.productShortDescription}}" stepKey="assertProductShortDescription"/> - </actionGroup> - - <!-- Assert product image in Storefront Product page --> - <actionGroup name="assertProductImageStorefrontProductPage"> - <annotations> - <description>Validates that the provided Product Image is present.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="image" defaultValue="MagentoLogo"/> - </arguments> - - <seeInCurrentUrl url="/{{product.urlKey}}.html" stepKey="checkUrl"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <seeElement selector="{{StorefrontProductMediaSection.imageFile(image.filename)}}" stepKey="seeImage"/> - </actionGroup> - - <!-- Assert product image in Storefront Product page --> - <actionGroup name="assertProductImageStorefrontProductPage2"> - <annotations> - <description>Validates that the provided Product Image is present.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="image" defaultValue="MagentoLogo"/> - </arguments> - - <seeInCurrentUrl url="/{{product.custom_attributes[url_key]}}.html" stepKey="checkUrl"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <seeElement selector="{{StorefrontProductMediaSection.imageFile(image.filename)}}" stepKey="seeImage"/> - </actionGroup> - - <!-- Assert no product image in Storefront Product page --> - <actionGroup name="assertProductImageNotInStorefrontProductPage"> - <annotations> - <description>Validates that the provided Product Image is not present.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="image" defaultValue="MagentoLogo"/> - </arguments> - - <seeInCurrentUrl url="/{{product.urlKey}}.html" stepKey="checkUrl"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <dontSeeElement selector="{{StorefrontProductMediaSection.imageFile(image.filename)}}" stepKey="seeImage"/> - </actionGroup> - - <!-- Assert no product image in Storefront Product page --> - <actionGroup name="assertProductImageNotInStorefrontProductPage2"> - <annotations> - <description>Validates that the provided Product Image is not present.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="image" defaultValue="MagentoLogo"/> - </arguments> - - <seeInCurrentUrl url="/{{product.custom_attributes[url_key]}}.html" stepKey="checkUrl"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <dontSeeElement selector="{{StorefrontProductMediaSection.imageFile(image.filename)}}" stepKey="seeImage"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontProductPageActionGroup.xml deleted file mode 100644 index c960f14b1cd48..0000000000000 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontProductPageActionGroup.xml +++ /dev/null @@ -1,87 +0,0 @@ -<?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"> - <!--Click Add to Cart button in storefront product page--> - <actionGroup name="addToCartFromStorefrontProductPage"> - <annotations> - <description>Click on the Add to Cart button. Validates that the Success Message is present.</description> - </annotations> - <arguments> - <argument name="productName"/> - </arguments> - - <click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="addToCart"/> - <waitForPageLoad stepKey="waitForAddToCart"/> - <waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdding}}" stepKey="waitForElementNotVisibleAddToCartButtonTitleIsAdding"/> - <waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdded}}" stepKey="waitForElementNotVisibleAddToCartButtonTitleIsAdded"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/> - <see selector="{{StorefrontMessagesSection.success}}" userInput="You added {{productName}} to your shopping cart." stepKey="seeAddToCartSuccessMessage"/> - </actionGroup> - - <actionGroup name="AddProductWithQtyToCartFromStorefrontProductPage" extends="addToCartFromStorefrontProductPage"> - <annotations> - <description>EXTENDS: addToCartFromStorefrontProductPage. Fills in the provided Product Quantity for the provided Product Name.</description> - </annotations> - <arguments> - <argument name="productName" type="string"/> - <argument name="productQty" type="string"/> - </arguments> - - <fillField selector="{{StorefrontProductActionSection.quantity}}" userInput="{{productQty}}" stepKey="fillProductQuantity" before="addToCart"/> - </actionGroup> - - <!--Verify text length validation hint with multiple inputs--> - <actionGroup name="testDynamicValidationHint"> - <annotations> - <description>Validates that the Product Text Option Text Length Hint displays the correct Count for multiple inputs based on the provided Character Limit.</description> - </annotations> - <arguments> - <argument name="charLimit"/> - </arguments> - - <fillField userInput="abcde" selector="{{StorefrontProductPageSection.customTextOptionInput}}" stepKey="textInput1"/> - <see selector="{{StorefrontProductPageSection.charCounter}}" userInput="(15 remaining)" stepKey="assertHint1"/> - <fillField userInput="abcdefghjklansdmnbv" selector="{{StorefrontProductPageSection.customTextOptionInput}}" stepKey="textInput2"/> - <see selector="{{StorefrontProductPageSection.charCounter}}" userInput="(1 remaining)" stepKey="assertHint2"/> - <fillField userInput="abcdefghjklansdmnbvd" selector="{{StorefrontProductPageSection.customTextOptionInput}}" stepKey="textInput3"/> - <see selector="{{StorefrontProductPageSection.charCounter}}" userInput="(0 remaining)" stepKey="assertHint3"/> - <fillField userInput="abcdefghjklansdmnbvds" selector="{{StorefrontProductPageSection.customTextOptionInput}}" stepKey="textInput4"/> - <see selector="{{StorefrontProductPageSection.charCounter}}" userInput="(1 too many)" stepKey="assertHint4"/> - <fillField userInput="abcdefghjklansdmnbvdsasdfghjmn" selector="{{StorefrontProductPageSection.customTextOptionInput}}" stepKey="textInput5"/> - <see selector="{{StorefrontProductPageSection.charCounter}}" userInput="(10 too many)" stepKey="assertHint5"/> - </actionGroup> - - <actionGroup name="checkAttributeInMoreInformationTab"> - <annotations> - <description>Validates that the Product More Information area contains the provided Text.</description> - </annotations> - <arguments> - <argument name="attributeLabel" type="string"/> - <argument name="attributeValue" type="string"/> - </arguments> - - <click selector="{{StorefrontProductMoreInformationSection.moreInformation}}" stepKey="clickTab"/> - <see userInput="{{attributeLabel}}" selector="{{StorefrontProductMoreInformationSection.moreInformationTextArea}}" stepKey="seeAttributeLabel"/> - <see userInput="{{attributeValue}}" selector="{{StorefrontProductMoreInformationSection.moreInformationTextArea}}" stepKey="seeAttributeValue"/> - </actionGroup> - - <actionGroup name="checkAttributeNotInMoreInformationTab"> - <annotations> - <description>Validate that the More Information area does not contain the provided Text.</description> - </annotations> - <arguments> - <argument name="attributeLabel" type="string"/> - </arguments> - - <click selector="{{StorefrontProductMoreInformationSection.moreInformation}}" stepKey="clickTab"/> - <dontSee userInput="{{attributeLabel}}" selector="{{StorefrontProductMoreInformationSection.moreInformationTextArea}}" stepKey="seeAttributeLabel"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontSwitchCategoryViewToListModeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontSwitchCategoryViewToListModeActionGroup.xml new file mode 100644 index 0000000000000..7e549294ecfe0 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontSwitchCategoryViewToListModeActionGroup.xml @@ -0,0 +1,19 @@ +<?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="StorefrontSwitchCategoryViewToListModeActionGroup"> + <annotations> + <description>Switch the Storefront Category view to List.</description> + </annotations> + + <click selector="{{StorefrontCategoryMainSection.modeListButton}}" stepKey="switchCategoryViewToListMode"/> + <waitForElement selector="{{StorefrontCategoryMainSection.CategoryTitle}}" time="30" stepKey="waitForCategoryReload"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SwitchCategoryStoreViewActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SwitchCategoryStoreViewActionGroup.xml new file mode 100644 index 0000000000000..e75a63581fb3c --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SwitchCategoryStoreViewActionGroup.xml @@ -0,0 +1,33 @@ +<?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="SwitchCategoryStoreViewActionGroup"> + <annotations> + <description>Navigates to category page, selects a category and changes store view to specified store.</description> + </annotations> + <arguments> + <argument name="Store"/> + <argument name="CatName"/> + </arguments> + + <amOnPage url="{{AdminCategoryPage.page}}" stepKey="amOnCategoryPage"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <click selector="{{AdminCategorySidebarTreeSection.categoryInTree(CatName)}}" stepKey="navigateToCreatedCategory"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + <waitForLoadingMaskToDisappear stepKey="waitForSpinner"/> + <scrollToTopOfPage stepKey="scrollToToggle"/> + <click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewDropdownToggle}}" stepKey="openStoreViewDropDown"/> + <click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewOption(Store)}}" stepKey="selectStoreView"/> + <waitForPageLoad stepKey="waitForPageLoad3"/> + <waitForLoadingMaskToDisappear stepKey="waitForSpinner2"/> + <click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewModalAccept}}" stepKey="selectStoreViewAccept"/> + <waitForPageLoad stepKey="waitForStoreViewChangeLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SwitchCategoryToAllStoreViewActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SwitchCategoryToAllStoreViewActionGroup.xml new file mode 100644 index 0000000000000..28ca577bb98f5 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SwitchCategoryToAllStoreViewActionGroup.xml @@ -0,0 +1,31 @@ +<?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="SwitchCategoryToAllStoreViewActionGroup"> + <annotations> + <description>Navigates to category page, selects a category and changes store view to all stores.</description> + </annotations> + <arguments> + <argument name="CatName"/> + </arguments> + + <click selector="{{AdminCategorySidebarTreeSection.categoryInTree(CatName)}}" stepKey="navigateToCreatedCategory"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <waitForLoadingMaskToDisappear stepKey="waitForSpinner1"/> + <scrollToTopOfPage stepKey="scrollToToggle"/> + <click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewDropdownToggle}}" stepKey="openStoreViewDropDown"/> + <click selector="{{AdminCategoryMainActionsSection.allStoreViews}}" stepKey="clickStoreViewByName"/> + <see selector="{{AdminCategoryMainActionsSection.storeSwitcher}}" userInput="All Store Views" stepKey="seeAllStoreView"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + <waitForLoadingMaskToDisappear stepKey="waitForSpinner2"/> + <click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewModalAccept}}" stepKey="selectStoreViewAccept"/> + <waitForPageLoad stepKey="waitForStoreViewChangeLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SwitchToTheNewStoreViewActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SwitchToTheNewStoreViewActionGroup.xml new file mode 100644 index 0000000000000..9dd1a2dc56d1e --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SwitchToTheNewStoreViewActionGroup.xml @@ -0,0 +1,26 @@ +<?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="SwitchToTheNewStoreViewActionGroup"> + <annotations> + <description>Switches the New Store View.</description> + </annotations> + <arguments> + <argument name="storeViewName" type="string"/> + </arguments> + + <scrollTo selector="{{AdminProductContentSection.pageHeader}}" stepKey="scrollToUp"/> + <waitForElementVisible selector="{{AdminProductFormActionSection.changeStoreButton}}" stepKey="waitForElementBecomeVisible"/> + <click selector="{{AdminProductFormActionSection.changeStoreButton}}" stepKey="clickStoreviewSwitcher"/> + <click selector="{{AdminProductFormActionSection.selectStoreView(storeViewName)}}" stepKey="chooseStoreView"/> + <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="acceptStoreSwitchingMessage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/TestDynamicValidationHintActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/TestDynamicValidationHintActionGroup.xml new file mode 100644 index 0000000000000..9e3f46e0400b2 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/TestDynamicValidationHintActionGroup.xml @@ -0,0 +1,30 @@ +<?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="TestDynamicValidationHintActionGroup"> + <annotations> + <description>Validates that the Product Text Option Text Length Hint displays the correct Count for multiple inputs based on the provided Character Limit.</description> + </annotations> + <arguments> + <argument name="charLimit"/> + </arguments> + + <fillField userInput="abcde" selector="{{StorefrontProductPageSection.customTextOptionInput}}" stepKey="textInput1"/> + <see selector="{{StorefrontProductPageSection.charCounter}}" userInput="(15 remaining)" stepKey="assertHint1"/> + <fillField userInput="abcdefghjklansdmnbv" selector="{{StorefrontProductPageSection.customTextOptionInput}}" stepKey="textInput2"/> + <see selector="{{StorefrontProductPageSection.charCounter}}" userInput="(1 remaining)" stepKey="assertHint2"/> + <fillField userInput="abcdefghjklansdmnbvd" selector="{{StorefrontProductPageSection.customTextOptionInput}}" stepKey="textInput3"/> + <see selector="{{StorefrontProductPageSection.charCounter}}" userInput="(0 remaining)" stepKey="assertHint3"/> + <fillField userInput="abcdefghjklansdmnbvds" selector="{{StorefrontProductPageSection.customTextOptionInput}}" stepKey="textInput4"/> + <see selector="{{StorefrontProductPageSection.charCounter}}" userInput="(1 too many)" stepKey="assertHint4"/> + <fillField userInput="abcdefghjklansdmnbvdsasdfghjmn" selector="{{StorefrontProductPageSection.customTextOptionInput}}" stepKey="textInput5"/> + <see selector="{{StorefrontProductPageSection.charCounter}}" userInput="(10 too many)" stepKey="assertHint5"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ToggleProductEnabledActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ToggleProductEnabledActionGroup.xml new file mode 100644 index 0000000000000..220d254f70c97 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ToggleProductEnabledActionGroup.xml @@ -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="ToggleProductEnabledActionGroup"> + <annotations> + <description>Clicks on the Enable Product toggle.</description> + </annotations> + + <click selector="{{AdminProductFormSection.enableProductLabel}}" stepKey="toggleEnabled"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/UnassignAttributeFromGroupActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/UnassignAttributeFromGroupActionGroup.xml new file mode 100644 index 0000000000000..d58fa1e71061d --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/UnassignAttributeFromGroupActionGroup.xml @@ -0,0 +1,26 @@ +<?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="UnassignAttributeFromGroupActionGroup"> + <annotations> + <description>Unassign the provided Attribute from an Attribute Set from the Attribute Sets creation/edit page.</description> + </annotations> + <arguments> + <argument name="group" type="string"/> + <argument name="attribute" type="string"/> + </arguments> + + <conditionalClick selector="{{AdminProductAttributeSetEditSection.attributeGroupExtender(group)}}" dependentSelector="{{AdminProductAttributeSetEditSection.attributeGroupCollapsed(group)}}" visible="true" stepKey="extendGroup"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <dragAndDrop selector1="{{AdminProductAttributeSetEditSection.assignedAttribute(attribute)}}" selector2="{{AdminProductAttributeSetEditSection.xThLineItemUnassignedAttribute('1')}}" stepKey="dragAndDropToUnassigned"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + <see userInput="{{attribute}}" selector="{{AdminProductAttributeSetEditSection.unassignedAttributesTree}}" stepKey="seeAttributeInUnassigned"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/UnassignWebsiteFromProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/UnassignWebsiteFromProductActionGroup.xml new file mode 100644 index 0000000000000..cee17cbc4b45e --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/UnassignWebsiteFromProductActionGroup.xml @@ -0,0 +1,15 @@ +<?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="UnassignWebsiteFromProductActionGroup" extends="SelectProductInWebsitesActionGroup"> + <remove keyForRemoval="selectWebsite"/> + <uncheckOption selector="{{ProductInWebsitesSection.website(website)}}" stepKey="unSelectWebsite" after="waitForPageOpened"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/VerifyCategoryPageParametersActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/VerifyCategoryPageParametersActionGroup.xml new file mode 100644 index 0000000000000..dff3ca46640df --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/VerifyCategoryPageParametersActionGroup.xml @@ -0,0 +1,29 @@ +<?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="VerifyCategoryPageParametersActionGroup"> + <annotations> + <description>Validate that the Category Page parameters are present and correct.</description> + </annotations> + <arguments> + <argument name="category"/> + <argument name="mode" type="string"/> + <argument name="numOfProductsPerPage" type="string"/> + <argument name="sortBy" type="string" defaultValue="position"/> + </arguments> + + <seeInCurrentUrl url="/{{category.custom_attributes[url_key]}}.html" stepKey="checkUrl"/> + <seeInTitle userInput="{{category.name}}" stepKey="assertCategoryNameInTitle"/> + <see userInput="{{category.name}}" selector="{{StorefrontCategoryMainSection.CategoryTitle}}" stepKey="assertCategoryName"/> + <see userInput="{{mode}}" selector="{{StorefrontCategoryMainSection.modeGridIsActive}}" stepKey="assertViewMode"/> + <see userInput="{{numOfProductsPerPage}}" selector="{{StorefrontCategoryMainSection.perPage}}" stepKey="assertNumberOfProductsPerPage"/> + <see userInput="{{sortBy}}" selector="{{StorefrontCategoryMainSection.sortedBy}}" stepKey="assertSortedBy"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ViewProductInAdminGridActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ViewProductInAdminGridActionGroup.xml new file mode 100644 index 0000000000000..9e9c7bc323eb3 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ViewProductInAdminGridActionGroup.xml @@ -0,0 +1,31 @@ +<?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="ViewProductInAdminGridActionGroup"> + <annotations> + <description>Filters the Admin Products grid by the provided Product (Name, SKU and Type).</description> + </annotations> + <arguments> + <argument name="product" defaultValue="_defaultProduct"/> + </arguments> + + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> + <waitForPageLoad stepKey="waitForPageLoadInitial"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{product.name}}" stepKey="fillProductNameFilter"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> + <selectOption selector="{{AdminProductGridFilterSection.typeFilter}}" userInput="{{product.type_id}}" stepKey="selectionProductType"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <see selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="{{product.name}}" stepKey="seeProductNameInGrid"/> + <see selector="{{AdminProductGridSection.productGridCell('1', 'Price')}}" userInput="{{product.price}}" stepKey="seeProductPriceInGrid"/> + <click selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="clickClearFiltersAfter"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AddToCartCrossSellTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AddToCartCrossSellTest.xml index 53bb12fda4833..7c0161d443df6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AddToCartCrossSellTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AddToCartCrossSellTest.xml @@ -45,10 +45,10 @@ <amOnPage url="{{AdminProductEditPage.url($simpleProduct1.id$)}}" stepKey="goToProduct1"/> <click stepKey="openHeader1" selector="{{AdminProductFormRelatedUpSellCrossSellSection.sectionHeader}}"/> - <actionGroup ref="addCrossSellProductBySku" stepKey="addProduct2ToSimp1"> + <actionGroup ref="AddCrossSellProductBySkuActionGroup" stepKey="addProduct2ToSimp1"> <argument name="sku" value="$simpleProduct2.sku$"/> </actionGroup> - <actionGroup ref="addCrossSellProductBySku" stepKey="addProduct3ToSimp1"> + <actionGroup ref="AddCrossSellProductBySkuActionGroup" stepKey="addProduct3ToSimp1"> <argument name="sku" value="$simpleProduct3.sku$"/> </actionGroup> <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSave"/> @@ -58,17 +58,17 @@ <amOnPage url="{{AdminProductEditPage.url($simpleProduct3.id$)}}" stepKey="goToProduct3"/> <click stepKey="openHeader2" selector="{{AdminProductFormRelatedUpSellCrossSellSection.sectionHeader}}"/> - <actionGroup ref="addCrossSellProductBySku" stepKey="addProduct1ToSimp3"> + <actionGroup ref="AddCrossSellProductBySkuActionGroup" stepKey="addProduct1ToSimp3"> <argument name="sku" value="$simpleProduct1.sku$"/> </actionGroup> - <actionGroup ref="addCrossSellProductBySku" stepKey="addProduct2ToSimp3"> + <actionGroup ref="AddCrossSellProductBySkuActionGroup" stepKey="addProduct2ToSimp3"> <argument name="sku" value="$simpleProduct2.sku$"/> </actionGroup> <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSave2"/> <waitForPageLoad stepKey="waitForPageLoad2"/> <!-- Go to frontend, add simpleProduct1 to cart--> - <actionGroup ref="AddSimpleProductToCart" stepKey="addSimp1ToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimp1ToCart"> <argument name="product" value="$simpleProduct1$"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageSimpleProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageSimpleProductTest.xml index 117f094ee0607..ac1f967b66e41 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageSimpleProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageSimpleProductTest.xml @@ -28,32 +28,32 @@ <!--Create product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPage"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateSimpleProduct"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateSimpleProduct"> <argument name="product" value="SimpleProduct3"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillSimpleProductMain"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillSimpleProductMain"> <argument name="product" value="SimpleProduct3"/> </actionGroup> <!-- Add image to product --> - <actionGroup ref="addProductImage" stepKey="addImageForProductSimple"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageForProductSimple"> <argument name="image" value="MagentoLogo"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveSimpleProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSimpleProduct"/> <!-- Assert product image in admin product form --> - <actionGroup ref="assertProductImageAdminProductPage" stepKey="assertProductImageAdminProductPage"> + <actionGroup ref="AssertProductImageAdminProductPageActionGroup" stepKey="assertProductImageAdminProductPage"> <argument name="image" value="MagentoLogo"/> </actionGroup> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="SimpleProduct3"/> </actionGroup> <!-- Assert product image in storefront product page --> - <actionGroup ref="assertProductImageStorefrontProductPage" stepKey="assertProductImageStorefrontProductPage"> + <actionGroup ref="AssertProductImageStorefrontProductPageActionGroup" stepKey="assertProductImageStorefrontProductPage"> <argument name="product" value="SimpleProduct3"/> <argument name="image" value="MagentoLogo"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageVirtualProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageVirtualProductTest.xml index 3f857c258924f..367827f8c0c28 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageVirtualProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageVirtualProductTest.xml @@ -28,30 +28,30 @@ <!--Create product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPage"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillProductMain"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillProductMain"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> <!-- Add image to product --> - <actionGroup ref="addProductImage" stepKey="addImageForProduct"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageForProduct"> <argument name="image" value="MagentoLogo"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Assert product image in admin product form --> - <actionGroup ref="assertProductImageAdminProductPage" stepKey="assertProductImageAdminProductPage"/> + <actionGroup ref="AssertProductImageAdminProductPageActionGroup" stepKey="assertProductImageAdminProductPage"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> <!-- Assert product image in storefront product page --> - <actionGroup ref="assertProductImageStorefrontProductPage" stepKey="assertProductImageStorefrontProductPage"> + <actionGroup ref="AssertProductImageStorefrontProductPageActionGroup" stepKey="assertProductImageStorefrontProductPage"> <argument name="product" value="defaultVirtualProduct"/> <argument name="image" value="MagentoLogo"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultVideoSimpleProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultVideoSimpleProductTest.xml index f657fbbdae607..0b33ef0ac0783 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultVideoSimpleProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultVideoSimpleProductTest.xml @@ -29,19 +29,19 @@ <!-- Create product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="adminProductIndexPageAdd"/> <waitForPageLoad stepKey="waitForProductIndexPageLoad"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProductPage"> <argument name="product" value="ApiSimpleProduct"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillMainProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillMainProductForm"> <argument name="product" value="ApiSimpleProduct"/> </actionGroup> <!-- Save product --> - <actionGroup ref="saveProductForm" stepKey="saveProductForm"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="ApiSimpleProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultVideoVirtualProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultVideoVirtualProductTest.xml index eab36bc90dc18..e89cf6f4242e7 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultVideoVirtualProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultVideoVirtualProductTest.xml @@ -21,13 +21,13 @@ <!-- Replacing steps in base AdminAddDefaultVideoSimpleProductTest --> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProductPage"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillMainProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillMainProductForm"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> - <actionGroup ref="AssertProductInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageForCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageForCategoryTest.xml index 8ac0cfa512b03..ed9eb686d2c86 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageForCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageForCategoryTest.xml @@ -22,27 +22,27 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> </before> <after> - <actionGroup ref="DeleteCategory" stepKey="DeleteCategory"> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="DeleteCategory"> <argument name="categoryEntity" value="SimpleSubCategory"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> </after> <!-- Go to create a new category with image --> - <actionGroup ref="goToCreateCategoryPage" stepKey="goToCreateCategoryPage"/> - <actionGroup ref="fillCategoryForm" stepKey="fillCategoryForm"> + <actionGroup ref="GoToCreateCategoryPageActionGroup" stepKey="goToCreateCategoryPage"/> + <actionGroup ref="FillCategoryFormActionGroup" stepKey="fillCategoryForm"> <argument name="categoryEntity" value="SimpleSubCategory"/> </actionGroup> - <actionGroup ref="addCategoryImage" stepKey="addCategoryImage"/> - <actionGroup ref="saveCategoryForm" stepKey="saveCategoryForm"/> + <actionGroup ref="AddCategoryImageActionGroup" stepKey="addCategoryImage"/> + <actionGroup ref="SaveCategoryFormActionGroup" stepKey="saveCategoryForm"/> <!-- Verify category with image in admin --> - <actionGroup ref="checkCategoryImageInAdmin" stepKey="checkCategoryImageInAdmin"/> + <actionGroup ref="CheckCategoryImageInAdminActionGroup" stepKey="checkCategoryImageInAdmin"/> <!-- Verify category with image in storefront --> - <actionGroup ref="CheckCategoryOnStorefront" stepKey="CheckCategoryOnStorefront"> + <actionGroup ref="CheckCategoryOnStorefrontActionGroup" stepKey="CheckCategoryOnStorefront"> <argument name="categoryEntity" value="SimpleSubCategory"/> </actionGroup> <seeElement selector="{{StorefrontCategoryMainSection.imageSource(ProductImage.filename)}}" stepKey="seeImage"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGCatalogTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGCatalogTest.xml index c36c29ce594d0..4bb41ff906f61 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGCatalogTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGCatalogTest.xml @@ -51,7 +51,7 @@ <seeElement selector="{{StorefrontCategoryMainSection.mediaDescription(ImageUpload3.content)}}" stepKey="assertMediaDescription"/> <seeElementInDOM selector="{{StorefrontCategoryMainSection.imageSource(ImageUpload3.fileName)}}" stepKey="assertMediaSource"/> <after> - <actionGroup ref="DeleteCategory" stepKey="DeleteCategory"> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="DeleteCategory"> <argument name="categoryEntity" value="SimpleSubCategory"/> </actionGroup> <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGProductTest.xml index 4044490c92334..e1772a975f714 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGProductTest.xml @@ -29,7 +29,7 @@ <amOnPage url="{{AdminProductCreatePage.url(AddToDefaultSet.attributeSetId, 'simple')}}" stepKey="navigateToNewProduct"/> <waitForPageLoad stepKey="waitForPageLoadProductCreatePage"/> - <actionGroup ref="fillMainProductForm" stepKey="fillBasicProductInfo" /> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillBasicProductInfo" /> <click selector="{{AdminProductFormSection.contentTab}}" stepKey="clickContentTab" /> <waitForElementVisible selector="{{ProductDescriptionWYSIWYGToolbarSection.TinyMCE4}}" stepKey="waitForDescription" /> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddInStockProductToTheCartTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddInStockProductToTheCartTest.xml index 51ef7fb77d74c..b98ca3a375a17 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddInStockProductToTheCartTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddInStockProductToTheCartTest.xml @@ -36,7 +36,7 @@ <!--Open Product Index Page and filter the product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPageToLoad"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProduct"> <argument name="product" value="SimpleProduct"/> </actionGroup> <!-- Update product Advanced Inventory setting --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest.xml index 545e7c10379bf..87acf14172ef6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest.xml @@ -32,7 +32,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex1"/> <waitForPageLoad time="30" stepKey="waitForProductIndexPageLoad"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetGridToDefaultKeywordSearch"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetGridToDefaultKeywordSearch"/> <actionGroup ref="logout" stepKey="logoutFromAdmin"/> </after> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> @@ -51,7 +51,7 @@ <selectOption selector="{{AdminProductFormAdvancedPricingSection.productTierPriceValueTypeSelect('0')}}" userInput="Discount" stepKey="selectProductTierPriceValueType1"/> <fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPricePercentageValuePriceInput('0')}}" userInput="10" stepKey="selectProductTierPricePriceInput"/> <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton1"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct1"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct1"/> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLogin1"> <argument name="Customer" value="$$createSimpleUSCustomer$$" /> </actionGroup> @@ -79,7 +79,7 @@ <waitForElement selector="{{AdminProductFormAdvancedPricingSection.productTierPriceCustGroupSelect('0')}}" time="30" stepKey="waitForSelectCustomerGroupNameAttribute1"/> <selectOption selector="{{AdminProductFormAdvancedPricingSection.productTierPriceCustGroupSelect('0')}}" userInput="General" stepKey="selectCustomerGroupGeneral"/> <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton2"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct2"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct2"/> <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="navigateToCategoryPage3"/> <waitForPageLoad time="30" stepKey="waitForPageLoad4"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceFinal('100')}}" stepKey="assertProductFinalPriceIs100_1"/> @@ -110,7 +110,7 @@ <selectOption selector="{{AdminProductFormAdvancedPricingSection.productTierPriceValueTypeSelect('1')}}" userInput="Discount" stepKey="selectProductTierPriceValueType2"/> <fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPricePercentageValuePriceInput('1')}}" userInput="18" stepKey="selectProductTierPricePriceInput18"/> <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton3"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct3"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct3"/> <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="navigateToCategoryPage5"/> <waitForPageLoad time="30" stepKey="waitForPageLoad6"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceFinal('100')}}" stepKey="assertProductFinalPriceIs100_2"/> @@ -132,7 +132,7 @@ <seeElement selector="{{StorefrontProductInfoMainSection.productTierPriceSavePercentageAmount('1', '10')}}" stepKey="assertProductTierPriceSavePercentageAmountForFirstRow1"/> <seeElement selector="{{StorefrontProductInfoMainSection.productTierPriceSavePercentageAmount('2', '18')}}" stepKey="assertProductTierPriceSavePercentageAmountForSecondRow1"/> <fillField userInput="10" selector="{{StorefrontProductInfoMainSection.qty}}" stepKey="fillProductQuantity1"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$$createSimpleProduct.name$$"/> </actionGroup> <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToCheckoutFromMinicart"/> @@ -169,7 +169,7 @@ <waitForElement selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="waitForcustomerGroupPriceAddButton4"/> <fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPricePercentageValuePriceInput('1')}}" userInput="25" stepKey="selectProductTierPricePercentageValue2"/> <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton4"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct4"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct4"/> <amOnPage url="{{CheckoutCartPage.url}}" stepKey="goToShoppingCartPage1"/> <waitForPageLoad time="30" stepKey="waitForShoppingCartPagePageLoad1"/> <seeInField userInput="20" selector="{{CheckoutCartProductSection.ProductQuantityByName($$createSimpleProduct.name$$)}}" stepKey="seeInQtyField20"/> @@ -239,7 +239,7 @@ <click selector="(//tr//button[@data-action='remove_row'])[1]" userInput=".product_form_product_form_advanced_pricing_modal" stepKey="deleteFirstRowOfCustomerGroupPrice"/> <click selector="//tr//button[@data-action='remove_row']" userInput=".product_form_product_form_advanced_pricing_modal" stepKey="deleteSecondRowOfCustomerGroupPrice"/> <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" userInput=".product_form_product_form_advanced_pricing_modal" stepKey="clickDoneButton5"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct5"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct5"/> <scrollToTopOfPage stepKey="scrollToTopOfPage6"/> <click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickOnAdvancedPricingButton6"/> <waitForElement selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="waitForcustomerGroupPriceAddButton5"/> @@ -291,7 +291,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad time="30" stepKey="waitForProductIndexPageLoad"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetGridToDefaultKeywordSearch"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetGridToDefaultKeywordSearch"/> <actionGroup ref="logout" stepKey="logoutFromAdmin"/> </after> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> @@ -309,7 +309,7 @@ <selectOption selector="{{AdminProductFormAdvancedPricingSection.productTierPriceValueTypeSelect('0')}}" userInput="Discount" stepKey="selectProductTierPriceValueType"/> <fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPricePercentageValuePriceInput('0')}}" userInput="0.1" stepKey="selectProductTierPricePriceInput"/> <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct1"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct1"/> <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.sku$$)}}" stepKey="goProductPageOnStorefront"/> <waitForPageLoad time="30" stepKey="waitForPageLoad1"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceFinal('99.90')}}" stepKey="assertProductFinalPriceProductPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAssignProductAttributeToAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAssignProductAttributeToAttributeSetTest.xml index 4261721d36064..41b358bbf760e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAssignProductAttributeToAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAssignProductAttributeToAttributeSetTest.xml @@ -40,14 +40,14 @@ <!-- Assert created attribute in unassigned section --> <see userInput="$$attribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.unassignedAttributesTree}}" stepKey="seeAttributeInUnassigned"/> <!-- Assign attribute to a group --> - <actionGroup ref="AssignAttributeToGroup" stepKey="assignAttributeToGroup"> + <actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup"> <argument name="group" value="Product Details"/> <argument name="attribute" value="$$attribute.attribute_code$$"/> </actionGroup> <!-- Assert attribute in a group --> <see userInput="$$attribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.groupTree}}" stepKey="seeAttributeInGroup"/> <!-- Save attribute set --> - <actionGroup ref="SaveAttributeSet" stepKey="SaveAttributeSet"/> + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="SaveAttributeSet"/> <!-- Go to create new product page --> <amOnPage url="{{AdminProductCreatePage.url(AddToDefaultSet.attributeSetId, 'simple')}}" stepKey="navigateToNewProduct"/> <waitForPageLoad stepKey="waitForPageLoad"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminBackorderAllowedAddProductToCartTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminBackorderAllowedAddProductToCartTest.xml index 88c524eff387c..9361637a0a935 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminBackorderAllowedAddProductToCartTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminBackorderAllowedAddProductToCartTest.xml @@ -35,7 +35,7 @@ </after> <!-- Go to the storefront and add the product to the cart --> - <actionGroup ref="AddSimpleProductToCart" stepKey="gotoAndAddProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="gotoAndAddProductToCart"> <argument name="product" value="$$createProduct$$"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminChangeProductAttributeSet.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminChangeProductAttributeSet.xml index bcfab6ccfdf1f..95620bf75b6d0 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminChangeProductAttributeSet.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminChangeProductAttributeSet.xml @@ -35,11 +35,11 @@ <actionGroup ref="LoginAsAdmin" stepKey="login"/> <amOnPage url="{{AdminProductAttributeSetEditPage.url}}/$$createAttributeSet.attribute_set_id$$/" stepKey="onAttributeSetEdit"/> - <actionGroup ref="AssignAttributeToGroup" stepKey="assignAttributeToGroup"> + <actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup"> <argument name="group" value="Product Details"/> <argument name="attribute" value="$$createProductAttribute.attribute_code$$"/> </actionGroup> - <actionGroup ref="SaveAttributeSet" stepKey="SaveAttributeSet"/> + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="SaveAttributeSet"/> </before> <after> <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWithDisabledChildProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWithDisabledChildProductTest.xml index 86978a4121a43..b4381a674827d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWithDisabledChildProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWithDisabledChildProductTest.xml @@ -145,7 +145,7 @@ <!-- Open Product Index Page and Filter First Child product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPageToLoad"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProduct"> <argument name="product" value="ApiSimpleOne"/> </actionGroup> <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="selectFirstRow"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckOutOfStockProductIsNotVisibleInCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckOutOfStockProductIsNotVisibleInCategoryTest.xml index ee8b48a94b20d..cd03d868838f3 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckOutOfStockProductIsNotVisibleInCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckOutOfStockProductIsNotVisibleInCategoryTest.xml @@ -36,7 +36,7 @@ <!--Open Product Index Page and filter the product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPageToLoad"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProduct"> <argument name="product" value="SimpleProduct"/> </actionGroup> <!-- Update product Advanced Inventory Setting --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckOutOfStockProductIsVisibleInCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckOutOfStockProductIsVisibleInCategoryTest.xml index a863de2716c97..bfea4fa7557f5 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckOutOfStockProductIsVisibleInCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckOutOfStockProductIsVisibleInCategoryTest.xml @@ -39,7 +39,7 @@ <!--Open Product Index Page and filter the product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPageToLoad"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProduct"> <argument name="product" value="SimpleProduct"/> </actionGroup> <!-- Update product Advanced Inventory Setting --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCloneProductWithDuplicateUrlTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCloneProductWithDuplicateUrlTest.xml index 99adaeb522786..ee9e364758899 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCloneProductWithDuplicateUrlTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCloneProductWithDuplicateUrlTest.xml @@ -28,10 +28,10 @@ <after> <!--Delete created data--> <comment userInput="Delete created data" stepKey="commentDeleteCreatedData"/> - <actionGroup ref="deleteAllDuplicateProductUsingProductGrid" stepKey="deleteAllDuplicateProducts"> + <actionGroup ref="DeleteAllDuplicateProductUsingProductGridActionGroup" stepKey="deleteAllDuplicateProducts"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetFiltersIfExist"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetFiltersIfExist"/> <actionGroup ref="logout" stepKey="logoutOfAdmin"/> </after> <amOnPage url="{{AdminProductEditPage.url($$createSimpleProduct.id$$)}}" stepKey="goToProductEditPage"/> @@ -47,16 +47,16 @@ <comment userInput="Add duplicated product to the simple product" stepKey="commentAddProduct"/> <amOnPage url="{{AdminProductEditPage.url($$createSimpleProduct.id$$)}}" stepKey="goToSimpleProductPage"/> <waitForPageLoad stepKey="waitForSimpleProductPageLoad1"/> - <actionGroup ref="addCrossSellProductBySku" stepKey="addCrossSellProduct"> + <actionGroup ref="AddCrossSellProductBySkuActionGroup" stepKey="addCrossSellProduct"> <argument name="sku" value="$$createSimpleProduct.sku$$"/> </actionGroup> - <actionGroup ref="addRelatedProductBySku" stepKey="addRelatedProduct"> + <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addRelatedProduct"> <argument name="sku" value="$$createSimpleProduct.sku$$"/> </actionGroup> - <actionGroup ref="addUpSellProductBySku" stepKey="addUpSellProduct"> + <actionGroup ref="AddUpSellProductBySkuActionGroup" stepKey="addUpSellProduct"> <argument name="sku" value="$$createSimpleProduct.sku$$"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="clickSaveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveProduct"/> <conditionalClick selector="{{AdminProductFormRelatedUpSellCrossSellSection.sectionHeader}}" dependentSelector="{{AdminProductFormRelatedUpSellCrossSellSection.AddRelatedProductsButton}}" visible="false" stepKey="openProductRUSSection"/> <see selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedProductSku('related')}}" userInput="$$createSimpleProduct.sku$$-1" stepKey="seeRelatedProduct"/> <see selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedProductSku('upsell')}}" userInput="$$createSimpleProduct.sku$$-1" stepKey="seeUpSellProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditSimpleProductSettingsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditSimpleProductSettingsTest.xml index 8ffab42653b49..80c20a7e0b5d9 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditSimpleProductSettingsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditSimpleProductSettingsTest.xml @@ -38,16 +38,16 @@ </after> <!-- Create new simple product --> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createSimpleProduct"/> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createSimpleProduct"/> <!-- Fill all main fields --> - <actionGroup ref="fillMainProductForm" stepKey="fillAllNecessaryFields"/> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillAllNecessaryFields"/> <!-- Add two related products --> - <actionGroup ref="addRelatedProductBySku" stepKey="addFirstRelatedProduct"> + <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addFirstRelatedProduct"> <argument name="sku" value="$$createFirstRelatedProduct.sku$$"/> </actionGroup> - <actionGroup ref="addRelatedProductBySku" stepKey="addSecondRelatedProduct"> + <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addSecondRelatedProduct"> <argument name="sku" value="$$createSecondRelatedProduct.sku$$"/> </actionGroup> @@ -60,7 +60,7 @@ </actionGroup> <!-- Save product form --> - <actionGroup ref="saveProductForm" stepKey="clickSaveButton"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveButton"/> <!-- Open product page --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage"> @@ -96,7 +96,7 @@ </actionGroup> <!-- Edit related products --> - <actionGroup ref="addRelatedProductBySku" stepKey="addThirdRelatedProduct"> + <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addThirdRelatedProduct"> <argument name="sku" value="$$createThirdRelatedProduct.sku$$"/> </actionGroup> <click selector="{{AdminProductFormRelatedUpSellCrossSellSection.removeRelatedProduct($$createFirstRelatedProduct.sku$$)}}" stepKey="removeFirstRelatedProduct"/> @@ -110,7 +110,7 @@ <actionGroup ref="AdminSwitchProductGiftMessageStatusActionGroup" stepKey="disableGiftMessageSettings"/> <!-- Save product form --> - <actionGroup ref="saveProductForm" stepKey="clickSaveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveProduct"/> <!-- Verify Url Key after changing --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> @@ -129,7 +129,7 @@ <dontSeeElement selector="{{StorefrontProductCartGiftOptionSection.giftOptions}}" stepKey="dontSeeGiftOptionBtn"/> <!-- Delete created simple product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="_defaultProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditVirtualProductSettingsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditVirtualProductSettingsTest.xml index 90cbab59bd71d..5e7cb461e9667 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditVirtualProductSettingsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditVirtualProductSettingsTest.xml @@ -33,7 +33,7 @@ </before> <after> <!-- Delete created virtual product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> @@ -54,12 +54,12 @@ <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> <!-- Create new virtual product --> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createVirtualProduct"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createVirtualProduct"> <argument name="productType" value="virtual"/> </actionGroup> <!-- Fill all main fields --> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillMainProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillMainProductForm"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> @@ -70,10 +70,10 @@ <fillField selector="{{AdminProductContentSection.shortDescriptionTextArea}}" userInput="{{ApiProductShortDescription.value}}" stepKey="fillShortDescription"/> <!-- Add two related products --> - <actionGroup ref="addRelatedProductBySku" stepKey="addFirstRelatedProduct"> + <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addFirstRelatedProduct"> <argument name="sku" value="$$createFirstRelatedProduct.sku$$"/> </actionGroup> - <actionGroup ref="addRelatedProductBySku" stepKey="addSecondRelatedProduct"> + <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addSecondRelatedProduct"> <argument name="sku" value="$$createSecondRelatedProduct.sku$$"/> </actionGroup> @@ -93,7 +93,7 @@ </actionGroup> <!-- Save product form--> - <actionGroup ref="saveProductForm" stepKey="clickSaveButton"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveButton"/> <!-- Open product page --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage"> @@ -139,12 +139,12 @@ </actionGroup> <!-- Edit related products --> - <actionGroup ref="addRelatedProductBySku" stepKey="addThirdRelatedProduct"> + <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addThirdRelatedProduct"> <argument name="sku" value="$$createThirdRelatedProduct.sku$$"/> </actionGroup> <!-- Assert product in assigned to websites --> - <actionGroup ref="AssertProductIsAssignedToWebsite" stepKey="seeCustomWebsiteIsChecked"> + <actionGroup ref="AssertProductIsAssignedToWebsiteActionGroup" stepKey="seeCustomWebsiteIsChecked"> <argument name="website" value="$createWebsite.website[name]$"/> </actionGroup> @@ -162,7 +162,7 @@ <actionGroup ref="AdminSwitchProductGiftMessageStatusActionGroup" stepKey="disableGiftMessageSettings"/> <!-- Save product form --> - <actionGroup ref="saveProductForm" stepKey="clickSaveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveProduct"/> <!-- Verify Url Key after changing --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndSwitchProductType.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndSwitchProductType.xml index 4deca73504677..12082e1daa6c3 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndSwitchProductType.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndSwitchProductType.xml @@ -23,11 +23,11 @@ <createData entity="_defaultCategory" stepKey="createPreReqCategory"/> </before> <after> - <actionGroup ref="GoToProductCatalogPage" stepKey="goToProductCatalogPage"/> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteSimpleProduct"> + <actionGroup ref="GoToProductCatalogPageActionGroup" stepKey="goToProductCatalogPage"/> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteSimpleProduct"> <argument name="product" value="_defaultProduct"/> </actionGroup> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetSearch"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetSearch"/> <amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> </after> @@ -35,28 +35,28 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> <!-- Open Dropdown and select simple product option --> <comment stepKey="beforeOpenProductFillForm" userInput="Selecting Product from the Add Product Dropdown"/> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="openProductFillForm"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="openProductFillForm"> <argument name="productType" value="simple"/> </actionGroup> <!-- Fill form for Virtual Product Type --> <comment stepKey="beforeFillProductForm" userInput="Filling Product Form"/> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillProductForm"> <argument name="product" value="_defaultProduct"/> </actionGroup> - <actionGroup ref="SetProductUrlKey" stepKey="setProductUrl"> + <actionGroup ref="SetProductUrlKeyActionGroup" stepKey="setProductUrl"> <argument name="product" value="_defaultProduct"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProductForm"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> <!-- Check that product was added with implicit type change --> <comment stepKey="beforeVerify" userInput="Verify Product Type Assigned Correctly"/> - <actionGroup ref="GoToProductCatalogPage" stepKey="goToProductCatalogPage"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetSearch"/> - <actionGroup ref="filterProductGridByName" stepKey="searchForProduct"> + <actionGroup ref="GoToProductCatalogPageActionGroup" stepKey="goToProductCatalogPage"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetSearch"/> + <actionGroup ref="FilterProductGridByNameActionGroup" stepKey="searchForProduct"> <argument name="product" value="_defaultProduct"/> </actionGroup> <see selector="{{AdminProductGridSection.productGridCell('1', 'Type')}}" userInput="Virtual Product" stepKey="seeProductTypeInGrid"/> - <actionGroup ref="AssertProductInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="_defaultProduct"/> </actionGroup> </test> @@ -71,11 +71,11 @@ <group value="catalog"/> <group value="mtf_migrated"/> </annotations> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="openProductFillForm"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="openProductFillForm"> <argument name="productType" value="virtual"/> </actionGroup> <!-- Fill form for Virtual Product Type --> - <actionGroup ref="fillMainProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="_defaultProduct"/> </actionGroup> <see selector="{{AdminProductGridSection.productGridCell('1', 'Type')}}" userInput="Simple Product" stepKey="seeProductTypeInGrid"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAttributeSetEntityTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAttributeSetEntityTest.xml index d9e410a9a3009..51518dffaf87e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAttributeSetEntityTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAttributeSetEntityTest.xml @@ -30,7 +30,7 @@ <amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSets"/> <waitForPageLoad stepKey="waitForPageLoad"/> - <actionGroup ref="goToAttributeSetByName" stepKey="filterProductAttributeSetGridByLabel"> + <actionGroup ref="GoToAttributeSetByNameActionGroup" stepKey="filterProductAttributeSetGridByLabel"> <argument name="name" value="$$createAttributeSet.attribute_set_name$$"/> </actionGroup> @@ -38,17 +38,17 @@ <see userInput="$$createProductAttribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.unassignedAttributesTree}}" stepKey="seeAttributeInUnassignedAttr"/> <!-- Assign attribute in the group --> - <actionGroup ref="AssignAttributeToGroup" stepKey="assignAttributeToGroup"> + <actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup"> <argument name="group" value="Product Details"/> <argument name="attribute" value="$$createProductAttribute.attribute_code$$"/> </actionGroup> <see userInput="$$createProductAttribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.groupTree}}" stepKey="seeAttributeInGroup"/> - <actionGroup ref="SaveAttributeSet" stepKey="SaveAttributeSet"/> + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="SaveAttributeSet"/> <amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSets2"/> <waitForPageLoad stepKey="waitForPageLoad2"/> <!-- Assert an attribute in the group--> - <actionGroup ref="goToAttributeSetByName" stepKey="filterProductAttributeSetGridByLabel2"> + <actionGroup ref="GoToAttributeSetByNameActionGroup" stepKey="filterProductAttributeSetGridByLabel2"> <argument name="name" value="$$createAttributeSet.attribute_set_name$$"/> </actionGroup> <see userInput="$$createProductAttribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.groupTree}}" stepKey="seeAttributeInGroup2"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryFromProductPageTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryFromProductPageTest.xml index a5150a0fb7f24..ef21b53c7613b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryFromProductPageTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryFromProductPageTest.xml @@ -26,7 +26,7 @@ <after> <!-- Delete the created category --> - <actionGroup ref="DeleteMostRecentCategory" stepKey="getRidOfCreatedCategory"/> + <actionGroup ref="DeleteMostRecentCategoryActionGroup" stepKey="getRidOfCreatedCategory"/> <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> <deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/> </after> @@ -35,7 +35,7 @@ <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> <waitForPageLoad stepKey="waitForAdminProductGridLoad"/> <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedProduct"> <argument name="product" value="SimpleTwo"/> </actionGroup> <waitForPageLoad stepKey="waitForFiltersToBeApplied"/> @@ -43,12 +43,12 @@ <waitForPageLoad stepKey="waitForProductPageLoad"/> <!-- Fill out the form for the new category --> - <actionGroup ref="FillNewProductCategory" stepKey="FillNewProductCategory"> + <actionGroup ref="FillNewProductCategoryActionGroup" stepKey="FillNewProductCategory"> <argument name="categoryName" value="{{_defaultCategory.name}}"/> </actionGroup> <!-- Check that category was created --> - <actionGroup ref="CategoryPresent" stepKey="checkIfCategoryPresent"> + <actionGroup ref="CategoryPresentActionGroup" stepKey="checkIfCategoryPresent"> <argument name="categoryName" value="{{_defaultCategory.name}}"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithAnchorFieldTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithAnchorFieldTest.xml index a6890c2ad4905..7de1d38f097c5 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithAnchorFieldTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithAnchorFieldTest.xml @@ -23,7 +23,7 @@ <createData entity="defaultSimpleProduct" stepKey="simpleProduct" /> </before> <after> - <actionGroup ref="DeleteCategory" stepKey="deleteCategory"/> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCategory"/> <actionGroup ref="logout" stepKey="logout"/> <deleteData createDataKey="createDefaultCMSBlock" stepKey="deleteDefaultCMSBlock"/> <deleteData stepKey="deleteSimpleProduct" createDataKey="simpleProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithCustomRootCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithCustomRootCategoryTest.xml index e8c6da476a3d6..a68a585bbf31d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithCustomRootCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithCustomRootCategoryTest.xml @@ -26,7 +26,7 @@ <actionGroup ref="DeleteCustomStoreActionGroup" stepKey="deleteCustomStore"> <argument name="storeGroupName" value="customStore.name"/> </actionGroup> - <actionGroup ref="DeleteCategory" stepKey="deleteCreatedNewRootCategory"> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCreatedNewRootCategory"> <argument name="categoryEntity" value="NewRootCategory"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -41,7 +41,7 @@ <scrollToTopOfPage stepKey="scrollToTopOfPage"/> <click selector="{{AdminCategorySidebarTreeSection.categoryInTree(NewRootCategory.name)}}" stepKey="clickOnCreatedNewRootCategory"/> <scrollToTopOfPage stepKey="scrollToTopOfPage1"/> - <actionGroup ref="CreateCategory" stepKey="createSubcategory"> + <actionGroup ref="CreateCategoryActionGroup" stepKey="createSubcategory"> <argument name="categoryEntity" value="SimpleSubCategory"/> </actionGroup> <!--Create a Store--> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithInactiveCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithInactiveCategoryTest.xml index 96f945da138b0..fae1a1fa8c2e4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithInactiveCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithInactiveCategoryTest.xml @@ -21,7 +21,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> </before> <after> - <actionGroup ref="DeleteCategory" stepKey="deleteCategory"/> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCategory"/> <actionGroup ref="logout" stepKey="logout"/> </after> <!-- Create In active Category --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithInactiveIncludeInMenuTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithInactiveIncludeInMenuTest.xml index c983089163f78..a695aa33079bd 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithInactiveIncludeInMenuTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithInactiveIncludeInMenuTest.xml @@ -21,7 +21,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> </before> <after> - <actionGroup ref="DeleteCategory" stepKey="deleteCategory"/> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCategory"/> <actionGroup ref="logout" stepKey="logout"/> </after> <!--Create Category with not included in menu Subcategory --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithProductsGridFilter.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithProductsGridFilter.xml index 79eec02a828f6..6a49b47b75078 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithProductsGridFilter.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithProductsGridFilter.xml @@ -21,14 +21,14 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> </before> <after> - <actionGroup ref="DeleteCategory" stepKey="deleteCategory"/> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct1"> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCategory"/> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct1"> <argument name="product" value="defaultSimpleProduct"/> </actionGroup> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct2"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct2"> <argument name="product" value="SimpleProduct"/> </actionGroup> - <actionGroup ref="NavigateToAndResetProductGridToDefaultView" stepKey="NavigateToAndResetProductGridToDefaultView"/> + <actionGroup ref="NavigateToAndResetProductGridToDefaultViewActionGroup" stepKey="NavigateToAndResetProductGridToDefaultView"/> <actionGroup ref="logout" stepKey="logout"/> </after> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductList"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithRequiredFieldsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithRequiredFieldsTest.xml index 1b6c9707b0656..dac2a121d107f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithRequiredFieldsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithRequiredFieldsTest.xml @@ -21,7 +21,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> </before> <after> - <actionGroup ref="DeleteCategory" stepKey="deleteCategory"/> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCategory"/> <actionGroup ref="logout" stepKey="logout"/> </after> <!-- Create subcategory with required fields --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCustomProductAttributeWithDropdownFieldTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCustomProductAttributeWithDropdownFieldTest.xml index a3f543e9cf32a..2d1a58764e20a 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCustomProductAttributeWithDropdownFieldTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCustomProductAttributeWithDropdownFieldTest.xml @@ -38,7 +38,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> - <actionGroup ref="deleteProductAttribute" stepKey="deleteCreatedAttribute"> + <actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteCreatedAttribute"> <argument name="ProductAttribute" value="newProductAttribute"/> </actionGroup> @@ -50,7 +50,7 @@ <waitForPageLoad stepKey="waitForProductIndexPageToLoad"/> <!-- Select Created Product--> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku"> <argument name="product" value="$$createConfigProduct$$"/> </actionGroup> <click stepKey="openFirstProduct" selector="{{AdminProductGridSection.productRowBySku($$createConfigProduct.sku$$)}}"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeTest.xml index 525f81de6c48c..4118356b07e74 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeTest.xml @@ -21,7 +21,7 @@ </before> <after> <!-- Remove attribute --> - <actionGroup ref="deleteProductAttribute" stepKey="deleteAttribute"> + <actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteAttribute"> <argument name="ProductAttribute" value="productDropDownAttribute"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -60,7 +60,7 @@ <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/> - <actionGroup ref="navigateToCreatedProductAttribute" stepKey="navigateToAttribute"> + <actionGroup ref="NavigateToCreatedProductAttributeActionGroup" stepKey="navigateToAttribute"> <argument name="ProductAttribute" value="productDropDownAttribute"/> </actionGroup> <!-- Check attribute data --> @@ -69,4 +69,4 @@ <assertEquals actual="$secondOptionAdminLabel" expected="'Fish & Chips'" stepKey="assertSecondOption"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml index 1bc69be642a37..557f0768c98a3 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml @@ -39,7 +39,7 @@ <!-- Filter product attribute set by attribute set name --> <amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="amOnAttributeSetPage"/> - <actionGroup ref="FilterProductAttributeSetGridByAttributeSetName" stepKey="filterProductAttrSetGridByAttrSetName"> + <actionGroup ref="FilterProductAttributeSetGridByAttributeSetNameActionGroup" stepKey="filterProductAttrSetGridByAttrSetName"> <argument name="name" value="$$createAttributeSet.attribute_set_name$$"/> </actionGroup> @@ -47,12 +47,12 @@ <see userInput="$$attribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.unassignedAttributesTree}}" stepKey="seeAttributeInUnassignedAttr"/> <!-- Assign attribute in the group --> - <actionGroup ref="AssignAttributeToGroup" stepKey="assignAttributeToGroup"> + <actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup"> <argument name="group" value="Product Details"/> <argument name="attribute" value="$$attribute.attribute_code$$"/> </actionGroup> <see userInput="$$attribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.groupTree}}" stepKey="seeAttributeInGroup"/> - <actionGroup ref="SaveAttributeSet" stepKey="saveAttributeSet"/> + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveAttributeSet"/> <!-- Go to Product Attribute Grid page --> <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDuplicateCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDuplicateCategoryTest.xml index 37ec4e0d32528..cbef9566b2b78 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDuplicateCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDuplicateCategoryTest.xml @@ -27,10 +27,10 @@ </after> <!-- Open Category Page and select Add category --> - <actionGroup ref="goToCreateCategoryPage" stepKey="goToCategoryPage"/> + <actionGroup ref="GoToCreateCategoryPageActionGroup" stepKey="goToCategoryPage"/> <!-- Fill the Category form with same name and urlKey as initially created category(SimpleSubCategory) --> - <actionGroup ref="FillCategoryNameAndUrlKeyAndSave" stepKey="fillCategoryForm"> + <actionGroup ref="FillCategoryNameAndUrlKeyAndSaveActionGroup" stepKey="fillCategoryForm"> <argument name="categoryName" value="$$category.name$$"/> <argument name="categoryUrlKey" value="$$category.custom_attributes[url_key]$$"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDuplicateProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDuplicateProductTest.xml index 575bb56912b25..4507e1f880a86 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDuplicateProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDuplicateProductTest.xml @@ -32,10 +32,10 @@ </after> <!-- Go to new simple product page --> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="goToCreateProductPage"/> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="goToCreateProductPage"/> <!-- Fill the main fields in the form --> - <actionGroup ref="FillMainProductFormByString" stepKey="fillMainProductForm"> + <actionGroup ref="FillMainProductFormByStringActionGroup" stepKey="fillMainProductForm"> <argument name="productName" value="$$subCategory.name$$"/> <argument name="productSku" value="{{defaultSimpleProduct.sku}}"/> <argument name="productPrice" value="{{defaultSimpleProduct.price}}"/> @@ -45,17 +45,17 @@ </actionGroup> <!-- Select the category that we created in the before block --> - <actionGroup ref="SetCategoryByName" stepKey="setCategory"> + <actionGroup ref="SetCategoryByNameActionGroup" stepKey="setCategory"> <argument name="categoryName" value="$$category.name$$"/> </actionGroup> <!-- Set the url key to match the subcategory created in the before block --> - <actionGroup ref="SetProductUrlKeyByString" stepKey="fillUrlKey"> + <actionGroup ref="SetProductUrlKeyByStringActionGroup" stepKey="fillUrlKey"> <argument name="urlKey" value="$$subCategory.custom_attributes[url_key]$$"/> </actionGroup> <!-- Save the product and expect to see an error message --> - <actionGroup ref="SaveProductFormNoSuccessCheck" stepKey="tryToSaveProduct"/> + <actionGroup ref="SaveProductFormNoSuccessCheckActionGroup" stepKey="tryToSaveProduct"/> <see selector="{{AdminProductFormSection.successMessage}}" userInput="The value specified in the URL Key field would generate a URL that already exists." stepKey="seeErrorMessage"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateMultipleSelectProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateMultipleSelectProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml index 4e096b7ebb142..6bfd012bc88b2 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateMultipleSelectProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateMultipleSelectProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml @@ -45,7 +45,7 @@ <!-- Filter product attribute set by attribute set name --> <amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="amOnAttributeSetPage"/> - <actionGroup ref="FilterProductAttributeSetGridByAttributeSetName" stepKey="filterProductAttrSetGridByAttrSetName"> + <actionGroup ref="FilterProductAttributeSetGridByAttributeSetNameActionGroup" stepKey="filterProductAttrSetGridByAttrSetName"> <argument name="name" value="$$createAttributeSet.attribute_set_name$$"/> </actionGroup> @@ -53,12 +53,12 @@ <see userInput="$$attribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.unassignedAttributesTree}}" stepKey="seeAttributeInUnassignedAttr"/> <!-- Assign attribute in the group --> - <actionGroup ref="AssignAttributeToGroup" stepKey="assignAttributeToGroup"> + <actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup"> <argument name="group" value="Product Details"/> <argument name="attribute" value="$$attribute.attribute_code$$"/> </actionGroup> <see userInput="$$attribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.groupTree}}" stepKey="seeAttributeInGroup"/> - <actionGroup ref="SaveAttributeSet" stepKey="saveAttributeSet"/> + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveAttributeSet"/> <!-- Go to Product Attribute Grid page --> <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateNewAttributeFromProductPageTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateNewAttributeFromProductPageTest.xml index 2706d00038e4b..51c4a3250d609 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateNewAttributeFromProductPageTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateNewAttributeFromProductPageTest.xml @@ -26,8 +26,8 @@ <actionGroup ref="logout" stepKey="logout"/> </after> - <actionGroup ref="GoToProductCatalogPage" stepKey="goToProductCatalogPage"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="GoToProductCatalogPageActionGroup" stepKey="goToProductCatalogPage"/> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="SimpleProduct"/> </actionGroup> <actionGroup ref="AdminClickAddAttributeOnProductEditPageActionGroup" stepKey="clickAddAttribute"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateNewAttributeFromProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateNewAttributeFromProductTest.xml index 02615ca5dd254..8fb226f5f5585 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateNewAttributeFromProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateNewAttributeFromProductTest.xml @@ -38,7 +38,7 @@ </actionGroup> <!--Delete Attribute--> - <actionGroup ref="deleteProductAttribute" stepKey="deleteAttribute"> + <actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteAttribute"> <argument name="ProductAttribute" value="productDropDownAttribute"/> </actionGroup> @@ -55,7 +55,7 @@ <!--Go to created product page and create new attribute--> <amOnPage url="{{AdminProductEditPage.url($$createProduct.id$$)}}" stepKey="openAdminEditPage"/> - <actionGroup ref="AdminCreateAttributeWithValueWithTwoStoreViesFromProductPage" stepKey="createAttribute"> + <actionGroup ref="AdminCreateAttributeWithValueWithTwoStoreViesFromProductPageActionGroup" stepKey="createAttribute"> <argument name="attributeName" value="{{productDropDownAttribute.attribute_code}}"/> <argument name="attributeType" value="Dropdown"/> <argument name="firstStoreViewName" value="{{customStoreEN.name}}"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateNewGroupForAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateNewGroupForAttributeSetTest.xml index 3219bca233bee..a105f343d3e21 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateNewGroupForAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateNewGroupForAttributeSetTest.xml @@ -29,13 +29,13 @@ <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/> <actionGroup ref="logout" stepKey="logout"/> </after> - + <!-- Navigate to Stores > Attributes > Attribute Set --> <amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSetPage"/> <waitForPageLoad stepKey="waitForPageLoad"/> <!-- Search and open Attribute Set from preconditions --> - <actionGroup ref="goToAttributeSetByName" stepKey="searchAttribute"> + <actionGroup ref="GoToAttributeSetByNameActionGroup" stepKey="searchAttribute"> <argument name="name" value="$$createAttributeSet.attribute_set_name$$"/> </actionGroup> @@ -68,9 +68,9 @@ <see userInput="$$createConfigProductAttribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.groupTree}}" stepKey="seeAttribute"/> <!-- Click 'Save' --> - <actionGroup ref="SaveAttributeSet" stepKey="saveAttribute"/> + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveAttribute"/> - <actionGroup ref="goToAttributeSetByName" stepKey="backTohAttributeSet"> + <actionGroup ref="GoToAttributeSetByNameActionGroup" stepKey="backTohAttributeSet"> <argument name="name" value="$$createAttributeSet.attribute_set_name$$"/> </actionGroup> @@ -85,7 +85,7 @@ <!-- Empty group is created. No attributes are assigned to it. --> <seeElement selector="{{AdminProductAttributeSetEditSection.attributeGroup(emptyGroup.name)}}" stepKey="assertEmptyGroup"/> <dontSeeElement selector="{{AdminProductAttributeSetEditSection.attributesInGroup(emptyGroup.name)}}" stepKey="seeNoAttributes"/> - + <!-- Navigate to Catalog > Products --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> @@ -93,8 +93,8 @@ <!-- Start to create a new simple product with the custom attribute set from the preconditions --> <click selector="{{AdminProductGridActionSection.addProductBtn}}" stepKey="clickAddProduct"/> <waitForPageLoad stepKey="waitForNewProductPage"/> - - <actionGroup ref="AdminProductPageSelectAttributeSet" stepKey="selectAttribute"> + + <actionGroup ref="AdminProductPageSelectAttributeSetActionGroup" stepKey="selectAttribute"> <argument name="attributeSetName" value="$$createAttributeSet.attribute_set_name$$"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml index 63a964f4b5e91..2e502f58041e6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml @@ -35,7 +35,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!--<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>--> - <actionGroup ref="deleteProductAttribute" stepKey="deleteCreatedAttribute"> + <actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteCreatedAttribute"> <argument name="ProductAttribute" value="newProductAttribute"/> </actionGroup> @@ -47,7 +47,7 @@ <waitForPageLoad stepKey="waitForProductIndexPageToLoad"/> <!-- Select Created Product--> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> <click stepKey="openFirstProduct" selector="{{AdminProductGridSection.productRowBySku($$createSimpleProduct.sku$$)}}"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeRequiredTextFieldTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeRequiredTextFieldTest.xml index d4d6496e018f5..63eed37b1e84f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeRequiredTextFieldTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeRequiredTextFieldTest.xml @@ -34,7 +34,7 @@ <!--Delete created entity --> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> - <actionGroup ref="deleteProductAttribute" stepKey="deleteCreatedAttribute"> + <actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteCreatedAttribute"> <argument name="ProductAttribute" value="newProductAttribute"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -45,7 +45,7 @@ <waitForPageLoad stepKey="waitForProductIndexPageToLoad"/> <!-- Select Created Product--> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> <click stepKey="openFirstProduct" selector="{{AdminProductGridSection.productRowBySku($$createSimpleProduct.sku$$)}}"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductCustomAttributeSet.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductCustomAttributeSet.xml index 713e1b7d6dfd1..7f6feaff3ed5d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductCustomAttributeSet.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductCustomAttributeSet.xml @@ -71,10 +71,10 @@ <dontSeeElementInDOM selector="{{AdminProductFormSection.divByDataIndex('meta_keyword')}}" stepKey="dontSeeMetaKeyword"/> <!-- Finish filling the new product page --> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillSimpleProductMain"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillSimpleProductMain"> <argument name="product" value="_defaultProduct"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveSimpleProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSimpleProduct"/> <!-- Check the storefront --> <amOnPage url="{{_defaultProduct.name}}.html" stepKey="goToProductPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductDuplicateUrlkeyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductDuplicateUrlkeyTest.xml index 291b6985bd3e5..f5e42bb84549c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductDuplicateUrlkeyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductDuplicateUrlkeyTest.xml @@ -58,7 +58,7 @@ </before> <after> <!--Delete all products by filtering grid and using mass delete action--> - <actionGroup ref="deleteAllDuplicateProductUsingProductGrid" stepKey="deleteAllDuplicateProducts"> + <actionGroup ref="DeleteAllDuplicateProductUsingProductGridActionGroup" stepKey="deleteAllDuplicateProducts"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> <deleteData createDataKey="createCategory" stepKey="deletePreReqCatalog" /> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateRootCategoryAndSubcategoriesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateRootCategoryAndSubcategoriesTest.xml index 11d919ddefa2c..7a99750c00e53 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateRootCategoryAndSubcategoriesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateRootCategoryAndSubcategoriesTest.xml @@ -33,7 +33,7 @@ <selectOption userInput="Default Category" selector="{{AdminNewStoreGroupSection.storeRootCategoryDropdown}}" stepKey="selectOptionDefaultCategory"/> <click selector="{{AdminStoreGroupActionsSection.saveButton}}" stepKey="clickSaveStoreButton"/> <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="clickOkOnModalDialog2"/> - <actionGroup ref="DeleteCategory" stepKey="deleteCreatedNewRootCategory"> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCreatedNewRootCategory"> <argument name="categoryEntity" value="NewRootCategory"/> </actionGroup> <actionGroup ref="logout" stepKey="logout2"/> @@ -48,13 +48,13 @@ </actionGroup> <scrollToTopOfPage stepKey="scrollToTopOfPage2"/> <!--Create subcategory--> - <actionGroup ref="CreateCategory" stepKey="createSubcategory1"> + <actionGroup ref="CreateCategoryActionGroup" stepKey="createSubcategory1"> <argument name="categoryEntity" value="SimpleSubCategory"/> </actionGroup> <click selector="{{AdminCategorySidebarTreeSection.categoryInTree(NewRootCategory.name)}}" stepKey="clickOnCreatedNewRootCategory1"/> <scrollToTopOfPage stepKey="scrollToTopOfPage3"/> <!--Create another subcategory--> - <actionGroup ref="CreateCategory" stepKey="createSubcategory2"> + <actionGroup ref="CreateCategoryActionGroup" stepKey="createSubcategory2"> <argument name="categoryEntity" value="SubCategoryWithParent"/> </actionGroup> <!--Assign new created root category to store--> @@ -74,11 +74,11 @@ <!--Go to storefront and verify created subcategory on frontend--> <amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToStorefrontPage"/> <waitForPageLoad stepKey="waitForPageAdminSystemStoreLoad2"/> - <actionGroup ref="CheckCategoryOnStorefront" stepKey="checkCreatedSubcategory1OnFrontend"> + <actionGroup ref="CheckCategoryOnStorefrontActionGroup" stepKey="checkCreatedSubcategory1OnFrontend"> <argument name="categoryEntity" value="SimpleSubCategory"/> </actionGroup> - <actionGroup ref="CheckCategoryOnStorefront" stepKey="checkCreatedSubcategory2OnFrontend"> + <actionGroup ref="CheckCategoryOnStorefrontActionGroup" stepKey="checkCreatedSubcategory2OnFrontend"> <argument name="categoryEntity" value="SubCategoryWithParent"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateRootCategoryRequiredFieldsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateRootCategoryRequiredFieldsTest.xml index f98f9acc46961..2b824554b9bd4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateRootCategoryRequiredFieldsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateRootCategoryRequiredFieldsTest.xml @@ -23,7 +23,7 @@ <actionGroup ref = "LoginAsAdmin" stepKey="LoginToAdminPanel"/> </before> <after> - <actionGroup ref="DeleteCategory" stepKey="deleteCategory"> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCategory"> <argument name="categoryEntity" value="_defaultCategory" /> </actionGroup> <actionGroup ref="logout" stepKey="logout" /> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest.xml index a7587a5ed31fe..052f6b1924e89 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest.xml @@ -26,7 +26,7 @@ </after> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> - <actionGroup ref="FillAdminSimpleProductForm" stepKey="fillProductFieldsInAdmin"> + <actionGroup ref="FillAdminSimpleProductFormActionGroup" stepKey="fillProductFieldsInAdmin"> <argument name="category" value="$$createPreReqCategory$$"/> <argument name="simpleProduct" value="_defaultProduct"/> </actionGroup> @@ -34,7 +34,7 @@ <argument name="category" value="$$createPreReqCategory$$"/> <argument name="product" value="_defaultProduct"/> </actionGroup> - <actionGroup ref="AssertProductInStorefrontProductPage" stepKey="assertProductInStorefront2"> + <actionGroup ref="AssertProductInStorefrontProductPageActionGroup" stepKey="assertProductInStorefront2"> <argument name="product" value="_defaultProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithCountryOfManufactureAttributeSKUMaskTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithCountryOfManufactureAttributeSKUMaskTest.xml index 3487de656173f..bbaabffcc5ecd 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithCountryOfManufactureAttributeSKUMaskTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithCountryOfManufactureAttributeSKUMaskTest.xml @@ -25,7 +25,7 @@ </before> <after> <magentoCLI stepKey="setName" command="config:set catalog/fields_masks/sku" arguments="{{name}}"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteCreatedProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteCreatedProduct"> <argument name="sku" value="{{nameAndAttributeSkuMaskSimpleProduct.name}}-{{nameAndAttributeSkuMaskSimpleProduct.country_of_manufacture_label}}" /> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml index 94d488f216b49..93f01964ffdb5 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml @@ -27,7 +27,7 @@ </after> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> - <actionGroup ref="FillAdminSimpleProductForm" stepKey="fillProductFieldsInAdmin"> + <actionGroup ref="FillAdminSimpleProductFormActionGroup" stepKey="fillProductFieldsInAdmin"> <argument name="category" value="$$createPreReqCategory$$"/> <argument name="simpleProduct" value="ProductWithUnicode"/> </actionGroup> @@ -35,7 +35,7 @@ <argument name="category" value="$$createPreReqCategory$$"/> <argument name="product" value="ProductWithUnicode"/> </actionGroup> - <actionGroup ref="AssertProductInStorefrontProductPage" stepKey="assertProductInStorefront2"> + <actionGroup ref="AssertProductInStorefrontProductPageActionGroup" stepKey="assertProductInStorefront2"> <argument name="product" value="ProductWithUnicode"/> </actionGroup> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateTextEditorProductAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateTextEditorProductAttributeTest.xml index fc7482c353136..848e765d34d70 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateTextEditorProductAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateTextEditorProductAttributeTest.xml @@ -30,12 +30,12 @@ </before> <after> <!-- Delete attribute --> - <actionGroup ref="deleteProductAttribute" stepKey="deleteAttribute"> + <actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteAttribute"> <argument name="ProductAttribute" value="productTextEditorAttribute"/> </actionGroup> <!-- Delete product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="_defaultProduct"/> </actionGroup> @@ -71,7 +71,7 @@ <selectOption selector="{{AttributePropertiesSection.InputType}}" userInput="{{productTextEditorAttribute.frontend_input}}" stepKey="returnInputType"/> <!-- Save Product Attribute --> - <actionGroup ref="saveProductAttribute" stepKey="saveAttribute"/> + <actionGroup ref="SaveProductAttributeActionGroup" stepKey="saveAttribute"/> <!-- Go to Store > Attribute Set --> <actionGroup ref="AdminOpenAttributeSetGridPageActionGroup" stepKey="openAttributeSetPage"/> @@ -80,20 +80,20 @@ <actionGroup ref="AdminOpenAttributeSetByNameActionGroup" stepKey="openDefaultAttributeSet"/> <!-- Add Product Attribute to Default attribute by dragging and dropping this to the 'Project Details' folder. Then Save. --> - <actionGroup ref="AssignAttributeToGroup" stepKey="assignAttributeToGroup"> + <actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup"> <argument name="group" value="Product Details"/> <argument name="attribute" value="{{productTextEditorAttribute.attribute_code}}"/> </actionGroup> - <actionGroup ref="SaveAttributeSet" stepKey="saveAttributeSet"/> + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveAttributeSet"/> <!-- Go Catalog > Product to create new product page --> <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="goToProductIndexPage"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="_defaultProduct"/> </actionGroup> <!-- On product page, select Attribute Set: "Default" --> - <actionGroup ref="AdminProductPageSelectAttributeSet" stepKey="selectAttributeSet"> + <actionGroup ref="AdminProductPageSelectAttributeSetActionGroup" stepKey="selectAttributeSet"> <argument name="attributeSetName" value="Default"/> </actionGroup> @@ -115,8 +115,8 @@ <fillField selector="{{ProductDescriptionWysiwygSection.attributeEditArea(productTextEditorAttribute.attribute_code)}}" userInput="This content from product page" stepKey="setContent"/> <!-- Fill up all required fields for product form --> - <actionGroup ref="fillMainProductForm" stepKey="fillProductForm"/> - <actionGroup ref="saveProductForm" stepKey="saveProductForm"/> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> <!-- Assert product attribute on Storefront --> <actionGroup ref="OpenStorefrontProductPageByProductNameActionGroup" stepKey="openProductPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductOutOfStockWithTierPriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductOutOfStockWithTierPriceTest.xml index 0b929eaddc96e..84eacc54a6e22 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductOutOfStockWithTierPriceTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductOutOfStockWithTierPriceTest.xml @@ -24,7 +24,7 @@ </before> <after> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="categoryEntity"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteVirtualProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteVirtualProduct"> <argument name="sku" value="{{virtualProductOutOfStock.sku}}"/> </actionGroup> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFilter"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml index 23f772a395a7d..8dd7671ac0295 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml @@ -24,7 +24,7 @@ </before> <after> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="categoryEntity"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteVirtualProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteVirtualProduct"> <argument name="sku" value="{{virtualProductCustomImportOptions.sku}}"/> </actionGroup> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="resetOrderFilter"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceForGeneralGroupTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceForGeneralGroupTest.xml index 9055e961f889f..976f714d7b3e1 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceForGeneralGroupTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceForGeneralGroupTest.xml @@ -24,7 +24,7 @@ <createData entity="Simple_US_CA_Customer" stepKey="customer" /> </before> <after> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteVirtualProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteVirtualProduct"> <argument name="product" value="virtualProductGeneralGroup"/> </actionGroup> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="categoryEntity"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteAttributeSetTest.xml index cbe2f40e0dd25..973ff0381584a 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteAttributeSetTest.xml @@ -47,7 +47,7 @@ <!-- Search for the product by sku and name on the product page --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToAdminProductIndex"/> <waitForPageLoad stepKey="waitForAdminProductIndex"/> - <actionGroup ref="filterProductGridBySkuAndName" stepKey="filerProductsBySkuAndName"> + <actionGroup ref="FilterProductGridBySkuAndNameActionGroup" stepKey="filerProductsBySkuAndName"> <argument name="product" value="SimpleProductWithCustomAttributeSet"/> </actionGroup> <!-- Should not see the product --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteConfigurableChildProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteConfigurableChildProductsTest.xml index 0df9dd0b57545..4a305b8dfec75 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteConfigurableChildProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteConfigurableChildProductsTest.xml @@ -95,10 +95,10 @@ <see selector="{{StorefrontProductInfoMainSection.productAttributeTitle1}}" userInput="$$createConfigProductAttribute.default_value$$" stepKey="seeProductAttributeLabel"/> <seeElement selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" stepKey="seeProductAttributeOptions"/> <!-- Delete Child products --> - <actionGroup ref="deleteProductBySku" stepKey="deleteFirstChildProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteFirstChildProduct"> <argument name="sku" value="$$createConfigChildProduct1.sku$$"/> </actionGroup> - <actionGroup ref="deleteProductBySku" stepKey="deleteSecondChildProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteSecondChildProduct"> <argument name="sku" value="$$createConfigChildProduct2.sku$$"/> </actionGroup> <!--Verify product is not visible in category store front page --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteDropdownProductAttributeFromAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteDropdownProductAttributeFromAttributeSetTest.xml index 3841c061c2629..84a116fb4bcd6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteDropdownProductAttributeFromAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteDropdownProductAttributeFromAttributeSetTest.xml @@ -41,7 +41,7 @@ <click selector="{{AdminProductAttributeSetGridSection.AttributeSetName($$createAttributeSet.attribute_set_name$$)}}" stepKey="clickOnAttributeSet"/> <waitForPageLoad stepKey="waitForAttributeSetEditPageToLoad"/> <!--Assign Attribute to the Group and save the attribute set --> - <actionGroup ref="AssignAttributeToGroup" stepKey="assignAttribute"> + <actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttribute"> <argument name="group" value="Product Details"/> <argument name="attribute" value="$$attribute.attribute_code$$"/> </actionGroup> @@ -49,11 +49,11 @@ <waitForPageLoad stepKey="waitForPageToSave"/> <see userInput="You saved the attribute set" selector="{{AdminMessagesSection.success}}" stepKey="successMessage"/> <!--Delete product attribute from product attribute grid --> - <actionGroup ref="deleteProductAttributeByAttributeCode" stepKey="deleteProductAttribute"> + <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttribute"> <argument name="ProductAttributeCode" value="$$attribute.attribute_code$$"/> </actionGroup> <!--Confirm Attribute is not present in Product Attribute Grid --> - <actionGroup ref="filterProductAttributeByAttributeCode" stepKey="filterAttribute"> + <actionGroup ref="FilterProductAttributeByAttributeCodeActionGroup" stepKey="filterAttribute"> <argument name="ProductAttributeCode" value="$$attribute.attribute_code$$"/> </actionGroup> <see selector="{{AdminProductAttributeGridSection.FirstRow}}" userInput="We couldn't find any records." stepKey="seeEmptyRow"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductAttributeTest.xml index d0036a2adea5a..cc3242310ca11 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductAttributeTest.xml @@ -24,16 +24,16 @@ <after> <actionGroup ref="logout" stepKey="logout"/> </after> - <actionGroup ref="deleteProductAttributeByAttributeCode" stepKey="deleteProductAttribute"> + <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttribute"> <argument name="ProductAttributeCode" value="$$createProductAttribute.attribute_code$$"/> </actionGroup> <!-- Assert the product attribute is not in the grid by Attribute code --> - <actionGroup ref="filterProductAttributeByAttributeCode" stepKey="filterByAttributeCode"> + <actionGroup ref="FilterProductAttributeByAttributeCodeActionGroup" stepKey="filterByAttributeCode"> <argument name="ProductAttributeCode" value="$$createProductAttribute.attribute_code$$"/> </actionGroup> <see selector="{{AdminDataGridTableSection.dataGridEmpty}}" userInput="We couldn't find any records." stepKey="assertDataGridEmptyMessage"/> <!--Assert the product attribute is not in the grid by Default Label --> - <actionGroup ref="filterProductAttributeByDefaultLabel" stepKey="filterByDefaultLabel"> + <actionGroup ref="FilterProductAttributeByDefaultLabelActionGroup" stepKey="filterByDefaultLabel"> <argument name="productAttributeLabel" value="$$createProductAttribute.default_frontend_label$$"/> </actionGroup> <see selector="{{AdminDataGridTableSection.dataGridEmpty}}" userInput="We couldn't find any records." stepKey="assertDataGridEmptyMessage2"/> @@ -48,7 +48,7 @@ <waitForPageLoad stepKey="waitForAttributeAdded"/> <!-- Filter By Attribute Label on Add Attribute Page --> <click selector="{{AdminProductFiltersSection.filter}}" stepKey="clickOnFilter"/> - <actionGroup ref="filterProductAttributeByAttributeLabel" stepKey="filterByAttributeLabel"> + <actionGroup ref="FilterProductAttributeByAttributeLabelActionGroup" stepKey="filterByAttributeLabel"> <argument name="productAttributeLabel" value="$$createProductAttribute.default_frontend_label$$"/> </actionGroup> <see selector="{{AdminDataGridTableSection.dataGridEmpty}}" userInput="We couldn't find any records." stepKey="assertDataGridEmptyMessage3"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductWithCustomOptionTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductWithCustomOptionTest.xml index 7f6a1333b721a..dec911ec84a8d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductWithCustomOptionTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductWithCustomOptionTest.xml @@ -30,7 +30,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <actionGroup ref="logout" stepKey="logout"/> </after> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteSimpleProductFilteredBySkuAndName"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteSimpleProductFilteredBySkuAndName"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductsImageInCaseOfMultipleStoresTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductsImageInCaseOfMultipleStoresTest.xml index f334cbc218b7c..55c98bcc13d34 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductsImageInCaseOfMultipleStoresTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductsImageInCaseOfMultipleStoresTest.xml @@ -43,17 +43,17 @@ <amOnPage url="{{AdminProductEditPage.url($$createProduct.id$$)}}" stepKey="visitAdminProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoad0"/> <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="['Default Category', $$createRootCategory.name$$, $$createSubCategory.name$$]" stepKey="fillCategory"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!--Add images to the product--> <amOnPage url="{{AdminProductEditPage.url($$createProduct.id$$)}}" stepKey="visitAdminProductPage2"/> <waitForPageLoad stepKey="waitForProductPageLoad1"/> - <actionGroup ref="addProductImage" stepKey="addImageToProduct"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageToProduct"> <argument name="image" value="ProductImage"/> </actionGroup> - <actionGroup ref="addProductImage" stepKey="addImage1ToProduct"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage1ToProduct"> <argument name="image" value="TestImageNew"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct1"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct1"/> <!--Enable config to view created store view on store front--> <createData entity="EnableWebUrlOptionsConfig" stepKey="enableWebUrlOptionsConfig"/> </before> @@ -86,12 +86,12 @@ <actionGroup ref="SelectProductInWebsitesActionGroup" stepKey="selectWebsiteInProduct2"> <argument name="website" value="{{NewWebSiteData.name}}"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct2"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct2"/> <!--Reindex and flush cache--> <magentoCLI command="indexer:reindex" stepKey="reindex"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> <!--Switch to 'Default Store View' scope and open product page--> - <actionGroup ref="SwitchToTheNewStoreView" stepKey="SwitchDefaultStoreView"> + <actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="SwitchDefaultStoreView"> <argument name="storeViewName" value="'Default Store View'"/> </actionGroup> <waitForPageLoad stepKey="waitForProductPageLoad3"/> @@ -99,9 +99,9 @@ <actionGroup ref="AdminAssignImageRolesIfUnassignedActionGroup" stepKey="assignAllRolesToFirstImage"> <argument name="image" value="ProductImage"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct3"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct3"/> <!--Switch to newly created Store View scope and open product page--> - <actionGroup ref="SwitchToTheNewStoreView" stepKey="SwitchNewStoreView"> + <actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="SwitchNewStoreView"> <argument name="storeViewName" value="{{NewStoreViewData.name}}"/> </actionGroup> <waitForPageLoad stepKey="waitForProductPageLoad4"/> @@ -109,17 +109,17 @@ <actionGroup ref="AdminAssignImageRolesIfUnassignedActionGroup" stepKey="assignAllRolesToFirstImage2"> <argument name="image" value="ProductImage"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct4"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct4"/> <!--Switch to 'All Store Views' scope and open product page--> - <actionGroup ref="SwitchToTheNewStoreView" stepKey="SwitchAllStoreView"> + <actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="SwitchAllStoreView"> <argument name="storeViewName" value="'All Store Views'"/> </actionGroup> <waitForPageLoad stepKey="waitForProductPageLoad5"/> <!--Remove product image and save--> - <actionGroup ref="RemoveProductImageByName" stepKey="removeProductImage"> + <actionGroup ref="RemoveProductImageByNameActionGroup" stepKey="removeProductImage"> <argument name="image" value="ProductImage"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct5"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct5"/> <!--Assert notification and success messages--> <see selector="{{StorefrontMessagesSection.success}}" userInput="{{ProductFormMessages.save_success}}" stepKey="seeSuccessMessage"/> <see selector="{{StorefrontMessagesSection.noticeMessage}}" userInput="{{ProductFormMessages.remove_image_notice}}" stepKey="seeNotification"/> @@ -128,7 +128,7 @@ <waitForPageLoad stepKey="waitForImagesLoad"/> <seeElement selector="{{AdminProductImagesSection.imageFile(ProductImage.fileName)}}" stepKey="seeImageIsNotDeleted"/> <!--Switch to newly created Store View scope and open product page--> - <actionGroup ref="SwitchToTheNewStoreView" stepKey="SwitchNewStoreView2"> + <actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="SwitchNewStoreView2"> <argument name="storeViewName" value="{{NewStoreViewData.name}}"/> </actionGroup> <waitForPageLoad stepKey="waitForProductPageLoad6"/> @@ -136,17 +136,17 @@ <actionGroup ref="AdminAssignImageRolesIfUnassignedActionGroup" stepKey="assignAllRolesToSecondImage"> <argument name="image" value="TestImageNew"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct6"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct6"/> <!--Switch to 'All Store Views' scope and open product page--> - <actionGroup ref="SwitchToTheNewStoreView" stepKey="SwitchAllStoreView2"> + <actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="SwitchAllStoreView2"> <argument name="storeViewName" value="'All Store Views'"/> </actionGroup> <waitForPageLoad stepKey="waitForProductPageLoad7"/> <!--Remove product image and save--> - <actionGroup ref="RemoveProductImageByName" stepKey="removeProductFirstImage"> + <actionGroup ref="RemoveProductImageByNameActionGroup" stepKey="removeProductFirstImage"> <argument name="image" value="ProductImage"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct7"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct7"/> <!--Assert notification and success messages--> <see selector="{{StorefrontMessagesSection.success}}" userInput="{{ProductFormMessages.save_success}}" stepKey="seeSuccessMessage2"/> <see selector="{{StorefrontMessagesSection.noticeMessage}}" userInput="{{ProductFormMessages.remove_image_notice}}" stepKey="seeNotification2"/> @@ -155,15 +155,15 @@ <waitForPageLoad stepKey="waitForImagesLoad2"/> <seeElement selector="{{AdminProductImagesSection.imageFile(ProductImage.fileName)}}" stepKey="seeImageIsNotDeleted2"/> <!--Switch to newly created Store View scope and open product page--> - <actionGroup ref="SwitchToTheNewStoreView" stepKey="SwitchNewStoreView3"> + <actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="SwitchNewStoreView3"> <argument name="storeViewName" value="{{NewStoreViewData.name}}"/> </actionGroup> <waitForPageLoad stepKey="waitForProductPageLoad8"/> <!--Remove second image and save--> - <actionGroup ref="RemoveProductImageByName" stepKey="removeProductSecondImage"> + <actionGroup ref="RemoveProductImageByNameActionGroup" stepKey="removeProductSecondImage"> <argument name="image" value="TestImageNew"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct8"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct8"/> <!--Assert success messages--> <see selector="{{StorefrontMessagesSection.success}}" userInput="{{ProductFormMessages.save_success}}" stepKey="seeSuccessMessage3"/> <!--Reopen image tab and see the image is deleted--> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteSimpleProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteSimpleProductTest.xml index 7c460a3dfc51e..5b8ac5157514d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteSimpleProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteSimpleProductTest.xml @@ -29,7 +29,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <actionGroup ref="logout" stepKey="logout"/> </after> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteSimpleProductFilteredBySkuAndName"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteSimpleProductFilteredBySkuAndName"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteTextFieldProductAttributeFromAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteTextFieldProductAttributeFromAttributeSetTest.xml index c3cafb17c5eac..4b97fb38e994f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteTextFieldProductAttributeFromAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteTextFieldProductAttributeFromAttributeSetTest.xml @@ -47,7 +47,7 @@ <!--Open Product Index Page and filter the product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPageToLoad"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProduct"> <argument name="product" value="SimpleProduct2"/> </actionGroup> <!--Verify Created Product Attribute displayed in Product page --> @@ -55,11 +55,11 @@ <waitForPageLoad stepKey="waitForProductToLoad"/> <seeElement selector="{{AdminProductFormSection.newAddedAttribute($$attribute.attribute_code$$)}}" stepKey="seeProductAttributeIsAdded"/> <!--Delete product attribute from product attribute grid --> - <actionGroup ref="deleteProductAttributeByAttributeCode" stepKey="deleteProductAttribute"> + <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttribute"> <argument name="ProductAttributeCode" value="$$attribute.attribute_code$$"/> </actionGroup> <!-- Confirm attribute is not present in product attribute grid --> - <actionGroup ref="filterProductAttributeByAttributeCode" stepKey="filterAttribute"> + <actionGroup ref="FilterProductAttributeByAttributeCodeActionGroup" stepKey="filterAttribute"> <argument name="ProductAttributeCode" value="$$attribute.attribute_code$$"/> </actionGroup> <see stepKey="seeEmptyRow" selector="{{AdminProductAttributeGridSection.FirstRow}}" userInput="We couldn't find any records."/> @@ -77,7 +77,7 @@ <!--Verify Product Attribute is not present in Product Index Page --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="openProductIndexPage"/> <waitForPageLoad stepKey="waitForProductIndexPageToLoad1"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProduct1"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProduct1"> <argument name="product" value="SimpleProduct2"/> </actionGroup> <!--Verify Product Attribute is not present in Product page --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteVirtualProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteVirtualProductTest.xml index 413d53d1c3746..86f253f358532 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteVirtualProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteVirtualProductTest.xml @@ -30,7 +30,7 @@ <actionGroup ref="logout" stepKey="logout"/> </after> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteVirtualProductFilteredBySkuAndName"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteVirtualProductFilteredBySkuAndName"> <argument name="product" value="$$createVirtualProduct$$"/> </actionGroup> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDisableProductOnChangingAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDisableProductOnChangingAttributeSetTest.xml index dab1704d50bf3..0fc2c022b81e9 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDisableProductOnChangingAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDisableProductOnChangingAttributeSetTest.xml @@ -33,7 +33,7 @@ </after> <actionGroup ref="LoginAsAdmin" stepKey="login"/> <amOnPage url="{{AdminProductAttributeSetEditPage.url}}/$$createAttributeSet.attribute_set_id$$/" stepKey="onAttributeSetEdit"/> - <actionGroup ref="SaveAttributeSet" stepKey="SaveAttributeSet"/> + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="SaveAttributeSet"/> <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForSimpleProduct"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminEditTextEditorProductAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminEditTextEditorProductAttributeTest.xml index 53040993beb8f..392d3c6ff5320 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminEditTextEditorProductAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminEditTextEditorProductAttributeTest.xml @@ -26,7 +26,7 @@ <requiredEntity createDataKey="myProductAttributeCreation"/> </createData> </before> - <actionGroup ref="navigateToCreatedProductAttribute" stepKey="navigateToAttribute"> + <actionGroup ref="NavigateToCreatedProductAttributeActionGroup" stepKey="navigateToAttribute"> <argument name="ProductAttribute" value="productAttributeWysiwyg"/> </actionGroup> <seeOptionIsSelected selector="{{AttributePropertiesSection.InputType}}" userInput="Text Editor" stepKey="seeTextEditorSelected" /> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminFilterByNameByStoreViewOnProductGridTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminFilterByNameByStoreViewOnProductGridTest.xml index f3ec225540c75..0b230b0b8e002 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminFilterByNameByStoreViewOnProductGridTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminFilterByNameByStoreViewOnProductGridTest.xml @@ -35,11 +35,11 @@ <scrollToTopOfPage stepKey="scrollToTopOfAdminProductFormSection"/> <click selector="{{AdminProductFormSection.productNameUseDefault}}" stepKey="uncheckUseDefault"/> <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{SimpleProduct.name}}" stepKey="fillNewName"/> - <actionGroup ref="saveProductForm" stepKey="saveSimpleProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSimpleProduct"/> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> - <actionGroup ref="filterProductGridByName" stepKey="filterGridByName"> + <actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterGridByName"> <argument name="product" value="SimpleProduct"/> </actionGroup> <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{SimpleProduct2.name}}" stepKey="seeProductNameInGrid"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminFilteringCategoryProductsUsingScopeSelectorTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminFilteringCategoryProductsUsingScopeSelectorTest.xml index 41b446b474078..f75bdf18ccfc4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminFilteringCategoryProductsUsingScopeSelectorTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminFilteringCategoryProductsUsingScopeSelectorTest.xml @@ -60,7 +60,7 @@ <click selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="clickToOpenWebsiteSection"/> <waitForPageLoad stepKey="waitForToOpenedWebsiteSection"/> <uncheckOption selector="{{ProductInWebsitesSection.website('Main Website')}}" stepKey="uncheckWebsite"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct1"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct1"/> <!-- Set filter to product name and product2 in website 2 only --> <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForProduct2"> @@ -73,7 +73,7 @@ <argument name="website" value="{{secondCustomWebsite.name}}"/> </actionGroup> <uncheckOption selector="{{ProductInWebsitesSection.website('Main Website')}}" stepKey="uncheckWebsite1"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct2"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct2"/> <!-- Set filter to product name and product12 assigned to both websites 1 and 2 --> <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForProduct12"> @@ -85,7 +85,7 @@ <actionGroup ref="SelectProductInWebsitesActionGroup" stepKey="selectProductInWebsites1"> <argument name="website" value="{{secondCustomWebsite.name}}"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct3"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct3"/> </before> <after> <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminGridPageNumberAfterSaveAndCloseActionTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminGridPageNumberAfterSaveAndCloseActionTest.xml index eb4a561760070..9c0fbbb78451d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminGridPageNumberAfterSaveAndCloseActionTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminGridPageNumberAfterSaveAndCloseActionTest.xml @@ -25,8 +25,8 @@ <comment userInput="Clear product grid" stepKey="commentClearProductGrid"/> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="goToProductCatalog"/> <waitForPageLoad stepKey="waitForProductIndexPage"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridToDefaultView"/> - <actionGroup ref="deleteProductsIfTheyExist" stepKey="deleteProductIfTheyExist"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridToDefaultView"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteProductIfTheyExist"/> <createData stepKey="category1" entity="SimpleSubCategory"/> <createData stepKey="product1" entity="SimpleProduct"> <requiredEntity createDataKey="category1"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml index dfadfdf00481b..3cc21920d239c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml @@ -42,7 +42,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createFirstProduct" stepKey="deleteFirstProduct"/> <!--Delete second product with changed sku--> - <actionGroup ref="deleteProductBySku" stepKey="deleteSecondProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteSecondProduct"> <argument name="sku" value="$$createFirstProduct.sku$$-1"/> </actionGroup> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductGridFilter"/> @@ -54,19 +54,19 @@ <fillField selector="{{AdminProductFormSection.productSku}}" userInput="$$createFirstProduct.sku$$" stepKey="fillProductSku1"/> <!--Import customizable options and check--> <conditionalClick selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" dependentSelector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" visible="false" stepKey="openCustomOptionSection"/> - <actionGroup ref="importProductCustomizableOptions" stepKey="importOptions"> + <actionGroup ref="ImportProductCustomizableOptionsActionGroup" stepKey="importOptions"> <argument name="productName" value="$$createFirstProduct.name$$"/> </actionGroup> - <actionGroup ref="checkCustomizableOptionImport" stepKey="checkFirstOptionImport"> + <actionGroup ref="CheckCustomizableOptionImportActionGroup" stepKey="checkFirstOptionImport"> <argument name="option" value="ProductOptionField"/> <argument name="optionIndex" value="0"/> </actionGroup> - <actionGroup ref="checkCustomizableOptionImport" stepKey="checkSecondOptionImport"> + <actionGroup ref="CheckCustomizableOptionImportActionGroup" stepKey="checkSecondOptionImport"> <argument name="option" value="ProductOptionField2"/> <argument name="optionIndex" value="1"/> </actionGroup> <!--Save product and check sku changed message--> - <actionGroup ref="saveProductForm" stepKey="saveSecondProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSecondProduct"/> <see selector="{{AdminMessagesSection.notice}}" userInput="SKU for product $$createSecondProduct.name$$ has been changed to $$createFirstProduct.sku$$-1." stepKey="seeSkuChangedMessage"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassChangeProductsStatusTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassChangeProductsStatusTest.xml index 8d5121cf21461..6896b11196cf2 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassChangeProductsStatusTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassChangeProductsStatusTest.xml @@ -39,10 +39,10 @@ <!-- Search and select products --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPageLoad"/> - <actionGroup ref="searchProductGridByKeyword2" stepKey="searchByKeyword"> + <actionGroup ref="SearchProductGridByKeyword2ActionGroup" stepKey="searchByKeyword"> <argument name="keyword" value="api-simple-product"/> </actionGroup> - <actionGroup ref="sortProductsByIdDescending" stepKey="sortProductsByIdDescending"/> + <actionGroup ref="SortProductsByIdDescendingActionGroup" stepKey="sortProductsByIdDescending"/> <click selector="{{AdminProductGridSection.productGridCheckboxOnRow('1')}}" stepKey="clickCheckbox1"/> <click selector="{{AdminProductGridSection.productGridCheckboxOnRow('2')}}" stepKey="clickCheckbox2"/> <!-- Mass change status --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassProductPriceUpdateTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassProductPriceUpdateTest.xml index f5ad5b8079d1f..e98b145f01401 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassProductPriceUpdateTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassProductPriceUpdateTest.xml @@ -34,12 +34,12 @@ <waitForPageLoad stepKey="waitForProductIndexPageToLoad"/> <!--Search products using keyword --> - <actionGroup ref="searchProductGridByKeyword2" stepKey="searchByKeyword"> + <actionGroup ref="SearchProductGridByKeyword2ActionGroup" stepKey="searchByKeyword"> <argument name="keyword" value="Testp"/> </actionGroup> <!--Sort Products by ID in descending order--> - <actionGroup ref="sortProductsByIdDescending" stepKey="sortProductsByIdDescending"/> + <actionGroup ref="SortProductsByIdDescendingActionGroup" stepKey="sortProductsByIdDescending"/> <!--Select products--> <checkOption selector="{{AdminProductGridSection.productRowCheckboxBySku($$simpleProduct1.sku$$)}}" stepKey="selectFirstProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesGlobalScopeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesGlobalScopeTest.xml index 989431941b279..71873fe5b0960 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesGlobalScopeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesGlobalScopeTest.xml @@ -21,7 +21,7 @@ </annotations> <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="deleteAllProductsUsingProductGrid" stepKey="deleteAllProducts"/> + <actionGroup ref="DeleteAllProductsUsingProductGridActionGroup" stepKey="deleteAllProducts"/> <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView" /> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="ApiSimpleProduct" stepKey="createProductOne"> @@ -44,10 +44,10 @@ <!-- Search and select products --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPageLoad"/> - <actionGroup ref="searchProductGridByKeyword2" stepKey="searchByKeyword"> + <actionGroup ref="SearchProductGridByKeyword2ActionGroup" stepKey="searchByKeyword"> <argument name="keyword" value="api-simple-product"/> </actionGroup> - <actionGroup ref="sortProductsByIdDescending" stepKey="sortProductsByIdDescending"/> + <actionGroup ref="SortProductsByIdDescendingActionGroup" stepKey="sortProductsByIdDescending"/> <click selector="{{AdminProductGridSection.productGridCheckboxOnRow('1')}}" stepKey="clickCheckbox1"/> <click selector="{{AdminProductGridSection.productGridCheckboxOnRow('2')}}" stepKey="clickCheckbox2"/> <!-- Mass update attributes --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesMissingRequiredFieldTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesMissingRequiredFieldTest.xml index fe0e46369c5e6..a4c8f5e8cff6c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesMissingRequiredFieldTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesMissingRequiredFieldTest.xml @@ -39,7 +39,7 @@ <!-- Search and select products --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPageLoad"/> - <actionGroup ref="searchProductGridByKeyword2" stepKey="searchByKeyword"> + <actionGroup ref="SearchProductGridByKeyword2ActionGroup" stepKey="searchByKeyword"> <argument name="keyword" value="api-simple-product"/> </actionGroup> <click selector="{{AdminProductGridSection.productGridCheckboxOnRow('1')}}" stepKey="clickCheckbox1"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesStoreViewScopeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesStoreViewScopeTest.xml index 18d4b9e341cc6..c9840fe455f84 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesStoreViewScopeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesStoreViewScopeTest.xml @@ -38,10 +38,10 @@ <!-- Search and select products --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPageLoad"/> - <actionGroup ref="searchProductGridByKeyword2" stepKey="searchByKeyword"> + <actionGroup ref="SearchProductGridByKeyword2ActionGroup" stepKey="searchByKeyword"> <argument name="keyword" value="api-simple-product"/> </actionGroup> - <actionGroup ref="sortProductsByIdDescending" stepKey="sortProductsByIdDescending"/> + <actionGroup ref="SortProductsByIdDescendingActionGroup" stepKey="sortProductsByIdDescending"/> <click selector="{{AdminProductGridSection.productGridCheckboxOnRow('1')}}" stepKey="clickCheckbox1"/> <click selector="{{AdminProductGridSection.productGridCheckboxOnRow('2')}}" stepKey="clickCheckbox2"/> <!-- Mass update attributes --> @@ -114,10 +114,10 @@ <!-- Search and select products --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPageLoad"/> - <actionGroup ref="searchProductGridByKeyword2" stepKey="searchByKeyword"> + <actionGroup ref="SearchProductGridByKeyword2ActionGroup" stepKey="searchByKeyword"> <argument name="keyword" value="api-simple-product"/> </actionGroup> - <actionGroup ref="sortProductsByIdDescending" stepKey="sortProductsByIdDescending"/> + <actionGroup ref="SortProductsByIdDescendingActionGroup" stepKey="sortProductsByIdDescending"/> <click selector="{{AdminProductGridSection.productGridCheckboxOnRow('1')}}" stepKey="clickCheckbox1"/> <click selector="{{AdminProductGridSection.productGridCheckboxOnRow('2')}}" stepKey="clickCheckbox2"/> <!-- Mass update attributes --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductStatusStoreViewScopeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductStatusStoreViewScopeTest.xml index 02e8157282dee..21c6c56adfd96 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductStatusStoreViewScopeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductStatusStoreViewScopeTest.xml @@ -55,13 +55,13 @@ <see userInput="You saved the store view." stepKey="seeSavedMessage" /> <!--Create a Simple Product 1 --> - <actionGroup ref="createSimpleProductAndAddToWebsite" stepKey="createSimpleProduct1"> + <actionGroup ref="CreateSimpleProductAndAddToWebsiteActionGroup" stepKey="createSimpleProduct1"> <argument name="product" value="simpleProductForMassUpdate"/> <argument name="website" value="Second Website"/> </actionGroup> <!--Create a Simple Product 2 --> - <actionGroup ref="createSimpleProductAndAddToWebsite" stepKey="createSimpleProduct2"> + <actionGroup ref="CreateSimpleProductAndAddToWebsiteActionGroup" stepKey="createSimpleProduct2"> <argument name="product" value="simpleProductForMassUpdate2"/> <argument name="website" value="Second Website"/> </actionGroup> @@ -86,10 +86,10 @@ <!-- Search and select products --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPageLoad"/> - <actionGroup ref="searchProductGridByKeyword2" stepKey="searchByKeyword"> + <actionGroup ref="SearchProductGridByKeyword2ActionGroup" stepKey="searchByKeyword"> <argument name="keyword" value="{{simpleProductForMassUpdate.keyword}}"/> </actionGroup> - <actionGroup ref="sortProductsByIdDescending" stepKey="sortProductsByIdDescending"/> + <actionGroup ref="SortProductsByIdDescendingActionGroup" stepKey="sortProductsByIdDescending"/> <!-- Filter to Second Store View --> <actionGroup ref="AdminFilterStoreViewActionGroup" stepKey="filterStoreView" > @@ -205,13 +205,13 @@ <see userInput="You saved the store view." stepKey="seeSavedMessage" /> <!--Create a Simple Product 1 --> - <actionGroup ref="createSimpleProductAndAddToWebsite" stepKey="createSimpleProduct1"> + <actionGroup ref="CreateSimpleProductAndAddToWebsiteActionGroup" stepKey="createSimpleProduct1"> <argument name="product" value="simpleProductForMassUpdate"/> <argument name="website" value="Second Website"/> </actionGroup> <!--Create a Simple Product 2 --> - <actionGroup ref="createSimpleProductAndAddToWebsite" stepKey="createSimpleProduct2"> + <actionGroup ref="CreateSimpleProductAndAddToWebsiteActionGroup" stepKey="createSimpleProduct2"> <argument name="product" value="simpleProductForMassUpdate2"/> <argument name="website" value="Second Website"/> </actionGroup> @@ -236,10 +236,10 @@ <!-- Search and select products --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPageLoad"/> - <actionGroup ref="searchProductGridByKeyword2" stepKey="searchByKeyword"> + <actionGroup ref="SearchProductGridByKeyword2ActionGroup" stepKey="searchByKeyword"> <argument name="keyword" value="{{simpleProductForMassUpdate.keyword}}"/> </actionGroup> - <actionGroup ref="sortProductsByIdDescending" stepKey="sortProductsByIdDescending"/> + <actionGroup ref="SortProductsByIdDescendingActionGroup" stepKey="sortProductsByIdDescending"/> <!-- Filter to Second Store View --> <actionGroup ref="AdminFilterStoreViewActionGroup" stepKey="filterStoreView" > @@ -299,4 +299,4 @@ <actionGroup ref="StorefrontCheckAdvancedSearchResultActionGroup" stepKey="StorefrontCheckAdvancedSearchResultDefault2"/> <see userInput="We can't find any items matching these search criteria." selector="{{StorefrontCatalogSearchAdvancedResultMainSection.message}}" stepKey="seeInDefault2"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryFromParentAnchoredCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryFromParentAnchoredCategoryTest.xml index b613068893b0e..271d78ab9cdb0 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryFromParentAnchoredCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryFromParentAnchoredCategoryTest.xml @@ -25,7 +25,7 @@ <after> <deleteData createDataKey="simpleProduct" stepKey="deleteSimpleProduct"/> <deleteData createDataKey="createDefaultCategory" stepKey="deleteDefaultCategory"/> - <actionGroup ref="DeleteCategory" stepKey="deleteCategory"> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCategory"> <argument name="categoryEntity" value="SimpleSubCategory"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryToAnotherPositionInCategoryTreeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryToAnotherPositionInCategoryTreeTest.xml index 9831f73e07877..6c403fc7714eb 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryToAnotherPositionInCategoryTreeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryToAnotherPositionInCategoryTreeTest.xml @@ -25,7 +25,7 @@ </before> <after> <deleteData createDataKey="createDefaultCategory" stepKey="deleteDefaultCategory"/> - <actionGroup ref="DeleteCategory" stepKey="SecondLevelSubCat"> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="SecondLevelSubCat"> <argument name="categoryEntity" value="SecondLevelSubCat"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveProductBetweenCategoriesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveProductBetweenCategoriesTest.xml index da985fc2ce34d..7e6e79cd08c26 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveProductBetweenCategoriesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveProductBetweenCategoriesTest.xml @@ -94,7 +94,7 @@ <waitForPageLoad stepKey="waitForProductPage"/> <!-- Click on <product1>: Product page opens--> - <actionGroup ref="filterProductGridByName" stepKey="filterProduct"> + <actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterProduct"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> <click selector="{{AdminProductGridSection.productGridNameProduct($$simpleProduct.name$$)}}" stepKey="clickProduct1"/> @@ -159,16 +159,16 @@ <see userInput="$$createAnchoredCategory1.name$$" selector="{{StorefrontCategoryMainSection.CategoryTitle}}" stepKey="seeCategory1Name"/> <see userInput="We can't find products matching the selection." stepKey="seeEmptyNotice"/> <dontSee userInput="$$simpleProduct.name$$" selector="{{StorefrontCategoryMainSection.productName}}" stepKey="dontseeProduct"/> - + <!-- Log in to the backend: Admin user is logged in--> <actionGroup ref="LoginAsAdmin" stepKey="LoginAdmin"/> - + <!-- Navigate to the Catalog > Products: Navigate to the Catalog>Products --> <amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="amOnProductPage"/> <waitForPageLoad stepKey="waitForProductsPage"/> <!-- Click on <product1> --> - <actionGroup ref="filterAndSelectProduct" stepKey="openSimpleProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="openSimpleProduct"> <argument name="productSku" value="$$simpleProduct.sku$$"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminNavigateMultipleUpSellProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminNavigateMultipleUpSellProductsTest.xml index bcd4ca8531203..5dd8b2e430941 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminNavigateMultipleUpSellProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminNavigateMultipleUpSellProductsTest.xml @@ -97,7 +97,7 @@ <waitForPageLoad stepKey="waitForProductIndexPageToLoad"/> <!--Select SimpleProduct --> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedProduct"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> <click stepKey="openFirstProduct" selector="{{AdminProductGridSection.productRowBySku($$createSimpleProduct.sku$$)}}"/> @@ -106,7 +106,7 @@ <!--Add SimpleProduct1 and ConfigProduct as Up sell products--> <click stepKey="clickOnRelatedProducts" selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedProductsHeader}}"/> <click stepKey="clickOnAddUpSellProducts" selector="{{AdminProductFormRelatedUpSellCrossSellSection.addUpSellProduct}}"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterProduct"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProduct"> <argument name="sku" value="$$createSimpleProduct1.sku$$"/> </actionGroup> <waitForPageLoad stepKey="waitForTheProductToLoad"/> @@ -114,7 +114,7 @@ <click stepKey="addSelectedProduct" selector="{{AdminAddRelatedProductsModalSection.AddUpSellProductsButton}}"/> <waitForPageLoad stepKey="waitForProductToBeAdded"/> <click stepKey="clickOnAddUpSellProductsButton" selector="{{AdminProductFormRelatedUpSellCrossSellSection.addUpSellProduct}}"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterConfigurableProduct"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterConfigurableProduct"> <argument name="sku" value="$$createConfigProduct.sku$$"/> </actionGroup> <waitForPageLoad stepKey="waitForTheConfigProductToLoad"/> @@ -131,7 +131,7 @@ <waitForPageLoad stepKey="waitForProductsToBeLoaded"/> <!--Select Configurable Product--> - <actionGroup ref="filterProductGridBySku" stepKey="findConfigProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findConfigProduct"> <argument name="product" value="$$createConfigProduct$$"/> </actionGroup> <click stepKey="openConfigProduct" selector="{{AdminProductGridSection.productRowBySku($$createConfigProduct.sku$$)}}"/> @@ -140,7 +140,7 @@ <!--Add SimpleProduct1 as Up Sell Product--> <click stepKey="clickOnRelatedProductsHeader" selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedProductsHeader}}"/> <click stepKey="clickOnAddUpSellProductsButton1" selector="{{AdminProductFormRelatedUpSellCrossSellSection.addUpSellProduct}}"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterSimpleProduct2"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterSimpleProduct2"> <argument name="sku" value="$$createSimpleProduct1.sku$$"/> </actionGroup> <waitForPageLoad stepKey="waitForTheSimpleProduct2ToBeLoaded"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCategoryIndexerInUpdateOnScheduleModeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCategoryIndexerInUpdateOnScheduleModeTest.xml index 41d3ca3020c98..2283a0e4d6158 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCategoryIndexerInUpdateOnScheduleModeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCategoryIndexerInUpdateOnScheduleModeTest.xml @@ -148,7 +148,7 @@ <waitForPageLoad stepKey="waitForProductC1PageLoad"/> <click selector="{{AdminProductFormSection.enableProductLabel}}" stepKey="clickOffEnableToggleAgain"/> <!-- Saved successfully --> - <actionGroup ref="saveProductForm" stepKey="saveProductC1"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductC1"/> <!-- 12. Open category B on Storefront --> <actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="toCategoryBStorefront"> @@ -205,7 +205,7 @@ <click selector="{{AdminProductFormSection.enableProductLabel}}" stepKey="clickOnEnableToggleAgain"/> <!-- Saved successfully --> - <actionGroup ref="saveProductForm" stepKey="saveChangedProductC1"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveChangedProductC1"/> <!-- 17.12. Open category B on Storefront --> <actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="openCategoryB"> @@ -264,7 +264,7 @@ stepKey="changeVisibility"/> <!-- Saved successfully --> - <actionGroup ref="saveProductForm" stepKey="productC1Saved"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="productC1Saved"/> <!-- 18.12. Open category B on Storefront --> <actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="goPageCategoryB"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCustomURLKeyPreservedWhenAssignedToCategoryWithoutCustomURLKey.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCustomURLKeyPreservedWhenAssignedToCategoryWithoutCustomURLKey.xml index bae81513de632..df09768139533 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCustomURLKeyPreservedWhenAssignedToCategoryWithoutCustomURLKey.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCustomURLKeyPreservedWhenAssignedToCategoryWithoutCustomURLKey.xml @@ -61,20 +61,20 @@ <conditionalClick selector="{{AdminProductSEOSection.sectionHeader}}" dependentSelector="{{AdminProductSEOSection.urlKeyInput}}" visible="false" stepKey="openSeoSection"/> <uncheckOption selector="{{AdminProductSEOSection.useDefaultUrl}}" stepKey="uncheckUseDefaultUrlKey"/> <fillField userInput="U2" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> - <actionGroup ref="goToAdminCategoryPageById" stepKey="openCategory"> + <actionGroup ref="GoToAdminCategoryPageByIdActionGroup" stepKey="openCategory"> <argument name="id" value="$createCategory.id$"/> </actionGroup> - <actionGroup ref="AdminCategoryAssignProduct" stepKey="assignSimpleProductFirst"> + <actionGroup ref="AdminCategoryAssignProductActionGroup" stepKey="assignSimpleProductFirst"> <argument name="productSku" value="$createSimpleProductFirst.sku$"/> </actionGroup> - <actionGroup ref="AdminCategoryAssignProduct" stepKey="assignSimpleProductSecond"> + <actionGroup ref="AdminCategoryAssignProductActionGroup" stepKey="assignSimpleProductSecond"> <argument name="productSku" value="$createSimpleProductSecond.sku$"/> </actionGroup> - <actionGroup ref="saveCategoryForm" stepKey="saveCategory"/> + <actionGroup ref="SaveCategoryFormActionGroup" stepKey="saveCategory"/> <executeJS function="return '$createCategory.name$'.toLowerCase();" stepKey="categoryNameLower" /> <executeJS function="return '$createSimpleProductFirst.name$'.toLowerCase();" stepKey="simpleProductFirstNameLower" /> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByCustomAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByCustomAttributeTest.xml index 72c270aad585c..f4f86f3a65a12 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByCustomAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByCustomAttributeTest.xml @@ -22,7 +22,7 @@ <before> <!--Login as admin and delete all products --> <actionGroup ref="LoginAsAdmin" stepKey="login"/> - <actionGroup ref="deleteAllProductsUsingProductGrid" stepKey="deleteAllProducts"/> + <actionGroup ref="DeleteAllProductsUsingProductGridActionGroup" stepKey="deleteAllProducts"/> <!--Create dropdown product attribute--> <createData entity="productDropDownAttribute" stepKey="createDropdownAttribute"/> <!--Create attribute options--> @@ -59,7 +59,7 @@ <argument name="product" value="$$createFirstProduct$$"/> </actionGroup> <selectOption selector="{{AdminProductFormSection.customSelectField($$createDropdownAttribute.attribute[attribute_code]$$)}}" userInput="$$createFirstProductAttributeOption.option[store_labels][0][label]$$" stepKey="setFirstAttributeValue"/> - <actionGroup ref="saveProductForm" stepKey="saveFirstProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveFirstProduct"/> <!--Update second product--> <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForSecondProduct"> <argument name="product" value="$$createSecondProduct$$"/> @@ -68,7 +68,7 @@ <argument name="product" value="$$createSecondProduct$$"/> </actionGroup> <selectOption selector="{{AdminProductFormSection.customSelectField($$createDropdownAttribute.attribute[attribute_code]$$)}}" userInput="$$createSecondProductAttributeOption.option[store_labels][0][label]$$" stepKey="setSecondAttributeValue"/> - <actionGroup ref="saveProductForm" stepKey="saveSecondProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSecondProduct"/> <!--Update third product--> <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForThirdProduct"> <argument name="product" value="$$createThirdProduct$$"/> @@ -77,7 +77,7 @@ <argument name="product" value="$$createThirdProduct$$"/> </actionGroup> <selectOption selector="{{AdminProductFormSection.customSelectField($$createDropdownAttribute.attribute[attribute_code]$$)}}" userInput="$$createThirdProductAttributeOption.option[store_labels][0][label]$$" stepKey="setThirdAttributeValue"/> - <actionGroup ref="saveProductForm" stepKey="saveThirdProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveThirdProduct"/> </before> <after> <!--Delete products--> @@ -88,7 +88,7 @@ <deleteData createDataKey="createDropdownAttribute" stepKey="deleteDropdownAttribute"/> <!--Delete category--> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> - <actionGroup ref="NavigateToAndResetProductGridToDefaultView" stepKey="NavigateToAndResetProductGridToDefaultViewAfterTest"/> + <actionGroup ref="NavigateToAndResetProductGridToDefaultViewActionGroup" stepKey="NavigateToAndResetProductGridToDefaultViewAfterTest"/> <actionGroup ref="logout" stepKey="logout"/> </after> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByDateAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByDateAttributeTest.xml index 2884cb26cf813..df2b525a56086 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByDateAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByDateAttributeTest.xml @@ -45,7 +45,7 @@ <click selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="closeColumnsDropdown1"/> <seeElement selector="{{AdminProductGridSection.columnHeader('Set Product as New from Date')}}" stepKey="seeNewFromDateColumn"/> <waitForPageLoad stepKey="waitforFiltersToApply"/> - <actionGroup ref="filterProductGridBySetNewFromDate" stepKey="filterProductGridToCheckSetAsNewColumn"/> + <actionGroup ref="FilterProductGridBySetNewFromDateActionGroup" stepKey="filterProductGridToCheckSetAsNewColumn"/> <click selector="{{AdminProductGridSection.firstRow}}" stepKey="clickOnFirstRowProductGrid"/> <waitForPageLoad stepKey="waitForProductEditPageToLoad"/> <actionGroup ref="AdminFormSaveAndClose" stepKey="saveAndCloseProductForm"/> @@ -57,4 +57,4 @@ <click selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="closeColumnsDropdown2"/> <click selector="{{AdminProductGridFilterSection.clearAll}}" stepKey="clearGridFilters"/> </test> - </tests> \ No newline at end of file + </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductImageAssignmentForMultipleStoresTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductImageAssignmentForMultipleStoresTest.xml index 8149bc34087fb..44829f0c06b84 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductImageAssignmentForMultipleStoresTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductImageAssignmentForMultipleStoresTest.xml @@ -73,8 +73,8 @@ </actionGroup> <!-- Upload Image English --> - <actionGroup ref="addProductImage" stepKey="uploadImageEnglish"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct1"/> + <actionGroup ref="AddProductImageActionGroup" stepKey="uploadImageEnglish"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct1"/> <!-- Switch to the French store view --> <actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="switchStoreViewFrenchProduct"> @@ -82,19 +82,19 @@ </actionGroup> <!-- Upload Image French --> - <actionGroup ref="addProductImage" stepKey="uploadImageFrench"> + <actionGroup ref="AddProductImageActionGroup" stepKey="uploadImageFrench"> <argument name="image" value="Magento3"/> </actionGroup> <actionGroup ref="AdminAssignImageRolesActionGroup" stepKey="assignImageRole1"> <argument name="image" value="Magento3"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct2"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct2"/> <!-- Switch to the All store view --> <actionGroup ref="AdminSwitchToAllStoreViewActionGroup" stepKey="switchAllStoreViewProduct"/> <!-- Upload Image All Store View --> - <actionGroup ref="addProductImage" stepKey="uploadImageAllStoreView"> + <actionGroup ref="AddProductImageActionGroup" stepKey="uploadImageAllStoreView"> <argument name="image" value="TestImageNew"/> </actionGroup> <actionGroup ref="AdminAssignImageRolesActionGroup" stepKey="assignImageRole"> @@ -105,7 +105,7 @@ <click selector="{{AdminProductContentSection.sectionHeader}}" stepKey="openDescriptionDropDown"/> <fillField selector="{{AdminProductContentSection.descriptionTextArea}}" userInput="This is the long description" stepKey="fillLongDescription"/> <fillField selector="{{AdminProductContentSection.shortDescriptionTextArea}}" userInput="This is the short description" stepKey="fillShortDescription"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Go to Product Page and see Default Store View--> <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="goToDefaultStorefrontProductPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml index de065d2d930cb..40880291330e7 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml @@ -45,11 +45,11 @@ <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addDownloadableProductLink"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveDownloadableProductForm"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveDownloadableProductForm"/> <!--Assert downloadable product on Admin product page grid--> <comment userInput="Assert configurable product in Admin product page grid" stepKey="commentAssertDownloadableProductOnAdmin"/> <amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="goToCatalogProductPage"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterProductGridBySku"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGridBySku"> <argument name="sku" value="$$createProduct.sku$$"/> </actionGroup> <see selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="$$createProduct.name$$" stepKey="seeDownloadableProductNameInGrid"/> @@ -80,11 +80,11 @@ <waitForPageLoad stepKey="waitForProductPageLoad"/> <actionGroup ref="AdminAddDownloadableLinkInformationActionGroup" stepKey="addDownloadableLinkInformation"/> <selectOption selector="{{AdminProductFormSection.productWeightSelect}}" userInput="This item has weight" stepKey="selectWeightForProduct"/> - <actionGroup ref="saveProductForm" stepKey="saveProductForm"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> <!--Assert simple product on Admin product page grid--> <comment userInput="Assert simple product in Admin product page grid" stepKey="commentAssertProductOnAdmin"/> <amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="goToCatalogSimpleProductPage"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterSimpleProductGridBySku"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterSimpleProductGridBySku"> <argument name="sku" value="$$createProduct.sku$$"/> </actionGroup> <see selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="$$createProduct.name$$" stepKey="seeSimpleProductNameInGrid"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveCustomOptionsFromProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveCustomOptionsFromProductTest.xml index b5f212d1144be..71c1ccd4de9b5 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveCustomOptionsFromProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveCustomOptionsFromProductTest.xml @@ -34,59 +34,59 @@ <!-- Edit Simple Product --> <amOnPage url="{{AdminProductEditPage.url($$createProduct.id$$)}}" stepKey="goToProduct"/> <!-- See 3 options are present --> - <actionGroup ref="AdminAssertProductCustomOptionVisible" stepKey="assertCustomOptionsField"> + <actionGroup ref="AdminAssertProductCustomOptionVisibleActionGroup" stepKey="assertCustomOptionsField"> <argument name="option" value="ProductOptionField"/> </actionGroup> - <actionGroup ref="AdminAssertProductCustomOptionVisible" stepKey="assertCustomOptionsArea"> + <actionGroup ref="AdminAssertProductCustomOptionVisibleActionGroup" stepKey="assertCustomOptionsArea"> <argument name="option" value="ProductOptionArea"/> </actionGroup> - <actionGroup ref="AdminAssertProductCustomOptionVisible" stepKey="assertCustomOptionsFile"> + <actionGroup ref="AdminAssertProductCustomOptionVisibleActionGroup" stepKey="assertCustomOptionsFile"> <argument name="option" value="ProductOptionFile"/> </actionGroup> <!-- Click delete "Area" and "File" options --> - <actionGroup ref="AdminDeleteProductCustomOption" stepKey="deleteCustomOptionArea"> + <actionGroup ref="AdminDeleteProductCustomOptionActionGroup" stepKey="deleteCustomOptionArea"> <argument name="option" value="ProductOptionArea"/> </actionGroup> - <actionGroup ref="AdminDeleteProductCustomOption" stepKey="deleteCustomOptionFile"> + <actionGroup ref="AdminDeleteProductCustomOptionActionGroup" stepKey="deleteCustomOptionFile"> <argument name="option" value="ProductOptionFile"/> </actionGroup> - <actionGroup ref="AdminAssertProductCustomOptionVisible" stepKey="assertVisibleCustomOptionField"> + <actionGroup ref="AdminAssertProductCustomOptionVisibleActionGroup" stepKey="assertVisibleCustomOptionField"> <argument name="option" value="ProductOptionField"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- See only "Field option" left Also we shouldn't see any other options --> - <actionGroup ref="AdminAssertProductCustomOptionVisible" stepKey="assertVisibleSecondCustomOptionField"> + <actionGroup ref="AdminAssertProductCustomOptionVisibleActionGroup" stepKey="assertVisibleSecondCustomOptionField"> <argument name="option" value="ProductOptionField"/> </actionGroup> - <actionGroup ref="AdminAssertProductHasNoCustomOption" stepKey="assertNoCustomOptionsFile"> + <actionGroup ref="AdminAssertProductHasNoCustomOptionActionGroup" stepKey="assertNoCustomOptionsFile"> <argument name="option" value="ProductOptionFileSecond"/> </actionGroup> - <actionGroup ref="AdminAssertProductHasNoCustomOption" stepKey="assertNoCustomOptionsField"> + <actionGroup ref="AdminAssertProductHasNoCustomOptionActionGroup" stepKey="assertNoCustomOptionsField"> <argument name="option" value="ProductOptionFieldSecond"/> </actionGroup> <!-- Click Add option "File" --> - <actionGroup ref="AddProductCustomOptionFile" stepKey="createAddOptionFile"> + <actionGroup ref="AddProductCustomOptionFileActionGroup" stepKey="createAddOptionFile"> <argument name="option" value="ProductOptionFileSecond"/> </actionGroup> <!-- Click Add option "Field" --> - <actionGroup ref="AddProductCustomOptionField" stepKey="createCustomOptionField"> + <actionGroup ref="AddProductCustomOptionFieldActionGroup" stepKey="createCustomOptionField"> <argument name="option" value="ProductOptionFieldSecond"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProductWithNewlyAddedOptions"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductWithNewlyAddedOptions"/> <!-- See 3 options are present --> - <actionGroup ref="AdminAssertProductCustomOptionVisible" stepKey="assertPresentCustomOptionField"> + <actionGroup ref="AdminAssertProductCustomOptionVisibleActionGroup" stepKey="assertPresentCustomOptionField"> <argument name="option" value="ProductOptionField"/> </actionGroup> - <actionGroup ref="AdminAssertProductCustomOptionVisible" stepKey="assertPresenceOfFileOption"> + <actionGroup ref="AdminAssertProductCustomOptionVisibleActionGroup" stepKey="assertPresenceOfFileOption"> <argument name="option" value="ProductOptionFileSecond"/> </actionGroup> - <actionGroup ref="AdminAssertProductCustomOptionVisible" stepKey="assertPresenceOfFieldOption"> + <actionGroup ref="AdminAssertProductCustomOptionVisibleActionGroup" stepKey="assertPresenceOfFieldOption"> <argument name="option" value="ProductOptionFieldSecond"/> </actionGroup> <!-- Delete All options and See no more options present on the page --> - <actionGroup ref="AdminDeleteAllProductCustomOptions" stepKey="deleteAllCustomOptions"/> + <actionGroup ref="AdminDeleteAllProductCustomOptionsActionGroup" stepKey="deleteAllCustomOptions"/> <!-- Product successfully saved and it has no options --> - <actionGroup ref="saveProductForm" stepKey="saveProductWithoutCustomOptions"/> - <actionGroup ref="AdminAssertProductHasNoCustomOptions" stepKey="assertNoCustomOptions"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductWithoutCustomOptions"/> + <actionGroup ref="AdminAssertProductHasNoCustomOptionsActionGroup" stepKey="assertNoCustomOptions"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultImageSimpleProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultImageSimpleProductTest.xml index 9760dc579b10b..3b750c2cdb21c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultImageSimpleProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultImageSimpleProductTest.xml @@ -28,35 +28,35 @@ <!--Create product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPage"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateSimpleProduct"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateSimpleProduct"> <argument name="product" value="SimpleProduct3"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillSimpleProductMain"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillSimpleProductMain"> <argument name="product" value="SimpleProduct3"/> </actionGroup> <!-- Add image to product --> - <actionGroup ref="addProductImage" stepKey="addImageForProductSimple"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageForProductSimple"> <argument name="image" value="MagentoLogo"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveSimpleProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSimpleProduct"/> <!-- Remove image from product --> - <actionGroup ref="removeProductImage" stepKey="removeProductImage"/> + <actionGroup ref="RemoveProductImageActionGroup" stepKey="removeProductImage"/> - <actionGroup ref="saveProductForm" stepKey="saveProductFormAfterRemove"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductFormAfterRemove"/> <!-- Assert product image not in admin product form --> - <actionGroup ref="assertProductImageNotInAdminProductPage" stepKey="assertProductImageNotInAdminProductPage"/> + <actionGroup ref="AssertProductImageNotInAdminProductPageActionGroup" stepKey="assertProductImageNotInAdminProductPage"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPageAfterRemove"> + <actionGroup ref="AssertProductInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPageAfterRemove"> <argument name="product" value="SimpleProduct3"/> </actionGroup> <!-- Assert product image not in storefront product page --> - <actionGroup ref="assertProductImageNotInStorefrontProductPage" stepKey="assertProductImageNotInStorefrontProductPage"> + <actionGroup ref="AssertProductImageNotInStorefrontProductPageActionGroup" stepKey="assertProductImageNotInStorefrontProductPage"> <argument name="product" value="SimpleProduct3"/> </actionGroup> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultImageVirtualProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultImageVirtualProductTest.xml index a740b700c3026..6a68928be8c70 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultImageVirtualProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultImageVirtualProductTest.xml @@ -28,35 +28,35 @@ <!--Create product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPage"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillProductMain"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillProductMain"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> <!-- Add image to product --> - <actionGroup ref="addProductImage" stepKey="addImageForProduct"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageForProduct"> <argument name="image" value="MagentoLogo"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Remove image from product --> - <actionGroup ref="removeProductImage" stepKey="removeProductImage"/> + <actionGroup ref="RemoveProductImageActionGroup" stepKey="removeProductImage"/> - <actionGroup ref="saveProductForm" stepKey="saveProductFormAfterRemove"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductFormAfterRemove"/> <!-- Assert product image not in admin product form --> - <actionGroup ref="assertProductImageNotInAdminProductPage" stepKey="assertProductImageNotInAdminProductPage"/> + <actionGroup ref="AssertProductImageNotInAdminProductPageActionGroup" stepKey="assertProductImageNotInAdminProductPage"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPageAfterRemove"> + <actionGroup ref="AssertProductInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPageAfterRemove"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> <!-- Assert product image not in storefront product page --> - <actionGroup ref="assertProductImageNotInStorefrontProductPage" stepKey="assertProductImageNotInStorefrontProductPage"> + <actionGroup ref="AssertProductImageNotInStorefrontProductPageActionGroup" stepKey="assertProductImageNotInStorefrontProductPage"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultVideoSimpleProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultVideoSimpleProductTest.xml index 876eedb9347c7..8c80a2bf9a851 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultVideoSimpleProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultVideoSimpleProductTest.xml @@ -30,21 +30,21 @@ <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="adminProductIndexPageAdd"/> <waitForPageLoad stepKey="waitForProductIndexPageLoad"/> <actionGroup ref="EnableAdminAccountSharingActionGroup" stepKey="enableAdminAccountSharing"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProductPage"> <argument name="product" value="ApiSimpleProduct"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillMainProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillMainProductForm"> <argument name="product" value="ApiSimpleProduct"/> </actionGroup> <!-- Save product --> - <actionGroup ref="saveProductForm" stepKey="saveProductForm"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> <!-- Save product --> - <actionGroup ref="saveProductForm" stepKey="saveProductFormAfterRemove"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductFormAfterRemove"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="ApiSimpleProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultVideoVirtualProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultVideoVirtualProductTest.xml index 8b3b38d0ece31..8d89e0d9b535b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultVideoVirtualProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultVideoVirtualProductTest.xml @@ -21,13 +21,13 @@ <!-- Replacing steps in base AdminRemoveDefaultVideoSimpleProductTest --> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProductPage"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillMainProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillMainProductForm"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> - <actionGroup ref="AssertProductInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml index 8316f54c15a52..a4887d5b29796 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml @@ -73,26 +73,26 @@ <!--Create product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPage"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/> <!--Open created product--> <click selector="{{AdminProductGridSection.productGridNameProduct($$product.name$$)}}" stepKey="createdProduct"/> <waitForPageLoad stepKey="waitForOpenedCreatedProduct"/> <!-- Add image to product --> - <actionGroup ref="addProductImage" stepKey="addFirstImageForProduct"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addFirstImageForProduct"> <argument name="image" value="TestImageNew"/> </actionGroup> <!-- Add second image to product --> - <actionGroup ref="addProductImage" stepKey="addSecondImageForProduct"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addSecondImageForProduct"> <argument name="image" value="MagentoLogo"/> </actionGroup> <!--"Product in Websites": select both Websites--> - <actionGroup ref="ProductSetWebsite" stepKey="ProductSetWebsite1"> + <actionGroup ref="ProductSetWebsiteActionGroup" stepKey="ProductSetWebsite1"> <argument name="website" value="FirstWebSite"/> </actionGroup> - <actionGroup ref="ProductSetWebsite" stepKey="ProductSetWebsite2"> + <actionGroup ref="ProductSetWebsiteActionGroup" stepKey="ProductSetWebsite2"> <argument name="website" value="SecondWebSite"/> </actionGroup> @@ -103,28 +103,28 @@ <waitForPageLoad stepKey="waitForCreatedProductOpened"/> <!--Delete Image 1--> - <actionGroup ref="removeProductImage" stepKey="removeProductImage"/> + <actionGroup ref="RemoveProductImageActionGroup" stepKey="removeProductImage"/> <!--Click "Save" in the upper right corner--> - <actionGroup ref="saveProductForm" stepKey="saveProductFormAfterRemove"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductFormAfterRemove"/> <!--Switch to "Store view 1"--> - <actionGroup ref="SwitchToTheNewStoreView" stepKey="selectStoreView"> + <actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="selectStoreView"> <argument name="storeViewName" value="Store View"/> </actionGroup> <!-- Assert product first image not in admin product form --> - <actionGroup ref="assertProductImageNotInAdminProductPage" stepKey="assertProductImageNotInAdminProductPage"> + <actionGroup ref="AssertProductImageNotInAdminProductPageActionGroup" stepKey="assertProductImageNotInAdminProductPage"> <argument name="image" value="TestImageNew"/> </actionGroup> <!--Switch to "Store view 2"--> - <actionGroup ref="SwitchToTheNewStoreView" stepKey="selectSecondStoreView"> + <actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="selectSecondStoreView"> <argument name="storeViewName" value="Second Store View"/> </actionGroup> <!-- Verify that Image 1 is deleted from the Second Store View list --> - <actionGroup ref="assertProductImageNotInAdminProductPage" stepKey="assertProductImageNotInSecondStoreViewPage"> + <actionGroup ref="AssertProductImageNotInAdminProductPageActionGroup" stepKey="assertProductImageNotInSecondStoreViewPage"> <argument name="image" value="TestImageNew"/> </actionGroup> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageFromCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageFromCategoryTest.xml index fb33e18379982..ef276114b4de5 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageFromCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageFromCategoryTest.xml @@ -22,30 +22,30 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> </before> <after> - <actionGroup ref="DeleteCategory" stepKey="DeleteCategory"> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="DeleteCategory"> <argument name="categoryEntity" value="SimpleSubCategory"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> </after> <!-- Go to create a new category with image --> - <actionGroup ref="goToCreateCategoryPage" stepKey="goToCreateCategoryPage"/> - <actionGroup ref="fillCategoryForm" stepKey="fillCategoryForm"> + <actionGroup ref="GoToCreateCategoryPageActionGroup" stepKey="goToCreateCategoryPage"/> + <actionGroup ref="FillCategoryFormActionGroup" stepKey="fillCategoryForm"> <argument name="categoryEntity" value="SimpleSubCategory"/> </actionGroup> - <actionGroup ref="addCategoryImage" stepKey="addCategoryImage"/> - <actionGroup ref="saveCategoryForm" stepKey="saveCategoryForm"/> - <actionGroup ref="checkCategoryImageInAdmin" stepKey="checkCategoryImageInAdmin"/> + <actionGroup ref="AddCategoryImageActionGroup" stepKey="addCategoryImage"/> + <actionGroup ref="SaveCategoryFormActionGroup" stepKey="saveCategoryForm"/> + <actionGroup ref="CheckCategoryImageInAdminActionGroup" stepKey="checkCategoryImageInAdmin"/> <!-- Remove image from category --> - <actionGroup ref="removeCategoryImage" stepKey="removeCategoryImage"/> - <actionGroup ref="saveCategoryForm" stepKey="saveCategoryFormAfterRemove"/> + <actionGroup ref="RemoveCategoryImageActionGroup" stepKey="removeCategoryImage"/> + <actionGroup ref="SaveCategoryFormActionGroup" stepKey="saveCategoryFormAfterRemove"/> - <actionGroup ref="CheckCategoryOnStorefront" stepKey="CheckCategoryOnStorefront"> + <actionGroup ref="CheckCategoryOnStorefrontActionGroup" stepKey="CheckCategoryOnStorefront"> <argument name="categoryEntity" value="SimpleSubCategory"/> </actionGroup> <!-- Verify category with no image in storefront --> <dontSee selector="{{StorefrontCategoryMainSection.categoryImage}}" stepKey="dontSeeImage"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRestrictedUserAddCategoryFromProductPageTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRestrictedUserAddCategoryFromProductPageTest.xml index 7b5455951fb27..bb0f883e4d439 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRestrictedUserAddCategoryFromProductPageTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRestrictedUserAddCategoryFromProductPageTest.xml @@ -28,10 +28,10 @@ <after> <!--Delete created product--> <comment userInput="Delete created product" stepKey="commentDeleteProduct"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetFiltersIfExist"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetFiltersIfExist"/> <actionGroup ref="logout" stepKey="logoutOfUser"/> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!--Delete created data--> @@ -80,15 +80,15 @@ </actionGroup> <!--Go to create product page--> <comment userInput="Go to create product page" stepKey="commentGoCreateProductPage"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"/> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProductPage"/> <dontSeeElement selector="{{AdminProductFormSection.newCategoryButton}}" stepKey="dontSeeNewCategoryButton"/> <!--Fill product data and assign to category--> <comment userInput="Fill product data and assign to category" stepKey="commentFillProductData"/> - <actionGroup ref="fillMainProductForm" stepKey="fillMainProductForm"/> - <actionGroup ref="SetCategoryByName" stepKey="addCategoryToProduct"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillMainProductForm"/> + <actionGroup ref="SetCategoryByNameActionGroup" stepKey="addCategoryToProduct"> <argument name="categoryName" value="$$createCategory.name$$"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!--Assert that category exist in field--> <comment userInput="Assert that category exist in field" stepKey="commentAssertion"/> <grabTextFrom selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="grabCategoryName"/> @@ -98,10 +98,10 @@ </assertContains> <!--Remove the category from the product and assert that it removed--> <comment userInput="Remove the category from the product and assert that it removed" stepKey="assertCategoryRemoved"/> - <actionGroup ref="removeCategoryFromProduct" stepKey="removeCategoryFromProduct"> + <actionGroup ref="RemoveCategoryFromProductActionGroup" stepKey="removeCategoryFromProduct"> <argument name="categoryName" value="$$createCategory.name$$"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProductAfterRemovingCategory"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductAfterRemovingCategory"/> <grabTextFrom selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="grabCategoryFieldContent"/> <assertNotContains stepKey="assertThatCategoryRemoved"> <expectedResult type="variable">$$createCategory.name$$</expectedResult> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminShouldBeAbleToAssociateSimpleProductToWebsitesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminShouldBeAbleToAssociateSimpleProductToWebsitesTest.xml index 061c30b224828..54224c73135b6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminShouldBeAbleToAssociateSimpleProductToWebsitesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminShouldBeAbleToAssociateSimpleProductToWebsitesTest.xml @@ -49,7 +49,7 @@ <!-- 1. Go to product page in admin panel to edit --> <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPageToAssociateToSecondWebsite"/> - <actionGroup ref="filterProductGridByName2" stepKey="filterProductInGrid"> + <actionGroup ref="FilterProductGridByName2ActionGroup" stepKey="filterProductInGrid"> <argument name="name" value="$$createSimpleProduct.name$$"/> </actionGroup> @@ -59,10 +59,10 @@ <argument name="websiteToUnassign" value="_defaultWebsite"/> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> - <actionGroup ref="AssertProductIsAssignedToWebsite" stepKey="seeCustomWebsiteIsChecked"> + <actionGroup ref="AssertProductIsAssignedToWebsiteActionGroup" stepKey="seeCustomWebsiteIsChecked"> <argument name="website" value="$createCustomWebsite.website[name]$"/> </actionGroup> - <actionGroup ref="AssertProductIsNotAssignedToWebsite" stepKey="seeMainWebsiteIsNotChecked"> + <actionGroup ref="AssertProductIsNotAssignedToWebsiteActionGroup" stepKey="seeMainWebsiteIsNotChecked"> <argument name="website" value="{{_defaultWebsite.name}}"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductImagesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductImagesTest.xml index df50edd20410a..ff8240655ca03 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductImagesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductImagesTest.xml @@ -40,11 +40,11 @@ <!-- Go to the first product edit page --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex"/> <waitForPageLoad stepKey="wait1"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGrid"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGrid"/> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku"> <argument name="product" value="$$firstProduct$$"/> </actionGroup> - <actionGroup ref="openProducForEditByClickingRowXColumnYInProductGrid" stepKey="openProducForEditByClickingRow1Column2InProductGrid"/> + <actionGroup ref="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup" stepKey="openProducForEditByClickingRow1Column2InProductGrid"/> <!-- Set url key --> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/> @@ -126,11 +126,11 @@ <!-- Go to the second product edit page --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex2"/> <waitForPageLoad stepKey="wait2"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGrid2"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku2"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGrid2"/> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku2"> <argument name="product" value="$$secondProduct$$"/> </actionGroup> - <actionGroup ref="openProducForEditByClickingRowXColumnYInProductGrid" stepKey="openProducForEditByClickingRow1Column2InProductGrid2"/> + <actionGroup ref="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup" stepKey="openProducForEditByClickingRow1Column2InProductGrid2"/> <!-- Upload an image --> <click selector="{{AdminProductImagesSection.productImagesToggle}}" stepKey="expandImages2"/> @@ -150,8 +150,8 @@ <!-- Go to the admin grid and see the uploaded image --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex3"/> <waitForPageLoad stepKey="wait3"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGrid3"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku3"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGrid3"/> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku3"> <argument name="product" value="$$secondProduct$$"/> </actionGroup> <seeElement selector="img.admin__control-thumbnail[src*='/large']" stepKey="seeImgInGrid"/> @@ -194,11 +194,11 @@ <!-- Go to the product edit page --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex"/> <waitForPageLoad stepKey="wait1"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGrid"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGrid"/> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku"> <argument name="product" value="$$product$$"/> </actionGroup> - <actionGroup ref="openProducForEditByClickingRowXColumnYInProductGrid" stepKey="openProduct"/> + <actionGroup ref="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup" stepKey="openProduct"/> <!-- Set url key --> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/> @@ -259,8 +259,8 @@ <!-- Go to the admin grid and see the Thumbnail image --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex2"/> <waitForPageLoad stepKey="wait2"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGrid2"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku2"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGrid2"/> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku2"> <argument name="product" value="$$product$$"/> </actionGroup> <seeElement selector="{{AdminProductGridSection.productThumbnailBySrc('/adobe-thumb')}}" stepKey="seeBaseInGrid"/> @@ -268,11 +268,11 @@ <!-- Go to the product edit page again --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex3"/> <waitForPageLoad stepKey="wait5"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGrid3"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku3"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGrid3"/> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku3"> <argument name="product" value="$$product$$"/> </actionGroup> - <actionGroup ref="openProducForEditByClickingRowXColumnYInProductGrid" stepKey="openProduct3"/> + <actionGroup ref="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup" stepKey="openProduct3"/> <click selector="{{AdminProductImagesSection.productImagesToggle}}" stepKey="expandImages2"/> <!-- Remove all images --> @@ -284,8 +284,8 @@ <!-- Check admin grid for placeholder --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex4"/> <waitForPageLoad stepKey="wait6"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGrid4"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku4"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGrid4"/> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku4"> <argument name="product" value="$$product$$"/> </actionGroup> <dontSeeElement selector="{{AdminProductGridSection.productThumbnailBySrc('/adobe-thumb')}}" stepKey="dontSeeBaseInGrid"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductSetEditContentTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductSetEditContentTest.xml index f5e5911352c86..b7e14c336ec5f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductSetEditContentTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductSetEditContentTest.xml @@ -26,7 +26,7 @@ </before> <after> <!-- Delete simple product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="SimpleProduct"/> </actionGroup> <!--Admin Logout--> @@ -36,10 +36,10 @@ <!-- Create product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPage"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="SimpleProduct"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillProductForm"> <argument name="product" value="SimpleProduct"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleSetEditRelatedProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleSetEditRelatedProductsTest.xml index 4803c1be6c936..0c0b8751a732e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleSetEditRelatedProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleSetEditRelatedProductsTest.xml @@ -30,7 +30,7 @@ </before> <after> <!-- Delete simple product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="SimpleProduct3"/> </actionGroup> <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> @@ -46,15 +46,15 @@ <!--Create product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPage"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="SimpleProduct3"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillProductForm"> <argument name="product" value="SimpleProduct3"/> </actionGroup> <!--Add related product--> - <actionGroup ref="addRelatedProductBySku" stepKey="addRelatedProduct0"> + <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addRelatedProduct0"> <argument name="sku" value="$$simpleProduct0.sku$$"/> </actionGroup> @@ -63,7 +63,7 @@ <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the product." stepKey="messageYouSavedTheProductIsShown"/> <!--Add another related product--> - <actionGroup ref="addRelatedProductBySku" stepKey="addRelatedProduct1"> + <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addRelatedProduct1"> <argument name="sku" value="$$simpleProduct1.sku$$"/> </actionGroup> @@ -80,19 +80,19 @@ <see selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedRelatedProduct}}" userInput="$$simpleProduct1.sku$$" stepKey="seeRelatedProduct"/> <!--See more related products in admin--> - <actionGroup ref="addRelatedProductBySku" stepKey="addRelatedProduct2"> + <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addRelatedProduct2"> <argument name="sku" value="$$simpleProduct2.sku$$"/> </actionGroup> - <actionGroup ref="addRelatedProductBySku" stepKey="addRelatedProduct3"> + <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addRelatedProduct3"> <argument name="sku" value="$$simpleProduct3.sku$$"/> </actionGroup> - <actionGroup ref="addRelatedProductBySku" stepKey="addRelatedProduct4"> + <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addRelatedProduct4"> <argument name="sku" value="$$simpleProduct4.sku$$"/> </actionGroup> - <actionGroup ref="addRelatedProductBySku" stepKey="addRelatedProduct5"> + <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addRelatedProduct5"> <argument name="sku" value="$$simpleProduct5.sku$$"/> </actionGroup> - <actionGroup ref="addRelatedProductBySku" stepKey="addRelatedProduct6"> + <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addRelatedProduct6"> <argument name="sku" value="$$simpleProduct6.sku$$"/> </actionGroup> <scrollTo selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" stepKey="scrollTo2"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml index 5b6207e135796..e385ef70cf4a0 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml @@ -40,8 +40,8 @@ <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteTestWebsite"> <argument name="websiteName" value="{{customWebsite.name}}"/> </actionGroup> - <actionGroup ref="GoToProductCatalogPage" stepKey="goToProductCatalogPage"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial"/> + <actionGroup ref="GoToProductCatalogPageActionGroup" stepKey="goToProductCatalogPage"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/> <actionGroup ref="ResetWebUrlOptions" stepKey="resetUrlOption"/> <magentoCLI command="indexer:reindex" stepKey="reindex"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUnassignProductAttributeFromAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUnassignProductAttributeFromAttributeSetTest.xml index bcc8636c65b1e..1c9cdad681d98 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUnassignProductAttributeFromAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUnassignProductAttributeFromAttributeSetTest.xml @@ -40,7 +40,7 @@ <!-- Assert attribute presence in storefront product additional information --> <amOnPage url="/$$product.custom_attributes[url_key]$$.html" stepKey="onProductPage1"/> <waitForPageLoad stepKey="wait1"/> - <actionGroup ref="checkAttributeInMoreInformationTab" stepKey="checkAttributeInMoreInformationTab"> + <actionGroup ref="CheckAttributeInMoreInformationTabActionGroup" stepKey="checkAttributeInMoreInformationTab"> <argument name="attributeLabel" value="$$attribute.attribute[frontend_labels][0][label]$$"/> <argument name="attributeValue" value="$$option2.option[store_labels][0][label]$$"/> </actionGroup> @@ -49,14 +49,14 @@ <!-- Assert created attribute in a group --> <see userInput="$$attribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.groupTree}}" stepKey="seeAttributeInGroup"/> <!-- Unassign attribute from group --> - <actionGroup ref="UnassignAttributeFromGroup" stepKey="UnassignAttributeFromGroup"> + <actionGroup ref="UnassignAttributeFromGroupActionGroup" stepKey="UnassignAttributeFromGroup"> <argument name="group" value="Product Details"/> <argument name="attribute" value="$$attribute.attribute_code$$"/> </actionGroup> <!-- Assert attribute in unassigned section --> <see userInput="$$attribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.unassignedAttributesTree}}" stepKey="seeAttributeInUnassigned"/> <!-- Save attribute set --> - <actionGroup ref="SaveAttributeSet" stepKey="SaveAttributeSet"/> + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="SaveAttributeSet"/> <!-- Clear cache --> <actionGroup ref="ClearPageCacheActionGroup" stepKey="clearPageCacheActionGroup"/> <!-- Go to create new product page --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryStoreUrlKeyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryStoreUrlKeyTest.xml index 0f63a72844452..01eba2976c3d6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryStoreUrlKeyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryStoreUrlKeyTest.xml @@ -19,7 +19,7 @@ <group value="category"/> </annotations> <after> - <actionGroup ref="DeleteCategory" stepKey="deleteCategory"> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCategory"> <argument name="categoryEntity" value="_defaultCategory"/> </actionGroup> <actionGroup ref="logout" stepKey="adminLogout"/> @@ -29,12 +29,12 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <amOnPage url="{{AdminCategoryPage.url}}" stepKey="navigateToCategoryPage"/> <waitForPageLoad stepKey="waitForPageLoad1"/> - <actionGroup ref="CreateCategory" stepKey="createCategory"> + <actionGroup ref="CreateCategoryActionGroup" stepKey="createCategory"> <argument name="categoryEntity" value="_defaultCategory"/> </actionGroup> <!--Switch to "Default Store View" scope--> - <actionGroup ref="switchCategoryStoreView" stepKey="SwitchStoreView"> + <actionGroup ref="SwitchCategoryStoreViewActionGroup" stepKey="SwitchStoreView"> <argument name="Store" value="_defaultStore.name"/> <argument name="CatName" value="_defaultCategory.name"/> </actionGroup> @@ -58,7 +58,7 @@ <!-- Update SEO key to original, uncheck "Create Redirect", confirm in frontend, delete category --> <!--Switch to "Default Store View" scope--> - <actionGroup ref="switchCategoryStoreView" stepKey="SwitchStoreView2"> + <actionGroup ref="SwitchCategoryStoreViewActionGroup" stepKey="SwitchStoreView2"> <argument name="Store" value="_defaultStore.name"/> <argument name="CatName" value="_defaultCategory.name"/> </actionGroup> @@ -74,4 +74,4 @@ <seeInTitle userInput="{{_defaultCategory.name}}" stepKey="seeCategoryNameInTitle2"/> <seeInCurrentUrl stepKey="verifyUrlKeyAfterOriginalSeoKey" url="{{_defaultCategory.name_lwr}}.html"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml index 80f0c8ad10ede..57499c1332020 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml @@ -32,7 +32,7 @@ <after> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> <deleteData stepKey="deleteSimpleSubCategory2" createDataKey="categoryEntity"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteCreatedProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteCreatedProduct"> <argument name="sku" value="{{defaultSimpleProduct.sku}}"/> </actionGroup> <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView"> @@ -44,7 +44,7 @@ <!-- Search default simple product in grid --> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="OpenProductCatalogPage"/> <waitForPageLoad stepKey="waitForProductCatalogPage"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterProductGrid"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> <argument name="sku" value="$$initialSimpleProduct.sku$$"/> </actionGroup> <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml index f698b3d89ffe9..630e47250f11f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml @@ -32,7 +32,7 @@ <after> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> <deleteData stepKey="deleteSimpleSubCategory2" createDataKey="categoryEntity"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteCreatedProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteCreatedProduct"> <argument name="sku" value="{{defaultSimpleProduct.sku}}"/> </actionGroup> <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView"> @@ -44,7 +44,7 @@ <!-- Search default simple product in grid --> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="OpenProductCatalogPage"/> <waitForPageLoad stepKey="waitForProductCatalogPage"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterProductGrid"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> <argument name="sku" value="$$initialSimpleProduct.sku$$"/> </actionGroup> <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml index 10ff1151cd9b3..a848eb3d11e61 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml @@ -33,7 +33,7 @@ <after> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> <deleteData stepKey="deleteSimpleSubCategory2" createDataKey="categoryEntity"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteCreatedProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteCreatedProduct"> <argument name="sku" value="{{simpleProductTierPrice300InStock.sku}}"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -42,7 +42,7 @@ <!-- Search default simple product in the grid --> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="OpenProductCatalogPage"/> <waitForPageLoad stepKey="waitForProductCatalogPage"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterProductGrid"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> <argument name="sku" value="$$initialSimpleProduct.sku$$"/> </actionGroup> <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml index 6e8f1ba6f12a6..ff3f56b566b38 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml @@ -27,7 +27,7 @@ </before> <after> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteCreatedProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteCreatedProduct"> <argument name="sku" value="{{simpleProductDisabled.sku}}"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -36,7 +36,7 @@ <!-- Search default simple product in the grid page --> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="OpenProductCatalogPage"/> <waitForPageLoad stepKey="waitForProductCatalogPage"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterProductGrid"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> <argument name="sku" value="$$initialSimpleProduct.sku$$"/> </actionGroup> <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml index afb8b40a6dbd4..09ddc18aff4bd 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml @@ -30,7 +30,7 @@ <after> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> <deleteData stepKey="deleteSimpleSubCategory2" createDataKey="categoryEntity"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteCreatedProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteCreatedProduct"> <argument name="sku" value="{{simpleProductEnabledFlat.sku}}"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -40,7 +40,7 @@ <!-- Search default simple product in the grid page --> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="OpenProductCatalogPage"/> <waitForPageLoad stepKey="waitForProductCatalogPage"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterProductGrid"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> <argument name="sku" value="$$initialSimpleProduct.sku$$"/> </actionGroup> <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml index 2436fc0fc7f12..94aec4cc95d1d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml @@ -29,7 +29,7 @@ <after> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> <deleteData stepKey="deleteSimpleSubCategory2" createDataKey="categoryEntity"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteCreatedProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteCreatedProduct"> <argument name="sku" value="{{simpleProductNotVisibleIndividually.sku}}"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -38,7 +38,7 @@ <!-- Search default simple product in the grid page --> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="OpenProductCatalogPage"/> <waitForPageLoad stepKey="waitForProductCatalogPage"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterProductGrid"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> <argument name="sku" value="$$initialSimpleProduct.sku$$"/> </actionGroup> <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockUnassignFromCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockUnassignFromCategoryTest.xml index 3433a09117322..fa3317aa815d9 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockUnassignFromCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockUnassignFromCategoryTest.xml @@ -27,7 +27,7 @@ </before> <after> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteCreatedProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteCreatedProduct"> <argument name="sku" value="$$initialSimpleProduct.sku$$"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -36,7 +36,7 @@ <!--Search default simple product in the grid page --> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="OpenProductCatalogPage"/> <waitForPageLoad stepKey="waitForProductCatalogPage"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterProductGrid"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> <argument name="sku" value="$$initialSimpleProduct.sku$$"/> </actionGroup> <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml index 82395e5d6e0eb..95b74f4d38b3f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml @@ -29,7 +29,7 @@ <after> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> <deleteData stepKey="deleteSimpleSubCategory2" createDataKey="categoryEntity"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteCreatedProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteCreatedProduct"> <argument name="sku" value="{{simpleProductRegularPrice245InStock.sku}}"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -38,7 +38,7 @@ <!-- Search default simple product in the grid page --> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="OpenProductCatalogPage"/> <waitForPageLoad stepKey="waitForProductCatalogPage"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterProductGrid"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> <argument name="sku" value="$$initialSimpleProduct.sku$$"/> </actionGroup> <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml index 4817b3497c97e..af190890ac351 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml @@ -29,7 +29,7 @@ <after> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> <deleteData stepKey="deleteSimpleSubCategory2" createDataKey="categoryEntity"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteCreatedProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteCreatedProduct"> <argument name="sku" value="{{simpleProductRegularPrice32501InStock.sku}}"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -38,7 +38,7 @@ <!-- Search default simple product in the grid --> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="OpenProductCatalogPage"/> <waitForPageLoad stepKey="waitForProductCatalogPage"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterProductGrid"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> <argument name="sku" value="$$initialSimpleProduct.sku$$"/> </actionGroup> <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml index 214f9b0273b6a..626c3d00a5caf 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml @@ -29,7 +29,7 @@ <after> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> <deleteData stepKey="deleteSimpleSubCategory2" createDataKey="categoryEntity"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteCreatedProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteCreatedProduct"> <argument name="sku" value="{{simpleProductRegularPrice325InStock.sku}}"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -38,7 +38,7 @@ <!-- Search default simple product in the grid --> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="OpenProductCatalogPage"/> <waitForPageLoad stepKey="waitForProductCatalogPage"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterProductGrid"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> <argument name="sku" value="$$initialSimpleProduct.sku$$"/> </actionGroup> <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml index b145328890a91..13782da076f69 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml @@ -29,7 +29,7 @@ <after> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> <deleteData stepKey="deleteSimpleSubCategory2" createDataKey="categoryEntity"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteCreatedProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteCreatedProduct"> <argument name="sku" value="{{simpleProductRegularPriceCustomOptions.sku}}"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -38,7 +38,7 @@ <!-- Search default simple product in the grid --> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="OpenProductCatalogPage"/> <waitForPageLoad stepKey="waitForProductCatalogPage"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterProductGrid"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> <argument name="sku" value="$$initialSimpleProduct.sku$$"/> </actionGroup> <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml index 27c7e77a94ad1..285ceb3c4d722 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml @@ -29,7 +29,7 @@ <after> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> <deleteData stepKey="deleteSimpleSubCategory2" createDataKey="categoryEntity"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteCreatedProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteCreatedProduct"> <argument name="sku" value="{{simpleProductRegularPrice32503OutOfStock.sku}}"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -38,7 +38,7 @@ <!-- Search default simple product in the grid --> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="OpenProductCatalogPage"/> <waitForPageLoad stepKey="waitForProductCatalogPage"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterProductGrid"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> <argument name="sku" value="$$initialSimpleProduct.sku$$"/> </actionGroup> <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockVisibleInCategoryOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockVisibleInCategoryOnlyTest.xml index 9fa0e155a4fe7..0e9b9431dcfa6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockVisibleInCategoryOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockVisibleInCategoryOnlyTest.xml @@ -28,7 +28,7 @@ <createData entity="SimpleSubCategory" stepKey="categoryEntity"/> </before> <after> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteVirtualProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteVirtualProduct"> <argument name="product" value="updateVirtualProductRegularPrice"/> </actionGroup> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryAndSearchTest.xml index e0e8360850983..10347584b4cda 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryAndSearchTest.xml @@ -28,7 +28,7 @@ <createData entity="SimpleSubCategory" stepKey="categoryEntity"/> </before> <after> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteVirtualProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteVirtualProduct"> <argument name="product" value="updateVirtualProductTierPriceInStock"/> </actionGroup> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryOnlyTest.xml index 677cc4c65ce88..0edc487e71edf 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryOnlyTest.xml @@ -28,7 +28,7 @@ <createData entity="SimpleSubCategory" stepKey="categoryEntity"/> </before> <after> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteVirtualProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteVirtualProduct"> <argument name="product" value="updateVirtualProductWithTierPriceInStock"/> </actionGroup> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceOutOfStockVisibleInCategoryAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceOutOfStockVisibleInCategoryAndSearchTest.xml index f0148f3d384c1..e513d007e6a09 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceOutOfStockVisibleInCategoryAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceOutOfStockVisibleInCategoryAndSearchTest.xml @@ -28,7 +28,7 @@ <createData entity="SimpleSubCategory" stepKey="categoryEntity"/> </before> <after> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteVirtualProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteVirtualProduct"> <argument name="product" value="updateVirtualTierPriceOutOfStock"/> </actionGroup> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminVerifyProductOrderTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminVerifyProductOrderTest.xml index a81c26b6e6eaf..b61be7fd95a58 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminVerifyProductOrderTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminVerifyProductOrderTest.xml @@ -25,7 +25,7 @@ <after> <actionGroup ref="logout" stepKey="logout"/> </after> - <actionGroup ref="GoToProductCatalogPage" stepKey="goToProductCatalogPage"/> + <actionGroup ref="GoToProductCatalogPageActionGroup" stepKey="goToProductCatalogPage"/> <actionGroup ref="VerifyProductTypeOrder" stepKey="verifyProductTypeOrder"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualProductSetEditContentTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualProductSetEditContentTest.xml index c9932de808006..1e7b7cc14f9cc 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualProductSetEditContentTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualProductSetEditContentTest.xml @@ -21,16 +21,16 @@ </annotations> <after> <!-- Delete virtual product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> </after> <!-- Create product --> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillProductForm"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualSetEditRelatedProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualSetEditRelatedProductsTest.xml index e630545fff8fb..a8d8face1a1e6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualSetEditRelatedProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualSetEditRelatedProductsTest.xml @@ -21,16 +21,16 @@ <before></before> <after> <!-- Delete virtual product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> </after> <!-- Create product --> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillProductForm"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest.xml index d8fa20c7cc469..3125ba3decce6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="deleteAllProductsUsingProductGrid" stepKey="deleteAllProducts"/> + <actionGroup ref="DeleteAllProductsUsingProductGridActionGroup" stepKey="deleteAllProducts"/> <createData entity="ApiProductWithDescription" stepKey="product"/> </before> <after> @@ -91,7 +91,7 @@ </annotations> <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="deleteAllProductsUsingProductGrid" stepKey="deleteAllProducts"/> + <actionGroup ref="DeleteAllProductsUsingProductGridActionGroup" stepKey="deleteAllProducts"/> <createData entity="ApiProductWithDescription" stepKey="product"/> <getData entity="GetProduct" stepKey="arg1"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/CheckTierPricingOfProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/CheckTierPricingOfProductsTest.xml index cee40241185b4..7cb49c18ec6e9 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/CheckTierPricingOfProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/CheckTierPricingOfProductsTest.xml @@ -61,10 +61,10 @@ <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct1"> <argument name="product" value="$$product1$$"/> </actionGroup> - <actionGroup ref="ProductSetWebsite" stepKey="ProductSetWebsite"> + <actionGroup ref="ProductSetWebsiteActionGroup" stepKey="ProductSetWebsite"> <argument name="website" value="secondWebsite"/> </actionGroup> - <actionGroup ref="ProductSetAdvancedPricing" stepKey="ProductSetAdvancedPricing1"> + <actionGroup ref="ProductSetAdvancedPricingActionGroup" stepKey="ProductSetAdvancedPricing1"> <argument name="website" value="secondWebsite"/> </actionGroup> @@ -74,10 +74,10 @@ <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct2"> <argument name="product" value="$$product2$$"/> </actionGroup> - <actionGroup ref="ProductSetWebsite" stepKey="ProductSetWebsite2"> + <actionGroup ref="ProductSetWebsiteActionGroup" stepKey="ProductSetWebsite2"> <argument name="website" value="secondWebsite"/> </actionGroup> - <actionGroup ref="ProductSetAdvancedPricing" stepKey="ProductSetAdvancedPricing2"> + <actionGroup ref="ProductSetAdvancedPricingActionGroup" stepKey="ProductSetAdvancedPricing2"> <argument name="website" value="secondWebsite"/> </actionGroup> @@ -87,10 +87,10 @@ <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct3"> <argument name="product" value="$$product3$$"/> </actionGroup> - <actionGroup ref="ProductSetWebsite" stepKey="ProductSetWebsite3"> + <actionGroup ref="ProductSetWebsiteActionGroup" stepKey="ProductSetWebsite3"> <argument name="website" value="secondWebsite"/> </actionGroup> - <actionGroup ref="ProductSetAdvancedPricing" stepKey="ProductSetAdvancedPricing3"> + <actionGroup ref="ProductSetAdvancedPricingActionGroup" stepKey="ProductSetAdvancedPricing3"> <argument name="website" value="secondWebsite"/> </actionGroup> @@ -100,10 +100,10 @@ <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct4"> <argument name="product" value="$$product4$$"/> </actionGroup> - <actionGroup ref="ProductSetWebsite" stepKey="ProductSetWebsite4"> + <actionGroup ref="ProductSetWebsiteActionGroup" stepKey="ProductSetWebsite4"> <argument name="website" value="secondWebsite"/> </actionGroup> - <actionGroup ref="ProductSetAdvancedPricing" stepKey="ProductSetAdvancedPricing4"> + <actionGroup ref="ProductSetAdvancedPricingActionGroup" stepKey="ProductSetAdvancedPricing4"> <argument name="website" value="secondWebsite"/> </actionGroup> <actionGroup ref="ClearProductsFilterActionGroup" stepKey="ClearProductsFilterActionGroup"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/ConfigurableOptionTextInputLengthValidationHint.xml b/app/code/Magento/Catalog/Test/Mftf/Test/ConfigurableOptionTextInputLengthValidationHint.xml index 899f3e61b5b86..a4785e25d39bb 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/ConfigurableOptionTextInputLengthValidationHint.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/ConfigurableOptionTextInputLengthValidationHint.xml @@ -27,7 +27,7 @@ </after> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> - <actionGroup ref="AdminCreateSimpleProductWithTextOptionCharLimit" stepKey="fillProductFieldsInAdmin"> + <actionGroup ref="AdminCreateSimpleProductWithTextOptionCharLimitActionGroup" stepKey="fillProductFieldsInAdmin"> <argument name="category" value="$$createPreReqCategory$$"/> <argument name="simpleProduct" value="_defaultProduct"/> <argument name="charLimit" value="20"/> @@ -36,10 +36,10 @@ <argument name="category" value="$$createPreReqCategory$$"/> <argument name="product" value="_defaultProduct"/> </actionGroup> - <actionGroup ref="AssertProductInStorefrontProductPage" stepKey="assertProductInStorefront2"> + <actionGroup ref="AssertProductInStorefrontProductPageActionGroup" stepKey="assertProductInStorefront2"> <argument name="product" value="_defaultProduct"/> </actionGroup> - <actionGroup ref="testDynamicValidationHint" stepKey="testDynamicValidationHint1"> + <actionGroup ref="TestDynamicValidationHintActionGroup" stepKey="testDynamicValidationHint1"> <argument name="charLimit" value="20"/> </actionGroup> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml index d895993217e32..1e297586ecb65 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml @@ -24,7 +24,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> </before> <after> - <actionGroup ref="navigateToEditProductAttribute" stepKey="goToEditPage"> + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage"> <argument name="ProductAttribute" value="{{textProductAttribute.attribute_code}}"/> </actionGroup> <click stepKey="clickDelete" selector="{{AttributePropertiesSection.DeleteAttribute}}"/> @@ -37,12 +37,12 @@ <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="goToProductAttributes"/> <!--Create new Product Attribute as TextField, with code and default value.--> - <actionGroup ref="createProductAttributeWithTextField" stepKey="createAttribute"> + <actionGroup ref="CreateProductAttributeWithTextFieldActionGroup" stepKey="createAttribute"> <argument name="attribute" value="textProductAttribute"/> </actionGroup> <!--Navigate to Product Attribute.--> - <actionGroup ref="navigateToEditProductAttribute" stepKey="goToEditPage"> + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage"> <argument name="ProductAttribute" value="{{textProductAttribute.attribute_code}}"/> </actionGroup> @@ -55,7 +55,7 @@ <!--Go to New Product page, add Attribute and check values--> <amOnPage url="{{AdminProductCreatePage.url('4', 'simple')}}" stepKey="goToCreateSimpleProductPage"/> - <actionGroup ref="addProductAttributeInProductModal" stepKey="addAttributeToProduct"> + <actionGroup ref="AddProductAttributeInProductModalActionGroup" stepKey="addAttributeToProduct"> <argument name="attributeCode" value="{{textProductAttribute.attribute_code}}"/> </actionGroup> <click stepKey="openAttributes" selector="{{AdminProductAttributesSection.sectionHeader}}"/> @@ -83,7 +83,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> </before> <after> - <actionGroup ref="navigateToEditProductAttribute" stepKey="goToEditPage"> + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage"> <argument name="ProductAttribute" value="{{dateProductAttribute.attribute_code}}"/> </actionGroup> <click stepKey="clickDelete" selector="{{AttributePropertiesSection.DeleteAttribute}}"/> @@ -99,13 +99,13 @@ <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="goToProductAttributes"/> <!--Create new Product Attribute as TextField, with code and default value.--> - <actionGroup ref="createProductAttributeWithDateField" stepKey="createAttribute"> + <actionGroup ref="CreateProductAttributeWithDateFieldActionGroup" stepKey="createAttribute"> <argument name="attribute" value="dateProductAttribute"/> <argument name="date" value="{$generateDefaultDate}"/> </actionGroup> <!--Navigate to Product Attribute.--> - <actionGroup ref="navigateToEditProductAttribute" stepKey="goToEditPage"> + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage"> <argument name="ProductAttribute" value="{{dateProductAttribute.attribute_code}}"/> </actionGroup> @@ -118,7 +118,7 @@ <!--Go to New Product page, add Attribute and check values--> <amOnPage url="{{AdminProductCreatePage.url('4', 'simple')}}" stepKey="goToCreateSimpleProductPage"/> - <actionGroup ref="addProductAttributeInProductModal" stepKey="addAttributeToProduct"> + <actionGroup ref="AddProductAttributeInProductModalActionGroup" stepKey="addAttributeToProduct"> <argument name="attributeCode" value="{{dateProductAttribute.attribute_code}}"/> </actionGroup> <click stepKey="openAttributes" selector="{{AdminProductAttributesSection.sectionHeader}}"/> @@ -143,7 +143,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> </before> <after> - <actionGroup ref="navigateToEditProductAttribute" stepKey="goToEditPage"> + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage"> <argument name="ProductAttribute" value="{{priceProductAttribute.attribute_code}}"/> </actionGroup> <click stepKey="clickDelete" selector="{{AttributePropertiesSection.DeleteAttribute}}"/> @@ -156,12 +156,12 @@ <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="goToProductAttributes"/> <!--Create new Product Attribute with Price--> - <actionGroup ref="createProductAttribute" stepKey="createAttribute"> + <actionGroup ref="CreateProductAttributeActionGroup" stepKey="createAttribute"> <argument name="attribute" value="priceProductAttribute"/> </actionGroup> <!--Navigate to Product Attribute.--> - <actionGroup ref="navigateToEditProductAttribute" stepKey="goToEditPage"> + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage"> <argument name="ProductAttribute" value="{{priceProductAttribute.attribute_code}}"/> </actionGroup> @@ -173,7 +173,7 @@ <!--Go to New Product page, add Attribute and check values--> <amOnPage url="{{AdminProductCreatePage.url('4', 'simple')}}" stepKey="goToCreateSimpleProductPage"/> - <actionGroup ref="addProductAttributeInProductModal" stepKey="addAttributeToProduct"> + <actionGroup ref="AddProductAttributeInProductModalActionGroup" stepKey="addAttributeToProduct"> <argument name="attributeCode" value="{{priceProductAttribute.attribute_code}}"/> </actionGroup> <click stepKey="openAttributes" selector="{{AdminProductAttributesSection.sectionHeader}}"/> @@ -197,7 +197,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> </before> <after> - <actionGroup ref="navigateToEditProductAttribute" stepKey="goToEditPage"> + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage"> <argument name="ProductAttribute" value="{{dropdownProductAttribute.attribute_code}}"/> </actionGroup> <click stepKey="clickDelete" selector="{{AttributePropertiesSection.DeleteAttribute}}"/> @@ -210,25 +210,25 @@ <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="goToProductAttributes"/> <!--Create new Product Attribute as TextField, with code and default value.--> - <actionGroup ref="createProductAttribute" stepKey="createAttribute"> + <actionGroup ref="CreateProductAttributeActionGroup" stepKey="createAttribute"> <argument name="attribute" value="dropdownProductAttribute"/> </actionGroup> <!--Navigate to Product Attribute, add Product Options and Save - 1--> - <actionGroup ref="navigateToEditProductAttribute" stepKey="goToEditPage1"> + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage1"> <argument name="ProductAttribute" value="{{dropdownProductAttribute.attribute_code}}"/> </actionGroup> - <actionGroup ref="createAttributeDropdownNthOption" stepKey="createOption1"> + <actionGroup ref="CreateAttributeDropdownNthOptionActionGroup" stepKey="createOption1"> <argument name="adminName" value="{{dropdownProductAttribute.option1_admin}}"/> <argument name="frontName" value="{{dropdownProductAttribute.option1_frontend}}"/> <argument name="row" value="1"/> </actionGroup> - <actionGroup ref="createAttributeDropdownNthOption" stepKey="createOption2"> + <actionGroup ref="CreateAttributeDropdownNthOptionActionGroup" stepKey="createOption2"> <argument name="adminName" value="{{dropdownProductAttribute.option2_admin}}"/> <argument name="frontName" value="{{dropdownProductAttribute.option2_frontend}}"/> <argument name="row" value="2"/> </actionGroup> - <actionGroup ref="createAttributeDropdownNthOptionAsDefault" stepKey="createOption3"> + <actionGroup ref="CreateAttributeDropdownNthOptionAsDefaultActionGroup" stepKey="createOption3"> <argument name="adminName" value="{{dropdownProductAttribute.option3_admin}}"/> <argument name="frontName" value="{{dropdownProductAttribute.option3_frontend}}"/> <argument name="row" value="3"/> @@ -236,7 +236,7 @@ <click stepKey="saveAttribute" selector="{{AttributePropertiesSection.Save}}"/> <!--Perform appropriate assertions against dropdownProductAttribute entity--> - <actionGroup ref="navigateToEditProductAttribute" stepKey="goToEditPageForAssertions"> + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPageForAssertions"> <argument name="ProductAttribute" value="{{dropdownProductAttribute.attribute_code}}"/> </actionGroup> <seeInField stepKey="assertLabel" selector="{{AttributePropertiesSection.DefaultLabel}}" userInput="{{dropdownProductAttribute.attribute_code}}"/> @@ -257,7 +257,7 @@ <!--Go to New Product page, add Attribute and check dropdown values--> <amOnPage url="{{AdminProductCreatePage.url('4', 'simple')}}" stepKey="goToCreateSimpleProductPage"/> - <actionGroup ref="addProductAttributeInProductModal" stepKey="addAttributeToProduct"> + <actionGroup ref="AddProductAttributeInProductModalActionGroup" stepKey="addAttributeToProduct"> <argument name="attributeCode" value="{{dropdownProductAttribute.attribute_code}}"/> </actionGroup> <click stepKey="openAttributes" selector="{{AdminProductAttributesSection.sectionHeader}}"/> @@ -284,7 +284,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> </before> <after> - <actionGroup ref="navigateToEditProductAttribute" stepKey="goToEditPage"> + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage"> <argument name="ProductAttribute" value="{{dropdownProductAttributeWithQuote.attribute_code}}"/> </actionGroup> <click stepKey="clickDelete" selector="{{AttributePropertiesSection.DeleteAttribute}}"/> @@ -297,15 +297,15 @@ <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="goToProductAttributes"/> <!--Create new Product Attribute as TextField, with code and default value.--> - <actionGroup ref="createProductAttribute" stepKey="createAttribute"> + <actionGroup ref="CreateProductAttributeActionGroup" stepKey="createAttribute"> <argument name="attribute" value="dropdownProductAttributeWithQuote"/> </actionGroup> <!--Navigate to Product Attribute, add Product Option and Save - 1--> - <actionGroup ref="navigateToEditProductAttribute" stepKey="goToEditPage1"> + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage1"> <argument name="ProductAttribute" value="{{dropdownProductAttributeWithQuote.attribute_code}}"/> </actionGroup> - <actionGroup ref="createAttributeDropdownNthOptionAsDefault" stepKey="createOption1"> + <actionGroup ref="CreateAttributeDropdownNthOptionAsDefaultActionGroup" stepKey="createOption1"> <argument name="adminName" value="{{dropdownProductAttributeWithQuote.option1_admin}}"/> <argument name="frontName" value="{{dropdownProductAttributeWithQuote.option1_frontend}}"/> <argument name="row" value="1"/> @@ -313,7 +313,7 @@ <click stepKey="saveAttribute" selector="{{AttributePropertiesSection.Save}}"/> <!--Perform appropriate assertions against dropdownProductAttribute entity--> - <actionGroup ref="navigateToEditProductAttribute" stepKey="goToEditPageForAssertions"> + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPageForAssertions"> <argument name="ProductAttribute" value="{{dropdownProductAttributeWithQuote.attribute_code}}"/> </actionGroup> <seeInField stepKey="assertLabel" selector="{{AttributePropertiesSection.DefaultLabel}}" userInput="{{dropdownProductAttributeWithQuote.attribute_code}}"/> @@ -328,7 +328,7 @@ <!--Go to New Product page, add Attribute and check dropdown values--> <amOnPage url="{{AdminProductCreatePage.url('4', 'simple')}}" stepKey="goToCreateSimpleProductPage"/> - <actionGroup ref="addProductAttributeInProductModal" stepKey="addAttributeToProduct"> + <actionGroup ref="AddProductAttributeInProductModalActionGroup" stepKey="addAttributeToProduct"> <argument name="attributeCode" value="{{dropdownProductAttributeWithQuote.attribute_code}}"/> </actionGroup> <click stepKey="openAttributes" selector="{{AdminProductAttributesSection.sectionHeader}}"/> @@ -352,7 +352,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> </before> <after> - <actionGroup ref="navigateToEditProductAttribute" stepKey="goToEditPage"> + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage"> <argument name="ProductAttribute" value="{{multiselectProductAttribute.attribute_code}}"/> </actionGroup> <click stepKey="clickDelete" selector="{{AttributePropertiesSection.DeleteAttribute}}"/> @@ -365,25 +365,25 @@ <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="goToProductAttributes"/> <!--Create new Product Attribute as TextField, with code and default value.--> - <actionGroup ref="createProductAttribute" stepKey="createAttribute"> + <actionGroup ref="CreateProductAttributeActionGroup" stepKey="createAttribute"> <argument name="attribute" value="multiselectProductAttribute"/> </actionGroup> <!--Navigate to Product Attribute, add Product Options and Save - 1--> - <actionGroup ref="navigateToEditProductAttribute" stepKey="goToEditPage1"> + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage1"> <argument name="ProductAttribute" value="{{multiselectProductAttribute.attribute_code}}"/> </actionGroup> - <actionGroup ref="createAttributeDropdownNthOption" stepKey="createOption1"> + <actionGroup ref="CreateAttributeDropdownNthOptionActionGroup" stepKey="createOption1"> <argument name="adminName" value="{{multiselectProductAttribute.option1_admin}}"/> <argument name="frontName" value="{{multiselectProductAttribute.option1_frontend}}"/> <argument name="row" value="1"/> </actionGroup> - <actionGroup ref="createAttributeDropdownNthOption" stepKey="createOption2"> + <actionGroup ref="CreateAttributeDropdownNthOptionActionGroup" stepKey="createOption2"> <argument name="adminName" value="{{multiselectProductAttribute.option2_admin}}"/> <argument name="frontName" value="{{multiselectProductAttribute.option2_frontend}}"/> <argument name="row" value="2"/> </actionGroup> - <actionGroup ref="createAttributeDropdownNthOptionAsDefault" stepKey="createOption3"> + <actionGroup ref="CreateAttributeDropdownNthOptionAsDefaultActionGroup" stepKey="createOption3"> <argument name="adminName" value="{{multiselectProductAttribute.option3_admin}}"/> <argument name="frontName" value="{{multiselectProductAttribute.option3_frontend}}"/> <argument name="row" value="3"/> @@ -391,7 +391,7 @@ <click stepKey="saveAttribute" selector="{{AttributePropertiesSection.Save}}"/> <!--Perform appropriate assertions against multiselectProductAttribute entity--> - <actionGroup ref="navigateToEditProductAttribute" stepKey="goToEditPageForAssertions"> + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPageForAssertions"> <argument name="ProductAttribute" value="{{multiselectProductAttribute.attribute_code}}"/> </actionGroup> <seeInField stepKey="assertLabel" selector="{{AttributePropertiesSection.DefaultLabel}}" userInput="{{multiselectProductAttribute.attribute_code}}"/> @@ -412,7 +412,7 @@ <!--Go to New Product page, add Attribute and check multiselect values--> <amOnPage url="{{AdminProductCreatePage.url('4', 'simple')}}" stepKey="goToCreateSimpleProductPage"/> - <actionGroup ref="addProductAttributeInProductModal" stepKey="addAttributeToProduct"> + <actionGroup ref="AddProductAttributeInProductModalActionGroup" stepKey="addAttributeToProduct"> <argument name="attributeCode" value="{{multiselectProductAttribute.attribute_code}}"/> </actionGroup> <click stepKey="openAttributes" selector="{{AdminProductAttributesSection.sectionHeader}}"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/DeleteCategoriesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/DeleteCategoriesTest.xml index 674d46b9c18b1..8609d50fecaf2 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/DeleteCategoriesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/DeleteCategoriesTest.xml @@ -98,7 +98,7 @@ <!--<argument name="category" value="$$createCategoryC$$"/>--> <!--<argument name="productCount" value="2"/>--> <!--</actionGroup>--> - <!--<actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="browseAssertCategoryProduct1">--> + <!--<actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="browseAssertCategoryProduct1">--> <!--<argument name="product" value="$$createProduct1$$"/>--> <!--</actionGroup>--> @@ -109,7 +109,7 @@ <argument name="category" value="$$createSubCategory$$"/> <argument name="productCount" value="1"/> </actionGroup> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="browseAssertCategoryProduct2"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="browseAssertCategoryProduct2"> <argument name="product" value="$$createProduct2$$"/> </actionGroup> @@ -118,17 +118,17 @@ <!--<argument name="category" value="$$createCategoryB$$"/>--> <!--<argument name="productCount" value="1"/>--> <!--</actionGroup>--> - <!--<actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="browseAssertCategoryProduct3">--> + <!--<actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="browseAssertCategoryProduct3">--> <!--<argument name="product" value="$$createProduct3$$"/>--> <!--</actionGroup>--> <!-- Delete Categories 1(with subcategory) and 3. --> <amOnPage url="{{AdminCategoryPage.url}}" stepKey="navigateToCategoryPageAfterStoreFrontCategoryAssertions"/> <waitForPageLoad time="30" stepKey="waitForCategoryPageLoadAfterStoreFrontCategoryAssertions"/> - <actionGroup ref="DeleteCategory" stepKey="deleteCategoryC"> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCategoryC"> <argument name="categoryEntity" value="$$createCategoryC$$"/> </actionGroup> - <actionGroup ref="DeleteCategory" stepKey="deleteCategoryB"> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCategoryB"> <argument name="categoryEntity" value="$$createCategoryB$$"/> </actionGroup> <!-- Verify categories 1 and 3 are absent --> @@ -139,17 +139,17 @@ <!-- Verify products 1-3 are available on storefront --> <amOnPage url="{{StorefrontHomePage.url}}$$createProduct1.custom_attributes[url_key]$$.html" stepKey="amOnProduct1Page"/> <waitForPageLoad stepKey="product1WaitForPageLoad"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="browseAssertProduct1Page"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="browseAssertProduct1Page"> <argument name="product" value="$$createProduct1$$"/> </actionGroup> <amOnPage url="{{StorefrontHomePage.url}}$$createProduct2.custom_attributes[url_key]$$.html" stepKey="amOnProduct2Page"/> <waitForPageLoad stepKey="product2WaitForPageLoad"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="browseAssertProduct2Page"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="browseAssertProduct2Page"> <argument name="product" value="$$createProduct2$$"/> </actionGroup> <amOnPage url="{{StorefrontHomePage.url}}$$createProduct3.custom_attributes[url_key]$$.html" stepKey="amOnProduct3Page"/> <waitForPageLoad stepKey="product3WaitForPageLoad"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="browseAssertProduct3Page"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="browseAssertProduct3Page"> <argument name="product" value="$$createProduct3$$"/> </actionGroup> <!-- Rename New Root Category to Default category --> @@ -161,4 +161,4 @@ <click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategoryDefaultCategory"/> <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="assertSuccessMessageAfterSaveDefaultCategory"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/DeleteUsedInConfigurableProductAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/DeleteUsedInConfigurableProductAttributeTest.xml index e79e4cea408fb..6706175a4da54 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/DeleteUsedInConfigurableProductAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/DeleteUsedInConfigurableProductAttributeTest.xml @@ -81,7 +81,7 @@ <!-- Click Delete Attribute button --> <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttributeByAttributeCode"> - <argument name="productAttributeCode" value="$$productAttributeHandle.attribute_code$$"/> + <argument name="ProductAttributeCode" value="$$productAttributeHandle.attribute_code$$"/> </actionGroup> <!-- Should see error message: This attribute is used in configurable products. --> @@ -102,4 +102,4 @@ <argument name="productAttribute" value="$$productAttributeHandle$$"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/DisplayRefreshCacheAfterChangingCategoryPageLayoutTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/DisplayRefreshCacheAfterChangingCategoryPageLayoutTest.xml index 02df8db5c2121..1f71ec1e6a850 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/DisplayRefreshCacheAfterChangingCategoryPageLayoutTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/DisplayRefreshCacheAfterChangingCategoryPageLayoutTest.xml @@ -35,7 +35,7 @@ </after> <!-- Navigate to category details page --> <comment userInput="Navigate to category details page" stepKey="navigateToAdminCategoryPage"/> - <actionGroup ref="goToAdminCategoryPageById" stepKey="goToAdminCategoryPage"> + <actionGroup ref="GoToAdminCategoryPageByIdActionGroup" stepKey="goToAdminCategoryPage"> <argument name="id" value="$$simpleCategory.id$$"/> </actionGroup> <!-- Open design tab and set layout --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CAdminTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CAdminTest.xml index 1419ca4cb42ef..232321610eadc 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CAdminTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CAdminTest.xml @@ -31,40 +31,40 @@ <!--Create Simple Product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageSimple"/> <waitForPageLoad time="30" stepKey="waitForProductPageLoadSimple"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateSimpleProduct"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateSimpleProduct"> <argument name="product" value="SimpleProduct"/> </actionGroup> - <actionGroup ref="checkRequiredFieldsInProductForm" stepKey="checkRequiredFieldsProductSimple"/> - <actionGroup ref="fillMainProductForm" stepKey="fillSimpleProductMain"> + <actionGroup ref="CheckRequiredFieldsInProductFormActionGroup" stepKey="checkRequiredFieldsProductSimple"/> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillSimpleProductMain"> <argument name="product" value="SimpleProduct"/> </actionGroup> - <actionGroup ref="addProductImage" stepKey="addImageForProductSimple"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageForProductSimple"> <argument name="image" value="ProductImage"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveSimpleProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSimpleProduct"/> <click selector="{{AdminProductFormActionSection.backButton}}" stepKey="clickBackToGridSimple"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridSimple"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridSimple"> <argument name="product" value="SimpleProduct"/> </actionGroup> <grabAttributeFrom selector="{{AdminProductGridSection.productThumbnail('1')}}" userInput="src" stepKey="getSimpleProductThumbnail"/> <assertNotRegExp expected="'/placeholder\/thumbnail\.jpg/'" actual="$getSimpleProductThumbnail" stepKey="simpleThumbnailIsNotDefault"/> - <actionGroup ref="viewProductInAdminGrid" stepKey="seeSimpleProductInGrid"> + <actionGroup ref="ViewProductInAdminGridActionGroup" stepKey="seeSimpleProductInGrid"> <argument name="product" value="SimpleProduct"/> </actionGroup> <!--Create Virtual Product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageVirtual"/> <waitForPageLoad time="30" stepKey="waitForProductPageLoadVirtual"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateVirtualProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateVirtualProduct"> <argument name="product" value="VirtualProduct"/> </actionGroup> <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{VirtualProduct.sku}}" stepKey="fillVirtualName"/> <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{VirtualProduct.name}}" stepKey="fillVirtualSku"/> <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{VirtualProduct.price}}" stepKey="fillVirtualPrice"/> <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{VirtualProduct.quantity}}" stepKey="fillVirtualQty"/> - <actionGroup ref="saveProductForm" stepKey="saveVirtualProduct"/> - <actionGroup ref="viewProductInAdminGrid" stepKey="viewVirtualProductInGrid"> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveVirtualProduct"/> + <actionGroup ref="ViewProductInAdminGridActionGroup" stepKey="viewVirtualProductInGrid"> <argument name="product" value="VirtualProduct"/> </actionGroup> @@ -74,15 +74,15 @@ <waitForPageLoad stepKey="waitForProductGridPageLoad"/> <!--Search by keyword--> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetGridToDefaultKeywordSearch"/> - <actionGroup ref="searchProductGridByKeyword" stepKey="useKeywordSearchSimpleProduct"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetGridToDefaultKeywordSearch"/> + <actionGroup ref="SearchProductGridByKeywordActionGroup" stepKey="useKeywordSearchSimpleProduct"> <argument name="keyword" value="SimpleProduct.name"/> </actionGroup> <seeNumberOfElements selector="{{AdminProductGridSection.productGridRows}}" userInput="1" stepKey="seeOnlyOneProductInGrid"/> <see selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="{{SimpleProduct.name}}" stepKey="seeOnlySimpleProductInGrid"/> <!--Paging works--> - <actionGroup ref="resetProductGridToDefaultView" stepKey="setProductGridToDefaultPagination"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="setProductGridToDefaultPagination"/> <comment userInput="Admin uses paging on product grid" stepKey="usePagingProductGridComment"/> <click selector="{{AdminProductGridPaginationSection.perPageDropdown}}" stepKey="clickProductPerPageDropdown"/> <click selector="{{AdminProductGridPaginationSection.perPageOption('50')}}" stepKey="selectProductsPerPage"/> @@ -100,14 +100,14 @@ <seeNumberOfElements selector="{{AdminProductGridSection.productGridRows}}" parameterArray="[1,5]" stepKey="seeProductsOnSecondPage"/> <!--Filtering works (by Name, By Price, by Status)--> - <actionGroup ref="resetProductGridToDefaultView" stepKey="setProductGridToDefaultFiltering"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridByGroupedSku"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="setProductGridToDefaultFiltering"/> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridByGroupedSku"> <argument name="product" value="GroupedProduct"/> </actionGroup> <seeNumberOfElements selector="{{AdminProductGridSection.productGridRows}}" userInput="1" stepKey="seeOneMatchingSkuInProductGrid"/> <see selector="{{AdminProductGridSection.productGridCell('1','SKU')}}" userInput="{{GroupedProduct.sku}}" stepKey="seeProductInFilteredGridSku"/> <!--Filter by price--> - <actionGroup ref="filterProductGridByPriceRange" stepKey="filterProductGridByPrice"> + <actionGroup ref="FilterProductGridByPriceRangeActionGroup" stepKey="filterProductGridByPrice"> <argument name="filter" value="PriceFilterRange"/> </actionGroup> <click selector="{{AdminProductGridSection.columnHeader('Price')}}" stepKey="clickPriceHeaderToSortAscForFilter"/> @@ -118,17 +118,17 @@ <assertRegExp expected="'/\$[0-9]{2}\.[0-9]{2}/'" actual="$getMaximumPriceInGrid" stepKey="assertMaximumPriceIsCorrect"/> <assertLessThan expected="$getMaximumPriceInGrid" actual="$getMinimumPriceInGrid" stepKey="checkPriceSortCorrect"/> <!--Filter by status--> - <actionGroup ref="filterProductGridByEnabledStatus" stepKey="filterGridByEnabledProducts"/> + <actionGroup ref="FilterProductGridByEnabledStatusActionGroup" stepKey="filterGridByEnabledProducts"/> <seeNumberOfElements selector="{{AdminProductGridSection.productGridRows}}" parameterArray="[1,20]" stepKey="seeEnabledProductsNotEmpty"/> <see selector="{{AdminProductGridSection.column('Status')}}" userInput="Enabled" stepKey="seeOnlyEnabledProducts"/> - <actionGroup ref="filterProductGridByDisabledStatus" stepKey="filterGridByDisabledProducts"/> + <actionGroup ref="FilterProductGridByDisabledStatusActionGroup" stepKey="filterGridByDisabledProducts"/> <dontSee selector="{{AdminProductGridSection.column('Status')}}" userInput="Enabled" stepKey="dontSeeEnabledProducts"/> <!--Sorting works (By Price, by ID)--> <!--By Price--> - <actionGroup ref="resetProductGridToDefaultView" stepKey="setProductGridToDefaultSortingPrice"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="setProductGridToDefaultSortingPrice"/> <!--Filter by price so grid contains prices that we can compare correctly--> - <actionGroup ref="filterProductGridByPriceRange" stepKey="filterProductGridByPriceForCompare"> + <actionGroup ref="FilterProductGridByPriceRangeActionGroup" stepKey="filterProductGridByPriceForCompare"> <argument name="filter" value="PriceFilterRange"/> </actionGroup> <!--Sort Ascending--> @@ -142,7 +142,7 @@ <grabTextFrom selector="{{AdminProductGridSection.productGridCell('2', 'Price')}}" stepKey="getSecondPriceSortDesc"/> <assertGreaterThanOrEqual expected="$getSecondPriceSortDesc" actual="$getFirstPriceSortDesc" stepKey="checkPriceDescSortCorrect"/> <!--By Product ID--> - <actionGroup ref="resetProductGridToDefaultView" stepKey="setProductGridToDefaultSortingId"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="setProductGridToDefaultSortingId"/> <!--Sort Ascending--> <grabTextFrom selector="{{AdminProductGridSection.productGridCell('1', 'ID')}}" stepKey="getFirstProductIdSortAsc"/> <grabTextFrom selector="{{AdminProductGridSection.productGridCell('2', 'ID')}}" stepKey="getSecondProductIdSortAsc"/> @@ -154,7 +154,7 @@ <assertGreaterThan expected="$getSecondProductIdSortDesc" actual="$getFirstProductIdSortDesc" stepKey="checkProductIdDescSortCorrect"/> <!--Adding column works--> - <actionGroup ref="resetProductGridToDefaultView" stepKey="setProductGridToDefaultColumns"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="setProductGridToDefaultColumns"/> <click selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="openColumnsDropdownToReset"/> <click selector="{{AdminProductGridFilterSection.resetGridColumns}}" stepKey="resetProductGridColumns"/> <click selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="closeColumnsDropdownAfterReset"/> @@ -170,7 +170,7 @@ <checkOption selector="{{AdminProductGridFilterSection.viewColumnOption('Weight')}}" stepKey="showWeightColumn"/> <click selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="closeColumnsDropdownWeight"/> <seeElement selector="{{AdminProductGridSection.columnHeader('Weight')}}" stepKey="seeWeightColumn"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridToCheckWeightColumn"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridToCheckWeightColumn"> <argument name="product" value="SimpleProduct"/> </actionGroup> <see selector="{{AdminProductGridSection.productGridCell('1','Weight')}}" userInput="{{SimpleProduct.weight}}" stepKey="seeCorrectProductWeightInGrid"/> @@ -182,13 +182,13 @@ <waitForPageLoad time="30" stepKey="waitForCategoryPageLoad"/> <!--Create category under Default Category--> <click selector="{{AdminCategorySidebarTreeSection.categoryTreeRoot}}" stepKey="clickDefaultCategory"/> - <actionGroup ref="CheckCategoryNameIsRequiredField" stepKey="checkCategoryNameIsRequired"/> - <actionGroup ref="CreateCategory" stepKey="createCategory"> + <actionGroup ref="CheckCategoryNameIsRequiredFieldActionGroup" stepKey="checkCategoryNameIsRequired"/> + <actionGroup ref="CreateCategoryActionGroup" stepKey="createCategory"> <argument name="categoryEntity" value="_defaultCategory"/> </actionGroup> <!--Create category under newly created category--> <click selector="{{AdminCategorySidebarTreeSection.categoryInTree(_defaultCategory.name)}}" stepKey="clickCreatedCategoryInTree"/> - <actionGroup ref="CreateCategory" stepKey="createSubCategory"> + <actionGroup ref="CreateCategoryActionGroup" stepKey="createSubCategory"> <argument name="categoryEntity" value="SimpleSubCategory"/> </actionGroup> @@ -211,24 +211,24 @@ <comment userInput="Admin deletes category" stepKey="deleteCategoryComment"/> <amOnPage url="{{AdminCategoryPage.url}}" stepKey="onCategoryPageToDeleteCategory"/> <waitForPageLoad time="30" stepKey="waitForCategoryPageDelete"/> - <actionGroup ref="DeleteCategory" stepKey="deleteCategory"> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCategory"> <argument name="categoryEntity" value="_defaultCategory"/> </actionGroup> <!--@TODO Move cleanup to "after" when MQE-830 is resolved--> <!--Clean up categories--> <comment userInput="Clean up categories" stepKey="cleanupCategoriesComment"/> - <actionGroup ref="DeleteCategory" stepKey="cleanSimpleSubCategory"> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="cleanSimpleSubCategory"> <argument name="categoryEntity" value="SimpleSubCategory"/> </actionGroup> <!--Clean up products--> <comment userInput="Clean up simple product" stepKey="cleanUpSimpleProduct"/> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteSimpleProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteSimpleProduct"> <argument name="product" value="SimpleProduct"/> </actionGroup> <comment userInput="Clean up virtual product" stepKey="cleanUpVirtualProduct"/> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteVirtualProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteVirtualProduct"> <argument name="product" value="VirtualProduct"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CGuestUserTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CGuestUserTest.xml index ad66214e902fe..f7ebb090124d6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CGuestUserTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CGuestUserTest.xml @@ -76,7 +76,7 @@ </actionGroup> <!-- Check simple product 1 in category --> <comment userInput="Check simple product 1 in category" stepKey="commentCheckSimpleProductInCategory" /> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="browseAssertCategoryProduct1"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="browseAssertCategoryProduct1"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -84,7 +84,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$browseGrabSimpleProduct1ImageSrc" stepKey="browseAssertSimpleProduct1ImageNotDefault"/> <!-- Check simple product 2 in category --> <comment userInput="Check simple product 2 in category" stepKey="commentCheckSimpleProduct2InCategory" /> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="browseAssertCategoryProduct2"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="browseAssertCategoryProduct2"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -95,7 +95,7 @@ <comment userInput="View simple product 1" stepKey="commentViewSimpleProduct1" after="browseAssertSimpleProduct2ImageNotDefault"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSimpleProduct1.name$$)}}" stepKey="browseClickCategorySimpleProduct1View" after="commentViewSimpleProduct1"/> <waitForLoadingMaskToDisappear stepKey="waitForSimpleProduct1Viewloaded" /> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="browseAssertProduct1Page"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="browseAssertProduct1Page"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -107,7 +107,7 @@ <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="clickCategory1"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSimpleProduct2.name$$)}}" stepKey="browseClickCategorySimpleProduct2View"/> <waitForLoadingMaskToDisappear stepKey="waitForSimpleProduct2ViewLoaded" /> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="browseAssertProduct2Page"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="browseAssertProduct2Page"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -125,7 +125,7 @@ <argument name="category" value="$$createCategory$$"/> <argument name="productCount" value="3"/> </actionGroup> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="compareAssertSimpleProduct1"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="compareAssertSimpleProduct1"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -133,7 +133,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$compareGrabSimpleProduct1ImageSrc" stepKey="compareAssertSimpleProduct1ImageNotDefault"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSimpleProduct1.name$$)}}" stepKey="compareClickSimpleProduct1"/> <waitForLoadingMaskToDisappear stepKey="waitForCompareSimpleProduct1loaded" /> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="compareAssertProduct1Page"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="compareAssertProduct1Page"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -151,7 +151,7 @@ <argument name="category" value="$$createCategory$$"/> <argument name="productCount" value="3"/> </actionGroup> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="compareAssertSimpleProduct2"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="compareAssertSimpleProduct2"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -269,7 +269,7 @@ </actionGroup> <!-- Check simple product 1 in category --> <comment userInput="Check simple product 1 in category" stepKey="commentCheckSimpleProductInCategory" /> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="browseAssertCategoryProduct1"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="browseAssertCategoryProduct1"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -277,7 +277,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$browseGrabSimpleProduct1ImageSrc" stepKey="browseAssertSimpleProduct1ImageNotDefault"/> <!-- Check simple product 2 in category --> <comment userInput="Check simple product 2 in category" stepKey="commentCheckSimpleProduct2InCategory" /> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="browseAssertCategoryProduct2"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="browseAssertCategoryProduct2"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -288,7 +288,7 @@ <comment userInput="View simple product 1" stepKey="commentViewSimpleProduct1" after="browseAssertSimpleProduct2ImageNotDefault"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSimpleProduct1.name$$)}}" stepKey="browseClickCategorySimpleProduct1View" after="commentViewSimpleProduct1"/> <waitForLoadingMaskToDisappear stepKey="waitForSimpleProduct1Viewloaded" /> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="browseAssertProduct1Page"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="browseAssertProduct1Page"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -300,7 +300,7 @@ <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="clickCategory1"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSimpleProduct2.name$$)}}" stepKey="browseClickCategorySimpleProduct2View"/> <waitForLoadingMaskToDisappear stepKey="waitForSimpleProduct2ViewLoaded" /> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="browseAssertProduct2Page"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="browseAssertProduct2Page"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -318,7 +318,7 @@ <argument name="category" value="$$createCategory$$"/> <argument name="productCount" value="3"/> </actionGroup> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="compareAssertSimpleProduct1"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="compareAssertSimpleProduct1"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -326,7 +326,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$compareGrabSimpleProduct1ImageSrc" stepKey="compareAssertSimpleProduct1ImageNotDefault"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSimpleProduct1.name$$)}}" stepKey="compareClickSimpleProduct1"/> <waitForLoadingMaskToDisappear stepKey="waitForCompareSimpleProduct1loaded" /> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="compareAssertProduct1Page"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="compareAssertProduct1Page"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -344,7 +344,7 @@ <argument name="category" value="$$createCategory$$"/> <argument name="productCount" value="3"/> </actionGroup> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="compareAssertSimpleProduct2"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="compareAssertSimpleProduct2"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml index 3f48c3ca811e3..74c6da1c47f60 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml @@ -61,7 +61,7 @@ </actionGroup> <!-- Check simple product 1 in category --> <comment userInput="Check simple product 1 in category" stepKey="commentCheckSimpleProductInCategory" after="browseAssertCategory"/> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="browseAssertCategoryProduct1" after="commentCheckSimpleProductInCategory"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="browseAssertCategoryProduct1" after="commentCheckSimpleProductInCategory"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -69,7 +69,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$browseGrabSimpleProduct1ImageSrc" stepKey="browseAssertSimpleProduct1ImageNotDefault" after="browseGrabSimpleProduct1ImageSrc"/> <!-- Check simple product 2 in category --> <comment userInput="Check simple product 2 in category" stepKey="commentCheckSimpleProduct2InCategory" after="browseAssertSimpleProduct1ImageNotDefault"/> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="browseAssertCategoryProduct2" after="commentCheckSimpleProduct2InCategory"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="browseAssertCategoryProduct2" after="commentCheckSimpleProduct2InCategory"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -80,7 +80,7 @@ <comment userInput="View simple product 1" stepKey="commentViewSimpleProduct1" after="browseAssertSimpleProduct2ImageNotDefault"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSimpleProduct1.name$$)}}" stepKey="browseClickCategorySimpleProduct1View" after="commentViewSimpleProduct1"/> <waitForLoadingMaskToDisappear stepKey="waitForSimpleProduct1Viewloaded" after="browseClickCategorySimpleProduct1View"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="browseAssertProduct1Page" after="waitForSimpleProduct1Viewloaded"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="browseAssertProduct1Page" after="waitForSimpleProduct1Viewloaded"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -92,7 +92,7 @@ <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="clickCategory1" after="commentViewSimpleProduct2"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSimpleProduct2.name$$)}}" stepKey="browseClickCategorySimpleProduct2View" after="clickCategory1"/> <waitForLoadingMaskToDisappear stepKey="waitForSimpleProduct2ViewLoaded" after="browseClickCategorySimpleProduct2View"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="browseAssertProduct2Page" after="waitForSimpleProduct2ViewLoaded"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="browseAssertProduct2Page" after="waitForSimpleProduct2ViewLoaded"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -110,7 +110,7 @@ <argument name="category" value="$$createCategory$$"/> <argument name="productCount" value="3"/> </actionGroup> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="compareAssertSimpleProduct1" after="compareAssertCategory"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="compareAssertSimpleProduct1" after="compareAssertCategory"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -118,7 +118,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$compareGrabSimpleProduct1ImageSrc" stepKey="compareAssertSimpleProduct1ImageNotDefault" after="compareGrabSimpleProduct1ImageSrc"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSimpleProduct1.name$$)}}" stepKey="compareClickSimpleProduct1" after="compareAssertSimpleProduct1ImageNotDefault"/> <waitForLoadingMaskToDisappear stepKey="waitForCompareSimpleProduct1loaded" after="compareClickSimpleProduct1"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="compareAssertProduct1Page" after="waitForCompareSimpleProduct1loaded"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="compareAssertProduct1Page" after="waitForCompareSimpleProduct1loaded"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -136,7 +136,7 @@ <argument name="category" value="$$createCategory$$"/> <argument name="productCount" value="3"/> </actionGroup> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="compareAssertSimpleProduct2" after="compareAssertCategory1"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="compareAssertSimpleProduct2" after="compareAssertCategory1"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/SimpleProductTwoCustomOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/SimpleProductTwoCustomOptionsTest.xml index 0049dcb504335..41bacc69baca4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/SimpleProductTwoCustomOptionsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/SimpleProductTwoCustomOptionsTest.xml @@ -25,16 +25,16 @@ <!--Create product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPage"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateSimpleProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateSimpleProduct"> <argument name="product" value="SimpleProduct3"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillSimpleProductMain"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillSimpleProductMain"> <argument name="product" value="SimpleProduct3"/> </actionGroup> </before> <after> <!-- Delete the created product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="SimpleProduct3"/> </actionGroup> <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> @@ -45,14 +45,14 @@ <waitForPageLoad stepKey="waitForCustomOptionsOpen"/> <!-- Create a custom option with 2 values --> - <actionGroup ref="CreateCustomRadioOptions" stepKey="createCustomOption1"> + <actionGroup ref="CreateCustomRadioOptionsActionGroup" stepKey="createCustomOption1"> <argument name="customOptionName" value="ProductOptionRadiobutton.title"/> <argument name="productOption" value="ProductOptionField"/> <argument name="productOption2" value="ProductOptionField2"/> </actionGroup> <!-- Create another custom option with 2 values --> - <actionGroup ref="CreateCustomRadioOptions" stepKey="createCustomOption2"> + <actionGroup ref="CreateCustomRadioOptionsActionGroup" stepKey="createCustomOption2"> <argument name="customOptionName" value="ProductOptionRadiobutton.title"/> <argument name="productOption" value="ProductOptionField"/> <argument name="productOption2" value="ProductOptionField2"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCatalogNavigationMenuUIDesktopTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCatalogNavigationMenuUIDesktopTest.xml index ae54b72a5a702..22ec0048497fa 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCatalogNavigationMenuUIDesktopTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCatalogNavigationMenuUIDesktopTest.xml @@ -21,10 +21,10 @@ <before> <!-- Login as admin --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="DeleteDefaultCategoryChildren" stepKey="deleteRootCategoryChildren"/> + <actionGroup ref="DeleteDefaultCategoryChildrenActionGroup" stepKey="deleteRootCategoryChildren"/> </before> <after> - <actionGroup ref="DeleteDefaultCategoryChildren" stepKey="deleteRootCategoryChildren"/> + <actionGroup ref="DeleteDefaultCategoryChildrenActionGroup" stepKey="deleteRootCategoryChildren"/> <actionGroup ref="AdminChangeStorefrontThemeActionGroup" stepKey="changeThemeToDefault"> <argument name="theme" value="{{MagentoLumaTheme.name}}"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontEnsureThatAccordionAnchorIsVisibleOnViewportOnceClickedTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontEnsureThatAccordionAnchorIsVisibleOnViewportOnceClickedTest.xml index 0f9f542a97d02..034347dc32d82 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontEnsureThatAccordionAnchorIsVisibleOnViewportOnceClickedTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontEnsureThatAccordionAnchorIsVisibleOnViewportOnceClickedTest.xml @@ -84,7 +84,7 @@ <selectOption selector="{{AdminProductFormSection.customSelectField($$createFourthAttribute.attribute[attribute_code]$$)}}" userInput="$$createSecondOption.option[store_labels][0][label]$$" stepKey="setFourthAttributeValue"/> <!-- Save product form --> - <actionGroup ref="saveProductForm" stepKey="saveSimpleProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSimpleProduct"/> <!-- Go to frontend and make a user account and login with it --> <actionGroup ref="SignUpNewUserFromStorefrontActionGroup" stepKey="signUpNewUser"> @@ -133,19 +133,19 @@ </actionGroup> <!-- Assert that product page has all product attributes in More Info tab --> - <actionGroup ref="checkAttributeInMoreInformationTab" stepKey="checkFirstAttributeInMoreInformationTab"> + <actionGroup ref="CheckAttributeInMoreInformationTabActionGroup" stepKey="checkFirstAttributeInMoreInformationTab"> <argument name="attributeLabel" value="$$createFirstAttribute.attribute[frontend_labels][0][label]$$"/> <argument name="attributeValue" value="$$createOption.option[store_labels][0][label]$$"/> </actionGroup> - <actionGroup ref="checkAttributeInMoreInformationTab" stepKey="checkSecondAttributeInMoreInformationTab"> + <actionGroup ref="CheckAttributeInMoreInformationTabActionGroup" stepKey="checkSecondAttributeInMoreInformationTab"> <argument name="attributeLabel" value="$$createSecondAttribute.attribute[frontend_labels][0][label]$$"/> <argument name="attributeValue" value="{{ProductAttributeOption8.value}}"/> </actionGroup> - <actionGroup ref="checkAttributeInMoreInformationTab" stepKey="checkThirdAttributeInMoreInformationTab"> + <actionGroup ref="CheckAttributeInMoreInformationTabActionGroup" stepKey="checkThirdAttributeInMoreInformationTab"> <argument name="attributeLabel" value="$$createThirdAttribute.attribute[frontend_labels][0][label]$$"/> <argument name="attributeValue" value="{{ProductAttributeOption8.value}}"/> </actionGroup> - <actionGroup ref="checkAttributeInMoreInformationTab" stepKey="checkFourthAttributeInMoreInformationTab"> + <actionGroup ref="CheckAttributeInMoreInformationTabActionGroup" stepKey="checkFourthAttributeInMoreInformationTab"> <argument name="attributeLabel" value="$$createFourthAttribute.attribute[frontend_labels][0][label]$$"/> <argument name="attributeValue" value="$$createSecondOption.option[store_labels][0][label]$$"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuote.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuote.xml index 21f8e2e070e32..07c2e8a972596 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuote.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuote.xml @@ -29,17 +29,17 @@ <!--Create product via admin--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPage"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToProductCreatePage"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToProductCreatePage"> <argument name="product" value="SimpleProductNameWithDoubleQuote"/> </actionGroup> - <actionGroup ref="fillMainProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="SimpleProductNameWithDoubleQuote"/> </actionGroup> <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createCategory.name$$]" stepKey="selectCategory"/> - <actionGroup ref="addProductImage" stepKey="addImageToProduct"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageToProduct"> <argument name="image" value="ProductImage"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!--Run re-index task--> <magentoCLI command="indexer:reindex" stepKey="reindex"/> @@ -61,7 +61,7 @@ <see selector="{{StorefrontNavigationSection.breadcrumbs}}" userInput="{{SimpleProductNameWithDoubleQuote.name}}" stepKey="seeCorrectBreadCrumbProduct"/> <!--Remove product--> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="SimpleProductNameWithDoubleQuote"/> </actionGroup> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductWithEmptyAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductWithEmptyAttributeTest.xml index 1c1b47a6bded9..db693b7229b17 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductWithEmptyAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductWithEmptyAttributeTest.xml @@ -23,7 +23,7 @@ <createData entity="productAttributeWithDropdownTwoOptions" stepKey="createProductAttribute"/> </before> <after> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteSimpleProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteSimpleProduct"> <argument name="product" value="SimpleProduct"/> </actionGroup> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> @@ -38,7 +38,7 @@ <click selector="{{AttributeSetSection.Save}}" stepKey="saveAttributeSet"/> <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear" /> <seeElement selector=".message-success" stepKey="assertSuccess"/> - <actionGroup ref="FillAdminSimpleProductForm" stepKey="fillProductFieldsInAdmin"> + <actionGroup ref="FillAdminSimpleProductFormActionGroup" stepKey="fillProductFieldsInAdmin"> <argument name="category" value="$$createPreReqCategory$$"/> <argument name="simpleProduct" value="SimpleProduct"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontRememberCategoryPaginationTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontRememberCategoryPaginationTest.xml index 0ed61b8636c4f..c8872425552be 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontRememberCategoryPaginationTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontRememberCategoryPaginationTest.xml @@ -1,68 +1,68 @@ -<?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="StorefrontRememberCategoryPaginationTest"> - <annotations> - <title value="Verify that Number of Products per page retained when visiting a different category"/> - <stories value="MAGETWO-61478: Number of Products displayed per page not retained when visiting a different category"/> - <description value="Verify that Number of Products per page retained when visiting a different category"/> - <features value="Catalog"/> - <severity value="MAJOR"/> - <testCaseId value="MAGETWO-94210"/> - <group value="Catalog"/> - </annotations> - - <before> - <createData entity="_defaultCategory" stepKey="defaultCategory1"/> - <createData entity="SimpleProduct" stepKey="simpleProduct1"> - <requiredEntity createDataKey="defaultCategory1"/> - </createData> - - <createData entity="_defaultCategory" stepKey="defaultCategory2"/> - <createData entity="SimpleProduct" stepKey="simpleProduct2"> - <requiredEntity createDataKey="defaultCategory2"/> - </createData> - - <createData entity="RememberPaginationCatalogStorefrontConfig" stepKey="setRememberPaginationCatalogStorefrontConfig"/> - </before> - - <actionGroup ref="GoToStorefrontCategoryPageByParameters" stepKey="GoToStorefrontCategory1Page"> - <argument name="category" value="$$defaultCategory1.custom_attributes[url_key]$$"/> - <argument name="mode" value="grid"/> - <argument name="numOfProductsPerPage" value="12"/> - </actionGroup> - - <actionGroup ref="VerifyCategoryPageParameters" stepKey="verifyCategory1PageParameters"> - <argument name="category" value="$$defaultCategory1$$"/> - <argument name="mode" value="grid"/> - <argument name="numOfProductsPerPage" value="12"/> - </actionGroup> - - <amOnPage url="{{StorefrontCategoryPage.url($$defaultCategory2.name$$)}}" stepKey="navigateToCategory2Page"/> - <waitForPageLoad stepKey="waitForCategory2PageToLoad"/> - - <actionGroup ref="VerifyCategoryPageParameters" stepKey="verifyCategory2PageParameters"> - <argument name="category" value="$$defaultCategory2$$"/> - <argument name="mode" value="grid"/> - <argument name="numOfProductsPerPage" value="12"/> - </actionGroup> - - <after> - <createData entity="DefaultCatalogStorefrontConfiguration" stepKey="setDefaultCatalogStorefrontConfiguration"/> - - <deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/> - <deleteData createDataKey="defaultCategory1" stepKey="deleteCategory1"/> - <deleteData createDataKey="simpleProduct2" stepKey="deleteProduct2"/> - <deleteData createDataKey="defaultCategory2" stepKey="deleteCategory2"/> - - <magentoCLI command="cache:flush" stepKey="flushCache"/> - - </after> - </test> -</tests> +<?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="StorefrontRememberCategoryPaginationTest"> + <annotations> + <title value="Verify that Number of Products per page retained when visiting a different category"/> + <stories value="MAGETWO-61478: Number of Products displayed per page not retained when visiting a different category"/> + <description value="Verify that Number of Products per page retained when visiting a different category"/> + <features value="Catalog"/> + <severity value="MAJOR"/> + <testCaseId value="MAGETWO-94210"/> + <group value="Catalog"/> + </annotations> + + <before> + <createData entity="_defaultCategory" stepKey="defaultCategory1"/> + <createData entity="SimpleProduct" stepKey="simpleProduct1"> + <requiredEntity createDataKey="defaultCategory1"/> + </createData> + + <createData entity="_defaultCategory" stepKey="defaultCategory2"/> + <createData entity="SimpleProduct" stepKey="simpleProduct2"> + <requiredEntity createDataKey="defaultCategory2"/> + </createData> + + <createData entity="RememberPaginationCatalogStorefrontConfig" stepKey="setRememberPaginationCatalogStorefrontConfig"/> + </before> + + <actionGroup ref="GoToStorefrontCategoryPageByParametersActionGroup" stepKey="GoToStorefrontCategory1Page"> + <argument name="category" value="$$defaultCategory1.custom_attributes[url_key]$$"/> + <argument name="mode" value="grid"/> + <argument name="numOfProductsPerPage" value="12"/> + </actionGroup> + + <actionGroup ref="VerifyCategoryPageParametersActionGroup" stepKey="verifyCategory1PageParameters"> + <argument name="category" value="$$defaultCategory1$$"/> + <argument name="mode" value="grid"/> + <argument name="numOfProductsPerPage" value="12"/> + </actionGroup> + + <amOnPage url="{{StorefrontCategoryPage.url($$defaultCategory2.name$$)}}" stepKey="navigateToCategory2Page"/> + <waitForPageLoad stepKey="waitForCategory2PageToLoad"/> + + <actionGroup ref="VerifyCategoryPageParametersActionGroup" stepKey="verifyCategory2PageParameters"> + <argument name="category" value="$$defaultCategory2$$"/> + <argument name="mode" value="grid"/> + <argument name="numOfProductsPerPage" value="12"/> + </actionGroup> + + <after> + <createData entity="DefaultCatalogStorefrontConfiguration" stepKey="setDefaultCatalogStorefrontConfiguration"/> + + <deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/> + <deleteData createDataKey="defaultCategory1" stepKey="deleteCategory1"/> + <deleteData createDataKey="simpleProduct2" stepKey="deleteProduct2"/> + <deleteData createDataKey="defaultCategory2" stepKey="deleteCategory2"/> + + <magentoCLI command="cache:flush" stepKey="flushCache"/> + + </after> + </test> +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontSpecialPriceForDifferentTimezonesForWebsitesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontSpecialPriceForDifferentTimezonesForWebsitesTest.xml index 514e12bb355a8..3e887a0a83aa4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontSpecialPriceForDifferentTimezonesForWebsitesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontSpecialPriceForDifferentTimezonesForWebsitesTest.xml @@ -61,7 +61,7 @@ <actionGroup ref="AddSpecialPriceToProductActionGroup" stepKey="setSpecialPriceToCreatedProduct"> <argument name="price" value="15"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProductForm"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> <!--Login to storefront from customer and check price--> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="logInFromCustomer"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyCategoryProductAndProductCategoryPartialReindexTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyCategoryProductAndProductCategoryPartialReindexTest.xml index deb6700c56990..e91f9742b2841 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyCategoryProductAndProductCategoryPartialReindexTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyCategoryProductAndProductCategoryPartialReindexTest.xml @@ -50,7 +50,7 @@ <createData entity="SimpleProduct2" stepKey="productC"/> <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> - <actionGroup ref="AdminAssignProductToCategory" stepKey="assignCategoryNAndMToProductC"> + <actionGroup ref="AdminAssignProductToCategoryActionGroup" stepKey="assignCategoryNAndMToProductC"> <argument name="productId" value="$$productC.id$$"/> <argument name="categoryName" value="$$categoryN.name$$, $$categoryM.name$$"/> </actionGroup> @@ -97,7 +97,7 @@ <!-- Open Products A, B, C to edit. Assign/unassign categories to/from them. Save changes --> <!-- Assign category K to Product A --> - <actionGroup ref="AdminAssignProductToCategory" stepKey="assignCategoryK"> + <actionGroup ref="AdminAssignProductToCategoryActionGroup" stepKey="assignCategoryK"> <argument name="productId" value="$$productA.id$$"/> <argument name="categoryName" value="$$categoryK.name$$"/> </actionGroup> @@ -109,7 +109,7 @@ </actionGroup> <!-- Assign category L to Product C --> - <actionGroup ref="AdminAssignProductToCategory" stepKey="assignCategoryNAndM"> + <actionGroup ref="AdminAssignProductToCategoryActionGroup" stepKey="assignCategoryNAndM"> <argument name="productId" value="$$productC.id$$"/> <argument name="categoryName" value="$$categoryL.name$$"/> </actionGroup> @@ -176,7 +176,7 @@ </actionGroup> <!-- Add Product B assignment for category N --> - <actionGroup ref="AdminAssignProductToCategory" stepKey="assignCategoryN"> + <actionGroup ref="AdminAssignProductToCategoryActionGroup" stepKey="assignCategoryN"> <argument name="productId" value="$$productB.id$$"/> <argument name="categoryName" value="$$categoryN.name$$"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyChildCategoriesShouldNotIncludeInMenuTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyChildCategoriesShouldNotIncludeInMenuTest.xml index 455e9b58156eb..d39d54400279c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyChildCategoriesShouldNotIncludeInMenuTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyChildCategoriesShouldNotIncludeInMenuTest.xml @@ -22,7 +22,7 @@ <amOnPage url="{{AdminCategoryPage.url}}" stepKey="navigateToCategoryPage2"/> <waitForPageLoad stepKey="waitForPageLoad3"/> <click selector="{{AdminCategorySidebarTreeSection.categoryInTree(SimpleSubCategory.name)}}" stepKey="clickOnCreatedSimpleSubCategoryBeforeDelete"/> - <actionGroup ref="DeleteCategory" stepKey="deleteCategory"> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCategory"> <argument name="categoryEntity" value="SimpleSubCategory"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -32,11 +32,11 @@ <waitForPageLoad stepKey="waitForPageLoad1"/> <scrollToTopOfPage stepKey="scrollToTopOfPage"/> <!--Create new category under Default Category--> - <actionGroup ref="CreateCategory" stepKey="createSubcategory1"> + <actionGroup ref="CreateCategoryActionGroup" stepKey="createSubcategory1"> <argument name="categoryEntity" value="SimpleSubCategory"/> </actionGroup> <!--Create another subcategory under created category--> - <actionGroup ref="CreateCategory" stepKey="createSubcategory2"> + <actionGroup ref="CreateCategoryActionGroup" stepKey="createSubcategory2"> <argument name="categoryEntity" value="SubCategoryWithParent"/> </actionGroup> <!--Go to storefront and verify visibility of categories--> @@ -85,4 +85,4 @@ <dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="dontSeeSimpleSubCategoryOnStorefront3"/> <dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(SubCategoryWithParent.name)}}" stepKey="dontSeeSubCategoryWithParentOnStorefront4"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportImportConfigurableProductWithImagesTest.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportImportConfigurableProductWithImagesTest.xml index f0ec7dbd0706b..87e4f2d5b3be0 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportImportConfigurableProductWithImagesTest.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportImportConfigurableProductWithImagesTest.xml @@ -150,7 +150,7 @@ <deleteData createDataKey="createExportImportCategory" stepKey="deleteExportImportCategory"/> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/> <!-- Admin logout--> <actionGroup ref="logout" stepKey="adminLogout"/> </after> @@ -174,7 +174,7 @@ </actionGroup> <!-- Go to Catalog > Products. Find ConfProd and delete it --> - <actionGroup ref="deleteProductBySku" stepKey="deleteConfigurableProductBySku"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteConfigurableProductBySku"> <argument name="sku" value="$$createExportImportConfigurableProduct.sku$$"/> </actionGroup> @@ -187,7 +187,7 @@ </actionGroup> <!-- Go to Catalog > Products: Configurable product exists --> - <actionGroup ref="filterAndSelectProduct" stepKey="openConfigurableProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="openConfigurableProduct"> <argument name="productSku" value="$$createExportImportConfigurableProduct.sku$$"/> </actionGroup> @@ -204,7 +204,7 @@ <!-- Go to "Images and Videos" section: assert image --> <scrollTo selector="{{AdminProductFormConfigurationsSection.sectionHeader}}" stepKey="scrollToProductGalleryTab"/> - <actionGroup ref="assertProductImageAdminProductPage" stepKey="assertProductImageAdminProductPage"> + <actionGroup ref="AssertProductImageAdminProductPageActionGroup" stepKey="assertProductImageAdminProductPage"> <argument name="image" value="MagentoLogo"/> </actionGroup> @@ -214,7 +214,7 @@ <waitForPageLoad stepKey="waitForProductPageLoad"/> <!-- Go to "Images and Videos" section: assert image --> <scrollTo selector="{{AdminProductFormConfigurationsSection.sectionHeader}}" stepKey="scrollToChildProductGalleryTab"/> - <actionGroup ref="assertProductImageAdminProductPage" stepKey="assertChildProductImageAdminProductPage"> + <actionGroup ref="AssertProductImageAdminProductPageActionGroup" stepKey="assertChildProductImageAdminProductPage"> <argument name="image" value="MagentoLogo"/> </actionGroup> <closeTab stepKey="closeConfigChildProductPage"/> diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/Test/AdminCreateProductWithZeroMaximumQtyAllowedInShoppingCartTest.xml b/app/code/Magento/CatalogInventory/Test/Mftf/Test/AdminCreateProductWithZeroMaximumQtyAllowedInShoppingCartTest.xml index f7cf0a4deba4b..b6831738923e1 100644 --- a/app/code/Magento/CatalogInventory/Test/Mftf/Test/AdminCreateProductWithZeroMaximumQtyAllowedInShoppingCartTest.xml +++ b/app/code/Magento/CatalogInventory/Test/Mftf/Test/AdminCreateProductWithZeroMaximumQtyAllowedInShoppingCartTest.xml @@ -75,6 +75,6 @@ <argument name="qty" value="50"/> </actionGroup> <waitForElementNotVisible selector="{{AdminProductFormAdvancedInventorySection.advancedInventoryModal}}" stepKey="waitForModalFormToDisappear"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> </test> </tests> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithSpecialPricesTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithSpecialPricesTest.xml index 4df08fcca696b..6e3d87fb812a3 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithSpecialPricesTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithSpecialPricesTest.xml @@ -95,21 +95,21 @@ </after> <!-- Add special prices for products --> - <actionGroup ref="goToProductPageViaID" stepKey="goToFirstChildProduct"> + <actionGroup ref="GoToProductPageViaIDActionGroup" stepKey="goToFirstChildProduct"> <argument name="productId" value="$$createFirstConfigChildProduct.id$$"/> </actionGroup> <actionGroup ref="AddSpecialPriceToProductActionGroup" stepKey="addSpecialPriceForFirstProduct"> <argument name="price" value="{{specialProductPrice.price}}"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveFirstProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveFirstProduct"/> - <actionGroup ref="goToProductPageViaID" stepKey="goToSecondChildProduct"> + <actionGroup ref="GoToProductPageViaIDActionGroup" stepKey="goToSecondChildProduct"> <argument name="productId" value="$$createSecondConfigChildProduct.id$$"/> </actionGroup> <actionGroup ref="AddSpecialPriceToProductActionGroup" stepKey="addSpecialPriceForSecondProduct"> <argument name="price" value="{{specialProductPrice.price}}"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveSecondProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSecondProduct"/> <!-- Create a new catalog price rule --> <actionGroup ref="newCatalogPriceRuleByUIWithConditionIsCategory" stepKey="newCatalogPriceRuleByUIWithConditionIsCategory"> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest.xml index d80759531ecae..84f4a84b6fb05 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest.xml @@ -78,7 +78,7 @@ <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$$createProduct1.price$$" stepKey="seeTrueProductPrice1"/> <!-- Assert that the rule isn't present in the Shopping Cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProductToShoppingCart1"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProductToShoppingCart1"> <argument name="productName" value="$$createProduct1.name$$"/> </actionGroup> <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="openMiniShoppingCart1"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml index 16fbca2697702..aea03b61eb153 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml @@ -36,7 +36,7 @@ <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteConfigurableProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteConfigurableProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductsGridFilters"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogPriceRuleByProductAttributeTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogPriceRuleByProductAttributeTest.xml index b9d601238ac73..1615985370182 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogPriceRuleByProductAttributeTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogPriceRuleByProductAttributeTest.xml @@ -140,49 +140,49 @@ <selectOption selector="{{StorefrontPropertiesSection.useForPromoRuleConditions}}" userInput="Yes" stepKey="selectYes"/> <!-- Save the attribute --> - <actionGroup ref="saveProductAttribute" stepKey="saveAttribute"/> + <actionGroup ref="SaveProductAttributeActionGroup" stepKey="saveAttribute"/> <!-- Add this product attribute to Default attribute set --> <actionGroup ref="AdminOpenAttributeSetGridPageActionGroup" stepKey="openAttributeSetPage"/> <actionGroup ref="AdminOpenAttributeSetByNameActionGroup" stepKey="openDefaultAttributeSet"/> - <actionGroup ref="AssignAttributeToGroup" stepKey="assignAttributeToGroup"> + <actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup"> <argument name="group" value="Product Details"/> <argument name="attribute" value="{{productAttributeDropdownTwoOptions.attribute_code}}"/> </actionGroup> - <actionGroup ref="SaveAttributeSet" stepKey="saveAttributeSet"/> + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveAttributeSet"/> <!-- First Simple Product: choose green as attribute value --> - <actionGroup ref="filterAndSelectProduct" stepKey="openFirstSimpleProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="openFirstSimpleProduct"> <argument name="productSku" value="$$createFirstProduct.sku$$"/> </actionGroup> <selectOption userInput="green" selector="{{AdminProductFormSection.customSelectField(productAttributeDropdownTwoOptions.attribute_code)}}" stepKey="selectGreen"/> - <actionGroup ref="saveProductForm" stepKey="saveFirstProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveFirstProduct"/> <!-- Second Simple Product: choose red as attribute value --> - <actionGroup ref="filterAndSelectProduct" stepKey="openSecondSimpleProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="openSecondSimpleProduct"> <argument name="productSku" value="$$createSecondProduct.sku$$"/> </actionGroup> <selectOption userInput="red" selector="{{AdminProductFormSection.customSelectField(productAttributeDropdownTwoOptions.attribute_code)}}" stepKey="selectRed"/> - <actionGroup ref="saveProductForm" stepKey="saveSecondProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSecondProduct"/> <!-- Configurable child product1: choose green as attribute value --> - <actionGroup ref="filterAndSelectProduct" stepKey="openConfigChild1Product"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="openConfigChild1Product"> <argument name="productSku" value="$$createConfigChildProduct1.sku$$"/> </actionGroup> <selectOption userInput="green" selector="{{AdminProductFormSection.customSelectField(productAttributeDropdownTwoOptions.attribute_code)}}" stepKey="selectGreenAttr"/> - <actionGroup ref="saveProductForm" stepKey="saveConfigChild1Product"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveConfigChild1Product"/> <!-- Configurable child product2: choose green as attribute value --> - <actionGroup ref="filterAndSelectProduct" stepKey="openConfigChild2Product"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="openConfigChild2Product"> <argument name="productSku" value="$$createConfigChildProduct2.sku$$"/> </actionGroup> <selectOption userInput="green" selector="{{AdminProductFormSection.customSelectField(productAttributeDropdownTwoOptions.attribute_code)}}" stepKey="selectGreenAttribute"/> - <actionGroup ref="saveProductForm" stepKey="saveConfigChild2Product"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveConfigChild2Product"/> <!-- Navigate to Marketing - Promotions - Catalog Price Rules --> <amOnPage url="{{AdminCatalogPriceRuleGridPage.url}}" stepKey="amOnCatalogPriceRule"/> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/EndToEndB2CGuestUserTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/EndToEndB2CGuestUserTest.xml index aa7cf933f6328..57940e39e9281 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/EndToEndB2CGuestUserTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/EndToEndB2CGuestUserTest.xml @@ -23,7 +23,7 @@ <waitForLoadingMaskToDisappear stepKey="waitForSearchProductsloaded" after="searchClickAdvancedSearchSubmitButton"/> <actionGroup ref="StorefrontCheckAdvancedSearchResultActionGroup" stepKey="searchCheckAdvancedSearchResult" after="waitForSearchProductsloaded"/> <see userInput="4" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.productCount}} span" stepKey="searchAdvancedAssertProductCount" after="searchCheckAdvancedSearchResult"/> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="searchAssertSimpleProduct1" after="searchAdvancedAssertProductCount"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="searchAssertSimpleProduct1" after="searchAdvancedAssertProductCount"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -31,7 +31,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$searchAdvancedGrabSimpleProduct1ImageSrc" stepKey="searchAdvancedAssertSimpleProduct1ImageNotDefault" after="searchAdvancedGrabSimpleProduct1ImageSrc"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSimpleProduct1.name$$)}}" stepKey="searchClickSimpleProduct1View" after="searchAdvancedAssertSimpleProduct1ImageNotDefault"/> <waitForLoadingMaskToDisappear stepKey="waitForSearchSimpleProduct1Viewloaded" after="searchClickSimpleProduct1View"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="searchAssertSimpleProduct1Page" after="waitForSearchSimpleProduct1Viewloaded"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="searchAssertSimpleProduct1Page" after="waitForSearchSimpleProduct1Viewloaded"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -51,14 +51,14 @@ <!-- Search simple product 1 --> <comment userInput="Search simple product 1" stepKey="commentSearchSimpleProduct1" after="searchAssertFilterCategoryProductCountCommonPart"/> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="searchAssertFilterCategorySimpleProduct1" after="commentSearchSimpleProduct1"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="searchAssertFilterCategorySimpleProduct1" after="commentSearchSimpleProduct1"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> <grabAttributeFrom selector="{{StorefrontCategoryProductSection.ProductImageByName($$createSimpleProduct1.name$$)}}" userInput="src" stepKey="searchGrabSimpleProduct1ImageSrc" after="searchAssertFilterCategorySimpleProduct1"/> <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$searchGrabSimpleProduct1ImageSrc" stepKey="searchAssertSimpleProduct1ImageNotDefault" after="searchGrabSimpleProduct1ImageSrc"/> <!-- Search simple product2 --> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="searchAssertFilterCategorySimpleProduct2" after="searchAssertSimpleProduct1ImageNotDefault"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="searchAssertFilterCategorySimpleProduct2" after="searchAssertSimpleProduct1ImageNotDefault"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -89,7 +89,7 @@ <waitForLoadingMaskToDisappear stepKey="waitForSearchProductsloaded" after="searchClickAdvancedSearchSubmitButton"/> <actionGroup ref="StorefrontCheckAdvancedSearchResultActionGroup" stepKey="searchCheckAdvancedSearchResult" after="waitForSearchProductsloaded"/> <see userInput="1" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.productCount}} span" stepKey="searchAdvancedAssertProductCount" after="searchCheckAdvancedSearchResult"/> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="searchAssertSimpleProduct1" after="searchAdvancedAssertProductCount"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="searchAssertSimpleProduct1" after="searchAdvancedAssertProductCount"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -97,7 +97,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$searchAdvancedGrabSimpleProduct1ImageSrc" stepKey="searchAdvancedAssertSimpleProduct1ImageNotDefault" after="searchAdvancedGrabSimpleProduct1ImageSrc"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSimpleProduct1.name$$)}}" stepKey="searchClickSimpleProduct1View" after="searchAdvancedAssertSimpleProduct1ImageNotDefault"/> <waitForLoadingMaskToDisappear stepKey="waitForSearchSimpleProduct1Viewloaded" after="searchClickSimpleProduct1View"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="searchAssertSimpleProduct1Page" after="waitForSearchSimpleProduct1Viewloaded"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="searchAssertSimpleProduct1Page" after="waitForSearchSimpleProduct1Viewloaded"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -117,14 +117,14 @@ <!-- Search simple product 1 --> <comment userInput="Search simple product 1" stepKey="commentSearchSimpleProduct1" after="searchAssertFilterCategoryProductCountCommonPart"/> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="searchAssertFilterCategorySimpleProduct1" after="commentSearchSimpleProduct1"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="searchAssertFilterCategorySimpleProduct1" after="commentSearchSimpleProduct1"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> <grabAttributeFrom selector="{{StorefrontCategoryProductSection.ProductImageByName($$createSimpleProduct1.name$$)}}" userInput="src" stepKey="searchGrabSimpleProduct1ImageSrc" after="searchAssertFilterCategorySimpleProduct1"/> <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$searchGrabSimpleProduct1ImageSrc" stepKey="searchAssertSimpleProduct1ImageNotDefault" after="searchGrabSimpleProduct1ImageSrc"/> <!-- Search simple product2 --> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="searchAssertFilterCategorySimpleProduct2" after="searchAssertSimpleProduct1ImageNotDefault"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="searchAssertFilterCategorySimpleProduct2" after="searchAssertSimpleProduct1ImageNotDefault"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml index 367cb6a6e214e..cd3dec912a3c1 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml @@ -23,7 +23,7 @@ <waitForLoadingMaskToDisappear stepKey="waitForSearchProductsloaded" after="searchClickAdvancedSearchSubmitButton"/> <actionGroup ref="StorefrontCheckAdvancedSearchResultActionGroup" stepKey="searchCheckAdvancedSearchResult" after="waitForSearchProductsloaded"/> <see userInput="1" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.productCount}} span" stepKey="searchAdvancedAssertProductCount" after="searchCheckAdvancedSearchResult"/> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="searchAssertSimpleProduct1" after="searchAdvancedAssertProductCount"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="searchAssertSimpleProduct1" after="searchAdvancedAssertProductCount"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -31,7 +31,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$searchAdvancedGrabSimpleProduct1ImageSrc" stepKey="searchAdvancedAssertSimpleProduct1ImageNotDefault" after="searchAdvancedGrabSimpleProduct1ImageSrc"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSimpleProduct1.name$$)}}" stepKey="searchClickSimpleProduct1View" after="searchAdvancedAssertSimpleProduct1ImageNotDefault"/> <waitForLoadingMaskToDisappear stepKey="waitForSearchSimpleProduct1Viewloaded" after="searchClickSimpleProduct1View"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="searchAssertSimpleProduct1Page" after="waitForSearchSimpleProduct1Viewloaded"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="searchAssertSimpleProduct1Page" after="waitForSearchSimpleProduct1Viewloaded"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -51,14 +51,14 @@ <!-- Search simple product 1 --> <comment userInput="Search simple product 1" stepKey="commentSearchSimpleProduct1" after="searchAssertFilterCategoryProductCountCommonPart"/> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="searchAssertFilterCategorySimpleProduct1" after="commentSearchSimpleProduct1"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="searchAssertFilterCategorySimpleProduct1" after="commentSearchSimpleProduct1"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> <grabAttributeFrom selector="{{StorefrontCategoryProductSection.ProductImageByName($$createSimpleProduct1.name$$)}}" userInput="src" stepKey="searchGrabSimpleProduct1ImageSrc" after="searchAssertFilterCategorySimpleProduct1"/> <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$searchGrabSimpleProduct1ImageSrc" stepKey="searchAssertSimpleProduct1ImageNotDefault" after="searchGrabSimpleProduct1ImageSrc"/> <!-- Search simple product2 --> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="searchAssertFilterCategorySimpleProduct2" after="searchAssertSimpleProduct1ImageNotDefault"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="searchAssertFilterCategorySimpleProduct2" after="searchAssertSimpleProduct1ImageNotDefault"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/LayerNavigationOfCatalogSearchTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/LayerNavigationOfCatalogSearchTest.xml index c8f84c732d6ba..fa9407495e6e7 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/LayerNavigationOfCatalogSearchTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/LayerNavigationOfCatalogSearchTest.xml @@ -42,7 +42,7 @@ </after> <!--Update value for price attribute of Product 1--> <comment userInput="Update value for price attribute of Product 1" stepKey="comment1"/> - <actionGroup ref="navigateToCreatedProductEditPage" stepKey="navigateToCreatedProductEditPage1"> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="navigateToCreatedProductEditPage1"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <grabTextFrom selector="{{AdminProductFormSection.attributeLabelByText($$createPriceAttribute.attribute[frontend_labels][0][label]$$)}}" stepKey="grabAttributeLabel"/> @@ -51,7 +51,7 @@ <waitForPageLoad stepKey="waitForSimpleProductSaved1"/> <!--Update value for price attribute of Product 2--> <comment userInput="Update value for price attribute of Product 1" stepKey="comment2"/> - <actionGroup ref="navigateToCreatedProductEditPage" stepKey="navigateToCreatedProductEditPage2"> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="navigateToCreatedProductEditPage2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <fillField selector="{{AdminProductAttributeSection.customAttribute($$createPriceAttribute.attribute_code$$)}}" userInput="70" stepKey="fillCustomPrice2"/> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml index 3b60e4b09de28..3aa044b650943 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml @@ -203,47 +203,47 @@ <!-- Create and Assign Attribute to product1--> - <actionGroup ref="goToProductPageViaID" stepKey="goToProduct1"> + <actionGroup ref="GoToProductPageViaIDActionGroup" stepKey="goToProduct1"> <argument name="productId" value="$product1.id$"/> </actionGroup> - <actionGroup ref="AdminCreateAttributeWithSearchWeight" stepKey="createProduct1Attribute"> + <actionGroup ref="AdminCreateAttributeWithSearchWeightActionGroup" stepKey="createProduct1Attribute"> <argument name="attributeType" value="Text Field"/> <argument name="attributeName" value="$product1.name$"/> <argument name="attributeSetName" value="$product1.name$"/> <argument name="weight" value="1"/> <argument name="defaultValue" value="{{_defaultProduct.name}}"/> </actionGroup> - <actionGroup ref="AdminProductPageSelectAttributeSet" stepKey="selectAttributeSet1"> + <actionGroup ref="AdminProductPageSelectAttributeSetActionGroup" stepKey="selectAttributeSet1"> <argument name="attributeSetName" value="$product1.name$"/> </actionGroup> <!--fill in default--> - <actionGroup ref="saveProductForm" stepKey="saveProduct1a"/> - <actionGroup ref="AdminProductPageFillTextAttributeValueByName" stepKey="fillDefault1"> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct1a"/> + <actionGroup ref="AdminProductPageFillTextAttributeValueByNameActionGroup" stepKey="fillDefault1"> <argument name="attributeName" value="$product1.name$"/> <argument name="value" value="{{_defaultProduct.name}}"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct1b"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct1b"/> <!-- Create and Assign Attribute to product2--> - <actionGroup ref="goToProductPageViaID" stepKey="goToProduct2"> + <actionGroup ref="GoToProductPageViaIDActionGroup" stepKey="goToProduct2"> <argument name="productId" value="$product2.id$"/> </actionGroup> - <actionGroup ref="AdminCreateAttributeWithSearchWeight" stepKey="createProduct2Attribute"> + <actionGroup ref="AdminCreateAttributeWithSearchWeightActionGroup" stepKey="createProduct2Attribute"> <argument name="attributeType" value="Text Field"/> <argument name="attributeName" value="$product2.name$"/> <argument name="attributeSetName" value="$product2.name$"/> <argument name="weight" value="1"/> <argument name="defaultValue" value="{{_defaultProduct.name}}"/> </actionGroup> - <actionGroup ref="AdminProductPageSelectAttributeSet" stepKey="selectAttributeSet2"> + <actionGroup ref="AdminProductPageSelectAttributeSetActionGroup" stepKey="selectAttributeSet2"> <argument name="attributeSetName" value="$product2.name$"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct2a"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct2a"/> <!--fill in default--> - <actionGroup ref="AdminProductPageFillTextAttributeValueByName" stepKey="fillDefault2"> + <actionGroup ref="AdminProductPageFillTextAttributeValueByNameActionGroup" stepKey="fillDefault2"> <argument name="attributeName" value="$product2.name$"/> <argument name="value" value="{{_defaultProduct.name}}"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct2b"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct2b"/> </before> <after> <deleteData stepKey="deleteProduct1" createDataKey="product1"/> @@ -275,7 +275,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="AdminCreateAttributeWithSearchWeight" stepKey="createProduct1Attribute"> + <actionGroup ref="AdminCreateAttributeWithSearchWeightActionGroup" stepKey="createProduct1Attribute"> <argument name="attributeType" value="Text Field"/> <argument name="attributeName" value="$product1.name$"/> <argument name="attributeSetName" value="$product1.name$"/> @@ -377,7 +377,7 @@ </before> <after> <deleteData stepKey="deleteCategory" createDataKey="createCategory"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductsGridFilters"/> @@ -446,7 +446,7 @@ </annotations> <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="deleteAllProductsUsingProductGrid" stepKey="deleteAllProducts"/> + <actionGroup ref="DeleteAllProductsUsingProductGridActionGroup" stepKey="deleteAllProducts"/> <createData entity="ApiProductWithDescription" stepKey="simple1"/> <createData entity="ApiGroupedProduct" stepKey="createProduct"/> <createData entity="OneSimpleProductLink" stepKey="addProductOne"> @@ -503,7 +503,7 @@ <!--Finish bundle creation--> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <amOnPage url="{{AdminProductEditPage.url($$createBundleProduct.id$$)}}" stepKey="goToProductEditPage"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Perform reindex and flush cache --> <magentoCLI command="indexer:reindex" stepKey="reindex"/> @@ -570,7 +570,7 @@ <!--Finish bundle creation--> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <amOnPage url="{{AdminProductEditPage.url($$createBundleProduct.id$$)}}" stepKey="goToProductEditPage"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Perform reindex and flush cache --> <magentoCLI command="indexer:reindex" stepKey="reindex"/> @@ -629,14 +629,14 @@ <!-- Assign attribute to set --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <actionGroup ref="goToAttributeGridPage" stepKey="goToPage"/> - <actionGroup ref="goToAttributeSetByName" stepKey="goToSet"> + <actionGroup ref="GoToAttributeSetByNameActionGroup" stepKey="goToSet"> <argument name="name" value="$attributeSet.attribute_set_name$"/> </actionGroup> - <actionGroup ref="AssignAttributeToGroup" stepKey="assignToAttributeSetAndGroup"> + <actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignToAttributeSetAndGroup"> <argument name="group" value="Product Details"/> <argument name="attribute" value="$createConfigProductAttribute.attribute_code$"/> </actionGroup> - <actionGroup ref="SaveAttributeSet" stepKey="savePage"/> + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="savePage"/> <!-- Get the first option of the attribute we created --> <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1"> @@ -682,11 +682,11 @@ </actionGroup> <!-- Disable Child Product --> - <actionGroup ref="goToProductPageViaID" stepKey="goToChildProduct"> + <actionGroup ref="GoToProductPageViaIDActionGroup" stepKey="goToChildProduct"> <argument name="productId" value="$createConfigChildProduct1.id$"/> </actionGroup> - <actionGroup ref="toggleProductEnabled" stepKey="disableProduct"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="ToggleProductEnabledActionGroup" stepKey="disableProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToFrontPageAgain"/> <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchStorefrontAgain"> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontAdvancedSearchEntitySimpleProductTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontAdvancedSearchEntitySimpleProductTest.xml index 14df2133017d9..61f274cd13061 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontAdvancedSearchEntitySimpleProductTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontAdvancedSearchEntitySimpleProductTest.xml @@ -21,7 +21,7 @@ <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!-- Delete all products left by prev tests because it sensitive for search--> - <actionGroup ref="deleteAllProductsUsingProductGrid" stepKey="deleteAllProducts"/> + <actionGroup ref="DeleteAllProductsUsingProductGridActionGroup" stepKey="deleteAllProducts"/> <!-- Create Data --> <createData entity="ABC_dfj_SimpleProduct" stepKey="createProduct"/> </before> diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminCategoryWithRestrictedUrlKeyNotCreatedTest.xml b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminCategoryWithRestrictedUrlKeyNotCreatedTest.xml index 58b489da5082b..c3c7e3c3281f4 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminCategoryWithRestrictedUrlKeyNotCreatedTest.xml +++ b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminCategoryWithRestrictedUrlKeyNotCreatedTest.xml @@ -24,36 +24,36 @@ <after> <!--Delete created categories--> <comment userInput="Delete created categories" stepKey="commentDeleteCreatedCategories"/> - <actionGroup ref="AdminDeleteCategoryByName" stepKey="deleteAdminCategory"> + <actionGroup ref="AdminDeleteCategoryByNameActionGroup" stepKey="deleteAdminCategory"> <argument name="categoryName" value="admin"/> </actionGroup> - <actionGroup ref="AdminDeleteCategoryByName" stepKey="deleteSoapCategory"> + <actionGroup ref="AdminDeleteCategoryByNameActionGroup" stepKey="deleteSoapCategory"> <argument name="categoryName" value="soap"/> </actionGroup> - <actionGroup ref="AdminDeleteCategoryByName" stepKey="deleteRestCategory"> + <actionGroup ref="AdminDeleteCategoryByNameActionGroup" stepKey="deleteRestCategory"> <argument name="categoryName" value="rest"/> </actionGroup> - <actionGroup ref="AdminDeleteCategoryByName" stepKey="deleteGraphQlCategory"> + <actionGroup ref="AdminDeleteCategoryByNameActionGroup" stepKey="deleteGraphQlCategory"> <argument name="categoryName" value="graphql"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> </after> <!--Check category creation with restricted url key 'admin'--> <comment userInput="Check category creation with restricted url key 'admin'" stepKey="commentCheckAdminCategoryCreation"/> - <actionGroup ref="goToCreateCategoryPage" stepKey="goToCreateAdminCategoryPage"/> - <actionGroup ref="FillCategoryNameAndUrlKeyAndSave" stepKey="fillAdminFirstCategoryForm"> + <actionGroup ref="GoToCreateCategoryPageActionGroup" stepKey="goToCreateAdminCategoryPage"/> + <actionGroup ref="FillCategoryNameAndUrlKeyAndSaveActionGroup" stepKey="fillAdminFirstCategoryForm"> <argument name="categoryName" value="admin"/> <argument name="categoryUrlKey" value=""/> </actionGroup> <see selector="{{AdminMessagesSection.error}}" userInput='{{AdminCategoryRestrictedUrlErrorMessage.urlAdmin}}' stepKey="seeAdminFirstErrorMessage"/> - <actionGroup ref="FillCategoryNameAndUrlKeyAndSave" stepKey="fillAdminSecondCategoryForm"> + <actionGroup ref="FillCategoryNameAndUrlKeyAndSaveActionGroup" stepKey="fillAdminSecondCategoryForm"> <argument name="categoryName" value="{{SimpleSubCategory.name}}"/> <argument name="categoryUrlKey" value="admin"/> </actionGroup> <see selector="{{AdminMessagesSection.error}}" userInput='{{AdminCategoryRestrictedUrlErrorMessage.urlAdmin}}' stepKey="seeAdminSecondErrorMessage"/> <!--Create category with 'admin' name--> <comment userInput="Create category with 'admin' name" stepKey="commentAdminCategoryCreation"/> - <actionGroup ref="FillCategoryNameAndUrlKeyAndSave" stepKey="fillAdminThirdCategoryForm"> + <actionGroup ref="FillCategoryNameAndUrlKeyAndSaveActionGroup" stepKey="fillAdminThirdCategoryForm"> <argument name="categoryName" value="admin"/> <argument name="categoryUrlKey" value="{{SimpleSubCategory.name}}"/> </actionGroup> @@ -61,20 +61,20 @@ <seeElement selector="{{AdminCategorySidebarTreeSection.categoryByName('admin')}}" stepKey="seeAdminCategoryInTree"/> <!--Check category creation with restricted url key 'soap'--> <comment userInput="Check category creation with restricted url key 'soap'" stepKey="commentCheckSoapCategoryCreation"/> - <actionGroup ref="goToCreateCategoryPage" stepKey="goToCreateSoapCategoryPage"/> - <actionGroup ref="FillCategoryNameAndUrlKeyAndSave" stepKey="fillSoapFirstCategoryForm"> + <actionGroup ref="GoToCreateCategoryPageActionGroup" stepKey="goToCreateSoapCategoryPage"/> + <actionGroup ref="FillCategoryNameAndUrlKeyAndSaveActionGroup" stepKey="fillSoapFirstCategoryForm"> <argument name="categoryName" value="soap"/> <argument name="categoryUrlKey" value=""/> </actionGroup> <see selector="{{AdminMessagesSection.error}}" userInput='{{AdminCategoryRestrictedUrlErrorMessage.urlSoap}}' stepKey="seeSoapFirstErrorMessage"/> - <actionGroup ref="FillCategoryNameAndUrlKeyAndSave" stepKey="fillSoapSecondCategoryForm"> + <actionGroup ref="FillCategoryNameAndUrlKeyAndSaveActionGroup" stepKey="fillSoapSecondCategoryForm"> <argument name="categoryName" value="{{ApiCategory.name}}"/> <argument name="categoryUrlKey" value="soap"/> </actionGroup> <see selector="{{AdminMessagesSection.error}}" userInput='{{AdminCategoryRestrictedUrlErrorMessage.urlSoap}}' stepKey="seeSoapSecondErrorMessage"/> <!--Create category with 'soap' name--> <comment userInput="Create category with 'soap' name" stepKey="commentSoapCategoryCreation"/> - <actionGroup ref="FillCategoryNameAndUrlKeyAndSave" stepKey="fillSoapThirdCategoryForm"> + <actionGroup ref="FillCategoryNameAndUrlKeyAndSaveActionGroup" stepKey="fillSoapThirdCategoryForm"> <argument name="categoryName" value="soap"/> <argument name="categoryUrlKey" value="{{ApiCategory.name}}"/> </actionGroup> @@ -82,20 +82,20 @@ <seeElement selector="{{AdminCategorySidebarTreeSection.categoryByName('soap')}}" stepKey="seeSoapCategoryInTree"/> <!--Check category creation with restricted url key 'rest'--> <comment userInput="Check category creation with restricted url key 'rest'" stepKey="commentCheckRestCategoryCreation"/> - <actionGroup ref="goToCreateCategoryPage" stepKey="goToCreateRestCategoryPage"/> - <actionGroup ref="FillCategoryNameAndUrlKeyAndSave" stepKey="fillRestFirstCategoryForm"> + <actionGroup ref="GoToCreateCategoryPageActionGroup" stepKey="goToCreateRestCategoryPage"/> + <actionGroup ref="FillCategoryNameAndUrlKeyAndSaveActionGroup" stepKey="fillRestFirstCategoryForm"> <argument name="categoryName" value="rest"/> <argument name="categoryUrlKey" value=""/> </actionGroup> <see selector="{{AdminMessagesSection.error}}" userInput='{{AdminCategoryRestrictedUrlErrorMessage.urlRest}}' stepKey="seeRestFirstErrorMessage"/> - <actionGroup ref="FillCategoryNameAndUrlKeyAndSave" stepKey="fillRestSecondCategoryForm"> + <actionGroup ref="FillCategoryNameAndUrlKeyAndSaveActionGroup" stepKey="fillRestSecondCategoryForm"> <argument name="categoryName" value="{{SubCategoryWithParent.name}}"/> <argument name="categoryUrlKey" value="rest"/> </actionGroup> <see selector="{{AdminMessagesSection.error}}" userInput='{{AdminCategoryRestrictedUrlErrorMessage.urlRest}}' stepKey="seeRestSecondErrorMessage"/> <!--Create category with 'rest' name--> <comment userInput="Create category with 'rest' name" stepKey="commentRestCategoryCreation"/> - <actionGroup ref="FillCategoryNameAndUrlKeyAndSave" stepKey="fillRestThirdCategoryForm"> + <actionGroup ref="FillCategoryNameAndUrlKeyAndSaveActionGroup" stepKey="fillRestThirdCategoryForm"> <argument name="categoryName" value="rest"/> <argument name="categoryUrlKey" value="{{SubCategoryWithParent.name}}"/> </actionGroup> @@ -103,20 +103,20 @@ <seeElement selector="{{AdminCategorySidebarTreeSection.categoryByName('rest')}}" stepKey="seeRestCategoryInTree"/> <!--Check category creation with restricted url key 'graphql'--> <comment userInput="Check category creation with restricted url key 'graphql'" stepKey="commentCheckGraphQlCategoryCreation"/> - <actionGroup ref="goToCreateCategoryPage" stepKey="goToCreateCategoryPage"/> - <actionGroup ref="FillCategoryNameAndUrlKeyAndSave" stepKey="fillGraphQlFirstCategoryForm"> + <actionGroup ref="GoToCreateCategoryPageActionGroup" stepKey="goToCreateCategoryPage"/> + <actionGroup ref="FillCategoryNameAndUrlKeyAndSaveActionGroup" stepKey="fillGraphQlFirstCategoryForm"> <argument name="categoryName" value="graphql"/> <argument name="categoryUrlKey" value=""/> </actionGroup> <see selector="{{AdminMessagesSection.error}}" userInput='{{AdminCategoryRestrictedUrlErrorMessage.urlGraphql}}' stepKey="seeGraphQlFirstErrorMessage"/> - <actionGroup ref="FillCategoryNameAndUrlKeyAndSave" stepKey="fillGraphQlSecondCategoryForm"> + <actionGroup ref="FillCategoryNameAndUrlKeyAndSaveActionGroup" stepKey="fillGraphQlSecondCategoryForm"> <argument name="categoryName" value="{{NewSubCategoryWithParent.name}}"/> <argument name="categoryUrlKey" value="graphql"/> </actionGroup> <see selector="{{AdminMessagesSection.error}}" userInput='{{AdminCategoryRestrictedUrlErrorMessage.urlGraphql}}' stepKey="seeGraphQlSecondErrorMessage"/> <!--Create category with 'graphql' name--> <comment userInput="Create category with 'graphql' name" stepKey="commentGraphQlCategoryCreation"/> - <actionGroup ref="FillCategoryNameAndUrlKeyAndSave" stepKey="fillGraphQlThirdCategoryForm"> + <actionGroup ref="FillCategoryNameAndUrlKeyAndSaveActionGroup" stepKey="fillGraphQlThirdCategoryForm"> <argument name="categoryName" value="graphql"/> <argument name="categoryUrlKey" value="{{NewSubCategoryWithParent.name}}"/> </actionGroup> diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminUrlForProductRewrittenCorrectlyTest.xml b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminUrlForProductRewrittenCorrectlyTest.xml index 5423267676507..cc5f09faca57b 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminUrlForProductRewrittenCorrectlyTest.xml +++ b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminUrlForProductRewrittenCorrectlyTest.xml @@ -41,7 +41,7 @@ <waitForPageLoad stepKey="waitForEditPage"/> <!--Switch to Default Store view--> - <actionGroup ref="SwitchToTheNewStoreView" stepKey="selectSecondStoreView"> + <actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="selectSecondStoreView"> <argument name="storeViewName" value="Default Store View"/> </actionGroup> <waitForPageLoad stepKey="waitForStoreViewLoad"/> @@ -51,12 +51,12 @@ <waitForElementVisible selector="{{AdminProductSEOSection.useDefaultUrl}}" stepKey="waitForUseDefaultUrlCheckbox"/> <click selector="{{AdminProductSEOSection.useDefaultUrl}}" stepKey="clickUseDefaultUrlCheckbox"/> <fillField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="$$createProduct.sku$$-new" stepKey="changeUrlKey"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!--Select product and go toUpdate Attribute page--> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="GoToCatalogPageChangingView"/> <waitForPageLoad stepKey="WaitForPageToLoadFullyChangingView"/> - <actionGroup ref="filterProductGridByName" stepKey="filterBundleProductOptionsDownToName"> + <actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterBundleProductOptionsDownToName"> <argument name="product" value="ApiSimpleProduct"/> </actionGroup> <click selector="{{AdminProductFiltersSection.allCheckbox}}" stepKey="ClickOnSelectAllCheckBoxChangingView"/> diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/RewriteStoreLevelUrlKeyOfChildCategoryTest.xml b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/RewriteStoreLevelUrlKeyOfChildCategoryTest.xml index 67870c51140a6..c3a358bbbd292 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/RewriteStoreLevelUrlKeyOfChildCategoryTest.xml +++ b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/RewriteStoreLevelUrlKeyOfChildCategoryTest.xml @@ -1,67 +1,67 @@ -<?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="RewriteStoreLevelUrlKeyOfChildCategoryTest"> - <annotations> - <title value="Rewriting Store-level URL key of child category"/> - <stories value="MAGETWO-91649: #13513: Magento ignore store-level url_key of child category in URL rewrite process for global scope"/> - <description value="Rewriting Store-level URL key of child category"/> - <features value="CatalogUrlRewrite"/> - <severity value="MAJOR"/> - <testCaseId value="MAGETWO-94934"/> - <group value="CatalogUrlRewrite"/> - </annotations> - - <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView" /> - - <createData entity="_defaultCategory" stepKey="defaultCategory"/> - <createData entity="SubCategoryWithParent" stepKey="subCategory"> - <requiredEntity createDataKey="defaultCategory"/> - </createData> - </before> - - <actionGroup ref="navigateToCreatedCategory" stepKey="navigateToCreatedSubCategory"> - <argument name="Category" value="$$subCategory$$"/> - </actionGroup> - - <actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="AdminSwitchStoreViewForSubCategory"/> - - <actionGroup ref="ChangeSeoUrlKeyForSubCategory" stepKey="changeSeoUrlKeyForSubCategory"> - <argument name="value" value="bags-second"/> - </actionGroup> - - <actionGroup ref="navigateToCreatedCategory" stepKey="navigateToCreatedDefaultCategory"> - <argument name="Category" value="$$defaultCategory$$"/> - </actionGroup> - - <actionGroup ref="ChangeSeoUrlKey" stepKey="changeSeoUrlKeyForDefaultCategory"> - <argument name="value" value="gear-global"/> - </actionGroup> - - <amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToStorefrontPage"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - - <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="storefrontSwitchStoreView"/> - - <actionGroup ref="GoToSubCategoryPage" stepKey="goToSubCategoryPage"> - <argument name="parentCategory" value="$$defaultCategory$$"/> - <argument name="subCategory" value="$$subCategory$$"/> - <argument name="urlPath" value="gear-global/bags-second"/> - </actionGroup> - - <after> - <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView"/> - <actionGroup ref="logout" stepKey="logout"/> - - <deleteData createDataKey="subCategory" stepKey="deleteSubCategory"/> - <deleteData createDataKey="defaultCategory" stepKey="deleteNewRootCategory"/> - </after> - </test> -</tests> +<?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="RewriteStoreLevelUrlKeyOfChildCategoryTest"> + <annotations> + <title value="Rewriting Store-level URL key of child category"/> + <stories value="MAGETWO-91649: #13513: Magento ignore store-level url_key of child category in URL rewrite process for global scope"/> + <description value="Rewriting Store-level URL key of child category"/> + <features value="CatalogUrlRewrite"/> + <severity value="MAJOR"/> + <testCaseId value="MAGETWO-94934"/> + <group value="CatalogUrlRewrite"/> + </annotations> + + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView" /> + + <createData entity="_defaultCategory" stepKey="defaultCategory"/> + <createData entity="SubCategoryWithParent" stepKey="subCategory"> + <requiredEntity createDataKey="defaultCategory"/> + </createData> + </before> + + <actionGroup ref="NavigateToCreatedCategoryActionGroup" stepKey="navigateToCreatedSubCategory"> + <argument name="Category" value="$$subCategory$$"/> + </actionGroup> + + <actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="AdminSwitchStoreViewForSubCategory"/> + + <actionGroup ref="ChangeSeoUrlKeyForSubCategoryActionGroup" stepKey="changeSeoUrlKeyForSubCategory"> + <argument name="value" value="bags-second"/> + </actionGroup> + + <actionGroup ref="NavigateToCreatedCategoryActionGroup" stepKey="navigateToCreatedDefaultCategory"> + <argument name="Category" value="$$defaultCategory$$"/> + </actionGroup> + + <actionGroup ref="ChangeSeoUrlKeyActionGroup" stepKey="changeSeoUrlKeyForDefaultCategory"> + <argument name="value" value="gear-global"/> + </actionGroup> + + <amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToStorefrontPage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + + <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="storefrontSwitchStoreView"/> + + <actionGroup ref="GoToSubCategoryPageActionGroup" stepKey="goToSubCategoryPage"> + <argument name="parentCategory" value="$$defaultCategory$$"/> + <argument name="subCategory" value="$$subCategory$$"/> + <argument name="urlPath" value="gear-global/bags-second"/> + </actionGroup> + + <after> + <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView"/> + <actionGroup ref="logout" stepKey="logout"/> + + <deleteData createDataKey="subCategory" stepKey="deleteSubCategory"/> + <deleteData createDataKey="defaultCategory" stepKey="deleteNewRootCategory"/> + </after> + </test> +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/CheckCheckoutSuccessPageTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/CheckCheckoutSuccessPageTest.xml index 163e71c50053f..971af9688e754 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/CheckCheckoutSuccessPageTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/CheckCheckoutSuccessPageTest.xml @@ -45,7 +45,7 @@ <waitForPageLoad stepKey="waitForCatalogPageLoad"/> <!--Add Product to Shopping Cart--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$$createSimpleProduct.name$$"/> </actionGroup> @@ -71,7 +71,7 @@ <waitForPageLoad stepKey="waitForCatalogPageLoad2"/> <!--Add Product to Shopping Cart--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage2"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage2"> <argument name="productName" value="$$createSimpleProduct.name$$"/> </actionGroup> @@ -96,7 +96,7 @@ <waitForPageLoad stepKey="waitForCatalogPageLoad3"/> <!--Add Product to Shopping Cart--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage3"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage3"> <argument name="productName" value="$$createSimpleProduct.name$$"/> </actionGroup> @@ -156,7 +156,7 @@ <waitForPageLoad stepKey="waitForCatalogPageLoad"/> <!--Add Product to Shopping Cart--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$$createSimpleProduct.name$$"/> </actionGroup> @@ -193,7 +193,7 @@ <waitForPageLoad stepKey="waitForCatalogPageLoad2"/> <!--Add Product to Shopping Cart--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage2"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage2"> <argument name="productName" value="$$createSimpleProduct.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/CheckNotVisibleProductInMinicartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/CheckNotVisibleProductInMinicartTest.xml index 4b4ca1935fd78..f99678d9171b2 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/CheckNotVisibleProductInMinicartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/CheckNotVisibleProductInMinicartTest.xml @@ -27,7 +27,7 @@ <waitForPageLoad stepKey="waitForCatalogPageLoad"/> <!--Add simple product1 to Shopping Cart--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage1"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage1"> <argument name="productName" value="$$createSimpleProduct1.name$$"/> </actionGroup> @@ -47,7 +47,7 @@ <waitForPageLoad stepKey="waitForCatalogPageLoad2"/> <!--Add simple product2 to Shopping Cart for updating cart items--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage2"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage2"> <argument name="productName" value="$$createSimpleProduct2.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/ConfiguringInstantPurchaseFunctionalityTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/ConfiguringInstantPurchaseFunctionalityTest.xml index 0897e20f1b17d..aea0657cc2e3b 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/ConfiguringInstantPurchaseFunctionalityTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/ConfiguringInstantPurchaseFunctionalityTest.xml @@ -64,7 +64,7 @@ </actionGroup> <!-- Add product to cart --> - <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> <argument name="product" value="$$createProduct$$"/> </actionGroup> <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/DefaultBillingAddressShouldBeCheckedOnPaymentPageTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/DefaultBillingAddressShouldBeCheckedOnPaymentPageTest.xml index 166f5022d5aeb..c3fb83cd1a096 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/DefaultBillingAddressShouldBeCheckedOnPaymentPageTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/DefaultBillingAddressShouldBeCheckedOnPaymentPageTest.xml @@ -38,7 +38,7 @@ <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/> </after> <!-- Add simple product to cart and go to checkout--> - <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> <argument name="product" value="$$createProduct$$"/> </actionGroup> <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/DeleteBundleDynamicProductFromShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/DeleteBundleDynamicProductFromShoppingCartTest.xml index 5ad4c764026f7..ef5f5b640b0a2 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/DeleteBundleDynamicProductFromShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/DeleteBundleDynamicProductFromShoppingCartTest.xml @@ -55,7 +55,7 @@ <!-- Add product to the cart --> <click selector="{{StorefrontBundleProductActionSection.customizeAndAddToCartButton}}" stepKey="clickCustomizeAndAddToCart"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProductToCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProductToCart"> <argument name="productName" value="$$createBundleDynamicProduct.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/DeleteBundleFixedProductFromShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/DeleteBundleFixedProductFromShoppingCartTest.xml index d1008c5831983..e141d0628cc4d 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/DeleteBundleFixedProductFromShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/DeleteBundleFixedProductFromShoppingCartTest.xml @@ -47,7 +47,7 @@ <!-- Add product to the cart --> <click selector="{{StorefrontBundleProductActionSection.customizeAndAddToCartButton}}" stepKey="clickCustomizeAndAddToCart"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProductToCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProductToCart"> <argument name="productName" value="$$createFixedBundleProduct.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/DeleteDownloadableProductFromShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/DeleteDownloadableProductFromShoppingCartTest.xml index e16ef70c23e3d..988e3b8d3129d 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/DeleteDownloadableProductFromShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/DeleteDownloadableProductFromShoppingCartTest.xml @@ -39,7 +39,7 @@ <!-- Add downloadable product to the cart --> <amOnPage url="{{StorefrontProductPage.url($$createDownloadableProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToDownloadableProductPage"/> <waitForPageLoad stepKey="waitForDownloadableProductPageLoad"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartDownloadableProductFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartDownloadableProductFromStorefrontProductPage"> <argument name="productName" value="$$createDownloadableProduct.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/DeleteVirtualProductFromShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/DeleteVirtualProductFromShoppingCartTest.xml index 97dcdd52127fd..969a827a8a461 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/DeleteVirtualProductFromShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/DeleteVirtualProductFromShoppingCartTest.xml @@ -33,7 +33,7 @@ <!-- Add virtual product to the cart --> <amOnPage url="{{StorefrontProductPage.url($$createVirtualProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartVirtualProductFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartVirtualProductFromStorefrontProductPage"> <argument name="productName" value="$$createVirtualProduct.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/EndToEndB2CGuestUserTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/EndToEndB2CGuestUserTest.xml index 4281a0eb77da8..7002479279a78 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/EndToEndB2CGuestUserTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/EndToEndB2CGuestUserTest.xml @@ -19,7 +19,7 @@ <argument name="category" value="$$createCategory$$"/> <argument name="productCount" value="3"/> </actionGroup> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="cartAssertSimpleProduct1" after="cartAssertCategory"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="cartAssertSimpleProduct1" after="cartAssertCategory"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -27,7 +27,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$cartGrabSimpleProduct1ImageSrc" stepKey="cartAssertSimpleProduct1ImageNotDefault" after="cartGrabSimpleProduct1ImageSrc"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSimpleProduct1.name$$)}}" stepKey="cartClickSimpleProduct1" after="cartAssertSimpleProduct1ImageNotDefault"/> <waitForLoadingMaskToDisappear stepKey="waitForCartSimpleProduct1loaded" after="cartClickSimpleProduct1"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="cartAssertProduct1Page" after="waitForCartSimpleProduct1loaded"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="cartAssertProduct1Page" after="waitForCartSimpleProduct1loaded"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -46,7 +46,7 @@ <argument name="category" value="$$createCategory$$"/> <argument name="productCount" value="3"/> </actionGroup> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="cartAssertSimpleProduct2" after="cartAssertCategory1ForSimpleProduct2"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="cartAssertSimpleProduct2" after="cartAssertCategory1ForSimpleProduct2"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -69,7 +69,7 @@ <assertNotRegExp expected="'/placeholder\/thumbnail\.jpg/'" actual="$cartMinicartGrabSimpleProduct1ImageSrc" stepKey="cartMinicartAssertSimpleProduct1ImageNotDefault" after="cartMinicartGrabSimpleProduct1ImageSrc"/> <click selector="{{StorefrontMinicartSection.productLinkByName($$createSimpleProduct1.name$$)}}" stepKey="cartMinicartClickSimpleProduct1" after="cartMinicartAssertSimpleProduct1ImageNotDefault"/> <waitForLoadingMaskToDisappear stepKey="waitForMinicartSimpleProduct1loaded" after="cartMinicartClickSimpleProduct1"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="cartAssertMinicartProduct1Page" after="waitForMinicartSimpleProduct1loaded"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="cartAssertMinicartProduct1Page" after="waitForMinicartSimpleProduct1loaded"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -85,7 +85,7 @@ <assertNotRegExp expected="'/placeholder\/thumbnail\.jpg/'" actual="$cartMinicartGrabSimpleProduct2ImageSrc" stepKey="cartMinicartAssertSimpleProduct2ImageNotDefault" after="cartMinicartGrabSimpleProduct2ImageSrc"/> <click selector="{{StorefrontMinicartSection.productLinkByName($$createSimpleProduct2.name$$)}}" stepKey="cartMinicartClickSimpleProduct2" after="cartMinicartAssertSimpleProduct2ImageNotDefault"/> <waitForLoadingMaskToDisappear stepKey="waitForMinicartSimpleProduct2loaded" after="cartMinicartClickSimpleProduct2"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="cartAssertMinicartProduct2Page" after="waitForMinicartSimpleProduct2loaded"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="cartAssertMinicartProduct2Page" after="waitForMinicartSimpleProduct2loaded"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -114,7 +114,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$cartCartGrabSimpleProduct1ImageSrc" stepKey="cartCartAssertSimpleProduct1ImageNotDefault" after="cartCartGrabSimpleProduct1ImageSrc"/> <click selector="{{CheckoutCartProductSection.ProductLinkByName($$createSimpleProduct1.name$$)}}" stepKey="cartClickCartSimpleProduct1" after="cartCartAssertSimpleProduct1ImageNotDefault"/> <waitForLoadingMaskToDisappear stepKey="waitForCartSimpleProduct1loadedAgain" after="cartClickCartSimpleProduct1"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="cartAssertCartProduct1Page" after="waitForCartSimpleProduct1loadedAgain"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="cartAssertCartProduct1Page" after="waitForCartSimpleProduct1loadedAgain"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -134,7 +134,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$cartCartGrabSimpleProduct2ImageSrc" stepKey="cartCartAssertSimpleProduct2ImageNotDefault" after="cartCartGrabSimpleProduct2ImageSrc"/> <click selector="{{CheckoutCartProductSection.ProductLinkByName($$createSimpleProduct2.name$$)}}" stepKey="cartClickCartSimpleProduct2" after="cartCartAssertSimpleProduct2ImageNotDefault"/> <waitForLoadingMaskToDisappear stepKey="waitForCartSimpleProduct2loaded" after="cartClickCartSimpleProduct2"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="cartAssertCartProduct2Page" after="waitForCartSimpleProduct2loaded"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="cartAssertCartProduct2Page" after="waitForCartSimpleProduct2loaded"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -207,7 +207,7 @@ <argument name="category" value="$$createCategory$$"/> <argument name="productCount" value="3"/> </actionGroup> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="cartAssertSimpleProduct1" after="cartAssertCategory"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="cartAssertSimpleProduct1" after="cartAssertCategory"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -215,7 +215,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$cartGrabSimpleProduct1ImageSrc" stepKey="cartAssertSimpleProduct1ImageNotDefault" after="cartGrabSimpleProduct1ImageSrc"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSimpleProduct1.name$$)}}" stepKey="cartClickSimpleProduct1" after="cartAssertSimpleProduct1ImageNotDefault"/> <waitForLoadingMaskToDisappear stepKey="waitForCartSimpleProduct1loaded" after="cartClickSimpleProduct1"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="cartAssertProduct1Page" after="waitForCartSimpleProduct1loaded"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="cartAssertProduct1Page" after="waitForCartSimpleProduct1loaded"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -234,7 +234,7 @@ <argument name="category" value="$$createCategory$$"/> <argument name="productCount" value="3"/> </actionGroup> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="cartAssertSimpleProduct2" after="cartAssertCategory1ForSimpleProduct2"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="cartAssertSimpleProduct2" after="cartAssertCategory1ForSimpleProduct2"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -257,7 +257,7 @@ <assertNotRegExp expected="'/placeholder\/thumbnail\.jpg/'" actual="$cartMinicartGrabSimpleProduct1ImageSrc" stepKey="cartMinicartAssertSimpleProduct1ImageNotDefault" after="cartMinicartGrabSimpleProduct1ImageSrc"/> <click selector="{{StorefrontMinicartSection.productLinkByName($$createSimpleProduct1.name$$)}}" stepKey="cartMinicartClickSimpleProduct1" after="cartMinicartAssertSimpleProduct1ImageNotDefault"/> <waitForLoadingMaskToDisappear stepKey="waitForMinicartSimpleProduct1loaded" after="cartMinicartClickSimpleProduct1"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="cartAssertMinicartProduct1Page" after="waitForMinicartSimpleProduct1loaded"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="cartAssertMinicartProduct1Page" after="waitForMinicartSimpleProduct1loaded"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -273,7 +273,7 @@ <assertNotRegExp expected="'/placeholder\/thumbnail\.jpg/'" actual="$cartMinicartGrabSimpleProduct2ImageSrc" stepKey="cartMinicartAssertSimpleProduct2ImageNotDefault" after="cartMinicartGrabSimpleProduct2ImageSrc"/> <click selector="{{StorefrontMinicartSection.productLinkByName($$createSimpleProduct2.name$$)}}" stepKey="cartMinicartClickSimpleProduct2" after="cartMinicartAssertSimpleProduct2ImageNotDefault"/> <waitForLoadingMaskToDisappear stepKey="waitForMinicartSimpleProduct2loaded" after="cartMinicartClickSimpleProduct2"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="cartAssertMinicartProduct2Page" after="waitForMinicartSimpleProduct2loaded"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="cartAssertMinicartProduct2Page" after="waitForMinicartSimpleProduct2loaded"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -302,7 +302,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$cartCartGrabSimpleProduct1ImageSrc" stepKey="cartCartAssertSimpleProduct1ImageNotDefault" after="cartCartGrabSimpleProduct1ImageSrc"/> <click selector="{{CheckoutCartProductSection.ProductLinkByName($$createSimpleProduct1.name$$)}}" stepKey="cartClickCartSimpleProduct1" after="cartCartAssertSimpleProduct1ImageNotDefault"/> <waitForLoadingMaskToDisappear stepKey="waitForCartSimpleProduct1loadedAgain" after="cartClickCartSimpleProduct1"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="cartAssertCartProduct1Page" after="waitForCartSimpleProduct1loadedAgain"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="cartAssertCartProduct1Page" after="waitForCartSimpleProduct1loadedAgain"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -322,7 +322,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$cartCartGrabSimpleProduct2ImageSrc" stepKey="cartCartAssertSimpleProduct2ImageNotDefault" after="cartCartGrabSimpleProduct2ImageSrc"/> <click selector="{{CheckoutCartProductSection.ProductLinkByName($$createSimpleProduct2.name$$)}}" stepKey="cartClickCartSimpleProduct2" after="cartCartAssertSimpleProduct2ImageNotDefault"/> <waitForLoadingMaskToDisappear stepKey="waitForCartSimpleProduct2loaded" after="cartClickCartSimpleProduct2"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="cartAssertCartProduct2Page" after="waitForCartSimpleProduct2loaded"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="cartAssertCartProduct2Page" after="waitForCartSimpleProduct2loaded"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml index 65627787e2a05..6df859c9972c3 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml @@ -19,7 +19,7 @@ <argument name="category" value="$$createCategory$$"/> <argument name="productCount" value="3"/> </actionGroup> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="cartAssertSimpleProduct1" after="cartAssertCategory"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="cartAssertSimpleProduct1" after="cartAssertCategory"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -27,7 +27,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$cartGrabSimpleProduct1ImageSrc" stepKey="cartAssertSimpleProduct1ImageNotDefault" after="cartGrabSimpleProduct1ImageSrc"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSimpleProduct1.name$$)}}" stepKey="cartClickSimpleProduct1" after="cartAssertSimpleProduct1ImageNotDefault"/> <waitForLoadingMaskToDisappear stepKey="waitForCartSimpleProduct1loaded" after="cartClickSimpleProduct1"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="cartAssertProduct1Page" after="waitForCartSimpleProduct1loaded"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="cartAssertProduct1Page" after="waitForCartSimpleProduct1loaded"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -46,7 +46,7 @@ <argument name="category" value="$$createCategory$$"/> <argument name="productCount" value="3"/> </actionGroup> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="cartAssertSimpleProduct2" after="cartAssertCategory1ForSimpleProduct2"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="cartAssertSimpleProduct2" after="cartAssertCategory1ForSimpleProduct2"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -69,7 +69,7 @@ <assertNotRegExp expected="'/placeholder\/thumbnail\.jpg/'" actual="$cartMinicartGrabSimpleProduct1ImageSrc" stepKey="cartMinicartAssertSimpleProduct1ImageNotDefault" after="cartMinicartGrabSimpleProduct1ImageSrc"/> <click selector="{{StorefrontMinicartSection.productLinkByName($$createSimpleProduct1.name$$)}}" stepKey="cartMinicartClickSimpleProduct1" after="cartMinicartAssertSimpleProduct1ImageNotDefault"/> <waitForLoadingMaskToDisappear stepKey="waitForMinicartSimpleProduct1loaded" after="cartMinicartClickSimpleProduct1"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="cartAssertMinicartProduct1Page" after="waitForMinicartSimpleProduct1loaded"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="cartAssertMinicartProduct1Page" after="waitForMinicartSimpleProduct1loaded"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -85,7 +85,7 @@ <assertNotRegExp expected="'/placeholder\/thumbnail\.jpg/'" actual="$cartMinicartGrabSimpleProduct2ImageSrc" stepKey="cartMinicartAssertSimpleProduct2ImageNotDefault" after="cartMinicartGrabSimpleProduct2ImageSrc"/> <click selector="{{StorefrontMinicartSection.productLinkByName($$createSimpleProduct2.name$$)}}" stepKey="cartMinicartClickSimpleProduct2" after="cartMinicartAssertSimpleProduct2ImageNotDefault"/> <waitForLoadingMaskToDisappear stepKey="waitForMinicartSimpleProduct2loaded" after="cartMinicartClickSimpleProduct2"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="cartAssertMinicartProduct2Page" after="waitForMinicartSimpleProduct2loaded"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="cartAssertMinicartProduct2Page" after="waitForMinicartSimpleProduct2loaded"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -114,7 +114,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$cartCartGrabSimpleProduct1ImageSrc" stepKey="cartCartAssertSimpleProduct1ImageNotDefault" after="cartCartGrabSimpleProduct1ImageSrc"/> <click selector="{{CheckoutCartProductSection.ProductLinkByName($$createSimpleProduct1.name$$)}}" stepKey="cartClickCartSimpleProduct1" after="cartCartAssertSimpleProduct1ImageNotDefault"/> <waitForLoadingMaskToDisappear stepKey="waitForCartSimpleProduct1loadedAgain" after="cartClickCartSimpleProduct1"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="cartAssertCartProduct1Page" after="waitForCartSimpleProduct1loadedAgain"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="cartAssertCartProduct1Page" after="waitForCartSimpleProduct1loadedAgain"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -134,7 +134,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$cartCartGrabSimpleProduct2ImageSrc" stepKey="cartCartAssertSimpleProduct2ImageNotDefault" after="cartCartGrabSimpleProduct2ImageSrc"/> <click selector="{{CheckoutCartProductSection.ProductLinkByName($$createSimpleProduct2.name$$)}}" stepKey="cartClickCartSimpleProduct2" after="cartCartAssertSimpleProduct2ImageNotDefault"/> <waitForLoadingMaskToDisappear stepKey="waitForCartSimpleProduct2loaded" after="cartClickCartSimpleProduct2"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="cartAssertCartProduct2Page" after="waitForCartSimpleProduct2loaded"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="cartAssertCartProduct2Page" after="waitForCartSimpleProduct2loaded"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/IdentityOfDefaultBillingAndShippingAddressTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/IdentityOfDefaultBillingAndShippingAddressTest.xml index 89028e146c358..e2d1a1b9139c8 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/IdentityOfDefaultBillingAndShippingAddressTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/IdentityOfDefaultBillingAndShippingAddressTest.xml @@ -36,7 +36,7 @@ </actionGroup> <!-- Add simple product to cart --> - <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart1"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart1"> <argument name="product" value="$$product$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml index aa3665a81bbde..ad7d55e8f9205 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml @@ -45,7 +45,7 @@ <!-- Add Simple Product to cart --> <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToSimpleProductPage"/> <waitForPageLoad stepKey="waitForSimpleProductPageLoad"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$$createSimpleProduct.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNewAddressTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNewAddressTest.xml index bafad6f28a680..cb752c3b752de 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNewAddressTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNewAddressTest.xml @@ -45,7 +45,7 @@ <!-- Add Simple Product to cart --> <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToSimpleProductPage"/> <waitForPageLoad stepKey="waitForSimpleProductPageLoad"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$$createSimpleProduct.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml index 2c341a5c4c1ab..e2e1039b301d1 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml @@ -45,7 +45,7 @@ <!-- Add Simple Product to cart --> <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToSimpleProductPage"/> <waitForPageLoad stepKey="waitForSimpleProductPageLoad"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$$createSimpleProduct.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml index 990459d7c81b7..ddb732b785995 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml @@ -45,7 +45,7 @@ <!-- Add Simple Product to cart --> <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToSimpleProductPage"/> <waitForPageLoad stepKey="waitForSimpleProductPageLoad"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$$createSimpleProduct.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml index e85a47ab7a91d..67b159e42d9e1 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml @@ -116,7 +116,7 @@ <!-- Add Simple Product to cart --> <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToSimpleProductPage"/> <waitForPageLoad stepKey="waitForSimpleProductPageLoad"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$$createSimpleProduct.name$$"/> </actionGroup> @@ -131,14 +131,14 @@ <!-- Add Virtual Product to cart --> <amOnPage url="{{StorefrontProductPage.url($$createVirtualProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToVirtualProductPage"/> <waitForPageLoad stepKey="waitForVirtualProductPageLoad"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartVirtualProductFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartVirtualProductFromStorefrontProductPage"> <argument name="productName" value="$$createVirtualProduct.name$$"/> </actionGroup> <!-- Add Downloadable Product to cart --> <amOnPage url="{{StorefrontProductPage.url($$createDownloadableProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToDownloadableProductPage"/> <waitForPageLoad stepKey="waitForDownloadableProductPageLoad"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartDownloadableProductFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartDownloadableProductFromStorefrontProductPage"> <argument name="productName" value="$$createDownloadableProduct.name$$"/> </actionGroup> @@ -146,7 +146,7 @@ <amOnPage url="{{StorefrontProductPage.url($$createGroupedProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToGroupedProductPage"/> <waitForPageLoad stepKey="waitForGroupedProductPageLoad"/> <fillField selector="{{StorefrontProductPageSection.qtyInput}}" userInput="1" stepKey="fillFieldQtyInput"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartGroupedProductFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartGroupedProductFromStorefrontProductPage"> <argument name="productName" value="$$createGroupedProduct.name$$"/> </actionGroup> @@ -154,7 +154,7 @@ <amOnPage url="{{StorefrontProductPage.url($$createFixedBundleProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToBundleProductPage"/> <waitForPageLoad stepKey="waitForFixedBundleProductPageLoad"/> <click selector="{{StorefrontBundleProductActionSection.customizeAndAddToCartButton}}" stepKey="clickCustomizeAndAddToCart"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFixedBundleProductFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFixedBundleProductFromStorefrontProductPage"> <argument name="productName" value="$$createFixedBundleProduct.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/ShoppingCartAndMiniShoppingCartPerCustomerTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/ShoppingCartAndMiniShoppingCartPerCustomerTest.xml index 84cdb8abd9344..97ff6d8e56243 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/ShoppingCartAndMiniShoppingCartPerCustomerTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/ShoppingCartAndMiniShoppingCartPerCustomerTest.xml @@ -66,7 +66,7 @@ <waitForPageLoad stepKey="waitForFirstProductPageLoad"/> <!-- Add the product to the shopping cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addFirstProductToCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addFirstProductToCart"> <argument name="productName" value="$$createSimpleProduct.name$$"/> </actionGroup> @@ -102,7 +102,7 @@ <waitForPageLoad stepKey="waitForProductPage"/> <!-- Add the product to the shopping cart --> - <actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPage" stepKey="addProductToCart"> + <actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPageActionGroup" stepKey="addProductToCart"> <argument name="productName" value="$$createSimpleProduct.name$$"/> <argument name="productQty" value="{{quoteQty2Price123.qty}}"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontAddProductWithAllTypesOfCustomOptionToTheShoppingCartWithoutAnySelectedOptionTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontAddProductWithAllTypesOfCustomOptionToTheShoppingCartWithoutAnySelectedOptionTest.xml index d108dc3657a40..450bfff27125a 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontAddProductWithAllTypesOfCustomOptionToTheShoppingCartWithoutAnySelectedOptionTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontAddProductWithAllTypesOfCustomOptionToTheShoppingCartWithoutAnySelectedOptionTest.xml @@ -31,7 +31,7 @@ </after> <!-- Open Product page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct1PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct1PageAndVerifyProduct"> <argument name="product" value="$$createProduct$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml index 693c05684f292..c08a930ba6224 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml @@ -36,7 +36,7 @@ <amOnPage url="$$product.name$$.html" stepKey="navigateToProductPage"/> <waitForPageLoad stepKey="waitForProductPage"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$$product.name$$"/> </actionGroup> <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontUpdateShoppingCartWhileUpdateMinicartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontUpdateShoppingCartWhileUpdateMinicartTest.xml index fb80b4880a6f4..2aa6530dea205 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontUpdateShoppingCartWhileUpdateMinicartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontUpdateShoppingCartWhileUpdateMinicartTest.xml @@ -32,7 +32,7 @@ <!--Add product to cart--> <amOnPage url="$$createProduct.name$$.html" stepKey="navigateToProductPage"/> <waitForPageLoad stepKey="waitForProductPage"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$$createProduct.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartTest.xml index 071311b78b3fa..fdfa7f192232e 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartTest.xml @@ -57,7 +57,7 @@ </after> <!--Open Product page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="product" value="$$createBundleProduct$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartWithDisableMiniCartSidebarTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartWithDisableMiniCartSidebarTest.xml index d67800e21afc2..5d5e2b3a91f49 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartWithDisableMiniCartSidebarTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartWithDisableMiniCartSidebarTest.xml @@ -61,7 +61,7 @@ </after> <!--Open Product page in StoreFront and assert product and price range --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="product" value="$$createBundleProduct$$"/> </actionGroup> <actionGroup ref="AssertStorefrontElementVisibleActionGroup" stepKey="seePriceRangeIsVisible"> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddOneBundleMultiSelectOptionToTheShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddOneBundleMultiSelectOptionToTheShoppingCartTest.xml index 9b8e5a4521115..9153693923c09 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddOneBundleMultiSelectOptionToTheShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddOneBundleMultiSelectOptionToTheShoppingCartTest.xml @@ -57,7 +57,7 @@ </after> <!--Open Product page in StoreFront and assert product details --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="product" value="$$createBundleProduct$$"/> </actionGroup> <actionGroup ref="AssertStorefrontElementVisibleActionGroup" stepKey="seePriceRangeIsVisible"> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddProductWithAllTypesOfCustomOptionToTheShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddProductWithAllTypesOfCustomOptionToTheShoppingCartTest.xml index e90f69e88cec7..319183d4641e6 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddProductWithAllTypesOfCustomOptionToTheShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddProductWithAllTypesOfCustomOptionToTheShoppingCartTest.xml @@ -30,7 +30,7 @@ <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> </after> <!-- Open Product page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct1PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct1PageAndVerifyProduct"> <argument name="product" value="$$createProduct$$"/> </actionGroup> @@ -111,4 +111,4 @@ <argument name="qty" value="2"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddTwoBundleMultiSelectOptionsToTheShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddTwoBundleMultiSelectOptionsToTheShoppingCartTest.xml index 71e99f41f79e1..2625ca2f1a6fe 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddTwoBundleMultiSelectOptionsToTheShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddTwoBundleMultiSelectOptionsToTheShoppingCartTest.xml @@ -57,7 +57,7 @@ </after> <!--Open Product page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="product" value="$$createBundleProduct$$"/> </actionGroup> <actionGroup ref="AssertStorefrontElementVisibleActionGroup" stepKey="seePriceRangeIsVisible"> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontApplyPromoCodeDuringCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontApplyPromoCodeDuringCheckoutTest.xml index bdfdfceab53f9..9f50e9c9f8f74 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontApplyPromoCodeDuringCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontApplyPromoCodeDuringCheckoutTest.xml @@ -42,7 +42,7 @@ </after> <!-- Go to Storefront as Guest and add simple product to cart --> - <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> <argument name="product" value="$$createProduct$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartAndCheckoutItemsCountTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartAndCheckoutItemsCountTest.xml index 0327deaf18968..c3f173961f0c5 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartAndCheckoutItemsCountTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartAndCheckoutItemsCountTest.xml @@ -33,13 +33,13 @@ <!-- Add simpleProduct1 to cart --> <amOnPage url="{{StorefrontProductPage.url($$simpleProduct1.custom_attributes[url_key]$)}}" stepKey="amOnProduct1Page"/> - <actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPage" stepKey="addProduct1ToCart"> + <actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPageActionGroup" stepKey="addProduct1ToCart"> <argument name="productName" value="$$simpleProduct1.name$$"/> <argument name="productQty" value="2"/> </actionGroup> <!-- Add simpleProduct2 to cart --> <amOnPage url="{{StorefrontProductPage.url($$simpleProduct2.custom_attributes[url_key]$)}}" stepKey="amOnProduct2Page"/> - <actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPage" stepKey="addProduct2ToCart"> + <actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPageActionGroup" stepKey="addProduct2ToCart"> <argument name="productName" value="$$simpleProduct2.name$$"/> <argument name="productQty" value="1"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartAndSummaryBlockItemDisplayWithDefaultDisplayLimitationTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartAndSummaryBlockItemDisplayWithDefaultDisplayLimitationTest.xml index beb2d40f94cad..0b52caa7165af 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartAndSummaryBlockItemDisplayWithDefaultDisplayLimitationTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartAndSummaryBlockItemDisplayWithDefaultDisplayLimitationTest.xml @@ -67,102 +67,102 @@ </after> <!-- Open Product1 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct1PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct1PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <!-- Add Product1 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct1ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct1ToTheCart"> <argument name="productName" value="$$simpleProduct1.name$$"/> </actionGroup> <!-- Open Product2 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct2PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct2PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <!-- Add Product2 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct2ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct2ToTheCart"> <argument name="productName" value="$$simpleProduct2.name$$"/> </actionGroup> <!-- Open Product3 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct3PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct3PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct3$$"/> </actionGroup> <!-- Add Product3 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct3ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct3ToTheCart"> <argument name="productName" value="$$simpleProduct3.name$$"/> </actionGroup> <!-- Open Product4 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct4PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct4PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct4$$"/> </actionGroup> <!-- Add Product4 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct4ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct4ToTheCart"> <argument name="productName" value="$$simpleProduct4.name$$"/> </actionGroup> <!-- Open Product5 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct5PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct5PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct5$$"/> </actionGroup> <!-- Add Product5 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct5ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct5ToTheCart"> <argument name="productName" value="$$simpleProduct5.name$$"/> </actionGroup> <!-- Open Product6 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct6PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct6PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct6$$"/> </actionGroup> <!-- Add Product6 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct6ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct6ToTheCart"> <argument name="productName" value="$$simpleProduct6.name$$"/> </actionGroup> <!-- Open Product7 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct7PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct7PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct7$$"/> </actionGroup> <!-- Add Product7 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct7ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct7ToTheCart"> <argument name="productName" value="$$simpleProduct7.name$$"/> </actionGroup> <!-- Open Product8 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct8PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct8PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct8$$"/> </actionGroup> <!-- Add Product8 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct8ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct8ToTheCart"> <argument name="productName" value="$$simpleProduct8.name$$"/> </actionGroup> <!-- Open Product9 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct9PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct9PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct9$$"/> </actionGroup> <!-- Add Product9 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct9ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct9ToTheCart"> <argument name="productName" value="$$simpleProduct9.name$$"/> </actionGroup> <!-- Open Product10 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPage10AndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPage10AndVerifyProduct"> <argument name="product" value="$$simpleProduct10$$"/> </actionGroup> <!-- Add Product10 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct10ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct10ToTheCart"> <argument name="productName" value="$$simpleProduct10.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartItemDisplayWhenMoreItemsAddedToTheCartThanDefaultDisplayLimitTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartItemDisplayWhenMoreItemsAddedToTheCartThanDefaultDisplayLimitTest.xml index 8b8aed3ac6204..a496ff68c0cd0 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartItemDisplayWhenMoreItemsAddedToTheCartThanDefaultDisplayLimitTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartItemDisplayWhenMoreItemsAddedToTheCartThanDefaultDisplayLimitTest.xml @@ -72,112 +72,112 @@ </after> <!-- Open Product1 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct1PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct1PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <!-- Add Product1 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct1ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct1ToTheCart"> <argument name="productName" value="$$simpleProduct1.name$$"/> </actionGroup> <!-- Open Product2 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct2PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct2PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <!-- Add Product2 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct2ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct2ToTheCart"> <argument name="productName" value="$$simpleProduct2.name$$"/> </actionGroup> <!-- Open Product3 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct3PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct3PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct3$$"/> </actionGroup> <!-- Add Product3 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct3ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct3ToTheCart"> <argument name="productName" value="$$simpleProduct3.name$$"/> </actionGroup> <!-- Open Product4 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct4PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct4PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct4$$"/> </actionGroup> <!-- Add Product4 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct4ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct4ToTheCart"> <argument name="productName" value="$$simpleProduct4.name$$"/> </actionGroup> <!-- Open Product5 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct5PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct5PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct5$$"/> </actionGroup> <!-- Add Product5 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct5ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct5ToTheCart"> <argument name="productName" value="$$simpleProduct5.name$$"/> </actionGroup> <!-- Open Product6 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct6PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct6PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct6$$"/> </actionGroup> <!-- Add Product6 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct6ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct6ToTheCart"> <argument name="productName" value="$$simpleProduct6.name$$"/> </actionGroup> <!-- Open Product7 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct7PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct7PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct7$$"/> </actionGroup> <!-- Add Product7 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct7ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct7ToTheCart"> <argument name="productName" value="$$simpleProduct7.name$$"/> </actionGroup> <!-- Open Product8 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct8PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct8PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct8$$"/> </actionGroup> <!-- Add Product8 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct8ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct8ToTheCart"> <argument name="productName" value="$$simpleProduct8.name$$"/> </actionGroup> <!-- Open Product9 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct9PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct9PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct9$$"/> </actionGroup> <!-- Add Product9 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct9ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct9ToTheCart"> <argument name="productName" value="$$simpleProduct9.name$$"/> </actionGroup> <!-- Open Product10 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPage10AndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPage10AndVerifyProduct"> <argument name="product" value="$$simpleProduct10$$"/> </actionGroup> <!-- Add Product10 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct10ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct10ToTheCart"> <argument name="productName" value="$$simpleProduct10.name$$"/> </actionGroup> <!-- Open Product11 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPage11AndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPage11AndVerifyProduct"> <argument name="product" value="$$simpleProduct11$$"/> </actionGroup> <!-- Add Product11 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct11ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct11ToTheCart"> <argument name="productName" value="$$simpleProduct11.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartItemDisplayWithDefaultDisplayLimitAndDefaultTotalQuantityTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartItemDisplayWithDefaultDisplayLimitAndDefaultTotalQuantityTest.xml index 2339789bd85d1..8e84deafea9f2 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartItemDisplayWithDefaultDisplayLimitAndDefaultTotalQuantityTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartItemDisplayWithDefaultDisplayLimitAndDefaultTotalQuantityTest.xml @@ -65,102 +65,102 @@ </after> <!-- Open Product1 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct1PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct1PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <!-- Add Product1 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct1ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct1ToTheCart"> <argument name="productName" value="$$simpleProduct1.name$$"/> </actionGroup> <!-- Open Product2 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct2PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct2PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <!-- Add Product2 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct2ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct2ToTheCart"> <argument name="productName" value="$$simpleProduct2.name$$"/> </actionGroup> <!-- Open Product3 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct3PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct3PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct3$$"/> </actionGroup> <!-- Add Product3 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct3ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct3ToTheCart"> <argument name="productName" value="$$simpleProduct3.name$$"/> </actionGroup> <!-- Open Product4 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct4PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct4PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct4$$"/> </actionGroup> <!-- Add Product4 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct4ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct4ToTheCart"> <argument name="productName" value="$$simpleProduct4.name$$"/> </actionGroup> <!-- Open Product5 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct5PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct5PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct5$$"/> </actionGroup> <!-- Add Product5 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct5ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct5ToTheCart"> <argument name="productName" value="$$simpleProduct5.name$$"/> </actionGroup> <!-- Open Product6 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct6PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct6PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct6$$"/> </actionGroup> <!-- Add Product6 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct6ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct6ToTheCart"> <argument name="productName" value="$$simpleProduct6.name$$"/> </actionGroup> <!-- Open Product7 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct7PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct7PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct7$$"/> </actionGroup> <!-- Add Product7 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct7ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct7ToTheCart"> <argument name="productName" value="$$simpleProduct7.name$$"/> </actionGroup> <!-- Open Product8 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct8PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct8PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct8$$"/> </actionGroup> <!-- Add Product8 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct8ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct8ToTheCart"> <argument name="productName" value="$$simpleProduct8.name$$"/> </actionGroup> <!-- Open Product9 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct9PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct9PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct9$$"/> </actionGroup> <!-- Add Product9 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct9ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct9ToTheCart"> <argument name="productName" value="$$simpleProduct9.name$$"/> </actionGroup> <!-- Open Product10 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPage10AndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPage10AndVerifyProduct"> <argument name="product" value="$$simpleProduct10$$"/> </actionGroup> <!-- Add Product10 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct10ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct10ToTheCart"> <argument name="productName" value="$$simpleProduct10.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckPagerShoppingCartWithMoreThan20ProductsTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckPagerShoppingCartWithMoreThan20ProductsTest.xml index 9dbd5daba6f23..caec34c5ef1aa 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckPagerShoppingCartWithMoreThan20ProductsTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckPagerShoppingCartWithMoreThan20ProductsTest.xml @@ -24,87 +24,87 @@ <magentoCLI stepKey="allowSpecificValue" command="config:set checkout/cart/number_items_to_display_pager 20" /> <createData entity="SimpleTwo" stepKey="simpleProduct1"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem1"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem1"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct2"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem2"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem2"> <argument name="product" value="$simpleProduct2$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct3"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem3"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem3"> <argument name="product" value="$simpleProduct3$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct4"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem4"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem4"> <argument name="product" value="$simpleProduct4$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct5"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem5"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem5"> <argument name="product" value="$simpleProduct5$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct6"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem6"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem6"> <argument name="product" value="$simpleProduct6$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct7"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem7"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem7"> <argument name="product" value="$simpleProduct7$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct8"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem8"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem8"> <argument name="product" value="$simpleProduct8$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct9"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem9"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem9"> <argument name="product" value="$simpleProduct9$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct10"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem10"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem10"> <argument name="product" value="$$simpleProduct10$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct11"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem11"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem11"> <argument name="product" value="$$simpleProduct11$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct12"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem12"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem12"> <argument name="product" value="$$simpleProduct12$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct13"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem13"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem13"> <argument name="product" value="$$simpleProduct13$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct14"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem14"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem14"> <argument name="product" value="$$simpleProduct14$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct15"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem15"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem15"> <argument name="product" value="$$simpleProduct15$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct16"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem16"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem16"> <argument name="product" value="$$simpleProduct16$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct17"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem17"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem17"> <argument name="product" value="$$simpleProduct17$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct18"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem18"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem18"> <argument name="product" value="$$simpleProduct18$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct19"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem19"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem19"> <argument name="product" value="$$simpleProduct19$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct20"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem20"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem20"> <argument name="product" value="$$simpleProduct20$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct21"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem21"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem21"> <argument name="product" value="$$simpleProduct21$$"/> </actionGroup> </before> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckSimpleProductCartItemDisplayWithDefaultLimitationTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckSimpleProductCartItemDisplayWithDefaultLimitationTest.xml index 084c89312cc7e..79e46d093c2f6 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckSimpleProductCartItemDisplayWithDefaultLimitationTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckSimpleProductCartItemDisplayWithDefaultLimitationTest.xml @@ -71,112 +71,112 @@ </after> <!-- Open Product1 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct1PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct1PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <!-- Add Product1 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct1ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct1ToTheCart"> <argument name="productName" value="$$simpleProduct1.name$$"/> </actionGroup> <!-- Open Product2 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct2PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct2PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <!-- Add Product2 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct2ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct2ToTheCart"> <argument name="productName" value="$$simpleProduct2.name$$"/> </actionGroup> <!-- Open Product3 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct3PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct3PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct3$$"/> </actionGroup> <!-- Add Product3 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct3ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct3ToTheCart"> <argument name="productName" value="$$simpleProduct3.name$$"/> </actionGroup> <!-- Open Product4 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct4PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct4PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct4$$"/> </actionGroup> <!-- Add Product4 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct4ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct4ToTheCart"> <argument name="productName" value="$$simpleProduct4.name$$"/> </actionGroup> <!-- Open Product5 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct5PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct5PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct5$$"/> </actionGroup> <!-- Add Product5 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct5ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct5ToTheCart"> <argument name="productName" value="$$simpleProduct5.name$$"/> </actionGroup> <!-- Open Product6 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct6PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct6PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct6$$"/> </actionGroup> <!-- Add Product6 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct6ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct6ToTheCart"> <argument name="productName" value="$$simpleProduct6.name$$"/> </actionGroup> <!-- Open Product7 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct7PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct7PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct7$$"/> </actionGroup> <!-- Add Product7 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct7ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct7ToTheCart"> <argument name="productName" value="$$simpleProduct7.name$$"/> </actionGroup> <!-- Open Product8 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct8PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct8PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct8$$"/> </actionGroup> <!-- Add Product8 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct8ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct8ToTheCart"> <argument name="productName" value="$$simpleProduct8.name$$"/> </actionGroup> <!-- Open Product9 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct9PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct9PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct9$$"/> </actionGroup> <!-- Add Product9 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct9ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct9ToTheCart"> <argument name="productName" value="$$simpleProduct9.name$$"/> </actionGroup> <!-- Open Product10 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPage10AndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPage10AndVerifyProduct"> <argument name="product" value="$$simpleProduct10$$"/> </actionGroup> <!-- Add Product10 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct10ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct10ToTheCart"> <argument name="productName" value="$$simpleProduct10.name$$"/> </actionGroup> <!-- Open Product11 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPage11AndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPage11AndVerifyProduct"> <argument name="product" value="$$simpleProduct11$$"/> </actionGroup> <!-- Add Product11 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct11ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct11ToTheCart"> <argument name="productName" value="$$simpleProduct11.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckVirtualProductCountDisplayWithCustomDisplayConfigurationTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckVirtualProductCountDisplayWithCustomDisplayConfigurationTest.xml index 1f63565899f88..9f3eacbf5f455 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckVirtualProductCountDisplayWithCustomDisplayConfigurationTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckVirtualProductCountDisplayWithCustomDisplayConfigurationTest.xml @@ -46,42 +46,42 @@ </after> <!-- Open Product1 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct1PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct1PageAndVerifyProduct"> <argument name="product" value="$$virtualProduct1$$"/> </actionGroup> <!-- Add Product1 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct1ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct1ToTheCart"> <argument name="productName" value="$$virtualProduct1.name$$"/> </actionGroup> <!-- Open Product2 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct2PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct2PageAndVerifyProduct"> <argument name="product" value="$$virtualProduct2$$"/> </actionGroup> <!-- Add Product2 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct2ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct2ToTheCart"> <argument name="productName" value="$$virtualProduct2.name$$"/> </actionGroup> <!-- Open Product3 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct3PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct3PageAndVerifyProduct"> <argument name="product" value="$$virtualProduct3$$"/> </actionGroup> <!-- Add Product3 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct3ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct3ToTheCart"> <argument name="productName" value="$$virtualProduct3.name$$"/> </actionGroup> <!-- Open Product4 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct4PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct4PageAndVerifyProduct"> <argument name="product" value="$$virtualProduct4$$"/> </actionGroup> <!-- Add Product4 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct4ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct4ToTheCart"> <argument name="productName" value="$$virtualProduct4.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml index c5d1c34a93b32..64591872d8dfe 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml @@ -23,10 +23,10 @@ <createData entity="SimpleProduct2" stepKey="simpleProduct"> <field key="price">50.00</field> </createData> - <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterAndSelectTheProduct"> <argument name="productSku" value="$$simpleProduct.sku$$"/> </actionGroup> - <actionGroup ref="ProductSetAdvancedTierFixedPricing" stepKey="setTierPrice"> + <actionGroup ref="ProductSetAdvancedTierFixedPricingActionGroup" stepKey="setTierPrice"> <argument name="website" value=""/> <argument name="group" value=""/> <argument name="quantity" value="3"/> @@ -49,7 +49,7 @@ </after> <!--Open Product page in StoreFront and assert product and price range --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> @@ -127,4 +127,4 @@ <!-- Assert order buttons --> <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest.xml index 34dc6617d25d5..30abf9a871ee9 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest.xml @@ -35,7 +35,7 @@ </after> <!--Open Product page in StoreFront and assert product and price range --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> @@ -98,4 +98,4 @@ <!-- Assert order buttons --> <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml index 6ccb05bf4c4f7..f4997ef65f47e 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml @@ -24,7 +24,7 @@ <field key="price">10.00</field> </createData> - <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterAndSelectTheProduct"> <argument name="productSku" value="$$simpleProduct.sku$$"/> </actionGroup> @@ -81,7 +81,7 @@ <requiredEntity createDataKey="createConfigChildProduct2"/> </createData> - <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheProduct2"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterAndSelectTheProduct2"> <argument name="productSku" value="$$createConfigChildProduct2.sku$$"/> </actionGroup> <actionGroup ref="AddSpecialPriceToProductActionGroup" stepKey="addSpecialPriceTopTheProduct2"> @@ -105,7 +105,7 @@ </after> <!--Open Product page in StoreFront and assert product and price range --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> @@ -168,4 +168,4 @@ <!-- Assert order buttons --> <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutDisabledProductAndCouponTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutDisabledProductAndCouponTest.xml index 0e704e5336db9..080a468bd5cd9 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutDisabledProductAndCouponTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutDisabledProductAndCouponTest.xml @@ -36,7 +36,7 @@ <deleteData createDataKey="createUSCustomer" stepKey="deleteCustomer"/> <deleteData createDataKey="createSalesRule" stepKey="deleteSalesRule"/> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductListing"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetGridToDefaultKeywordSearch"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetGridToDefaultKeywordSearch"/> </after> <!-- Login as Customer --> @@ -46,7 +46,7 @@ <!-- Add product to shopping cart --> <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.name$$)}}" stepKey="amOnSimpleProductPage"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="cartAddSimpleProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="cartAddSimpleProductToCart"> <argument name="product" value="$$createSimpleProduct$$"/> <argument name="productCount" value="1"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutOnLoginWhenGuestCheckoutIsDisabledTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutOnLoginWhenGuestCheckoutIsDisabledTest.xml index b0b72515611e8..1dd693bdc2f09 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutOnLoginWhenGuestCheckoutIsDisabledTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutOnLoginWhenGuestCheckoutIsDisabledTest.xml @@ -39,7 +39,7 @@ </after> <!--Open Product page in StoreFront and assert product and price range --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> @@ -91,4 +91,4 @@ <!-- Ship the order and assert the shipping status --> <actionGroup ref="AdminShipThePendingOrderActionGroup" stepKey="shipTheOrder"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithNewCustomerRegistrationAndDisableGuestCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithNewCustomerRegistrationAndDisableGuestCheckoutTest.xml index f7e54867b1ae4..c2735c8615beb 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithNewCustomerRegistrationAndDisableGuestCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithNewCustomerRegistrationAndDisableGuestCheckoutTest.xml @@ -39,7 +39,7 @@ </after> <!--Open Product page in StoreFront and assert product and price range --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> @@ -129,4 +129,4 @@ <!-- Ship the order and assert the shipping status --> <actionGroup ref="AdminShipThePendingOrderActionGroup" stepKey="shipTheOrder"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithoutRegionTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithoutRegionTest.xml index 0cc0dcf38e312..4c2a9c1db46f7 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithoutRegionTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithoutRegionTest.xml @@ -43,7 +43,7 @@ <argument name="Customer" value="$$createCustomer$$" /> </actionGroup> - <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> <argument name="product" value="$$createProduct$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerPlaceOrderWithNewAddressesThatWasEditedTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerPlaceOrderWithNewAddressesThatWasEditedTest.xml index 651c5bd8d4375..994a6d2a8b4df 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerPlaceOrderWithNewAddressesThatWasEditedTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerPlaceOrderWithNewAddressesThatWasEditedTest.xml @@ -39,7 +39,7 @@ </actionGroup> <!-- Add simple product to cart and go to checkout--> - <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> <argument name="product" value="$$createProduct$$"/> </actionGroup> <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart" /> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteBundleProductFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteBundleProductFromMiniShoppingCartTest.xml index 8f3ddbb27f62f..01a420ed24d0a 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteBundleProductFromMiniShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteBundleProductFromMiniShoppingCartTest.xml @@ -50,7 +50,7 @@ </after> <!--Open Product page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="product" value="$$createBundleProduct$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteProductsWithCartItemsDisplayDefaultLimitationFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteProductsWithCartItemsDisplayDefaultLimitationFromMiniShoppingCartTest.xml index cca5268564b12..0b5d002253217 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteProductsWithCartItemsDisplayDefaultLimitationFromMiniShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteProductsWithCartItemsDisplayDefaultLimitationFromMiniShoppingCartTest.xml @@ -67,92 +67,92 @@ </after> <!--Open Product1 page in StoreFront--> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct1PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct1PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <!--Add Product1 to the cart--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct1ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct1ToTheCart"> <argument name="productName" value="$$simpleProduct1.name$$"/> </actionGroup> <!--Open Product2 page in StoreFront--> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct2PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct2PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <!--Add Product2 to the cart--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct2ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct2ToTheCart"> <argument name="productName" value="$$simpleProduct2.name$$"/> </actionGroup> <!--Open Product3 page in StoreFront--> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct3PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct3PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct3$$"/> </actionGroup> <!--Add Product3 to the cart--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct3ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct3ToTheCart"> <argument name="productName" value="$$simpleProduct3.name$$"/> </actionGroup> <!--Open Product4 page in StoreFront--> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct4PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct4PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct4$$"/> </actionGroup> <!--Add Product4 to the cart--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct4ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct4ToTheCart"> <argument name="productName" value="$$simpleProduct4.name$$"/> </actionGroup> <!--Open Product5 page in StoreFront--> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct5PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct5PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct5$$"/> </actionGroup> <!--Add Product5 to the cart--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct5ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct5ToTheCart"> <argument name="productName" value="$$simpleProduct5.name$$"/> </actionGroup> <!--Open Product6 page in StoreFront--> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct6PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct6PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct6$$"/> </actionGroup> <!--Add Product6 to the cart--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct6ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct6ToTheCart"> <argument name="productName" value="$$simpleProduct6.name$$"/> </actionGroup> <!--Open Product7 page in StoreFront--> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct7PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct7PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct7$$"/> </actionGroup> <!--Add Product7 to the cart--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct7ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct7ToTheCart"> <argument name="productName" value="$$simpleProduct7.name$$"/> </actionGroup> <!--Open Product8 page in StoreFront--> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct8PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct8PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct8$$"/> </actionGroup> <!--Add Product8 to the cart--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct8ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct8ToTheCart"> <argument name="productName" value="$$simpleProduct8.name$$"/> </actionGroup> <!--Open Product9 page in StoreFront--> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct9PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct9PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct9$$"/> </actionGroup> <!--Add Product9 to the cart--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct9ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct9ToTheCart"> <argument name="productName" value="$$simpleProduct9.name$$"/> </actionGroup> <!--Open Product10 page in StoreFront--> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPage10AndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPage10AndVerifyProduct"> <argument name="product" value="$$simpleProduct10$$"/> </actionGroup> <!--Add Product10 to the cart--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct10ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct10ToTheCart"> <argument name="productName" value="$$simpleProduct10.name$$"/> </actionGroup> @@ -282,4 +282,4 @@ <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$simpleProduct9.name$$)}}" stepKey="verifyAssertProduct9AbsentInMiniShoppingCart"/> <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$simpleProduct10.name$$)}}" stepKey="verifyAssertProduct10AbsentInMiniShoppingCart"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleAndVirtualProductFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleAndVirtualProductFromMiniShoppingCartTest.xml index b8092ccdcdce7..90f6860dfa736 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleAndVirtualProductFromMiniShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleAndVirtualProductFromMiniShoppingCartTest.xml @@ -36,13 +36,13 @@ </after> <!-- Add Simple Product to the cart --> - <actionGroup ref="AddSimpleProductToCart" stepKey="addSimpleProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimpleProductToCart"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> <!-- Add virtual Product to the cart --> <amOnPage url="{{StorefrontProductPage.url($$virtualProduct.name$$)}}" stepKey="amOnStorefrontVirtualProductPage"/> <waitForPageLoad stepKey="waitForPageLoad"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct1ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct1ToTheCart"> <argument name="productName" value="$$virtualProduct.name$$"/> </actionGroup> @@ -85,4 +85,4 @@ <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$simpleProduct.name$$)}}" stepKey="verifyAssertSimpleProductAbsentInMiniShoppingCart"/> <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$virtualProduct.name$$)}}" stepKey="verifyAssertVirtualProductAbsentInMiniShoppingCart"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleProductFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleProductFromMiniShoppingCartTest.xml index 05198060f5de4..4ef0ad977a779 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleProductFromMiniShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleProductFromMiniShoppingCartTest.xml @@ -31,7 +31,7 @@ </after> <!-- Add Simple Product to the cart --> - <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> @@ -60,4 +60,4 @@ <actionGroup ref="assertMiniCartEmpty" stepKey="miniCartEnpty"/> <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$simpleProduct.name$$)}}" stepKey="verifyAssertProductAbsentInMiniShoppingCart"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutDataPersistTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutDataPersistTest.xml index 626f095604fa2..a43bbef57d0c8 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutDataPersistTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutDataPersistTest.xml @@ -30,7 +30,7 @@ </after> <!-- Add simple product to cart --> - <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> <argument name="product" value="$$createProduct$$"/> </actionGroup> <!-- Navigate to checkout --> @@ -40,7 +40,7 @@ <argument name="shippingMethod" value="Flat Rate"/> </actionGroup> <!-- Add simple product to cart --> - <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart1"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart1"> <argument name="product" value="$$createProduct$$"/> </actionGroup> <!-- Navigate to checkout --> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml index 2226e1ebc8292..1369c1a0fcbd2 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml @@ -129,7 +129,7 @@ <see selector="{{AdminTaxRuleGridSection.successMessage}}" userInput="You saved the tax rule." stepKey="assertTaxRuleSuccessMessage" /> <!--Open Product page in StoreFront and assert product and price range --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> @@ -147,7 +147,7 @@ </actionGroup> <!--Open Product page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openBundleProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openBundleProduct"> <argument name="product" value="$$createBundleProduct$$"/> </actionGroup> @@ -220,4 +220,4 @@ <argument name="customerGroup" value=""/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutWithCouponAndZeroSubtotalTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutWithCouponAndZeroSubtotalTest.xml index 33ec099aa2ace..eb386975e1ad2 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutWithCouponAndZeroSubtotalTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutWithCouponAndZeroSubtotalTest.xml @@ -31,12 +31,12 @@ </after> <!--Open Product page in StoreFront and assert product and price range --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openVirtualProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openVirtualProductPageAndVerifyProduct"> <argument name="product" value="$$virtualProduct$$"/> </actionGroup> <!-- Add Product to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct1ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct1ToTheCart"> <argument name="productName" value="$$virtualProduct.name$$"/> </actionGroup> @@ -90,4 +90,4 @@ <see selector="{{AdminOrderTotalSection.grandTotal}}" userInput="$0.00" stepKey="seeGrandTotal"/> <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Pending" stepKey="seeOrderStatus"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontMissingPagerShoppingCartWith20ProductsTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontMissingPagerShoppingCartWith20ProductsTest.xml index afe4ebcfea40c..32b0985c290a3 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontMissingPagerShoppingCartWith20ProductsTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontMissingPagerShoppingCartWith20ProductsTest.xml @@ -23,83 +23,83 @@ <!--Set the default number of items on cart which is 20--> <magentoCLI stepKey="allowSpecificValue" command="config:set checkout/cart/number_items_to_display_pager 20" /> <createData entity="SimpleTwo" stepKey="simpleProduct1"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem1"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem1"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct2"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem2"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct3"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem3"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem3"> <argument name="product" value="$$simpleProduct3$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct4"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem4"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem4"> <argument name="product" value="$$simpleProduct4$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct5"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem5"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem5"> <argument name="product" value="$$simpleProduct5$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct6"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem6"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem6"> <argument name="product" value="$$simpleProduct6$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct7"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem7"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem7"> <argument name="product" value="$$simpleProduct7$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct8"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem8"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem8"> <argument name="product" value="$$simpleProduct8$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct9"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem9"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem9"> <argument name="product" value="$$simpleProduct9$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct10"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem10"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem10"> <argument name="product" value="$$simpleProduct10$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct11"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem11"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem11"> <argument name="product" value="$$simpleProduct11$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct12"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem12"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem12"> <argument name="product" value="$$simpleProduct12$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct13"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem13"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem13"> <argument name="product" value="$$simpleProduct13$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct14"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem14"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem14"> <argument name="product" value="$$simpleProduct14$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct15"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem15"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem15"> <argument name="product" value="$$simpleProduct15$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct16"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem16"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem16"> <argument name="product" value="$$simpleProduct16$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct17"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem17"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem17"> <argument name="product" value="$$simpleProduct17$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct18"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem18"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem18"> <argument name="product" value="$$simpleProduct18$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct19"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem19"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem19"> <argument name="product" value="$$simpleProduct19$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct20"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem20"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem20"> <argument name="product" value="$$simpleProduct20$$"/> </actionGroup> </before> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontOnePageCheckoutDataWhenChangeQtyTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontOnePageCheckoutDataWhenChangeQtyTest.xml index 913eb34b34d07..ae7b8d2446380 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontOnePageCheckoutDataWhenChangeQtyTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontOnePageCheckoutDataWhenChangeQtyTest.xml @@ -30,7 +30,7 @@ <!--Add product to cart and checkout--> <amOnPage url="{{StorefrontProductPage.url($$createProduct.name$$)}}" stepKey="amOnSimpleProductPage"/> <waitForPageLoad stepKey="waitForPageLoad"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$createProduct.name$$"/> </actionGroup> <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontOnePageCheckoutJsValidationTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontOnePageCheckoutJsValidationTest.xml index 8ed8e590eb229..66a4f417aed9d 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontOnePageCheckoutJsValidationTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontOnePageCheckoutJsValidationTest.xml @@ -30,7 +30,7 @@ <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> </after> - <actionGroup ref="AddSimpleProductToCart" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="product" value="$$createProduct$$"/> </actionGroup> <actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="guestGoToCheckout"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontPersistentDataForGuestCustomerWithPhysicalQuoteTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontPersistentDataForGuestCustomerWithPhysicalQuoteTest.xml index 20ff67a076e1e..c106ec9c552ff 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontPersistentDataForGuestCustomerWithPhysicalQuoteTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontPersistentDataForGuestCustomerWithPhysicalQuoteTest.xml @@ -31,7 +31,7 @@ <createData entity="FreeShippinMethodDefault" stepKey="disableFreeShipping"/> </after> <!-- 1. Add simple product to cart and go to checkout--> - <actionGroup ref="AddSimpleProductToCart" stepKey="addSimpleProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimpleProductToCart"> <argument name="product" value="$$createProduct$$"/> </actionGroup> <!-- 2. Go to Shopping Cart --> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductNameMinicartOnCheckoutPageDifferentStoreViewsTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductNameMinicartOnCheckoutPageDifferentStoreViewsTest.xml index 5e7e76ae4f02a..b678cb835f503 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductNameMinicartOnCheckoutPageDifferentStoreViewsTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductNameMinicartOnCheckoutPageDifferentStoreViewsTest.xml @@ -45,7 +45,7 @@ <waitForPageLoad stepKey="waitForProductPage"/> <!--Switch to second store view and change the product name--> - <actionGroup ref="SwitchToTheNewStoreView" stepKey="switchToCustomStoreView"> + <actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="switchToCustomStoreView"> <argument name="storeViewName" value="{{customStore.name}}"/> </actionGroup> <waitForPageLoad stepKey="waitForPageLoad"/> @@ -56,7 +56,7 @@ <!--Add product to cart--> <amOnPage url="{{StorefrontProductPage.url($$createProduct.name$$)}}" stepKey="amOnSimpleProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$createProduct.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductQuantityChangesInBackendAfterCustomerCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductQuantityChangesInBackendAfterCustomerCheckoutTest.xml index 285dc28cb520e..2f5e687063806 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductQuantityChangesInBackendAfterCustomerCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductQuantityChangesInBackendAfterCustomerCheckoutTest.xml @@ -32,7 +32,7 @@ </after> <!--Open Product page in StoreFront and assert product and price range --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> @@ -88,7 +88,7 @@ <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> <!-- Assert Product Quantity in backend reduced after order processed --> - <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterAndSelectTheProduct"> <argument name="productSku" value="$$simpleProduct.sku$$"/> </actionGroup> <waitForElementVisible selector="{{AdminProductFormSection.productName}}" stepKey="waitForProductDetailsToLoad"/> @@ -97,9 +97,9 @@ <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="Out of Stock" stepKey="seeProductStockStatus"/> <!-- Assert Product is Out of Stock in frontend --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="assertProductInStorefront"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="assertProductInStorefront"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> <see selector="{{StorefrontProductInfoMainSection.productStockStatus}}" userInput="Out Of Stock" stepKey="seeProductDisplayedAsOutOfStock"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontShoppingCartPagerForOneItemPerPageAnd2ProductsTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontShoppingCartPagerForOneItemPerPageAnd2ProductsTest.xml index 744401cf24d13..2691dc2b9fd06 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontShoppingCartPagerForOneItemPerPageAnd2ProductsTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontShoppingCartPagerForOneItemPerPageAnd2ProductsTest.xml @@ -24,10 +24,10 @@ <magentoCLI stepKey="allowSpecificValue" command="config:set checkout/cart/number_items_to_display_pager 1" /> <createData entity="SimpleTwo" stepKey="createSimpleProduct1"/> <createData entity="SimpleTwo" stepKey="createSimpleProduct2"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="addToCartFromStorefrontProductPage1"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addToCartFromStorefrontProductPage1"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> - <actionGroup ref="AddSimpleProductToCart" stepKey="addToCartFromStorefrontProductPage2"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addToCartFromStorefrontProductPage2"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> </before> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKCustomerCheckoutWithCouponTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKCustomerCheckoutWithCouponTest.xml index 482e2fb6233a6..890a3eb748b6b 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKCustomerCheckoutWithCouponTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKCustomerCheckoutWithCouponTest.xml @@ -57,12 +57,12 @@ </actionGroup> <!--Open Product page in StoreFront and assert product and price range --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openVirtualProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openVirtualProductPageAndVerifyProduct"> <argument name="product" value="$$virtualProduct$$"/> </actionGroup> <!-- Add Product to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct1ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct1ToTheCart"> <argument name="productName" value="$$virtualProduct.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKGuestCheckoutWithConditionProductQuantityEqualsToOrderedQuantityTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKGuestCheckoutWithConditionProductQuantityEqualsToOrderedQuantityTest.xml index deab32aede324..f390244fbd00b 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKGuestCheckoutWithConditionProductQuantityEqualsToOrderedQuantityTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKGuestCheckoutWithConditionProductQuantityEqualsToOrderedQuantityTest.xml @@ -29,7 +29,7 @@ </after> <!--Open Product page in StoreFront and assert product and price range --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> @@ -83,7 +83,7 @@ <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> <!-- Assert Product Quantity in backend reduced after order processed --> - <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterAndSelectTheProduct"> <argument name="productSku" value="$$simpleProduct.sku$$"/> </actionGroup> <waitForElementVisible selector="{{AdminProductFormSection.productName}}" stepKey="waitForProductDetailsToLoad"/> @@ -92,9 +92,9 @@ <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="Out of Stock" stepKey="seeProductStockStatus"/> <!-- Assert Product is Out of Stock in frontend --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="assertProductInStorefront"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="assertProductInStorefront"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> <see selector="{{StorefrontProductInfoMainSection.productStockStatus}}" userInput="Out Of Stock" stepKey="seeProductDisplayedAsOutOfStock"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUSCustomerCheckoutWithCouponAndBankTransferPaymentMethodTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUSCustomerCheckoutWithCouponAndBankTransferPaymentMethodTest.xml index 6d5f79f3aadf4..2a07604c806d7 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUSCustomerCheckoutWithCouponAndBankTransferPaymentMethodTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUSCustomerCheckoutWithCouponAndBankTransferPaymentMethodTest.xml @@ -36,7 +36,7 @@ </after> <!-- Open Product page in StoreFront and assert product and price range --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> @@ -94,4 +94,4 @@ <!-- Assert order buttons --> <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdatePriceInShoppingCartAfterProductSaveTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdatePriceInShoppingCartAfterProductSaveTest.xml index b4747a6bf7273..4bff22950174f 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdatePriceInShoppingCartAfterProductSaveTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdatePriceInShoppingCartAfterProductSaveTest.xml @@ -37,7 +37,7 @@ <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToSimpleProductPage"/> <!--Add Product to Shopping Cart--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$$createSimpleProduct.name$$"/> </actionGroup> @@ -54,7 +54,7 @@ <openNewTab stepKey="openNewTab"/> <amOnPage url="{{AdminProductEditPage.url($$createSimpleProduct.id$$)}}" stepKey="goToProductEditPage"/> <fillField userInput="120" selector="{{AdminProductFormSection.productPrice}}" stepKey="setNewPrice"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <closeTab stepKey="closeTab"/> <!--Check price--> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdateShoppingCartSimpleProductQtyTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdateShoppingCartSimpleProductQtyTest.xml index 72f6cf95a6fbe..69aae3d94ee97 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdateShoppingCartSimpleProductQtyTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdateShoppingCartSimpleProductQtyTest.xml @@ -26,7 +26,7 @@ </createData> <!-- Add the newly created product to the shopping cart --> - <actionGroup ref="AddSimpleProductToCart" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="product" value="$$createProduct$$"/> </actionGroup> </before> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/UpdateProductFromMiniShoppingCartEntityTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/UpdateProductFromMiniShoppingCartEntityTest.xml index 7318f865a0dc1..6e484c30fa81e 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/UpdateProductFromMiniShoppingCartEntityTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/UpdateProductFromMiniShoppingCartEntityTest.xml @@ -24,7 +24,7 @@ <createData entity="simpleProductWithoutCategory" stepKey="createProduct"/> <!--Add product to cart--> - <actionGroup ref="AddSimpleProductToCart" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="product" value="$$createProduct$$"/> </actionGroup> </before> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml index 4b3e18fb31877..280338239ef58 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml @@ -63,7 +63,7 @@ <!--Proceed to store front and place an order with free shipping using created coupon--> <!--Add product to card--> - <actionGroup ref="AddSimpleProductToCart" stepKey="AddProductToCard"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="AddProductToCard"> <argument name="product" value="$$simpleproduct$$"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddDefaultImageConfigurableTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddDefaultImageConfigurableTest.xml index 92928c9384672..2f9347157ef33 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddDefaultImageConfigurableTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddDefaultImageConfigurableTest.xml @@ -93,28 +93,28 @@ <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="productIndexPage"/> <waitForPageLoad time="30" stepKey="waitForPageLoad1"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGrid"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGrid"> <argument name="product" value="$$baseConfigProductHandle$$"/> </actionGroup> - <actionGroup ref="openProducForEditByClickingRowXColumnYInProductGrid" stepKey="openProducForEditByClickingRow1Column2InProductGrid1"/> + <actionGroup ref="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup" stepKey="openProducForEditByClickingRow1Column2InProductGrid1"/> <!-- Add image to product --> - <actionGroup ref="addProductImage" stepKey="addImageForProduct"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageForProduct"> <argument name="image" value="MagentoLogo"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Assert product image in admin product form --> - <actionGroup ref="assertProductImageAdminProductPage" stepKey="assertProductImageAdminProductPage"/> + <actionGroup ref="AssertProductImageAdminProductPageActionGroup" stepKey="assertProductImageAdminProductPage"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="$$baseConfigProductHandle$$"/> </actionGroup> <!-- Assert product image in storefront product page --> - <actionGroup ref="assertProductImageStorefrontProductPage2" stepKey="assertProductImageStorefrontProductPage"> + <actionGroup ref="AssertProductImageStorefrontProductPage2ActionGroup" stepKey="assertProductImageStorefrontProductPageActionGroup"> <argument name="product" value="$$baseConfigProductHandle$$"/> <argument name="image" value="MagentoLogo"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddingNewOptionsWithImagesAndPricesToConfigurableProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddingNewOptionsWithImagesAndPricesToConfigurableProductTest.xml index 36c135c427365..67f432ca48fa4 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddingNewOptionsWithImagesAndPricesToConfigurableProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddingNewOptionsWithImagesAndPricesToConfigurableProductTest.xml @@ -104,7 +104,7 @@ <click selector="{{ConfigurableProductSection.generateConfigure}}" stepKey="clickGenerateConfigure"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!--Go to frontend and check image and price--> <amOnPage url="{{StorefrontProductPage.url($$createConfigProductCreateConfigurableProduct.custom_attributes[url_key]$$)}}" stepKey="goToProductPage"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAssertNoticeThatExistingSkuAutomaticallyChangedWhenSavingProductWithSameSkuTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAssertNoticeThatExistingSkuAutomaticallyChangedWhenSavingProductWithSameSkuTest.xml index c085229da8028..a1faa2b156808 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAssertNoticeThatExistingSkuAutomaticallyChangedWhenSavingProductWithSameSkuTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAssertNoticeThatExistingSkuAutomaticallyChangedWhenSavingProductWithSameSkuTest.xml @@ -22,12 +22,12 @@ </before> <after> <!-- Delete configurable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <!-- Delete product attribute --> - <actionGroup ref="deleteProductAttributeByLabel" stepKey="deleteProductAttribute"> + <actionGroup ref="DeleteProductAttributeByLabelActionGroup" stepKey="deleteProductAttribute"> <argument name="ProductAttribute" value="colorProductAttribute"/> </actionGroup> @@ -38,12 +38,12 @@ <!-- Create configurable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="goToCreateProductPage" stepKey="createConfigurableProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="createConfigurableProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <!-- Fill configurable product values --> - <actionGroup ref="fillMainProductForm" stepKey="fillConfigurableProductValues"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillConfigurableProductValues"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckConfigurableProductAttributeValueUniquenessTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckConfigurableProductAttributeValueUniquenessTest.xml index df6afdcfd2243..3600d6e82bd82 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckConfigurableProductAttributeValueUniquenessTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckConfigurableProductAttributeValueUniquenessTest.xml @@ -26,11 +26,11 @@ <after> <!--Delete created data--> <comment userInput="Delete created data" stepKey="deleteCreatedData"/> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteConfigurableProductAndOptions"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteConfigurableProductAndOptions"> <argument name="product" value="$$createConfigProduct$$"/> </actionGroup> <waitForPageLoad stepKey="waitForProductIndexPage"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createProductAttribute" stepKey="deleteAttribute"/> <actionGroup ref="logout" stepKey="logOut"/> @@ -45,7 +45,7 @@ <comment userInput="Go to created product page" stepKey="goToProdPage"/> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="goToProductGrid"/> <waitForPageLoad stepKey="waitForProductPage1"/> - <actionGroup ref="filterProductGridByName2" stepKey="filterByName"> + <actionGroup ref="FilterProductGridByName2ActionGroup" stepKey="filterByName"> <argument name="name" value="$$createConfigProduct.name$$"/> </actionGroup> <click selector="{{AdminProductGridSection.firstRow}}" stepKey="clickOnProductName"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml index de0cca11235ea..84fbab5fb4f02 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml @@ -71,7 +71,7 @@ <!-- Login as Admin --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!-- Add created attributes with options to Attribute Set --> - <actionGroup ref="AdminAddUnassignedAttributeToGroup" stepKey="createDefaultAttributeSet"> + <actionGroup ref="AdminAddUnassignedAttributeToGroupActionGroup" stepKey="createDefaultAttributeSet"> <argument name="label" value="mySet"/> <argument name="firstOption" value="$$createConfigProductAttribute.attribute_code$$"/> <argument name="secondOption" value="$$createConfigProductAttribute2.attribute_code$$"/> @@ -86,7 +86,7 @@ <deleteData createDataKey="createThirdConfigurableProduct" stepKey="deleteThirdProduct"/> <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> <!-- Delete attribute set --> - <actionGroup ref="deleteAttributeSetByLabel" stepKey="deleteAttributeSet"> + <actionGroup ref="DeleteAttributeSetByLabelActionGroup" stepKey="deleteAttributeSet"> <argument name="label" value="mySet"/> </actionGroup> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearAttributeSetsFilter"/> @@ -95,14 +95,14 @@ <argument name="productAttributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> </actionGroup> <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttributeByAttributeCode"> - <argument name="productAttributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> + <argument name="ProductAttributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> </actionGroup> <!-- Delete Second attribute --> <actionGroup ref="OpenProductAttributeFromSearchResultInGridActionGroup" stepKey="openSecondProductAttributeFromSearchResultInGrid"> <argument name="productAttributeCode" value="$$createConfigProductAttribute2.attribute_code$$"/> </actionGroup> <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteSecondProductAttributeByAttributeCode"> - <argument name="productAttributeCode" value="$$createConfigProductAttribute2.attribute_code$$"/> + <argument name="ProductAttributeCode" value="$$createConfigProductAttribute2.attribute_code$$"/> </actionGroup> <!-- Clear filters --> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductAttributesFilter"/> @@ -114,7 +114,7 @@ <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad time="30" stepKey="wait1"/> <!-- Edit created first product as configurable product with options --> - <actionGroup ref="filterProductGridBySku" stepKey="filterGridByFirstProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterGridByFirstProduct"> <argument name="product" value="$$createFirstConfigurableProduct$$"/> </actionGroup> <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProductFirst"> @@ -136,7 +136,7 @@ <waitForPageLoad stepKey="waitForMessage"/> <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessageFirst"/> <!-- Edit created second product as configurable product with options --> - <actionGroup ref="filterProductGridBySku" stepKey="filterGridBySecondProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterGridBySecondProduct"> <argument name="product" value="$$createSecondConfigurableProduct$$"/> </actionGroup> <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProductSecond"> @@ -159,7 +159,7 @@ <waitForPageLoad stepKey="waitForSuccessMessage"/> <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessageSecond"/> <!-- Edit created third product as configurable product with options --> - <actionGroup ref="filterProductGridBySku" stepKey="filterGridByThirdProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterGridByThirdProduct"> <argument name="product" value="$$createThirdConfigurableProduct$$"/> </actionGroup> <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProductThird"> @@ -181,7 +181,7 @@ <waitForPageLoad stepKey="waitForProductPage"/> <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveConfigurableProductMessage"/> <!-- Create Simple product with options --> - <actionGroup ref="filterProductGridBySku" stepKey="filterGridBySimpleProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterGridBySimpleProduct"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditSimpleProduct"> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckValidatorConfigurableProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckValidatorConfigurableProductTest.xml index dd641fd370ba7..5bdccf15b19d3 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckValidatorConfigurableProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckValidatorConfigurableProductTest.xml @@ -34,13 +34,13 @@ <!--Delete created data--> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> <argument name="sku" value="{{ApiConfigurableProduct.name}}-thisIsShortName"/> </actionGroup> <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> <!-- Remove attribute --> - <actionGroup ref="deleteProductAttribute" stepKey="deleteAttribute"> + <actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteAttribute"> <argument name="ProductAttribute" value="productDropDownAttribute"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -51,7 +51,7 @@ <waitForPageLoad stepKey="waitForAdminProductPageLoad"/> <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <waitForPageLoad stepKey="waitForProductFilterLoad"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest.xml index 430007ae761f7..75d1745ebe7bc 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest.xml @@ -130,7 +130,7 @@ <click selector="{{DropdownAttributeOptionsSection.deleteButton(1)}}" stepKey="deleteOption"/> <click selector="{{AttributePropertiesSection.Save}}" stepKey="saveAttribute"/> <click selector="{{AdminProductAttributeGridSection.ResetFilter}}" stepKey="resetFiltersOnGrid2"/> - <actionGroup stepKey="deleteProduct1" ref="deleteProductBySku"> + <actionGroup stepKey="deleteProduct1" ref="DeleteProductBySkuActionGroup"> <argument name="sku" value="$grabTextFromContent"/> </actionGroup> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest.xml index 33a6da9dabf34..83e428b454c46 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest.xml @@ -82,7 +82,7 @@ <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductList"/> <waitForPageLoad stepKey="wait2"/> <conditionalClick selector="{{AdminProductGridFilterSection.clearAll}}" dependentSelector="{{AdminProductGridFilterSection.clearAll}}" stepKey="clearAll" visible="true"/> - <actionGroup ref="searchProductGridByKeyword" stepKey="searchForProduct"> + <actionGroup ref="SearchProductGridByKeywordActionGroup" stepKey="searchForProduct"> <argument name="keyword" value="ApiConfigurableProduct.name"/> </actionGroup> <click selector="label.data-grid-checkbox-cell-inner" stepKey="clickCheckbox"/> @@ -231,7 +231,7 @@ <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductList"/> <waitForPageLoad stepKey="wait1"/> <conditionalClick selector="{{AdminProductGridFilterSection.clearAll}}" dependentSelector="{{AdminProductGridFilterSection.clearAll}}" stepKey="clearAll" visible="true"/> - <actionGroup ref="searchProductGridByKeyword" stepKey="searchForProduct"> + <actionGroup ref="SearchProductGridByKeywordActionGroup" stepKey="searchForProduct"> <argument name="keyword" value="ApiConfigurableProduct.name"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductLongSkuTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductLongSkuTest.xml index cd09cbd295877..450e27f293893 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductLongSkuTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductLongSkuTest.xml @@ -44,7 +44,7 @@ <after> <!--Clean up products--> - <actionGroup ref="deleteProductByName" stepKey="cleanUpProducts"> + <actionGroup ref="DeleteProductByNameActionGroup" stepKey="cleanUpProducts"> <argument name="sku" value="{{ProductWithLongNameSku.sku}}"/> <argument name="name" value="{{ProductWithLongNameSku.name}}"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductOutOfStockTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductOutOfStockTest.xml index 51b3e49f51913..6bba4aa6b43ce 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductOutOfStockTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductOutOfStockTest.xml @@ -94,7 +94,7 @@ <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> <waitForPageLoad stepKey="waitForAdminProductGridLoad"/> <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedProduct"> <argument name="product" value="ApiSimpleOne"/> </actionGroup> <waitForPageLoad stepKey="waitForFiltersToBeApplied"/> @@ -114,7 +114,7 @@ <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage2"/> <waitForPageLoad stepKey="waitForAdminProductGridLoad2"/> <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial2"/> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedProduct2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedProduct2"> <argument name="product" value="ApiSimpleTwo"/> </actionGroup> <waitForPageLoad stepKey="waitForFiltersToBeApplied2"/> @@ -212,7 +212,7 @@ <see stepKey="checkForOutOfStock" selector="{{StorefrontProductInfoMainSection.stockIndication}}" userInput="IN STOCK" /> <!-- Delete the first simple product --> - <actionGroup stepKey="deleteProduct1" ref="deleteProductBySku"> + <actionGroup stepKey="deleteProduct1" ref="DeleteProductBySkuActionGroup"> <argument name="sku" value="{{ApiSimpleOne.sku}}"/> </actionGroup> @@ -222,7 +222,7 @@ <see stepKey="checkForOutOfStock2" selector="{{StorefrontProductInfoMainSection.stockIndication}}" userInput="IN STOCK"/> <!-- Delete the second simple product --> - <actionGroup stepKey="deleteProduct2" ref="deleteProductBySku"> + <actionGroup stepKey="deleteProduct2" ref="DeleteProductBySkuActionGroup"> <argument name="sku" value="{{ApiSimpleTwo.sku}}"/> </actionGroup> @@ -314,7 +314,7 @@ <see stepKey="checkForOutOfStock" selector="{{StorefrontProductInfoMainSection.stockIndication}}" userInput="IN STOCK" /> <!-- Delete the first simple product --> - <actionGroup stepKey="deleteProduct1" ref="deleteProductBySku"> + <actionGroup stepKey="deleteProduct1" ref="DeleteProductBySkuActionGroup"> <argument name="sku" value="{{ApiSimpleOne.sku}}"/> </actionGroup> @@ -327,7 +327,7 @@ <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage2"/> <waitForPageLoad stepKey="waitForAdminProductGridLoad2"/> <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial2"/> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedProduct2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedProduct2"> <argument name="product" value="ApiSimpleTwo"/> </actionGroup> <waitForPageLoad stepKey="waitForFiltersToBeApplied2"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductSearchTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductSearchTest.xml index 410c85d314904..889ca5b24b242 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductSearchTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductSearchTest.xml @@ -78,7 +78,7 @@ <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductList"/> <waitForPageLoad stepKey="wait1"/> <conditionalClick selector="{{AdminProductGridFilterSection.clearAll}}" dependentSelector="{{AdminProductGridFilterSection.clearAll}}" stepKey="clearAll" visible="true"/> - <actionGroup ref="searchProductGridByKeyword" stepKey="searchForProduct"> + <actionGroup ref="SearchProductGridByKeywordActionGroup" stepKey="searchForProduct"> <argument name="keyword" value="ApiConfigurableProduct.name"/> </actionGroup> <waitForPageLoad stepKey="wait2"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductSetEditContentTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductSetEditContentTest.xml index 42e12852f563f..0da4c265a73af 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductSetEditContentTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductSetEditContentTest.xml @@ -21,16 +21,16 @@ </annotations> <after> <!-- Delete configurable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> </after> <!-- Create product --> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillProductForm"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateAttributeTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateAttributeTest.xml index dba481b64810a..c437b39a405cd 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateAttributeTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateAttributeTest.xml @@ -117,7 +117,7 @@ <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> <waitForPageLoad stepKey="waitForAdminProductPageLoad"/> <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <waitForPageLoad stepKey="waitForProductFilterLoad"/> @@ -227,7 +227,7 @@ <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> <waitForPageLoad stepKey="waitForAdminProductPageLoad"/> <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedProduct"> <argument name="product" value="$$createConfigProduct$$"/> </actionGroup> <waitForPageLoad stepKey="waitForProductFilterLoad"/> @@ -265,7 +265,7 @@ <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> <!-- Find the simple product that we just created using the product grid and delete it --> - <actionGroup ref="deleteProductBySku" stepKey="findCreatedProduct2"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="findCreatedProduct2"> <argument name="sku" value="{{ApiConfigurableProduct.sku}}2-simple"/> </actionGroup> </test> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest.xml index 7c6cd57097591..2fe4e1925ce6d 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest.xml @@ -48,7 +48,7 @@ <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductList"/> <waitForPageLoad stepKey="wait1"/> <conditionalClick selector="{{AdminProductGridFilterSection.clearAll}}" dependentSelector="{{AdminProductGridFilterSection.clearAll}}" visible="true" stepKey="clearAll"/> - <actionGroup ref="searchProductGridByKeyword" stepKey="searchForProduct"> + <actionGroup ref="SearchProductGridByKeywordActionGroup" stepKey="searchForProduct"> <argument name="keyword" value="ApiConfigurableProduct.name"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableSetEditRelatedProductsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableSetEditRelatedProductsTest.xml index 11f1e9bb33c10..e15727b75d86e 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableSetEditRelatedProductsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableSetEditRelatedProductsTest.xml @@ -24,7 +24,7 @@ </before> <after> <!-- Delete configurable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="_defaultProduct"/> </actionGroup> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndEditConfigurableProductSettingsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndEditConfigurableProductSettingsTest.xml index fd80c41b64962..6632cbcee30f2 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndEditConfigurableProductSettingsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndEditConfigurableProductSettingsTest.xml @@ -29,12 +29,12 @@ <!-- Create a configurable product --> <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndexPage"/> - <actionGroup ref="goToCreateProductPage" stepKey="createConfigurableProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="createConfigurableProduct"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> <!-- Fill configurable product values --> - <actionGroup ref="fillMainProductForm" stepKey="fillConfigurableProductValues"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillConfigurableProductValues"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> @@ -47,7 +47,7 @@ </actionGroup> <!-- Save product form --> - <actionGroup ref="saveProductForm" stepKey="clickSaveButton"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveButton"/> <!-- Open product page --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage"> @@ -87,7 +87,7 @@ <actionGroup ref="AdminSwitchProductGiftMessageStatusActionGroup" stepKey="disableGiftMessageSettings"/> <!-- Save product form --> - <actionGroup ref="saveProductForm" stepKey="clickSaveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveProduct"/> <!-- Verify Url Key after changing --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> @@ -102,7 +102,7 @@ <dontSeeElement selector="{{StorefrontProductCartGiftOptionSection.giftOptions}}" stepKey="dontSeeGiftOptionBtn"/> <!-- Delete created configurable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndSwitchProductType.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndSwitchProductType.xml index 2cc71964042a4..c1308bcf57f1e 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndSwitchProductType.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndSwitchProductType.xml @@ -19,10 +19,10 @@ <group value="catalog"/> <group value="mtf_migrated"/> </annotations> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="openProductFillForm"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="openProductFillForm"> <argument name="productType" value="configurable"/> </actionGroup> - <actionGroup ref="fillMainProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="_defaultProduct"/> </actionGroup> <see selector="{{AdminProductGridSection.productGridCell('1', 'Type')}}" userInput="Simple Product" stepKey="seeProductTypeInGrid"/> @@ -38,7 +38,7 @@ <group value="catalog"/> <group value="mtf_migrated"/> </annotations> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="openProductFillForm"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="openProductFillForm"> <argument name="productType" value="configurable"/> </actionGroup> <see selector="{{AdminProductGridSection.productGridCell('1', 'Type')}}" userInput="Virtual Product" stepKey="seeProductTypeInGrid"/> @@ -63,10 +63,10 @@ <after> <deleteData stepKey="deleteAttribute" createDataKey="createConfigProductAttribute"/> </after> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="openProductFillForm"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="openProductFillForm"> <argument name="productType" value="virtual"/> </actionGroup> - <actionGroup ref="fillMainProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="_defaultProduct"/> </actionGroup> <comment before="createConfiguration" stepKey="beforeCreateConfiguration" userInput="Adding Configuration to Product"/> @@ -100,12 +100,12 @@ <after> <deleteData stepKey="deleteAttribute" createDataKey="createConfigProductAttribute"/> </after> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="openProductFillForm"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="openProductFillForm"> <argument name="productType" value="simple"/> </actionGroup> <!-- Create configurable product from simple product page--> <comment userInput="Create configurable product" stepKey="commentCreateProduct"/> - <actionGroup ref="fillMainProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="_defaultProduct"/> </actionGroup> <comment before="createConfiguration" stepKey="beforeCreateConfiguration" userInput="Adding Configuration to Product"/> @@ -141,11 +141,11 @@ </createData> </before> <after> - <actionGroup ref="GoToProductCatalogPage" stepKey="goToProductCatalogPage"/> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteConfigurableProduct"> + <actionGroup ref="GoToProductCatalogPageActionGroup" stepKey="goToProductCatalogPage"/> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteConfigurableProduct"> <argument name="product" value="_defaultProduct"/> </actionGroup> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetSearch"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetSearch"/> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> <deleteData stepKey="deleteAttribute" createDataKey="createConfigProductAttribute"/> <actionGroup ref="logout" stepKey="logout"/> @@ -155,17 +155,17 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> <!-- Open Dropdown and select downloadable product option --> <comment stepKey="beforeOpenProductFillForm" userInput="Selecting Product from the Add Product Dropdown"/> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="openProductFillForm"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="openProductFillForm"> <argument name="productType" value="downloadable"/> </actionGroup> <scrollTo selector="{{AdminProductDownloadableSection.sectionHeader}}" stepKey="scrollToDownloadableInfo" /> <uncheckOption selector="{{AdminProductDownloadableSection.isDownloadableProduct}}" stepKey="checkIsDownloadable"/> <!-- Fill form for Downloadable Product Type --> <comment stepKey="beforeFillProductForm" userInput="Filling Product Form"/> - <actionGroup ref="fillMainProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="_defaultProduct"/> </actionGroup> - <actionGroup ref="SetProductUrlKey" stepKey="setProductUrl"> + <actionGroup ref="SetProductUrlKeyActionGroup" stepKey="setProductUrl"> <argument name="product" value="_defaultProduct"/> </actionGroup> <comment before="createConfiguration" stepKey="beforeCreateConfiguration" userInput="Adding Configuration to Product"/> @@ -175,13 +175,13 @@ <actionGroup ref="saveConfiguredProduct" stepKey="saveProductForm"/> <!-- Check that product was added with implicit type change --> <comment stepKey="beforeVerify" userInput="Verify Product Type Assigned Correctly"/> - <actionGroup ref="GoToProductCatalogPage" stepKey="goToProductCatalogPage"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetSearch"/> - <actionGroup ref="filterProductGridByName" stepKey="searchForProduct"> + <actionGroup ref="GoToProductCatalogPageActionGroup" stepKey="goToProductCatalogPage"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetSearch"/> + <actionGroup ref="FilterProductGridByNameActionGroup" stepKey="searchForProduct"> <argument name="product" value="_defaultProduct"/> </actionGroup> <see selector="{{AdminProductGridSection.productGridCell('2', 'Type')}}" userInput="Configurable Product" stepKey="seeProductTypeInGrid"/> - <actionGroup ref="AssertProductInStorefrontProductPage" stepKey="assertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductInStorefrontProductPageActionGroup" stepKey="assertProductInStorefrontProductPage"> <argument name="product" value="_defaultProduct"/> </actionGroup> <actionGroup ref="VerifyOptionInProductStorefront" stepKey="verifyConfigurableOption"> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductBasedOnParentSkuTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductBasedOnParentSkuTest.xml index f4f607e9119b6..36cc4363e22f3 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductBasedOnParentSkuTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductBasedOnParentSkuTest.xml @@ -22,12 +22,12 @@ </before> <after> <!-- Delete configurable product with children products --> - <actionGroup ref="deleteProductBySku" stepKey="deleteProducts"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProducts"> <argument name="sku" value="{{ApiConfigurableProduct.sku}}"/> </actionGroup> <!-- Delete product attribute --> - <actionGroup ref="deleteProductAttributeByLabel" stepKey="deleteProductAttribute"> + <actionGroup ref="DeleteProductAttributeByLabelActionGroup" stepKey="deleteProductAttribute"> <argument name="ProductAttribute" value="colorProductAttribute"/> </actionGroup> @@ -38,12 +38,12 @@ <!-- Create configurable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="goToCreateProductPage" stepKey="createConfigurableProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="createConfigurableProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <!-- Fill configurable product values --> - <actionGroup ref="fillMainProductForm" stepKey="fillConfigurableProductValues"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillConfigurableProductValues"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> @@ -70,13 +70,13 @@ <!-- Assert child products generated sku in grid --> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="openProductCatalogPage"/> <waitForPageLoad stepKey="waitForProductCatalogPageLoad"/> - <actionGroup ref="filterProductGridByName2" stepKey="filterFirstProductByNameInGrid"> + <actionGroup ref="FilterProductGridByName2ActionGroup" stepKey="filterFirstProductByNameInGrid"> <argument name="name" value="{{colorConfigurableProductAttribute1.name}}"/> </actionGroup> <see selector="{{AdminProductGridSection.productGridCell('1', 'SKU')}}" userInput="{{ApiConfigurableProduct.sku}}-{{colorConfigurableProductAttribute1.name}}" stepKey="seeFirstProductSkuInGrid"/> - <actionGroup ref="filterProductGridByName2" stepKey="filterSecondProductByNameInGrid"> + <actionGroup ref="FilterProductGridByName2ActionGroup" stepKey="filterSecondProductByNameInGrid"> <argument name="name" value="{{colorConfigurableProductAttribute2.name}}"/> </actionGroup> <see selector="{{AdminProductGridSection.productGridCell('1', 'SKU')}}" userInput="{{ApiConfigurableProduct.sku}}-{{colorConfigurableProductAttribute2.name}}" stepKey="seeSecondProductSkuInGrid"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithCreatingCategoryAndAttributeTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithCreatingCategoryAndAttributeTest.xml index a7242b43c2b5f..00f166d0f29d0 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithCreatingCategoryAndAttributeTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithCreatingCategoryAndAttributeTest.xml @@ -23,25 +23,25 @@ </before> <after> <!-- Delete configurable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <!-- Delete children products --> - <actionGroup ref="deleteProductBySku" stepKey="deleteFirstChildProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteFirstChildProduct"> <argument name="sku" value="{{colorConfigurableProductAttribute1.sku}}"/> </actionGroup> - <actionGroup ref="deleteProductBySku" stepKey="deleteSecondChildProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteSecondChildProduct"> <argument name="sku" value="{{colorConfigurableProductAttribute2.sku}}"/> </actionGroup> <!-- Delete product attribute --> - <actionGroup ref="deleteProductAttributeByLabel" stepKey="deleteProductAttribute"> + <actionGroup ref="DeleteProductAttributeByLabelActionGroup" stepKey="deleteProductAttribute"> <argument name="ProductAttribute" value="colorProductAttribute"/> </actionGroup> <!-- Delete attribute set --> - <actionGroup ref="deleteAttributeSetByLabel" stepKey="deleteAttributeSet"> + <actionGroup ref="DeleteAttributeSetByLabelActionGroup" stepKey="deleteAttributeSet"> <argument name="label" value="{{ProductAttributeFrontendLabel.label}}"/> </actionGroup> @@ -55,7 +55,7 @@ <!-- Create configurable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="goToCreateProductPage" stepKey="createConfigurableProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="createConfigurableProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> @@ -90,7 +90,7 @@ <!-- Find configurable product in grid --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> <waitForPageLoad stepKey="waitForAdminProductPageLoad"/> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedConfigurableProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedConfigurableProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithDisabledChildrenProductsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithDisabledChildrenProductsTest.xml index 49f3f8b5ea931..3379e0d053ed9 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithDisabledChildrenProductsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithDisabledChildrenProductsTest.xml @@ -43,7 +43,7 @@ <actionGroup ref="noDisplayOutOfStockProduct" stepKey="revertDisplayOutOfStockProduct"/> <!-- Delete configurable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> @@ -59,12 +59,12 @@ <!-- Create configurable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="goToCreateProductPage" stepKey="createConfigurableProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="createConfigurableProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <!-- Fill configurable product values --> - <actionGroup ref="fillMainProductForm" stepKey="fillConfigurableProductValues"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillConfigurableProductValues"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> @@ -83,12 +83,12 @@ </actionGroup> <!-- Save configurable product --> - <actionGroup ref="saveProductForm" stepKey="saveConfigurableProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveConfigurableProduct"/> <!-- Find configurable product in grid --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> <waitForPageLoad stepKey="waitForAdminProductPageLoad"/> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedConfigurableProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedConfigurableProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml index 9796c14f5519a..d536ed1b4b960 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml @@ -46,7 +46,7 @@ </before> <after> <!-- Delete configurable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> @@ -62,12 +62,12 @@ <!--Create configurable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="goToCreateProductPage" stepKey="createConfigurableProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="createConfigurableProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <!-- Fill configurable product values --> - <actionGroup ref="fillMainProductForm" stepKey="fillConfigurableProductValues"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillConfigurableProductValues"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> @@ -75,7 +75,7 @@ <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createCategory.name$$]" stepKey="fillCategory" after="fillConfigurableProductValues"/> <!-- Add image to product --> - <actionGroup ref="addProductImage" stepKey="addImageForProduct"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageForProduct"> <argument name="image" value="MagentoLogo"/> </actionGroup> @@ -142,7 +142,7 @@ <!-- Assert product image in storefront product page --> <amOnPage url="{{ApiConfigurableProduct.urlKey}}.html" stepKey="amOnProductPage"/> - <actionGroup ref="assertProductImageStorefrontProductPage" stepKey="assertProductImageStorefrontProductPage"> + <actionGroup ref="AssertProductImageStorefrontProductPageActionGroup" stepKey="assertProductImageStorefrontProductPage"> <argument name="product" value="ApiConfigurableProduct"/> <argument name="image" value="MagentoLogo"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDisplayOutOfStockProductsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDisplayOutOfStockProductsTest.xml index 308e256543736..f12f34cbb02d6 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDisplayOutOfStockProductsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDisplayOutOfStockProductsTest.xml @@ -64,7 +64,7 @@ <actionGroup ref="noDisplayOutOfStockProduct" stepKey="revertDisplayOutOfStockProduct"/> <!-- Delete configurable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> @@ -82,12 +82,12 @@ <!--Create configurable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="goToCreateProductPage" stepKey="createConfigurableProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="createConfigurableProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <!--Fill configurable product values --> - <actionGroup ref="fillMainProductForm" stepKey="fillConfigurableProductValues"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillConfigurableProductValues"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> @@ -116,7 +116,7 @@ </actionGroup> <!-- Save configurable product --> - <actionGroup ref="saveProductForm" stepKey="saveConfigurableProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveConfigurableProduct"/> <!-- Display out of stock product --> <actionGroup ref="displayOutOfStockProduct" stepKey="displayOutOfStockProduct"/> @@ -137,4 +137,4 @@ <waitForPageLoad stepKey="waitForProductPageLoad"/> <see userInput="$$createConfigProductAttributeOptionThree.option[store_labels][1][label]$$" selector="{{StorefrontProductInfoMainSection.optionByAttributeId($$createConfigProductAttribute.attribute_id$$)}}" stepKey="assertOptionNotAvailable" /> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDontDisplayOutOfStockProductsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDontDisplayOutOfStockProductsTest.xml index e24ac07c30d1e..527900b1767bf 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDontDisplayOutOfStockProductsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDontDisplayOutOfStockProductsTest.xml @@ -61,7 +61,7 @@ </before> <after> <!-- Delete configurable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> @@ -79,12 +79,12 @@ <!--Create configurable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="goToCreateProductPage" stepKey="createConfigurableProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="createConfigurableProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <!--Fill configurable product values --> - <actionGroup ref="fillMainProductForm" stepKey="fillConfigurableProductValues"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillConfigurableProductValues"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> @@ -113,7 +113,7 @@ </actionGroup> <!-- Save configurable product --> - <actionGroup ref="saveProductForm" stepKey="saveConfigurableProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveConfigurableProduct"/> <!-- Flash cache --> <magentoCLI command="cache:flush" stepKey="flushCache"/> @@ -131,4 +131,4 @@ <waitForPageLoad stepKey="waitForPageLoad"/> <dontSee userInput="$$createConfigProductAttributeOptionThree.option[store_labels][1][label]$$" selector="{{StorefrontProductInfoMainSection.optionByAttributeId($$createConfigProductAttribute.attribute_id$$)}}" stepKey="assertOptionNotAvailable"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTierPriceForOneItemTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTierPriceForOneItemTest.xml index 51f4bf0279942..660651fecf69b 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTierPriceForOneItemTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTierPriceForOneItemTest.xml @@ -54,7 +54,7 @@ </before> <after> <!-- Delete configurable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> @@ -70,12 +70,12 @@ <!--Create configurable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitProductGridPageLoad"/> - <actionGroup ref="goToCreateProductPage" stepKey="createConfigurableProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="createConfigurableProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <!--Fill configurable product values --> - <actionGroup ref="fillMainProductForm" stepKey="fillConfigurableProductValues"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillConfigurableProductValues"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> @@ -96,7 +96,7 @@ </actionGroup> <!-- Save configurable product --> - <actionGroup ref="saveProductForm" stepKey="saveConfigurableProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveConfigurableProduct"/> <!-- Assert product tier price on product page --> <amOnPage url="{{ApiConfigurableProduct.urlKey}}.html" stepKey="amOnProductPage"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsAssignedToCategoryTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsAssignedToCategoryTest.xml index 1db9b3e5b79b2..2cee05be69bbe 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsAssignedToCategoryTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsAssignedToCategoryTest.xml @@ -26,25 +26,25 @@ </before> <after> <!-- Delete configurable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <!-- Delete children products --> - <actionGroup ref="deleteProductBySku" stepKey="deleteFirstChildProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteFirstChildProduct"> <argument name="sku" value="{{colorConfigurableProductAttribute1.sku}}"/> </actionGroup> - <actionGroup ref="deleteProductBySku" stepKey="deleteSecondChildProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteSecondChildProduct"> <argument name="sku" value="{{colorConfigurableProductAttribute2.sku}}"/> </actionGroup> <!-- Delete product attribute --> - <actionGroup ref="deleteProductAttributeByLabel" stepKey="deleteProductAttribute"> + <actionGroup ref="DeleteProductAttributeByLabelActionGroup" stepKey="deleteProductAttribute"> <argument name="ProductAttribute" value="colorProductAttribute"/> </actionGroup> <!-- Delete attribute set --> - <actionGroup ref="deleteAttributeSetByLabel" stepKey="deleteAttributeSet"> + <actionGroup ref="DeleteAttributeSetByLabelActionGroup" stepKey="deleteAttributeSet"> <argument name="label" value="{{ProductAttributeFrontendLabel.label}}"/> </actionGroup> @@ -58,12 +58,12 @@ <!-- Create configurable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="goToCreateProductPage" stepKey="createConfigurableProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="createConfigurableProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <!-- Fill configurable product values --> - <actionGroup ref="fillMainProductForm" stepKey="fillConfigurableProductValues"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillConfigurableProductValues"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> @@ -91,15 +91,15 @@ <actionGroup ref="saveConfigurableProductWithNewAttributeSet" stepKey="saveConfigurableProduct"/> <!-- Assert child products in grid --> - <actionGroup ref="viewProductInAdminGrid" stepKey="viewFirstChildProductInAdminGrid"> + <actionGroup ref="ViewProductInAdminGridActionGroup" stepKey="viewFirstChildProductInAdminGrid"> <argument name="product" value="colorConfigurableProductAttribute1"/> </actionGroup> - <actionGroup ref="viewProductInAdminGrid" stepKey="viewSecondChildProductInAdminGrid"> + <actionGroup ref="ViewProductInAdminGridActionGroup" stepKey="viewSecondChildProductInAdminGrid"> <argument name="product" value="colorConfigurableProductAttribute2"/> </actionGroup> <!-- Assert configurable product in grid --> - <actionGroup ref="filterProductGridBySkuAndName" stepKey="findCreatedConfigurableProduct"> + <actionGroup ref="FilterProductGridBySkuAndNameActionGroup" stepKey="findCreatedConfigurableProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <see selector="{{AdminProductGridSection.productGridCell('1', 'Type')}}" userInput="{{ApiConfigurableProduct.type_id}}" stepKey="seeProductTypeInGrid"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsWithoutAssignedToCategoryTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsWithoutAssignedToCategoryTest.xml index 934a410d58a8a..f36465b853317 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsWithoutAssignedToCategoryTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsWithoutAssignedToCategoryTest.xml @@ -22,25 +22,25 @@ </before> <after> <!-- Delete configurable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <!-- Delete children products --> - <actionGroup ref="deleteProductBySku" stepKey="deleteFirstChildProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteFirstChildProduct"> <argument name="sku" value="{{colorConfigurableProductAttribute1.sku}}"/> </actionGroup> - <actionGroup ref="deleteProductBySku" stepKey="deleteSecondChildProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteSecondChildProduct"> <argument name="sku" value="{{colorConfigurableProductAttribute2.sku}}"/> </actionGroup> <!-- Delete product attribute --> - <actionGroup ref="deleteProductAttributeByLabel" stepKey="deleteProductAttribute"> + <actionGroup ref="DeleteProductAttributeByLabelActionGroup" stepKey="deleteProductAttribute"> <argument name="ProductAttribute" value="colorProductAttribute"/> </actionGroup> <!-- Delete attribute set --> - <actionGroup ref="deleteAttributeSetByLabel" stepKey="deleteAttributeSet"> + <actionGroup ref="DeleteAttributeSetByLabelActionGroup" stepKey="deleteAttributeSet"> <argument name="label" value="{{ProductAttributeFrontendLabel.label}}"/> </actionGroup> @@ -51,12 +51,12 @@ <!-- Create configurable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="goToCreateProductPage" stepKey="createConfigurableProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="createConfigurableProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <!-- Fill configurable product values --> - <actionGroup ref="fillMainProductForm" stepKey="fillConfigurableProductValues"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillConfigurableProductValues"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> @@ -81,15 +81,15 @@ <actionGroup ref="saveConfigurableProductWithNewAttributeSet" stepKey="saveConfigurableProduct"/> <!-- Assert Child Products in grid --> - <actionGroup ref="viewProductInAdminGrid" stepKey="viewFirstChildProductInAdminGrid"> + <actionGroup ref="ViewProductInAdminGridActionGroup" stepKey="viewFirstChildProductInAdminGrid"> <argument name="product" value="colorConfigurableProductAttribute1"/> </actionGroup> - <actionGroup ref="viewProductInAdminGrid" stepKey="viewSecondChildProductInAdminGrid"> + <actionGroup ref="ViewProductInAdminGridActionGroup" stepKey="viewSecondChildProductInAdminGrid"> <argument name="product" value="colorConfigurableProductAttribute2"/> </actionGroup> <!-- Assert Configurable Product in grid --> - <actionGroup ref="filterProductGridBySkuAndName" stepKey="findCreatedConfigurableProduct"> + <actionGroup ref="FilterProductGridBySkuAndNameActionGroup" stepKey="findCreatedConfigurableProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <see selector="{{AdminProductGridSection.productGridCell('1', 'Type')}}" userInput="{{ApiConfigurableProduct.type_id}}" stepKey="seeProductTypeInGrid"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminDeleteConfigurableProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminDeleteConfigurableProductTest.xml index fb2920be528b6..c2edbaa4e6e87 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminDeleteConfigurableProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminDeleteConfigurableProductTest.xml @@ -28,7 +28,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <actionGroup ref="logout" stepKey="logout"/> </after> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteConfigurableProductFilteredBySkuAndName"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteConfigurableProductFilteredBySkuAndName"> <argument name="product" value="$$createConfigurableProduct$$"/> </actionGroup> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml index fa21d20eb4456..6dc77b691bb4f 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml @@ -39,7 +39,7 @@ <comment userInput="Delete product" stepKey="commentDeleteProduct"/> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteAttribute"/> - <actionGroup ref="deleteAllDuplicateProductUsingProductGrid" stepKey="deleteAllDuplicateProducts"> + <actionGroup ref="DeleteAllDuplicateProductUsingProductGridActionGroup" stepKey="deleteAllDuplicateProducts"> <argument name="product" value="$$createProduct$$"/> </actionGroup> <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearProductFilters"/> @@ -56,7 +56,7 @@ <!--Assert configurable product on Admin product page grid--> <comment userInput="Assert configurable product in Admin product page grid" stepKey="commentAssertConfigProductOnAdmin"/> <amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="goToCatalogProductPage"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterProductGridBySku"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGridBySku"> <argument name="sku" value="$$createProduct.sku$$"/> </actionGroup> <see selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="$$createProduct.name$$" stepKey="seeProductNameInGrid"/> @@ -97,11 +97,11 @@ <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{SimpleProduct2.quantity}}" stepKey="fillProductQty"/> <clearField selector="{{AdminProductFormSection.productWeight}}" stepKey="clearWeightField"/> <selectOption selector="{{AdminProductFormSection.productWeightSelect}}" userInput="This item has no weight" stepKey="selectNoWeight"/> - <actionGroup ref="saveProductForm" stepKey="saveVirtualProductForm"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveVirtualProductForm"/> <!--Assert virtual product on Admin product page grid--> <comment userInput="Assert virtual product on Admin product page grid" stepKey="commentAssertVirtualProductOnAdmin"/> <amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="goToCatalogProductPageForVirtual"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterProductGridBySkuForVirtual"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGridBySkuForVirtual"> <argument name="sku" value="$$createProduct.sku$$"/> </actionGroup> <see selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="$$createProduct.name$$" stepKey="seeVirtualProductNameInGrid"/> @@ -143,7 +143,7 @@ <comment userInput="Delete product" stepKey="commentDeleteProduct"/> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteAttribute"/> - <actionGroup ref="deleteAllDuplicateProductUsingProductGrid" stepKey="deleteAllDuplicateProducts"> + <actionGroup ref="DeleteAllDuplicateProductUsingProductGridActionGroup" stepKey="deleteAllDuplicateProducts"> <argument name="product" value="$$createProduct$$"/> </actionGroup> <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearProductFilters"/> @@ -161,7 +161,7 @@ <!--Assert configurable product on Admin product page grid--> <comment userInput="Assert configurable product in Admin product page grid" stepKey="commentAssertConfigurableProductOnAdmin"/> <amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="goToCatalogProductPageForConfigurable"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterProductGridBySkuForConfigurable"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGridBySkuForConfigurable"> <argument name="sku" value="$$createProduct.sku$$"/> </actionGroup> <see selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="$$createProduct.name$$" stepKey="seeConfigurableProductNameInGrid"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminRelatedProductsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminRelatedProductsTest.xml index aa34693ed82f0..166c31d0460a9 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminRelatedProductsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminRelatedProductsTest.xml @@ -94,18 +94,18 @@ <comment userInput="Filter and edit simple product 1" stepKey="filterAndEditComment1"/> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="productIndexPage"/> <waitForPageLoad time="30" stepKey="waitForPageLoad1"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridSimple"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridSimple"> <argument name="product" value="$$simple1Handle$$"/> </actionGroup> - <actionGroup ref="openProducForEditByClickingRowXColumnYInProductGrid" stepKey="openProducForEditByClickingRow1Column2InProductGrid"/> + <actionGroup ref="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup" stepKey="openProducForEditByClickingRow1Column2InProductGrid"/> <conditionalClick selector="{{AdminProductFormSection.productFormTab('Related Products')}}" dependentSelector="{{AdminProductFormSection.productFormTabState('Related Products', 'closed')}}" visible="true" stepKey="openRelatedProductTab"/> <waitForPageLoad time="30" stepKey="waitForPageLoad3"/> <!-- TODO: move adding related product to a action group when nested action group is allowed (ref#: MQE-539)--> <comment userInput="Add related simple product to simple product" stepKey="addSimpleToSimpleComment"/> <click selector="{{AdminProductFormRelatedUpSellCrossSellSection.AddRelatedProductsButton}}" stepKey="clickAddRelatedProductButton"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridSimple1"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridSimple1"> <argument name="product" value="$$simple2Handle$$"/> </actionGroup> <click selector="{{AdminProductModalSlideGridSection.productGridXRowYColumnButton('1', '1')}}" stepKey="selectSimpleTwo"/> @@ -114,7 +114,7 @@ <comment userInput="Add related config product to simple product" stepKey="addConfigToSimpleComment"/> <click selector="{{AdminProductFormRelatedUpSellCrossSellSection.AddRelatedProductsButton}}" stepKey="clickAddRelatedProductButton2"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridSimpleForRelatedConfig1"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridSimpleForRelatedConfig1"> <argument name="product" value="$$baseConfigProductHandle$$"/> </actionGroup> <click selector="{{AdminProductModalSlideGridSection.productGridXRowYColumnButton('1', '1')}}" stepKey="selectConfigProduct"/> @@ -122,16 +122,16 @@ <click selector="{{AdminAddRelatedProductsModalSection.AddSelectedProductsButton}}" stepKey="addRelatedProductSelected2"/> <comment userInput="Save simple product" stepKey="saveSimpleProductComment"/> - <actionGroup ref="saveProductForm" stepKey="saveRelatedProduct1"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveRelatedProduct1"/> <comment userInput="Assert related simple products for simple product in Admin Product Form" stepKey="assertRelated1Comment"/> - <actionGroup ref="AssertTextInAdminProductRelatedUpSellCrossSellSection" stepKey="assertRelated1"> + <actionGroup ref="AssertTextInAdminProductRelatedUpSellCrossSellSectionActionGroup" stepKey="assertRelated1"> <argument name="element" value="AdminProductFormRelatedUpSellCrossSellSection.relatedProductSectionText"/> <argument name="expectedText" value="$$simple2Handle.name$$"/> </actionGroup> <comment userInput="Assert related config products for simple product in Admin Product Form" stepKey="assertRelated2Comment"/> - <actionGroup ref="AssertTextInAdminProductRelatedUpSellCrossSellSection" stepKey="assertRelated2"> + <actionGroup ref="AssertTextInAdminProductRelatedUpSellCrossSellSectionActionGroup" stepKey="assertRelated2"> <argument name="element" value="AdminProductFormRelatedUpSellCrossSellSection.relatedProductSectionText"/> <argument name="expectedText" value="$$baseConfigProductHandle.name$$"/> </actionGroup> @@ -139,17 +139,17 @@ <comment userInput="Filter and edit config product" stepKey="filterAndEditComment2"/> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="productIndexPage2"/> <waitForPageLoad time="30" stepKey="waitForPageLoad5"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial2"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridConfig"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial2"/> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridConfig"> <argument name="product" value="$$baseConfigProductHandle$$"/> </actionGroup> - <actionGroup ref="openProducForEditByClickingRowXColumnYInProductGrid" stepKey="openProducForEditByClickingRow1Column2InProductGrid2"/> + <actionGroup ref="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup" stepKey="openProducForEditByClickingRow1Column2InProductGrid2"/> <conditionalClick selector="{{AdminProductFormSection.productFormTab('Related Products')}}" dependentSelector="{{AdminProductFormSection.productFormTabState('Related Products', 'closed')}}" visible="true" stepKey="openRelatedProductTab2"/> <waitForPageLoad time="30" stepKey="waitForPageLoad7"/> <comment userInput="Add related simple product to config product" stepKey="addSimpleToConfigComment"/> <click selector="{{AdminProductFormRelatedUpSellCrossSellSection.AddRelatedProductsButton}}" stepKey="clickAddRelatedProductButton3"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridForConfig3"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridForConfig3"> <argument name="product" value="$$simple2Handle$$"/> </actionGroup> <click selector="{{AdminProductModalSlideGridSection.productGridXRowYColumnButton('1', '1')}}" stepKey="selectSimpleTwo2"/> @@ -157,10 +157,10 @@ <click selector="{{AdminAddRelatedProductsModalSection.AddSelectedProductsButton}}" stepKey="addRelatedProductSelected3"/> <comment userInput="Save config product" stepKey="saveConfigProductComment"/> - <actionGroup ref="saveProductForm" stepKey="saveRelatedProduct2"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveRelatedProduct2"/> <comment userInput="Assert related simple product for config product in Admin Product Form" stepKey="assertRelated3Comment"/> - <actionGroup ref="AssertTextInAdminProductRelatedUpSellCrossSellSection" stepKey="assertRelated3"> + <actionGroup ref="AssertTextInAdminProductRelatedUpSellCrossSellSectionActionGroup" stepKey="assertRelated3"> <argument name="element" value="AdminProductFormRelatedUpSellCrossSellSection.relatedProductSectionText"/> <argument name="expectedText" value="$$simple2Handle.name$$"/> </actionGroup> @@ -187,7 +187,7 @@ <comment userInput="Check related product in product page" stepKey="checkRelatedProductInProductPageComment"/> <click selector="{{StorefrontProductRelatedProductsSection.relatedProductCheckBoxButton('$$simple2Handle.name$$')}}" stepKey="checkRelatedProcut"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$$baseConfigProductHandle.name$$"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminRemoveDefaultImageConfigurableTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminRemoveDefaultImageConfigurableTest.xml index e7492f4eeaecf..0cc73f117aaad 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminRemoveDefaultImageConfigurableTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminRemoveDefaultImageConfigurableTest.xml @@ -93,33 +93,33 @@ <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="productIndexPage"/> <waitForPageLoad time="30" stepKey="waitForPageLoad1"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGrid"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGrid"> <argument name="product" value="$$baseConfigProductHandle$$"/> </actionGroup> - <actionGroup ref="openProducForEditByClickingRowXColumnYInProductGrid" stepKey="openProducForEditByClickingRow1Column2InProductGrid1"/> + <actionGroup ref="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup" stepKey="openProducForEditByClickingRow1Column2InProductGrid1"/> <!-- Add image to product --> - <actionGroup ref="addProductImage" stepKey="addImageForProduct"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageForProduct"> <argument name="image" value="MagentoLogo"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Remove image from product --> - <actionGroup ref="removeProductImage" stepKey="removeProductImage"/> + <actionGroup ref="RemoveProductImageActionGroup" stepKey="removeProductImage"/> - <actionGroup ref="saveProductForm" stepKey="saveProductFormAfterRemove"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductFormAfterRemove"/> <!-- Assert product image not in admin product form --> - <actionGroup ref="assertProductImageNotInAdminProductPage" stepKey="assertProductImageNotInAdminProductPage"/> + <actionGroup ref="AssertProductImageNotInAdminProductPageActionGroup" stepKey="assertProductImageNotInAdminProductPage"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="AssertProductInStorefrontProductPageAfterRemove"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="AssertProductInStorefrontProductPageAfterRemove"> <argument name="product" value="$$baseConfigProductHandle$$"/> </actionGroup> <!-- Assert product image not in storefront product page --> - <actionGroup ref="assertProductImageNotInStorefrontProductPage2" stepKey="assertProductImageNotInStorefrontProductPage2"> + <actionGroup ref="AssertProductImageNotInStorefrontProductPage2ActionGroup" stepKey="assertProductImageNotInStorefrontProductPage2"> <argument name="product" value="$$baseConfigProductHandle$$"/> </actionGroup> </test> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CAdminTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CAdminTest.xml index 6bbb97c66cdd8..dccacbdc3d6f6 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CAdminTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CAdminTest.xml @@ -11,11 +11,11 @@ <!--Create configurable product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageConfigurable" after="seeSimpleProductInGrid"/> <waitForPageLoad stepKey="waitForProductPageLoadConfigurable" after="visitAdminProductPageConfigurable"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateConfigurableProduct" after="waitForProductPageLoadConfigurable"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateConfigurableProduct" after="waitForProductPageLoadConfigurable"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> - <actionGroup ref="checkRequiredFieldsInProductForm" stepKey="checkRequiredFieldsProductConfigurable" after="goToCreateConfigurableProduct"/> - <actionGroup ref="fillMainProductForm" stepKey="fillConfigurableProductMain" after="checkRequiredFieldsProductConfigurable"> + <actionGroup ref="CheckRequiredFieldsInProductFormActionGroup" stepKey="checkRequiredFieldsProductConfigurable" after="goToCreateConfigurableProduct"/> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillConfigurableProductMain" after="checkRequiredFieldsProductConfigurable"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> <!--Create product configurations--> @@ -69,8 +69,8 @@ <!--@TODO Move cleanup to "after" when MQE-830 is resolved--> <comment userInput="Clean up configurable product" stepKey="cleanUpConfigurableProduct" after="deleteSimpleProduct"/> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteConfigurableProduct" after="cleanUpConfigurableProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteConfigurableProduct" after="cleanUpConfigurableProduct"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoOptionAvailableToConfigureDisabledProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoOptionAvailableToConfigureDisabledProductTest.xml index fd607d2203c66..4f21e80844736 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoOptionAvailableToConfigureDisabledProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoOptionAvailableToConfigureDisabledProductTest.xml @@ -109,13 +109,13 @@ <amOnPage url="{{AdminProductEditPage.url($$createConfigChildProduct1.id$$)}}" stepKey="goToEditPage"/> <waitForPageLoad stepKey="waitForChildProductPageLoad"/> <click selector="{{AdminProductFormSection.enableProductLabel}}" stepKey="disableProduct"/> - <actionGroup ref="saveProductForm" stepKey="saveProductForm"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> <!-- Set the second product out of stock --> <comment userInput="Set the second product out of stock" stepKey="outOfStockChildProduct"/> <amOnPage url="{{AdminProductEditPage.url($$createConfigChildProduct2.id$$)}}" stepKey="goToSecondProductEditPage"/> <waitForPageLoad stepKey="waitForSecondChildProductPageLoad"/> <selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="Out of Stock" stepKey="outOfStockStatus"/> - <actionGroup ref="saveProductForm" stepKey="saveSecondProductForm"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSecondProductForm"/> <!-- Go to created customer page --> <comment userInput="Go to created customer page" stepKey="goToCreatedCustomerPage"/> <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="createNewOrder"> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml index c3459aec34492..9152adc6c2e79 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml @@ -49,7 +49,7 @@ <waitForPageLoad stepKey="waitForProductPage"/> <fillField selector="{{StorefrontProductInfoMainSection.qty}}" userInput="4" stepKey="fillQuantity"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$$createConfigProduct.name$$"/> </actionGroup> @@ -91,7 +91,7 @@ <amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="GoToCatalogProductPage"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterProductGridBySku"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGridBySku"> <argument name="sku" value="$$createConfigProduct.sku$$"/> </actionGroup> <see selector="{{AdminProductGridSection.productGridCell('1', 'Quantity')}}" userInput="99" stepKey="seeProductSkuInGrid"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductCategoryViewChildOnlyTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductCategoryViewChildOnlyTest.xml index 805727e29a17a..9d7807c543def 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductCategoryViewChildOnlyTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductCategoryViewChildOnlyTest.xml @@ -102,10 +102,10 @@ <!-- Go to the product page for the first product --> <amOnPage stepKey="goToProductGrid" url="{{ProductCatalogPage.url}}"/> <waitForPageLoad stepKey="waitForProductGridLoad"/> - <actionGroup stepKey="searchForSimpleProduct" ref="filterProductGridBySku2"> + <actionGroup stepKey="searchForSimpleProduct" ref="FilterProductGridBySku2ActionGroup"> <argument name="sku" value="$$createConfigChildProduct1.sku$$"/> </actionGroup> - <actionGroup stepKey="openProductEditPage" ref="openProducForEditByClickingRowXColumnYInProductGrid"/> + <actionGroup stepKey="openProductEditPage" ref="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup"/> <!-- Edit the visibility the first simple product --> <selectOption selector="{{AdminProductFormSection.visibility}}" userInput="Catalog, Search" stepKey="selectVisibilityCatalogSearch"/> <!--Add to category--> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductChildSearchTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductChildSearchTest.xml index 16400fa837b1c..294ab9fd0664d 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductChildSearchTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductChildSearchTest.xml @@ -119,10 +119,10 @@ <!-- Go to the product page for the first product --> <amOnPage stepKey="goToProductGrid" url="{{ProductCatalogPage.url}}"/> <waitForPageLoad stepKey="waitForProductGridLoad"/> - <actionGroup stepKey="searchForSimpleProduct" ref="filterProductGridBySku2"> + <actionGroup stepKey="searchForSimpleProduct" ref="FilterProductGridBySku2ActionGroup"> <argument name="sku" value="$$createConfigChildProduct1.sku$$"/> </actionGroup> - <actionGroup stepKey="openProductEditPage" ref="openProducForEditByClickingRowXColumnYInProductGrid"/> + <actionGroup stepKey="openProductEditPage" ref="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup"/> <!-- Edit the attribute for the first simple product --> <selectOption stepKey="editSelectAttribute" selector="{{ModifyAttributes.nthExistingAttribute($$createConfigProductAttributeSelect.default_frontend_label$$)}}" userInput="$$createConfigProductAttributeSelectOption1.option[store_labels][0][label]$$"/> @@ -156,4 +156,4 @@ <submitForm selector="#search_mini_form" parameterArray="['q' => $$createConfigChildProduct1.custom_attributes[short_description]$$]" stepKey="searchStorefront3" /> <seeElement stepKey="seeProduct3" selector="{{StorefrontCategoryProductSection.ProductTitleByName('$$createConfigProduct.name$$')}}"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest.xml index 2f5ee036b1420..6a2d1867a691f 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest.xml @@ -31,7 +31,7 @@ </before> <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductsGridFilters"/> @@ -76,7 +76,7 @@ </before> <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductsGridFilters"/> @@ -121,7 +121,7 @@ </before> <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductsGridFilters"/> @@ -163,7 +163,7 @@ </before> <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductsGridFilters"/> @@ -213,7 +213,7 @@ </before> <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> <argument name="sku" value="{{BaseConfigurableProduct.sku}}"/> </actionGroup> <deleteData createDataKey="createFirstAttribute" stepKey="deleteFirstAttribute"/> @@ -223,16 +223,16 @@ </after> <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPage"/> - <actionGroup ref="goToCreateProductPage" stepKey="navigateToCreateProductPage"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="navigateToCreateProductPage"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> - <actionGroup ref="fillMainProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> - <actionGroup ref="SetCategoryByName" stepKey="addCategoryToProduct"> + <actionGroup ref="SetCategoryByNameActionGroup" stepKey="addCategoryToProduct"> <argument name="categoryName" value="$createCategory.name$"/> </actionGroup> - <actionGroup ref="SetProductUrlKeyByString" stepKey="fillUrlKey"> + <actionGroup ref="SetProductUrlKeyByStringActionGroup" stepKey="fillUrlKey"> <argument name="urlKey" value="{{BaseConfigurableProduct.urlKey}}"/> </actionGroup> <click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickOnCreateConfigurations"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest.xml index 65e1d3a74f060..d40b0efa8ad4b 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest.xml @@ -34,7 +34,7 @@ <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> - <actionGroup stepKey="deleteProduct" ref="deleteProductBySku"> + <actionGroup stepKey="deleteProduct" ref="DeleteProductBySkuActionGroup"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> <actionGroup ref="logout" stepKey="adminLogout"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductWithFileCustomOptionTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductWithFileCustomOptionTest.xml index 4c955f3385643..a9d7f35a50c8a 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductWithFileCustomOptionTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductWithFileCustomOptionTest.xml @@ -36,9 +36,9 @@ <argument name="category" value="$$createCategory$$"/> </actionGroup> <!--Add custom option to configurable product--> - <actionGroup ref="AddProductCustomOptionFile" stepKey="addCustomOptionToProduct"/> + <actionGroup ref="AddProductCustomOptionFileActionGroup" stepKey="addCustomOptionToProduct"/> <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct"/> - + <!--Go to storefront--> <amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToHomePage"/> <waitForPageLoad stepKey="waitForHomePageLoad"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml index bc8f3e49272b7..8d08f599db6a0 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml @@ -89,10 +89,10 @@ </createData> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!--SKU Product Attribute is enabled for Promo Rule Conditions--> - <actionGroup ref="navigateToEditProductAttribute" stepKey="navigateToSkuProductAttribute"> + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="navigateToSkuProductAttribute"> <argument name="ProductAttribute" value="sku"/> </actionGroup> - <actionGroup ref="changeUseForPromoRuleConditionsProductAttribute" stepKey="changeUseForPromoRuleConditionsProductAttributeToYes"> + <actionGroup ref="ChangeUseForPromoRuleConditionsProductAttributeActionGroup" stepKey="changeUseForPromoRuleConditionsProductAttributeToYes"> <argument name="option" value="Yes"/> </actionGroup> <magentoCLI command="indexer:reindex" stepKey="reindex1"/> @@ -110,17 +110,17 @@ <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/> <!--SKU Product Attribute is disable for Promo Rule Conditions--> - <actionGroup ref="navigateToEditProductAttribute" stepKey="navigateToSkuProductAttribute"> + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="navigateToSkuProductAttribute"> <argument name="ProductAttribute" value="sku"/> </actionGroup> - <actionGroup ref="changeUseForPromoRuleConditionsProductAttribute" stepKey="changeUseForPromoRuleConditionsProductAttributeToNo"> + <actionGroup ref="ChangeUseForPromoRuleConditionsProductAttributeActionGroup" stepKey="changeUseForPromoRuleConditionsProductAttributeToNo"> <argument name="option" value="No"/> </actionGroup> <actionGroup ref="logout" stepKey="logoutFromAdmin"/> </after> <!--Open category with products and Sort by price desc--> - <actionGroup ref="GoToStorefrontCategoryPageByParameters" stepKey="goToStorefrontCategoryPage"> + <actionGroup ref="GoToStorefrontCategoryPageByParametersActionGroup" stepKey="goToStorefrontCategoryPage"> <argument name="category" value="$$createCategory.custom_attributes[url_key]$$"/> <argument name="mode" value="grid"/> <argument name="numOfProductsPerPage" value="25"/> @@ -143,7 +143,7 @@ <magentoCLI command="cache:flush" stepKey="flushCache"/> <!--Reopen category with products and Sort by price desc--> - <actionGroup ref="GoToStorefrontCategoryPageByParameters" stepKey="goToStorefrontCategoryPage2"> + <actionGroup ref="GoToStorefrontCategoryPageByParametersActionGroup" stepKey="goToStorefrontCategoryPage2"> <argument name="category" value="$$createCategory.custom_attributes[url_key]$$"/> <argument name="mode" value="grid"/> <argument name="numOfProductsPerPage" value="9"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVerifyConfigurableProductLayeredNavigationTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVerifyConfigurableProductLayeredNavigationTest.xml index 182c8c069ab23..3ebd9d6ef5367 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVerifyConfigurableProductLayeredNavigationTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVerifyConfigurableProductLayeredNavigationTest.xml @@ -122,7 +122,7 @@ <!-- Open Product Index Page and Filter First Child product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPageToLoad"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProduct"> <argument name="product" value="ApiSimpleOne"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml index 749d1bee0661a..e3ab26fa2fff4 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml @@ -30,17 +30,17 @@ <after> <!--Delete created data--> <comment userInput="Delete created data" stepKey="commentDeleteCreatedData"/> - <actionGroup ref="deleteAllDuplicateProductUsingProductGrid" stepKey="deleteDuplicatedProduct"> + <actionGroup ref="DeleteAllDuplicateProductUsingProductGridActionGroup" stepKey="deleteDuplicatedProduct"> <argument name="product" value="$$createConfigProduct$$"/> </actionGroup> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetGridToDefaultKeywordSearch"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetGridToDefaultKeywordSearch"/> <!--Delete product attributes--> <comment userInput="Delete product attributes" stepKey="deleteCommentAttributes"/> - <actionGroup ref="deleteProductAttributeByLabel" stepKey="deleteProductAttribute"> + <actionGroup ref="DeleteProductAttributeByLabelActionGroup" stepKey="deleteProductAttribute"> <argument name="ProductAttribute" value="colorProductAttribute"/> </actionGroup> <click selector="{{AdminProductAttributeGridSection.ResetFilter}}" stepKey="resetFiltersOnGridFirst"/> - <actionGroup ref="deleteProductAttributeByLabel" stepKey="deleteProductSecondAttribute"> + <actionGroup ref="DeleteProductAttributeByLabelActionGroup" stepKey="deleteProductSecondAttribute"> <argument name="ProductAttribute" value="productAttributeColor"/> </actionGroup> <click selector="{{AdminProductAttributeGridSection.ResetFilter}}" stepKey="resetFiltersOnGridSecond"/> @@ -51,11 +51,11 @@ <comment userInput="Create attribute and options for product" stepKey="commentCreateAttributesAndOptions"/> <amOnPage url="{{AdminProductEditPage.url($$createConfigProduct.id$$)}}" stepKey="navigateToConfigProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> - <actionGroup ref="addProductImage" stepKey="addImageForProduct1"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageForProduct1"> <argument name="image" value="MagentoLogo"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProductForm"/> - <actionGroup ref="AdminCreateAttributeFromProductPageWithScope" stepKey="createAttributeForProduct"> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> + <actionGroup ref="AdminCreateAttributeFromProductPageWithScopeActionGroup" stepKey="createAttributeForProduct"> <argument name="attributeName" value="{{colorProductAttribute.default_label}}"/> <argument name="attributeType" value="{{colorProductAttribute.input_type}}"/> <argument name="scope" value="Global"/> @@ -111,7 +111,7 @@ <waitForPageLoad stepKey="waitForSummaryPageLoad"/> <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButtonToGenerateConfigs"/> <waitForPageLoad stepKey="waitForConfigurableProductPageLoad"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!--Duplicate the product--> <comment userInput="Duplicate the product" stepKey="commentDuplicateProduct"/> <actionGroup ref="AdminFormSaveAndDuplicate" stepKey="saveAndDuplicateProductForm"/> @@ -120,8 +120,8 @@ <selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="1" stepKey="selectInStock"/> <!--Change product image--> <comment userInput="Change product image" stepKey="commentChangeProductImage"/> - <actionGroup ref="removeProductImage" stepKey="removeProductImage"/> - <actionGroup ref="addProductImage" stepKey="addImageForProduct"> + <actionGroup ref="RemoveProductImageActionGroup" stepKey="removeProductImage"/> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageForProduct"> <argument name="image" value="TestImageAdobe"/> </actionGroup> <!--Disable configurations--> @@ -132,10 +132,10 @@ <actionGroup ref="AdminConfigurableProductDisableConfigurationsActionGroup" stepKey="disableSecondConfig"> <argument name="productName" value="{{colorConfigurableProductAttribute2.name}}"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveDuplicatedProductForm"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveDuplicatedProductForm"/> <!--Create new configurations with another attribute--> <comment userInput="Create new configurations with another attribute" stepKey="commentCreateNewConfigurations"/> - <actionGroup ref="AdminCreateAttributeFromProductPageWithScope" stepKey="createAttributeForDuplicatedProduct"> + <actionGroup ref="AdminCreateAttributeFromProductPageWithScopeActionGroup" stepKey="createAttributeForDuplicatedProduct"> <argument name="attributeName" value="{{productAttributeColor.default_label}}"/> <argument name="attributeType" value="{{productAttributeColor.input_type}}"/> <argument name="scope" value="Global"/> @@ -187,7 +187,7 @@ <waitForPageLoad stepKey="waitForSummaryPageLoadForDuplicatedProduct"/> <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="generateConfigsForDuplicatedProduct"/> <waitForPageLoad stepKey="waitForDuplicatedProductPageLoad"/> - <actionGroup ref="saveProductForm" stepKey="saveDuplicatedProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveDuplicatedProduct"/> <magentoCLI command="indexer:reindex" stepKey="reindex"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> <!--Assert configurable product in category--> diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayWhenChooseThreeAllowedCurrenciesTest.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayWhenChooseThreeAllowedCurrenciesTest.xml index 26fbfd394be68..feaef865a5e17 100644 --- a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayWhenChooseThreeAllowedCurrenciesTest.xml +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayWhenChooseThreeAllowedCurrenciesTest.xml @@ -48,7 +48,7 @@ <actionGroup ref="StorefrontSwitchCurrency" stepKey="switchCurrency"> <argument name="currency" value="RUB"/> </actionGroup> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontNewProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontNewProductPage"> <argument name="productName" value="$$createNewProduct.name$$"/> </actionGroup> <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="guestGoToCheckoutNewProductFromMinicart" /> diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayedInOneLineTest.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayedInOneLineTest.xml index dc6bdf3db542e..aa3c356d20a20 100644 --- a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayedInOneLineTest.xml +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayedInOneLineTest.xml @@ -51,7 +51,7 @@ <!--Open created product on Storefront and place for order--> <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="goToProductPage"/> <waitForPageLoad stepKey="waitForProductPagePageLoad"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$$createProduct.name$$"/> </actionGroup> <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="guestGoToCheckoutFromMinicart" /> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminProductBackRedirectNavigateFromCustomerViewCartProduct.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminProductBackRedirectNavigateFromCustomerViewCartProduct.xml index b5db354d54371..18106836ce137 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminProductBackRedirectNavigateFromCustomerViewCartProduct.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminProductBackRedirectNavigateFromCustomerViewCartProduct.xml @@ -37,7 +37,7 @@ </actionGroup> <!-- Add product to cart --> - <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> <argument name="product" value="$$createProduct$$"/> </actionGroup> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/PasswordAutocompleteOffTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/PasswordAutocompleteOffTest.xml index f364d24806b9c..6d8f55daecc13 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/PasswordAutocompleteOffTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/PasswordAutocompleteOffTest.xml @@ -42,7 +42,7 @@ </after> <!-- Go to the created product page and add it to the cart--> - <actionGroup ref="AddSimpleProductToCart" stepKey="cartAddSimpleProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="cartAddSimpleProductToCart"> <argument name="product" value="$$product$$"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultImageDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultImageDownloadableProductTest.xml index a7ce96ddf1fde..e801f890c34b9 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultImageDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultImageDownloadableProductTest.xml @@ -23,7 +23,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> </before> <after> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> <magentoCLI stepKey="removeDownloadableDomain" command="downloadable:domains:remove static.magento.com"/> @@ -33,15 +33,15 @@ <!-- Create product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="adminProductIndexPageAdd"/> <waitForPageLoad stepKey="waitForProductIndexPageLoad"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProductPage"> <argument name="product" value="DownloadableProduct"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillMainProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillMainProductForm"> <argument name="product" value="DownloadableProduct"/> </actionGroup> <!-- Add image to product --> - <actionGroup ref="addProductImage" stepKey="addImageForProduct"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageForProduct"> <argument name="image" value="MagentoLogo"/> </actionGroup> @@ -59,18 +59,18 @@ </actionGroup> <!--Save product--> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Assert product image in admin product form --> - <actionGroup ref="assertProductImageAdminProductPage" stepKey="assertProductImageAdminProductPage"/> + <actionGroup ref="AssertProductImageAdminProductPageActionGroup" stepKey="assertProductImageAdminProductPage"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="DownloadableProduct"/> </actionGroup> <!-- Assert product image in storefront product page --> - <actionGroup ref="assertProductImageStorefrontProductPage" stepKey="assertProductImageStorefrontProductPage"> + <actionGroup ref="AssertProductImageStorefrontProductPageActionGroup" stepKey="assertProductImageStorefrontProductPage"> <argument name="product" value="DownloadableProduct"/> <argument name="image" value="MagentoLogo"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultVideoDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultVideoDownloadableProductTest.xml index d95ddaf12470d..4129fc50c4f7e 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultVideoDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultVideoDownloadableProductTest.xml @@ -26,10 +26,10 @@ </after> <!-- Create a downloadable product --> <!-- Replacing steps in base AdminAddDefaultVideoSimpleProductTest --> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProductPage"> <argument name="product" value="DownloadableProduct"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillMainProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillMainProductForm"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -48,7 +48,7 @@ </actionGroup> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="DownloadableProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateAndEditDownloadableProductSettingsTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateAndEditDownloadableProductSettingsTest.xml index 2a7f5b437115b..ebd36dddc0b6c 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateAndEditDownloadableProductSettingsTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateAndEditDownloadableProductSettingsTest.xml @@ -24,7 +24,7 @@ </before> <after> <!-- Delete created downloadable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -33,12 +33,12 @@ </after> <!-- Create new downloadable product --> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createDownloadableProduct"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createDownloadableProduct"> <argument name="productType" value="downloadable"/> </actionGroup> <!-- Fill all main fields --> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillMainProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillMainProductForm"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -53,7 +53,7 @@ </actionGroup> <!-- Save product form --> - <actionGroup ref="saveProductForm" stepKey="clickSaveButton"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveButton"/> <!-- Open product page --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage"> @@ -93,7 +93,7 @@ <actionGroup ref="AdminSwitchProductGiftMessageStatusActionGroup" stepKey="disableGiftMessageSettings"/> <!-- Save product form --> - <actionGroup ref="saveProductForm" stepKey="clickSaveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveProduct"/> <!-- Verify Url Key after changing --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateAndSwitchProductType.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateAndSwitchProductType.xml index 55740af4d834f..d3933ae4fae7d 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateAndSwitchProductType.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateAndSwitchProductType.xml @@ -19,11 +19,11 @@ <group value="catalog"/> <group value="mtf_migrated"/> </annotations> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="openProductFillForm"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="openProductFillForm"> <argument name="productType" value="downloadable"/> </actionGroup> <!-- Fill form for Virtual Product Type --> - <actionGroup ref="fillMainProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="_defaultProduct"/> </actionGroup> <see selector="{{AdminProductGridSection.productGridCell('1', 'Type')}}" userInput="Simple Product" stepKey="seeProductTypeInGrid"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductAndAssignItToCustomStoreTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductAndAssignItToCustomStoreTest.xml index 4f07334640cf3..3ea48542ad96d 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductAndAssignItToCustomStoreTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductAndAssignItToCustomStoreTest.xml @@ -33,7 +33,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete created downloadable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -50,12 +50,12 @@ <!-- Create Downloadable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createProduct"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createProduct"> <argument name="productType" value="downloadable"/> </actionGroup> <!-- Fill downloadable product values --> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillDownloadableProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillDownloadableProductForm"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -74,7 +74,7 @@ </actionGroup> <!-- Save product --> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Switch default store view on store view created below --> <amOnPage url="{{StorefrontHomePage.url}}" stepKey="amOnStorefrontPage"/> @@ -84,7 +84,7 @@ </actionGroup> <!-- Assert product in custom store --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="DownloadableProduct"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithCustomOptionsTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithCustomOptionsTest.xml index 54a2ff606f384..fce6568eacd6c 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithCustomOptionsTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithCustomOptionsTest.xml @@ -33,7 +33,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete created downloadable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -44,12 +44,12 @@ <!-- Create Downloadable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createProduct"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createProduct"> <argument name="productType" value="downloadable"/> </actionGroup> <!-- Fill downloadable product values --> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillDownloadableProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillDownloadableProductForm"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -86,7 +86,7 @@ </actionGroup> <!-- Save product --> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Go to storefront category page --> <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> @@ -98,7 +98,7 @@ </actionGroup> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="DownloadableProduct"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithDefaultSetLinksTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithDefaultSetLinksTest.xml index 24741c281d7f6..cb8d36793c41e 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithDefaultSetLinksTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithDefaultSetLinksTest.xml @@ -35,7 +35,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete created downloadable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -46,12 +46,12 @@ <!-- Create downloadable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createProduct"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createProduct"> <argument name="productType" value="downloadable"/> </actionGroup> <!-- Fill downloadable product values --> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillDownloadableProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillDownloadableProductForm"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -75,14 +75,14 @@ </actionGroup> <!-- Save product --> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <magentoCLI command="indexer:reindex" stepKey="reindex"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> <!-- Find downloadable product in grid --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> <waitForPageLoad stepKey="waitForAdminProductPageLoad"/> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedConfigurableProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedConfigurableProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> <click selector="{{AdminProductGridSection.firstRow}}" stepKey="clickOnProduct"/> @@ -103,7 +103,7 @@ </actionGroup> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="DownloadableProduct"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithGroupPriceTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithGroupPriceTest.xml index 06cf31b763f1c..17d0e334eb7f3 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithGroupPriceTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithGroupPriceTest.xml @@ -33,7 +33,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete created downloadable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="ApiDownloadableProduct"/> </actionGroup> @@ -44,7 +44,7 @@ <!-- Create downloadable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createProduct"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createProduct"> <argument name="productType" value="downloadable"/> </actionGroup> @@ -55,7 +55,7 @@ </actionGroup> <!-- Fill downloadable product values --> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillDownloadableProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillDownloadableProductForm"> <argument name="product" value="ApiDownloadableProduct"/> </actionGroup> @@ -79,12 +79,12 @@ </actionGroup> <!-- Save product --> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Find downloadable product in grid --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> <waitForPageLoad stepKey="waitForAdminProductPageLoad"/> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedConfigurableProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedConfigurableProduct"> <argument name="product" value="ApiDownloadableProduct"/> </actionGroup> <click selector="{{AdminProductGridSection.firstRow}}" stepKey="clickOnProduct"/> @@ -96,7 +96,7 @@ <seeElement selector="{{AdminProductDownloadableSection.addLinkTitleInput('1')}}" stepKey="seeSecondLinkTitle"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="ApiDownloadableProduct"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithInvalidDomainLinkUrlTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithInvalidDomainLinkUrlTest.xml index f2e4bdfb4890f..ae37d6f4d3bf1 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithInvalidDomainLinkUrlTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithInvalidDomainLinkUrlTest.xml @@ -25,10 +25,10 @@ <argument name="link" value="downloadableLink"/> <argument name="index" value="0"/> </actionGroup> - <actionGroup ref="SaveProductFormNoSuccessCheck" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormNoSuccessCheckActionGroup" stepKey="saveProduct"/> <see selector="{{AdminProductMessagesSection.errorMessage}}" userInput="Link URL's domain is not in list of downloadable_domains in env.php." stepKey="seeLinkUrlInvalidMessage" after="saveProduct" /> <magentoCLI stepKey="addDownloadableDomain2" command="downloadable:domains:add static.magento.com" after="seeLinkUrlInvalidMessage" /> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillDownloadableProductFormAgain" after="addDownloadableDomain2"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillDownloadableProductFormAgain" after="addDownloadableDomain2"> <argument name="product" value="DownloadableProduct"/> </actionGroup> <checkOption selector="{{AdminProductDownloadableSection.isDownloadableProduct}}" stepKey="checkIsDownloadable" after="fillDownloadableProductFormAgain"/> @@ -37,7 +37,7 @@ <argument name="link" value="downloadableLink"/> <argument name="index" value="0"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProductAfterAddingDomainToWhitelist" after="addDownloadableProductLinkAgain" /> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductAfterAddingDomainToWhitelist" after="addDownloadableProductLinkAgain" /> <scrollTo selector="{{StorefrontDownloadableProductSection.downloadableLinkByTitle(downloadableLink.title)}}" stepKey="scrollToLinks"/> <click selector="{{StorefrontDownloadableProductSection.downloadableLinkByTitle(downloadableLink.title)}}" stepKey="selectProductLink"/> <see selector="{{CheckoutCartProductSection.ProductPriceByName(DownloadableProduct.name)}}" userInput="$52.99" stepKey="assertProductPriceInCart"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithLinkTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithLinkTest.xml index e43b8f94c7a3d..f604e710ce701 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithLinkTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithLinkTest.xml @@ -33,7 +33,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete created downloadable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -44,12 +44,12 @@ <!-- Create downloadable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createProduct"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createProduct"> <argument name="productType" value="downloadable"/> </actionGroup> <!-- Fill downloadable product values --> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillDownloadableProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillDownloadableProductForm"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -68,7 +68,7 @@ </actionGroup> <!-- Save product --> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Assert product in storefront category page --> <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> @@ -78,7 +78,7 @@ </actionGroup> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="DownloadableProduct"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithManageStockTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithManageStockTest.xml index fb6a48254fa8d..732e347713dca 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithManageStockTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithManageStockTest.xml @@ -33,7 +33,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete created downloadable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -44,12 +44,12 @@ <!-- Create downloadable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createProduct"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createProduct"> <argument name="productType" value="downloadable"/> </actionGroup> <!-- Fill downloadable product values --> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillDownloadableProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillDownloadableProductForm"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -86,12 +86,12 @@ </actionGroup> <!-- Save product --> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Find downloadable product in grid --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> <waitForPageLoad stepKey="waitForAdminProductPageLoad"/> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedConfigurableProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedConfigurableProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> <click selector="{{AdminProductGridSection.firstRow}}" stepKey="clickOnProduct"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithOutOfStockStatusTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithOutOfStockStatusTest.xml index 5e3fe6836f7e9..2d3f8f88a8591 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithOutOfStockStatusTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithOutOfStockStatusTest.xml @@ -33,7 +33,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete created downloadable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="DownloadableProductOutOfStock"/> </actionGroup> @@ -44,12 +44,12 @@ <!-- Create Downloadable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createProduct"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createProduct"> <argument name="productType" value="downloadable"/> </actionGroup> <!-- Fill downloadable product values --> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillDownloadableProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillDownloadableProductForm"> <argument name="product" value="DownloadableProductOutOfStock"/> </actionGroup> @@ -73,7 +73,7 @@ </actionGroup> <!-- Save product --> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Assert product is out of stock --> <amOnPage url="{{DownloadableProductOutOfStock.urlKey}}.html" stepKey="navigateToProductPage"/> @@ -83,7 +83,7 @@ <!-- Find downloadable product in grid --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> <waitForPageLoad stepKey="waitForAdminProductPageLoad"/> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedConfigurableProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedConfigurableProduct"> <argument name="product" value="DownloadableProductOutOfStock"/> </actionGroup> <click selector="{{AdminProductGridSection.firstRow}}" stepKey="clickOnProduct"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithSpecialPriceTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithSpecialPriceTest.xml index fb59d51831bae..5085c547517cd 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithSpecialPriceTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithSpecialPriceTest.xml @@ -33,7 +33,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete created downloadable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="ApiDownloadableProduct"/> </actionGroup> @@ -44,7 +44,7 @@ <!-- Create downloadable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createProduct"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createProduct"> <argument name="productType" value="downloadable"/> </actionGroup> @@ -54,7 +54,7 @@ </actionGroup> <!-- Fill downloadable product values --> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillDownloadableProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillDownloadableProductForm"> <argument name="product" value="ApiDownloadableProduct"/> </actionGroup> @@ -78,12 +78,12 @@ </actionGroup> <!-- Save product --> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Find downloadable product in grid --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> <waitForPageLoad stepKey="waitForAdminProductPageLoad"/> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedConfigurableProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedConfigurableProduct"> <argument name="product" value="ApiDownloadableProduct"/> </actionGroup> <click selector="{{AdminProductGridSection.firstRow}}" stepKey="clickOnProduct"/> @@ -95,7 +95,7 @@ <seeElement selector="{{AdminProductDownloadableSection.addLinkTitleInput('1')}}" stepKey="seeSecondLinkTitle"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="ApiDownloadableProduct"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutFillingQuantityAndStockTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutFillingQuantityAndStockTest.xml index af9487e3e6a23..9f9e24b65b5a8 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutFillingQuantityAndStockTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutFillingQuantityAndStockTest.xml @@ -33,7 +33,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete created downloadable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -44,12 +44,12 @@ <!-- Create downloadable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createProduct"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createProduct"> <argument name="productType" value="downloadable"/> </actionGroup> <!-- Fill downloadable product values --> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillDownloadableProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillDownloadableProductForm"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -75,12 +75,12 @@ </actionGroup> <!-- Save product --> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Find downloadable product in grid --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> <waitForPageLoad stepKey="waitForAdminProductPageLoad"/> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedConfigurableProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedConfigurableProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> <click selector="{{AdminProductGridSection.firstRow}}" stepKey="clickOnProduct"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutTaxClassIdTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutTaxClassIdTest.xml index dd7e3331a0ed2..4c564c26b9cad 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutTaxClassIdTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutTaxClassIdTest.xml @@ -33,7 +33,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete created downloadable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -44,12 +44,12 @@ <!-- Create downloadable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createProduct"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createProduct"> <argument name="productType" value="downloadable"/> </actionGroup> <!-- Fill downloadable product values --> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillDownloadableProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillDownloadableProductForm"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -76,12 +76,12 @@ </actionGroup> <!-- Save product --> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Find downloadable product in grid --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> <waitForPageLoad stepKey="waitForAdminProductPageLoad"/> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedConfigurableProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedConfigurableProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> <click selector="{{AdminProductGridSection.firstRow}}" stepKey="clickOnProduct"/> @@ -93,7 +93,7 @@ <seeInField selector="{{AdminProductDownloadableSection.addLinkTitleInput('1')}}" userInput="{{downloadableLink.title}}" stepKey="seeSecondLinkTitle"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="DownloadableProduct"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDeleteDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDeleteDownloadableProductTest.xml index 07124ea4846be..0d93bac16569f 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDeleteDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDeleteDownloadableProductTest.xml @@ -36,7 +36,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <actionGroup ref="logout" stepKey="logout"/> </after> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteDownloadableProductFilteredBySkuAndName"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteDownloadableProductFilteredBySkuAndName"> <argument name="product" value="$$createDownloadableProduct$$"/> </actionGroup> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDownloadableProductSetEditContentTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDownloadableProductSetEditContentTest.xml index 72cdf589bec91..44c27c17adcd9 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDownloadableProductSetEditContentTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDownloadableProductSetEditContentTest.xml @@ -21,16 +21,16 @@ </annotations> <after> <!-- Delete downloadable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> </after> <!-- Create product --> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillProductForm"> <argument name="product" value="DownloadableProduct"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDownloadableSetEditRelatedProductsTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDownloadableSetEditRelatedProductsTest.xml index f70769cdfe834..a09076b7dc06e 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDownloadableSetEditRelatedProductsTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDownloadableSetEditRelatedProductsTest.xml @@ -21,16 +21,16 @@ <before></before> <after> <!-- Delete downloadable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> </after> <!-- Create product --> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillProductForm"> <argument name="product" value="DownloadableProduct"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml index 20c1acaf8d612..4a3f0d4ef9f83 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml @@ -23,7 +23,7 @@ <click selector="{{AdminProductDownloadableSection.sectionHeader}}" stepKey="openDownloadableSection" after="waitForSimpleProductPageLoad"/> <uncheckOption selector="{{AdminProductDownloadableSection.isDownloadableProduct}}" stepKey="checkOptionIsDownloadable" after="openDownloadableSection"/> <selectOption selector="{{AdminProductFormSection.productWeightSelect}}" userInput="This item has weight" stepKey="selectWeightForProduct" after="checkOptionIsDownloadable"/> - <actionGroup ref="saveProductForm" stepKey="saveDownloadableProductForm" after="selectWeightForProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveDownloadableProductForm" after="selectWeightForProduct"/> </test> <test name="AdminSimpleProductTypeSwitchingToDownloadableProductTest"> <annotations> @@ -62,11 +62,11 @@ <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addDownloadableProductLink"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveDownloadableProductForm"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveDownloadableProductForm"/> <!--Assert downloadable product on Admin product page grid--> <comment userInput="Assert configurable product in Admin product page grid" stepKey="commentAssertDownloadableProductOnAdmin"/> <amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="goToCatalogProductPage"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterProductGridBySku"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGridBySku"> <argument name="sku" value="$$createProduct.sku$$"/> </actionGroup> <see selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="$$createProduct.name$$" stepKey="seeDownloadableProductNameInGrid"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultImageDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultImageDownloadableProductTest.xml index 3597c12e82df0..6830ed9feb08f 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultImageDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultImageDownloadableProductTest.xml @@ -30,15 +30,15 @@ <!-- Create product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="adminProductIndexPageAdd"/> <waitForPageLoad stepKey="waitForProductIndexPageLoad"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProductPage"> <argument name="product" value="DownloadableProduct"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillMainProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillMainProductForm"> <argument name="product" value="DownloadableProduct"/> </actionGroup> <!-- Add image to product --> - <actionGroup ref="addProductImage" stepKey="addImageForProduct"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageForProduct"> <argument name="image" value="MagentoLogo"/> </actionGroup> @@ -56,22 +56,22 @@ </actionGroup> <!--Save product--> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Remove image from product --> - <actionGroup ref="removeProductImage" stepKey="removeProductImage"/> + <actionGroup ref="RemoveProductImageActionGroup" stepKey="removeProductImage"/> - <actionGroup ref="saveProductForm" stepKey="saveProductFormAfterRemove"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductFormAfterRemove"/> <!-- Assert product image not in admin product form --> - <actionGroup ref="assertProductImageNotInAdminProductPage" stepKey="assertProductImageNotInAdminProductPage"/> + <actionGroup ref="AssertProductImageNotInAdminProductPageActionGroup" stepKey="assertProductImageNotInAdminProductPage"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPageAfterRemove"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPageAfterRemove"> <argument name="product" value="DownloadableProduct"/> </actionGroup> <!-- Assert product image not in storefront product page --> - <actionGroup ref="assertProductImageNotInStorefrontProductPage" stepKey="assertProductImageNotInStorefrontProductPage"> + <actionGroup ref="AssertProductImageNotInStorefrontProductPageActionGroup" stepKey="assertProductImageNotInStorefrontProductPage"> <argument name="product" value="DownloadableProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultVideoDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultVideoDownloadableProductTest.xml index 0d98862d9a5e7..ede4540050ecb 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultVideoDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultVideoDownloadableProductTest.xml @@ -27,10 +27,10 @@ <!-- Create a downloadable product --> <!-- Replacing steps in base AdminRemoveDefaultVideoSimpleProductTest --> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProductPage"> <argument name="product" value="DownloadableProduct"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillMainProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillMainProductForm"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -49,7 +49,7 @@ </actionGroup> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="DownloadableProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/EditDownloadableProductWithSeparateLinksFromCartTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/EditDownloadableProductWithSeparateLinksFromCartTest.xml index 274dd39468a2b..32dc52559b24b 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/EditDownloadableProductWithSeparateLinksFromCartTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/EditDownloadableProductWithSeparateLinksFromCartTest.xml @@ -30,12 +30,12 @@ <!-- Create downloadable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createProduct"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createProduct"> <argument name="productType" value="downloadable"/> </actionGroup> <!-- Fill downloadable product values --> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillDownloadableProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillDownloadableProductForm"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -61,7 +61,7 @@ </actionGroup> <!-- Save product --> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> </before> <after> <!-- Remove downloadable domains --> @@ -71,7 +71,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete created downloadable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/EndToEndB2CAdminTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/EndToEndB2CAdminTest.xml index 75a66cec91692..3b9e359aeec34 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/EndToEndB2CAdminTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/EndToEndB2CAdminTest.xml @@ -11,7 +11,7 @@ <!--Create Downloadable Product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitProductPageDownloadable" after="seeSimpleProductInGrid"/> <waitForPageLoad stepKey="waitForProductPageLoadDownloadable" after="visitProductPageDownloadable"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateDownloadableProduct" after="waitForProductPageLoadDownloadable"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateDownloadableProduct" after="waitForProductPageLoadDownloadable"> <argument name="product" value="DownloadableProduct"/> </actionGroup> <actionGroup ref="fillMainDownloadableProductForm" stepKey="fillMainProductFormDownloadable" after="goToCreateDownloadableProduct"> @@ -45,14 +45,14 @@ </actionGroup> <!--Save Product--> - <actionGroup ref="saveProductForm" stepKey="saveDownloadableProduct" after="addDownloadableSampleUrl"/> - <actionGroup ref="viewProductInAdminGrid" stepKey="viewDownloadableProductInGrid" after="saveDownloadableProduct"> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveDownloadableProduct" after="addDownloadableSampleUrl"/> + <actionGroup ref="ViewProductInAdminGridActionGroup" stepKey="viewDownloadableProductInGrid" after="saveDownloadableProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> <!--@TODO Move cleanup to "after" when MQE-830 is resolved--> <comment userInput="Clean up downloadable product" stepKey="cleanUpDownloadableProduct" after="deleteSimpleProduct"/> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteDownloadableProduct" after="cleanUpDownloadableProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteDownloadableProduct" after="cleanUpDownloadableProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/ManualSelectAllDownloadableLinksDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/ManualSelectAllDownloadableLinksDownloadableProductTest.xml index a86fd544d24d6..0b7f459f43427 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/ManualSelectAllDownloadableLinksDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/ManualSelectAllDownloadableLinksDownloadableProductTest.xml @@ -30,12 +30,12 @@ <!-- Create downloadable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createProduct"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createProduct"> <argument name="productType" value="downloadable"/> </actionGroup> <!-- Fill downloadable product values --> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillDownloadableProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillDownloadableProductForm"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -61,7 +61,7 @@ </actionGroup> <!-- Save product --> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> </before> <after> <!-- Remove downloadable domains --> @@ -71,7 +71,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete created downloadable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/SelectAllDownloadableLinksDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/SelectAllDownloadableLinksDownloadableProductTest.xml index f9ca6fea09cf0..ea7074c70d3c3 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/SelectAllDownloadableLinksDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/SelectAllDownloadableLinksDownloadableProductTest.xml @@ -30,12 +30,12 @@ <!-- Create downloadable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createProduct"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createProduct"> <argument name="productType" value="downloadable"/> </actionGroup> <!-- Fill downloadable product values --> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillDownloadableProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillDownloadableProductForm"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -61,7 +61,7 @@ </actionGroup> <!-- Save product --> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> </before> <after> <!-- Remove downloadable domains --> @@ -71,7 +71,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete created downloadable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/VerifyDisableDownloadableProductSamplesAreNotAccessibleTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/VerifyDisableDownloadableProductSamplesAreNotAccessibleTest.xml index ba2e3453a6d99..b0f7edaeaa3a9 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/VerifyDisableDownloadableProductSamplesAreNotAccessibleTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/VerifyDisableDownloadableProductSamplesAreNotAccessibleTest.xml @@ -87,13 +87,13 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!-- Open Downloadable product from precondition --> - <actionGroup ref="goToProductPageViaID" stepKey="openProductEditPage"> + <actionGroup ref="GoToProductPageViaIDActionGroup" stepKey="openProductEditPage"> <argument name="productId" value="$createProduct.id$"/> </actionGroup> <!-- Change status of product to "Disable" and save it --> - <actionGroup ref="AdminSetProductDisabled" stepKey="disableProduct"/> - <actionGroup ref="saveProductForm" stepKey="clickSaveProduct"/> + <actionGroup ref="AdminSetProductDisabledActionGroup" stepKey="disableProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveProduct"/> <!-- Assert product is disable on Storefront --> <actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="openCategoryPage"> diff --git a/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearch6SearchInvalidValueTest.xml b/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearch6SearchInvalidValueTest.xml index a144a4849db60..7c6ff7176ee8f 100644 --- a/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearch6SearchInvalidValueTest.xml +++ b/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearch6SearchInvalidValueTest.xml @@ -34,7 +34,7 @@ <magentoCLI command="config:set {{SetMinQueryLength3Config.path}} {{SetMinQueryLength3Config.value}}" stepKey="setMinQueryLengthPreviousState"/> <!--Delete created data--> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> - <actionGroup ref="deleteProductAttributeByAttributeCode" stepKey="deleteProductAttribute"> + <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttribute"> <argument name="ProductAttributeCode" value="{{textProductAttribute.attribute_code}}"/> </actionGroup> <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> @@ -42,35 +42,35 @@ <click selector="{{AdminProductAttributeGridSection.ResetFilter}}" stepKey="resetFiltersOnGrid"/> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="goToProductCatalog"/> <waitForPageLoad stepKey="waitForProductIndexPage"/> - <actionGroup ref="deleteProductsIfTheyExist" stepKey="deleteProduct"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetFiltersIfExist"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteProduct"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetFiltersIfExist"/> <magentoCLI command="indexer:reindex catalogsearch_fulltext" stepKey="reindex"/> <magentoCLI command="cache:flush config" stepKey="flushCache"/> <actionGroup ref="logout" stepKey="logout"/> </after> <!--Create new searchable product attribute--> <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="goToProductAttributes"/> - <actionGroup ref="AdminCreateSearchableProductAttribute" stepKey="createAttribute"> + <actionGroup ref="AdminCreateSearchableProductAttributeActionGroup" stepKey="createAttribute"> <argument name="attribute" value="textProductAttribute"/> </actionGroup> <!--Assign attribute to the Default set--> <actionGroup ref="AdminOpenAttributeSetGridPageActionGroup" stepKey="openAttributeSetPage"/> <actionGroup ref="AdminOpenAttributeSetByNameActionGroup" stepKey="openDefaultAttributeSet"/> - <actionGroup ref="AssignAttributeToGroup" stepKey="assignAttributeToGroup"> + <actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup"> <argument name="group" value="Product Details"/> <argument name="attribute" value="{{textProductAttribute.attribute_code}}"/> </actionGroup> - <actionGroup ref="SaveAttributeSet" stepKey="saveAttributeSet"/> + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveAttributeSet"/> <!--Create product and fill new attribute field--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPage"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="SimpleProduct"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillProductForm"> <argument name="product" value="ProductWithSpecialSymbols"/> </actionGroup> - <actionGroup ref="SetCategoryByName" stepKey="addCategoryToProduct"> + <actionGroup ref="SetCategoryByNameActionGroup" stepKey="addCategoryToProduct"> <argument name="categoryName" value="$$createCategory.name$$"/> </actionGroup> <fillField selector="{{AdminProductFormSection.attributeRequiredInput(textProductAttribute.attribute_code)}}" userInput="searchable" stepKey="fillTheAttributeRequiredInputField"/> diff --git a/app/code/Magento/Fedex/Test/Mftf/Test/AdminCreatingShippingLabelTest.xml b/app/code/Magento/Fedex/Test/Mftf/Test/AdminCreatingShippingLabelTest.xml index 91a76383babd4..c18364df3ca67 100644 --- a/app/code/Magento/Fedex/Test/Mftf/Test/AdminCreatingShippingLabelTest.xml +++ b/app/code/Magento/Fedex/Test/Mftf/Test/AdminCreatingShippingLabelTest.xml @@ -83,7 +83,7 @@ <actionGroup ref="AdminFillProductCountryOfManufactureActionGroup" stepKey="fillCountryOfManufacture"> <argument name="countryId" value="DE"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveSimpleProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSimpleProduct"/> <!--Place for order using FedEx shipping method--> <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="amOnStorefrontProductPage"/> <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart"> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/StorefrontAddGroupedProductWithTwoLinksToCartActionGroup.xml b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/StorefrontAddGroupedProductWithTwoLinksToCartActionGroup.xml index c1ba827f6ca8a..0a44aa6943862 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/StorefrontAddGroupedProductWithTwoLinksToCartActionGroup.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/StorefrontAddGroupedProductWithTwoLinksToCartActionGroup.xml @@ -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="StorefrontAddGroupedProductWithTwoLinksToCartActionGroup" extends="AddSimpleProductToCart"> + <actionGroup name="StorefrontAddGroupedProductWithTwoLinksToCartActionGroup" extends="AddSimpleProductToCartActionGroup"> <annotations> <description>Adding to the Shopping Cart single Grouped product, with 2 associated from the Product page</description> </annotations> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultImageGroupedProductTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultImageGroupedProductTest.xml index f2cb2cc993a50..583406e898c39 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultImageGroupedProductTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultImageGroupedProductTest.xml @@ -29,7 +29,7 @@ </createData> </before> <after> - <actionGroup ref="deleteProductBySku" stepKey="deleteGroupedProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteGroupedProduct"> <argument name="sku" value="{{GroupedProduct.sku}}"/> </actionGroup> <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> @@ -41,8 +41,8 @@ <!-- Create product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPage"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="GroupedProduct"/> </actionGroup> <actionGroup ref="fillGroupedProductForm" stepKey="fillProductForm"> @@ -54,7 +54,7 @@ <click selector="body" stepKey="clickBodyToCorrectFocusGrouped"/> <click selector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" stepKey="clickAddProductsToGroup"/> <waitForElementVisible selector="{{AdminAddProductsToGroupPanel.filters}}" stepKey="waitForGroupedProductModal"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterGroupedProducts"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterGroupedProducts"> <argument name="sku" value="api-simple-product"/> </actionGroup> <checkOption selector="{{AdminAddProductsToGroupPanel.nThCheckbox('0')}}" stepKey="checkFilterResult1"/> @@ -63,21 +63,21 @@ <click selector="{{AdminAddProductsToGroupPanel.addSelectedProducts}}" stepKey="clickAddSelectedGroupProducts"/> <!-- Add image to product --> - <actionGroup ref="addProductImage" stepKey="addImageForProduct"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageForProduct"> <argument name="image" value="MagentoLogo"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Assert product image in admin product form --> - <actionGroup ref="assertProductImageAdminProductPage" stepKey="assertProductImageAdminProductPage"/> + <actionGroup ref="AssertProductImageAdminProductPageActionGroup" stepKey="assertProductImageAdminProductPage"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="GroupedProduct"/> </actionGroup> <!-- Assert product image in storefront product page --> - <actionGroup ref="assertProductImageStorefrontProductPage" stepKey="assertProductImageStorefrontProductPage"> + <actionGroup ref="AssertProductImageStorefrontProductPageActionGroup" stepKey="assertProductImageStorefrontProductPage"> <argument name="product" value="GroupedProduct"/> <argument name="image" value="MagentoLogo"/> </actionGroup> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultVideoGroupedProductTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultVideoGroupedProductTest.xml index c3a95bbef3aa3..b4d8b4c1825ad 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultVideoGroupedProductTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultVideoGroupedProductTest.xml @@ -29,7 +29,7 @@ <!-- Create a grouped product --> <!-- Replacing steps in base AdminAddDefaultVideoSimpleProductTest --> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProductPage"> <argument name="product" value="GroupedProduct"/> </actionGroup> <actionGroup ref="fillGroupedProductForm" stepKey="fillMainProductForm"> @@ -41,18 +41,18 @@ <conditionalClick selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" dependentSelector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" visible="false" stepKey="openGroupedProductSection" after="scrollToSection"/> <click selector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" stepKey="clickAddProductsToGroup" after="openGroupedProductSection"/> <waitForElementVisible selector="{{AdminAddProductsToGroupPanel.filters}}" stepKey="waitForFilter" after="clickAddProductsToGroup"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku1" after="waitForFilter"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku1" after="waitForFilter"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToGroupPanel.firstCheckbox}}" stepKey="checkOption1" after="filterProductGridBySku1"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku2" after="checkOption1"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku2" after="checkOption1"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToGroupPanel.firstCheckbox}}" stepKey="checkOption2" after="filterProductGridBySku2"/> <click selector="{{AdminAddProductsToGroupPanel.addSelectedProducts}}" stepKey="addSelectedProducts" before="saveProductForm"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="GroupedProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAssociateGroupedProductToWebsitesTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAssociateGroupedProductToWebsitesTest.xml index 3827666252478..41096c416d05e 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAssociateGroupedProductToWebsitesTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAssociateGroupedProductToWebsitesTest.xml @@ -69,14 +69,14 @@ <argument name="websiteName" value="{{secondCustomWebsite.name}}"/> </actionGroup> - <actionGroup ref="NavigateToAndResetProductGridToDefaultView" stepKey="resetProductGridFilter"/> + <actionGroup ref="NavigateToAndResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridFilter"/> <!-- Admin logout --> <actionGroup ref="logout" stepKey="logout"/> </after> <!-- Open product page and assign grouped project to second website --> - <actionGroup ref="filterAndSelectProduct" stepKey="openAdminProductPage"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="openAdminProductPage"> <argument name="productSku" value="$$createGroupedProduct.sku$$"/> </actionGroup> <actionGroup ref="AdminAssignProductInWebsiteActionGroup" stepKey="assignProductToSecondWebsite"> @@ -85,15 +85,15 @@ <actionGroup ref="AdminUnassignProductInWebsiteActionGroup" stepKey="unassignProductFromDefaultWebsite"> <argument name="website" value="{{_defaultWebsite.name}}"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveGroupedProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveGroupedProduct"/> <!-- Assert product is assigned to Second website --> - <actionGroup ref="AssertProductIsAssignedToWebsite" stepKey="seeCustomWebsiteIsChecked"> + <actionGroup ref="AssertProductIsAssignedToWebsiteActionGroup" stepKey="seeCustomWebsiteIsChecked"> <argument name="website" value="{{secondCustomWebsite.name}}"/> </actionGroup> <!-- Assert product is not assigned to Main website --> - <actionGroup ref="AssertProductIsNotAssignedToWebsite" stepKey="seeMainWebsiteIsNotChecked"> + <actionGroup ref="AssertProductIsNotAssignedToWebsiteActionGroup" stepKey="seeMainWebsiteIsNotChecked"> <argument name="website" value="{{_defaultWebsite.name}}"/> </actionGroup> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateAndEditGroupedProductSettingsTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateAndEditGroupedProductSettingsTest.xml index 62a685554f735..88f90e54784e8 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateAndEditGroupedProductSettingsTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateAndEditGroupedProductSettingsTest.xml @@ -30,7 +30,7 @@ </before> <after> <!-- Delete grouped product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="GroupedProduct"/> </actionGroup> @@ -47,7 +47,7 @@ </after> <!-- Create new grouped product --> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createGroupedProduct"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createGroupedProduct"> <argument name="productType" value="grouped"/> </actionGroup> @@ -70,7 +70,7 @@ <actionGroup ref="AdminSetProductDesignSettingsActionGroup" stepKey="setProductDesignSettings"/> <!-- Save grouped product form --> - <actionGroup ref="saveProductForm" stepKey="clickSaveButton"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveButton"/> <!-- Open created simple product --> <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForSimpleProduct"> @@ -86,7 +86,7 @@ </actionGroup> <!-- Save simple product form --> - <actionGroup ref="saveProductForm" stepKey="clickSaveBtn"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveBtn"/> <!-- Open grouped product page --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage"> @@ -100,7 +100,7 @@ <fillField selector="{{StorefrontProductPageSection.qtyInput}}" userInput="{{ApiSimpleSingleQty.quantity}}" stepKey="fillFieldQtyInput"/> <!-- Assert Gift Option product settings is present --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage6"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage6"> <argument name="productName" value="GroupedProduct.name"/> </actionGroup> <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openShoppingCart"/> @@ -120,7 +120,7 @@ </actionGroup> <!-- Assert product is assigned to websites --> - <actionGroup ref="AssertProductIsAssignedToWebsite" stepKey="seeCustomWebsiteIsChecked"> + <actionGroup ref="AssertProductIsAssignedToWebsiteActionGroup" stepKey="seeCustomWebsiteIsChecked"> <argument name="website" value="$createWebsite.website[name]$"/> </actionGroup> @@ -135,7 +135,7 @@ </actionGroup> <!-- Save grouped product form --> - <actionGroup ref="saveProductForm" stepKey="clickSaveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveProduct"/> <!-- Open created simple product --> <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForProduct"> @@ -149,7 +149,7 @@ <actionGroup ref="AdminSwitchProductGiftMessageStatusActionGroup" stepKey="disableGiftMessageSettings"/> <!-- Save product form --> - <actionGroup ref="saveProductForm" stepKey="clickSaveSimpleProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveSimpleProduct"/> <!-- Verify Url Key after changing --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminDeleteGroupedProductTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminDeleteGroupedProductTest.xml index 6768dd5a1a249..f7b9357f1b34a 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminDeleteGroupedProductTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminDeleteGroupedProductTest.xml @@ -33,7 +33,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <actionGroup ref="logout" stepKey="logout"/> </after> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteGroupedProductFilteredBySkuAndName"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteGroupedProductFilteredBySkuAndName"> <argument name="product" value="$$createGroupedProduct$$"/> </actionGroup> <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedProductSetEditContentTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedProductSetEditContentTest.xml index 3938d91c515f1..d9f9d8ecd9382 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedProductSetEditContentTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedProductSetEditContentTest.xml @@ -21,16 +21,16 @@ </annotations> <after> <!-- Delete grouped product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="GroupedProduct"/> </actionGroup> </after> <!-- Create product --> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="GroupedProduct"/> </actionGroup> - <actionGroup ref="fillProductNameAndSkuInProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="GroupedProduct"/> </actionGroup> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedProductsListTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedProductsListTest.xml index b59cf1e2175d8..431ca4449cbdb 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedProductsListTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedProductsListTest.xml @@ -39,7 +39,7 @@ <!-- Create product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="adminProductIndexPageAdd"/> <waitForPageLoad stepKey="waitForProductIndexPageLoad"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProductPage"> <argument name="product" value="GroupedProduct"/> </actionGroup> <actionGroup ref="fillGroupedProductForm" stepKey="fillMainProductForm"> @@ -50,11 +50,11 @@ <conditionalClick selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" dependentSelector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" visible="false" stepKey="openGroupedProductSection"/> <click selector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" stepKey="clickAddProductsToGroup"/> <waitForElementVisible selector="{{AdminAddProductsToGroupPanel.filters}}" stepKey="waitForFilter"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku1"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku1"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToGroupPanel.firstCheckbox}}" stepKey="checkOption1"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToGroupPanel.firstCheckbox}}" stepKey="checkOption2"/> @@ -62,7 +62,7 @@ <waitForPageLoad stepKey="waitForPageLoad1"/> <!-- Save product --> - <actionGroup ref="saveProductForm" stepKey="saveProductForm"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> <waitForPageLoad stepKey="waitForPageLoad2"/> <scrollTo selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" x="0" y="-100" stepKey="scrollToProducts"/> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedSetEditRelatedProductsTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedSetEditRelatedProductsTest.xml index 8117d627a370c..9cdd24b41355a 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedSetEditRelatedProductsTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedSetEditRelatedProductsTest.xml @@ -21,13 +21,13 @@ <before></before> <after> <!-- Delete grouped product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="GroupedProduct"/> </actionGroup> </after> <!-- Create product --> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="GroupedProduct"/> </actionGroup> <actionGroup ref="fillGroupedProductForm" stepKey="fillProductForm"> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultImageGroupedProductTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultImageGroupedProductTest.xml index da7cfaeb71566..975498863d6da 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultImageGroupedProductTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultImageGroupedProductTest.xml @@ -38,8 +38,8 @@ <!-- Create product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPage"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="GroupedProduct"/> </actionGroup> <actionGroup ref="fillGroupedProductForm" stepKey="fillProductForm"> @@ -51,7 +51,7 @@ <click selector="body" stepKey="clickBodyToCorrectFocusGrouped"/> <click selector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" stepKey="clickAddProductsToGroup"/> <waitForElementVisible selector="{{AdminAddProductsToGroupPanel.filters}}" stepKey="waitForGroupedProductModal"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterGroupedProducts"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterGroupedProducts"> <argument name="sku" value="api-simple-product"/> </actionGroup> <checkOption selector="{{AdminAddProductsToGroupPanel.nThCheckbox('0')}}" stepKey="checkFilterResult1"/> @@ -60,26 +60,26 @@ <click selector="{{AdminAddProductsToGroupPanel.addSelectedProducts}}" stepKey="clickAddSelectedGroupProducts"/> <!-- Add image to product --> - <actionGroup ref="addProductImage" stepKey="addImageForProduct"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageForProduct"> <argument name="image" value="MagentoLogo"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Remove image from product --> - <actionGroup ref="removeProductImage" stepKey="removeProductImage"/> + <actionGroup ref="RemoveProductImageActionGroup" stepKey="removeProductImage"/> - <actionGroup ref="saveProductForm" stepKey="saveProductFormAfterRemove"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductFormAfterRemove"/> <!-- Assert product image not in admin product form --> - <actionGroup ref="assertProductImageNotInAdminProductPage" stepKey="assertProductImageNotInAdminProductPage"/> + <actionGroup ref="AssertProductImageNotInAdminProductPageActionGroup" stepKey="assertProductImageNotInAdminProductPage"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPageAfterRemove"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPageAfterRemove"> <argument name="product" value="GroupedProduct"/> </actionGroup> <!-- Assert product image not in storefront product page --> - <actionGroup ref="assertProductImageNotInStorefrontProductPage" stepKey="assertProductImageNotInStorefrontProductPage"> + <actionGroup ref="AssertProductImageNotInStorefrontProductPageActionGroup" stepKey="assertProductImageNotInStorefrontProductPage"> <argument name="product" value="GroupedProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultVideoGroupedProductTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultVideoGroupedProductTest.xml index e322d4a1eb038..c24be0d9fdfb6 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultVideoGroupedProductTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultVideoGroupedProductTest.xml @@ -29,7 +29,7 @@ <!-- Create a grouped product --> <!-- Replacing steps in base AdminRemoveDefaultVideoSimpleProductTest --> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProductPage"> <argument name="product" value="GroupedProduct"/> </actionGroup> <actionGroup ref="fillGroupedProductForm" stepKey="fillMainProductForm"> @@ -41,18 +41,18 @@ <conditionalClick selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" dependentSelector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" visible="false" stepKey="openGroupedProductSection" after="scrollToSection"/> <click selector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" stepKey="clickAddProductsToGroup" after="openGroupedProductSection"/> <waitForElementVisible selector="{{AdminAddProductsToGroupPanel.filters}}" stepKey="waitForFilter" after="clickAddProductsToGroup"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku1" after="waitForFilter"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku1" after="waitForFilter"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToGroupPanel.firstCheckbox}}" stepKey="checkOption1" after="filterProductGridBySku1"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku2" after="checkOption1"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku2" after="checkOption1"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToGroupPanel.firstCheckbox}}" stepKey="checkOption2" after="filterProductGridBySku2"/> <click selector="{{AdminAddProductsToGroupPanel.addSelectedProducts}}" stepKey="addSelectedProducts" before="saveProductForm"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="GroupedProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminSortingAssociatedProductsTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminSortingAssociatedProductsTest.xml index ad5fbbb30edeb..f42c0bed70a17 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminSortingAssociatedProductsTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminSortingAssociatedProductsTest.xml @@ -94,7 +94,7 @@ </before> <after> <!--Delete created grouped product--> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="GroupedProduct"/> </actionGroup> <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" @@ -129,8 +129,8 @@ <!--Create grouped Product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPage"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="GroupedProduct"/> </actionGroup> <actionGroup ref="fillGroupedProductForm" stepKey="fillProductForm"> @@ -142,7 +142,7 @@ <click selector="body" stepKey="clickBodyToCorrectFocusGrouped"/> <click selector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" stepKey="clickAddProductsToGroup"/> <waitForElementVisible selector="{{AdminAddProductsToGroupPanel.filters}}" stepKey="waitForGroupedProductModal"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterGroupedProducts"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterGroupedProducts"> <argument name="sku" value="api-simple-product"/> </actionGroup> @@ -153,13 +153,13 @@ <click selector="{{AdminAddProductsToGroupPanel.addSelectedProducts}}" stepKey="clickAddSelectedGroupProducts"/> <waitForPageLoad stepKey="waitForProductsAdded"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!--Open created Product group--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPageLoad"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetFiltersIfExist"/> - <actionGroup ref="searchProductGridByKeyword" stepKey="searchProductGridForm"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetFiltersIfExist"/> + <actionGroup ref="SearchProductGridByKeywordActionGroup" stepKey="searchProductGridForm"> <argument name="keyword" value="GroupedProduct.name"/> </actionGroup> <click selector="{{AdminProductGridSection.selectRowBasedOnName(GroupedProduct.name)}}" stepKey="openGroupedProduct"/> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/EndToEndB2CAdminTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/EndToEndB2CAdminTest.xml index dbe3dddfca81b..f5f7abc7075ab 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/EndToEndB2CAdminTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/EndToEndB2CAdminTest.xml @@ -11,7 +11,7 @@ <!--Create Grouped Product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageGrouped" after="seeSimpleProductInGrid"/> <waitForPageLoad stepKey="waitForProductPageLoadGrouped" after="visitAdminProductPageGrouped"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateGroupedProduct" after="waitForProductPageLoadGrouped"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateGroupedProduct" after="waitForProductPageLoadGrouped"> <argument name="product" value="GroupedProduct"/> </actionGroup> <actionGroup ref="checkRequiredFieldsInGroupedProductForm" stepKey="checkRequiredFieldsProductGrouped" after="goToCreateGroupedProduct"/> @@ -23,20 +23,20 @@ <click selector="body" stepKey="clickBodyToCorrectFocusGrouped" after="openGroupedProductsSection"/> <click selector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" stepKey="clickAddProductsToGroup" after="clickBodyToCorrectFocusGrouped"/> <waitForElementVisible selector="{{AdminAddProductsToGroupPanel.filters}}" stepKey="waitForGroupedProductModal" after="clickAddProductsToGroup"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterGroupedProductOptions" after="waitForGroupedProductModal"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterGroupedProductOptions" after="waitForGroupedProductModal"> <argument name="product" value="SimpleProduct"/> </actionGroup> <checkOption selector="{{AdminAddProductsToGroupPanel.firstCheckbox}}" stepKey="checkFilterResult" after="filterGroupedProductOptions"/> <click selector="{{AdminAddProductsToGroupPanel.addSelectedProducts}}" stepKey="clickAddSelectedGroupProducts" after="checkFilterResult"/> - <actionGroup ref="saveProductForm" stepKey="saveGroupedProduct" after="clickAddSelectedGroupProducts"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveGroupedProduct" after="clickAddSelectedGroupProducts"/> <actionGroup ref="viewGroupedProductInAdminGrid" stepKey="viewGroupedProductInGrid" after="saveGroupedProduct"> <argument name="product" value="GroupedProduct"/> </actionGroup> <!--@TODO Move cleanup to "after" when MQE-830 is resolved--> <comment userInput="Clean up grouped product" stepKey="cleanUpGroupedProduct" after="deleteSimpleProduct"/> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteGroupedProduct" after="cleanUpGroupedProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteGroupedProduct" after="cleanUpGroupedProduct"> <argument name="product" value="GroupedProduct"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/NewProductsListWidgetGroupedProductTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/NewProductsListWidgetGroupedProductTest.xml index a56512f84a9b8..d563796b21da9 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/NewProductsListWidgetGroupedProductTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/NewProductsListWidgetGroupedProductTest.xml @@ -52,7 +52,7 @@ <scrollTo selector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" stepKey="scrollToAddProductsToGroup"/> <click selector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" stepKey="clickAddProductsToGroup"/> <waitForElementVisible selector="{{AdminAddProductsToGroupPanel.filters}}" stepKey="waitForGroupedProductModal"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterGroupedProducts"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterGroupedProducts"> <argument name="sku" value="api-simple-product"/> </actionGroup> <checkOption selector="{{AdminAddProductsToGroupPanel.nThCheckbox('0')}}" stepKey="checkFilterResult1"/> diff --git a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminCheckDoubleImportOfProductsTest.xml b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminCheckDoubleImportOfProductsTest.xml index 909c6101fe53e..23ef749217ac6 100644 --- a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminCheckDoubleImportOfProductsTest.xml +++ b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminCheckDoubleImportOfProductsTest.xml @@ -37,7 +37,7 @@ <actionGroup ref="adminDataGridSelectPerPage" stepKey="selectNumberOfProductsPerPage"> <argument name="perPage" value="100"/> </actionGroup> - <actionGroup ref="deleteProductsIfTheyExist" stepKey="deleteAllProducts"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteAllProducts"/> <!-- Delete additional store views --> <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteFirstStoreView"> @@ -48,7 +48,7 @@ </actionGroup> <!-- Delete category --> - <actionGroup ref="DeleteCategory" stepKey="deleteCategory"> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCategory"> <argument name="categoryEntity" value="Gear"/> </actionGroup> diff --git a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminCheckThatSomeAttributesChangedValueToEmptyAfterImportTest.xml b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminCheckThatSomeAttributesChangedValueToEmptyAfterImportTest.xml index 42516e5a5a363..6a2f6ca60acf4 100644 --- a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminCheckThatSomeAttributesChangedValueToEmptyAfterImportTest.xml +++ b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminCheckThatSomeAttributesChangedValueToEmptyAfterImportTest.xml @@ -22,8 +22,8 @@ <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndexPage"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridToDefaultView"/> - <actionGroup ref="deleteProductsIfTheyExist" stepKey="deleteAllProducts"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridToDefaultView"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteAllProducts"/> <createData entity="productDropDownAttribute" stepKey="productAttribute"/> <createData entity="productAttributeOption2" stepKey="attributeOptionWithDefaultValue"> <requiredEntity createDataKey="productAttribute"/> @@ -44,22 +44,22 @@ <actionGroup ref="logout" stepKey="logoutFromAdmin"/> </after> <!--Create product--> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="openProductFillForm"/> - <actionGroup ref="fillMainProductForm" stepKey="fillProductFieldsInAdmin"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="openProductFillForm"/> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductFieldsInAdmin"> <argument name="product" value="simpleProductWithShortNameAndSku"/> </actionGroup> - <actionGroup ref="SetCategoryByName" stepKey="addCategoryToProduct"> + <actionGroup ref="SetCategoryByNameActionGroup" stepKey="addCategoryToProduct"> <argument name="categoryName" value="$$createCategory.name$$"/> </actionGroup> <!--Select created attribute--> - <actionGroup ref="addProductAttributeInProductModal" stepKey="addAttributeToProduct"> + <actionGroup ref="AddProductAttributeInProductModalActionGroup" stepKey="addAttributeToProduct"> <argument name="attributeCode" value="$$productAttribute.attribute_code$$"/> </actionGroup> <!--Check that attribute value is selected--> <scrollTo selector="{{AdminProductFormSection.attributeTab}}" stepKey="scrollToAttributeTitle1"/> <conditionalClick selector="{{AdminProductFormSection.attributeTab}}" dependentSelector="{{AdminProductAttributeSection.dropDownAttribute($$productAttribute.attribute_code$$)}}" visible="false" stepKey="expandAttributeTab1"/> <seeOptionIsSelected selector="{{AdminProductAttributeSection.dropDownAttribute($$productAttribute.attribute_code$$)}}" userInput="option2" stepKey="seeAttributeValueIsSelected1"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!--Import product with add/update behavior--> <actionGroup ref="AdminImportProductsActionGroup" stepKey="adminImportProductsFirstTime"> <argument name="behavior" value="Add/Update"/> @@ -67,7 +67,7 @@ <argument name="importNoticeMessage" value="Created: 0, Updated: 1, Deleted: 0"/> </actionGroup> <!--Check that attribute value is empty after import--> - <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheProduct2"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterAndSelectTheProduct2"> <argument name="productSku" value="{{simpleProductWithShortNameAndSku.sku}}"/> </actionGroup> <scrollTo selector="{{AdminProductFormSection.attributeTab}}" stepKey="scrollToAttributeTitle2"/> diff --git a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminImportProductsWithErrorEntriesTest.xml b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminImportProductsWithErrorEntriesTest.xml index 94840a4ea6142..e3065f005218b 100644 --- a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminImportProductsWithErrorEntriesTest.xml +++ b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminImportProductsWithErrorEntriesTest.xml @@ -25,7 +25,7 @@ <!--Clear products grid filters--> <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearProductsGridFilters"/> <!--Delete all imported products--> - <actionGroup ref="deleteProductsIfTheyExist" stepKey="deleteAllProducts"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteAllProducts"/> <!--Logout from Admin page--> <actionGroup ref="logout" stepKey="logoutFromAdminPage"/> </after> diff --git a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminProductVisibilityDifferentStoreViewsAfterImportTest.xml b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminProductVisibilityDifferentStoreViewsAfterImportTest.xml index 0a1423ece71e0..738acc873b9c8 100644 --- a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminProductVisibilityDifferentStoreViewsAfterImportTest.xml +++ b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminProductVisibilityDifferentStoreViewsAfterImportTest.xml @@ -38,7 +38,7 @@ <actionGroup ref="adminDataGridSelectPerPage" stepKey="selectNumberOfProductsPerPage"> <argument name="perPage" value="100"/> </actionGroup> - <actionGroup ref="deleteProductsIfTheyExist" stepKey="deleteAllProducts"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteAllProducts"/> <!--Delete store views--> <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteEnglishStoreView"> <argument name="customStore" value="customStoreEN"/> @@ -55,17 +55,17 @@ <argument name="importNoticeMessage" value="Created: 2, Updated: 0, Deleted: 0"/> </actionGroup> <!--Open imported name4 product--> - <actionGroup ref="filterAndSelectProduct" stepKey="openName4Product"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="openName4Product"> <argument name="productSku" value="name4"/> </actionGroup> <!--Switch Chinese store view and assert visibility field--> <comment userInput="Switch Chinese store view and assert visibility field" stepKey="commentAssertVisibilityChineseView"/> - <actionGroup ref="SwitchToTheNewStoreView" stepKey="switchToCustomStoreView"> + <actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="switchToCustomStoreView"> <argument name="storeViewName" value="{{storeViewChinese.name}}"/> </actionGroup> <seeInField selector="{{AdminProductFormSection.visibility}}" userInput="Catalog" stepKey="seeVisibilityFieldForChineseStore"/> <!--Switch English store view and assert visibility field--> - <actionGroup ref="SwitchToTheNewStoreView" stepKey="switchToCustomEnglishView"> + <actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="switchToCustomEnglishView"> <argument name="storeViewName" value="{{customStoreEN.name}}"/> </actionGroup> <seeInField selector="{{AdminProductFormSection.visibility}}" userInput="Catalog" stepKey="seeVisibilityFieldForEnglishView"/> diff --git a/app/code/Magento/LayeredNavigation/Test/Mftf/Test/ShopByButtonInMobile.xml b/app/code/Magento/LayeredNavigation/Test/Mftf/Test/ShopByButtonInMobile.xml index 6d182d0b7a5e2..d2b462d0467a2 100644 --- a/app/code/Magento/LayeredNavigation/Test/Mftf/Test/ShopByButtonInMobile.xml +++ b/app/code/Magento/LayeredNavigation/Test/Mftf/Test/ShopByButtonInMobile.xml @@ -47,7 +47,7 @@ <comment userInput="Go to simple product edit page and set the product attribute to a value" stepKey="commentProductAttributeEdit" /> <amOnPage url="{{AdminProductEditPage.url($$simpleProduct1.id$$)}}" stepKey="goToEditPage"/> <selectOption selector="{{AdminProductFormSection.customSelectField($$attribute.attribute[attribute_code]$$)}}" userInput="option1" stepKey="selectAttribute"/> - <actionGroup ref="saveProductForm" stepKey="saveSimpleProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSimpleProduct"/> <!-- Check storefront mobile view for shop by button is functioning as expected --> <comment userInput="Check storefront mobile view for shop by button is functioning as expected" stepKey="commentCheckShopByButton" /> <amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToHomePage"/> diff --git a/app/code/Magento/Msrp/Test/Mftf/Test/StorefrontProductWithMapAssignedConfigProductIsCorrectTest.xml b/app/code/Magento/Msrp/Test/Mftf/Test/StorefrontProductWithMapAssignedConfigProductIsCorrectTest.xml index d1eb1339fe856..ccb724e8bf199 100644 --- a/app/code/Magento/Msrp/Test/Mftf/Test/StorefrontProductWithMapAssignedConfigProductIsCorrectTest.xml +++ b/app/code/Magento/Msrp/Test/Mftf/Test/StorefrontProductWithMapAssignedConfigProductIsCorrectTest.xml @@ -114,7 +114,7 @@ <waitForElement selector="{{AdminProductFormAdvancedPricingSection.msrp}}" stepKey="waitForMsrp"/> <fillField selector="{{AdminProductFormAdvancedPricingSection.msrp}}" userInput="55" stepKey="setMsrpForFirstChildProduct"/> <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct1"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct1"/> <amOnPage url="{{AdminProductEditPage.url($$createConfigChildProduct2.id$$)}}" stepKey="goToSecondChildProductEditPage"/> <waitForPageLoad stepKey="waitForProductPageLoad1"/> @@ -122,7 +122,7 @@ <waitForElement selector="{{AdminProductFormAdvancedPricingSection.msrp}}" stepKey="waitForMsrp1"/> <fillField selector="{{AdminProductFormAdvancedPricingSection.msrp}}" userInput="66" stepKey="setMsrpForSecondChildProduct"/> <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton1"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!--Clear cache--> <magentoCLI command="cache:flush" stepKey="flushCache"/> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithMultishipmentTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithMultishipmentTest.xml index 3a58ead3b6dfa..cfec857329b3d 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithMultishipmentTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithMultishipmentTest.xml @@ -38,11 +38,11 @@ </before> <amOnPage url="$$product1.name$$.html" stepKey="goToProduct1"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProduct1"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProduct1"> <argument name="productName" value="$$product1.name$$"/> </actionGroup> <amOnPage url="$$product2.name$$.html" stepKey="goToProduct2"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProduct2"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProduct2"> <argument name="productName" value="$$product2.name$$"/> </actionGroup> <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithSingleShipmentTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithSingleShipmentTest.xml index c9f1856249762..dcf0770e5421e 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithSingleShipmentTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithSingleShipmentTest.xml @@ -38,11 +38,11 @@ </before> <amOnPage url="$$product1.name$$.html" stepKey="goToProduct1"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProduct1"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProduct1"> <argument name="productName" value="$$product1.name$$"/> </actionGroup> <amOnPage url="$$product2.name$$.html" stepKey="goToProduct2"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProduct2"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProduct2"> <argument name="productName" value="$$product2.name$$"/> </actionGroup> <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMinicartWithMultishipmentTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMinicartWithMultishipmentTest.xml index c2fd978cf3137..e826d8e03ffbc 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMinicartWithMultishipmentTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMinicartWithMultishipmentTest.xml @@ -48,11 +48,11 @@ </after> <amOnPage url="$$product1.name$$.html" stepKey="goToProduct1"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProduct1"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProduct1"> <argument name="productName" value="$$product1.name$$"/> </actionGroup> <amOnPage url="$$product2.name$$.html" stepKey="goToProduct2"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProduct2"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProduct2"> <argument name="productName" value="$$product2.name$$"/> </actionGroup> <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMyAccountWithMultishipmentTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMyAccountWithMultishipmentTest.xml index eec8a40877bb3..52da343419a22 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMyAccountWithMultishipmentTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMyAccountWithMultishipmentTest.xml @@ -52,11 +52,11 @@ <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearAllFilters"/> <actionGroup ref="logout" stepKey="logoutAdmin"/> </after> - <actionGroup ref="AddSimpleProductToCart" stepKey="addSimpleProduct1ToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimpleProduct1ToCart"> <argument name="product" value="$$product1$$"/> </actionGroup> <waitForPageLoad stepKey="waitForSecondProductPageLoad"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="addSimpleProduct2ToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimpleProduct2ToCart"> <argument name="product" value="$$product2$$"/> </actionGroup> <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontCheckoutWithMultipleAddressesTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontCheckoutWithMultipleAddressesTest.xml index 138ab5df26ab0..dc786f9cbc5db 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontCheckoutWithMultipleAddressesTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontCheckoutWithMultipleAddressesTest.xml @@ -51,7 +51,7 @@ <argument name="productUrl" value="$$firstProduct.custom_attributes[url_key]$$"/> </actionGroup> <!-- Add the first product to the Shopping Cart --> - <actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPage" stepKey="addFirstProductToCart"> + <actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPageActionGroup" stepKey="addFirstProductToCart"> <argument name="productName" value="$$firstProduct.name$$"/> <argument name="productQty" value="1"/> </actionGroup> @@ -60,7 +60,7 @@ <argument name="productUrl" value="$$secondProduct.custom_attributes[url_key]$$"/> </actionGroup> <!-- Add the second product to the Shopping Cart --> - <actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPage" stepKey="addSecondProductToCart"> + <actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPageActionGroup" stepKey="addSecondProductToCart"> <argument name="productName" value="$$secondProduct.name$$"/> <argument name="productQty" value="1"/> </actionGroup> @@ -89,7 +89,7 @@ <argument name="productUrl" value="$$firstProduct.custom_attributes[url_key]$$"/> </actionGroup> <!-- Add three identical products to the Shopping Cart --> - <actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPage" stepKey="addIdenticalProductsToCart"> + <actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPageActionGroup" stepKey="addIdenticalProductsToCart"> <argument name="productName" value="$$firstProduct.name$$"/> <argument name="productQty" value="3"/> </actionGroup> diff --git a/app/code/Magento/Persistent/Test/Mftf/Test/CheckShoppingCartBehaviorAfterSessionExpiredTest.xml b/app/code/Magento/Persistent/Test/Mftf/Test/CheckShoppingCartBehaviorAfterSessionExpiredTest.xml index c66a2979aa7f5..ff5713f445097 100644 --- a/app/code/Magento/Persistent/Test/Mftf/Test/CheckShoppingCartBehaviorAfterSessionExpiredTest.xml +++ b/app/code/Magento/Persistent/Test/Mftf/Test/CheckShoppingCartBehaviorAfterSessionExpiredTest.xml @@ -43,7 +43,7 @@ <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> </after> <!-- Add simple product to cart --> - <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart1"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart1"> <argument name="product" value="$$createProduct$$"/> </actionGroup> <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/> diff --git a/app/code/Magento/Persistent/Test/Mftf/Test/GuestCheckoutWithEnabledPersistentTest.xml b/app/code/Magento/Persistent/Test/Mftf/Test/GuestCheckoutWithEnabledPersistentTest.xml index a383fd4505bd6..43390598f7cb3 100644 --- a/app/code/Magento/Persistent/Test/Mftf/Test/GuestCheckoutWithEnabledPersistentTest.xml +++ b/app/code/Magento/Persistent/Test/Mftf/Test/GuestCheckoutWithEnabledPersistentTest.xml @@ -31,7 +31,7 @@ <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> </after> <!-- Add simple product to cart --> - <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart1"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart1"> <argument name="product" value="$$createProduct$$"/> </actionGroup> <!-- Navigate to checkout --> diff --git a/app/code/Magento/Persistent/Test/Mftf/Test/ShippingQuotePersistedForGuestTest.xml b/app/code/Magento/Persistent/Test/Mftf/Test/ShippingQuotePersistedForGuestTest.xml index d508ebaa26885..2000617e79707 100644 --- a/app/code/Magento/Persistent/Test/Mftf/Test/ShippingQuotePersistedForGuestTest.xml +++ b/app/code/Magento/Persistent/Test/Mftf/Test/ShippingQuotePersistedForGuestTest.xml @@ -45,7 +45,7 @@ </actionGroup> <!--Step 2: Open the Product Page and add the product to shopping cart--> <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToProductPageAsLoggedUser"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProductToCartAsLoggedUser"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProductToCartAsLoggedUser"> <argument name="productName" value="$$createProduct.name$$"/> </actionGroup> <!--Step 3: Log out, reset persistent cookie and go to homepage--> @@ -56,7 +56,7 @@ <waitForPageLoad stepKey="waitHomePageLoadAfterResetCookie"/> <!--Step 4: Add the product to shopping cart and open cart--> <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToProductPageAsGuestUser"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProductToCartAsGuestUser"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProductToCartAsGuestUser"> <argument name="productName" value="$$createProduct.name$$"/> </actionGroup> <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartBeforeChangeShippingAndTaxSection"/> diff --git a/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyShoppingCartPersistenceUnderLongTermCookieTest.xml b/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyShoppingCartPersistenceUnderLongTermCookieTest.xml index e50fc4af83107..492e0a6f6b101 100644 --- a/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyShoppingCartPersistenceUnderLongTermCookieTest.xml +++ b/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyShoppingCartPersistenceUnderLongTermCookieTest.xml @@ -64,7 +64,7 @@ </actionGroup> <!-- 3. Put Simple Product 1 into Shopping Cart --> - <actionGroup ref="AddSimpleProductToCart" stepKey="addSimple1ProductToCartForJohnSmithCustomer"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimple1ProductToCartForJohnSmithCustomer"> <argument name="product" value="$$createSimple1$$"/> </actionGroup> <actionGroup ref="assertOneProductNameInMiniCart" stepKey="checkSimple1InMiniCartForJohnSmithCustomer"> @@ -92,7 +92,7 @@ <argument name="customerFullName" value="{{Simple_Customer_Without_Address.fullname}}"/> </actionGroup> <!-- 6. Add Simple Product 1 to Shopping Cart --> - <actionGroup ref="AddSimpleProductToCart" stepKey="addSimple1ProductToCartForJohnDoeCustomer"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimple1ProductToCartForJohnDoeCustomer"> <argument name="product" value="$$createSimple1$$"/> </actionGroup> <see selector="{{StorefrontMinicartSection.productCount}}" userInput="1" stepKey="miniCartContainsOneProductForJohnDoeCustomer"/> @@ -119,7 +119,7 @@ <see selector="{{CheckoutCartProductSection.productName}}" userInput="$$createSimple1.name$$" stepKey="checkSimple1InShoppingCart"/> <!-- 9. Add Simple Product 2 to Shopping Cart --> - <actionGroup ref="AddSimpleProductToCart" stepKey="addSimple2ProductToCartForGuest"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimple2ProductToCartForGuest"> <argument name="product" value="$$createSimple2$$"/> </actionGroup> <actionGroup ref="assertOneProductNameInMiniCart" stepKey="checkSimple1InMiniCartForGuestCustomerSecondTime"> diff --git a/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyThatInformationAboutViewingComparisonWishlistIsPersistedUnderLongTermCookieTest.xml b/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyThatInformationAboutViewingComparisonWishlistIsPersistedUnderLongTermCookieTest.xml index dc6f87bef0ba8..fd1396ce28d70 100644 --- a/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyThatInformationAboutViewingComparisonWishlistIsPersistedUnderLongTermCookieTest.xml +++ b/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyThatInformationAboutViewingComparisonWishlistIsPersistedUnderLongTermCookieTest.xml @@ -70,10 +70,10 @@ <see userInput="Welcome, $$createCustomer.firstname$$ $$createCustomer.lastname$$!" selector="{{StorefrontPanelHeaderSection.WelcomeMessage}}" stepKey="checkWelcomeMessage"/> <!--Open the details page of Simple Product 1, Simple Product 2 and add to cart, get to the category--> - <actionGroup ref="AddSimpleProductToCart" stepKey="addSimpleProductProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimpleProductProductToCart"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> - <actionGroup ref="AddSimpleProductToCart" stepKey="addSecondSimpleProductProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSecondSimpleProductProductToCart"> <argument name="product" value="$$createSecondSimpleProduct$$"/> </actionGroup> <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="openCategoryPageAfterAddedProductToCart"/> diff --git a/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminValidateUrlOnGetVideoInformationTest.xml b/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminValidateUrlOnGetVideoInformationTest.xml index 0db15276e8c67..03fb71ac039a7 100644 --- a/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminValidateUrlOnGetVideoInformationTest.xml +++ b/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminValidateUrlOnGetVideoInformationTest.xml @@ -25,7 +25,7 @@ <actionGroup ref="logout" stepKey="logout"/> </after> <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndexPage"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="SimpleProduct"/> </actionGroup> <actionGroup ref="AdminOpenProductVideoModalActionGroup" stepKey="openAddProductVideoModal"/> diff --git a/app/code/Magento/ProductVideo/Test/Mftf/Test/YoutubeVideoWindowOnProductPageTest.xml b/app/code/Magento/ProductVideo/Test/Mftf/Test/YoutubeVideoWindowOnProductPageTest.xml index 7249a4223503e..57e63945865fa 100644 --- a/app/code/Magento/ProductVideo/Test/Mftf/Test/YoutubeVideoWindowOnProductPageTest.xml +++ b/app/code/Magento/ProductVideo/Test/Mftf/Test/YoutubeVideoWindowOnProductPageTest.xml @@ -35,11 +35,11 @@ <!--Open simple product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex"/> <waitForPageLoad stepKey="wait1"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGrid"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGrid"/> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku"> <argument name="product" value="$$createProduct$$"/> </actionGroup> - <actionGroup ref="openProducForEditByClickingRowXColumnYInProductGrid" stepKey="openFirstProductForEdit"/> + <actionGroup ref="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup" stepKey="openFirstProductForEdit"/> <!-- Add product video --> <actionGroup ref="addProductVideo" stepKey="addProductVideo" after="openFirstProductForEdit"/> diff --git a/app/code/Magento/Quote/Test/Mftf/Test/StorefrontGuestCheckoutDisabledProductTest.xml b/app/code/Magento/Quote/Test/Mftf/Test/StorefrontGuestCheckoutDisabledProductTest.xml index f7a4fda4f67d8..6e31214b0dddf 100644 --- a/app/code/Magento/Quote/Test/Mftf/Test/StorefrontGuestCheckoutDisabledProductTest.xml +++ b/app/code/Magento/Quote/Test/Mftf/Test/StorefrontGuestCheckoutDisabledProductTest.xml @@ -86,11 +86,11 @@ <deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigChildProduct2"/> <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductListing"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetGridToDefaultKeywordSearch"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetGridToDefaultKeywordSearch"/> </after> <!-- Step 1: Add simple product to shopping cart --> <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.name$$)}}" stepKey="amOnSimpleProductPage"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="cartAddSimpleProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="cartAddSimpleProductToCart"> <argument name="product" value="$$createSimpleProduct$$"/> <argument name="productCount" value="1"/> </actionGroup> @@ -103,7 +103,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!-- Find the first simple product that we just created using the product grid and go to its page--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedProduct"> <argument name="product" value="$$createConfigChildProduct1$$"/> </actionGroup> <waitForPageLoad stepKey="waitForFiltersToBeApplied"/> @@ -111,7 +111,7 @@ <waitForPageLoad stepKey="waitForProductPageLoad"/> <!-- Disabled child configurable product --> <click selector="{{AdminProductFormSection.enableProductAttributeLabel}}" stepKey="clickDisableProduct"/> - <actionGroup ref="saveProductForm" stepKey="clickSaveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveProduct"/> <!-- Disabled simple product from grid --> <actionGroup ref="ChangeStatusProductUsingProductGridActionGroup" stepKey="disabledProductFromGrid"> <argument name="product" value="$$createSimpleProduct$$"/> @@ -126,7 +126,7 @@ <dontSeeElement selector="{{StorefrontMiniCartSection.quantity}}" stepKey="dontSeeCartItem"/> <!-- Add simple product to shopping cart --> <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct2.name$$)}}" stepKey="amOnSimpleProductPage2"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="cartAddSimpleProductToCart2"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="cartAddSimpleProductToCart2"> <argument name="product" value="$$createSimpleProduct2$$"/> <argument name="productCount" value="1"/> </actionGroup> @@ -135,7 +135,7 @@ <openNewTab stepKey="openNewTab2"/> <!-- Find the first simple product that we just created using the product grid and go to its page --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage2"/> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedProduct2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedProduct2"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <click selector="{{AdminProductGridSection.firstRow}}" stepKey="clickOnProductPage2"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml index 116b8e7d6ca71..ed081d60074fc 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml @@ -152,7 +152,7 @@ <actionGroup ref="cancelPendingOrder" stepKey="cancelPendingOrder"/> <!-- Assert Simple Product Quantity in backend after order Canceled --> <comment userInput="Assert Simple Product Quantity in backend after order Canceled" stepKey="assertSimpleProductQuantityAfterOrderCanceledComment"/> - <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterAndSelectTheProduct"> <argument name="productSku" value="$$simpleProduct.sku$$"/> </actionGroup> <waitForElementVisible selector="{{AdminProductFormSection.productName}}" stepKey="waitForProductDetailsToLoad"/> @@ -167,7 +167,7 @@ </actionGroup> <!-- Assert Virtual Product Quantity in backend after order canceled --> <comment userInput="Assert Virtual Product Quantity in backend after order canceled" stepKey="assertVirtualProductQuantityAfterOrderCanceledComment"/> - <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheVirtualProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterAndSelectTheVirtualProduct"> <argument name="productSku" value="$$virtualProduct.sku$$"/> </actionGroup> <waitForElementVisible selector="{{AdminProductFormSection.productName}}" stepKey="waitForProductDetailsToLoad1"/> @@ -182,7 +182,7 @@ </actionGroup> <!-- Assert Bundle Product Quantity in backend after order canceled --> <comment userInput="Assert Bundle Product Quantity in backend after order canceled" stepKey="assertBundleProductQuantityAfterOrderCanceledComment"/> - <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheBundleProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterAndSelectTheBundleProduct"> <argument name="productSku" value="$$simpleProduct1.sku$$"/> </actionGroup> <waitForElementVisible selector="{{AdminProductFormSection.productName}}" stepKey="waitForProductDetailsToLoad2"/> @@ -197,7 +197,7 @@ </actionGroup> <!-- Assert Configurable Product Quantity in backend after order canceled --> <comment userInput="Assert Configurable Product quantity in backend after order canceled" stepKey="assertConfigurableProductQuantityAfterOrderCanceledComment"/> - <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheConfigProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterAndSelectTheConfigProduct"> <argument name="productSku" value="$$createConfigChildProduct1.sku$$"/> </actionGroup> <waitForElementVisible selector="{{AdminProductFormSection.productName}}" stepKey="waitForProductDetailsToLoad3"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithProductQtyWithoutStockDecreaseTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithProductQtyWithoutStockDecreaseTest.xml index 4300f22c3fb3a..28aa3fab7b9a7 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithProductQtyWithoutStockDecreaseTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithProductQtyWithoutStockDecreaseTest.xml @@ -67,7 +67,7 @@ <grabTextFrom selector="|Order # (\d+)|" stepKey="orderId"/> <!-- Assert Simple Product Quantity in backend after order --> - <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterAndSelectTheProduct"> <argument name="productSku" value="$$simpleProduct.sku$$"/> </actionGroup> <waitForElementVisible selector="{{AdminProductFormSection.productName}}" stepKey="waitForProductDetailsToLoad"/> @@ -89,7 +89,7 @@ <actionGroup ref="cancelPendingOrder" stepKey="cancelPendingOrder"/> <!-- Assert Simple Product Quantity in backend after Cancelling the order --> - <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheProduct1"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterAndSelectTheProduct1"> <argument name="productSku" value="$$simpleProduct.sku$$"/> </actionGroup> <waitForElementVisible selector="{{AdminProductFormSection.productName}}" stepKey="waitForProductDetailsToLoad1"/> @@ -114,7 +114,7 @@ <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="submitOrder1"/> <!-- Assert Simple Product Quantity in backend after Reorder --> - <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheProduct2"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterAndSelectTheProduct2"> <argument name="productSku" value="$$simpleProduct.sku$$"/> </actionGroup> <waitForElementVisible selector="{{AdminProductFormSection.productName}}" stepKey="waitForProductDetailsToLoad2"/> @@ -122,4 +122,4 @@ <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="10" stepKey="seeProductQuantityAfterReorder"/> <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="In Stock" stepKey="seeProductStockStatusAfterReorder"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCorrectnessInvoicedItemInBundleProductTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCorrectnessInvoicedItemInBundleProductTest.xml index 4310d412d1c98..75f3640b16405 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCorrectnessInvoicedItemInBundleProductTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCorrectnessInvoicedItemInBundleProductTest.xml @@ -53,7 +53,7 @@ <!--Complete Bundle product creation--> <amOnPage url="{{AdminProductEditPage.url($$createBundleProduct.id$$)}}" stepKey="goToProductEditPage"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!--Run re-index task--> <magentoCLI command="indexer:reindex" stepKey="reindex"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoiceTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoiceTest.xml index a90fe5c49f032..b0868a408498f 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoiceTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoiceTest.xml @@ -84,7 +84,7 @@ <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Processing" stepKey="seeOrderStatus"/> <amOnPage url="{{AdminInvoicesPage.url}}" stepKey="goToInvoices"/> <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask6" /> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetGridInitial"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetGridInitial"/> <click selector="{{AdminInvoicesGridSection.filter}}" stepKey="clickFilters"/> <fillField selector="{{AdminInvoicesFiltersSection.orderNum}}" userInput="{$grabOrderNumber}" stepKey="searchOrderNum2"/> <click selector="{{AdminInvoicesFiltersSection.applyFilters}}" stepKey="clickApplyFilters"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminProductInTheShoppingCartCouldBeReachedByAdminDuringOrderCreationWithMultiWebsiteConfigTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminProductInTheShoppingCartCouldBeReachedByAdminDuringOrderCreationWithMultiWebsiteConfigTest.xml index b40e9d041a10e..2b7b8bac2038b 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminProductInTheShoppingCartCouldBeReachedByAdminDuringOrderCreationWithMultiWebsiteConfigTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminProductInTheShoppingCartCouldBeReachedByAdminDuringOrderCreationWithMultiWebsiteConfigTest.xml @@ -37,10 +37,10 @@ <argument name="StoreGroup" value="customStoreGroup"/> <argument name="customStore" value="customStore"/> </actionGroup> - <actionGroup ref="goToProductPageViaID" stepKey="goToProductEditPage"> + <actionGroup ref="GoToProductPageViaIDActionGroup" stepKey="goToProductEditPage"> <argument name="productId" value="$$createProduct.id$$"/> </actionGroup> - <actionGroup ref="ProductSetWebsite" stepKey="assignProductToSecondWebsite"> + <actionGroup ref="ProductSetWebsiteActionGroup" stepKey="assignProductToSecondWebsite"> <argument name="website" value="{{customWebsite.name}}"/> </actionGroup> </before> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml index 0bd8ab4855e97..aa506ead65974 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml @@ -36,7 +36,7 @@ </createData> <!-- Check Links can be purchased separately for Downloadable Product --> - <actionGroup ref="navigateToCreatedProductEditPage" stepKey="goToDownloadableProduct"> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToDownloadableProduct"> <argument name="product" value="$$downloadableProduct$$"/> </actionGroup> <waitForPageLoad stepKey="waitForPageLoad"/> @@ -112,7 +112,7 @@ </createData> <!-- Grab attribute name for Configurable Product --> - <actionGroup ref="navigateToCreatedProductEditPage" stepKey="goToConfigurableProduct"> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToConfigurableProduct"> <argument name="product" value="$$createConfigProduct$$"/> </actionGroup> <grabTextFrom selector="{{AdminConfigurableProductFormSection.currentAttribute}}" stepKey="grabAttribute"/> @@ -145,7 +145,7 @@ </createData> <!-- Grab bundle option name for Bundle Product --> - <actionGroup ref="navigateToCreatedProductEditPage" stepKey="goToBundleProduct"> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToBundleProduct"> <argument name="product" value="$$createBundleProduct$$"/> </actionGroup> <grabTextFrom selector="{{AdminProductFormBundleSection.currentBundleOption}}" stepKey="grabBundleOption"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml index ab085dc5ae137..675a5857f3959 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml @@ -36,7 +36,7 @@ <deleteData createDataKey="defaultCategory" stepKey="deleteCategory"/> <deleteData createDataKey="simpleProduct" stepKey="deleteSimpleProduct"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteBundleProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteBundleProduct"> <argument name="sku" value="{{BundleProduct.sku}}"/> </actionGroup> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFilters"/> @@ -52,10 +52,10 @@ <!--Start creating a bundle product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductList"/> <waitForPageLoad stepKey="waitForProductList"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="BundleProduct"/> </actionGroup> - <actionGroup ref="fillProductNameAndSkuInProductForm" stepKey="fillNameAndSku"> + <actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillNameAndSku"> <argument name="product" value="BundleProduct"/> </actionGroup> <pressKey selector="{{AdminProductFormSection.productSku}}" parameterArray="[\Facebook\WebDriver\WebDriverKeys::ENTER]" stepKey="enter"/> @@ -83,7 +83,7 @@ </actionGroup> <selectOption selector="{{AdminProductFormBundleSection.bundlePriceType}}" userInput="Fixed" stepKey="selectPriceType"/> <fillField selector="{{AdminProductFormBundleSection.bundlePriceValue}}" userInput="200" stepKey="fillPriceValue"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!--Create cart price rule--> <actionGroup ref="AdminCreateCartPriceRuleWithConditions" stepKey="createRule"> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateBuyXGetYFreeTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateBuyXGetYFreeTest.xml index 02078ff15ecc2..625e174ae9c8e 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateBuyXGetYFreeTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateBuyXGetYFreeTest.xml @@ -50,7 +50,7 @@ <see selector="{{AdminCartPriceRulesSection.messages}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> <!-- Create a product to check the storefront --> - <actionGroup ref="FillAdminSimpleProductForm" stepKey="fillProductFieldsInAdmin"> + <actionGroup ref="FillAdminSimpleProductFormActionGroup" stepKey="fillProductFieldsInAdmin"> <argument name="category" value="$$createPreReqCategory$$"/> <argument name="simpleProduct" value="_defaultProduct"/> </actionGroup> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleAndVerifyRuleConditionAndFreeShippingIsAppliedTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleAndVerifyRuleConditionAndFreeShippingIsAppliedTest.xml index b51027d51fd53..d2efdfb6ec084 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleAndVerifyRuleConditionAndFreeShippingIsAppliedTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleAndVerifyRuleConditionAndFreeShippingIsAppliedTest.xml @@ -74,7 +74,7 @@ <seeInField selector="{{AdminCartPriceRulesFormSection.defaultStoreView}}" userInput="{{CartPriceRuleConditionAndFreeShippingApplied.defaultStoreView}}" stepKey="seeDefaultStoreView"/> <!--Go to storefront page and verify created product--> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="product" value="$$initialSimpleProduct$$"/> </actionGroup> <!--Click on Add To Cart button--> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleAndVerifyRuleConditionIsNotAppliedTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleAndVerifyRuleConditionIsNotAppliedTest.xml index 8969e9d9d4ceb..dcd813bb30b35 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleAndVerifyRuleConditionIsNotAppliedTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleAndVerifyRuleConditionIsNotAppliedTest.xml @@ -85,7 +85,7 @@ <seeInField selector="{{AdminCartPriceRulesFormSection.defaultStoreView}}" userInput="{{CartPriceRuleConditionNotApplied.defaultStoreView}}" stepKey="seeDefaultStoreView"/> <!--Go to storefront page and verify created product--> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="product" value="$$initialSimpleProduct$$"/> </actionGroup> <fillField selector="{{StorefrontProductInfoMainSection.qty}}" userInput="2" stepKey="fillProductQuantity"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForCouponCodeTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForCouponCodeTest.xml index 712475186d5bf..6242c1f3d1baf 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForCouponCodeTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForCouponCodeTest.xml @@ -67,7 +67,7 @@ <seeInField selector="{{AdminCartPriceRulesFormSection.discountAmount}}" userInput="5" stepKey="seeDiscountAmount"/> <!-- Create a product to check the storefront --> - <actionGroup ref="FillAdminSimpleProductForm" stepKey="fillProductFieldsInAdmin"> + <actionGroup ref="FillAdminSimpleProductFormActionGroup" stepKey="fillProductFieldsInAdmin"> <argument name="category" value="$$createPreReqCategory$$"/> <argument name="simpleProduct" value="_defaultProduct"/> </actionGroup> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForGeneratedCouponTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForGeneratedCouponTest.xml index d719bb90efd59..78943a0648b51 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForGeneratedCouponTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForGeneratedCouponTest.xml @@ -69,7 +69,7 @@ <grabTextFrom selector="{{AdminCartPriceRulesFormSection.generatedCouponByIndex('1')}}" stepKey="grabCouponCode"/> <!-- Create a product to check the storefront --> - <actionGroup ref="FillAdminSimpleProductForm" stepKey="fillProductFieldsInAdmin"> + <actionGroup ref="FillAdminSimpleProductFormActionGroup" stepKey="fillProductFieldsInAdmin"> <argument name="category" value="$$createPreReqCategory$$"/> <argument name="simpleProduct" value="_defaultProduct"/> </actionGroup> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForMatchingSubtotalAndVerifyRuleConditionIsAppliedTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForMatchingSubtotalAndVerifyRuleConditionIsAppliedTest.xml index ab62e51414e85..7ecf869ec1c7e 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForMatchingSubtotalAndVerifyRuleConditionIsAppliedTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForMatchingSubtotalAndVerifyRuleConditionIsAppliedTest.xml @@ -84,7 +84,7 @@ <seeInField selector="{{AdminCartPriceRulesFormSection.defaultStoreView}}" userInput="{{CartPriceRuleConditionAppliedForSubtotal.defaultStoreView}}" stepKey="seeDefaultStoreView"/> <!--Go to storefront page and verify created product--> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="product" value="$$initialSimpleProduct$$"/> </actionGroup> <!--Click on Add To Cart button--> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingCategoryAndVerifyRuleConditionIsAppliedTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingCategoryAndVerifyRuleConditionIsAppliedTest.xml index 00f104885e0f0..eeccdef78c554 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingCategoryAndVerifyRuleConditionIsAppliedTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingCategoryAndVerifyRuleConditionIsAppliedTest.xml @@ -21,14 +21,14 @@ <before> <actionGroup ref = "LoginAsAdmin" stepKey="loginAsAdmin"/> <createData entity="_defaultCategory" stepKey="createCategory"/> - <actionGroup ref="FillAdminSimpleProductForm" stepKey="fillProductFieldsInAdmin"> + <actionGroup ref="FillAdminSimpleProductFormActionGroup" stepKey="fillProductFieldsInAdmin"> <argument name="category" value="$$createCategory$$"/> <argument name="simpleProduct" value="_defaultProduct"/> </actionGroup> </before> <after> <deleteData createDataKey="createCategory" stepKey="deletePreReqCategory"/> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteSimpleProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteSimpleProduct"> <argument name="product" value="_defaultProduct"/> </actionGroup> <actionGroup ref="DeleteCartPriceRuleByName" stepKey="deleteCreatedCartPriceRule"> @@ -94,7 +94,7 @@ <!--Go to storefront page and verify created product--> <amOnPage url="{{StorefrontProductPage.url(_defaultProduct.urlKey)}}" stepKey="onCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="productName" value="_defaultProduct.name"/> </actionGroup> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingTotalWeightAndVerifyRuleConditionIsAppliedTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingTotalWeightAndVerifyRuleConditionIsAppliedTest.xml index 43b92ee938978..9157de478efec 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingTotalWeightAndVerifyRuleConditionIsAppliedTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingTotalWeightAndVerifyRuleConditionIsAppliedTest.xml @@ -81,7 +81,7 @@ <seeInField selector="{{AdminCartPriceRulesFormSection.defaultStoreView}}" userInput="{{CartPriceRuleConditionAppliedForWeight.defaultStoreView}}" stepKey="seeDefaultStoreView"/> <!--Go to storefront page and verify created product--> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="product" value="$$initialSimpleProduct$$"/> </actionGroup> <!--Click on Add To Cart button--> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountDiscountTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountDiscountTest.xml index 1681d910ccdb0..44c89d022edb3 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountDiscountTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountDiscountTest.xml @@ -49,7 +49,7 @@ <see selector="{{AdminCartPriceRulesSection.messages}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> <!-- Create a product to check the storefront --> - <actionGroup ref="FillAdminSimpleProductForm" stepKey="fillProductFieldsInAdmin"> + <actionGroup ref="FillAdminSimpleProductFormActionGroup" stepKey="fillProductFieldsInAdmin"> <argument name="category" value="$$createPreReqCategory$$"/> <argument name="simpleProduct" value="_defaultProduct"/> </actionGroup> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountWholeCartDiscountTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountWholeCartDiscountTest.xml index 69918bda8c426..b92efd6f83651 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountWholeCartDiscountTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountWholeCartDiscountTest.xml @@ -49,7 +49,7 @@ <see selector="{{AdminCartPriceRulesSection.messages}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> <!-- Create a product to check the storefront --> - <actionGroup ref="FillAdminSimpleProductForm" stepKey="fillProductFieldsInAdmin"> + <actionGroup ref="FillAdminSimpleProductFormActionGroup" stepKey="fillProductFieldsInAdmin"> <argument name="category" value="$$createPreReqCategory$$"/> <argument name="simpleProduct" value="_defaultProduct"/> </actionGroup> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreatePercentOfProductPriceTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreatePercentOfProductPriceTest.xml index 898e5a07304b6..5fd7c7241130f 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreatePercentOfProductPriceTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreatePercentOfProductPriceTest.xml @@ -49,7 +49,7 @@ <see selector="{{AdminCartPriceRulesSection.messages}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> <!-- Create a product to check the storefront --> - <actionGroup ref="FillAdminSimpleProductForm" stepKey="fillProductFieldsInAdmin"> + <actionGroup ref="FillAdminSimpleProductFormActionGroup" stepKey="fillProductFieldsInAdmin"> <argument name="category" value="$$createPreReqCategory$$"/> <argument name="simpleProduct" value="_defaultProduct"/> </actionGroup> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminDeleteInactiveSalesRuleAndVerifyDeleteMessageTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminDeleteInactiveSalesRuleAndVerifyDeleteMessageTest.xml index 1570bfbdb7a23..39a5d0f6a7131 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminDeleteInactiveSalesRuleAndVerifyDeleteMessageTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminDeleteInactiveSalesRuleAndVerifyDeleteMessageTest.xml @@ -44,7 +44,7 @@ </actionGroup> <!--Verify customer don't see updated virtual product link on category page --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="product" value="$$initialSimpleProduct$$"/> </actionGroup> @@ -62,4 +62,4 @@ <argument name="qty" value="1"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToComplexProductsTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToComplexProductsTest.xml index d8c5b42dbaaaf..a14ccc2ad879f 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToComplexProductsTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToComplexProductsTest.xml @@ -31,28 +31,28 @@ </actionGroup> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!-- Assign config1 and the associated child products to CAT1 --> - <actionGroup ref="AdminAssignProductToCategory" stepKey="assignConfigurableProduct1ToCategory"> + <actionGroup ref="AdminAssignProductToCategoryActionGroup" stepKey="assignConfigurableProduct1ToCategory"> <argument name="productId" value="$$createConfigProductCreateConfigurableProduct1.id$$"/> <argument name="categoryName" value="$$createCategory.name$$"/> </actionGroup> - <actionGroup ref="AdminAssignProductToCategory" stepKey="assignConfig1ChildProduct1ToCategory"> + <actionGroup ref="AdminAssignProductToCategoryActionGroup" stepKey="assignConfig1ChildProduct1ToCategory"> <argument name="productId" value="$$createConfigChildProduct1CreateConfigurableProduct1.id$$"/> <argument name="categoryName" value="$$createCategory.name$$"/> </actionGroup> - <actionGroup ref="AdminAssignProductToCategory" stepKey="assignConfig1ChildProduct2ToCategory"> + <actionGroup ref="AdminAssignProductToCategoryActionGroup" stepKey="assignConfig1ChildProduct2ToCategory"> <argument name="productId" value="$$createConfigChildProduct2CreateConfigurableProduct1.id$$"/> <argument name="categoryName" value="$$createCategory.name$$"/> </actionGroup> <!-- Assign config12 and the associated child products to CAT2 --> - <actionGroup ref="AdminAssignProductToCategory" stepKey="assignConfigurableProduct2ToCategory2"> + <actionGroup ref="AdminAssignProductToCategoryActionGroup" stepKey="assignConfigurableProduct2ToCategory2"> <argument name="productId" value="$$createConfigProductCreateConfigurableProduct2.id$$"/> <argument name="categoryName" value="$$createCategory2.name$$"/> </actionGroup> - <actionGroup ref="AdminAssignProductToCategory" stepKey="assignConfig2ChildProduct1ToCategory2"> + <actionGroup ref="AdminAssignProductToCategoryActionGroup" stepKey="assignConfig2ChildProduct1ToCategory2"> <argument name="productId" value="$$createConfigChildProduct1CreateConfigurableProduct2.id$$"/> <argument name="categoryName" value="$$createCategory2.name$$"/> </actionGroup> - <actionGroup ref="AdminAssignProductToCategory" stepKey="assignConfig2ChildProduct2ToCategory2"> + <actionGroup ref="AdminAssignProductToCategoryActionGroup" stepKey="assignConfig2ChildProduct2ToCategory2"> <argument name="productId" value="$$createConfigChildProduct2CreateConfigurableProduct2.id$$"/> <argument name="categoryName" value="$$createCategory2.name$$"/> </actionGroup> diff --git a/app/code/Magento/Search/Test/Mftf/Test/AdminGlobalSearchOnProductPageTest.xml b/app/code/Magento/Search/Test/Mftf/Test/AdminGlobalSearchOnProductPageTest.xml index 45a5f53c3e448..725f45c0bc6e3 100644 --- a/app/code/Magento/Search/Test/Mftf/Test/AdminGlobalSearchOnProductPageTest.xml +++ b/app/code/Magento/Search/Test/Mftf/Test/AdminGlobalSearchOnProductPageTest.xml @@ -24,12 +24,12 @@ </before> <after> <!-- Delete product --> - <actionGroup ref="deleteProductBySku" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> <argument name="sku" value="{{SimpleProduct.sku}}"/> </actionGroup> <!-- Delete category --> - <actionGroup ref="DeleteCategory" stepKey="deleteCreatedNewRootCategory"> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCreatedNewRootCategory"> <argument name="categoryEntity" value="_defaultCategory"/> </actionGroup> @@ -40,20 +40,20 @@ <!-- Create Simple Product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="adminProductIndexPageAdd"/> <waitForPageLoad stepKey="waitForProductIndexPageLoad"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProductPage"> <argument name="product" value="SimpleProduct"/> </actionGroup> - <actionGroup ref="fillMainProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="SimpleProduct"/> </actionGroup> <!-- Create new category for product --> - <actionGroup ref="FillNewProductCategory" stepKey="FillNewProductCategory"> + <actionGroup ref="FillNewProductCategoryActionGroup" stepKey="FillNewProductCategory"> <argument name="categoryName" value="{{_defaultCategory.name}}"/> </actionGroup> <!-- Save product form --> - <actionGroup ref="saveProductForm" stepKey="saveProductForm"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> <!-- Click on the magnifying glass to start searching --> <click selector="{{AdminGlobalSearchSection.globalSearch}}" stepKey="clickSearchBtn"/> diff --git a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductDescriptionTest.xml b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductDescriptionTest.xml index c5124ac9c74a1..9e5001591bb91 100644 --- a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductDescriptionTest.xml +++ b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductDescriptionTest.xml @@ -28,7 +28,7 @@ <!-- Delete all search terms --> <comment userInput="Delete all search terms" stepKey="deleteAllSearchTermsComment"/> <actionGroup ref="DeleteAllSearchTerms" stepKey="deleteAllSearchTerms"/> - <actionGroup ref="deleteAllProductsUsingProductGrid" stepKey="deleteAllProducts"/> + <actionGroup ref="DeleteAllProductsUsingProductGridActionGroup" stepKey="deleteAllProducts"/> <!-- Create product with description --> <comment userInput="Create product with description" stepKey="createProductWithDescriptionComment"/> <createData entity="SimpleProductWithDescription" stepKey="simpleProduct"/> diff --git a/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateOrderCustomStoreShippingMethodTableRatesTest.xml b/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateOrderCustomStoreShippingMethodTableRatesTest.xml index b2e3e2516a5c3..9602bfdde5e75 100644 --- a/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateOrderCustomStoreShippingMethodTableRatesTest.xml +++ b/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateOrderCustomStoreShippingMethodTableRatesTest.xml @@ -78,13 +78,13 @@ <!--Assign product to custom website--> <amOnPage url="{{AdminProductEditPage.url($$createProduct.id$$)}}" stepKey="goToProductEditPage"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> - <actionGroup ref="unassignWebsiteFromProductActionGroup" stepKey="unassignWebsiteInProduct"> + <actionGroup ref="UnassignWebsiteFromProductActionGroup" stepKey="unassignWebsiteInProduct"> <argument name="website" value="{{_defaultWebsite.name}}"/> </actionGroup> <actionGroup ref="SelectProductInWebsitesActionGroup" stepKey="selectWebsiteInProduct"> <argument name="website" value="{{customWebsite.name}}"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!--Create order--> <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$createCustomer$$"/> diff --git a/app/code/Magento/Shipping/Test/Mftf/Test/StorefrontDisplayTableRatesShippingMethodForAETest.xml b/app/code/Magento/Shipping/Test/Mftf/Test/StorefrontDisplayTableRatesShippingMethodForAETest.xml index bb29a4a28bcf6..81fe492ffc005 100644 --- a/app/code/Magento/Shipping/Test/Mftf/Test/StorefrontDisplayTableRatesShippingMethodForAETest.xml +++ b/app/code/Magento/Shipping/Test/Mftf/Test/StorefrontDisplayTableRatesShippingMethodForAETest.xml @@ -54,7 +54,7 @@ <argument name="Customer" value="$$createCustomer$$"/> </actionGroup> <!--Add the created product to the shopping cart--> - <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> <argument name="product" value="$$createProduct$$"/> </actionGroup> <!--Proceed to Checkout from the mini cart--> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateImageSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateImageSwatchTest.xml index 0e294153e881e..aac765b4926af 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateImageSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateImageSwatchTest.xml @@ -98,10 +98,10 @@ <!-- Create a configurable product to verify the storefront with --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad time="30" stepKey="waitForProductGrid"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateConfigurableProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateConfigurableProduct"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> - <actionGroup ref="fillMainProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createCategory.name$$]" stepKey="fillCategory"/> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateTextSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateTextSwatchTest.xml index 87d3f0bb5bcb9..4685670fbfdd2 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateTextSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateTextSwatchTest.xml @@ -54,12 +54,12 @@ <!-- Create a configurable product to verify the storefront with --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad time="30" stepKey="waitForProductGrid"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateConfigurableProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateConfigurableProduct"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/> <fillField userInput="{{_defaultProduct.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/> - <actionGroup ref="fillMainProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateVisualSwatchWithNonValidOptionsTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateVisualSwatchWithNonValidOptionsTest.xml index b03f771875957..5b11cf5942cde 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateVisualSwatchWithNonValidOptionsTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateVisualSwatchWithNonValidOptionsTest.xml @@ -21,7 +21,7 @@ </before> <after> <!-- Remove attribute --> - <actionGroup ref="deleteProductAttribute" stepKey="deleteAttribute"> + <actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteAttribute"> <argument name="ProductAttribute" value="visualSwatchAttribute"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -103,10 +103,10 @@ <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/> - <actionGroup ref="navigateToCreatedProductAttribute" stepKey="navigateToAttribute"> + <actionGroup ref="NavigateToCreatedProductAttributeActionGroup" stepKey="navigateToAttribute"> <argument name="ProductAttribute" value="visualSwatchAttribute"/> </actionGroup> <!-- Check attribute data --> <seeCheckboxIsChecked selector="{{AdminManageSwatchSection.nthIsDefault('2')}}" stepKey="CheckDefaultOption"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml index f94314fe94806..43205375a6330 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml @@ -59,7 +59,7 @@ </before> <after> <!-- Delete product attribute and clear grid filter --> - <actionGroup ref="deleteProductAttributeByAttributeCode" stepKey="deleteProductAttribute"> + <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttribute"> <argument name="ProductAttributeCode" value="{{VisualSwatchProductAttribute.attribute_code}}"/> </actionGroup> <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearAttributesGridFilter"/> @@ -73,19 +73,19 @@ <!-- Add created product attribute to the Default set --> <actionGroup ref="AdminOpenAttributeSetGridPageActionGroup" stepKey="openAttributeSetPage"/> <actionGroup ref="AdminOpenAttributeSetByNameActionGroup" stepKey="openDefaultAttributeSet"/> - <actionGroup ref="AssignAttributeToGroup" stepKey="assignAttributeToGroup"> + <actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup"> <argument name="group" value="Product Details"/> <argument name="attribute" value="{{VisualSwatchProductAttribute.attribute_code}}"/> </actionGroup> - <actionGroup ref="SaveAttributeSet" stepKey="saveAttributeSet"/> + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveAttributeSet"/> <!-- Create configurable product --> <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPage"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateConfigurableProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateConfigurableProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <!-- Fill all the necessary information such as weight, name, SKU etc --> - <actionGroup ref="fillMainProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <!-- Click "Create Configurations" button, select created product attribute using the same Quantity for all products. Click "Generate products" button --> @@ -100,10 +100,10 @@ <attachFile selector="{{AdminDataGridTableSection.rowTemplate({$attributeCodeAdobeSmall})}}{{AdminProductFormConfigurationsSection.fileUploaderInput}}" userInput="{{TestImageAdobe.file}}" stepKey="uploadImageForSecondProduct"/> <!-- Click "Save" button --> - <actionGroup ref="saveProductForm" stepKey="clickSaveButton"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveButton"/> <!-- Delete all created product --> - <actionGroup ref="deleteProductBySku" stepKey="deleteCreatedProducts"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteCreatedProducts"> <argument name="sku" value="{{ApiConfigurableProduct.sku}}"/> </actionGroup> </test> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontConfigurableProductSwatchMinimumPriceTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontConfigurableProductSwatchMinimumPriceTest.xml index 0a98e7a721c17..af3e2f49c9e79 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontConfigurableProductSwatchMinimumPriceTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontConfigurableProductSwatchMinimumPriceTest.xml @@ -26,17 +26,17 @@ </before> <after> <!-- Delete configurable product and all child products --> - <actionGroup ref="deleteProductsByKeyword" stepKey="deleteProductsByKeyword"> + <actionGroup ref="DeleteProductsByKeywordActionGroup" stepKey="deleteProductsByKeyword"> <argument name="keyword" value="{{_defaultProduct.sku}}"/> </actionGroup> <!-- Delete category --> <deleteData createDataKey="createCategory" stepKey="deleteCategoryAttribute"/> <!-- Delete color attribute --> - <actionGroup ref="deleteProductAttribute" stepKey="deleteColorAttribute"> + <actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteColorAttribute"> <argument name="ProductAttribute" value="ProductColorAttribute"/> </actionGroup> <!-- Delete size attribute --> - <actionGroup ref="deleteProductAttribute" stepKey="deleteSizeAttribute"> + <actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteSizeAttribute"> <argument name="ProductAttribute" value="ProductSizeAttribute"/> </actionGroup> <!-- Logout --> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontDisplayAllCharactersOnTextSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontDisplayAllCharactersOnTextSwatchTest.xml index 1bcdd6fcf9a3a..0999b43c48820 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontDisplayAllCharactersOnTextSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontDisplayAllCharactersOnTextSwatchTest.xml @@ -63,7 +63,7 @@ <click selector="{{StorefrontCategorySidebarSection.attributeNthOption(ProductAttributeFrontendLabel.label, '4')}}" stepKey="filterBySwatch4"/> <!-- Deletes the created configurable product--> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteConfigurableProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteConfigurableProduct"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByImageSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByImageSwatchTest.xml index c9602ddcd127c..b23e94ae41d6b 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByImageSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByImageSwatchTest.xml @@ -81,18 +81,18 @@ <!-- Create a configurable product to verify the storefront with --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad time="30" stepKey="waitForProductGrid"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateConfigurableProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateConfigurableProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <!-- Add image to configurable product --> - <actionGroup ref="addProductImage" stepKey="addFirstImageForProductConfigurable"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addFirstImageForProductConfigurable"> <argument name="image" value="MagentoLogo"/> </actionGroup> <!-- Add image to configurable product --> - <actionGroup ref="addProductImage" stepKey="addSecondImageForProductConfigurable"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addSecondImageForProductConfigurable"> <argument name="image" value="TestImageNew"/> </actionGroup> - <actionGroup ref="fillMainProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createCategory.name$$]" stepKey="fillCategory"/> @@ -130,18 +130,18 @@ <dontSee selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" userInput="$$createSimpleProduct.name$$" stepKey="dontSeeSimpleProduct"/> <!-- Assert configurable product in storefront product page --> - <actionGroup ref="AssertProductInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <!-- Assert configurable product image in storefront product page --> - <actionGroup ref="assertProductImageStorefrontProductPage" stepKey="assertProductImageStorefrontProductPage"> + <actionGroup ref="AssertProductImageStorefrontProductPageActionGroup" stepKey="assertProductImageStorefrontProductPage"> <argument name="product" value="ApiConfigurableProduct"/> <argument name="image" value="MagentoLogo"/> </actionGroup> <!-- Assert configurable product image in storefront product page --> - <actionGroup ref="assertProductImageStorefrontProductPage" stepKey="assertProductSecondImageStorefrontProductPage"> + <actionGroup ref="AssertProductImageStorefrontProductPageActionGroup" stepKey="assertProductSecondImageStorefrontProductPage"> <argument name="product" value="ApiConfigurableProduct"/> <argument name="image" value="TestImageNew"/> </actionGroup> @@ -150,7 +150,7 @@ <click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel('adobe-thumb')}}" stepKey="clickSwatchOption"/> <!-- Assert swatch option image for configurable product image in storefront product page --> - <actionGroup ref="assertProductImageStorefrontProductPage" stepKey="assertSwatchImageStorefrontProductPage"> + <actionGroup ref="AssertProductImageStorefrontProductPageActionGroup" stepKey="assertSwatchImageStorefrontProductPage"> <argument name="product" value="ApiConfigurableProduct"/> <argument name="image" value="TestImageAdobe"/> </actionGroup> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByTextSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByTextSwatchTest.xml index 7bf63d25417e3..c065cb450d3e3 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByTextSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByTextSwatchTest.xml @@ -69,10 +69,10 @@ <!-- Create a configurable product to verify the storefront with --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGrid"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateConfigurableProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateConfigurableProduct"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> - <actionGroup ref="fillMainProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createCategory.name$$]" stepKey="fillCategory"/> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByVisualSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByVisualSwatchTest.xml index fd38c48919416..de12e326ebcef 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByVisualSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByVisualSwatchTest.xml @@ -81,10 +81,10 @@ <!-- Create a configurable product to verify the storefront with --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad time="30" stepKey="waitForProductGrid"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateConfigurableProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateConfigurableProduct"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> - <actionGroup ref="fillMainProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createCategory.name$$]" stepKey="fillCategory"/> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontImageColorWhenFilterByColorFilterTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontImageColorWhenFilterByColorFilterTest.xml index 2928011662864..64283accb9c13 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontImageColorWhenFilterByColorFilterTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontImageColorWhenFilterByColorFilterTest.xml @@ -30,7 +30,7 @@ <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> - <actionGroup ref="deleteProductAttributeByLabel" stepKey="deleteAttribute"> + <actionGroup ref="DeleteProductAttributeByLabelActionGroup" stepKey="deleteAttribute"> <argument name="ProductAttribute" value="visualSwatchAttribute"/> </actionGroup> <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPage"/> @@ -38,7 +38,7 @@ <actionGroup ref="adminDataGridSelectPerPage" stepKey="selectNumberOfProductsPerPage"> <argument name="perPage" value="100"/> </actionGroup> - <actionGroup ref="deleteProductsIfTheyExist" stepKey="deleteAllProducts"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteAllProducts"/> <actionGroup ref="logout" stepKey="logout"/> </after> <amOnPage url="{{AdminProductEditPage.url($$createConfigProduct.id$$)}}" stepKey="navigateToConfigProductPage"/> @@ -66,7 +66,7 @@ </actionGroup> <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton"/> <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnGenerateProductsButton"/> - <actionGroup ref="saveProductForm" stepKey="saveProductForm"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> <!-- Perform reindex and flush cache --> <magentoCLI command="indexer:reindex" stepKey="reindex"/> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSeeProductImagesMatchingProductSwatchesTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSeeProductImagesMatchingProductSwatchesTest.xml index 1717b424e4597..34f95d7f2284b 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSeeProductImagesMatchingProductSwatchesTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSeeProductImagesMatchingProductSwatchesTest.xml @@ -26,11 +26,11 @@ <after> <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> - <actionGroup ref="deleteProductAttribute" stepKey="deleteAttribute"> + <actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteAttribute"> <argument name="ProductAttribute" value="VisualSwatchProductAttribute"/> </actionGroup> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductAttributeGridFilter"/> - <actionGroup ref="deleteAllDuplicateProductUsingProductGrid" stepKey="deleteAllChildrenProducts"> + <actionGroup ref="DeleteAllDuplicateProductUsingProductGridActionGroup" stepKey="deleteAllChildrenProducts"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductGridFilter"/> @@ -63,15 +63,15 @@ </actionGroup> <!-- Edit configurable product --> - <actionGroup ref="goToProductPageViaID" stepKey="openProductEditPage"> + <actionGroup ref="GoToProductPageViaIDActionGroup" stepKey="openProductEditPage"> <argument name="productId" value="$$createSimpleProduct.id$$"/> </actionGroup> <!-- Add images to configurable product --> - <actionGroup ref="addProductImage" stepKey="addFirstImageForProductConfigurable"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addFirstImageForProductConfigurable"> <argument name="image" value="MagentoLogo"/> </actionGroup> - <actionGroup ref="addProductImage" stepKey="addSecondImageForProductConfigurable"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addSecondImageForProductConfigurable"> <argument name="image" value="TestImageNew"/> </actionGroup> @@ -97,15 +97,15 @@ <!-- Go to the category page --> <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="goToProductPage"/> - <actionGroup ref="StorefrontAssertActiveProductImage" stepKey="StorefrontAssertActiveProductImage"/> + <actionGroup ref="StorefrontAssertActiveProductImageActionGroup" stepKey="StorefrontAssertActiveProductImage"/> <!--Click a swatch and expect to see the image from the swatch from the configurable product --> <actionGroup ref="StorefrontSelectSwatchOptionOnProductPageAndCheckImage" stepKey="clickSwatchOption"> <argument name="optionName" value="{{visualSwatchOption1.default_label}}"/> <argument name="fileName" value="{{TestImageAdobe.filename}}"/> </actionGroup> - <actionGroup ref="StorefrontAssertFotoramaImageAvailablity" stepKey="seeFirstImageBaseProductInSwatchOption"/> - <actionGroup ref="StorefrontAssertFotoramaImageAvailablity" stepKey="seeSecondImageBaseProductInSwatchOption"> + <actionGroup ref="StorefrontAssertFotoramaImageAvailabilityActionGroup" stepKey="seeFirstImageBaseProductInSwatchOption"/> + <actionGroup ref="StorefrontAssertFotoramaImageAvailabilityActionGroup" stepKey="seeSecondImageBaseProductInSwatchOption"> <argument name="fileName" value="{{TestImageNew.filename}}"/> </actionGroup> @@ -113,8 +113,8 @@ <argument name="optionName" value="{{visualSwatchOption2.default_label}}"/> <argument name="fileName" value="{{ImageUpload3.filename}}"/> </actionGroup> - <actionGroup ref="StorefrontAssertFotoramaImageAvailablity" stepKey="seeFirstImageBaseProductInSwatchOption2"/> - <actionGroup ref="StorefrontAssertFotoramaImageAvailablity" stepKey="seeSecondImageBaseProductInSwatchOption2"> + <actionGroup ref="StorefrontAssertFotoramaImageAvailabilityActionGroup" stepKey="seeFirstImageBaseProductInSwatchOption2"/> + <actionGroup ref="StorefrontAssertFotoramaImageAvailabilityActionGroup" stepKey="seeSecondImageBaseProductInSwatchOption2"> <argument name="fileName" value="{{TestImageNew.filename}}"/> </actionGroup> </test> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributesDisplayInWidgetCMSTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributesDisplayInWidgetCMSTest.xml index 323b10507fe28..119a645252685 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributesDisplayInWidgetCMSTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributesDisplayInWidgetCMSTest.xml @@ -30,13 +30,13 @@ <after> <!--delete created configurable product--> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> <waitForPageLoad stepKey="waitForAdminProductGridLoad"/> <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <actionGroup ref="deleteProductAttributeByLabel" stepKey="deleteAttribute"> + <actionGroup ref="DeleteProductAttributeByLabelActionGroup" stepKey="deleteAttribute"> <argument name="ProductAttribute" value="visualSwatchAttribute"/> </actionGroup> <!--delete root category--> @@ -58,10 +58,10 @@ <!--Create a configurable swatch product via the UI --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex"/> <waitForPageLoad stepKey="waitForProductPage"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProductPage"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> - <actionGroup ref="fillMainProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createRootCategory.name$$]" stepKey="searchAndSelectCategory"/> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchProductWithFileCustomOptionTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchProductWithFileCustomOptionTest.xml index 5e712ebc38292..99b38bd3b34d6 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchProductWithFileCustomOptionTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchProductWithFileCustomOptionTest.xml @@ -34,19 +34,19 @@ <!-- Create a configurable swatch product via the UI --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex"/> <waitForPageLoad stepKey="waitForProductPage"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProductPage"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> - <actionGroup ref="fillMainProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createCategory.name$$]" stepKey="searchAndSelectCategory"/> <!--Add swatch attribute to configurable product--> <actionGroup ref="AddVisualSwatchToProductActionGroup" stepKey="addSwatchToProduct"/> <!--Add custom option to configurable product--> - <actionGroup ref="AddProductCustomOptionFile" stepKey="addCustomOptionToProduct"/> + <actionGroup ref="AddProductCustomOptionFileActionGroup" stepKey="addCustomOptionToProduct"/> <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct"/> - + <!--Go to storefront--> <amOnPage url="" stepKey="goToHomePage"/> <waitForPageLoad stepKey="waitForHomePageLoad"/> @@ -85,7 +85,7 @@ <click selector="{{CheckoutCartProductSection.RemoveItem}}" stepKey="deleteCartItem"/> <!--Delete product--> - <actionGroup ref="deleteProductBySku" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> <argument name="sku" value="{{BaseConfigurableProduct.sku}}"/> </actionGroup> </test> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxReportGridTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxReportGridTest.xml index 628d189823a52..814ac1aee1603 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxReportGridTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxReportGridTest.xml @@ -72,11 +72,11 @@ <!--Open Created products. In Tax Class select new created Product Tax classes.--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex"/> <waitForPageLoad stepKey="wait1"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGrid"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGrid"/> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku"> <argument name="product" value="$$firstProduct$$"/> </actionGroup> - <actionGroup ref="openProducForEditByClickingRowXColumnYInProductGrid" stepKey="openFirstProductForEdit"/> + <actionGroup ref="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup" stepKey="openFirstProductForEdit"/> <selectOption selector="{{AdminProductFormSection.productTaxClass}}" stepKey="selectTexClassForFirstProduct" userInput="TaxClasses1"/> <!-- Save the second product --> <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveFirstProduct"/> @@ -84,11 +84,11 @@ <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="againGoToProductIndex"/> <waitForPageLoad stepKey="wait2"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetSecondProductGrid"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterSecondProductGridBySku"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetSecondProductGrid"/> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterSecondProductGridBySku"> <argument name="product" value="$$secondProduct$$"/> </actionGroup> - <actionGroup ref="openProducForEditByClickingRowXColumnYInProductGrid" stepKey="openSecondProductForEdit"/> + <actionGroup ref="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup" stepKey="openSecondProductForEdit"/> <selectOption selector="{{AdminProductFormSection.productTaxClass}}" stepKey="selectTexClassForSecondProduct" userInput="TaxClasses2"/> <!-- Save the second product --> <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveSecondProduct"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForCustomerPhysicalQuoteTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForCustomerPhysicalQuoteTest.xml index aa44593400a89..5032ca693ceaa 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForCustomerPhysicalQuoteTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForCustomerPhysicalQuoteTest.xml @@ -57,10 +57,10 @@ <argument name="stateForFPT" value="New York"/> <argument name="valueForFPT" value="20"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPageLoad"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetGridToDefaultKeywordSearch"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetGridToDefaultKeywordSearch"/> </before> <after> <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForGuestPhysicalQuoteTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForGuestPhysicalQuoteTest.xml index bce9d895e311e..7ac66498b3c6d 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForGuestPhysicalQuoteTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForGuestPhysicalQuoteTest.xml @@ -55,10 +55,10 @@ <argument name="stateForFPT" value="New York"/> <argument name="valueForFPT" value="20"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPageLoad"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetGridToDefaultKeywordSearch"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetGridToDefaultKeywordSearch"/> </before> <after> <deleteData createDataKey="createTaxRule" stepKey="deleteTaxRule"/> diff --git a/app/code/Magento/Theme/Test/Mftf/Test/AdminDesignConfigMediaGalleryImageUploadTest.xml b/app/code/Magento/Theme/Test/Mftf/Test/AdminDesignConfigMediaGalleryImageUploadTest.xml index f46328ac151b1..8939bf6744042 100644 --- a/app/code/Magento/Theme/Test/Mftf/Test/AdminDesignConfigMediaGalleryImageUploadTest.xml +++ b/app/code/Magento/Theme/Test/Mftf/Test/AdminDesignConfigMediaGalleryImageUploadTest.xml @@ -61,7 +61,7 @@ <waitForPageLoad stepKey="waitForPageloadSuccess2"/> <!--Delete Image: will be in both root and favicon--> <comment userInput="Delete Image" stepKey="deleteImageComment"/> - <actionGroup ref="navigateToMediaGallery" stepKey="navigateToMediaGallery"/> + <actionGroup ref="NavigateToMediaGalleryActionGroup" stepKey="navigateToMediaGallery"/> <actionGroup ref="NavigateToMediaFolderActionGroup" stepKey="navigateToFolder2"> <argument name="FolderName" value="Storage Root"/> </actionGroup> diff --git a/app/code/Magento/Translation/Test/Mftf/Test/AdminInlineTranslationOnCheckoutTest.xml b/app/code/Magento/Translation/Test/Mftf/Test/AdminInlineTranslationOnCheckoutTest.xml index 2b86a8ac07e77..08448f7735f7c 100644 --- a/app/code/Magento/Translation/Test/Mftf/Test/AdminInlineTranslationOnCheckoutTest.xml +++ b/app/code/Magento/Translation/Test/Mftf/Test/AdminInlineTranslationOnCheckoutTest.xml @@ -56,7 +56,7 @@ <argument name="Customer" value="$$createCustomer$$"/> </actionGroup> - <actionGroup ref="AddSimpleProductToCart" stepKey="addProduct"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProduct"> <argument name="product" value="$$createProduct$$"/> </actionGroup> @@ -333,7 +333,7 @@ <argument name="Customer" value="$$createCustomer2$$"/> </actionGroup> - <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> <argument name="product" value="$$createProduct$$"/> </actionGroup> <click selector="{{StorefrontMiniCartSection.show}}" stepKey="showCart"/> @@ -427,7 +427,7 @@ <argument name="Customer" value="$$createCustomer3$$"/> </actionGroup> - <actionGroup ref="AddSimpleProductToCart" stepKey="addOneProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addOneProductToCart"> <argument name="product" value="$$createProduct$$"/> </actionGroup> diff --git a/app/code/Magento/Translation/Test/Mftf/Test/StorefrontButtonsInlineTranslationTest.xml b/app/code/Magento/Translation/Test/Mftf/Test/StorefrontButtonsInlineTranslationTest.xml index 155e174310ea9..d87d3635fa07c 100644 --- a/app/code/Magento/Translation/Test/Mftf/Test/StorefrontButtonsInlineTranslationTest.xml +++ b/app/code/Magento/Translation/Test/Mftf/Test/StorefrontButtonsInlineTranslationTest.xml @@ -45,7 +45,7 @@ </after> <!-- Add product to cart on storefront --> - <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> <argument name="product" value="$$createProduct$$"/> </actionGroup> diff --git a/app/code/Magento/Ui/Test/Mftf/Test/AdminGridFilterDeleteAndVerifyErrorMessageTest.xml b/app/code/Magento/Ui/Test/Mftf/Test/AdminGridFilterDeleteAndVerifyErrorMessageTest.xml index e2c3b157c1059..1a4b3b76eebe8 100644 --- a/app/code/Magento/Ui/Test/Mftf/Test/AdminGridFilterDeleteAndVerifyErrorMessageTest.xml +++ b/app/code/Magento/Ui/Test/Mftf/Test/AdminGridFilterDeleteAndVerifyErrorMessageTest.xml @@ -53,7 +53,7 @@ <!--Filter created simple product in grid and add category and website created in create data--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="openProductCatalogPage"/> <waitForPageLoad stepKey="waitForProductCatalogPage"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProduct"> <argument name="product" value="$$createProduct$$"/> </actionGroup> <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowOfCreatedSimpleProduct"/> @@ -78,4 +78,4 @@ <argument name="errorMessage" value="Something went wrong with processing the default view and we have restored the filter to its original state."/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminAutoUpdateURLRewriteWhenCategoryIsDeletedTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminAutoUpdateURLRewriteWhenCategoryIsDeletedTest.xml index 52d313b21f3e1..5d2bc8a923237 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminAutoUpdateURLRewriteWhenCategoryIsDeletedTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminAutoUpdateURLRewriteWhenCategoryIsDeletedTest.xml @@ -46,7 +46,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!--Filter Product in product page and get the Product ID --> - <actionGroup ref="filterAndSelectProduct" stepKey="filterProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterProduct"> <argument name="productSku" value="$$createSimpleProduct.sku$$"/> </actionGroup> <grabFromCurrentUrl stepKey="productId" regex="#\/([0-9]*)?\/$#"/> @@ -70,4 +70,4 @@ <argument name="requestPath" value="$$createCategory.name$$.html"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTest.xml index 121fd7c736dcc..dc26b8c97c64e 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTest.xml @@ -46,31 +46,31 @@ <argument name="storeViewName" value="{{customStoreNLNotUnique.name}}"/> </actionGroup> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearStoreFilters"/> - <actionGroup ref="deleteProductByName" stepKey="deleteImportedProduct"> + <actionGroup ref="DeleteProductByNameActionGroup" stepKey="deleteImportedProduct"> <argument name="sku" value="productformagetwo68980"/> <argument name="name" value="productformagetwo68980"/> </actionGroup> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFiltersIfSet"/> <actionGroup ref="logout" stepKey="logout"/> </after> - <actionGroup ref="switchCategoryStoreView" stepKey="switchToStoreViewEn"> + <actionGroup ref="SwitchCategoryStoreViewActionGroup" stepKey="switchToStoreViewEn"> <argument name="Store" value="customStoreENNotUnique.name"/> <argument name="CatName" value="$$createCategory.name$$"/> </actionGroup> <uncheckOption selector="{{AdminCategoryBasicFieldSection.categoryNameUseDefault}}" stepKey="uncheckUseDefaultValueENStoreView"/> <fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="category-english" stepKey="changeNameField"/> <click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="clickOnSectionHeader"/> - <actionGroup ref="ChangeSeoUrlKeyForSubCategory" stepKey="changeSeoUrlKeyENStoreView"> + <actionGroup ref="ChangeSeoUrlKeyForSubCategoryActionGroup" stepKey="changeSeoUrlKeyENStoreView"> <argument name="value" value="category-english"/> </actionGroup> - <actionGroup ref="switchCategoryStoreView" stepKey="switchToStoreViewNl"> + <actionGroup ref="SwitchCategoryStoreViewActionGroup" stepKey="switchToStoreViewNl"> <argument name="Store" value="customStoreNLNotUnique.name"/> <argument name="CatName" value="$$createCategory.name$$"/> </actionGroup> <uncheckOption selector="{{AdminCategoryBasicFieldSection.categoryNameUseDefault}}" stepKey="uncheckUseDefaultValue1"/> <fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="category-dutch" stepKey="changeNameFieldNLStoreView"/> <click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="clickOnSectionHeader2"/> - <actionGroup ref="ChangeSeoUrlKeyForSubCategory" stepKey="changeSeoUrlKeyNLStoreView"> + <actionGroup ref="ChangeSeoUrlKeyForSubCategoryActionGroup" stepKey="changeSeoUrlKeyNLStoreView"> <argument name="value" value="category-dutch"/> </actionGroup> <amOnPage url="{{AdminImportIndexPage.url}}" stepKey="navigateToSystemImport"/> @@ -170,7 +170,7 @@ <argument name="storeViewName" value="{{customStoreNLNotUnique.name}}"/> </actionGroup> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearStoreGridFilters"/> - <actionGroup ref="deleteProductByName" stepKey="deleteImportedProduct"> + <actionGroup ref="DeleteProductByNameActionGroup" stepKey="deleteImportedProduct"> <argument name="sku" value="productformagetwo68980"/> <argument name="name" value="productformagetwo68980"/> </actionGroup> @@ -180,24 +180,24 @@ <!--Flush cache--> <magentoCLI command="cache:flush" stepKey="cleanCache2"/> </after> - <actionGroup ref="switchCategoryStoreView" stepKey="switchToStoreViewEn"> + <actionGroup ref="SwitchCategoryStoreViewActionGroup" stepKey="switchToStoreViewEn"> <argument name="Store" value="customStoreENNotUnique.name"/> <argument name="CatName" value="$$createCategory.name$$"/> </actionGroup> <uncheckOption selector="{{AdminCategoryBasicFieldSection.categoryNameUseDefault}}" stepKey="uncheckUseDefaultValueENStoreView"/> <fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="category-english" stepKey="changeNameField"/> <click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="clickOnSectionHeader"/> - <actionGroup ref="ChangeSeoUrlKeyForSubCategory" stepKey="changeSeoUrlKeyENStoreView"> + <actionGroup ref="ChangeSeoUrlKeyForSubCategoryActionGroup" stepKey="changeSeoUrlKeyENStoreView"> <argument name="value" value="category-english"/> </actionGroup> - <actionGroup ref="switchCategoryStoreView" stepKey="switchToStoreViewNl"> + <actionGroup ref="SwitchCategoryStoreViewActionGroup" stepKey="switchToStoreViewNl"> <argument name="Store" value="customStoreNLNotUnique.name"/> <argument name="CatName" value="$$createCategory.name$$"/> </actionGroup> <uncheckOption selector="{{AdminCategoryBasicFieldSection.categoryNameUseDefault}}" stepKey="uncheckUseDefaultValue1"/> <fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="category-dutch" stepKey="changeNameFieldNLStoreView"/> <click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="clickOnSectionHeader2"/> - <actionGroup ref="ChangeSeoUrlKeyForSubCategory" stepKey="changeSeoUrlKeyNLStoreView"> + <actionGroup ref="ChangeSeoUrlKeyForSubCategoryActionGroup" stepKey="changeSeoUrlKeyNLStoreView"> <argument name="value" value="category-dutch"/> </actionGroup> <amOnPage url="{{AdminImportIndexPage.url}}" stepKey="navigateToSystemImport"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml index 52dce4d67f698..828a661e385c9 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml @@ -45,18 +45,18 @@ </after> <!-- On the categories editing page change store view to created additional view --> - <actionGroup ref="switchCategoryStoreView" stepKey="switchStoreView"> + <actionGroup ref="SwitchCategoryStoreViewActionGroup" stepKey="switchStoreView"> <argument name="Store" value="customStore.name"/> <argument name="CatName" value="$$createFirstCategory.name$$"/> </actionGroup> <!-- Change url key for category for first category; save --> - <actionGroup ref="ChangeSeoUrlKeyForSubCategory" stepKey="changeUrlKey"> + <actionGroup ref="ChangeSeoUrlKeyForSubCategoryActionGroup" stepKey="changeUrlKey"> <argument name="value" value="{{SimpleRootSubCategory.url_key}}"/> </actionGroup> <!-- Change store view to "All store views" for first category --> - <actionGroup ref="switchCategoryToAllStoreView" stepKey="switchToAllStoreViewProduct"> + <actionGroup ref="SwitchCategoryToAllStoreViewActionGroup" stepKey="switchToAllStoreViewProduct"> <argument name="CatName" value="$$createFirstCategory.name$$"/> </actionGroup> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddNoRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddNoRedirectTest.xml index 85e9d7847d5ea..e4047ca625618 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddNoRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddNoRedirectTest.xml @@ -37,7 +37,7 @@ </actionGroup> <!-- Get Category ID --> - <actionGroup ref="OpenCategoryFromCategoryTree" stepKey="getCategoryId"> + <actionGroup ref="OpenCategoryFromCategoryTreeActionGroup" stepKey="getCategoryId"> <argument name="category" value="$$category.name$$"/> </actionGroup> <grabFromCurrentUrl stepKey="categoryId" regex="#\/([0-9]*)?\/$#"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCategoryUrlRewriteAndAddPermanentRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCategoryUrlRewriteAndAddPermanentRedirectTest.xml index b123bc14cb1ed..552853943db25 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCategoryUrlRewriteAndAddPermanentRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCategoryUrlRewriteAndAddPermanentRedirectTest.xml @@ -30,7 +30,7 @@ </after> <!-- Open Category Page and Get Category ID --> - <actionGroup ref="OpenCategoryFromCategoryTree" stepKey="getCategoryId"> + <actionGroup ref="OpenCategoryFromCategoryTreeActionGroup" stepKey="getCategoryId"> <argument name="category" value="$$category.name$$"/> </actionGroup> <grabFromCurrentUrl stepKey="categoryId" regex="#\/([0-9]*)?\/$#"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomProductUrlRewriteAndAddTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomProductUrlRewriteAndAddTemporaryRedirectTest.xml index 711d5389b013b..2a225123a3409 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomProductUrlRewriteAndAddTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomProductUrlRewriteAndAddTemporaryRedirectTest.xml @@ -30,7 +30,7 @@ </after> <!--Filter Product in product page and get the Product ID --> - <actionGroup ref="filterAndSelectProduct" stepKey="filterProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterProduct"> <argument name="productSku" value="$$createProduct.sku$$"/> </actionGroup> <grabFromCurrentUrl stepKey="productId" regex="#\/([0-9]*)?\/$#"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteAndAddNoRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteAndAddNoRedirectTest.xml index f8d297c92a176..4aef4aec3deed 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteAndAddNoRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteAndAddNoRedirectTest.xml @@ -40,7 +40,7 @@ </actionGroup> <!--Filter Product in product page and get the Product ID --> - <actionGroup ref="filterAndSelectProduct" stepKey="filterProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterProduct"> <argument name="productSku" value="$$createSimpleProduct.sku$$"/> </actionGroup> <grabFromCurrentUrl stepKey="productId" regex="#\/([0-9]*)?\/$#"/> @@ -59,4 +59,4 @@ <argument name="targetPath" value="catalog/product/view/id/{$productId}"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteWithCategoryAndAddTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteWithCategoryAndAddTemporaryRedirectTest.xml index ae18ab33ba6ce..e91446f43fec0 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteWithCategoryAndAddTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteWithCategoryAndAddTemporaryRedirectTest.xml @@ -51,7 +51,7 @@ </actionGroup> <!--Filter Product in product page and get the Product ID --> - <actionGroup ref="filterAndSelectProduct" stepKey="filterProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterProduct"> <argument name="productSku" value="$$createSimpleProduct.sku$$"/> </actionGroup> <grabFromCurrentUrl stepKey="productId" regex="#\/([0-9]*)?\/$#"/> @@ -64,7 +64,7 @@ </actionGroup> <!-- Open Category Page and Get Category ID --> - <actionGroup ref="OpenCategoryFromCategoryTree" stepKey="getCategoryId"> + <actionGroup ref="OpenCategoryFromCategoryTreeActionGroup" stepKey="getCategoryId"> <argument name="category" value="$$createCategory.name$$"/> </actionGroup> <grabFromCurrentUrl stepKey="categoryId" regex="#\/([0-9]*)?\/$#"/> @@ -76,4 +76,4 @@ <argument name="targetPath" value="catalog/category/view/id/{$categoryId}"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddPermanentRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddPermanentRedirectTest.xml index 66c586d4fe891..82e6b269c7b30 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddPermanentRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddPermanentRedirectTest.xml @@ -39,7 +39,7 @@ </actionGroup> <!--Filter Product in product page and get the Product ID --> - <actionGroup ref="filterAndSelectProduct" stepKey="filterProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterProduct"> <argument name="productSku" value="$$createSimpleProduct.sku$$"/> </actionGroup> <grabFromCurrentUrl stepKey="productId" regex="#\/([0-9]*)?\/$#"/> @@ -59,4 +59,4 @@ <argument name="targetPath" value="catalog/product/view/id/{$productId}"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddTemporaryRedirectTest.xml index 2d797a12bedf5..1133119202226 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddTemporaryRedirectTest.xml @@ -40,7 +40,7 @@ </actionGroup> <!--Filter Product in product page and get the Product ID --> - <actionGroup ref="filterAndSelectProduct" stepKey="filterProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterProduct"> <argument name="productSku" value="$$createSimpleProduct.sku$$"/> </actionGroup> <grabFromCurrentUrl stepKey="productId" regex="#\/([0-9]*)?\/$#"/> @@ -59,4 +59,4 @@ <argument name="targetPath" value="catalog/product/view/id/{$productId}"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductWithSeveralWebsitesAndCheckURLRewritesTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductWithSeveralWebsitesAndCheckURLRewritesTest.xml index 4dc5c85830076..1dafe371f0d2a 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductWithSeveralWebsitesAndCheckURLRewritesTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductWithSeveralWebsitesAndCheckURLRewritesTest.xml @@ -65,7 +65,7 @@ <!-- Create simple product with categories created in create data --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="openProductCatalogPage"/> <waitForPageLoad stepKey="waitForProductCatalogPage"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProduct"> <argument name="product" value="$$createProduct$$"/> </actionGroup> <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowOfCreatedSimpleProduct"/> @@ -85,7 +85,7 @@ <see selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeAssertSimpleProductSaveSuccessMessage"/> <!-- Grab category Id --> - <actionGroup ref="OpenCategoryFromCategoryTree" stepKey="grabCategoryId"> + <actionGroup ref="OpenCategoryFromCategoryTreeActionGroup" stepKey="grabCategoryId"> <argument name="category" value="$$category.name$$"/> </actionGroup> <grabFromCurrentUrl stepKey="categoryId" regex="#\/([0-9]*)?\/$#"/> @@ -99,7 +99,7 @@ <see selector="{{AdminUrlRewriteIndexSection.storeView('1')}}" userInput="{{customStoreEN.name}}" stepKey="seeStoreViewValueForCategoryId"/> <!-- Grab product Id --> - <actionGroup ref="filterAndSelectProduct" stepKey="grabProductId"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="grabProductId"> <argument name="productSku" value="$$createProduct.sku$$"/> </actionGroup> <grabFromCurrentUrl stepKey="productId" regex="#\/([0-9]*)?\/$#"/> @@ -112,4 +112,4 @@ <see selector="{{AdminUrlRewriteIndexSection.storeView('1')}}" userInput="{{customStore.name}}" stepKey="seeStoreValueForProductId"/> <see selector="{{AdminUrlRewriteIndexSection.storeView('1')}}" userInput="{{storeViewData.name}}" stepKey="seeStoreViewValueForProductId"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminProductCreateUrlRewriteForCustomStoreViewTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminProductCreateUrlRewriteForCustomStoreViewTest.xml index c6ee1a7da9602..151211bac67e0 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminProductCreateUrlRewriteForCustomStoreViewTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminProductCreateUrlRewriteForCustomStoreViewTest.xml @@ -44,7 +44,7 @@ <actionGroup ref="logout" stepKey="logoutFromAdmin"/> </after> <!--Step 1. Navigate as Admin on Product Page for edit product`s Url Key--> - <actionGroup ref="navigateToCreatedProductEditPage" stepKey="goToProductForUrlRewrite"> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToProductForUrlRewrite"> <argument name="product" value="$$createProductForUrlRewrite$$"/> </actionGroup> <!--Step 2. As Admin switch on Custom Store View from Precondition --> @@ -55,12 +55,12 @@ <actionGroup ref="AdminProductFormUpdateUrlKeyActionGroup" stepKey="updateUrlKeyForProduct"> <argument name="newUrlKey" value="U2"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProductWithNewUrl"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductWithNewUrl"/> <!--Step 4. Set URL Key for created category --> - <actionGroup ref="navigateToCreatedCategory" stepKey="navigateToCreatedSubCategory"> + <actionGroup ref="NavigateToCreatedCategoryActionGroup" stepKey="navigateToCreatedSubCategory"> <argument name="Category" value="$$createCategory$$"/> </actionGroup> - <actionGroup ref="ChangeSeoUrlKey" stepKey="updateUrlKeyForCategory"> + <actionGroup ref="ChangeSeoUrlKeyActionGroup" stepKey="updateUrlKeyForCategory"> <argument name="value" value="U1"/> </actionGroup> <!--Step 5. On Storefront Assert what URL Key for Category is changed and is correct as for Default Store View --> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddAspxRequestPathTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddAspxRequestPathTest.xml index 072753505223d..33f8ab5d8a98d 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddAspxRequestPathTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddAspxRequestPathTest.xml @@ -40,7 +40,7 @@ </actionGroup> <!-- Open Category Page and Get Category ID --> - <actionGroup ref="OpenCategoryFromCategoryTree" stepKey="getCategoryId"> + <actionGroup ref="OpenCategoryFromCategoryTreeActionGroup" stepKey="getCategoryId"> <argument name="category" value="$$category.name$$"/> </actionGroup> <grabFromCurrentUrl stepKey="categoryId" regex="#\/([0-9]*)?\/$#"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddNoRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddNoRedirectTest.xml index 80b9dbe41bf59..9859d1a792679 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddNoRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddNoRedirectTest.xml @@ -40,7 +40,7 @@ </actionGroup> <!-- Open Category Page and Get Category ID --> - <actionGroup ref="OpenCategoryFromCategoryTree" stepKey="getCategoryId"> + <actionGroup ref="OpenCategoryFromCategoryTreeActionGroup" stepKey="getCategoryId"> <argument name="category" value="$$category.name$$"/> </actionGroup> <grabFromCurrentUrl stepKey="categoryId" regex="#\/([0-9]*)?\/$#"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddPermanentRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddPermanentRedirectTest.xml index be9fd1d83c8f1..65fd4f2df25bd 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddPermanentRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddPermanentRedirectTest.xml @@ -40,7 +40,7 @@ </actionGroup> <!-- Open Category Page and Get Category ID --> - <actionGroup ref="OpenCategoryFromCategoryTree" stepKey="getCategoryId"> + <actionGroup ref="OpenCategoryFromCategoryTreeActionGroup" stepKey="getCategoryId"> <argument name="category" value="$$category.name$$"/> </actionGroup> <grabFromCurrentUrl stepKey="categoryId" regex="#\/([0-9]*)?\/$#"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddTemporaryRedirectTest.xml index 7e1b9acbc47ab..42b3032592897 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddTemporaryRedirectTest.xml @@ -40,7 +40,7 @@ </actionGroup> <!-- Open Category Page and Get Category ID --> - <actionGroup ref="OpenCategoryFromCategoryTree" stepKey="getCategoryId"> + <actionGroup ref="OpenCategoryFromCategoryTreeActionGroup" stepKey="getCategoryId"> <argument name="category" value="$$category.name$$"/> </actionGroup> <grabFromCurrentUrl stepKey="categoryId" regex="#\/([0-9]*)?\/$#"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCustomURLRewritesTemporaryTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCustomURLRewritesTemporaryTest.xml index 07d578cbbeca4..059f6bdce71f2 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCustomURLRewritesTemporaryTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCustomURLRewritesTemporaryTest.xml @@ -32,7 +32,7 @@ </after> <!--Filter Product in product page and get the Product ID --> - <actionGroup ref="filterAndSelectProduct" stepKey="filterProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterProduct"> <argument name="productSku" value="$$createProduct.sku$$"/> </actionGroup> <grabFromCurrentUrl stepKey="productId" regex="#\/([0-9]*)?\/$#"/> @@ -65,4 +65,4 @@ <argument name="productRequestPath" value="$$createProduct.name$$.html"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductInAnchorCategoriesTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductInAnchorCategoriesTest.xml index b708b63599173..dc82a3e4ab24f 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductInAnchorCategoriesTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductInAnchorCategoriesTest.xml @@ -54,7 +54,7 @@ <seeElement selector="{{AdminUrlRewriteIndexSection.requestPathColumnValue($simpleSubCategory1.custom_attributes[url_key]$/$simpleSubCategory2.custom_attributes[url_key]$/$simpleSubCategory3.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html)}}" stepKey="seeValue4"/> <!-- 3. Edit Category 1 for DEFAULT Store View: --> - <actionGroup ref="switchCategoryStoreView" stepKey="switchStoreView"> + <actionGroup ref="SwitchCategoryStoreViewActionGroup" stepKey="switchStoreView"> <argument name="Store" value="_defaultStore.name"/> <argument name="CatName" value="$$simpleSubCategory1.name$$"/> </actionGroup> @@ -137,7 +137,7 @@ <dontSeeElement selector="{{AdminUrlRewriteIndexSection.requestPathColumnValue($simpleSubCategory1.custom_attributes[url_key]$/$simpleSubCategory2.custom_attributes[url_key]$/$simpleSubCategory3.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html)}}" stepKey="seeValue4"/> <!-- 3. Edit Category 1 for DEFAULT Store View: --> - <actionGroup ref="switchCategoryStoreView" stepKey="switchStoreView"> + <actionGroup ref="SwitchCategoryStoreViewActionGroup" stepKey="switchStoreView"> <argument name="Store" value="_defaultStore.name"/> <argument name="CatName" value="$$simpleSubCategory1.name$$"/> </actionGroup> @@ -200,7 +200,7 @@ </before> <remove keyForRemoval="switchStoreView"/> <!-- 3. Edit Category 1 for All store view: --> - <actionGroup ref="navigateToCreatedCategory" stepKey="goToCategoryPage" after="seeValue4"> + <actionGroup ref="NavigateToCreatedCategoryActionGroup" stepKey="goToCategoryPage" after="seeValue4"> <argument name="Category" value="$$simpleSubCategory1$$"/> </actionGroup> <remove keyForRemoval="uncheckRedirect2"/> @@ -227,7 +227,7 @@ </before> <remove keyForRemoval="switchStoreView"/> <!-- 3. Edit Category 1 for All store view: --> - <actionGroup ref="navigateToCreatedCategory" stepKey="goToCategoryPage" after="seeValue4"> + <actionGroup ref="NavigateToCreatedCategoryActionGroup" stepKey="goToCategoryPage" after="seeValue4"> <argument name="Category" value="$$simpleSubCategory1$$"/> </actionGroup> <remove keyForRemoval="uncheckRedirect2"/> diff --git a/app/code/Magento/Weee/Test/Mftf/Test/AdminFixedTaxValSavedForSpecificWebsiteTest.xml b/app/code/Magento/Weee/Test/Mftf/Test/AdminFixedTaxValSavedForSpecificWebsiteTest.xml index aeb8537313fae..6cbdbe0db267d 100644 --- a/app/code/Magento/Weee/Test/Mftf/Test/AdminFixedTaxValSavedForSpecificWebsiteTest.xml +++ b/app/code/Magento/Weee/Test/Mftf/Test/AdminFixedTaxValSavedForSpecificWebsiteTest.xml @@ -75,7 +75,7 @@ <actionGroup ref="SelectProductInWebsitesActionGroup" stepKey="selectWebsiteInProduct"> <argument name="website" value="{{NewWebSiteData.name}}"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProductFirstTime"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductFirstTime"/> <!-- Add Fixed Product Tax attribute --> <comment userInput="Add Fixed Product Tax attribute" stepKey="addFixedProdTaxAttr"/> <actionGroup ref="AdminProductAddFPTValueActionGroup" stepKey="addFixedProductTaxAttr"> @@ -83,7 +83,7 @@ <argument name="stateForFPT" value="California"/> <argument name="valueForFPT" value="10"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProductSecondTime"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductSecondTime"/> <!-- Check if created tax attribute is saved --> <comment userInput="Check if created tax attribute is saved" stepKey="checkThatTaxAttributeIsSaved"/> <seeElement selector="{{AdminProductAddFPTValueSection.setTaxValueForFPT($$createProductFPTAttribute.attribute_code$$)}}" stepKey="checkIfTaxAttributeSaved"/> @@ -104,10 +104,10 @@ <seeElement selector="{{AdminProductAddFPTValueSection.setWebSiteForFPTOption($$createProductFPTAttribute.attribute_code$$, 'All Websites')}}" stepKey="checkAllWebsitesInDropDown"/> <seeElement selector="{{AdminProductAddFPTValueSection.setWebSiteForFPTOption($$createProductFPTAttribute.attribute_code$$, 'Main Website')}}" stepKey="checkMainWebsiteInDropDown"/> <seeElement selector="{{AdminProductAddFPTValueSection.setWebSiteForFPTOption($$createProductFPTAttribute.attribute_code$$, NewWebSiteData.name)}}" stepKey="checkSecondWebsitesInDropDown"/> - <actionGroup ref="unassignWebsiteFromProductActionGroup" stepKey="unassignWebsiteInProduct"> + <actionGroup ref="UnassignWebsiteFromProductActionGroup" stepKey="unassignWebsiteInProduct"> <argument name="website" value="{{_defaultWebsite.name}}"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProductThirdTime"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductThirdTime"/> <waitForPageLoad stepKey="waitForSavedProductLoad"/> <seeElement selector="{{AdminProductAddFPTValueSection.setWebSiteForFPTOption($$createProductFPTAttribute.attribute_code$$, 'All Websites')}}" stepKey="checkAllWebsitesInDropDownSecondTime"/> <dontSeeElement selector="{{AdminProductAddFPTValueSection.setWebSiteForFPTOption($$createProductFPTAttribute.attribute_code$$, 'Main Website')}}" stepKey="checkNoMainWebsiteInDropDown"/> diff --git a/app/code/Magento/Weee/Test/Mftf/Test/AdminRemoveProductWeeeAttributeOptionTest.xml b/app/code/Magento/Weee/Test/Mftf/Test/AdminRemoveProductWeeeAttributeOptionTest.xml index 3aeed3095dc45..6164f037048ba 100644 --- a/app/code/Magento/Weee/Test/Mftf/Test/AdminRemoveProductWeeeAttributeOptionTest.xml +++ b/app/code/Magento/Weee/Test/Mftf/Test/AdminRemoveProductWeeeAttributeOptionTest.xml @@ -35,12 +35,12 @@ <argument name="stateForFPT" value="California"/> <argument name="valueForFPT" value="10"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProductInitial"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductInitial"/> </before> <after> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductListing"/> <waitForPageLoad stepKey="waitForProductListingPageLoad"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetGridToDefaultKeywordSearch"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetGridToDefaultKeywordSearch"/> <actionGroup ref="logout" stepKey="logout"/> <deleteData createDataKey="createProductFPTAttribute" stepKey="deleteProductFPTAttribute"/> <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> @@ -56,7 +56,7 @@ </actionGroup> <!-- Step 2: Remove weee attribute options --> <click selector="{{AdminProductAddFPTValueSection.removeRowByIndex('$$createProductFPTAttribute.attribute_code$$','1')}}" stepKey="removeAttributeOption"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Assert weee attribute options are empty --> <dontSeeElement selector="{{AdminProductAddFPTValueSection.removeRowByIndex('$$createProductFPTAttribute.attribute_code$$','1')}}" stepKey="dontSeeOptions"/> </test> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/ConfProdAddToCartWishListWithUnselectedAttrTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/ConfProdAddToCartWishListWithUnselectedAttrTest.xml index 4e6a062c7993d..75f5a0e192080 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/ConfProdAddToCartWishListWithUnselectedAttrTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/ConfProdAddToCartWishListWithUnselectedAttrTest.xml @@ -33,7 +33,7 @@ <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete the first simple product --> - <actionGroup stepKey="deleteProduct1" ref="deleteProductBySku"> + <actionGroup stepKey="deleteProduct1" ref="DeleteProductBySkuActionGroup"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/ConfigurableProductChildImageShouldBeShownOnWishListTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/ConfigurableProductChildImageShouldBeShownOnWishListTest.xml index 0489ec750b7e0..3d2d229c6077a 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/ConfigurableProductChildImageShouldBeShownOnWishListTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/ConfigurableProductChildImageShouldBeShownOnWishListTest.xml @@ -36,24 +36,24 @@ </after> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPageLoad"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetFiltersIfPresent"/> - <actionGroup ref="searchProductGridByKeyword" stepKey="searchProductGrid"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetFiltersIfPresent"/> + <actionGroup ref="SearchProductGridByKeywordActionGroup" stepKey="searchProductGrid"> <argument name="keyword" value="_defaultProduct.name"/> </actionGroup> <click selector="{{AdminProductGridSection.selectRowBasedOnName(_defaultProduct.name)}}" stepKey="selectProductToAddImage"/> <waitForPageLoad stepKey="waitForProductEditPageLoad"/> - <actionGroup ref="addProductImage" stepKey="addImageForParentProduct"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageForParentProduct"> <argument name="image" value="MagentoLogo"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex1"/> <waitForPageLoad stepKey="waitForProductIndexPageLoad1"/> <click selector="{{AdminProductGridSection.selectRowBasedOnName(colorProductAttribute1.name)}}" stepKey="selectProductToAddImage1"/> <waitForPageLoad stepKey="waitForProductEditPageLoad1"/> - <actionGroup ref="addProductImage" stepKey="addImageForChildProduct"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageForChildProduct"> <argument name="image" value="TestImageNew"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveSimpleProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSimpleProduct"/> <!--Sign in as customer --> <amOnPage url="{{StorefrontCustomerSignInPage.url}}" stepKey="amOnSignInPage"/> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddProductsToCartFromWishlistUsingSidebarTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddProductsToCartFromWishlistUsingSidebarTest.xml index 82c53bc343e51..432ab2b41cdf6 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddProductsToCartFromWishlistUsingSidebarTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddProductsToCartFromWishlistUsingSidebarTest.xml @@ -44,7 +44,7 @@ </actionGroup> <!-- Add product from first category to the wishlist --> <amOnPage url="{{StorefrontCategoryPage.url($$categoryFirst.name$$)}}" stepKey="navigateToCategoryFirstPage"/> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="browseAssertCategoryProduct1"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="browseAssertCategoryProduct1"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <actionGroup ref="StorefrontCustomerAddCategoryProductToWishlistActionGroup" stepKey="addSimpleProduct1ToWishlist"> @@ -52,7 +52,7 @@ </actionGroup> <!--Add product to the cart from the Wishlist using the sidebar from the second category page--> <amOnPage url="{{StorefrontCategoryPage.url($$categorySecond.name$$)}}" stepKey="navigateToCategorySecondPage"/> - <actionGroup ref="StorefrontSwitchCategoryViewToListMode" stepKey="switchCategoryViewToListMode"/> + <actionGroup ref="StorefrontSwitchCategoryViewToListModeActionGroup" stepKey="switchCategoryViewToListMode"/> <actionGroup ref="StorefrontCustomerCheckProductInWishlistSidebar" stepKey="checkSimpleProduct1InWishlistSidebar"> <argument name="productVar" value="$$simpleProduct1$$"/> </actionGroup> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteBundleDynamicProductFromWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteBundleDynamicProductFromWishlistTest.xml index ae65a4171d883..c2a0f2b20a028 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteBundleDynamicProductFromWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteBundleDynamicProductFromWishlistTest.xml @@ -48,12 +48,12 @@ </createData> <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> - <actionGroup ref="goToProductPageViaID" stepKey="goToProduct"> + <actionGroup ref="GoToProductPageViaIDActionGroup" stepKey="goToProduct"> <argument name="productId" value="$$createBundleProduct.id$$"/> </actionGroup> <scrollTo selector="{{AdminProductFormBundleSection.contentDropDown}}" stepKey="scrollToBundleSection"/> <selectOption userInput="Separately" selector="{{AdminProductFormBundleSection.shipmentType}}" stepKey="selectSeparately"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> </before> <after> <!-- Delete data --> @@ -74,7 +74,7 @@ <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openProductFromCategory"> <argument name="productUrlKey" value="$$createBundleProduct.custom_attributes[url_key]$$"/> </actionGroup> - + <!-- Add created product to Wishlist according to dataset and assert add product to wishlist success message --> <actionGroup ref="StorefrontCustomerAddProductToWishlistActionGroup" stepKey="addProductToWishlist"> <argument name="productVar" value="$$createBundleProduct$$"/> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontRemoveProductsFromWishlistUsingSidebarTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontRemoveProductsFromWishlistUsingSidebarTest.xml index 6c73cb6708ae4..37adb23f513ab 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontRemoveProductsFromWishlistUsingSidebarTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontRemoveProductsFromWishlistUsingSidebarTest.xml @@ -45,7 +45,7 @@ </actionGroup> <!-- Add product from first category to the wishlist --> <amOnPage url="{{StorefrontCategoryPage.url($$categoryFirst.name$$)}}" stepKey="navigateToCategoryFirstPage"/> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="browseAssertCategoryProduct1"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="browseAssertCategoryProduct1"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <actionGroup ref="StorefrontCustomerAddCategoryProductToWishlistActionGroup" stepKey="addSimpleProduct1ToWishlist"> @@ -53,7 +53,7 @@ </actionGroup> <!--Remove product from the Wishlist using the sidebar from the second category page--> <amOnPage url="{{StorefrontCategoryPage.url($$categorySecond.name$$)}}" stepKey="navigateToCategorySecondPage"/> - <actionGroup ref="StorefrontSwitchCategoryViewToListMode" stepKey="switchCategoryViewToListMode"/> + <actionGroup ref="StorefrontSwitchCategoryViewToListModeActionGroup" stepKey="switchCategoryViewToListMode"/> <actionGroup ref="StorefrontCustomerCheckProductInWishlistSidebar" stepKey="checkSimpleProduct1InWishlistSidebar"> <argument name="productVar" value="$$simpleProduct1$$"/> </actionGroup> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/WishListWithDisabledProductTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/WishListWithDisabledProductTest.xml index af216c139e7fe..488490c2b612e 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/WishListWithDisabledProductTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/WishListWithDisabledProductTest.xml @@ -41,8 +41,8 @@ <openNewTab stepKey="openNewTab"/> <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminArea"/> <amOnPage url="{{AdminProductEditPage.url($$createProduct.id$$)}}" stepKey="goToProductEditPage"/> - <actionGroup ref="AdminSetProductDisabled" stepKey="disableProduct"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="AdminSetProductDisabledActionGroup" stepKey="disableProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <closeTab stepKey="closeSecondTab"/> <reloadPage stepKey="refreshPage"/> <actionGroup ref="StorefrontAssertCustomerWishlistIsEmpty" stepKey="checkProductIsAbsentInWishlistIsEmpty"/> From bb860cce82ba7b720832d386047c687d6ddbc33b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Fri, 29 Nov 2019 21:19:30 +0100 Subject: [PATCH 148/586] FIX: Extract Assertion to separate file, append existing tests with assertion --- ...ductAttributeRemovedSuccessfullyActionGroup.xml | 14 ++++++++++++++ ...eProductAttributeByAttributeCodeActionGroup.xml | 1 - ...ropdownProductAttributeFromAttributeSetTest.xml | 1 + .../Mftf/Test/AdminDeleteProductAttributeTest.xml | 1 + ...xtFieldProductAttributeFromAttributeSetTest.xml | 1 + ...AdminCheckResultsOfColorAndOtherFiltersTest.xml | 1 + ...refrontElasticsearch6SearchInvalidValueTest.xml | 1 + ...eProductWithAttributesImagesAndSwatchesTest.xml | 1 + 8 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductAttributeRemovedSuccessfullyActionGroup.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductAttributeRemovedSuccessfullyActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductAttributeRemovedSuccessfullyActionGroup.xml new file mode 100644 index 0000000000000..60f1e59f9871a --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductAttributeRemovedSuccessfullyActionGroup.xml @@ -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="AssertProductAttributeRemovedSuccessfullyActionGroup"> + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByAttributeCodeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByAttributeCodeActionGroup.xml index 7fbf6a9b2a178..c40a0f6d31dc0 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByAttributeCodeActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByAttributeCodeActionGroup.xml @@ -25,6 +25,5 @@ <click selector="{{AttributePropertiesSection.DeleteAttribute}}" stepKey="deleteAttribute"/> <click selector="{{ModalConfirmationSection.OkButton}}" stepKey="ClickOnDeleteButton"/> <waitForPageLoad stepKey="waitForPageLoad"/> - <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteDropdownProductAttributeFromAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteDropdownProductAttributeFromAttributeSetTest.xml index 84a116fb4bcd6..bded224a86563 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteDropdownProductAttributeFromAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteDropdownProductAttributeFromAttributeSetTest.xml @@ -52,6 +52,7 @@ <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttribute"> <argument name="ProductAttributeCode" value="$$attribute.attribute_code$$"/> </actionGroup> + <actionGroup ref="AssertProductAttributeRemovedSuccessfullyActionGroup" stepKey="deleteProductAttributeSuccess"/> <!--Confirm Attribute is not present in Product Attribute Grid --> <actionGroup ref="FilterProductAttributeByAttributeCodeActionGroup" stepKey="filterAttribute"> <argument name="ProductAttributeCode" value="$$attribute.attribute_code$$"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductAttributeTest.xml index cc3242310ca11..f81b05c61a669 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductAttributeTest.xml @@ -27,6 +27,7 @@ <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttribute"> <argument name="ProductAttributeCode" value="$$createProductAttribute.attribute_code$$"/> </actionGroup> + <actionGroup ref="AssertProductAttributeRemovedSuccessfullyActionGroup" stepKey="deleteProductAttributeSuccess"/> <!-- Assert the product attribute is not in the grid by Attribute code --> <actionGroup ref="FilterProductAttributeByAttributeCodeActionGroup" stepKey="filterByAttributeCode"> <argument name="ProductAttributeCode" value="$$createProductAttribute.attribute_code$$"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteTextFieldProductAttributeFromAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteTextFieldProductAttributeFromAttributeSetTest.xml index 4b97fb38e994f..f5fc104fa2b8d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteTextFieldProductAttributeFromAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteTextFieldProductAttributeFromAttributeSetTest.xml @@ -58,6 +58,7 @@ <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttribute"> <argument name="ProductAttributeCode" value="$$attribute.attribute_code$$"/> </actionGroup> + <actionGroup ref="AssertProductAttributeRemovedSuccessfullyActionGroup" stepKey="deleteProductAttributeSuccess"/> <!-- Confirm attribute is not present in product attribute grid --> <actionGroup ref="FilterProductAttributeByAttributeCodeActionGroup" stepKey="filterAttribute"> <argument name="ProductAttributeCode" value="$$attribute.attribute_code$$"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml index 84fbab5fb4f02..7324008879eda 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml @@ -104,6 +104,7 @@ <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteSecondProductAttributeByAttributeCode"> <argument name="ProductAttributeCode" value="$$createConfigProductAttribute2.attribute_code$$"/> </actionGroup> + <actionGroup ref="AssertProductAttributeRemovedSuccessfullyActionGroup" stepKey="deleteProductAttributeSuccess"/> <!-- Clear filters --> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductAttributesFilter"/> <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearProductsGridFilter"/> diff --git a/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearch6SearchInvalidValueTest.xml b/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearch6SearchInvalidValueTest.xml index 7c6ff7176ee8f..9da343b40a283 100644 --- a/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearch6SearchInvalidValueTest.xml +++ b/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearch6SearchInvalidValueTest.xml @@ -37,6 +37,7 @@ <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttribute"> <argument name="ProductAttributeCode" value="{{textProductAttribute.attribute_code}}"/> </actionGroup> + <actionGroup ref="AssertProductAttributeRemovedSuccessfullyActionGroup" stepKey="deleteProductAttributeSuccess"/> <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> <waitForPageLoad stepKey="waitForAttributePageLoad"/> <click selector="{{AdminProductAttributeGridSection.ResetFilter}}" stepKey="resetFiltersOnGrid"/> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml index 43205375a6330..e7fc490bbcb97 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml @@ -62,6 +62,7 @@ <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttribute"> <argument name="ProductAttributeCode" value="{{VisualSwatchProductAttribute.attribute_code}}"/> </actionGroup> + <actionGroup ref="AssertProductAttributeRemovedSuccessfullyActionGroup" stepKey="deleteProductAttributeSuccess"/> <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearAttributesGridFilter"/> <!--Clear products grid filter--> <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPage"/> From bd425997542a3a02888f243c040bd58abdbe5e0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Sat, 30 Nov 2019 11:09:44 +0100 Subject: [PATCH 149/586] Refactor: Remove redundant section to avoid confusion --- .../Test/Mftf/Section/StorefrontSwitchCurrencyRatesSection.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/Section/StorefrontSwitchCurrencyRatesSection.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/Section/StorefrontSwitchCurrencyRatesSection.xml index ff922421e5db7..43512796a134d 100644 --- a/app/code/Magento/CurrencySymbol/Test/Mftf/Section/StorefrontSwitchCurrencyRatesSection.xml +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/Section/StorefrontSwitchCurrencyRatesSection.xml @@ -10,7 +10,6 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="StorefrontSwitchCurrencyRatesSection"> <element name="currencyToggle" type="select" selector="#switcher-currency-trigger" timeout="30"/> - <element name="currencyTrigger" type="select" selector="#switcher-currency-trigger" timeout="30"/> <element name="currency" type="button" selector="//div[@id='switcher-currency-trigger']/following-sibling::ul//a[contains(text(), '{{currency}}')]" parameterized="true" timeout="10"/> <element name="selectedCurrency" type="text" selector="#switcher-currency-trigger span"/> </section> From 2be777942056985a81371890cfc010d43c47bccd Mon Sep 17 00:00:00 2001 From: Sergiy Zhovnir <s.zhovnir@atwix.com> Date: Sun, 1 Dec 2019 09:02:47 +0200 Subject: [PATCH 150/586] #issue-761 Mark clicked column image with active class --- .../Magento/Ui/view/base/web/js/grid/columns/image.js | 9 +++++++++ .../Ui/view/base/web/templates/grid/columns/image.html | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Ui/view/base/web/js/grid/columns/image.js b/app/code/Magento/Ui/view/base/web/js/grid/columns/image.js index cec0955b835e0..0bd93f8e629b7 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/columns/image.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/columns/image.js @@ -80,6 +80,15 @@ define([ return record.css || {}; }, + /** + * Get is active record + * + * @param {Object} record - Data to be preprocessed. + */ + getIsActive: function (record) { + return this.previewComponent().visibleRecord() === record._rowIndex || false; + }, + /** * Expand image preview */ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/columns/image.html b/app/code/Magento/Ui/view/base/web/templates/grid/columns/image.html index c513ddeff9895..fa0074ad72283 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/columns/image.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/columns/image.html @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ --> -<div class="masonry-image-block" ko-style="$col.getStyles($row())" attr="'data-id': $col.getId($row())"> +<div class="masonry-image-block" ko-style="$col.getStyles($row())" css="{'active': $col.getIsActive($row())}" attr="'data-id': $col.getId($row())"> <img attr="src: $col.getUrl($row())" css="$col.getClasses($row())" click="function(){ expandPreview($row()) }" data-role="thumbnail"/> </div> From a7f6e2d895d3c818d52b318349b5e7d03e06df30 Mon Sep 17 00:00:00 2001 From: Sergiy Zhovnir <s.zhovnir@atwix.com> Date: Sun, 1 Dec 2019 09:51:45 +0200 Subject: [PATCH 151/586] #issue-761 Added the styles for the selected image in the grid --- .../Magento_Ui/web/css/source/module/_masonry-grid.less | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/module/_masonry-grid.less b/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/module/_masonry-grid.less index c17c19e259478..f805861be90e2 100644 --- a/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/module/_masonry-grid.less +++ b/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/module/_masonry-grid.less @@ -27,6 +27,15 @@ margin: @admin__masonry_grid_image__space/2; overflow: hidden; + .masonry-image-block { + &.active { + img { + border: 2px #558dd6 solid; + padding: 1px; + } + } + } + img { cursor: pointer; height: 100%; From db5332e5d95a12c9b32ed0e3523655c8e24d7b1f Mon Sep 17 00:00:00 2001 From: Ashna-Jahan <32352950+Ashna-Jahan@users.noreply.github.com> Date: Mon, 2 Dec 2019 14:01:23 +0530 Subject: [PATCH 152/586] Fixed issue. --- .../backend/web/css/source/forms/fields/_control-table.less | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less b/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less index b304ae1de4c5a..f8e50db60281c 100644 --- a/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less +++ b/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less @@ -239,11 +239,10 @@ } .product_form_product_form_advanced_pricing_modal .admin__fieldset > .admin__field > .admin__field-control { - min-width: 682px; + width: calc(~"(100%) * 0.57 - 30px"); } -.admin__control-table-wrapper { - max-width: 100%; +.product_form_product_form_advanced_pricing_modal .admin__control-table-wrapper { overflow-x: visible; overflow-y: visible; } From 45592e234b8ee700b02e82c28c9c7ee94ae13b51 Mon Sep 17 00:00:00 2001 From: Andrea Zambon <azambon@webgriffe.com> Date: Mon, 2 Dec 2019 12:29:52 +0100 Subject: [PATCH 153/586] Sets the order to state processing also if the order is in state new or pending_payment --- .../RegisterCaptureNotificationCommand.php | 18 +++++++++++++++--- .../RegisterCaptureNotificationCommandTest.php | 16 ++++++++++++++++ 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Sales/Model/Order/Payment/State/RegisterCaptureNotificationCommand.php b/app/code/Magento/Sales/Model/Order/Payment/State/RegisterCaptureNotificationCommand.php index d38e58d7341c1..d8afcc71cc6af 100644 --- a/app/code/Magento/Sales/Model/Order/Payment/State/RegisterCaptureNotificationCommand.php +++ b/app/code/Magento/Sales/Model/Order/Payment/State/RegisterCaptureNotificationCommand.php @@ -11,6 +11,11 @@ use Magento\Sales\Model\Order; use Magento\Sales\Model\Order\StatusResolver; +/** + * Class RegisterCaptureNotificationCommand + * + * @package Magento\Sales\Model\Order\Payment\State + */ class RegisterCaptureNotificationCommand implements CommandInterface { /** @@ -23,11 +28,12 @@ class RegisterCaptureNotificationCommand implements CommandInterface */ public function __construct(StatusResolver $statusResolver = null) { - $this->statusResolver = $statusResolver - ? : ObjectManager::getInstance()->get(StatusResolver::class); + $this->statusResolver = $statusResolver ?: ObjectManager::getInstance()->get(StatusResolver::class); } /** + * Registers a capture event for this payment + * * @param OrderPaymentInterface $payment * @param string|float|int $amount * @param OrderInterface $order @@ -35,7 +41,11 @@ public function __construct(StatusResolver $statusResolver = null) */ public function execute(OrderPaymentInterface $payment, $amount, OrderInterface $order) { - $state = $order->getState() ?: Order::STATE_PROCESSING; + $state = $order->getState(); + if (!$state || $state === Order::STATE_NEW || $state === Order::STATE_PENDING_PAYMENT) { + $state = Order::STATE_PROCESSING; + } + $status = null; $message = 'Registered notification about captured amount of %1.'; @@ -61,6 +71,8 @@ public function execute(OrderPaymentInterface $payment, $amount, OrderInterface } /** + * Sets the state and status of the order + * * @deprecated 100.2.0 Replaced by a StatusResolver class call. * * @param Order $order diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Payment/State/RegisterCaptureNotificationCommandTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Payment/State/RegisterCaptureNotificationCommandTest.php index 1b762fafe0b71..c5c333e55a551 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Payment/State/RegisterCaptureNotificationCommandTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Payment/State/RegisterCaptureNotificationCommandTest.php @@ -80,6 +80,22 @@ public function commandResultDataProvider() $this->newOrderStatus, 'Registered notification about captured amount of %1.', ], + [ + false, + false, + Order::STATE_NEW, + Order::STATE_PROCESSING, + $this->newOrderStatus, + 'Registered notification about captured amount of %1.', + ], + [ + false, + false, + Order::STATE_PENDING_PAYMENT, + Order::STATE_PROCESSING, + $this->newOrderStatus, + 'Registered notification about captured amount of %1.', + ], [ true, false, From 386f4d2ee393f3162277ca7f861db3a87ec82641 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <p.bystritsky@yandex.ru> Date: Fri, 29 Nov 2019 17:56:39 +0200 Subject: [PATCH 154/586] Test for: magento/magento2#25585. --- .../StorefrontCompareActionGroup.xml | 2 + ...AttributeWithoutValueInCompareListTest.xml | 81 +++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/ProductAttributeWithoutValueInCompareListTest.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCompareActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCompareActionGroup.xml index b10b74c919918..706de58a87840 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCompareActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCompareActionGroup.xml @@ -32,6 +32,8 @@ <argument name="productVar"/> </arguments> + <waitForElementVisible selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" + stepKey="seeAddToCompareLink"/> <click selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="clickAddToCompare"/> <waitForElement selector="{{StorefrontMessagesSection.success}}" time="30" stepKey="waitForAddProductToCompareSuccessMessage"/> <see selector="{{StorefrontMessagesSection.success}}" userInput="You added product {{productVar.name}} to the comparison list." stepKey="assertAddProductToCompareSuccessMessage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/ProductAttributeWithoutValueInCompareListTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/ProductAttributeWithoutValueInCompareListTest.xml new file mode 100644 index 0000000000000..f926a2aa2f4ad --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/Test/ProductAttributeWithoutValueInCompareListTest.xml @@ -0,0 +1,81 @@ +<?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="ProductAttributeWithoutValueInCompareListTest"> + <annotations> + <features value="Catalog"/> + <title value="Product attribute without value in compare list test"/> + <description + value="The product attribute that has no value should output 'N/A' on the product comparison page."/> + <severity value="MINOR"/> + <group value="Catalog"/> + </annotations> + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <createData entity="textProductAttribute" stepKey="createProductAttribute"/> + <createData entity="CatalogAttributeSet" stepKey="createAttributeSet"/> + <amOnPage url="{{AdminProductAttributeSetEditPage.url}}/$$createAttributeSet.attribute_set_id$$/" + stepKey="onAttributeSetEdit"/> + <actionGroup ref="AssignAttributeToGroup" stepKey="assignAttributeToGroup"> + <argument name="group" value="Product Details"/> + <argument name="attribute" value="$$createProductAttribute.attribute_code$$"/> + </actionGroup> + <actionGroup ref="SaveAttributeSet" stepKey="SaveAttributeSet"/> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="_defaultProduct" stepKey="createProductDefault"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <createData entity="SimpleProductWithCustomAttributeSet" stepKey="createProductCustom"> + <requiredEntity createDataKey="createCategory"/> + <requiredEntity createDataKey="createAttributeSet"/> + </createData> + </before> + <after> + <deleteData createDataKey="createProductDefault" stepKey="deleteProductDefault"/> + <deleteData createDataKey="createProductCustom" stepKey="deleteProductCustom"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createAttributeSet" stepKey="deleteAttributeSet"/> + <deleteData createDataKey="createProductAttribute" stepKey="deleteProductAttribute"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + <!--Open product page--> + <amOnPage url="{{StorefrontProductPage.url($$createProductDefault.name$$)}}" stepKey="goToProductDefaultPage"/> + <waitForPageLoad stepKey="waitForProductPage"/> + <!--Click on 'Add to Compare' link--> + <actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="clickOnAddToCompare"> + <argument name="productVar" value="$$createProductDefault$$"/> + </actionGroup> + <!--See product in the comparison list--> + <amOnPage url="{{StorefrontProductComparePage.url}}" stepKey="navigateToComparePage"/> + <waitForPageLoad stepKey="waitForStorefrontProductComparePageLoad"/> + <seeElement selector="{{StorefrontProductCompareMainSection.ProductLinkByName($createProductDefault.name$)}}" + stepKey="seeProductInCompareList"/> + <!--Open product with custom attribute page--> + <amOnPage url="{{StorefrontProductPage.url($$createProductCustom.name$$)}}" stepKey="goToProductCustomPage"/> + <waitForPageLoad stepKey="waitForProductCustomPage"/> + <!--Click on 'Add to Compare' link--> + <actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="clickOnAddToCompareCustom"> + <argument name="productVar" value="$$createProductCustom$$"/> + </actionGroup> + <!--See product with custom attribute in the comparison list--> + <amOnPage url="{{StorefrontProductComparePage.url}}" stepKey="navigateToComparePageCustom"/> + <waitForPageLoad stepKey="waitForStorefrontProductCustomComparePageLoad"/> + <seeElement selector="{{StorefrontProductCompareMainSection.ProductLinkByName($createProductCustom.name$)}}" + stepKey="seeProductCustomInCompareList"/> + <!--See attribute default value in the comparison list--> + <see userInput="$createProductAttribute.defaultValue$" + selector="{{StorefrontProductCompareMainSection.ProductAttributeByCodeAndProductName(ProductAttributeFrontendLabel.label, $createProductCustom.name$)}}" + stepKey="assertAttributeValueForProductCustom"/> + <!--See N/A if attribute has no value in the comparison list--> + <see userInput="N/A" + selector="{{StorefrontProductCompareMainSection.ProductAttributeByCodeAndProductName(ProductAttributeFrontendLabel.label, $createProductDefault.name$)}}" + stepKey="assertNAForProductDefault"/> + </test> +</tests> From 28542922e9914d169ddb41ce1f83ce44cc063982 Mon Sep 17 00:00:00 2001 From: Dmytro Voskoboinikov <voskoboi@adobe.com> Date: Mon, 2 Dec 2019 15:06:05 -0600 Subject: [PATCH 155/586] MC-23177: Update of Moment.js library --- lib/web/moment.js | 557 +--------------------------------------------- 1 file changed, 6 insertions(+), 551 deletions(-) diff --git a/lib/web/moment.js b/lib/web/moment.js index d34d1c6329e59..ee598a90a83f0 100644 --- a/lib/web/moment.js +++ b/lib/web/moment.js @@ -1,551 +1,6 @@ -//! moment.js -//! version : 2.17.1 -//! authors : Tim Wood, Iskren Chernev, Moment.js contributors -//! license : MIT -//! momentjs.com -!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.moment=b()}(this,function(){"use strict";function a(){return od.apply(null,arguments)} -// This is done to register the method called with moment() -// without creating circular dependencies. - function b(a){od=a}function c(a){return a instanceof Array||"[object Array]"===Object.prototype.toString.call(a)}function d(a){ -// IE8 will treat undefined and null as object if it wasn't for -// input != null - return null!=a&&"[object Object]"===Object.prototype.toString.call(a)}function e(a){var b;for(b in a) -// even if its not own property I'd still call it non-empty - return!1;return!0}function f(a){return"number"==typeof a||"[object Number]"===Object.prototype.toString.call(a)}function g(a){return a instanceof Date||"[object Date]"===Object.prototype.toString.call(a)}function h(a,b){var c,d=[];for(c=0;c<a.length;++c)d.push(b(a[c],c));return d}function i(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function j(a,b){for(var c in b)i(b,c)&&(a[c]=b[c]);return i(b,"toString")&&(a.toString=b.toString),i(b,"valueOf")&&(a.valueOf=b.valueOf),a}function k(a,b,c,d){return rb(a,b,c,d,!0).utc()}function l(){ -// We need to deep clone this object. - return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null}}function m(a){return null==a._pf&&(a._pf=l()),a._pf}function n(a){if(null==a._isValid){var b=m(a),c=qd.call(b.parsedDateParts,function(a){return null!=a}),d=!isNaN(a._d.getTime())&&b.overflow<0&&!b.empty&&!b.invalidMonth&&!b.invalidWeekday&&!b.nullInput&&!b.invalidFormat&&!b.userInvalidated&&(!b.meridiem||b.meridiem&&c);if(a._strict&&(d=d&&0===b.charsLeftOver&&0===b.unusedTokens.length&&void 0===b.bigHour),null!=Object.isFrozen&&Object.isFrozen(a))return d;a._isValid=d}return a._isValid}function o(a){var b=k(NaN);return null!=a?j(m(b),a):m(b).userInvalidated=!0,b}function p(a){return void 0===a}function q(a,b){var c,d,e;if(p(b._isAMomentObject)||(a._isAMomentObject=b._isAMomentObject),p(b._i)||(a._i=b._i),p(b._f)||(a._f=b._f),p(b._l)||(a._l=b._l),p(b._strict)||(a._strict=b._strict),p(b._tzm)||(a._tzm=b._tzm),p(b._isUTC)||(a._isUTC=b._isUTC),p(b._offset)||(a._offset=b._offset),p(b._pf)||(a._pf=m(b)),p(b._locale)||(a._locale=b._locale),rd.length>0)for(c in rd)d=rd[c],e=b[d],p(e)||(a[d]=e);return a} -// Moment prototype object - function r(b){q(this,b),this._d=new Date(null!=b._d?b._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)), -// Prevent infinite loop in case updateOffset creates new moment -// objects. - sd===!1&&(sd=!0,a.updateOffset(this),sd=!1)}function s(a){return a instanceof r||null!=a&&null!=a._isAMomentObject}function t(a){return a<0?Math.ceil(a)||0:Math.floor(a)}function u(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=t(b)),c} -// compare two arrays, return the number of differences - function v(a,b,c){var d,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;d<e;d++)(c&&a[d]!==b[d]||!c&&u(a[d])!==u(b[d]))&&g++;return g+f}function w(b){a.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+b)}function x(b,c){var d=!0;return j(function(){if(null!=a.deprecationHandler&&a.deprecationHandler(null,b),d){for(var e,f=[],g=0;g<arguments.length;g++){if(e="","object"==typeof arguments[g]){e+="\n["+g+"] ";for(var h in arguments[0])e+=h+": "+arguments[0][h]+", ";e=e.slice(0,-2)}else e=arguments[g];f.push(e)}w(b+"\nArguments: "+Array.prototype.slice.call(f).join("")+"\n"+(new Error).stack),d=!1}return c.apply(this,arguments)},c)}function y(b,c){null!=a.deprecationHandler&&a.deprecationHandler(b,c),td[b]||(w(c),td[b]=!0)}function z(a){return a instanceof Function||"[object Function]"===Object.prototype.toString.call(a)}function A(a){var b,c;for(c in a)b=a[c],z(b)?this[c]=b:this["_"+c]=b;this._config=a, -// Lenient ordinal parsing accepts just a number in addition to -// number + (possibly) stuff coming from _ordinalParseLenient. - this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function B(a,b){var c,e=j({},a);for(c in b)i(b,c)&&(d(a[c])&&d(b[c])?(e[c]={},j(e[c],a[c]),j(e[c],b[c])):null!=b[c]?e[c]=b[c]:delete e[c]);for(c in a)i(a,c)&&!i(b,c)&&d(a[c])&&( -// make sure changes to properties don't modify parent config - e[c]=j({},e[c]));return e}function C(a){null!=a&&this.set(a)}function D(a,b,c){var d=this._calendar[a]||this._calendar.sameElse;return z(d)?d.call(b,c):d}function E(a){var b=this._longDateFormat[a],c=this._longDateFormat[a.toUpperCase()];return b||!c?b:(this._longDateFormat[a]=c.replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a])}function F(){return this._invalidDate}function G(a){return this._ordinal.replace("%d",a)}function H(a,b,c,d){var e=this._relativeTime[c];return z(e)?e(a,b,c,d):e.replace(/%d/i,a)}function I(a,b){var c=this._relativeTime[a>0?"future":"past"];return z(c)?c(b):c.replace(/%s/i,b)}function J(a,b){var c=a.toLowerCase();Dd[c]=Dd[c+"s"]=Dd[b]=a}function K(a){return"string"==typeof a?Dd[a]||Dd[a.toLowerCase()]:void 0}function L(a){var b,c,d={};for(c in a)i(a,c)&&(b=K(c),b&&(d[b]=a[c]));return d}function M(a,b){Ed[a]=b}function N(a){var b=[];for(var c in a)b.push({unit:c,priority:Ed[c]});return b.sort(function(a,b){return a.priority-b.priority}),b}function O(b,c){return function(d){return null!=d?(Q(this,b,d),a.updateOffset(this,c),this):P(this,b)}}function P(a,b){return a.isValid()?a._d["get"+(a._isUTC?"UTC":"")+b]():NaN}function Q(a,b,c){a.isValid()&&a._d["set"+(a._isUTC?"UTC":"")+b](c)} -// MOMENTS - function R(a){return a=K(a),z(this[a])?this[a]():this}function S(a,b){if("object"==typeof a){a=L(a);for(var c=N(a),d=0;d<c.length;d++)this[c[d].unit](a[c[d].unit])}else if(a=K(a),z(this[a]))return this[a](b);return this}function T(a,b,c){var d=""+Math.abs(a),e=b-d.length,f=a>=0;return(f?c?"+":"":"-")+Math.pow(10,Math.max(0,e)).toString().substr(1)+d} -// token: 'M' -// padded: ['MM', 2] -// ordinal: 'Mo' -// callback: function () { this.month() + 1 } - function U(a,b,c,d){var e=d;"string"==typeof d&&(e=function(){return this[d]()}),a&&(Id[a]=e),b&&(Id[b[0]]=function(){return T(e.apply(this,arguments),b[1],b[2])}),c&&(Id[c]=function(){return this.localeData().ordinal(e.apply(this,arguments),a)})}function V(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function W(a){var b,c,d=a.match(Fd);for(b=0,c=d.length;b<c;b++)Id[d[b]]?d[b]=Id[d[b]]:d[b]=V(d[b]);return function(b){var e,f="";for(e=0;e<c;e++)f+=d[e]instanceof Function?d[e].call(b,a):d[e];return f}} -// format date using native date object - function X(a,b){return a.isValid()?(b=Y(b,a.localeData()),Hd[b]=Hd[b]||W(b),Hd[b](a)):a.localeData().invalidDate()}function Y(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(Gd.lastIndex=0;d>=0&&Gd.test(a);)a=a.replace(Gd,c),Gd.lastIndex=0,d-=1;return a}function Z(a,b,c){$d[a]=z(b)?b:function(a,d){return a&&c?c:b}}function $(a,b){return i($d,a)?$d[a](b._strict,b._locale):new RegExp(_(a))} -// Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript - function _(a){return aa(a.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e}))}function aa(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function ba(a,b){var c,d=b;for("string"==typeof a&&(a=[a]),f(b)&&(d=function(a,c){c[b]=u(a)}),c=0;c<a.length;c++)_d[a[c]]=d}function ca(a,b){ba(a,function(a,c,d,e){d._w=d._w||{},b(a,d._w,d,e)})}function da(a,b,c){null!=b&&i(_d,a)&&_d[a](b,c._a,c,a)}function ea(a,b){return new Date(Date.UTC(a,b+1,0)).getUTCDate()}function fa(a,b){return a?c(this._months)?this._months[a.month()]:this._months[(this._months.isFormat||ke).test(b)?"format":"standalone"][a.month()]:this._months}function ga(a,b){return a?c(this._monthsShort)?this._monthsShort[a.month()]:this._monthsShort[ke.test(b)?"format":"standalone"][a.month()]:this._monthsShort}function ha(a,b,c){var d,e,f,g=a.toLocaleLowerCase();if(!this._monthsParse)for( -// this is not used - this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],d=0;d<12;++d)f=k([2e3,d]),this._shortMonthsParse[d]=this.monthsShort(f,"").toLocaleLowerCase(),this._longMonthsParse[d]=this.months(f,"").toLocaleLowerCase();return c?"MMM"===b?(e=je.call(this._shortMonthsParse,g),e!==-1?e:null):(e=je.call(this._longMonthsParse,g),e!==-1?e:null):"MMM"===b?(e=je.call(this._shortMonthsParse,g),e!==-1?e:(e=je.call(this._longMonthsParse,g),e!==-1?e:null)):(e=je.call(this._longMonthsParse,g),e!==-1?e:(e=je.call(this._shortMonthsParse,g),e!==-1?e:null))}function ia(a,b,c){var d,e,f;if(this._monthsParseExact)return ha.call(this,a,b,c); -// TODO: add sorting -// Sorting makes sure if one month (or abbr) is a prefix of another -// see sorting in computeMonthsParse - for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),d=0;d<12;d++){ -// test the regex - if( -// make the regex if we don't have it already - e=k([2e3,d]),c&&!this._longMonthsParse[d]&&(this._longMonthsParse[d]=new RegExp("^"+this.months(e,"").replace(".","")+"$","i"),this._shortMonthsParse[d]=new RegExp("^"+this.monthsShort(e,"").replace(".","")+"$","i")),c||this._monthsParse[d]||(f="^"+this.months(e,"")+"|^"+this.monthsShort(e,""),this._monthsParse[d]=new RegExp(f.replace(".",""),"i")),c&&"MMMM"===b&&this._longMonthsParse[d].test(a))return d;if(c&&"MMM"===b&&this._shortMonthsParse[d].test(a))return d;if(!c&&this._monthsParse[d].test(a))return d}} -// MOMENTS - function ja(a,b){var c;if(!a.isValid()) -// No op - return a;if("string"==typeof b)if(/^\d+$/.test(b))b=u(b);else -// TODO: Another silent failure? - if(b=a.localeData().monthsParse(b),!f(b))return a;return c=Math.min(a.date(),ea(a.year(),b)),a._d["set"+(a._isUTC?"UTC":"")+"Month"](b,c),a}function ka(b){return null!=b?(ja(this,b),a.updateOffset(this,!0),this):P(this,"Month")}function la(){return ea(this.year(),this.month())}function ma(a){return this._monthsParseExact?(i(this,"_monthsRegex")||oa.call(this),a?this._monthsShortStrictRegex:this._monthsShortRegex):(i(this,"_monthsShortRegex")||(this._monthsShortRegex=ne),this._monthsShortStrictRegex&&a?this._monthsShortStrictRegex:this._monthsShortRegex)}function na(a){return this._monthsParseExact?(i(this,"_monthsRegex")||oa.call(this),a?this._monthsStrictRegex:this._monthsRegex):(i(this,"_monthsRegex")||(this._monthsRegex=oe),this._monthsStrictRegex&&a?this._monthsStrictRegex:this._monthsRegex)}function oa(){function a(a,b){return b.length-a.length}var b,c,d=[],e=[],f=[];for(b=0;b<12;b++) -// make the regex if we don't have it already - c=k([2e3,b]),d.push(this.monthsShort(c,"")),e.push(this.months(c,"")),f.push(this.months(c,"")),f.push(this.monthsShort(c,""));for( -// Sorting makes sure if one month (or abbr) is a prefix of another it -// will match the longer piece. - d.sort(a),e.sort(a),f.sort(a),b=0;b<12;b++)d[b]=aa(d[b]),e[b]=aa(e[b]);for(b=0;b<24;b++)f[b]=aa(f[b]);this._monthsRegex=new RegExp("^("+f.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+e.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+d.join("|")+")","i")} -// HELPERS - function pa(a){return qa(a)?366:365}function qa(a){return a%4===0&&a%100!==0||a%400===0}function ra(){return qa(this.year())}function sa(a,b,c,d,e,f,g){ -//can't just apply() to create a date: -//http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply - var h=new Date(a,b,c,d,e,f,g); -//the date constructor remaps years 0-99 to 1900-1999 - return a<100&&a>=0&&isFinite(h.getFullYear())&&h.setFullYear(a),h}function ta(a){var b=new Date(Date.UTC.apply(null,arguments)); -//the Date.UTC function remaps years 0-99 to 1900-1999 - return a<100&&a>=0&&isFinite(b.getUTCFullYear())&&b.setUTCFullYear(a),b} -// start-of-first-week - start-of-year - function ua(a,b,c){var// first-week day -- which january is always in the first week (4 for iso, 1 for other) - d=7+b-c, -// first-week day local weekday -- which local weekday is fwd - e=(7+ta(a,0,d).getUTCDay()-b)%7;return-e+d-1} -//http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday - function va(a,b,c,d,e){var f,g,h=(7+c-d)%7,i=ua(a,d,e),j=1+7*(b-1)+h+i;return j<=0?(f=a-1,g=pa(f)+j):j>pa(a)?(f=a+1,g=j-pa(a)):(f=a,g=j),{year:f,dayOfYear:g}}function wa(a,b,c){var d,e,f=ua(a.year(),b,c),g=Math.floor((a.dayOfYear()-f-1)/7)+1;return g<1?(e=a.year()-1,d=g+xa(e,b,c)):g>xa(a.year(),b,c)?(d=g-xa(a.year(),b,c),e=a.year()+1):(e=a.year(),d=g),{week:d,year:e}}function xa(a,b,c){var d=ua(a,b,c),e=ua(a+1,b,c);return(pa(a)-d+e)/7} -// HELPERS -// LOCALES - function ya(a){return wa(a,this._week.dow,this._week.doy).week}function za(){return this._week.dow}function Aa(){return this._week.doy} -// MOMENTS - function Ba(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),"d")}function Ca(a){var b=wa(this,1,4).week;return null==a?b:this.add(7*(a-b),"d")} -// HELPERS - function Da(a,b){return"string"!=typeof a?a:isNaN(a)?(a=b.weekdaysParse(a),"number"==typeof a?a:null):parseInt(a,10)}function Ea(a,b){return"string"==typeof a?b.weekdaysParse(a)%7||7:isNaN(a)?null:a}function Fa(a,b){return a?c(this._weekdays)?this._weekdays[a.day()]:this._weekdays[this._weekdays.isFormat.test(b)?"format":"standalone"][a.day()]:this._weekdays}function Ga(a){return a?this._weekdaysShort[a.day()]:this._weekdaysShort}function Ha(a){return a?this._weekdaysMin[a.day()]:this._weekdaysMin}function Ia(a,b,c){var d,e,f,g=a.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],d=0;d<7;++d)f=k([2e3,1]).day(d),this._minWeekdaysParse[d]=this.weekdaysMin(f,"").toLocaleLowerCase(),this._shortWeekdaysParse[d]=this.weekdaysShort(f,"").toLocaleLowerCase(),this._weekdaysParse[d]=this.weekdays(f,"").toLocaleLowerCase();return c?"dddd"===b?(e=je.call(this._weekdaysParse,g),e!==-1?e:null):"ddd"===b?(e=je.call(this._shortWeekdaysParse,g),e!==-1?e:null):(e=je.call(this._minWeekdaysParse,g),e!==-1?e:null):"dddd"===b?(e=je.call(this._weekdaysParse,g),e!==-1?e:(e=je.call(this._shortWeekdaysParse,g),e!==-1?e:(e=je.call(this._minWeekdaysParse,g),e!==-1?e:null))):"ddd"===b?(e=je.call(this._shortWeekdaysParse,g),e!==-1?e:(e=je.call(this._weekdaysParse,g),e!==-1?e:(e=je.call(this._minWeekdaysParse,g),e!==-1?e:null))):(e=je.call(this._minWeekdaysParse,g),e!==-1?e:(e=je.call(this._weekdaysParse,g),e!==-1?e:(e=je.call(this._shortWeekdaysParse,g),e!==-1?e:null)))}function Ja(a,b,c){var d,e,f;if(this._weekdaysParseExact)return Ia.call(this,a,b,c);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),d=0;d<7;d++){ -// test the regex - if( -// make the regex if we don't have it already - e=k([2e3,1]).day(d),c&&!this._fullWeekdaysParse[d]&&(this._fullWeekdaysParse[d]=new RegExp("^"+this.weekdays(e,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[d]=new RegExp("^"+this.weekdaysShort(e,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[d]=new RegExp("^"+this.weekdaysMin(e,"").replace(".",".?")+"$","i")),this._weekdaysParse[d]||(f="^"+this.weekdays(e,"")+"|^"+this.weekdaysShort(e,"")+"|^"+this.weekdaysMin(e,""),this._weekdaysParse[d]=new RegExp(f.replace(".",""),"i")),c&&"dddd"===b&&this._fullWeekdaysParse[d].test(a))return d;if(c&&"ddd"===b&&this._shortWeekdaysParse[d].test(a))return d;if(c&&"dd"===b&&this._minWeekdaysParse[d].test(a))return d;if(!c&&this._weekdaysParse[d].test(a))return d}} -// MOMENTS - function Ka(a){if(!this.isValid())return null!=a?this:NaN;var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=Da(a,this.localeData()),this.add(a-b,"d")):b}function La(a){if(!this.isValid())return null!=a?this:NaN;var b=(this.day()+7-this.localeData()._week.dow)%7;return null==a?b:this.add(a-b,"d")}function Ma(a){if(!this.isValid())return null!=a?this:NaN; -// behaves the same as moment#day except -// as a getter, returns 7 instead of 0 (1-7 range instead of 0-6) -// as a setter, sunday should belong to the previous week. - if(null!=a){var b=Ea(a,this.localeData());return this.day(this.day()%7?b:b-7)}return this.day()||7}function Na(a){return this._weekdaysParseExact?(i(this,"_weekdaysRegex")||Qa.call(this),a?this._weekdaysStrictRegex:this._weekdaysRegex):(i(this,"_weekdaysRegex")||(this._weekdaysRegex=ue),this._weekdaysStrictRegex&&a?this._weekdaysStrictRegex:this._weekdaysRegex)}function Oa(a){return this._weekdaysParseExact?(i(this,"_weekdaysRegex")||Qa.call(this),a?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(i(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=ve),this._weekdaysShortStrictRegex&&a?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Pa(a){return this._weekdaysParseExact?(i(this,"_weekdaysRegex")||Qa.call(this),a?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(i(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=we),this._weekdaysMinStrictRegex&&a?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Qa(){function a(a,b){return b.length-a.length}var b,c,d,e,f,g=[],h=[],i=[],j=[];for(b=0;b<7;b++) -// make the regex if we don't have it already - c=k([2e3,1]).day(b),d=this.weekdaysMin(c,""),e=this.weekdaysShort(c,""),f=this.weekdays(c,""),g.push(d),h.push(e),i.push(f),j.push(d),j.push(e),j.push(f);for( -// Sorting makes sure if one weekday (or abbr) is a prefix of another it -// will match the longer piece. - g.sort(a),h.sort(a),i.sort(a),j.sort(a),b=0;b<7;b++)h[b]=aa(h[b]),i[b]=aa(i[b]),j[b]=aa(j[b]);this._weekdaysRegex=new RegExp("^("+j.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+h.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+g.join("|")+")","i")} -// FORMATTING - function Ra(){return this.hours()%12||12}function Sa(){return this.hours()||24}function Ta(a,b){U(a,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),b)})} -// PARSING - function Ua(a,b){return b._meridiemParse} -// LOCALES - function Va(a){ -// IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays -// Using charAt should be more compatible. - return"p"===(a+"").toLowerCase().charAt(0)}function Wa(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"}function Xa(a){return a?a.toLowerCase().replace("_","-"):a} -// pick the locale from the array -// try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each -// substring from most specific to least, but move to the next array item if it's a more specific variant than the current root - function Ya(a){for(var b,c,d,e,f=0;f<a.length;){for(e=Xa(a[f]).split("-"),b=e.length,c=Xa(a[f+1]),c=c?c.split("-"):null;b>0;){if(d=Za(e.slice(0,b).join("-")))return d;if(c&&c.length>=b&&v(e,c,!0)>=b-1) -//the next array item is better than a shallower substring of this one - break;b--}f++}return null}function Za(a){var b=null; -// TODO: Find a better way to register and load all the locales in Node - if(!Be[a]&&"undefined"!=typeof module&&module&&module.exports)try{b=xe._abbr,require("./locale/"+a), -// because defineLocale currently also sets the global locale, we -// want to undo that for lazy loaded locales - $a(b)}catch(a){}return Be[a]} -// This function will load locale and then set the global locale. If -// no arguments are passed in, it will simply return the current global -// locale key. - function $a(a,b){var c; -// moment.duration._locale = moment._locale = data; - return a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}function _a(a,b){if(null!==b){var c=Ae;if(b.abbr=a,null!=Be[a])y("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),c=Be[a]._config;else if(null!=b.parentLocale){if(null==Be[b.parentLocale])return Ce[b.parentLocale]||(Ce[b.parentLocale]=[]),Ce[b.parentLocale].push({name:a,config:b}),null;c=Be[b.parentLocale]._config} -// backwards compat for now: also set the locale -// make sure we set the locale AFTER all child locales have been -// created, so we won't end up with the child locale set. - return Be[a]=new C(B(c,b)),Ce[a]&&Ce[a].forEach(function(a){_a(a.name,a.config)}),$a(a),Be[a]} -// useful for testing - return delete Be[a],null}function ab(a,b){if(null!=b){var c,d=Ae; -// MERGE - null!=Be[a]&&(d=Be[a]._config),b=B(d,b),c=new C(b),c.parentLocale=Be[a],Be[a]=c, -// backwards compat for now: also set the locale - $a(a)}else -// pass null for config to unupdate, useful for tests - null!=Be[a]&&(null!=Be[a].parentLocale?Be[a]=Be[a].parentLocale:null!=Be[a]&&delete Be[a]);return Be[a]} -// returns locale data - function bb(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return xe;if(!c(a)){if( -//short-circuit everything else - b=Za(a))return b;a=[a]}return Ya(a)}function cb(){return wd(Be)}function db(a){var b,c=a._a;return c&&m(a).overflow===-2&&(b=c[be]<0||c[be]>11?be:c[ce]<1||c[ce]>ea(c[ae],c[be])?ce:c[de]<0||c[de]>24||24===c[de]&&(0!==c[ee]||0!==c[fe]||0!==c[ge])?de:c[ee]<0||c[ee]>59?ee:c[fe]<0||c[fe]>59?fe:c[ge]<0||c[ge]>999?ge:-1,m(a)._overflowDayOfYear&&(b<ae||b>ce)&&(b=ce),m(a)._overflowWeeks&&b===-1&&(b=he),m(a)._overflowWeekday&&b===-1&&(b=ie),m(a).overflow=b),a} -// date from iso format - function eb(a){var b,c,d,e,f,g,h=a._i,i=De.exec(h)||Ee.exec(h);if(i){for(m(a).iso=!0,b=0,c=Ge.length;b<c;b++)if(Ge[b][1].exec(i[1])){e=Ge[b][0],d=Ge[b][2]!==!1;break}if(null==e)return void(a._isValid=!1);if(i[3]){for(b=0,c=He.length;b<c;b++)if(He[b][1].exec(i[3])){ -// match[2] should be 'T' or space - f=(i[2]||" ")+He[b][0];break}if(null==f)return void(a._isValid=!1)}if(!d&&null!=f)return void(a._isValid=!1);if(i[4]){if(!Fe.exec(i[4]))return void(a._isValid=!1);g="Z"}a._f=e+(f||"")+(g||""),kb(a)}else a._isValid=!1} -// date from iso format or fallback - function fb(b){var c=Ie.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(eb(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))} -// Pick the first defined of two or three arguments. - function gb(a,b,c){return null!=a?a:null!=b?b:c}function hb(b){ -// hooks is actually the exported moment object - var c=new Date(a.now());return b._useUTC?[c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()]:[c.getFullYear(),c.getMonth(),c.getDate()]} -// convert an array to a date. -// the array should mirror the parameters below -// note: all values past the year are optional and will default to the lowest possible value. -// [year, month, day , hour, minute, second, millisecond] - function ib(a){var b,c,d,e,f=[];if(!a._d){ -// Default to current date. -// * if no year, month, day of month are given, default to today -// * if day of month is given, default month and year -// * if month is given, default only year -// * if year is given, don't default anything - for(d=hb(a), -//compute day of the year from weeks and weekdays - a._w&&null==a._a[ce]&&null==a._a[be]&&jb(a), -//if the day of the year is set, figure out what it is - a._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b]; -// Zero out whatever was not defaulted, including time - for(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b]; -// Check for 24:00:00.000 - 24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f), -// Apply timezone offset from input. The actual utcOffset can be changed -// with parseZone. - null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}function jb(a){var b,c,d,e,f,g,h,i;if(b=a._w,null!=b.GG||null!=b.W||null!=b.E)f=1,g=4, -// TODO: We need to take the current isoWeekYear, but that depends on -// how we interpret now (local, utc, fixed offset). So create -// a now version of current config (take local/utc/offset flags, and -// create now). - c=gb(b.GG,a._a[ae],wa(sb(),1,4).year),d=gb(b.W,1),e=gb(b.E,1),(e<1||e>7)&&(i=!0);else{f=a._locale._week.dow,g=a._locale._week.doy;var j=wa(sb(),f,g);c=gb(b.gg,a._a[ae],j.year), -// Default to current week. - d=gb(b.w,j.week),null!=b.d?( -// weekday -- low day numbers are considered next week - e=b.d,(e<0||e>6)&&(i=!0)):null!=b.e?( -// local weekday -- counting starts from begining of week - e=b.e+f,(b.e<0||b.e>6)&&(i=!0)): -// default to begining of week - e=f}d<1||d>xa(c,f,g)?m(a)._overflowWeeks=!0:null!=i?m(a)._overflowWeekday=!0:(h=va(c,d,e,f,g),a._a[ae]=h.year,a._dayOfYear=h.dayOfYear)} -// date from string and format string - function kb(b){ -// TODO: Move this to another part of the creation flow to prevent circular deps - if(b._f===a.ISO_8601)return void eb(b);b._a=[],m(b).empty=!0; -// This array is used to make a Date, either with `new Date` or `Date.UTC` - var c,d,e,f,g,h=""+b._i,i=h.length,j=0;for(e=Y(b._f,b._locale).match(Fd)||[],c=0;c<e.length;c++)f=e[c],d=(h.match($(f,b))||[])[0], -// console.log('token', token, 'parsedInput', parsedInput, -// 'regex', getParseRegexForToken(token, config)); - d&&(g=h.substr(0,h.indexOf(d)),g.length>0&&m(b).unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),j+=d.length), -// don't parse if it's not a known token - Id[f]?(d?m(b).empty=!1:m(b).unusedTokens.push(f),da(f,d,b)):b._strict&&!d&&m(b).unusedTokens.push(f); -// add remaining unparsed input length to the string - m(b).charsLeftOver=i-j,h.length>0&&m(b).unusedInput.push(h), -// clear _12h flag if hour is <= 12 - b._a[de]<=12&&m(b).bigHour===!0&&b._a[de]>0&&(m(b).bigHour=void 0),m(b).parsedDateParts=b._a.slice(0),m(b).meridiem=b._meridiem, -// handle meridiem - b._a[de]=lb(b._locale,b._a[de],b._meridiem),ib(b),db(b)}function lb(a,b,c){var d; -// Fallback - return null==c?b:null!=a.meridiemHour?a.meridiemHour(b,c):null!=a.isPM?(d=a.isPM(c),d&&b<12&&(b+=12),d||12!==b||(b=0),b):b} -// date from string and array of format strings - function mb(a){var b,c,d,e,f;if(0===a._f.length)return m(a).invalidFormat=!0,void(a._d=new Date(NaN));for(e=0;e<a._f.length;e++)f=0,b=q({},a),null!=a._useUTC&&(b._useUTC=a._useUTC),b._f=a._f[e],kb(b),n(b)&&( -// if there is any input that was not parsed add a penalty for that format - f+=m(b).charsLeftOver, -//or tokens - f+=10*m(b).unusedTokens.length,m(b).score=f,(null==d||f<d)&&(d=f,c=b));j(a,c||b)}function nb(a){if(!a._d){var b=L(a._i);a._a=h([b.year,b.month,b.day||b.date,b.hour,b.minute,b.second,b.millisecond],function(a){return a&&parseInt(a,10)}),ib(a)}}function ob(a){var b=new r(db(pb(a))); -// Adding is smart enough around DST - return b._nextDay&&(b.add(1,"d"),b._nextDay=void 0),b}function pb(a){var b=a._i,d=a._f;return a._locale=a._locale||bb(a._l),null===b||void 0===d&&""===b?o({nullInput:!0}):("string"==typeof b&&(a._i=b=a._locale.preparse(b)),s(b)?new r(db(b)):(g(b)?a._d=b:c(d)?mb(a):d?kb(a):qb(a),n(a)||(a._d=null),a))}function qb(b){var d=b._i;void 0===d?b._d=new Date(a.now()):g(d)?b._d=new Date(d.valueOf()):"string"==typeof d?fb(b):c(d)?(b._a=h(d.slice(0),function(a){return parseInt(a,10)}),ib(b)):"object"==typeof d?nb(b):f(d)? -// from milliseconds - b._d=new Date(d):a.createFromInputFallback(b)}function rb(a,b,f,g,h){var i={}; -// object construction must be done this way. -// https://github.com/moment/moment/issues/1423 - return f!==!0&&f!==!1||(g=f,f=void 0),(d(a)&&e(a)||c(a)&&0===a.length)&&(a=void 0),i._isAMomentObject=!0,i._useUTC=i._isUTC=h,i._l=f,i._i=a,i._f=b,i._strict=g,ob(i)}function sb(a,b,c,d){return rb(a,b,c,d,!1)} -// Pick a moment m from moments so that m[fn](other) is true for all -// other. This relies on the function fn to be transitive. -// -// moments should either be an array of moment objects or an array, whose -// first element is an array of moment objects. - function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d} -// TODO: Use [].sort instead? - function ub(){var a=[].slice.call(arguments,0);return tb("isBefore",a)}function vb(){var a=[].slice.call(arguments,0);return tb("isAfter",a)}function wb(a){var b=L(a),c=b.year||0,d=b.quarter||0,e=b.month||0,f=b.week||0,g=b.day||0,h=b.hour||0,i=b.minute||0,j=b.second||0,k=b.millisecond||0; -// representation for dateAddRemove - this._milliseconds=+k+1e3*j+// 1000 - 6e4*i+// 1000 * 60 - 1e3*h*60*60,//using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978 -// Because of dateAddRemove treats 24 hours as different from a -// day when working around DST, we need to store them separately - this._days=+g+7*f, -// It is impossible translate months into days without knowing -// which months you are are talking about, so we have to store -// it separately. - this._months=+e+3*d+12*c,this._data={},this._locale=bb(),this._bubble()}function xb(a){return a instanceof wb}function yb(a){return a<0?Math.round(-1*a)*-1:Math.round(a)} -// FORMATTING - function zb(a,b){U(a,0,0,function(){var a=this.utcOffset(),c="+";return a<0&&(a=-a,c="-"),c+T(~~(a/60),2)+b+T(~~a%60,2)})}function Ab(a,b){var c=(b||"").match(a);if(null===c)return null;var d=c[c.length-1]||[],e=(d+"").match(Me)||["-",0,0],f=+(60*e[1])+u(e[2]);return 0===f?0:"+"===e[0]?f:-f} -// Return a moment from input, that is local/utc/zone equivalent to model. - function Bb(b,c){var d,e; -// Use low-level api, because this fn is low-level api. - return c._isUTC?(d=c.clone(),e=(s(b)||g(b)?b.valueOf():sb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):sb(b).local()}function Cb(a){ -// On Firefox.24 Date#getTimezoneOffset returns a floating point. -// https://github.com/moment/moment/pull/1871 - return 15*-Math.round(a._d.getTimezoneOffset()/15)} -// MOMENTS -// keepLocalTime = true means only change the timezone, without -// affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]--> -// 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset -// +0200, so we adjust the time as needed, to be valid. -// -// Keeping the time actually adds/subtracts (one hour) -// from the actual represented time. That is why we call updateOffset -// a second time. In case it wants us to change the offset again -// _changeInProgress == true case, then we have to adjust, because -// there is no such time in the given timezone. - function Db(b,c){var d,e=this._offset||0;if(!this.isValid())return null!=b?this:NaN;if(null!=b){if("string"==typeof b){if(b=Ab(Xd,b),null===b)return this}else Math.abs(b)<16&&(b=60*b);return!this._isUTC&&c&&(d=Cb(this)),this._offset=b,this._isUTC=!0,null!=d&&this.add(d,"m"),e!==b&&(!c||this._changeInProgress?Tb(this,Ob(b-e,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?e:Cb(this)}function Eb(a,b){return null!=a?("string"!=typeof a&&(a=-a),this.utcOffset(a,b),this):-this.utcOffset()}function Fb(a){return this.utcOffset(0,a)}function Gb(a){return this._isUTC&&(this.utcOffset(0,a),this._isUTC=!1,a&&this.subtract(Cb(this),"m")),this}function Hb(){if(null!=this._tzm)this.utcOffset(this._tzm);else if("string"==typeof this._i){var a=Ab(Wd,this._i);null!=a?this.utcOffset(a):this.utcOffset(0,!0)}return this}function Ib(a){return!!this.isValid()&&(a=a?sb(a).utcOffset():0,(this.utcOffset()-a)%60===0)}function Jb(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Kb(){if(!p(this._isDSTShifted))return this._isDSTShifted;var a={};if(q(a,this),a=pb(a),a._a){var b=a._isUTC?k(a._a):sb(a._a);this._isDSTShifted=this.isValid()&&v(a._a,b.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Lb(){return!!this.isValid()&&!this._isUTC}function Mb(){return!!this.isValid()&&this._isUTC}function Nb(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function Ob(a,b){var c,d,e,g=a, -// matching against regexp is expensive, do it on demand - h=null;// checks for null or undefined - return xb(a)?g={ms:a._milliseconds,d:a._days,M:a._months}:f(a)?(g={},b?g[b]=a:g.milliseconds=a):(h=Ne.exec(a))?(c="-"===h[1]?-1:1,g={y:0,d:u(h[ce])*c,h:u(h[de])*c,m:u(h[ee])*c,s:u(h[fe])*c,ms:u(yb(1e3*h[ge]))*c}):(h=Oe.exec(a))?(c="-"===h[1]?-1:1,g={y:Pb(h[2],c),M:Pb(h[3],c),w:Pb(h[4],c),d:Pb(h[5],c),h:Pb(h[6],c),m:Pb(h[7],c),s:Pb(h[8],c)}):null==g?g={}:"object"==typeof g&&("from"in g||"to"in g)&&(e=Rb(sb(g.from),sb(g.to)),g={},g.ms=e.milliseconds,g.M=e.months),d=new wb(g),xb(a)&&i(a,"_locale")&&(d._locale=a._locale),d}function Pb(a,b){ -// We'd normally use ~~inp for this, but unfortunately it also -// converts floats to ints. -// inp may be undefined, so careful calling replace on it. - var c=a&&parseFloat(a.replace(",",".")); -// apply sign while we're at it - return(isNaN(c)?0:c)*b}function Qb(a,b){var c={milliseconds:0,months:0};return c.months=b.month()-a.month()+12*(b.year()-a.year()),a.clone().add(c.months,"M").isAfter(b)&&--c.months,c.milliseconds=+b-+a.clone().add(c.months,"M"),c}function Rb(a,b){var c;return a.isValid()&&b.isValid()?(b=Bb(b,a),a.isBefore(b)?c=Qb(a,b):(c=Qb(b,a),c.milliseconds=-c.milliseconds,c.months=-c.months),c):{milliseconds:0,months:0}} -// TODO: remove 'name' arg after deprecation is removed - function Sb(a,b){return function(c,d){var e,f; -//invert the arguments, but complain about it - return null===d||isNaN(+d)||(y(b,"moment()."+b+"(period, number) is deprecated. Please use moment()."+b+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),f=c,c=d,d=f),c="string"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}function Tb(b,c,d,e){var f=c._milliseconds,g=yb(c._days),h=yb(c._months);b.isValid()&&(e=null==e||e,f&&b._d.setTime(b._d.valueOf()+f*d),g&&Q(b,"Date",P(b,"Date")+g*d),h&&ja(b,P(b,"Month")+h*d),e&&a.updateOffset(b,g||h))}function Ub(a,b){var c=a.diff(b,"days",!0);return c<-6?"sameElse":c<-1?"lastWeek":c<0?"lastDay":c<1?"sameDay":c<2?"nextDay":c<7?"nextWeek":"sameElse"}function Vb(b,c){ -// We want to compare the start of today, vs this. -// Getting start-of-today depends on whether we're local/utc/offset or not. - var d=b||sb(),e=Bb(d,this).startOf("day"),f=a.calendarFormat(this,e)||"sameElse",g=c&&(z(c[f])?c[f].call(this,d):c[f]);return this.format(g||this.localeData().calendar(f,this,sb(d)))}function Wb(){return new r(this)}function Xb(a,b){var c=s(a)?a:sb(a);return!(!this.isValid()||!c.isValid())&&(b=K(p(b)?"millisecond":b),"millisecond"===b?this.valueOf()>c.valueOf():c.valueOf()<this.clone().startOf(b).valueOf())}function Yb(a,b){var c=s(a)?a:sb(a);return!(!this.isValid()||!c.isValid())&&(b=K(p(b)?"millisecond":b),"millisecond"===b?this.valueOf()<c.valueOf():this.clone().endOf(b).valueOf()<c.valueOf())}function Zb(a,b,c,d){return d=d||"()",("("===d[0]?this.isAfter(a,c):!this.isBefore(a,c))&&(")"===d[1]?this.isBefore(b,c):!this.isAfter(b,c))}function $b(a,b){var c,d=s(a)?a:sb(a);return!(!this.isValid()||!d.isValid())&&(b=K(b||"millisecond"),"millisecond"===b?this.valueOf()===d.valueOf():(c=d.valueOf(),this.clone().startOf(b).valueOf()<=c&&c<=this.clone().endOf(b).valueOf()))}function _b(a,b){return this.isSame(a,b)||this.isAfter(a,b)}function ac(a,b){return this.isSame(a,b)||this.isBefore(a,b)}function bc(a,b,c){var d,e,f,g;// 1000 -// 1000 * 60 -// 1000 * 60 * 60 -// 1000 * 60 * 60 * 24, negate dst -// 1000 * 60 * 60 * 24 * 7, negate dst - return this.isValid()?(d=Bb(a,this),d.isValid()?(e=6e4*(d.utcOffset()-this.utcOffset()),b=K(b),"year"===b||"month"===b||"quarter"===b?(g=cc(this,d),"quarter"===b?g/=3:"year"===b&&(g/=12)):(f=this-d,g="second"===b?f/1e3:"minute"===b?f/6e4:"hour"===b?f/36e5:"day"===b?(f-e)/864e5:"week"===b?(f-e)/6048e5:f),c?g:t(g)):NaN):NaN}function cc(a,b){ -// difference in months - var c,d,e=12*(b.year()-a.year())+(b.month()-a.month()), -// b is in (anchor - 1 month, anchor + 1 month) - f=a.clone().add(e,"months"); -//check for negative zero, return zero if negative zero -// linear across the month -// linear across the month - return b-f<0?(c=a.clone().add(e-1,"months"),d=(b-f)/(f-c)):(c=a.clone().add(e+1,"months"),d=(b-f)/(c-f)),-(e+d)||0}function dc(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function ec(){var a=this.clone().utc();return 0<a.year()&&a.year()<=9999?z(Date.prototype.toISOString)?this.toDate().toISOString():X(a,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):X(a,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}/** - * Return a human readable representation of a moment that can - * also be evaluated to get a new moment which is the same - * - * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects - */ - function fc(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var a="moment",b="";this.isLocal()||(a=0===this.utcOffset()?"moment.utc":"moment.parseZone",b="Z");var c="["+a+'("]',d=0<this.year()&&this.year()<=9999?"YYYY":"YYYYYY",e="-MM-DD[T]HH:mm:ss.SSS",f=b+'[")]';return this.format(c+d+e+f)}function gc(b){b||(b=this.isUtc()?a.defaultFormatUtc:a.defaultFormat);var c=X(this,b);return this.localeData().postformat(c)}function hc(a,b){return this.isValid()&&(s(a)&&a.isValid()||sb(a).isValid())?Ob({to:this,from:a}).locale(this.locale()).humanize(!b):this.localeData().invalidDate()}function ic(a){return this.from(sb(),a)}function jc(a,b){return this.isValid()&&(s(a)&&a.isValid()||sb(a).isValid())?Ob({from:this,to:a}).locale(this.locale()).humanize(!b):this.localeData().invalidDate()}function kc(a){return this.to(sb(),a)} -// If passed a locale key, it will set the locale for this -// instance. Otherwise, it will return the locale configuration -// variables for this instance. - function lc(a){var b;return void 0===a?this._locale._abbr:(b=bb(a),null!=b&&(this._locale=b),this)}function mc(){return this._locale}function nc(a){ -// the following switch intentionally omits break keywords -// to utilize falling through the cases. - switch(a=K(a)){case"year":this.month(0);/* falls through */ - case"quarter":case"month":this.date(1);/* falls through */ - case"week":case"isoWeek":case"day":case"date":this.hours(0);/* falls through */ - case"hour":this.minutes(0);/* falls through */ - case"minute":this.seconds(0);/* falls through */ - case"second":this.milliseconds(0)} -// weeks are a special case -// quarters are also special - return"week"===a&&this.weekday(0),"isoWeek"===a&&this.isoWeekday(1),"quarter"===a&&this.month(3*Math.floor(this.month()/3)),this}function oc(a){ -// 'date' is an alias for 'day', so it should be considered as such. - return a=K(a),void 0===a||"millisecond"===a?this:("date"===a&&(a="day"),this.startOf(a).add(1,"isoWeek"===a?"week":a).subtract(1,"ms"))}function pc(){return this._d.valueOf()-6e4*(this._offset||0)}function qc(){return Math.floor(this.valueOf()/1e3)}function rc(){return new Date(this.valueOf())}function sc(){var a=this;return[a.year(),a.month(),a.date(),a.hour(),a.minute(),a.second(),a.millisecond()]}function tc(){var a=this;return{years:a.year(),months:a.month(),date:a.date(),hours:a.hours(),minutes:a.minutes(),seconds:a.seconds(),milliseconds:a.milliseconds()}}function uc(){ -// new Date(NaN).toJSON() === null - return this.isValid()?this.toISOString():null}function vc(){return n(this)}function wc(){return j({},m(this))}function xc(){return m(this).overflow}function yc(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function zc(a,b){U(0,[a,a.length],0,b)} -// MOMENTS - function Ac(a){return Ec.call(this,a,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function Bc(a){return Ec.call(this,a,this.isoWeek(),this.isoWeekday(),1,4)}function Cc(){return xa(this.year(),1,4)}function Dc(){var a=this.localeData()._week;return xa(this.year(),a.dow,a.doy)}function Ec(a,b,c,d,e){var f;return null==a?wa(this,d,e).year:(f=xa(a,d,e),b>f&&(b=f),Fc.call(this,a,b,c,d,e))}function Fc(a,b,c,d,e){var f=va(a,b,c,d,e),g=ta(f.year,0,f.dayOfYear);return this.year(g.getUTCFullYear()),this.month(g.getUTCMonth()),this.date(g.getUTCDate()),this} -// MOMENTS - function Gc(a){return null==a?Math.ceil((this.month()+1)/3):this.month(3*(a-1)+this.month()%3)} -// HELPERS -// MOMENTS - function Hc(a){var b=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==a?b:this.add(a-b,"d")}function Ic(a,b){b[ge]=u(1e3*("0."+a))} -// MOMENTS - function Jc(){return this._isUTC?"UTC":""}function Kc(){return this._isUTC?"Coordinated Universal Time":""}function Lc(a){return sb(1e3*a)}function Mc(){return sb.apply(null,arguments).parseZone()}function Nc(a){return a}function Oc(a,b,c,d){var e=bb(),f=k().set(d,b);return e[c](f,a)}function Pc(a,b,c){if(f(a)&&(b=a,a=void 0),a=a||"",null!=b)return Oc(a,b,c,"month");var d,e=[];for(d=0;d<12;d++)e[d]=Oc(a,d,c,"month");return e} -// () -// (5) -// (fmt, 5) -// (fmt) -// (true) -// (true, 5) -// (true, fmt, 5) -// (true, fmt) - function Qc(a,b,c,d){"boolean"==typeof a?(f(b)&&(c=b,b=void 0),b=b||""):(b=a,c=b,a=!1,f(b)&&(c=b,b=void 0),b=b||"");var e=bb(),g=a?e._week.dow:0;if(null!=c)return Oc(b,(c+g)%7,d,"day");var h,i=[];for(h=0;h<7;h++)i[h]=Oc(b,(h+g)%7,d,"day");return i}function Rc(a,b){return Pc(a,b,"months")}function Sc(a,b){return Pc(a,b,"monthsShort")}function Tc(a,b,c){return Qc(a,b,c,"weekdays")}function Uc(a,b,c){return Qc(a,b,c,"weekdaysShort")}function Vc(a,b,c){return Qc(a,b,c,"weekdaysMin")}function Wc(){var a=this._data;return this._milliseconds=Ze(this._milliseconds),this._days=Ze(this._days),this._months=Ze(this._months),a.milliseconds=Ze(a.milliseconds),a.seconds=Ze(a.seconds),a.minutes=Ze(a.minutes),a.hours=Ze(a.hours),a.months=Ze(a.months),a.years=Ze(a.years),this}function Xc(a,b,c,d){var e=Ob(b,c);return a._milliseconds+=d*e._milliseconds,a._days+=d*e._days,a._months+=d*e._months,a._bubble()} -// supports only 2.0-style add(1, 's') or add(duration) - function Yc(a,b){return Xc(this,a,b,1)} -// supports only 2.0-style subtract(1, 's') or subtract(duration) - function Zc(a,b){return Xc(this,a,b,-1)}function $c(a){return a<0?Math.floor(a):Math.ceil(a)}function _c(){var a,b,c,d,e,f=this._milliseconds,g=this._days,h=this._months,i=this._data; -// if we have a mix of positive and negative values, bubble down first -// check: https://github.com/moment/moment/issues/2166 -// The following code bubbles up values, see the tests for -// examples of what that means. -// convert days to months -// 12 months -> 1 year - return f>=0&&g>=0&&h>=0||f<=0&&g<=0&&h<=0||(f+=864e5*$c(bd(h)+g),g=0,h=0),i.milliseconds=f%1e3,a=t(f/1e3),i.seconds=a%60,b=t(a/60),i.minutes=b%60,c=t(b/60),i.hours=c%24,g+=t(c/24),e=t(ad(g)),h+=e,g-=$c(bd(e)),d=t(h/12),h%=12,i.days=g,i.months=h,i.years=d,this}function ad(a){ -// 400 years have 146097 days (taking into account leap year rules) -// 400 years have 12 months === 4800 - return 4800*a/146097}function bd(a){ -// the reverse of daysToMonths - return 146097*a/4800}function cd(a){var b,c,d=this._milliseconds;if(a=K(a),"month"===a||"year"===a)return b=this._days+d/864e5,c=this._months+ad(b),"month"===a?c:c/12;switch( -// handle milliseconds separately because of floating point math errors (issue #1867) - b=this._days+Math.round(bd(this._months)),a){case"week":return b/7+d/6048e5;case"day":return b+d/864e5;case"hour":return 24*b+d/36e5;case"minute":return 1440*b+d/6e4;case"second":return 86400*b+d/1e3; -// Math.floor prevents floating point math errors here - case"millisecond":return Math.floor(864e5*b)+d;default:throw new Error("Unknown unit "+a)}} -// TODO: Use this.as('ms')? - function dd(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*u(this._months/12)}function ed(a){return function(){return this.as(a)}}function fd(a){return a=K(a),this[a+"s"]()}function gd(a){return function(){return this._data[a]}}function hd(){return t(this.days()/7)} -// helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize - function id(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function jd(a,b,c){var d=Ob(a).abs(),e=of(d.as("s")),f=of(d.as("m")),g=of(d.as("h")),h=of(d.as("d")),i=of(d.as("M")),j=of(d.as("y")),k=e<pf.s&&["s",e]||f<=1&&["m"]||f<pf.m&&["mm",f]||g<=1&&["h"]||g<pf.h&&["hh",g]||h<=1&&["d"]||h<pf.d&&["dd",h]||i<=1&&["M"]||i<pf.M&&["MM",i]||j<=1&&["y"]||["yy",j];return k[2]=b,k[3]=+a>0,k[4]=c,id.apply(null,k)} -// This function allows you to set the rounding function for relative time strings - function kd(a){return void 0===a?of:"function"==typeof a&&(of=a,!0)} -// This function allows you to set a threshold for relative time strings - function ld(a,b){return void 0!==pf[a]&&(void 0===b?pf[a]:(pf[a]=b,!0))}function md(a){var b=this.localeData(),c=jd(this,!a,b);return a&&(c=b.pastFuture(+this,c)),b.postformat(c)}function nd(){ -// for ISO strings we do not use the normal bubbling rules: -// * milliseconds bubble up until they become hours -// * days do not bubble at all -// * months bubble up until they become years -// This is because there is no context-free conversion between hours and days -// (think of clock changes) -// and also not between days and months (28-31 days per month) - var a,b,c,d=qf(this._milliseconds)/1e3,e=qf(this._days),f=qf(this._months); -// 3600 seconds -> 60 minutes -> 1 hour - a=t(d/60),b=t(a/60),d%=60,a%=60, -// 12 months -> 1 year - c=t(f/12),f%=12; -// inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js - var g=c,h=f,i=e,j=b,k=a,l=d,m=this.asSeconds();return m?(m<0?"-":"")+"P"+(g?g+"Y":"")+(h?h+"M":"")+(i?i+"D":"")+(j||k||l?"T":"")+(j?j+"H":"")+(k?k+"M":"")+(l?l+"S":""):"P0D"}var od,pd;pd=Array.prototype.some?Array.prototype.some:function(a){for(var b=Object(this),c=b.length>>>0,d=0;d<c;d++)if(d in b&&a.call(this,b[d],d,b))return!0;return!1};var qd=pd,rd=a.momentProperties=[],sd=!1,td={};a.suppressDeprecationWarnings=!1,a.deprecationHandler=null;var ud;ud=Object.keys?Object.keys:function(a){var b,c=[];for(b in a)i(a,b)&&c.push(b);return c};var vd,wd=ud,xd={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},yd={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},zd="Invalid date",Ad="%d",Bd=/\d{1,2}/,Cd={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Dd={},Ed={},Fd=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Gd=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Hd={},Id={},Jd=/\d/,Kd=/\d\d/,Ld=/\d{3}/,Md=/\d{4}/,Nd=/[+-]?\d{6}/,Od=/\d\d?/,Pd=/\d\d\d\d?/,Qd=/\d\d\d\d\d\d?/,Rd=/\d{1,3}/,Sd=/\d{1,4}/,Td=/[+-]?\d{1,6}/,Ud=/\d+/,Vd=/[+-]?\d+/,Wd=/Z|[+-]\d\d:?\d\d/gi,Xd=/Z|[+-]\d\d(?::?\d\d)?/gi,Yd=/[+-]?\d+(\.\d{1,3})?/,Zd=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,$d={},_d={},ae=0,be=1,ce=2,de=3,ee=4,fe=5,ge=6,he=7,ie=8;vd=Array.prototype.indexOf?Array.prototype.indexOf:function(a){ -// I know - var b;for(b=0;b<this.length;++b)if(this[b]===a)return b;return-1};var je=vd; -// FORMATTING - U("M",["MM",2],"Mo",function(){return this.month()+1}),U("MMM",0,0,function(a){return this.localeData().monthsShort(this,a)}),U("MMMM",0,0,function(a){return this.localeData().months(this,a)}), -// ALIASES - J("month","M"), -// PRIORITY - M("month",8), -// PARSING - Z("M",Od),Z("MM",Od,Kd),Z("MMM",function(a,b){return b.monthsShortRegex(a)}),Z("MMMM",function(a,b){return b.monthsRegex(a)}),ba(["M","MM"],function(a,b){b[be]=u(a)-1}),ba(["MMM","MMMM"],function(a,b,c,d){var e=c._locale.monthsParse(a,d,c._strict); -// if we didn't find a month name, mark the date as invalid. - null!=e?b[be]=e:m(c).invalidMonth=a}); -// LOCALES - var ke=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,le="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),me="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),ne=Zd,oe=Zd; -// FORMATTING - U("Y",0,0,function(){var a=this.year();return a<=9999?""+a:"+"+a}),U(0,["YY",2],0,function(){return this.year()%100}),U(0,["YYYY",4],0,"year"),U(0,["YYYYY",5],0,"year"),U(0,["YYYYYY",6,!0],0,"year"), -// ALIASES - J("year","y"), -// PRIORITIES - M("year",1), -// PARSING - Z("Y",Vd),Z("YY",Od,Kd),Z("YYYY",Sd,Md),Z("YYYYY",Td,Nd),Z("YYYYYY",Td,Nd),ba(["YYYYY","YYYYYY"],ae),ba("YYYY",function(b,c){c[ae]=2===b.length?a.parseTwoDigitYear(b):u(b)}),ba("YY",function(b,c){c[ae]=a.parseTwoDigitYear(b)}),ba("Y",function(a,b){b[ae]=parseInt(a,10)}), -// HOOKS - a.parseTwoDigitYear=function(a){return u(a)+(u(a)>68?1900:2e3)}; -// MOMENTS - var pe=O("FullYear",!0); -// FORMATTING - U("w",["ww",2],"wo","week"),U("W",["WW",2],"Wo","isoWeek"), -// ALIASES - J("week","w"),J("isoWeek","W"), -// PRIORITIES - M("week",5),M("isoWeek",5), -// PARSING - Z("w",Od),Z("ww",Od,Kd),Z("W",Od),Z("WW",Od,Kd),ca(["w","ww","W","WW"],function(a,b,c,d){b[d.substr(0,1)]=u(a)});var qe={dow:0,// Sunday is the first day of the week. - doy:6}; -// FORMATTING - U("d",0,"do","day"),U("dd",0,0,function(a){return this.localeData().weekdaysMin(this,a)}),U("ddd",0,0,function(a){return this.localeData().weekdaysShort(this,a)}),U("dddd",0,0,function(a){return this.localeData().weekdays(this,a)}),U("e",0,0,"weekday"),U("E",0,0,"isoWeekday"), -// ALIASES - J("day","d"),J("weekday","e"),J("isoWeekday","E"), -// PRIORITY - M("day",11),M("weekday",11),M("isoWeekday",11), -// PARSING - Z("d",Od),Z("e",Od),Z("E",Od),Z("dd",function(a,b){return b.weekdaysMinRegex(a)}),Z("ddd",function(a,b){return b.weekdaysShortRegex(a)}),Z("dddd",function(a,b){return b.weekdaysRegex(a)}),ca(["dd","ddd","dddd"],function(a,b,c,d){var e=c._locale.weekdaysParse(a,d,c._strict); -// if we didn't get a weekday name, mark the date as invalid - null!=e?b.d=e:m(c).invalidWeekday=a}),ca(["d","e","E"],function(a,b,c,d){b[d]=u(a)}); -// LOCALES - var re="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),se="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),te="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ue=Zd,ve=Zd,we=Zd;U("H",["HH",2],0,"hour"),U("h",["hh",2],0,Ra),U("k",["kk",2],0,Sa),U("hmm",0,0,function(){return""+Ra.apply(this)+T(this.minutes(),2)}),U("hmmss",0,0,function(){return""+Ra.apply(this)+T(this.minutes(),2)+T(this.seconds(),2)}),U("Hmm",0,0,function(){return""+this.hours()+T(this.minutes(),2)}),U("Hmmss",0,0,function(){return""+this.hours()+T(this.minutes(),2)+T(this.seconds(),2)}),Ta("a",!0),Ta("A",!1), -// ALIASES - J("hour","h"), -// PRIORITY - M("hour",13),Z("a",Ua),Z("A",Ua),Z("H",Od),Z("h",Od),Z("HH",Od,Kd),Z("hh",Od,Kd),Z("hmm",Pd),Z("hmmss",Qd),Z("Hmm",Pd),Z("Hmmss",Qd),ba(["H","HH"],de),ba(["a","A"],function(a,b,c){c._isPm=c._locale.isPM(a),c._meridiem=a}),ba(["h","hh"],function(a,b,c){b[de]=u(a),m(c).bigHour=!0}),ba("hmm",function(a,b,c){var d=a.length-2;b[de]=u(a.substr(0,d)),b[ee]=u(a.substr(d)),m(c).bigHour=!0}),ba("hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[de]=u(a.substr(0,d)),b[ee]=u(a.substr(d,2)),b[fe]=u(a.substr(e)),m(c).bigHour=!0}),ba("Hmm",function(a,b,c){var d=a.length-2;b[de]=u(a.substr(0,d)),b[ee]=u(a.substr(d))}),ba("Hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[de]=u(a.substr(0,d)),b[ee]=u(a.substr(d,2)),b[fe]=u(a.substr(e))});var xe,ye=/[ap]\.?m?\.?/i,ze=O("Hours",!0),Ae={calendar:xd,longDateFormat:yd,invalidDate:zd,ordinal:Ad,ordinalParse:Bd,relativeTime:Cd,months:le,monthsShort:me,week:qe,weekdays:re,weekdaysMin:te,weekdaysShort:se,meridiemParse:ye},Be={},Ce={},De=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ee=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Fe=/Z|[+-]\d\d(?::?\d\d)?/,Ge=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/], -// YYYYMM is NOT allowed by the standard - ["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],He=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Ie=/^\/?Date\((\-?\d+)/i;a.createFromInputFallback=x("value provided is not in a recognized ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(a){a._d=new Date(a._i+(a._useUTC?" UTC":""))}), -// constant that refers to the ISO standard - a.ISO_8601=function(){};var Je=x("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var a=sb.apply(null,arguments);return this.isValid()&&a.isValid()?a<this?this:a:o()}),Ke=x("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var a=sb.apply(null,arguments);return this.isValid()&&a.isValid()?a>this?this:a:o()}),Le=function(){return Date.now?Date.now():+new Date};zb("Z",":"),zb("ZZ",""), -// PARSING - Z("Z",Xd),Z("ZZ",Xd),ba(["Z","ZZ"],function(a,b,c){c._useUTC=!0,c._tzm=Ab(Xd,a)}); -// HELPERS -// timezone chunker -// '+10:00' > ['10', '00'] -// '-1530' > ['-15', '30'] - var Me=/([\+\-]|\d\d)/gi; -// HOOKS -// This function will be called whenever a moment is mutated. -// It is intended to keep the offset in sync with the timezone. - a.updateOffset=function(){}; -// ASP.NET json date format regex - var Ne=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Oe=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;Ob.fn=wb.prototype;var Pe=Sb(1,"add"),Qe=Sb(-1,"subtract");a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",a.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Re=x("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(a){return void 0===a?this.localeData():this.locale(a)}); -// FORMATTING - U(0,["gg",2],0,function(){return this.weekYear()%100}),U(0,["GG",2],0,function(){return this.isoWeekYear()%100}),zc("gggg","weekYear"),zc("ggggg","weekYear"),zc("GGGG","isoWeekYear"),zc("GGGGG","isoWeekYear"), -// ALIASES - J("weekYear","gg"),J("isoWeekYear","GG"), -// PRIORITY - M("weekYear",1),M("isoWeekYear",1), -// PARSING - Z("G",Vd),Z("g",Vd),Z("GG",Od,Kd),Z("gg",Od,Kd),Z("GGGG",Sd,Md),Z("gggg",Sd,Md),Z("GGGGG",Td,Nd),Z("ggggg",Td,Nd),ca(["gggg","ggggg","GGGG","GGGGG"],function(a,b,c,d){b[d.substr(0,2)]=u(a)}),ca(["gg","GG"],function(b,c,d,e){c[e]=a.parseTwoDigitYear(b)}), -// FORMATTING - U("Q",0,"Qo","quarter"), -// ALIASES - J("quarter","Q"), -// PRIORITY - M("quarter",7), -// PARSING - Z("Q",Jd),ba("Q",function(a,b){b[be]=3*(u(a)-1)}), -// FORMATTING - U("D",["DD",2],"Do","date"), -// ALIASES - J("date","D"), -// PRIOROITY - M("date",9), -// PARSING - Z("D",Od),Z("DD",Od,Kd),Z("Do",function(a,b){return a?b._ordinalParse:b._ordinalParseLenient}),ba(["D","DD"],ce),ba("Do",function(a,b){b[ce]=u(a.match(Od)[0],10)}); -// MOMENTS - var Se=O("Date",!0); -// FORMATTING - U("DDD",["DDDD",3],"DDDo","dayOfYear"), -// ALIASES - J("dayOfYear","DDD"), -// PRIORITY - M("dayOfYear",4), -// PARSING - Z("DDD",Rd),Z("DDDD",Ld),ba(["DDD","DDDD"],function(a,b,c){c._dayOfYear=u(a)}), -// FORMATTING - U("m",["mm",2],0,"minute"), -// ALIASES - J("minute","m"), -// PRIORITY - M("minute",14), -// PARSING - Z("m",Od),Z("mm",Od,Kd),ba(["m","mm"],ee); -// MOMENTS - var Te=O("Minutes",!1); -// FORMATTING - U("s",["ss",2],0,"second"), -// ALIASES - J("second","s"), -// PRIORITY - M("second",15), -// PARSING - Z("s",Od),Z("ss",Od,Kd),ba(["s","ss"],fe); -// MOMENTS - var Ue=O("Seconds",!1); -// FORMATTING - U("S",0,0,function(){return~~(this.millisecond()/100)}),U(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),U(0,["SSS",3],0,"millisecond"),U(0,["SSSS",4],0,function(){return 10*this.millisecond()}),U(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),U(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),U(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),U(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),U(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}), -// ALIASES - J("millisecond","ms"), -// PRIORITY - M("millisecond",16), -// PARSING - Z("S",Rd,Jd),Z("SS",Rd,Kd),Z("SSS",Rd,Ld);var Ve;for(Ve="SSSS";Ve.length<=9;Ve+="S")Z(Ve,Ud);for(Ve="S";Ve.length<=9;Ve+="S")ba(Ve,Ic); -// MOMENTS - var We=O("Milliseconds",!1); -// FORMATTING - U("z",0,0,"zoneAbbr"),U("zz",0,0,"zoneName");var Xe=r.prototype;Xe.add=Pe,Xe.calendar=Vb,Xe.clone=Wb,Xe.diff=bc,Xe.endOf=oc,Xe.format=gc,Xe.from=hc,Xe.fromNow=ic,Xe.to=jc,Xe.toNow=kc,Xe.get=R,Xe.invalidAt=xc,Xe.isAfter=Xb,Xe.isBefore=Yb,Xe.isBetween=Zb,Xe.isSame=$b,Xe.isSameOrAfter=_b,Xe.isSameOrBefore=ac,Xe.isValid=vc,Xe.lang=Re,Xe.locale=lc,Xe.localeData=mc,Xe.max=Ke,Xe.min=Je,Xe.parsingFlags=wc,Xe.set=S,Xe.startOf=nc,Xe.subtract=Qe,Xe.toArray=sc,Xe.toObject=tc,Xe.toDate=rc,Xe.toISOString=ec,Xe.inspect=fc,Xe.toJSON=uc,Xe.toString=dc,Xe.unix=qc,Xe.valueOf=pc,Xe.creationData=yc, -// Year - Xe.year=pe,Xe.isLeapYear=ra, -// Week Year - Xe.weekYear=Ac,Xe.isoWeekYear=Bc, -// Quarter - Xe.quarter=Xe.quarters=Gc, -// Month - Xe.month=ka,Xe.daysInMonth=la, -// Week - Xe.week=Xe.weeks=Ba,Xe.isoWeek=Xe.isoWeeks=Ca,Xe.weeksInYear=Dc,Xe.isoWeeksInYear=Cc, -// Day - Xe.date=Se,Xe.day=Xe.days=Ka,Xe.weekday=La,Xe.isoWeekday=Ma,Xe.dayOfYear=Hc, -// Hour - Xe.hour=Xe.hours=ze, -// Minute - Xe.minute=Xe.minutes=Te, -// Second - Xe.second=Xe.seconds=Ue, -// Millisecond - Xe.millisecond=Xe.milliseconds=We, -// Offset - Xe.utcOffset=Db,Xe.utc=Fb,Xe.local=Gb,Xe.parseZone=Hb,Xe.hasAlignedHourOffset=Ib,Xe.isDST=Jb,Xe.isLocal=Lb,Xe.isUtcOffset=Mb,Xe.isUtc=Nb,Xe.isUTC=Nb, -// Timezone - Xe.zoneAbbr=Jc,Xe.zoneName=Kc, -// Deprecations - Xe.dates=x("dates accessor is deprecated. Use date instead.",Se),Xe.months=x("months accessor is deprecated. Use month instead",ka),Xe.years=x("years accessor is deprecated. Use year instead",pe),Xe.zone=x("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Eb),Xe.isDSTShifted=x("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Kb);var Ye=C.prototype;Ye.calendar=D,Ye.longDateFormat=E,Ye.invalidDate=F,Ye.ordinal=G,Ye.preparse=Nc,Ye.postformat=Nc,Ye.relativeTime=H,Ye.pastFuture=I,Ye.set=A, -// Month - Ye.months=fa,Ye.monthsShort=ga,Ye.monthsParse=ia,Ye.monthsRegex=na,Ye.monthsShortRegex=ma, -// Week - Ye.week=ya,Ye.firstDayOfYear=Aa,Ye.firstDayOfWeek=za, -// Day of Week - Ye.weekdays=Fa,Ye.weekdaysMin=Ha,Ye.weekdaysShort=Ga,Ye.weekdaysParse=Ja,Ye.weekdaysRegex=Na,Ye.weekdaysShortRegex=Oa,Ye.weekdaysMinRegex=Pa, -// Hours - Ye.isPM=Va,Ye.meridiem=Wa,$a("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(a){var b=a%10,c=1===u(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}), -// Side effect imports - a.lang=x("moment.lang is deprecated. Use moment.locale instead.",$a),a.langData=x("moment.langData is deprecated. Use moment.localeData instead.",bb);var Ze=Math.abs,$e=ed("ms"),_e=ed("s"),af=ed("m"),bf=ed("h"),cf=ed("d"),df=ed("w"),ef=ed("M"),ff=ed("y"),gf=gd("milliseconds"),hf=gd("seconds"),jf=gd("minutes"),kf=gd("hours"),lf=gd("days"),mf=gd("months"),nf=gd("years"),of=Math.round,pf={s:45,// seconds to minute - m:45,// minutes to hour - h:22,// hours to day - d:26,// days to month - M:11},qf=Math.abs,rf=wb.prototype; -// Deprecations -// Side effect imports -// FORMATTING -// PARSING -// Side effect imports - return rf.abs=Wc,rf.add=Yc,rf.subtract=Zc,rf.as=cd,rf.asMilliseconds=$e,rf.asSeconds=_e,rf.asMinutes=af,rf.asHours=bf,rf.asDays=cf,rf.asWeeks=df,rf.asMonths=ef,rf.asYears=ff,rf.valueOf=dd,rf._bubble=_c,rf.get=fd,rf.milliseconds=gf,rf.seconds=hf,rf.minutes=jf,rf.hours=kf,rf.days=lf,rf.weeks=hd,rf.months=mf,rf.years=nf,rf.humanize=md,rf.toISOString=nd,rf.toString=nd,rf.toJSON=nd,rf.locale=lc,rf.localeData=mc,rf.toIsoString=x("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",nd),rf.lang=Re,U("X",0,0,"unix"),U("x",0,0,"valueOf"),Z("x",Vd),Z("X",Yd),ba("X",function(a,b,c){c._d=new Date(1e3*parseFloat(a,10))}),ba("x",function(a,b,c){c._d=new Date(u(a))}),a.version="2.17.1",b(sb),a.fn=Xe,a.min=ub,a.max=vb,a.now=Le,a.utc=k,a.unix=Lc,a.months=Rc,a.isDate=g,a.locale=$a,a.invalid=o,a.duration=Ob,a.isMoment=s,a.weekdays=Tc,a.parseZone=Mc,a.localeData=bb,a.isDuration=xb,a.monthsShort=Sc,a.weekdaysMin=Vc,a.defineLocale=_a,a.updateLocale=ab,a.locales=cb,a.weekdaysShort=Uc,a.normalizeUnits=K,a.relativeTimeRounding=kd,a.relativeTimeThreshold=ld,a.calendarFormat=Ub,a.prototype=Xe,a}); \ No newline at end of file +/** + * Moment.js + * + * Version: 2.24.0 + */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){"use strict";var e,i;function c(){return e.apply(null,arguments)}function o(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function u(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function l(e){return void 0===e}function h(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function d(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function f(e,t){var n,s=[];for(n=0;n<e.length;++n)s.push(t(e[n],n));return s}function m(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function _(e,t){for(var n in t)m(t,n)&&(e[n]=t[n]);return m(t,"toString")&&(e.toString=t.toString),m(t,"valueOf")&&(e.valueOf=t.valueOf),e}function y(e,t,n,s){return Tt(e,t,n,s,!0).utc()}function g(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function v(e){if(null==e._isValid){var t=g(e),n=i.call(t.parsedDateParts,function(e){return null!=e}),s=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(s=s&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return s;e._isValid=s}return e._isValid}function p(e){var t=y(NaN);return null!=e?_(g(t),e):g(t).userInvalidated=!0,t}i=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),n=t.length>>>0,s=0;s<n;s++)if(s in t&&e.call(this,t[s],s,t))return!0;return!1};var r=c.momentProperties=[];function w(e,t){var n,s,i;if(l(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),l(t._i)||(e._i=t._i),l(t._f)||(e._f=t._f),l(t._l)||(e._l=t._l),l(t._strict)||(e._strict=t._strict),l(t._tzm)||(e._tzm=t._tzm),l(t._isUTC)||(e._isUTC=t._isUTC),l(t._offset)||(e._offset=t._offset),l(t._pf)||(e._pf=g(t)),l(t._locale)||(e._locale=t._locale),0<r.length)for(n=0;n<r.length;n++)l(i=t[s=r[n]])||(e[s]=i);return e}var t=!1;function M(e){w(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===t&&(t=!0,c.updateOffset(this),t=!1)}function k(e){return e instanceof M||null!=e&&null!=e._isAMomentObject}function S(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function D(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=S(t)),n}function a(e,t,n){var s,i=Math.min(e.length,t.length),r=Math.abs(e.length-t.length),a=0;for(s=0;s<i;s++)(n&&e[s]!==t[s]||!n&&D(e[s])!==D(t[s]))&&a++;return a+r}function Y(e){!1===c.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function n(i,r){var a=!0;return _(function(){if(null!=c.deprecationHandler&&c.deprecationHandler(null,i),a){for(var e,t=[],n=0;n<arguments.length;n++){if(e="","object"==typeof arguments[n]){for(var s in e+="\n["+n+"] ",arguments[0])e+=s+": "+arguments[0][s]+", ";e=e.slice(0,-2)}else e=arguments[n];t.push(e)}Y(i+"\nArguments: "+Array.prototype.slice.call(t).join("")+"\n"+(new Error).stack),a=!1}return r.apply(this,arguments)},r)}var s,O={};function T(e,t){null!=c.deprecationHandler&&c.deprecationHandler(e,t),O[e]||(Y(t),O[e]=!0)}function b(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function x(e,t){var n,s=_({},e);for(n in t)m(t,n)&&(u(e[n])&&u(t[n])?(s[n]={},_(s[n],e[n]),_(s[n],t[n])):null!=t[n]?s[n]=t[n]:delete s[n]);for(n in e)m(e,n)&&!m(t,n)&&u(e[n])&&(s[n]=_({},s[n]));return s}function P(e){null!=e&&this.set(e)}c.suppressDeprecationWarnings=!1,c.deprecationHandler=null,s=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)m(e,t)&&n.push(t);return n};var W={};function C(e,t){var n=e.toLowerCase();W[n]=W[n+"s"]=W[t]=e}function H(e){return"string"==typeof e?W[e]||W[e.toLowerCase()]:void 0}function R(e){var t,n,s={};for(n in e)m(e,n)&&(t=H(n))&&(s[t]=e[n]);return s}var U={};function F(e,t){U[e]=t}function L(e,t,n){var s=""+Math.abs(e),i=t-s.length;return(0<=e?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+s}var N=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,G=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,V={},E={};function I(e,t,n,s){var i=s;"string"==typeof s&&(i=function(){return this[s]()}),e&&(E[e]=i),t&&(E[t[0]]=function(){return L(i.apply(this,arguments),t[1],t[2])}),n&&(E[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function A(e,t){return e.isValid()?(t=j(t,e.localeData()),V[t]=V[t]||function(s){var e,i,t,r=s.match(N);for(e=0,i=r.length;e<i;e++)E[r[e]]?r[e]=E[r[e]]:r[e]=(t=r[e]).match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"");return function(e){var t,n="";for(t=0;t<i;t++)n+=b(r[t])?r[t].call(e,s):r[t];return n}}(t),V[t](e)):e.localeData().invalidDate()}function j(e,t){var n=5;function s(e){return t.longDateFormat(e)||e}for(G.lastIndex=0;0<=n&&G.test(e);)e=e.replace(G,s),G.lastIndex=0,n-=1;return e}var Z=/\d/,z=/\d\d/,$=/\d{3}/,q=/\d{4}/,J=/[+-]?\d{6}/,B=/\d\d?/,Q=/\d\d\d\d?/,X=/\d\d\d\d\d\d?/,K=/\d{1,3}/,ee=/\d{1,4}/,te=/[+-]?\d{1,6}/,ne=/\d+/,se=/[+-]?\d+/,ie=/Z|[+-]\d\d:?\d\d/gi,re=/Z|[+-]\d\d(?::?\d\d)?/gi,ae=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,oe={};function ue(e,n,s){oe[e]=b(n)?n:function(e,t){return e&&s?s:n}}function le(e,t){return m(oe,e)?oe[e](t._strict,t._locale):new RegExp(he(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,s,i){return t||n||s||i})))}function he(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var de={};function ce(e,n){var t,s=n;for("string"==typeof e&&(e=[e]),h(n)&&(s=function(e,t){t[n]=D(e)}),t=0;t<e.length;t++)de[e[t]]=s}function fe(e,i){ce(e,function(e,t,n,s){n._w=n._w||{},i(e,n._w,n,s)})}var me=0,_e=1,ye=2,ge=3,ve=4,pe=5,we=6,Me=7,ke=8;function Se(e){return De(e)?366:365}function De(e){return e%4==0&&e%100!=0||e%400==0}I("Y",0,0,function(){var e=this.year();return e<=9999?""+e:"+"+e}),I(0,["YY",2],0,function(){return this.year()%100}),I(0,["YYYY",4],0,"year"),I(0,["YYYYY",5],0,"year"),I(0,["YYYYYY",6,!0],0,"year"),C("year","y"),F("year",1),ue("Y",se),ue("YY",B,z),ue("YYYY",ee,q),ue("YYYYY",te,J),ue("YYYYYY",te,J),ce(["YYYYY","YYYYYY"],me),ce("YYYY",function(e,t){t[me]=2===e.length?c.parseTwoDigitYear(e):D(e)}),ce("YY",function(e,t){t[me]=c.parseTwoDigitYear(e)}),ce("Y",function(e,t){t[me]=parseInt(e,10)}),c.parseTwoDigitYear=function(e){return D(e)+(68<D(e)?1900:2e3)};var Ye,Oe=Te("FullYear",!0);function Te(t,n){return function(e){return null!=e?(xe(this,t,e),c.updateOffset(this,n),this):be(this,t)}}function be(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function xe(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&De(e.year())&&1===e.month()&&29===e.date()?e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),Pe(n,e.month())):e._d["set"+(e._isUTC?"UTC":"")+t](n))}function Pe(e,t){if(isNaN(e)||isNaN(t))return NaN;var n,s=(t%(n=12)+n)%n;return e+=(t-s)/12,1===s?De(e)?29:28:31-s%7%2}Ye=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},I("M",["MM",2],"Mo",function(){return this.month()+1}),I("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),I("MMMM",0,0,function(e){return this.localeData().months(this,e)}),C("month","M"),F("month",8),ue("M",B),ue("MM",B,z),ue("MMM",function(e,t){return t.monthsShortRegex(e)}),ue("MMMM",function(e,t){return t.monthsRegex(e)}),ce(["M","MM"],function(e,t){t[_e]=D(e)-1}),ce(["MMM","MMMM"],function(e,t,n,s){var i=n._locale.monthsParse(e,s,n._strict);null!=i?t[_e]=i:g(n).invalidMonth=e});var We=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Ce="January_February_March_April_May_June_July_August_September_October_November_December".split("_");var He="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_");function Re(e,t){var n;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=D(t);else if(!h(t=e.localeData().monthsParse(t)))return e;return n=Math.min(e.date(),Pe(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function Ue(e){return null!=e?(Re(this,e),c.updateOffset(this,!0),this):be(this,"Month")}var Fe=ae;var Le=ae;function Ne(){function e(e,t){return t.length-e.length}var t,n,s=[],i=[],r=[];for(t=0;t<12;t++)n=y([2e3,t]),s.push(this.monthsShort(n,"")),i.push(this.months(n,"")),r.push(this.months(n,"")),r.push(this.monthsShort(n,""));for(s.sort(e),i.sort(e),r.sort(e),t=0;t<12;t++)s[t]=he(s[t]),i[t]=he(i[t]);for(t=0;t<24;t++)r[t]=he(r[t]);this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+s.join("|")+")","i")}function Ge(e){var t;if(e<100&&0<=e){var n=Array.prototype.slice.call(arguments);n[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)}else t=new Date(Date.UTC.apply(null,arguments));return t}function Ve(e,t,n){var s=7+t-n;return-((7+Ge(e,0,s).getUTCDay()-t)%7)+s-1}function Ee(e,t,n,s,i){var r,a,o=1+7*(t-1)+(7+n-s)%7+Ve(e,s,i);return a=o<=0?Se(r=e-1)+o:o>Se(e)?(r=e+1,o-Se(e)):(r=e,o),{year:r,dayOfYear:a}}function Ie(e,t,n){var s,i,r=Ve(e.year(),t,n),a=Math.floor((e.dayOfYear()-r-1)/7)+1;return a<1?s=a+Ae(i=e.year()-1,t,n):a>Ae(e.year(),t,n)?(s=a-Ae(e.year(),t,n),i=e.year()+1):(i=e.year(),s=a),{week:s,year:i}}function Ae(e,t,n){var s=Ve(e,t,n),i=Ve(e+1,t,n);return(Se(e)-s+i)/7}I("w",["ww",2],"wo","week"),I("W",["WW",2],"Wo","isoWeek"),C("week","w"),C("isoWeek","W"),F("week",5),F("isoWeek",5),ue("w",B),ue("ww",B,z),ue("W",B),ue("WW",B,z),fe(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=D(e)});function je(e,t){return e.slice(t,7).concat(e.slice(0,t))}I("d",0,"do","day"),I("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),I("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),I("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),I("e",0,0,"weekday"),I("E",0,0,"isoWeekday"),C("day","d"),C("weekday","e"),C("isoWeekday","E"),F("day",11),F("weekday",11),F("isoWeekday",11),ue("d",B),ue("e",B),ue("E",B),ue("dd",function(e,t){return t.weekdaysMinRegex(e)}),ue("ddd",function(e,t){return t.weekdaysShortRegex(e)}),ue("dddd",function(e,t){return t.weekdaysRegex(e)}),fe(["dd","ddd","dddd"],function(e,t,n,s){var i=n._locale.weekdaysParse(e,s,n._strict);null!=i?t.d=i:g(n).invalidWeekday=e}),fe(["d","e","E"],function(e,t,n,s){t[s]=D(e)});var Ze="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_");var ze="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");var $e="Su_Mo_Tu_We_Th_Fr_Sa".split("_");var qe=ae;var Je=ae;var Be=ae;function Qe(){function e(e,t){return t.length-e.length}var t,n,s,i,r,a=[],o=[],u=[],l=[];for(t=0;t<7;t++)n=y([2e3,1]).day(t),s=this.weekdaysMin(n,""),i=this.weekdaysShort(n,""),r=this.weekdays(n,""),a.push(s),o.push(i),u.push(r),l.push(s),l.push(i),l.push(r);for(a.sort(e),o.sort(e),u.sort(e),l.sort(e),t=0;t<7;t++)o[t]=he(o[t]),u[t]=he(u[t]),l[t]=he(l[t]);this._weekdaysRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Xe(){return this.hours()%12||12}function Ke(e,t){I(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function et(e,t){return t._meridiemParse}I("H",["HH",2],0,"hour"),I("h",["hh",2],0,Xe),I("k",["kk",2],0,function(){return this.hours()||24}),I("hmm",0,0,function(){return""+Xe.apply(this)+L(this.minutes(),2)}),I("hmmss",0,0,function(){return""+Xe.apply(this)+L(this.minutes(),2)+L(this.seconds(),2)}),I("Hmm",0,0,function(){return""+this.hours()+L(this.minutes(),2)}),I("Hmmss",0,0,function(){return""+this.hours()+L(this.minutes(),2)+L(this.seconds(),2)}),Ke("a",!0),Ke("A",!1),C("hour","h"),F("hour",13),ue("a",et),ue("A",et),ue("H",B),ue("h",B),ue("k",B),ue("HH",B,z),ue("hh",B,z),ue("kk",B,z),ue("hmm",Q),ue("hmmss",X),ue("Hmm",Q),ue("Hmmss",X),ce(["H","HH"],ge),ce(["k","kk"],function(e,t,n){var s=D(e);t[ge]=24===s?0:s}),ce(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),ce(["h","hh"],function(e,t,n){t[ge]=D(e),g(n).bigHour=!0}),ce("hmm",function(e,t,n){var s=e.length-2;t[ge]=D(e.substr(0,s)),t[ve]=D(e.substr(s)),g(n).bigHour=!0}),ce("hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[ge]=D(e.substr(0,s)),t[ve]=D(e.substr(s,2)),t[pe]=D(e.substr(i)),g(n).bigHour=!0}),ce("Hmm",function(e,t,n){var s=e.length-2;t[ge]=D(e.substr(0,s)),t[ve]=D(e.substr(s))}),ce("Hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[ge]=D(e.substr(0,s)),t[ve]=D(e.substr(s,2)),t[pe]=D(e.substr(i))});var tt,nt=Te("Hours",!0),st={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Ce,monthsShort:He,week:{dow:0,doy:6},weekdays:Ze,weekdaysMin:$e,weekdaysShort:ze,meridiemParse:/[ap]\.?m?\.?/i},it={},rt={};function at(e){return e?e.toLowerCase().replace("_","-"):e}function ot(e){var t=null;if(!it[e]&&"undefined"!=typeof module&&module&&module.exports)try{t=tt._abbr,require("./locale/"+e),ut(t)}catch(e){}return it[e]}function ut(e,t){var n;return e&&((n=l(t)?ht(e):lt(e,t))?tt=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),tt._abbr}function lt(e,t){if(null===t)return delete it[e],null;var n,s=st;if(t.abbr=e,null!=it[e])T("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=it[e]._config;else if(null!=t.parentLocale)if(null!=it[t.parentLocale])s=it[t.parentLocale]._config;else{if(null==(n=ot(t.parentLocale)))return rt[t.parentLocale]||(rt[t.parentLocale]=[]),rt[t.parentLocale].push({name:e,config:t}),null;s=n._config}return it[e]=new P(x(s,t)),rt[e]&&rt[e].forEach(function(e){lt(e.name,e.config)}),ut(e),it[e]}function ht(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return tt;if(!o(e)){if(t=ot(e))return t;e=[e]}return function(e){for(var t,n,s,i,r=0;r<e.length;){for(t=(i=at(e[r]).split("-")).length,n=(n=at(e[r+1]))?n.split("-"):null;0<t;){if(s=ot(i.slice(0,t).join("-")))return s;if(n&&n.length>=t&&a(i,n,!0)>=t-1)break;t--}r++}return tt}(e)}function dt(e){var t,n=e._a;return n&&-2===g(e).overflow&&(t=n[_e]<0||11<n[_e]?_e:n[ye]<1||n[ye]>Pe(n[me],n[_e])?ye:n[ge]<0||24<n[ge]||24===n[ge]&&(0!==n[ve]||0!==n[pe]||0!==n[we])?ge:n[ve]<0||59<n[ve]?ve:n[pe]<0||59<n[pe]?pe:n[we]<0||999<n[we]?we:-1,g(e)._overflowDayOfYear&&(t<me||ye<t)&&(t=ye),g(e)._overflowWeeks&&-1===t&&(t=Me),g(e)._overflowWeekday&&-1===t&&(t=ke),g(e).overflow=t),e}function ct(e,t,n){return null!=e?e:null!=t?t:n}function ft(e){var t,n,s,i,r,a=[];if(!e._d){var o,u;for(o=e,u=new Date(c.now()),s=o._useUTC?[u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()]:[u.getFullYear(),u.getMonth(),u.getDate()],e._w&&null==e._a[ye]&&null==e._a[_e]&&function(e){var t,n,s,i,r,a,o,u;if(null!=(t=e._w).GG||null!=t.W||null!=t.E)r=1,a=4,n=ct(t.GG,e._a[me],Ie(bt(),1,4).year),s=ct(t.W,1),((i=ct(t.E,1))<1||7<i)&&(u=!0);else{r=e._locale._week.dow,a=e._locale._week.doy;var l=Ie(bt(),r,a);n=ct(t.gg,e._a[me],l.year),s=ct(t.w,l.week),null!=t.d?((i=t.d)<0||6<i)&&(u=!0):null!=t.e?(i=t.e+r,(t.e<0||6<t.e)&&(u=!0)):i=r}s<1||s>Ae(n,r,a)?g(e)._overflowWeeks=!0:null!=u?g(e)._overflowWeekday=!0:(o=Ee(n,s,i,r,a),e._a[me]=o.year,e._dayOfYear=o.dayOfYear)}(e),null!=e._dayOfYear&&(r=ct(e._a[me],s[me]),(e._dayOfYear>Se(r)||0===e._dayOfYear)&&(g(e)._overflowDayOfYear=!0),n=Ge(r,0,e._dayOfYear),e._a[_e]=n.getUTCMonth(),e._a[ye]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=a[t]=s[t];for(;t<7;t++)e._a[t]=a[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[ge]&&0===e._a[ve]&&0===e._a[pe]&&0===e._a[we]&&(e._nextDay=!0,e._a[ge]=0),e._d=(e._useUTC?Ge:function(e,t,n,s,i,r,a){var o;return e<100&&0<=e?(o=new Date(e+400,t,n,s,i,r,a),isFinite(o.getFullYear())&&o.setFullYear(e)):o=new Date(e,t,n,s,i,r,a),o}).apply(null,a),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[ge]=24),e._w&&void 0!==e._w.d&&e._w.d!==i&&(g(e).weekdayMismatch=!0)}}var mt=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,_t=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,yt=/Z|[+-]\d\d(?::?\d\d)?/,gt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],vt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],pt=/^\/?Date\((\-?\d+)/i;function wt(e){var t,n,s,i,r,a,o=e._i,u=mt.exec(o)||_t.exec(o);if(u){for(g(e).iso=!0,t=0,n=gt.length;t<n;t++)if(gt[t][1].exec(u[1])){i=gt[t][0],s=!1!==gt[t][2];break}if(null==i)return void(e._isValid=!1);if(u[3]){for(t=0,n=vt.length;t<n;t++)if(vt[t][1].exec(u[3])){r=(u[2]||" ")+vt[t][0];break}if(null==r)return void(e._isValid=!1)}if(!s&&null!=r)return void(e._isValid=!1);if(u[4]){if(!yt.exec(u[4]))return void(e._isValid=!1);a="Z"}e._f=i+(r||"")+(a||""),Yt(e)}else e._isValid=!1}var Mt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/;function kt(e,t,n,s,i,r){var a=[function(e){var t=parseInt(e,10);{if(t<=49)return 2e3+t;if(t<=999)return 1900+t}return t}(e),He.indexOf(t),parseInt(n,10),parseInt(s,10),parseInt(i,10)];return r&&a.push(parseInt(r,10)),a}var St={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Dt(e){var t,n,s,i=Mt.exec(e._i.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));if(i){var r=kt(i[4],i[3],i[2],i[5],i[6],i[7]);if(t=i[1],n=r,s=e,t&&ze.indexOf(t)!==new Date(n[0],n[1],n[2]).getDay()&&(g(s).weekdayMismatch=!0,!(s._isValid=!1)))return;e._a=r,e._tzm=function(e,t,n){if(e)return St[e];if(t)return 0;var s=parseInt(n,10),i=s%100;return(s-i)/100*60+i}(i[8],i[9],i[10]),e._d=Ge.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),g(e).rfc2822=!0}else e._isValid=!1}function Yt(e){if(e._f!==c.ISO_8601)if(e._f!==c.RFC_2822){e._a=[],g(e).empty=!0;var t,n,s,i,r,a,o,u,l=""+e._i,h=l.length,d=0;for(s=j(e._f,e._locale).match(N)||[],t=0;t<s.length;t++)i=s[t],(n=(l.match(le(i,e))||[])[0])&&(0<(r=l.substr(0,l.indexOf(n))).length&&g(e).unusedInput.push(r),l=l.slice(l.indexOf(n)+n.length),d+=n.length),E[i]?(n?g(e).empty=!1:g(e).unusedTokens.push(i),a=i,u=e,null!=(o=n)&&m(de,a)&&de[a](o,u._a,u,a)):e._strict&&!n&&g(e).unusedTokens.push(i);g(e).charsLeftOver=h-d,0<l.length&&g(e).unusedInput.push(l),e._a[ge]<=12&&!0===g(e).bigHour&&0<e._a[ge]&&(g(e).bigHour=void 0),g(e).parsedDateParts=e._a.slice(0),g(e).meridiem=e._meridiem,e._a[ge]=function(e,t,n){var s;if(null==n)return t;return null!=e.meridiemHour?e.meridiemHour(t,n):(null!=e.isPM&&((s=e.isPM(n))&&t<12&&(t+=12),s||12!==t||(t=0)),t)}(e._locale,e._a[ge],e._meridiem),ft(e),dt(e)}else Dt(e);else wt(e)}function Ot(e){var t,n,s,i,r=e._i,a=e._f;return e._locale=e._locale||ht(e._l),null===r||void 0===a&&""===r?p({nullInput:!0}):("string"==typeof r&&(e._i=r=e._locale.preparse(r)),k(r)?new M(dt(r)):(d(r)?e._d=r:o(a)?function(e){var t,n,s,i,r;if(0===e._f.length)return g(e).invalidFormat=!0,e._d=new Date(NaN);for(i=0;i<e._f.length;i++)r=0,t=w({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[i],Yt(t),v(t)&&(r+=g(t).charsLeftOver,r+=10*g(t).unusedTokens.length,g(t).score=r,(null==s||r<s)&&(s=r,n=t));_(e,n||t)}(e):a?Yt(e):l(n=(t=e)._i)?t._d=new Date(c.now()):d(n)?t._d=new Date(n.valueOf()):"string"==typeof n?(s=t,null===(i=pt.exec(s._i))?(wt(s),!1===s._isValid&&(delete s._isValid,Dt(s),!1===s._isValid&&(delete s._isValid,c.createFromInputFallback(s)))):s._d=new Date(+i[1])):o(n)?(t._a=f(n.slice(0),function(e){return parseInt(e,10)}),ft(t)):u(n)?function(e){if(!e._d){var t=R(e._i);e._a=f([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),ft(e)}}(t):h(n)?t._d=new Date(n):c.createFromInputFallback(t),v(e)||(e._d=null),e))}function Tt(e,t,n,s,i){var r,a={};return!0!==n&&!1!==n||(s=n,n=void 0),(u(e)&&function(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(e.hasOwnProperty(t))return!1;return!0}(e)||o(e)&&0===e.length)&&(e=void 0),a._isAMomentObject=!0,a._useUTC=a._isUTC=i,a._l=n,a._i=e,a._f=t,a._strict=s,(r=new M(dt(Ot(a))))._nextDay&&(r.add(1,"d"),r._nextDay=void 0),r}function bt(e,t,n,s){return Tt(e,t,n,s,!1)}c.createFromInputFallback=n("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),c.ISO_8601=function(){},c.RFC_2822=function(){};var xt=n("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=bt.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:p()}),Pt=n("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=bt.apply(null,arguments);return this.isValid()&&e.isValid()?this<e?this:e:p()});function Wt(e,t){var n,s;if(1===t.length&&o(t[0])&&(t=t[0]),!t.length)return bt();for(n=t[0],s=1;s<t.length;++s)t[s].isValid()&&!t[s][e](n)||(n=t[s]);return n}var Ct=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ht(e){var t=R(e),n=t.year||0,s=t.quarter||0,i=t.month||0,r=t.week||t.isoWeek||0,a=t.day||0,o=t.hour||0,u=t.minute||0,l=t.second||0,h=t.millisecond||0;this._isValid=function(e){for(var t in e)if(-1===Ye.call(Ct,t)||null!=e[t]&&isNaN(e[t]))return!1;for(var n=!1,s=0;s<Ct.length;++s)if(e[Ct[s]]){if(n)return!1;parseFloat(e[Ct[s]])!==D(e[Ct[s]])&&(n=!0)}return!0}(t),this._milliseconds=+h+1e3*l+6e4*u+1e3*o*60*60,this._days=+a+7*r,this._months=+i+3*s+12*n,this._data={},this._locale=ht(),this._bubble()}function Rt(e){return e instanceof Ht}function Ut(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Ft(e,n){I(e,0,0,function(){var e=this.utcOffset(),t="+";return e<0&&(e=-e,t="-"),t+L(~~(e/60),2)+n+L(~~e%60,2)})}Ft("Z",":"),Ft("ZZ",""),ue("Z",re),ue("ZZ",re),ce(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Nt(re,e)});var Lt=/([\+\-]|\d\d)/gi;function Nt(e,t){var n=(t||"").match(e);if(null===n)return null;var s=((n[n.length-1]||[])+"").match(Lt)||["-",0,0],i=60*s[1]+D(s[2]);return 0===i?0:"+"===s[0]?i:-i}function Gt(e,t){var n,s;return t._isUTC?(n=t.clone(),s=(k(e)||d(e)?e.valueOf():bt(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+s),c.updateOffset(n,!1),n):bt(e).local()}function Vt(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function Et(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}c.updateOffset=function(){};var It=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,At=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function jt(e,t){var n,s,i,r=e,a=null;return Rt(e)?r={ms:e._milliseconds,d:e._days,M:e._months}:h(e)?(r={},t?r[t]=e:r.milliseconds=e):(a=It.exec(e))?(n="-"===a[1]?-1:1,r={y:0,d:D(a[ye])*n,h:D(a[ge])*n,m:D(a[ve])*n,s:D(a[pe])*n,ms:D(Ut(1e3*a[we]))*n}):(a=At.exec(e))?(n="-"===a[1]?-1:1,r={y:Zt(a[2],n),M:Zt(a[3],n),w:Zt(a[4],n),d:Zt(a[5],n),h:Zt(a[6],n),m:Zt(a[7],n),s:Zt(a[8],n)}):null==r?r={}:"object"==typeof r&&("from"in r||"to"in r)&&(i=function(e,t){var n;if(!e.isValid()||!t.isValid())return{milliseconds:0,months:0};t=Gt(t,e),e.isBefore(t)?n=zt(e,t):((n=zt(t,e)).milliseconds=-n.milliseconds,n.months=-n.months);return n}(bt(r.from),bt(r.to)),(r={}).ms=i.milliseconds,r.M=i.months),s=new Ht(r),Rt(e)&&m(e,"_locale")&&(s._locale=e._locale),s}function Zt(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function zt(e,t){var n={};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function $t(s,i){return function(e,t){var n;return null===t||isNaN(+t)||(T(i,"moment()."+i+"(period, number) is deprecated. Please use moment()."+i+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),n=e,e=t,t=n),qt(this,jt(e="string"==typeof e?+e:e,t),s),this}}function qt(e,t,n,s){var i=t._milliseconds,r=Ut(t._days),a=Ut(t._months);e.isValid()&&(s=null==s||s,a&&Re(e,be(e,"Month")+a*n),r&&xe(e,"Date",be(e,"Date")+r*n),i&&e._d.setTime(e._d.valueOf()+i*n),s&&c.updateOffset(e,r||a))}jt.fn=Ht.prototype,jt.invalid=function(){return jt(NaN)};var Jt=$t(1,"add"),Bt=$t(-1,"subtract");function Qt(e,t){var n=12*(t.year()-e.year())+(t.month()-e.month()),s=e.clone().add(n,"months");return-(n+(t-s<0?(t-s)/(s-e.clone().add(n-1,"months")):(t-s)/(e.clone().add(n+1,"months")-s)))||0}function Xt(e){var t;return void 0===e?this._locale._abbr:(null!=(t=ht(e))&&(this._locale=t),this)}c.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",c.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Kt=n("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});function en(){return this._locale}var tn=126227808e5;function nn(e,t){return(e%t+t)%t}function sn(e,t,n){return e<100&&0<=e?new Date(e+400,t,n)-tn:new Date(e,t,n).valueOf()}function rn(e,t,n){return e<100&&0<=e?Date.UTC(e+400,t,n)-tn:Date.UTC(e,t,n)}function an(e,t){I(0,[e,e.length],0,t)}function on(e,t,n,s,i){var r;return null==e?Ie(this,s,i).year:((r=Ae(e,s,i))<t&&(t=r),function(e,t,n,s,i){var r=Ee(e,t,n,s,i),a=Ge(r.year,0,r.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}.call(this,e,t,n,s,i))}I(0,["gg",2],0,function(){return this.weekYear()%100}),I(0,["GG",2],0,function(){return this.isoWeekYear()%100}),an("gggg","weekYear"),an("ggggg","weekYear"),an("GGGG","isoWeekYear"),an("GGGGG","isoWeekYear"),C("weekYear","gg"),C("isoWeekYear","GG"),F("weekYear",1),F("isoWeekYear",1),ue("G",se),ue("g",se),ue("GG",B,z),ue("gg",B,z),ue("GGGG",ee,q),ue("gggg",ee,q),ue("GGGGG",te,J),ue("ggggg",te,J),fe(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,s){t[s.substr(0,2)]=D(e)}),fe(["gg","GG"],function(e,t,n,s){t[s]=c.parseTwoDigitYear(e)}),I("Q",0,"Qo","quarter"),C("quarter","Q"),F("quarter",7),ue("Q",Z),ce("Q",function(e,t){t[_e]=3*(D(e)-1)}),I("D",["DD",2],"Do","date"),C("date","D"),F("date",9),ue("D",B),ue("DD",B,z),ue("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),ce(["D","DD"],ye),ce("Do",function(e,t){t[ye]=D(e.match(B)[0])});var un=Te("Date",!0);I("DDD",["DDDD",3],"DDDo","dayOfYear"),C("dayOfYear","DDD"),F("dayOfYear",4),ue("DDD",K),ue("DDDD",$),ce(["DDD","DDDD"],function(e,t,n){n._dayOfYear=D(e)}),I("m",["mm",2],0,"minute"),C("minute","m"),F("minute",14),ue("m",B),ue("mm",B,z),ce(["m","mm"],ve);var ln=Te("Minutes",!1);I("s",["ss",2],0,"second"),C("second","s"),F("second",15),ue("s",B),ue("ss",B,z),ce(["s","ss"],pe);var hn,dn=Te("Seconds",!1);for(I("S",0,0,function(){return~~(this.millisecond()/100)}),I(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),I(0,["SSS",3],0,"millisecond"),I(0,["SSSS",4],0,function(){return 10*this.millisecond()}),I(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),I(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),I(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),I(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),I(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),C("millisecond","ms"),F("millisecond",16),ue("S",K,Z),ue("SS",K,z),ue("SSS",K,$),hn="SSSS";hn.length<=9;hn+="S")ue(hn,ne);function cn(e,t){t[we]=D(1e3*("0."+e))}for(hn="S";hn.length<=9;hn+="S")ce(hn,cn);var fn=Te("Milliseconds",!1);I("z",0,0,"zoneAbbr"),I("zz",0,0,"zoneName");var mn=M.prototype;function _n(e){return e}mn.add=Jt,mn.calendar=function(e,t){var n=e||bt(),s=Gt(n,this).startOf("day"),i=c.calendarFormat(this,s)||"sameElse",r=t&&(b(t[i])?t[i].call(this,n):t[i]);return this.format(r||this.localeData().calendar(i,this,bt(n)))},mn.clone=function(){return new M(this)},mn.diff=function(e,t,n){var s,i,r;if(!this.isValid())return NaN;if(!(s=Gt(e,this)).isValid())return NaN;switch(i=6e4*(s.utcOffset()-this.utcOffset()),t=H(t)){case"year":r=Qt(this,s)/12;break;case"month":r=Qt(this,s);break;case"quarter":r=Qt(this,s)/3;break;case"second":r=(this-s)/1e3;break;case"minute":r=(this-s)/6e4;break;case"hour":r=(this-s)/36e5;break;case"day":r=(this-s-i)/864e5;break;case"week":r=(this-s-i)/6048e5;break;default:r=this-s}return n?r:S(r)},mn.endOf=function(e){var t;if(void 0===(e=H(e))||"millisecond"===e||!this.isValid())return this;var n=this._isUTC?rn:sn;switch(e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=36e5-nn(t+(this._isUTC?0:6e4*this.utcOffset()),36e5)-1;break;case"minute":t=this._d.valueOf(),t+=6e4-nn(t,6e4)-1;break;case"second":t=this._d.valueOf(),t+=1e3-nn(t,1e3)-1;break}return this._d.setTime(t),c.updateOffset(this,!0),this},mn.format=function(e){e||(e=this.isUtc()?c.defaultFormatUtc:c.defaultFormat);var t=A(this,e);return this.localeData().postformat(t)},mn.from=function(e,t){return this.isValid()&&(k(e)&&e.isValid()||bt(e).isValid())?jt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},mn.fromNow=function(e){return this.from(bt(),e)},mn.to=function(e,t){return this.isValid()&&(k(e)&&e.isValid()||bt(e).isValid())?jt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},mn.toNow=function(e){return this.to(bt(),e)},mn.get=function(e){return b(this[e=H(e)])?this[e]():this},mn.invalidAt=function(){return g(this).overflow},mn.isAfter=function(e,t){var n=k(e)?e:bt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=H(t)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())},mn.isBefore=function(e,t){var n=k(e)?e:bt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=H(t)||"millisecond")?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())},mn.isBetween=function(e,t,n,s){var i=k(e)?e:bt(e),r=k(t)?t:bt(t);return!!(this.isValid()&&i.isValid()&&r.isValid())&&("("===(s=s||"()")[0]?this.isAfter(i,n):!this.isBefore(i,n))&&(")"===s[1]?this.isBefore(r,n):!this.isAfter(r,n))},mn.isSame=function(e,t){var n,s=k(e)?e:bt(e);return!(!this.isValid()||!s.isValid())&&("millisecond"===(t=H(t)||"millisecond")?this.valueOf()===s.valueOf():(n=s.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},mn.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},mn.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},mn.isValid=function(){return v(this)},mn.lang=Kt,mn.locale=Xt,mn.localeData=en,mn.max=Pt,mn.min=xt,mn.parsingFlags=function(){return _({},g(this))},mn.set=function(e,t){if("object"==typeof e)for(var n=function(e){var t=[];for(var n in e)t.push({unit:n,priority:U[n]});return t.sort(function(e,t){return e.priority-t.priority}),t}(e=R(e)),s=0;s<n.length;s++)this[n[s].unit](e[n[s].unit]);else if(b(this[e=H(e)]))return this[e](t);return this},mn.startOf=function(e){var t;if(void 0===(e=H(e))||"millisecond"===e||!this.isValid())return this;var n=this._isUTC?rn:sn;switch(e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=nn(t+(this._isUTC?0:6e4*this.utcOffset()),36e5);break;case"minute":t=this._d.valueOf(),t-=nn(t,6e4);break;case"second":t=this._d.valueOf(),t-=nn(t,1e3);break}return this._d.setTime(t),c.updateOffset(this,!0),this},mn.subtract=Bt,mn.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},mn.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},mn.toDate=function(){return new Date(this.valueOf())},mn.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||9999<n.year()?A(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):b(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",A(n,"Z")):A(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},mn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="";this.isLocal()||(e=0===this.utcOffset()?"moment.utc":"moment.parseZone",t="Z");var n="["+e+'("]',s=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i=t+'[")]';return this.format(n+s+"-MM-DD[T]HH:mm:ss.SSS"+i)},mn.toJSON=function(){return this.isValid()?this.toISOString():null},mn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},mn.unix=function(){return Math.floor(this.valueOf()/1e3)},mn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},mn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},mn.year=Oe,mn.isLeapYear=function(){return De(this.year())},mn.weekYear=function(e){return on.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},mn.isoWeekYear=function(e){return on.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},mn.quarter=mn.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},mn.month=Ue,mn.daysInMonth=function(){return Pe(this.year(),this.month())},mn.week=mn.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},mn.isoWeek=mn.isoWeeks=function(e){var t=Ie(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},mn.weeksInYear=function(){var e=this.localeData()._week;return Ae(this.year(),e.dow,e.doy)},mn.isoWeeksInYear=function(){return Ae(this.year(),1,4)},mn.date=un,mn.day=mn.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t,n,s=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(t=e,n=this.localeData(),e="string"!=typeof t?t:isNaN(t)?"number"==typeof(t=n.weekdaysParse(t))?t:null:parseInt(t,10),this.add(e-s,"d")):s},mn.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},mn.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null==e)return this.day()||7;var t,n,s=(t=e,n=this.localeData(),"string"==typeof t?n.weekdaysParse(t)%7||7:isNaN(t)?null:t);return this.day(this.day()%7?s:s-7)},mn.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},mn.hour=mn.hours=nt,mn.minute=mn.minutes=ln,mn.second=mn.seconds=dn,mn.millisecond=mn.milliseconds=fn,mn.utcOffset=function(e,t,n){var s,i=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null==e)return this._isUTC?i:Vt(this);if("string"==typeof e){if(null===(e=Nt(re,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(s=Vt(this)),this._offset=e,this._isUTC=!0,null!=s&&this.add(s,"m"),i!==e&&(!t||this._changeInProgress?qt(this,jt(e-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,c.updateOffset(this,!0),this._changeInProgress=null)),this},mn.utc=function(e){return this.utcOffset(0,e)},mn.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Vt(this),"m")),this},mn.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=Nt(ie,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},mn.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?bt(e).utcOffset():0,(this.utcOffset()-e)%60==0)},mn.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},mn.isLocal=function(){return!!this.isValid()&&!this._isUTC},mn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},mn.isUtc=Et,mn.isUTC=Et,mn.zoneAbbr=function(){return this._isUTC?"UTC":""},mn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},mn.dates=n("dates accessor is deprecated. Use date instead.",un),mn.months=n("months accessor is deprecated. Use month instead",Ue),mn.years=n("years accessor is deprecated. Use year instead",Oe),mn.zone=n("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),mn.isDSTShifted=n("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!l(this._isDSTShifted))return this._isDSTShifted;var e={};if(w(e,this),(e=Ot(e))._a){var t=e._isUTC?y(e._a):bt(e._a);this._isDSTShifted=this.isValid()&&0<a(e._a,t.toArray())}else this._isDSTShifted=!1;return this._isDSTShifted});var yn=P.prototype;function gn(e,t,n,s){var i=ht(),r=y().set(s,t);return i[n](r,e)}function vn(e,t,n){if(h(e)&&(t=e,e=void 0),e=e||"",null!=t)return gn(e,t,n,"month");var s,i=[];for(s=0;s<12;s++)i[s]=gn(e,s,n,"month");return i}function pn(e,t,n,s){t=("boolean"==typeof e?h(t)&&(n=t,t=void 0):(t=e,e=!1,h(n=t)&&(n=t,t=void 0)),t||"");var i,r=ht(),a=e?r._week.dow:0;if(null!=n)return gn(t,(n+a)%7,s,"day");var o=[];for(i=0;i<7;i++)o[i]=gn(t,(i+a)%7,s,"day");return o}yn.calendar=function(e,t,n){var s=this._calendar[e]||this._calendar.sameElse;return b(s)?s.call(t,n):s},yn.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])},yn.invalidDate=function(){return this._invalidDate},yn.ordinal=function(e){return this._ordinal.replace("%d",e)},yn.preparse=_n,yn.postformat=_n,yn.relativeTime=function(e,t,n,s){var i=this._relativeTime[n];return b(i)?i(e,t,n,s):i.replace(/%d/i,e)},yn.pastFuture=function(e,t){var n=this._relativeTime[0<e?"future":"past"];return b(n)?n(t):n.replace(/%s/i,t)},yn.set=function(e){var t,n;for(n in e)b(t=e[n])?this[n]=t:this["_"+n]=t;this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},yn.months=function(e,t){return e?o(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||We).test(t)?"format":"standalone"][e.month()]:o(this._months)?this._months:this._months.standalone},yn.monthsShort=function(e,t){return e?o(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[We.test(t)?"format":"standalone"][e.month()]:o(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},yn.monthsParse=function(e,t,n){var s,i,r;if(this._monthsParseExact)return function(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)r=y([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(r,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(i=Ye.call(this._shortMonthsParse,a))?i:null:-1!==(i=Ye.call(this._longMonthsParse,a))?i:null:"MMM"===t?-1!==(i=Ye.call(this._shortMonthsParse,a))?i:-1!==(i=Ye.call(this._longMonthsParse,a))?i:null:-1!==(i=Ye.call(this._longMonthsParse,a))?i:-1!==(i=Ye.call(this._shortMonthsParse,a))?i:null}.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(i=y([2e3,s]),n&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[s]||(r="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[s]=new RegExp(r.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[s].test(e))return s;if(n&&"MMM"===t&&this._shortMonthsParse[s].test(e))return s;if(!n&&this._monthsParse[s].test(e))return s}},yn.monthsRegex=function(e){return this._monthsParseExact?(m(this,"_monthsRegex")||Ne.call(this),e?this._monthsStrictRegex:this._monthsRegex):(m(this,"_monthsRegex")||(this._monthsRegex=Le),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},yn.monthsShortRegex=function(e){return this._monthsParseExact?(m(this,"_monthsRegex")||Ne.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(m(this,"_monthsShortRegex")||(this._monthsShortRegex=Fe),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},yn.week=function(e){return Ie(e,this._week.dow,this._week.doy).week},yn.firstDayOfYear=function(){return this._week.doy},yn.firstDayOfWeek=function(){return this._week.dow},yn.weekdays=function(e,t){var n=o(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?je(n,this._week.dow):e?n[e.day()]:n},yn.weekdaysMin=function(e){return!0===e?je(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},yn.weekdaysShort=function(e){return!0===e?je(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},yn.weekdaysParse=function(e,t,n){var s,i,r;if(this._weekdaysParseExact)return function(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)r=y([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(i=Ye.call(this._weekdaysParse,a))?i:null:"ddd"===t?-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:null:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:null:"dddd"===t?-1!==(i=Ye.call(this._weekdaysParse,a))?i:-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:null:"ddd"===t?-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:-1!==(i=Ye.call(this._weekdaysParse,a))?i:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:null:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:-1!==(i=Ye.call(this._weekdaysParse,a))?i:-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:null}.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(i=y([2e3,1]).day(s),n&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[s]||(r="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[s]=new RegExp(r.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[s].test(e))return s;if(n&&"ddd"===t&&this._shortWeekdaysParse[s].test(e))return s;if(n&&"dd"===t&&this._minWeekdaysParse[s].test(e))return s;if(!n&&this._weekdaysParse[s].test(e))return s}},yn.weekdaysRegex=function(e){return this._weekdaysParseExact?(m(this,"_weekdaysRegex")||Qe.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(m(this,"_weekdaysRegex")||(this._weekdaysRegex=qe),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},yn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(m(this,"_weekdaysRegex")||Qe.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(m(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Je),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},yn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(m(this,"_weekdaysRegex")||Qe.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(m(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Be),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},yn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},yn.meridiem=function(e,t,n){return 11<e?n?"pm":"PM":n?"am":"AM"},ut("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===D(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),c.lang=n("moment.lang is deprecated. Use moment.locale instead.",ut),c.langData=n("moment.langData is deprecated. Use moment.localeData instead.",ht);var wn=Math.abs;function Mn(e,t,n,s){var i=jt(t,n);return e._milliseconds+=s*i._milliseconds,e._days+=s*i._days,e._months+=s*i._months,e._bubble()}function kn(e){return e<0?Math.floor(e):Math.ceil(e)}function Sn(e){return 4800*e/146097}function Dn(e){return 146097*e/4800}function Yn(e){return function(){return this.as(e)}}var On=Yn("ms"),Tn=Yn("s"),bn=Yn("m"),xn=Yn("h"),Pn=Yn("d"),Wn=Yn("w"),Cn=Yn("M"),Hn=Yn("Q"),Rn=Yn("y");function Un(e){return function(){return this.isValid()?this._data[e]:NaN}}var Fn=Un("milliseconds"),Ln=Un("seconds"),Nn=Un("minutes"),Gn=Un("hours"),Vn=Un("days"),En=Un("months"),In=Un("years");var An=Math.round,jn={ss:44,s:45,m:45,h:22,d:26,M:11};var Zn=Math.abs;function zn(e){return(0<e)-(e<0)||+e}function $n(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n=Zn(this._milliseconds)/1e3,s=Zn(this._days),i=Zn(this._months);t=S((e=S(n/60))/60),n%=60,e%=60;var r=S(i/12),a=i%=12,o=s,u=t,l=e,h=n?n.toFixed(3).replace(/\.?0+$/,""):"",d=this.asSeconds();if(!d)return"P0D";var c=d<0?"-":"",f=zn(this._months)!==zn(d)?"-":"",m=zn(this._days)!==zn(d)?"-":"",_=zn(this._milliseconds)!==zn(d)?"-":"";return c+"P"+(r?f+r+"Y":"")+(a?f+a+"M":"")+(o?m+o+"D":"")+(u||l||h?"T":"")+(u?_+u+"H":"")+(l?_+l+"M":"")+(h?_+h+"S":"")}var qn=Ht.prototype;return qn.isValid=function(){return this._isValid},qn.abs=function(){var e=this._data;return this._milliseconds=wn(this._milliseconds),this._days=wn(this._days),this._months=wn(this._months),e.milliseconds=wn(e.milliseconds),e.seconds=wn(e.seconds),e.minutes=wn(e.minutes),e.hours=wn(e.hours),e.months=wn(e.months),e.years=wn(e.years),this},qn.add=function(e,t){return Mn(this,e,t,1)},qn.subtract=function(e,t){return Mn(this,e,t,-1)},qn.as=function(e){if(!this.isValid())return NaN;var t,n,s=this._milliseconds;if("month"===(e=H(e))||"quarter"===e||"year"===e)switch(t=this._days+s/864e5,n=this._months+Sn(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Dn(this._months)),e){case"week":return t/7+s/6048e5;case"day":return t+s/864e5;case"hour":return 24*t+s/36e5;case"minute":return 1440*t+s/6e4;case"second":return 86400*t+s/1e3;case"millisecond":return Math.floor(864e5*t)+s;default:throw new Error("Unknown unit "+e)}},qn.asMilliseconds=On,qn.asSeconds=Tn,qn.asMinutes=bn,qn.asHours=xn,qn.asDays=Pn,qn.asWeeks=Wn,qn.asMonths=Cn,qn.asQuarters=Hn,qn.asYears=Rn,qn.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*D(this._months/12):NaN},qn._bubble=function(){var e,t,n,s,i,r=this._milliseconds,a=this._days,o=this._months,u=this._data;return 0<=r&&0<=a&&0<=o||r<=0&&a<=0&&o<=0||(r+=864e5*kn(Dn(o)+a),o=a=0),u.milliseconds=r%1e3,e=S(r/1e3),u.seconds=e%60,t=S(e/60),u.minutes=t%60,n=S(t/60),u.hours=n%24,o+=i=S(Sn(a+=S(n/24))),a-=kn(Dn(i)),s=S(o/12),o%=12,u.days=a,u.months=o,u.years=s,this},qn.clone=function(){return jt(this)},qn.get=function(e){return e=H(e),this.isValid()?this[e+"s"]():NaN},qn.milliseconds=Fn,qn.seconds=Ln,qn.minutes=Nn,qn.hours=Gn,qn.days=Vn,qn.weeks=function(){return S(this.days()/7)},qn.months=En,qn.years=In,qn.humanize=function(e){if(!this.isValid())return this.localeData().invalidDate();var t,n,s,i,r,a,o,u,l,h,d,c=this.localeData(),f=(n=!e,s=c,i=jt(t=this).abs(),r=An(i.as("s")),a=An(i.as("m")),o=An(i.as("h")),u=An(i.as("d")),l=An(i.as("M")),h=An(i.as("y")),(d=r<=jn.ss&&["s",r]||r<jn.s&&["ss",r]||a<=1&&["m"]||a<jn.m&&["mm",a]||o<=1&&["h"]||o<jn.h&&["hh",o]||u<=1&&["d"]||u<jn.d&&["dd",u]||l<=1&&["M"]||l<jn.M&&["MM",l]||h<=1&&["y"]||["yy",h])[2]=n,d[3]=0<+t,d[4]=s,function(e,t,n,s,i){return i.relativeTime(t||1,!!n,e,s)}.apply(null,d));return e&&(f=c.pastFuture(+this,f)),c.postformat(f)},qn.toISOString=$n,qn.toString=$n,qn.toJSON=$n,qn.locale=Xt,qn.localeData=en,qn.toIsoString=n("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",$n),qn.lang=Kt,I("X",0,0,"unix"),I("x",0,0,"valueOf"),ue("x",se),ue("X",/[+-]?\d+(\.\d{1,3})?/),ce("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))}),ce("x",function(e,t,n){n._d=new Date(D(e))}),c.version="2.24.0",e=bt,c.fn=mn,c.min=function(){return Wt("isBefore",[].slice.call(arguments,0))},c.max=function(){return Wt("isAfter",[].slice.call(arguments,0))},c.now=function(){return Date.now?Date.now():+new Date},c.utc=y,c.unix=function(e){return bt(1e3*e)},c.months=function(e,t){return vn(e,t,"months")},c.isDate=d,c.locale=ut,c.invalid=p,c.duration=jt,c.isMoment=k,c.weekdays=function(e,t,n){return pn(e,t,n,"weekdays")},c.parseZone=function(){return bt.apply(null,arguments).parseZone()},c.localeData=ht,c.isDuration=Rt,c.monthsShort=function(e,t){return vn(e,t,"monthsShort")},c.weekdaysMin=function(e,t,n){return pn(e,t,n,"weekdaysMin")},c.defineLocale=lt,c.updateLocale=function(e,t){if(null!=t){var n,s,i=st;null!=(s=ot(e))&&(i=s._config),(n=new P(t=x(i,t))).parentLocale=it[e],it[e]=n,ut(e)}else null!=it[e]&&(null!=it[e].parentLocale?it[e]=it[e].parentLocale:null!=it[e]&&delete it[e]);return it[e]},c.locales=function(){return s(it)},c.weekdaysShort=function(e,t,n){return pn(e,t,n,"weekdaysShort")},c.normalizeUnits=H,c.relativeTimeRounding=function(e){return void 0===e?An:"function"==typeof e&&(An=e,!0)},c.relativeTimeThreshold=function(e,t){return void 0!==jn[e]&&(void 0===t?jn[e]:(jn[e]=t,"s"===e&&(jn.ss=t-1),!0))},c.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},c.prototype=mn,c.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},c}); \ No newline at end of file From ff92deb93ecd30669ba17e0ad58f3fc64a68e2fe Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Tue, 3 Dec 2019 10:26:00 +0200 Subject: [PATCH 156/586] Fixing static tests --- .../Config/Model/Config/Structure/Element/Dependency/Field.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/Magento/Config/Model/Config/Structure/Element/Dependency/Field.php b/app/code/Magento/Config/Model/Config/Structure/Element/Dependency/Field.php index 8f4d82eed51c5..28e1ba505a2ce 100644 --- a/app/code/Magento/Config/Model/Config/Structure/Element/Dependency/Field.php +++ b/app/code/Magento/Config/Model/Config/Structure/Element/Dependency/Field.php @@ -6,6 +6,8 @@ namespace Magento\Config\Model\Config\Structure\Element\Dependency; /** + * Field + * * @api * @since 100.0.2 */ From f64cd491cd0a4574b572de10e609870a746e3e48 Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Tue, 3 Dec 2019 10:27:55 +0200 Subject: [PATCH 157/586] Revert "Fixing static tests" This reverts commit ff92deb93ecd30669ba17e0ad58f3fc64a68e2fe. --- .../Config/Model/Config/Structure/Element/Dependency/Field.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/code/Magento/Config/Model/Config/Structure/Element/Dependency/Field.php b/app/code/Magento/Config/Model/Config/Structure/Element/Dependency/Field.php index 28e1ba505a2ce..8f4d82eed51c5 100644 --- a/app/code/Magento/Config/Model/Config/Structure/Element/Dependency/Field.php +++ b/app/code/Magento/Config/Model/Config/Structure/Element/Dependency/Field.php @@ -6,8 +6,6 @@ namespace Magento\Config\Model\Config\Structure\Element\Dependency; /** - * Field - * * @api * @since 100.0.2 */ From c3804b7a43e32dff6e9066e5030e898b4f1bc986 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <p.bystritsky@yandex.ru> Date: Tue, 3 Dec 2019 15:08:07 +0200 Subject: [PATCH 158/586] Test for magento/magento2#25666. --- .../Section/StorefrontProductMediaSection.xml | 2 + .../Test/StorefrontFotoramaArrowsTest.xml | 61 +++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/StorefrontFotoramaArrowsTest.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductMediaSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductMediaSection.xml index 6ed359e35ab59..d3e43d9ea2dfa 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductMediaSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductMediaSection.xml @@ -17,5 +17,7 @@ <element name="imageFile" type="text" selector="//*[@class='product media']//img[contains(@src, '{{filename}}')]" parameterized="true"/> <element name="productImageActive" type="text" selector=".product.media div[data-active=true] > img[src*='{{filename}}']" parameterized="true"/> <element name="productImageInFotorama" type="file" selector=".fotorama__nav__shaft img[src*='{{imageName}}']" parameterized="true"/> + <element name="fotoramaPrevButton" type="button" selector="//*[@data-gallery-role='gallery']//*[@data-gallery-role='nav-wrap']//*[@data-gallery-role='arrow' and contains(@class, 'fotorama__thumb__arr--left')]"/> + <element name="fotoramaNextButton" type="button" selector="//*[@data-gallery-role='gallery']//*[@data-gallery-role='nav-wrap']//*[@data-gallery-role='arrow' and contains(@class, 'fotorama__thumb__arr--right')]"/> </section> </sections> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontFotoramaArrowsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontFotoramaArrowsTest.xml new file mode 100644 index 0000000000000..25d1dcedea0d5 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontFotoramaArrowsTest.xml @@ -0,0 +1,61 @@ +<?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="AdminAddDefaultImageSimpleProductTest"> + <annotations> + <features value="Catalog"/> + <title value="Storefront Fotorama arrows test"/> + <description value="Check arrows next to the thumbs are not visible than there is room for all pictures."/> + <severity value="MINOR"/> + <group value="Catalog"/> + </annotations> + <before> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="_defaultProduct" stepKey="createProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + </before> + <after> + <actionGroup ref="logout" stepKey="logout"/> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + </after> + + <!-- Open Product for edit --> + <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="findCreatedProductInGrid"> + <argument name="product" value="$$createProduct$$"/> + </actionGroup> + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="goToEditProductPage"> + <argument name="product" value="$$createProduct$$"/> + </actionGroup> + + <!-- Add images to product --> + <actionGroup ref="addProductImage" stepKey="addFirstImageToProduct"> + <argument name="image" value="MagentoLogo"/> + </actionGroup> + <actionGroup ref="addProductImage" stepKey="addSecondImageToProduct"> + <argument name="image" value="ProductImage"/> + </actionGroup> + <actionGroup ref="addProductImage" stepKey="addThirdImageToProduct"> + <argument name="image" value="TestImageNew"/> + </actionGroup> + <actionGroup ref="saveProductForm" stepKey="saveSimpleProduct"/> + + <!-- Assert product in storefront product page --> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openCreatedProductPage"> + <argument name="productUrl" value="$$createProduct.name$$"/> + </actionGroup> + + <!-- Assert Fotorama arrows aren't visible --> + <dontSeeElement selector="{{StorefrontProductMediaSection.fotoramaPrevButton}}" stepKey="dontSeePrevButton"/> + <dontSeeElement selector="{{StorefrontProductMediaSection.fotoramaNextButton}}" stepKey="dontSeeNextButton"/> + </test> +</tests> From ee115feeb5d412c69d3e8a8fc9b58e7d406207e6 Mon Sep 17 00:00:00 2001 From: Sergiy Zhovnir <s.zhovnir@atwix.com> Date: Tue, 3 Dec 2019 16:06:36 +0200 Subject: [PATCH 159/586] #issue-761 Adjusted the PR --- app/code/Magento/Ui/view/base/web/js/grid/columns/image.js | 2 ++ .../Magento_Ui/web/css/source/module/_masonry-grid.less | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Ui/view/base/web/js/grid/columns/image.js b/app/code/Magento/Ui/view/base/web/js/grid/columns/image.js index 0bd93f8e629b7..e8e1cf3246c76 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/columns/image.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/columns/image.js @@ -84,6 +84,8 @@ define([ * Get is active record * * @param {Object} record - Data to be preprocessed. + * + * @returns {Boolean} */ getIsActive: function (record) { return this.previewComponent().visibleRecord() === record._rowIndex || false; diff --git a/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/module/_masonry-grid.less b/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/module/_masonry-grid.less index f805861be90e2..9dd42246dac3f 100644 --- a/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/module/_masonry-grid.less +++ b/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/module/_masonry-grid.less @@ -5,6 +5,7 @@ @admin__masonry_grid_image__space: 20px; @admin__masonry_grid_background_color: #fff; @admin__masonry_overlay_background_color: #507dc8; +@admin__masonry_grid_active_image_border_color: #558dd6; & when (@media-common = true) { .masonry-image { @@ -30,7 +31,7 @@ .masonry-image-block { &.active { img { - border: 2px #558dd6 solid; + border: 2px @admin__masonry_grid_active_image_border_color solid; padding: 1px; } } From 6c7f33b067a36b89e41166bf82a7e41bd648a1ce Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <p.bystritsky@yandex.ru> Date: Tue, 3 Dec 2019 16:30:21 +0200 Subject: [PATCH 160/586] Test for magento/magento2#24973. --- .../Model/ResourceModel/Product/CollectionTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/CollectionTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/CollectionTest.php index 86dcf9d96d086..e8d472fb98c6f 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/CollectionTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/CollectionTest.php @@ -287,8 +287,8 @@ public function testAddAttributeToFilterAffectsGetSize(): void */ public function testAddAttributeTierPriceToFilter($condition): void { - $this->collection->addAttributeToFilter('tier_price', $condition); - $this->assertEquals(1, $this->collection->getSize()); + $size = $this->collection->addAttributeToFilter('tier_price', $condition)->getSize(); + $this->assertEquals(1, $size); } /** @@ -314,8 +314,8 @@ public function addAttributeTierPriceToFilterDataProvider(): array */ public function testAddAttributeIsSaleableToFilter($condition): void { - $this->collection->addAttributeToFilter('is_saleable', $condition); - $this->assertEquals(1, $this->collection->getSize()); + $size = $this->collection->addAttributeToFilter('is_saleable', $condition)->getSize(); + $this->assertEquals(1, $size); } /** From b1a2a29671de32d90dbc10a3b0ced6a3d71b2b72 Mon Sep 17 00:00:00 2001 From: Ihor Sviziev <svizev.igor@gmail.com> Date: Tue, 3 Dec 2019 21:45:36 +0200 Subject: [PATCH 161/586] magento/magento2#25603 Fix removing query string from url after redirect Cover with integration tests cases with external URLs as target path --- .../UrlRewrite/Controller/UrlRewriteTest.php | 27 ++++++++++++-- .../Magento/UrlRewrite/_files/url_rewrite.php | 36 +++++++++++++++++++ .../_files/url_rewrite_rollback.php | 16 ++++++++- 3 files changed, 76 insertions(+), 3 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/UrlRewrite/Controller/UrlRewriteTest.php b/dev/tests/integration/testsuite/Magento/UrlRewrite/Controller/UrlRewriteTest.php index b6a551cc6ad50..cea44226f6192 100644 --- a/dev/tests/integration/testsuite/Magento/UrlRewrite/Controller/UrlRewriteTest.php +++ b/dev/tests/integration/testsuite/Magento/UrlRewrite/Controller/UrlRewriteTest.php @@ -44,8 +44,7 @@ public function testMatchUrlRewrite( $location = $response->getHeader('Location')->getFieldValue(); $this->assertStringEndsWith( $redirect, - $location, - 'Invalid location header' + $location ); } } @@ -110,6 +109,30 @@ public function requestDataProvider(): array 'request' => '/page-similar-query-param/?param2=1', 'redirect' => '/page-e?param1=1¶m2=1', ], + 'Use Case #13: Rewrite: page-external1 --(301)--> http://example.com/external;' + . 'Request: page-external1?param1=1 --(301)--> http://example.com/external (not fills get params)' => [ + 'request' => '/page-external1?param1=1', + 'redirect' => 'http://example.com/external', + ], + 'Use Case #14: Rewrite: page-external2/ --(301)--> https://example.com/external2/;' + . 'Request: page-external2?param2=1 --(301)--> https://example.com/external2/ (not fills get params)' => [ + 'request' => '/page-external2?param2=1', + 'redirect' => 'https://example.com/external2/', + ], + 'Use Case #15: Rewrite: page-external3 --(301)--> http://example.com/external?param1=value1;' + . 'Request: page-external3?param1=custom1¶m2=custom2 --(301)--> ' + . 'http://example.com/external?param1=value1' + . ' (fills get param from target path)' => [ + 'request' => '/page-external3?param1=custom1¶m2=custom2', + 'redirect' => 'http://example.com/external?param1=value1', + ], + 'Use Case #16: Rewrite: page-external4/ --(301)--> https://example.com/external2/?param2=value2;' + . 'Request: page-external4?param1=custom1¶m2=custom2 --(301)--> ' + . 'https://example.com/external2/?param2=value2 ' + . ' (fills get param from target path)' => [ + 'request' => '/page-external4?param1=custom1¶m2=custom2', + 'redirect' => 'https://example.com/external2/?param2=value2', + ], ]; } } diff --git a/dev/tests/integration/testsuite/Magento/UrlRewrite/_files/url_rewrite.php b/dev/tests/integration/testsuite/Magento/UrlRewrite/_files/url_rewrite.php index dc3f5490f5a53..68d1212539c6d 100644 --- a/dev/tests/integration/testsuite/Magento/UrlRewrite/_files/url_rewrite.php +++ b/dev/tests/integration/testsuite/Magento/UrlRewrite/_files/url_rewrite.php @@ -155,3 +155,39 @@ ->setStoreId($storeID) ->setDescription('From page-similar-query-param with trailing slash to page-e with query param'); $rewriteResource->save($rewrite); + +$rewrite = $objectManager->create(UrlRewrite::class); +$rewrite->setEntityType('custom') + ->setRequestPath('page-external1') + ->setTargetPath('http://example.com/external') + ->setRedirectType(OptionProvider::PERMANENT) + ->setStoreId($storeID) + ->setDescription('From page-external to external URL'); +$rewriteResource->save($rewrite); + +$rewrite = $objectManager->create(UrlRewrite::class); +$rewrite->setEntityType('custom') + ->setRequestPath('page-external2/') + ->setTargetPath('https://example.com/external2/') + ->setRedirectType(OptionProvider::PERMANENT) + ->setStoreId($storeID) + ->setDescription('From page-external with trailing slash to external URL'); +$rewriteResource->save($rewrite); + +$rewrite = $objectManager->create(UrlRewrite::class); +$rewrite->setEntityType('custom') + ->setRequestPath('page-external3') + ->setTargetPath('http://example.com/external?param1=value1') + ->setRedirectType(OptionProvider::PERMANENT) + ->setStoreId($storeID) + ->setDescription('From page-external to external URL'); +$rewriteResource->save($rewrite); + +$rewrite = $objectManager->create(UrlRewrite::class); +$rewrite->setEntityType('custom') + ->setRequestPath('page-external4/') + ->setTargetPath('https://example.com/external2/?param2=value2') + ->setRedirectType(OptionProvider::PERMANENT) + ->setStoreId($storeID) + ->setDescription('From page-external with trailing slash to external URL'); +$rewriteResource->save($rewrite); diff --git a/dev/tests/integration/testsuite/Magento/UrlRewrite/_files/url_rewrite_rollback.php b/dev/tests/integration/testsuite/Magento/UrlRewrite/_files/url_rewrite_rollback.php index 76b84810ac433..a5c21f7a00e48 100644 --- a/dev/tests/integration/testsuite/Magento/UrlRewrite/_files/url_rewrite_rollback.php +++ b/dev/tests/integration/testsuite/Magento/UrlRewrite/_files/url_rewrite_rollback.php @@ -31,7 +31,21 @@ ->create(\Magento\UrlRewrite\Model\ResourceModel\UrlRewriteCollection::class); $collection = $urlRewriteCollection ->addFieldToFilter('entity_type', 'custom') - ->addFieldToFilter('target_path', ['page-a/', 'page-a', 'page-b', 'page-c', 'page-d?param1=1', 'page-e?param1=1']) + ->addFieldToFilter( + 'target_path', + [ + 'page-a/', + 'page-a', + 'page-b', + 'page-c', + 'page-d?param1=1', + 'page-e?param1=1', + 'http://example.com/external', + 'https://example.com/external2/', + 'http://example.com/external?param1=value1', + 'https://example.com/external2/?param2=value2' + ] + ) ->load() ->walk('delete'); From d904436ab74f88afb6102aff022fc206e7abd199 Mon Sep 17 00:00:00 2001 From: Ashna-Jahan <32352950+Ashna-Jahan@users.noreply.github.com> Date: Wed, 4 Dec 2019 13:39:27 +0530 Subject: [PATCH 162/586] Fixed the issue. --- .../css/source/forms/fields/_control-table.less | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less b/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less index f8e50db60281c..22957cb86cb55 100644 --- a/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less +++ b/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less @@ -238,12 +238,20 @@ } } -.product_form_product_form_advanced_pricing_modal .admin__fieldset > .admin__field > .admin__field-control { - width: calc(~"(100%) * 0.57 - 30px"); +.product_form_product_form_advanced_pricing_modal .admin__fieldset > .admin__field > .admin__field-label, .product_form_product_form_advanced_pricing_modal [class*='admin__control-grouped'] > .admin__field:first-child > .admin__field-label { + margin-left: 0; +} + +.product_form_product_form_advanced_pricing_modal .admin__control-table td, +.product_form_product_form_advanced_pricing_modal .admin__control-table th { + padding: 1.3rem 0.7rem 1.3rem 0.3; + overflow-y: visible; +} +.product_form_product_form_advanced_pricing_modal .admin__fieldset { + margin: -40px; } .product_form_product_form_advanced_pricing_modal .admin__control-table-wrapper { overflow-x: visible; overflow-y: visible; } - From 5db4ca7b241868aed4847491dc27332e361888e4 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <p.bystritsky@yandex.ru> Date: Wed, 4 Dec 2019 16:44:28 +0200 Subject: [PATCH 163/586] Test for magento/magento2#25149. --- .../Catalog/Test/Mftf/Data/ProductData.xml | 5 ++ ...AdminProductCustomizableOptionsSection.xml | 1 + ...minCreateOrderWithDateTimeOptionUITest.xml | 49 +++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithDateTimeOptionUITest.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml index bd02bc0e4b340..46bb6e527608f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml @@ -528,6 +528,11 @@ <requiredEntity type="product_option">ProductOptionDateTime</requiredEntity> <requiredEntity type="product_option">ProductOptionTime</requiredEntity> </entity> + <entity name="productWithDateTimeOption" type="product"> + <var key="sku" entityType="product" entityKey="sku" /> + <data key="file">magento.jpg</data> + <requiredEntity type="product_option">ProductOptionDateTime</requiredEntity> + </entity> <entity name="productWithOptionRadiobutton" type="product"> <var key="sku" entityType="product" entityKey="sku" /> <requiredEntity type="product_option">ProductOptionRadiobuttonWithTwoFixedOptions</requiredEntity> diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductCustomizableOptionsSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductCustomizableOptionsSection.xml index fa2f9feffdf91..8802372968f65 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductCustomizableOptionsSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductCustomizableOptionsSection.xml @@ -9,6 +9,7 @@ <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminProductCustomizableOptionsSection"> + <element name="requiredFieldIndicator" type="text" selector=" return window.getComputedStyle(document.querySelector('#product_composite_configure_form_fields .admin__field.required .admin__field-label'), ':after').getPropertyValue('content');"/> <element name="checkIfCustomizableOptionsTabOpen" type="text" selector="//span[text()='Customizable Options']/parent::strong/parent::*[@data-state-collapsible='closed']" timeout="30"/> <element name="customizableOptions" type="text" selector="//strong[contains(@class, 'admin__collapsible-title')]/span[text()='Customizable Options']"/> <element name="useDefaultOptionTitle" type="text" selector="[data-index='options'] tr.data-row [data-index='title'] [name^='options_use_default']"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithDateTimeOptionUITest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithDateTimeOptionUITest.xml new file mode 100644 index 0000000000000..06c2375a26616 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithDateTimeOptionUITest.xml @@ -0,0 +1,49 @@ +<?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="AdminCreateOrderWithDateTimeOptionUITest"> + <annotations> + <title value="Admin create order with date time option UI test"/> + <description value="Check asterisk rendered correctly for Product with custom option (datetime) at backend"/> + <features value="Sales"/> + <severity value="MINOR"/> + <group value="Sales"/> + </annotations> + + <before> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="_defaultProduct" stepKey="createProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <updateData createDataKey="createProduct" entity="productWithDateTimeOption" stepKey="updateProductWithOption"/> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + </before> + <after> + <actionGroup ref="logout" stepKey="logout"/> + <deleteData createDataKey="createProduct" stepKey="deleteSimpleProduct"/> + <deleteData createDataKey="createCustomer" stepKey="deleteSimpleCustomer"/> + </after> + + <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> + <argument name="customer" value="$$createCustomer$$"/> + </actionGroup> + + <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> + <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="$$createProduct.sku$$" stepKey="fillSkuFilter"/> + <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearch"/> + <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> + <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectProduct"/> + <waitForAjaxLoad stepKey="waitForAjaxLoad"/> + <executeJS function="{{AdminProductCustomizableOptionsSection.requiredFieldIndicator}}" stepKey="dateTimeRequiredFieldIndicator"/> + <assertEquals expected='"*"' expectedType="string" actualType="variable" actual="dateTimeRequiredFieldIndicator" message="pass" stepKey="assertRequiredFieldIndicator"/> + </test> +</tests> + From a4d57b99f4163ca929433f20d56630e99f234a54 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Wed, 4 Dec 2019 22:50:34 +0700 Subject: [PATCH 164/586] Resolve issue 25896: Cannot create folder using only letters --- .../Magento/Cms/Model/Wysiwyg/Images/Storage.php | 2 +- .../Unit/Model/Wysiwyg/Images/StorageTest.php | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php index e02d2b461a94e..21f3b232e783c 100644 --- a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php +++ b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php @@ -416,7 +416,7 @@ public function createDirectory($name, $path) { if (!preg_match(self::DIRECTORY_NAME_REGEXP, $name)) { throw new \Magento\Framework\Exception\LocalizedException( - __('Please rename the folder using only letters, numbers, underscores and dashes.') + __('Please rename the folder using only Latin letters, numbers, underscores and dashes.') ); } diff --git a/app/code/Magento/Cms/Test/Unit/Model/Wysiwyg/Images/StorageTest.php b/app/code/Magento/Cms/Test/Unit/Model/Wysiwyg/Images/StorageTest.php index 662aee671dd24..9a9c63195051c 100644 --- a/app/code/Magento/Cms/Test/Unit/Model/Wysiwyg/Images/StorageTest.php +++ b/app/code/Magento/Cms/Test/Unit/Model/Wysiwyg/Images/StorageTest.php @@ -7,6 +7,7 @@ use Magento\Cms\Model\Wysiwyg\Images\Storage\Collection as StorageCollection; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Exception\LocalizedException; /** * @SuppressWarnings(PHPMD.LongVariable) @@ -539,4 +540,18 @@ public function testUploadFile() $this->assertEquals($result, $this->imagesStorage->uploadFile($targetPath, $type)); } + + /** + * Test create directory with invalid name + */ + public function testCreateDirectoryWithInvalidName() + { + $name = 'папка'; + $path = '/tmp/path'; + $this->expectException(LocalizedException::class); + $this->expectExceptionMessage( + (string)__('Please rename the folder using only Latin letters, numbers, underscores and dashes.') + ); + $this->imagesStorage->createDirectory($name, $path); + } } From 4584cabf5f11cb422f9735f12f552e471e69644d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Wed, 4 Dec 2019 21:34:39 +0100 Subject: [PATCH 165/586] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- .../ActionGroup/_Deprecated_ActionGroup.xml | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 app/code/Magento/Backup/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/Backup/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Backup/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..84c6812ddf183 --- /dev/null +++ b/app/code/Magento/Backup/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,68 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="createSystemBackup"> + <annotations> + <description>Creates a System Backup using provided Backup Entity.</description> + </annotations> + <arguments> + <argument name="backup" defaultValue="SystemBackup"/> + </arguments> + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateSystemBackupActionGroup` instead --> + <click selector="{{AdminMainActionsSection.systemBackup}}" stepKey="clickCreateBackupButton"/> + <waitForElementVisible selector="{{AdminCreateBackupFormSection.backupNameField}}" stepKey="waitForForm"/> + <fillField selector="{{AdminCreateBackupFormSection.backupNameField}}" userInput="{{backup.name}}" stepKey="fillBackupName"/> + <click selector="{{AdminCreateBackupFormSection.ok}}" stepKey="clickOk"/> + <waitForElementNotVisible selector=".loading-mask" time="300" stepKey="waitForBackupProcess"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You created the system backup." stepKey="seeSuccessMessage"/> + <see selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="seeBackupInGrid"/> + <see selector="{{AdminGridTableSection.backupTypeByName(backup.name)}}" userInput="{{backup.type}}" stepKey="seeBackupType"/> + </actionGroup> + + <actionGroup name="createMediaBackup"> + <annotations> + <description>Creates a Media Backup using provided Backup Entity.</description> + </annotations> + <arguments> + <argument name="backup" defaultValue="MediaBackup"/> + </arguments> + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateMediaBackupActionGroup` instead --> + <click selector="{{AdminMainActionsSection.mediaBackup}}" stepKey="clickCreateBackupButton"/> + <waitForElementVisible selector="{{AdminCreateBackupFormSection.backupNameField}}" stepKey="waitForForm"/> + <fillField selector="{{AdminCreateBackupFormSection.backupNameField}}" userInput="{{backup.name}}" stepKey="fillBackupName"/> + <click selector="{{AdminCreateBackupFormSection.ok}}" stepKey="clickOk"/> + <waitForPageLoad time="120" stepKey="waitForBackupProcess"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You created the database and media backup." stepKey="seeSuccessMessage"/> + <see selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="seeBackupInGrid"/> + <see selector="{{AdminGridTableSection.backupTypeByName(backup.name)}}" userInput="{{backup.type}}" stepKey="seeBackupType"/> + </actionGroup> + + <actionGroup name="createDatabaseBackup"> + <annotations> + <description>Creates a Database Backup using provided Backup Entity.</description> + </annotations> + <arguments> + <argument name="backup" defaultValue="DatabaseBackup"/> + </arguments> + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateDatabaseBackupActionGroup` instead --> + <click selector="{{AdminMainActionsSection.databaseBackup}}" stepKey="clickCreateBackupButton"/> + <waitForElementVisible selector="{{AdminCreateBackupFormSection.backupNameField}}" stepKey="waitForForm"/> + <fillField selector="{{AdminCreateBackupFormSection.backupNameField}}" userInput="{{backup.name}}" stepKey="fillBackupName"/> + <click selector="{{AdminCreateBackupFormSection.ok}}" stepKey="clickOk"/> + <waitForPageLoad time="120" stepKey="waitForBackupProcess"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You created the database backup." stepKey="seeSuccessMessage"/> + <see selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="seeBackupInGrid"/> + <see selector="{{AdminGridTableSection.backupTypeByName(backup.name)}}" userInput="{{backup.type}}" stepKey="seeBackupType"/> + </actionGroup> +</actionGroups> From 54f094a82ef60da66e0f84fa213be3ef5cb74ad5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Wed, 4 Dec 2019 21:44:58 +0100 Subject: [PATCH 166/586] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- .../_Deprecated_ActionGroup.xml .xml | 139 ++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 app/code/Magento/Braintree/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml .xml diff --git a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml .xml b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml .xml new file mode 100644 index 0000000000000..5bfd2d15de72a --- /dev/null +++ b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml .xml @@ -0,0 +1,139 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="GoToAllUsers"> + <annotations> + <description>Navigate to the Users page via Backend Admin Side Menu. PLEASE NOTE: Use the amOnPage action instead.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `GoToAllUsersActionGroup` instead --> + <click selector="{{AdminCreateUserSection.system}}" stepKey="clickOnSystemIcon"/> + <waitForPageLoad stepKey="waitForSystemsPageToOpen"/> + <click selector="{{AdminCreateUserSection.allUsers}}" stepKey="clickToSelectUserRoles"/> + <waitForPageLoad stepKey="waitForUserRolesPageToOpen"/> + </actionGroup> + + <actionGroup name="GoToUserRoles"> + <annotations> + <description>Navigate to the User Roles page via Backend Admin Side Menu. PLEASE NOTE: Use the amOnPage action instead.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `GoToUserRolesActionGroup` instead --> + <click selector="#menu-magento-backend-system" stepKey="clickOnSystemIcon"/> + <waitForPageLoad stepKey="waitForSystemsPageToOpen"/> + <click selector="//span[contains(text(), 'User Roles')]" stepKey="clickToSelectUserRoles"/> + <waitForPageLoad stepKey="waitForUserRolesPageToOpen"/> + </actionGroup> + + <actionGroup name="AdminCreateNewRole"> + <annotations> + <description>Creates a User Role using the provided Data.</description> + </annotations> + <arguments> + <argument name="role" type="string" defaultValue=""/> + <argument name="resource" type="string" defaultValue="All"/> + <argument name="scope" type="string" defaultValue="Custom"/> + <argument name="websites" type="string" defaultValue="Main Website"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminCreateNewRoleActionGroup` instead --> + <click selector="{{AdminCreateRoleSection.create}}" stepKey="clickToAddNewRole"/> + <fillField selector="{{AdminCreateRoleSection.name}}" userInput="{{role.name}}" stepKey="setRoleName"/> + <fillField stepKey="setPassword" selector="{{AdminCreateRoleSection.password}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/> + <click selector="{{AdminCreateRoleSection.roleResources}}" stepKey="clickToOpenRoleResources"/> + <waitForPageLoad stepKey="waitForRoleResourcePage" time="5"/> + <click stepKey="checkSales" selector="//a[text()='Sales']"/> + <click selector="{{AdminCreateRoleSection.save}}" stepKey="clickToSaveRole"/> + <waitForPageLoad stepKey="waitForPageLoad" time="10"/> + <see userInput="You saved the role." stepKey="seeSuccessMessage"/> + </actionGroup> + + <actionGroup name="AdminCreateUserAction"> + <annotations> + <description>Creates a User using the NewAdmin User Entity and User Role Entity. PLEASE NOTE: The Action Group values are Hardcoded.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminCreateUserActionGroup` instead --> + <click selector="{{AdminCreateUserSection.create}}" stepKey="clickToCreateNewUser"/> + <waitForPageLoad stepKey="waitForNewUserPageLoad" time="10"/> + <fillField selector="{{AdminCreateUserSection.usernameTextField}}" userInput="{{NewAdmin.username}}" stepKey="enterUserName"/> + <fillField selector="{{AdminCreateUserSection.firstNameTextField}}" userInput="{{NewAdmin.firstName}}" stepKey="enterFirstName"/> + <fillField selector="{{AdminCreateUserSection.lastNameTextField}}" userInput="{{NewAdmin.lastName}}" stepKey="enterLastName"/> + <fillField selector="{{AdminCreateUserSection.emailTextField}}" userInput="{{NewAdmin.email}}" stepKey="enterEmail"/> + <fillField selector="{{AdminCreateUserSection.passwordTextField}}" userInput="{{NewAdmin.password}}" stepKey="enterPassword"/> + <fillField selector="{{AdminCreateUserSection.pwConfirmationTextField}}" userInput="{{NewAdmin.password}}" stepKey="confirmPassword"/> + <fillField selector="{{AdminCreateUserSection.currentPasswordField}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="enterCurrentPassword"/> + <scrollToTopOfPage stepKey="scrollToTopOfPage"/> + <click selector="{{AdminCreateUserSection.userRoleTab}}" stepKey="clickUserRole"/> + <waitForAjaxLoad stepKey="waitForRoles" time="5"/> + <fillField selector="{{AdminCreateRoleSection.roleNameFilterTextField}}" userInput="{{role.name}}" stepKey="filterRole"/> + <click selector="{{AdminCreateRoleSection.searchButton}}" stepKey="clickSearch"/> + <waitForPageLoad stepKey="waitForSearch" time="10"/> + <click selector="{{AdminCreateRoleSection.searchResultFirstRow}}" stepKey="selectRole"/> + <click selector="{{AdminCreateUserSection.saveButton}}" stepKey="clickSaveUser"/> + <waitForPageLoad stepKey="waitForSaveUser" time="10"/> + <see userInput="You saved the user." stepKey="seeSuccessMessage"/> + </actionGroup> + + <actionGroup name="ConfigureBraintree"> + <annotations> + <description>Sets up the Braintree configuration setting using the BraintreeConfigurationSection Data Entity. PLEASE NOTE: The Action Group values are Hardcoded.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ConfigureBraintreeActionGroup` instead --> + <click stepKey="clickOnSTORES" selector="{{AdminMenuSection.stores}}"/> + <waitForPageLoad stepKey="waitForConfiguration" time="2"/> + <click stepKey="clickOnConfigurations" selector="{{AdminMenuSection.configuration}}"/> + <waitForPageLoad stepKey="waitForSales" time="2"/> + <click stepKey="clickOnSales" selector="{{ConfigurationListSection.sales}}"/> + <waitForPageLoad stepKey="waitForPaymentMethods" time="2"/> + <click stepKey="clickOnPaymentMethods" selector="{{ConfigurationListSection.salesPaymentMethods}}"/> + <waitForPageLoad stepKey="waitForConfigureButton" time="2"/> + <click stepKey="clickOnConfigureButtonForBraintree" selector="{{ConfigurationPaymentSection.configureButton}}"/> + <waitForPageLoad stepKey="BraintreeSettings" time="2"/> + + <fillField stepKey="fillTitleForBraintreeSettings" selector="{{BraintreeConfiguraionSection.titleForBraintreeSettings}}" userInput="{{BraintreeConfigurationData.title}}"/> + <click stepKey="openEnvironmentSelect" selector="{{BraintreeConfiguraionSection.environment}}"/> + <click stepKey="chooseEnvironment" selector="{{BraintreeConfiguraionSection.sandbox}}"/> + <click stepKey="openPaymentActionSelect" selector="{{BraintreeConfiguraionSection.paymentActionSelect}}"/> + <click stepKey="choosePaymentAction" selector="{{BraintreeConfiguraionSection.paymentAction}}"/> + <fillField stepKey="fillMerchantID" selector="{{BraintreeConfiguraionSection.merchantID}}" userInput="{{BraintreeConfigurationData.merchantID}}"/> + <fillField stepKey="fillPublicKey" selector="{{BraintreeConfiguraionSection.publicKey}}" userInput="{{BraintreeConfigurationData.publicKey}}"/> + <fillField stepKey="fillPrivateKey" selector="{{BraintreeConfiguraionSection.privateKey}}" userInput="{{BraintreeConfigurationData.privateKey}}"/> + <click stepKey="expandEnableThisSolution" selector="{{BraintreeConfiguraionSection.enableThisSolution}}"/> + <click stepKey="chooseYesForEnableThisSolution" selector="{{BraintreeConfiguraionSection.yesForEnable}}"/> + <click stepKey="expandEnablePayPalThroughBraintree" selector="{{BraintreeConfiguraionSection.payPalThroughBraintree}}"/> + <click stepKey="chooseYesForEnablePayPalThroughBraintree" selector="{{BraintreeConfiguraionSection.yesForPayPalThroughBraintree}}"/> + <click stepKey="expandAdvancedBraintreeSettings" selector="{{BraintreeConfiguraionSection.advancedBraintreeSettings}}"/> + <fillField stepKey="fillMerchantAccountID" selector="{{BraintreeConfiguraionSection.merchantAccountID}}" userInput="{{BraintreeConfigurationData.merchantAccountID}}"/> + <click stepKey="expandCVVVerification" selector="{{BraintreeConfiguraionSection.CVVVerification}}"/> + <click stepKey="chooseYes" selector="{{BraintreeConfiguraionSection.yesForCVV}}"/> + <click stepKey="expandPayPalThroughBraintree" selector="{{BraintreeConfiguraionSection.payPalThroughBraintreeSelector}}"/> + <fillField stepKey="fillTitleForPayPalThroughBraintree" selector="{{BraintreeConfiguraionSection.titleForPayPalThroughBraintree}}" userInput="{{BraintreeConfigurationData.titleForPayPalThroughBraintree}}"/> + <click stepKey="expandPaymentAction" selector="{{BraintreeConfiguraionSection.paymentActionInPayPal}}"/> + <click stepKey="chooseAuthorize" selector="{{BraintreeConfiguraionSection.actionAuthorize}}"/> + <click stepKey="save" selector="{{BraintreeConfiguraionSection.save}}"/> + <waitForElementVisible selector="{{BraintreeConfiguraionSection.successfulMessage}}" stepKey="waitForSuccessfullyConfigured" time="10"/> + </actionGroup> + + <actionGroup name="DisableBrainTree"> + <annotations> + <description>Disables the Braintree and BraintreePaypal configuration settings via the CLI.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `DisableBraintreeActionGroup` instead --> + <magentoCLI stepKey="disableBrainTree" command="config:set payment/braintree/active 0"/> + <magentoCLI stepKey="disableBrainTreePaypal" command="config:set payment/braintree_paypal/active 0"/> + </actionGroup> +</actionGroups> From df44eebd4b9eefa1027f5d5fa67687a30d30e8e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Wed, 4 Dec 2019 21:56:55 +0100 Subject: [PATCH 167/586] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- ...iewBundleProductInAdminGridActionGroup.xml | 2 +- .../ActionGroup/_Deprecated_ActionGroup.xml | 263 ++++++++++++++++++ 2 files changed, 264 insertions(+), 1 deletion(-) create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/ViewBundleProductInAdminGridActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/ViewBundleProductInAdminGridActionGroup.xml index 96179b49206c8..bd0d08e4c0924 100644 --- a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/ViewBundleProductInAdminGridActionGroup.xml +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/ViewBundleProductInAdminGridActionGroup.xml @@ -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="viewBundleProductInAdminGrid"> + <actionGroup name="ViewBundleProductInAdminGridActionGroup"> <annotations> <description>Clears the Grid Filters on the Catalog Grid page and applies Filter by Name and Sku. Then checks to see if the Product exists in the 1st row. Then clears the Grid Filters again for future Tests.</description> </annotations> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..d5413d2269a5b --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,263 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AncillaryPrepBundleProduct"> + <annotations> + <description>Requires Navigation to the Product Creation page. Fills out Name, Sku, and SEO information using the BundleProduct Data Entity. PLEASE NOTE: The Action Group values are Hardcoded.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AncillaryPrepBundleProductActionGroup` instead --> + <fillField selector="{{AdminProductFormBundleSection.productName}}" userInput="{{BundleProduct.name}}" stepKey="fillProductName"/> + <fillField selector="{{AdminProductFormBundleSection.productSku}}" userInput="{{BundleProduct.sku}}" stepKey="fillProductSku"/> + + <scrollTo selector="{{AdminProductFormBundleSection.seoDropdown}}" stepKey="moveToSEOSection"/> + <conditionalClick selector="{{AdminProductFormBundleSection.seoDropdown}}" dependentSelector="{{AdminProductFormBundleSection.urlKey}}" visible="false" stepKey="openDropDownIfClosed"/> + <waitForPageLoad stepKey="WaitForDropDownSEO"/> + + <fillField userInput="{{BundleProduct.urlKey}}" selector="{{AdminProductFormBundleSection.urlKey}}" stepKey="FillsinSEOlinkExtension"/> + </actionGroup> + + <actionGroup name="FindProductToEdit"> + <annotations> + <description>Clears the Backend Admin Grid Filters on the Backend Admin Product Grid page. Searches for the BundleProduct Data Entity. Then clicks on the first item in the Admin Grid. PLEASE NOTE: The Action Group values are Hardcoded.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FindProductToEditActionGroup` instead --> + <amOnPage url="{{ProductCatalogPage.url}}" stepKey="GoToProductCatalog"/> + <waitForPageLoad stepKey="WaitForCatalogProductPageToLoad"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> + <fillField userInput="{{BundleProduct.name}}" selector="#fulltext" stepKey="EnterProductNameInSearch"/> + <click stepKey="ClickSearch" selector="{{AdminProductFormBundleSection.searchButton}}"/> + <click stepKey="ClickOnProduct" selector="{{AdminProductFormBundleSection.firstCatalogProduct}}"/> + <waitForPageLoad stepKey="WaitForProductEditPageToLoad"/> + </actionGroup> + + <actionGroup name="CreateBasicBundleProduct"> + <annotations> + <description>Requires Navigation to the Product Creation page. Fills out Name, Sku, and SEO information using the BundleProduct Data Entity. PLEASE NOTE: The Action Group values are Hardcoded.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateBasicBundleProductActionGroup` instead --> + <fillField selector="{{AdminProductFormBundleSection.productName}}" userInput="{{BundleProduct.name}}" stepKey="fillProductName"/> + <fillField selector="{{AdminProductFormBundleSection.productSku}}" userInput="{{BundleProduct.sku}}" stepKey="fillProductSku"/> + + <scrollTo selector="{{AdminProductFormBundleSection.seoDropdown}}" stepKey="scrollToSeoDropDown"/> + <conditionalClick selector="{{AdminProductFormBundleSection.seoDropdown}}" dependentSelector="{{AdminProductFormBundleSection.urlKey}}" visible="false" stepKey="openDropDownIfClosed"/> + <waitForPageLoad stepKey="waitForDropDownSEO"/> + + <fillField userInput="{{BundleProduct.urlKey}}" selector="{{AdminProductFormBundleSection.urlKey}}" stepKey="fillsInSeoLinkExtension"/> + </actionGroup> + + <actionGroup name="addBundleOptionWithTwoProducts"> + <annotations> + <description>Requires Navigation to the Product Creation page. Adds Bundle Option with Two Products using the provided arguments. 'x' refers to Bundle option number. 'n' refers to the first number after x.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddBundleOptionWithTwoProductsActionGroup` instead --> + <arguments> + <argument name="x" type="string"/> + <argument name="n" type="string"/> + <argument name="prodOneSku" type="string"/> + <argument name="prodTwoSku" type="string"/> + <argument name="optionTitle" type="string"/> + <argument name="inputType" type="string"/> + </arguments> + + <conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/> + <scrollTo selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" stepKey="scrollUpABit"/> + <click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="clickAddOption"/> + <waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle(x)}}" stepKey="waitForOptions"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle(x)}}" userInput="{{optionTitle}}" stepKey="fillTitle"/> + <selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType(x)}}" userInput="{{inputType}}" stepKey="selectType"/> + <waitForElementVisible selector="{{AdminProductFormBundleSection.nthAddProductsToOption(n)}}" stepKey="waitForAddBtn"/> + <click selector="{{AdminProductFormBundleSection.nthAddProductsToOption(n)}}" stepKey="clickAdd"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters1"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters1"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodOneSku}}" stepKey="fillProductSkuFilter1"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters1"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad1" time="30"/> + <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct1"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters2"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters2"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodTwoSku}}" stepKey="fillProductSkuFilter2"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters2"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad2" time="30"/> + <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct2"/> + <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddButton1"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="50" stepKey="fillQuantity1"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '1')}}" userInput="50" stepKey="fillQuantity2"/> + </actionGroup> + + <actionGroup name="addBundleOptionWithOneProduct" extends="addBundleOptionWithTwoProducts"> + <annotations> + <description>Requires Navigation to the Product Creation page. Adds Bundle Option with One Product as specified in arguments. 'x' refers to Bundle option number. 'n' refers to the first number after x.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddBundleOptionWithOneProductActionGroup` instead --> + <remove keyForRemoval="openProductFilters2"/> + <remove keyForRemoval="fillProductSkuFilter2"/> + <remove keyForRemoval="clickApplyFilters2"/> + <remove keyForRemoval="waitForFilteredGridLoad2"/> + <remove keyForRemoval="selectProduct2"/> + <remove keyForRemoval="selectProduct2"/> + <remove keyForRemoval="fillQuantity1"/> + <remove keyForRemoval="fillQuantity2"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="1" stepKey="fillQuantity" after="clickAddButton1"/> + </actionGroup> + + <actionGroup name="addBundleOptionWithTreeProducts" extends="addBundleOptionWithTwoProducts"> + <annotations> + <description>Requires Navigation to the Product Creation page. Adds Bundle Option with Three Products using the provided arguments. 'x' refers to Bundle option number. 'n' refers to the first number after x.</description> + </annotations> + <arguments> + <argument name="prodTreeSku" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddBundleOptionWithThreeProductsActionGroup` instead --> + <remove keyForRemoval="fillQuantity1"/> + <remove keyForRemoval="fillQuantity2"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters3" after="selectProduct2"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters3" after="clickClearFilters3"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodTreeSku}}" stepKey="fillProductSkuFilter3" after="openProductFilters3"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters3" after="fillProductSkuFilter3"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad3" time="30" after="clickApplyFilters3"/> + <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct3" after="waitForFilteredGridLoad3"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="1" stepKey="fillQuantity1" after="clickAddButton1"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '1')}}" userInput="1" stepKey="fillQuantity2" after="fillQuantity1"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '2')}}" userInput="1" stepKey="fillQuantity3" after="fillQuantity2"/> + </actionGroup> + + <actionGroup name="addBundleOptionWithSixProducts" extends="addBundleOptionWithTwoProducts"> + <annotations> + <description>Requires Navigation to Product Creation page. Adds Bundle Option with Six Products as specified in arguments. 'x' refers to Bundle option number. 'n' refers to the first number after x.</description> + </annotations> + <arguments> + <argument name="prodTreeSku" type="string"/> + <argument name="prodFourSku" type="string"/> + <argument name="prodFiveSku" type="string"/> + <argument name="prodSixSku" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddBundleOptionWithSixProductsActionGroup` instead --> + <remove keyForRemoval="fillQuantity1"/> + <remove keyForRemoval="fillQuantity2"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters3" after="selectProduct2"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters3" after="clickClearFilters3"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodTreeSku}}" stepKey="fillProductSkuFilter3" after="openProductFilters3"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters3" after="fillProductSkuFilter3"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad3" time="30" after="clickApplyFilters3"/> + <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct3" after="waitForFilteredGridLoad3"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters4" after="selectProduct3"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters4" after="clickClearFilters4"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodFourSku}}" stepKey="fillProductSkuFilter4" after="openProductFilters4"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters4" after="fillProductSkuFilter4"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad4" time="30" after="clickApplyFilters4"/> + <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct4" after="clickApplyFilters4"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters5" after="selectProduct4"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters5" after="clickClearFilters5"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodFiveSku}}" stepKey="fillProductSkuFilter5" after="openProductFilters5"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters5" after="fillProductSkuFilter5"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad5" time="30" after="clickApplyFilters5"/> + <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct5" after="waitForFilteredGridLoad5"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters6" after="selectProduct5"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters6" after="clickClearFilters6"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodSixSku}}" stepKey="fillProductSkuFilter6" after="openProductFilters6"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters6" after="fillProductSkuFilter6"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad6" time="30" after="clickApplyFilters6"/> + <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct6" after="waitForFilteredGridLoad6"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="2" stepKey="fillQuantity1" after="clickAddButton1"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '1')}}" userInput="2" stepKey="fillQuantity2" after="fillQuantity1"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '2')}}" userInput="2" stepKey="fillQuantity3" after="fillQuantity2"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '3')}}" userInput="2" stepKey="fillQuantity4" after="fillQuantity3"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '4')}}" userInput="2" stepKey="fillQuantity5" after="fillQuantity4"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '5')}}" userInput="2" stepKey="fillQuantity6" after="fillQuantity5"/> + </actionGroup> + + <actionGroup name="deleteBundleOptionByIndex"> + <annotations> + <description>Requires Navigation to Product Creation page. Removes any Bundle Option by index specified in arguments. 'deleteIndex' refers to Bundle option number.</description> + </annotations> + <arguments> + <argument name="deleteIndex" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `DeleteBundleOptionByIndexActionGroup` instead --> + <conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/> + <scrollTo selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" stepKey="scrollUpABit"/> + <click selector="{{AdminProductFormBundleSection.deleteOption(deleteIndex)}}" stepKey="clickDeleteOption"/> + </actionGroup> + + <actionGroup name="StorefrontAddBundleProductFromProductToCartWithMultiOption" extends="StorefrontAddBundleProductFromProductToCartActionGroup"> + <annotations> + <description>Selects a Bundled Product option on the Bundled Product page. PLEASE NOTE: The Quantity selection is not available in the Action Group.</description> + </annotations> + <arguments> + <argument name="optionName" type="string"/> + <argument name="value" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontAddBundleProductFromProductToCartWithMultiOptionActionGroup` instead --> + <selectOption selector="{{StorefrontBundledSection.multiselectOptionFourProducts(optionName)}}" userInput="{{value}}" stepKey="selectValue" before="clickAddBundleProductToCart"/> + </actionGroup> + + <actionGroup name="fillMainBundleProductForm"> + <annotations> + <description>Fills the Name, SKU and Stock Status fields.</description> + </annotations> + <arguments> + <argument name="product" defaultValue="BundleProduct"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FillMainBundleProductFormActionGroup` instead --> + <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductSku"/> + <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductName"/> + <selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{product.status}}" stepKey="selectStockStatus"/> + </actionGroup> + + <actionGroup name="checkRequiredFieldsInBundleProductForm"> + <annotations> + <description>Clears the Name and SKU fields when adding a Product and then verifies that they are required after attempting to Save.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CheckRequiredFieldsInBundleProductFormActionGroup` instead --> + <clearField selector="{{AdminProductFormSection.productName}}" stepKey="clearProductSku"/> + <clearField selector="{{AdminProductFormSection.productSku}}" stepKey="clearProductName"/> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Product" stepKey="seeStillOnEditPage"/> + <see selector="{{AdminProductFormSection.fieldError('name')}}" userInput="This is a required field." stepKey="seeNameRequired"/> + <see selector="{{AdminProductFormSection.fieldError('sku')}}" userInput="This is a required field." stepKey="seeSkuRequired"/> + </actionGroup> + + <actionGroup name="viewBundleProductInAdminGrid"> + <annotations> + <description>Clears the Grid Filters on the Catalog Grid page and applies Filter by Name and Sku. Then checks to see if the Product exists in the 1st row. Then clears the Grid Filters again for future Tests.</description> + </annotations> + <arguments> + <argument name="product" defaultValue="BundleProduct"/> + <argument name="thumbnail" defaultValue="ProductPlaceholderImage"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ViewBundleProductInAdminGridActionGroup` instead --> + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> + <waitForPageLoad stepKey="waitForPageLoadInitial"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{product.name}}" stepKey="fillProductNameFilter"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> + <selectOption selector="{{AdminProductGridFilterSection.typeFilter}}" userInput="{{product.type_id}}" stepKey="selectionProductType"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.name}}" stepKey="seeProductNameInGrid"/> + <click selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="clickClearFiltersAfter"/> + </actionGroup> +</actionGroups> From 24637fc96cb65ebf61f198c6279c0d6b208acc90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Wed, 4 Dec 2019 22:03:21 +0100 Subject: [PATCH 168/586] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- .../ActionGroup/_Deprecated_ActionGroup.xml | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 app/code/Magento/Wishlist/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..ca17b0275ed5b --- /dev/null +++ b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + + <actionGroup name="StorefrontCustomerCheckProductInWishlist"> + <annotations> + <description>Validates that the provided Product details (Price and Name) are present in the Storefront Customer Dashboard Wish List.</description> + </annotations> + <arguments> + <argument name="productVar"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCustomerCheckProductInWishlistActionGroup` instead --> + <waitForElement selector="{{StorefrontCustomerWishlistProductSection.ProductTitleByName(productVar.name)}}" time="30" stepKey="assertWishlistProductName"/> + <see userInput="${{productVar.price}}.00" selector="{{StorefrontCustomerWishlistProductSection.ProductPriceByName(productVar.name)}}" stepKey="AssertWishlistProductPrice"/> + <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName(productVar.name)}}" stepKey="wishlistMoveMouseOverProduct"/> + <seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductAddToCartByName(productVar.name)}}" stepKey="AssertWishlistAddToCart"/> + <seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductImageByName(productVar.name)}}" stepKey="AssertWishlistProductImage"/> + </actionGroup> + + <actionGroup name="StorefrontCustomerCheckProductInWishlistSidebar"> + <annotations> + <description>Validates that the provided Product details (Name) are present in the Wish List side bar menu.</description> + </annotations> + <arguments> + <argument name="productVar"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCustomerCheckProductInWishlistSidebarActionGroup` instead --> + <waitForElement selector="{{StorefrontCustomerWishlistSidebarSection.ProductTitleByName(productVar.name)}}" time="30" stepKey="assertWishlistSidebarProductName"/> + <see userInput="${{productVar.price}}.00" selector="{{StorefrontCustomerWishlistSidebarSection.ProductPriceByName(productVar.name)}}" stepKey="AssertWishlistSidebarProductPrice"/> + <seeElement selector="{{StorefrontCustomerWishlistSidebarSection.ProductAddToCartByName(productVar.name)}}" stepKey="AssertWishlistSidebarAddToCart"/> + <seeElement selector="{{StorefrontCustomerWishlistSidebarSection.ProductImageByName(productVar.name)}}" stepKey="AssertWishlistSidebarProductImage"/> + </actionGroup> + + <actionGroup name="StorefrontCustomerRemoveProductFromWishlistUsingSidebar"> + <annotations> + <description>Removes the provided Product from the Wish List side bar menu. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCustomerRemoveProductFromWishlistUsingSidebarActionGroup` instead --> + <click selector="{{StorefrontCustomerWishlistSidebarSection.ProductRemoveByName(product.name)}}" stepKey="RemoveProductFromWishlistUsingSidebarClickRemoveItemFromWishlist"/> + <waitForElement selector="{{StorefrontCategoryMainSection.SuccessMsg}}" time="30" stepKey="RemoveProductFromWishlistUsingSidebarWaitForSuccessMessage"/> + <see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="{{product.name}} has been removed from your Wish List." stepKey="RemoveProductFromWishlistUsingSidebarSeeProductNameRemovedFromWishlist"/> + </actionGroup> + + <actionGroup name="StorefrontCustomerAddProductToCartFromWishlistUsingSidebar"> + <annotations> + <description>Add the provided Product to the Cart from the Wish List side bar menu. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCustomerAddProductToCartFromWishlistUsingSidebarActionGroup` instead --> + <click selector="{{StorefrontCustomerWishlistSidebarSection.ProductAddToCartByName(product.name)}}" stepKey="AddProductToCartFromWishlistUsingSidebarClickAddToCartFromWishlist"/> + <waitForElement selector="{{StorefrontCategoryMainSection.SuccessMsg}}" time="30" stepKey="AddProductToCartFromWishlistUsingSidebarWaitForSuccessMessage"/> + <see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="You added {{product.name}} to your shopping cart." stepKey="AddProductToCartFromWishlistUsingSidebarSeeProductNameAddedToCartFromWishlist"/> + </actionGroup> + + <actionGroup name="StorefrontCustomerEditProductInWishlist"> + <annotations> + <description>Edits the provided Product on the Storefront Wish List page. Fills in the provided Description and Quantity. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="description" type="string"/> + <argument name="quantity" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCustomerEditProductInWishlistActionGroup` instead --> + <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName(product.name)}}" stepKey="mouseOverOnProduct"/> + <fillField selector="{{StorefrontCustomerWishlistProductSection.ProductDescription(product.name)}}" userInput="{{description}}" stepKey="fillDescription"/> + <fillField selector="{{StorefrontCustomerWishlistProductSection.ProductQuantity(product.name)}}" userInput="{{quantity}}" stepKey="fillQuantity"/> + <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductAddAllToCart}}" stepKey="mouseOver"/> + <click selector="{{StorefrontCustomerWishlistProductSection.ProductUpdateWishList}}" stepKey="submitUpdateWishlist"/> + <see selector="{{StorefrontCustomerWishlistProductSection.ProductSuccessUpdateMessage}}" userInput="{{product.name}} has been updated in your Wish List." stepKey="successMessage"/> + </actionGroup> + + <actionGroup name="StorefrontAssertCustomerWishlistIsEmpty"> + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontAssertCustomerWishlistIsEmptyActionGroup` instead --> + <dontSeeElement selector="{{StorefrontCustomerWishlistProductSection.pager}}" stepKey="checkThatPagerIsAbsent"/> + <see selector="{{StorefrontCustomerWishlistProductSection.wishlistEmpty}}" userInput="You have no items in your wish list." stepKey="checkNoItemsMessage"/> + </actionGroup> +</actionGroups> From 8519c5d8da998647f7d052493114fb9e893714a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Wed, 4 Dec 2019 22:12:56 +0100 Subject: [PATCH 169/586] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- .../ActionGroup/_Deprecated_ActionGroup.xml | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 app/code/Magento/User/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..0230f5b1c8e3e --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,69 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + + + <actionGroup name="AdminAddNewUserRoleWithCustomRoleScopes" extends="AdminAddNewUserRoleActionGroup"> + <arguments> + <argument name="customWebsiteName" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminAddNewUserRoleWithCustomRoleScopesActionGroup` instead --> + <checkOption selector="{{AdminCreateRoleSection.selectWebsite(customWebsiteName)}}" stepKey="checkWebsite" after="selectRoleResources"/> + </actionGroup> + <actionGroup name="AdminFillUserRoleRequiredData" extends="AdminCreateRoleActionGroup"> + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminFillUserRoleRequiredDataActionGroup` instead --> + <remove keyForRemoval="clickRoleResourcesTab"/> + <remove keyForRemoval="waitForScopeSelection"/> + <remove keyForRemoval="selectResourceAccessCustom"/> + <remove keyForRemoval="waitForElementVisible"/> + <remove keyForRemoval="clickContentBlockCheckbox"/> + <remove keyForRemoval="clickSaveRoleButton"/> + <remove keyForRemoval="waitForPageLoad2"/> + </actionGroup> + <actionGroup name="AdminAddRestrictedRole" extends="AdminCreateRoleActionGroup"> + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminAddRestrictedRoleActionGroup` instead --> + <remove keyForRemoval="navigateToNewRole"/> + <remove keyForRemoval="waitForPageLoad1"/> + <remove keyForRemoval="fillRoleName"/> + <remove keyForRemoval="enterPassword"/> + <remove keyForRemoval="clickRoleResourcesTab"/> + <remove keyForRemoval="waitForScopeSelection"/> + <remove keyForRemoval="clickSaveRoleButton"/> + <remove keyForRemoval="waitForPageLoad2"/> + <scrollTo selector="{{AdminEditRoleInfoSection.blockName('restrictedRole')}}" x="0" y="-100" stepKey="scrollToResourceElement" after="selectResourceAccessCustom"/> + </actionGroup> + <actionGroup name="AdminCreateRole"> + <annotations> + <description>Clicks on 'Add New Role'. Fills in the provided details (Role, Resource, Scope and Websites). Clicks on Save. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="role" type="string" defaultValue=""/> + <argument name="resource" type="string" defaultValue="All"/> + <argument name="scope" type="string" defaultValue="Custom"/> + <argument name="websites" type="string" defaultValue="Main Website"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminCreateRoleActionGroup` instead --> + <click selector="{{AdminCreateRoleSection.create}}" stepKey="clickToAddNewRole"/> + <fillField selector="{{AdminCreateRoleSection.name}}" userInput="{{role.name}}" stepKey="setRoleName"/> + <fillField stepKey="setPassword" selector="{{AdminCreateRoleSection.password}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/> + <click selector="{{AdminCreateRoleSection.roleResources}}" stepKey="clickToOpenRoleResources"/> + <waitForPageLoad stepKey="waitForRoleResourcePage" time="5"/> + <click stepKey="checkSales" selector="//a[text()='Sales']"/> + <click selector="{{AdminCreateRoleSection.save}}" stepKey="clickToSaveRole"/> + <waitForPageLoad stepKey="waitForPageLoad" time="10"/> + <see userInput="You saved the role." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> From bb7eca034eac3fa1514bd78df347f0e9f46bd06b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Wed, 4 Dec 2019 22:19:45 +0100 Subject: [PATCH 170/586] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- ....xml => AdminAddUrlRewriteActionGroup.xml} | 0 .../ActionGroup/_Deprecated_ActionGroup.xml | 296 ++++++++++++++++++ 2 files changed, 296 insertions(+) rename app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/{AdminUrlRewriteActionGroup.xml => AdminAddUrlRewriteActionGroup.xml} (100%) create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUrlRewriteActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminAddUrlRewriteActionGroup.xml similarity index 100% rename from app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUrlRewriteActionGroup.xml rename to app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminAddUrlRewriteActionGroup.xml diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..c990db8cc3cf8 --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,296 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminAddUrlRewrite"> + <annotations> + <description>Goes to the Admin Add URL Rewrite edit page. Fills in the provided URL details. Clicks on Save. Validates that the Success Message is present.</description> + </annotations> + <arguments> + <argument name="category" type="string"/> + <argument name="customUrlRewriteValue" type="string"/> + <argument name="storeValue" type="string"/> + <argument name="requestPath" type="string"/> + <argument name="redirectTypeValue" type="string"/> + <argument name="description" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminAddUrlRewriteActionGroup` instead --> + <amOnPage url="{{AdminUrlRewriteEditPage.url}}" stepKey="openUrlRewriteEditPage"/> + <waitForElementVisible selector="{{AdminUrlRewriteEditSection.createCustomUrlRewrite}}" stepKey="waitForCreateUrlRewriteVisible"/> + <selectOption selector="{{AdminUrlRewriteEditSection.createCustomUrlRewrite}}" userInput="{{customUrlRewriteValue}}" stepKey="selectUrlRewriteTypeOption"/> + <waitForElementVisible selector="{{AdminUrlRewriteEditSection.categoryInTree(category)}}" stepKey="waitForCategoryInTreeVisible"/> + <click selector="{{AdminUrlRewriteEditSection.categoryInTree(category)}}" stepKey="clickOnCategoryInTree"/> + <waitForElementVisible selector="{{AdminUrlRewriteEditSection.store}}" stepKey="waitForStoreSelectVisible"/> + <selectOption selector="{{AdminUrlRewriteEditSection.store}}" userInput="{{storeValue}}" stepKey="selectStoreOption"/> + <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPathField"/> + <selectOption selector="{{AdminUrlRewriteEditSection.redirectType}}" userInput="{{redirectTypeValue}}" stepKey="selectRedirectType"/> + <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescriptionField"/> + <click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveButton"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/> + <see selector="{{AdminMessagesSection.success}}" userInput="The URL Rewrite has been saved." stepKey="seeSuccessMessage"/> + </actionGroup> + + <actionGroup name="AdminAddUrlRewriteForProduct"> + <annotations> + <description>Adds the provided URL Rewrite details for a Product.</description> + </annotations> + <arguments> + <argument name="storeValue" type="string"/> + <argument name="requestPath" type="string"/> + <argument name="redirectTypeValue" type="string"/> + <argument name="description" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminAddUrlRewriteForProductActionGroup` instead --> + <waitForElementVisible selector="{{AdminUrlRewriteProductSection.skipCategoryButton}}" stepKey="waitForSkipCategoryButton"/> + <click selector="{{AdminUrlRewriteProductSection.skipCategoryButton}}" stepKey="clickOnSkipCategoryButton"/> + <waitForPageLoad stepKey="waitForProductPageToLoad"/> + <click selector="{{AdminUrlRewriteEditSection.store}}" stepKey="clickOnStore"/> + <click selector="{{AdminUrlRewriteEditSection.storeValue('storeValue')}}" stepKey="clickOnStoreValue"/> + <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPath"/> + <click selector="{{AdminUrlRewriteEditSection.redirectType}}" stepKey="selectRedirectType"/> + <click selector="{{AdminUrlRewriteEditSection.redirectTypeValue('redirectTypeValue')}}" stepKey="clickOnRedirectTypeValue"/> + <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescription"/> + <click selector="{{AdminUrlRewriteEditSection.saveButton}}" stepKey="clickOnSaveButton"/> + <seeElement selector="{{AdminUrlRewriteIndexSection.successMessage}}" stepKey="seeSuccessSaveMessage"/> + </actionGroup> + + <actionGroup name="AdminAddCustomUrlRewrite"> + <annotations> + <description>Goes to the Admin URL Rewrite edit page. Adds the provided Custom URL Rewrite details. Clicks on Save. Validates that the Success Message is present.</description> + </annotations> + <arguments> + <argument name="customUrlRewriteValue" type="string"/> + <argument name="storeValue" type="string"/> + <argument name="requestPath" type="string"/> + <argument name="targetPath" type="string"/> + <argument name="redirectTypeValue" type="string"/> + <argument name="description" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminAddCustomUrlRewriteActionGroup` instead --> + <amOnPage url="{{AdminUrlRewriteEditPage.url}}" stepKey="openUrlRewriteEditPage"/> + <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad" after="openUrlRewriteEditPage"/> + <click selector="{{AdminUrlRewriteEditSection.createCustomUrlRewrite}}" stepKey="clickOnCustonUrlRewrite"/> + <click selector="{{AdminUrlRewriteEditSection.createCustomUrlRewriteValue('customUrlRewriteValue')}}" stepKey="selectCustom"/> + <click selector="{{AdminUrlRewriteEditSection.store}}" stepKey="clickOnStore"/> + <click selector="{{AdminUrlRewriteEditSection.storeValue('storeValue')}}" stepKey="clickOnStoreValue"/> + <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPath"/> + <fillField selector="{{AdminUrlRewriteEditSection.targetPath}}" userInput="{{targetPath}}" stepKey="fillTargetPath"/> + <click selector="{{AdminUrlRewriteEditSection.redirectType}}" stepKey="selectRedirectType"/> + <click selector="{{AdminUrlRewriteEditSection.redirectTypeValue('redirectTypeValue')}}" stepKey="selectRedirectTypeValue"/> + <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescription"/> + <click selector="{{AdminUrlRewriteEditSection.saveButton}}" stepKey="clickOnSaveButton"/> + <seeElement selector="{{AdminUrlRewriteIndexSection.successMessage}}" stepKey="seeSuccessSaveMessage"/> + </actionGroup> + + <actionGroup name="AdminUpdateUrlRewrite"> + <annotations> + <description>Updates the URL Rewrite fields with the provided details.</description> + </annotations> + <arguments> + <argument name="storeValue" type="string"/> + <argument name="requestPath" type="string"/> + <argument name="redirectTypeValue" type="string"/> + <argument name="description" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminUpdateUrlRewriteActionGroup` instead --> + <click selector="{{AdminUrlRewriteEditSection.store}}" stepKey="clickOnStore"/> + <click selector="{{AdminUrlRewriteEditSection.storeValue(storeValue)}}" stepKey="clickOnStoreValue"/> + <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPath"/> + <click selector="{{AdminUrlRewriteEditSection.redirectType}}" stepKey="selectRedirectType"/> + <click selector="{{AdminUrlRewriteEditSection.redirectTypeValue(redirectTypeValue)}}" stepKey="selectRedirectTypeValue"/> + <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescription"/> + <click selector="{{AdminUrlRewriteEditSection.saveButton}}" stepKey="clickOnSaveButton"/> + <seeElement selector="{{AdminUrlRewriteIndexSection.successMessage}}" stepKey="seeSuccessSaveMessage"/> + </actionGroup> + + <actionGroup name="AdminUpdateCustomUrlRewrite"> + <annotations> + <description>Updates the Custom URL Rewrite fields with the provided details.</description> + </annotations> + <arguments> + <argument name="storeValue" type="string"/> + <argument name="requestPath" type="string"/> + <argument name="targetPath" type="string"/> + <argument name="redirectTypeValue" type="string"/> + <argument name="description" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminUpdateCustomUrlRewriteActionGroup` instead --> + <click selector="{{AdminUrlRewriteEditSection.store}}" stepKey="clickOnStore"/> + <click selector="{{AdminUrlRewriteEditSection.storeValue('storeValue')}}" stepKey="clickOnStoreValue"/> + <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPath"/> + <fillField selector="{{AdminUrlRewriteEditSection.targetPath}}" userInput="{{targetPath}}" stepKey="fillTargetPath"/> + <selectOption selector="{{AdminUrlRewriteEditSection.redirectType}}" userInput="{{redirectTypeValue}}" stepKey="selectRedirectTypeValue"/> + <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescription"/> + <click selector="{{AdminUrlRewriteEditSection.saveButton}}" stepKey="clickOnSaveButton"/> + <seeElement selector="{{AdminUrlRewriteIndexSection.successMessage}}" stepKey="seeSuccessSaveMessage"/> + </actionGroup> + <actionGroup name="AdminSearchByRequestPath"> + <annotations> + <description>Goes to the Admin URL Rewrite grid page. Searches the grid based on the provided Redirect Path. Validates that the provided Redirect Path, Type and Target Path are present and correct in the grid.</description> + </annotations> + <arguments> + <argument name="redirectPath" type="string"/> + <argument name="redirectType" type="string"/> + <argument name="targetPath" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminSearchByRequestPathActionGroup` instead --> + <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="openUrlRewriteEditPage"/> + <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad"/> + <click selector="{{AdminUrlRewriteIndexSection.resetButton}}" stepKey="clickOnResetButton"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="{{redirectPath}}" stepKey="fillRedirectPathFilter"/> + <click selector="{{AdminUrlRewriteIndexSection.searchButton}}" stepKey="clickOnSearchButton"/> + <waitForPageLoad stepKey="waitForPageToLoad1"/> + <see selector="{{AdminUrlRewriteIndexSection.requestPathColumn('1')}}" userInput="{{redirectPath}}" stepKey="seeTheRedirectPathForOldUrl"/> + <see selector="{{AdminUrlRewriteIndexSection.targetPathColumn('1')}}" userInput="{{targetPath}}" stepKey="seeTheTargetPath"/> + <see selector="{{AdminUrlRewriteIndexSection.redirectTypeColumn('1')}}" userInput="{{redirectType}}" stepKey="seeTheRedirectTypeForOldUrl"/> + </actionGroup> + + <actionGroup name="AdminSearchUrlRewriteProductBySku"> + <annotations> + <description>Goes to the Admin URL Rewrite grid page. Searches the grid based on the provided Product SKU. Clicks on the 1st row in the grid.</description> + </annotations> + <arguments> + <argument name="productSku" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminSearchUrlRewriteProductBySkuActionGroup` instead --> + <amOnPage url="{{AdminUrlRewriteProductPage.url}}" stepKey="openUrlRewriteProductPage"/> + <waitForPageLoad stepKey="waitForUrlRewriteProductPageToLoad"/> + <click selector="{{AdminUrlRewriteProductSection.resetFilter}}" stepKey="clickOnResetFilter"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <fillField selector="{{AdminUrlRewriteProductSection.skuFilter}}" userInput="{{productSku}}" stepKey="fillProductSkuFilter"/> + <click selector="{{AdminUrlRewriteProductSection.searchFilter}}" stepKey="clickOnSearchFilter"/> + <waitForPageLoad stepKey="waitForProductToLoad"/> + <click selector="{{AdminUrlRewriteProductSection.productRow}}" stepKey="clickOnFirstRow"/> + <waitForPageLoad stepKey="waitForProductCategoryPageToLoad"/> + </actionGroup> + + <actionGroup name="AdminSearchDeletedUrlRewrite"> + <annotations> + <description>Goes to the Admin URL Rewrite grid page. Searches the grid for the provided Request Path. Validates that it does NOT appear in the grid.</description> + </annotations> + <arguments> + <argument name="requestPath" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminSearchDeletedUrlRewriteActionGroup` instead --> + <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="openUrlRewriteEditPage"/> + <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad"/> + <click selector="{{AdminUrlRewriteIndexSection.resetButton}}" stepKey="clickOnResetButton"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="{{requestPath}}" stepKey="fillRedirectPathFilter"/> + <click selector="{{AdminUrlRewriteIndexSection.searchButton}}" stepKey="clickOnSearchButton"/> + <waitForPageLoad stepKey="waitForPageToLoad1"/> + <see selector="{{AdminUrlRewriteIndexSection.emptyRecords}}" userInput="We couldn't find any records." stepKey="seeEmptyRecordMessage"/> + </actionGroup> + + <actionGroup name="AdminDeleteUrlRewrite"> + <annotations> + <description>Goes to the Admin URL Rewrite grid page. Deletes the provided Request Path. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="requestPath" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminDeleteUrlRewriteActionGroup` instead --> + <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="openUrlRewriteEditPage"/> + <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad"/> + <click selector="{{AdminUrlRewriteIndexSection.resetButton}}" stepKey="clickOnResetButton"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="{{requestPath}}" stepKey="fillRedirectPathFilter"/> + <click selector="{{AdminUrlRewriteIndexSection.searchButton}}" stepKey="clickOnSearchButton"/> + <waitForPageLoad stepKey="waitForPageToLoad1"/> + <click selector="{{AdminUrlRewriteIndexSection.editButton('1')}}" stepKey="clickOnEditButton"/> + <waitForPageLoad stepKey="waitForEditPageToLoad"/> + <click selector="{{AdminUrlRewriteEditSection.deleteButton}}" stepKey="clickOnDeleteButton"/> + <waitForPageLoad stepKey="waitForPageToLoad2"/> + <waitForElementVisible selector="{{AdminUrlRewriteEditSection.okButton}}" stepKey="waitForOkButtonToVisible"/> + <click selector="{{AdminUrlRewriteEditSection.okButton}}" stepKey="clickOnOkButton"/> + <waitForPageLoad stepKey="waitForPageToLoad3"/> + <see selector="{{AdminUrlRewriteIndexSection.successMessage}}" userInput="You deleted the URL rewrite." stepKey="seeSuccessMessage"/> + </actionGroup> + + <actionGroup name="AssertPageByUrlRewriteIsNotFound"> + <annotations> + <description>Validates that the provided Request Path does NOT exist on the Storefront. Validates that the 'Whoops' message is present and correct.</description> + </annotations> + <arguments> + <argument name="requestPath" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertPageByUrlRewriteIsNotFoundActionGroup` instead --> + <amOnPage url="{{requestPath}}" stepKey="amOnPage"/> + <waitForPageLoad stepKey="waitForStorefrontPageLoad"/> + <see userInput="Whoops, our bad..." stepKey="seeWhoops"/> + </actionGroup> + + <actionGroup name="AdminSearchAndSelectUrlRewriteInGrid"> + <annotations> + <description>Goes to the Admin URL Rewrite grid page. Searches the grid for the provided Request Path. Clicks on Edit.</description> + </annotations> + <arguments> + <argument name="requestPath" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminSearchAndSelectUrlRewriteInGridActionGroup` instead --> + <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="openUrlRewriteEditPage"/> + <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad"/> + <click selector="{{AdminUrlRewriteIndexSection.resetButton}}" stepKey="clickOnResetButton"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="{{requestPath}}" stepKey="fillRedirectPathFilter"/> + <click selector="{{AdminUrlRewriteIndexSection.searchButton}}" stepKey="clickOnSearchButton"/> + <waitForPageLoad stepKey="waitForPageToLoad1"/> + <click selector="{{AdminUrlRewriteIndexSection.editButton('1')}}" stepKey="clickOnEditButton"/> + <waitForPageLoad stepKey="waitForEditPageToLoad"/> + </actionGroup> + + <actionGroup name="AssertStorefrontUrlRewriteRedirect"> + <annotations> + <description>Goes to the provided New URL. Validates that the redirect works and the provided Category is present.</description> + </annotations> + <arguments> + <argument name="category" type="string"/> + <argument name="newRequestPath" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertStorefrontUrlRewriteRedirectActionGroup` instead --> + <amOnPage url="{{newRequestPath}}" stepKey="openCategoryInStorefront"/> + <waitForPageLoad stepKey="waitForCategoryPageToLoad"/> + <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(category)}}" stepKey="seeCategoryOnStoreNavigationBar"/> + <seeElement selector="{{StorefrontCategoryMainSection.CategoryTitle(category)}}" stepKey="seeCategoryInTitle"/> + </actionGroup> + + <actionGroup name="AssertStorefrontProductRedirect"> + <annotations> + <description>Goes to the provided New Product URL. Validates that the redirect works and the provided Product is present and correct.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + <argument name="productSku" type="string"/> + <argument name="productRequestPath" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertStorefrontProductRedirectActionGroup` instead --> + <amOnPage url="{{productRequestPath}}" stepKey="openCategoryInStorefront"/> + <waitForPageLoad stepKey="waitForCategoryPageToLoad"/> + <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{productName}}" stepKey="seeProductNameInStoreFrontPage"/> + <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{productSku}}" stepKey="seeProductSkuInStoreFrontPage"/> + </actionGroup> +</actionGroups> From 64936e3174869374bb767b820ce2fc3eb52ab864 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Wed, 4 Dec 2019 22:23:24 +0100 Subject: [PATCH 171/586] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- .../ActionGroup/_Deprecated_ActionGroup.xml | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 app/code/Magento/Ui/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/Ui/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Ui/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..48d6b90ddb8dc --- /dev/null +++ b/app/code/Magento/Ui/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,98 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="searchAdminDataGridByKeyword"> + <annotations> + <description>Fills 'Search by keyword' on an Admin Grid page. Clicks on Submit Search.</description> + </annotations> + <arguments> + <argument name="keyword"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SearchAdminDataGridByKeywordActionGroup` instead --> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <fillField selector="{{AdminDataGridHeaderSection.search}}" userInput="{{keyword}}" stepKey="fillKeywordSearchField"/> + <click selector="{{AdminDataGridHeaderSection.submitSearch}}" stepKey="clickKeywordSearch"/> + </actionGroup> + + <actionGroup name="resetAdminDataGridToDefaultView"> + <annotations> + <description>Resets an Admin Grid page to the 'Default View'.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ResetAdminDataGridToDefaultViewActionGroup` instead --> + <click selector="{{AdminDataGridHeaderSection.bookmarkToggle}}" stepKey="openViewBookmarks"/> + <click selector="{{AdminDataGridHeaderSection.bookmarkOption('Default View')}}" stepKey="selectDefaultGridView"/> + <see selector="{{AdminDataGridHeaderSection.bookmarkToggle}}" userInput="Default View" stepKey="seeDefaultViewSelected"/> + </actionGroup> + + <actionGroup name="clearFiltersAdminDataGrid"> + <annotations> + <description>Clicks on 'Clear Filters' on an Admin Grid page.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ClearFiltersAdminDataGridActionGroup` instead --> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> + </actionGroup> + + <actionGroup name="adminDataGridSelectPerPage"> + <annotations> + <description>Sets the provided preset 'per page' display setting on an Admin Grid page.</description> + </annotations> + <arguments> + <argument name="perPage" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminDataGridSelectPerPageActionGroup` instead --> + <click selector="{{AdminDataGridPaginationSection.perPageDropdown}}" stepKey="clickPerPageDropdown"/> + <click selector="{{AdminDataGridPaginationSection.perPageOption(perPage)}}" stepKey="selectCustomPerPage"/> + <waitForPageLoad stepKey="waitForGridLoad"/> + </actionGroup> + + <actionGroup name="adminDataGridSelectCustomPerPage"> + <annotations> + <description>Sets the provided custom 'per page' display setting on an Admin Grid page.</description> + </annotations> + <arguments> + <argument name="perPage"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminDataGridSelectCustomPerPageActionGroup` instead --> + <click selector="{{AdminDataGridPaginationSection.perPageDropdown}}" stepKey="clickPerPageDropdown"/> + <click selector="{{AdminDataGridPaginationSection.perPageOption('Custom')}}" stepKey="selectCustomPerPage"/> + <waitForElementVisible selector="{{AdminDataGridPaginationSection.perPageInput}}" time="30" stepKey="waitForInputVisible"/> + <fillField selector="{{AdminDataGridPaginationSection.perPageInput}}" userInput="{{perPage}}" stepKey="fillCustomPerPage"/> + <click selector="{{AdminDataGridPaginationSection.perPageApplyInput}}" stepKey="applyCustomPerPage"/> + <waitForLoadingMaskToDisappear stepKey="waitForGridLoad"/> + <seeInField selector="{{AdminDataGridPaginationSection.perPageDropDownValue}}" userInput="{{perPage}}" stepKey="seePerPageValueInDropDown"/> + </actionGroup> + + <actionGroup name="adminDataGridDeleteCustomPerPage"> + <annotations> + <description>Sets the provided custom 'per page' display setting on an Admin Grid page. Deletes the Items listed in a grid. Validates that the 'per page' count in NOT present.</description> + </annotations> + <arguments> + <argument name="perPage"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminDataGridDeleteCustomPerPageActionGroup` instead --> + <click selector="{{AdminDataGridPaginationSection.perPageDropdown}}" stepKey="clickPerPageDropdown1"/> + <click selector="{{AdminDataGridPaginationSection.perPageEditCustomValue(perPage)}}" stepKey="clickToEditCustomPerPage"/> + <waitForElementVisible selector="{{AdminDataGridPaginationSection.perPageDeleteCustomValue(perPage)}}" time="30" stepKey="waitForDeleteButtonVisible"/> + <click selector="{{AdminDataGridPaginationSection.perPageDeleteCustomValue(perPage)}}" stepKey="clickToDeleteCustomPerPage"/> + <waitForLoadingMaskToDisappear stepKey="waitForGridLoad"/> + <click selector="{{AdminDataGridPaginationSection.perPageDropdown}}" stepKey="clickPerPageDropdown"/> + <dontSeeElement selector="{{AdminDataGridPaginationSection.perPageDropDownItem(perPage)}}" stepKey="dontSeeDropDownItem"/> + </actionGroup> +</actionGroups> From 8289f8cd676459040a0d23c22a2854debbcbfb87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Wed, 4 Dec 2019 22:33:29 +0100 Subject: [PATCH 172/586] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- ...xml => AddCustomerTaxClassActionGroup.xml} | 0 .../ActionGroup/_Deprecated_ActionGroup.xml | 271 ++++++++++++++++++ 2 files changed, 271 insertions(+) rename app/code/Magento/Tax/Test/Mftf/ActionGroup/{AdminCustomerTaxClassActionGroup.xml => AddCustomerTaxClassActionGroup.xml} (100%) create mode 100644 app/code/Magento/Tax/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminCustomerTaxClassActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AddCustomerTaxClassActionGroup.xml similarity index 100% rename from app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminCustomerTaxClassActionGroup.xml rename to app/code/Magento/Tax/Test/Mftf/ActionGroup/AddCustomerTaxClassActionGroup.xml diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..95516361a74f5 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,271 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="addCustomerTaxClass"> + <annotations> + <description>Adds the provided Customer Tax Class on the Admin Tax Rule creation/edit page.</description> + </annotations> + <arguments> + <argument name="customerTaxClassName" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddCustomerTaxClassActionGroup` instead --> + <click stepKey="clickAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> + <click stepKey="clickCustomerAddNewTaxClassBtn" selector="{{AdminTaxRulesSection.customerAddNewTaxClass}}"/> + <fillField stepKey="fillCustomerNewTaxClass" selector="{{AdminTaxRulesSection.fieldCustomerNewTaxClass}}" userInput="{{customerTaxClassName}}"/> + <click stepKey="saveProdTaxRate" selector="{{AdminTaxRulesSection.saveCustomerNewTaxClass}}"/> + </actionGroup> + + <actionGroup name="deleteCustomerTaxClass"> + <annotations> + <description>Goes to the Admin New Tax Rule page. Deletes the provided Tax Class Name.</description> + </annotations> + <arguments> + <argument name="taxClassName" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `DeleteCustomerTaxClassActionGroup` instead --> + <amOnPage url="{{AdminNewTaxRulePage.url}}" stepKey="goToNewTaxRulePage"/> + <waitForPageLoad stepKey="waitForTaxRatePage"/> + <click stepKey="clickAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> + <scrollTo stepKey="scrollToAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> + <moveMouseOver stepKey="hoverDeleteElement" selector="{{AdminTaxRulesSection.deleteTaxClassName(taxClassName)}}"/> + <click stepKey="deleteFirstTaxClass" selector="{{AdminTaxRulesSection.deleteTaxClass(taxClassName)}}"/> + <waitForElementVisible selector="{{AdminTaxRulesSection.popUpDialogOK}}" stepKey="waitForElementBecomeVisible"/> + <click stepKey="acceptPopUpDialog" selector="{{AdminTaxRulesSection.popUpDialogOK}}"/> + <waitForPageLoad stepKey="waitForProductTaxClassDeleted"/> + </actionGroup> + <actionGroup name="editTaxConfigurationByUI"> + <annotations> + <description>Goes to the 'Configuration' page for 'Tax'. Enables the display of Taxes in the Storefront Shopping Cart and Checkout page.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `EditTaxConfigurationByUIActionGroup` instead --> + <amOnPage url="{{AdminTaxConfigurationPage.url}}" stepKey="goToAdminTaxPage"/> + <waitForPageLoad stepKey="waitForTaxConfigLoad"/> + + <scrollTo selector="#tax_defaults-head" x="0" y="-80" stepKey="scrollToTaxDefaults"/> + + <conditionalClick stepKey="clickCalculationSettings" selector="{{AdminConfigureTaxSection.defaultDestination}}" dependentSelector="#tax_defaults" visible="false"/> + <conditionalClick stepKey="clickCalculationSettingsAgain" selector="{{AdminConfigureTaxSection.defaultDestination}}" dependentSelector="#tax_defaults" visible="false"/> + <uncheckOption stepKey="clickDefaultState" selector="{{AdminConfigureTaxSection.systemValueDefaultState}}"/> + <selectOption stepKey="selectDefaultState" selector="{{AdminConfigureTaxSection.dropdownDefaultState}}" userInput="California"/> + <fillField stepKey="fillDefaultPostCode" selector="{{AdminConfigureTaxSection.defaultPostCode}}" userInput="*"/> + + <scrollTo selector="#tax_cart_display-head" x="0" y="-80" stepKey="scrollToTaxShoppingCartDisplay"/> + + <conditionalClick stepKey="clickShoppingCartDisplaySettings" selector="{{AdminConfigureTaxSection.shoppingCartDisplay}}" dependentSelector="#tax_cart_display" visible="false"/> + <conditionalClick stepKey="clickShoppingCartDisplaySettingsAgain" selector="{{AdminConfigureTaxSection.shoppingCartDisplay}}" dependentSelector="#tax_cart_display" visible="false"/> + <uncheckOption stepKey="clickTaxTotalCart" selector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalCart}}"/> + <selectOption stepKey="selectTaxTotalCart" selector="{{AdminConfigureTaxSection.dropdownIncludeTaxTotalCart}}" userInput="Yes"/> + <uncheckOption stepKey="clickDisplayTaxSummaryCart" selector="{{AdminConfigureTaxSection.systemValueDisplayTaxSummaryCart}}"/> + <selectOption stepKey="selectDisplayTaxSummaryCart" selector="{{AdminConfigureTaxSection.dropdownDisplayTaxSummaryCart}}" userInput="Yes"/> + <uncheckOption stepKey="clickDisplayZeroTaxCart" selector="{{AdminConfigureTaxSection.systemValueDisplayZeroTaxCart}}"/> + <selectOption stepKey="selectDisplayZeroTaxCart" selector="{{AdminConfigureTaxSection.dropdownDisplayZeroTaxCart}}" userInput="Yes"/> + + <scrollTo selector="#tax_sales_display-head" x="0" y="-80" stepKey="scrollToTaxSalesDisplay"/> + + <conditionalClick stepKey="clickOrdersInvoicesCreditSales" selector="{{AdminConfigureTaxSection.ordersInvoicesCreditSales}}" dependentSelector="#tax_sales_display" visible="false"/> + <conditionalClick stepKey="clickOrdersInvoicesCreditSalesAgain" selector="{{AdminConfigureTaxSection.ordersInvoicesCreditSales}}" dependentSelector="#tax_sales_display" visible="false"/> + <uncheckOption stepKey="clickTaxTotalSales" selector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalSales}}"/> + <selectOption stepKey="selectTaxTotalSales" selector="{{AdminConfigureTaxSection.dropdownIncludeTaxTotalSales}}" userInput="Yes"/> + <uncheckOption stepKey="clickDisplayTaxSummarySales" selector="{{AdminConfigureTaxSection.systemValueDisplayTaxSummarySales}}"/> + <selectOption stepKey="selectDisplayTaxSummarySales" selector="{{AdminConfigureTaxSection.dropdownDisplayTaxSummarySales}}" userInput="Yes"/> + <uncheckOption stepKey="clickDisplayZeroTaxSales" selector="{{AdminConfigureTaxSection.systemValueDisplayZeroTaxSales}}"/> + <selectOption stepKey="selectDisplayZeroTaxSales" selector="{{AdminConfigureTaxSection.dropdownDisplayZeroTaxSales}}" userInput="Yes"/> + + <scrollToTopOfPage stepKey="scrollToTop"/> + <click stepKey="saveTaxOptions" selector="{{AdminCategoryMainActionsSection.SaveButton}}"/> + <waitForPageLoad stepKey="waitForTaxSaved"/> + <see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/> + </actionGroup> + + <actionGroup name="changeToDefaultTaxConfigurationUI"> + <annotations> + <description>Goes to the 'Configuration' page for 'Tax'. Set the Tax Configuration Settings to the Default values. Clicks on Save. Validates that the Success Message is present and correct.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ChangeToDefaultTaxConfigurationUIActionGroup` instead --> + <amOnPage url="{{AdminTaxConfigurationPage.url}}" stepKey="goToAdminTaxPage"/> + <waitForPageLoad stepKey="waitForTaxConfigLoad"/> + + <conditionalClick stepKey="clickCalculationSettings" selector="{{AdminConfigureTaxSection.defaultDestination}}" dependentSelector="{{AdminConfigureTaxSection.systemValueDefaultState}}" visible="false"/> + <conditionalClick stepKey="clickCalculationSettingsAgain" selector="{{AdminConfigureTaxSection.defaultDestination}}" dependentSelector="{{AdminConfigureTaxSection.systemValueDefaultState}}" visible="false"/> + <checkOption stepKey="clickDefaultState" selector="{{AdminConfigureTaxSection.systemValueDefaultState}}"/> + <selectOption stepKey="selectDefaultState" selector="{{AdminConfigureTaxSection.dropdownDefaultState}}" userInput="California"/> + <fillField stepKey="fillDefaultPostCode" selector="{{AdminConfigureTaxSection.defaultPostCode}}" userInput=""/> + + <conditionalClick stepKey="clickShoppingCartDisplaySettings" selector="{{AdminConfigureTaxSection.shoppingCartDisplay}}" dependentSelector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalCart}}" visible="false"/> + <conditionalClick stepKey="clickShoppingCartDisplaySettingsAgain" selector="{{AdminConfigureTaxSection.shoppingCartDisplay}}" dependentSelector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalCart}}" visible="false"/> + <checkOption stepKey="clickTaxTotalCart" selector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalCart}}"/> + <selectOption stepKey="selectTaxTotalCart" selector="{{AdminConfigureTaxSection.dropdownIncludeTaxTotalCart}}" userInput="Yes"/> + <checkOption stepKey="clickDisplayTaxSummaryCart" selector="{{AdminConfigureTaxSection.systemValueDisplayTaxSummaryCart}}"/> + <selectOption stepKey="selectDisplayTaxSummaryCart" selector="{{AdminConfigureTaxSection.dropdownDisplayTaxSummaryCart}}" userInput="Yes"/> + <checkOption stepKey="clickDisplayZeroTaxCart" selector="{{AdminConfigureTaxSection.systemValueDisplayZeroTaxCart}}"/> + <selectOption stepKey="selectDisplayZeroTaxCart" selector="{{AdminConfigureTaxSection.dropdownDisplayZeroTaxCart}}" userInput="Yes"/> + + <conditionalClick stepKey="clickOrdersInvoicesCreditSales" selector="{{AdminConfigureTaxSection.ordersInvoicesCreditSales}}" dependentSelector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalSales}}" visible="false"/> + <conditionalClick stepKey="clickOrdersInvoicesCreditSalesAgain" selector="{{AdminConfigureTaxSection.ordersInvoicesCreditSales}}" dependentSelector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalSales}}" visible="false"/> + <checkOption stepKey="clickTaxTotalSales" selector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalSales}}"/> + <selectOption stepKey="selectTaxTotalSales" selector="{{AdminConfigureTaxSection.dropdownIncludeTaxTotalSales}}" userInput="Yes"/> + <checkOption stepKey="clickDisplayTaxSummarySales" selector="{{AdminConfigureTaxSection.systemValueDisplayTaxSummarySales}}"/> + <selectOption stepKey="selectDisplayTaxSummarySales" selector="{{AdminConfigureTaxSection.dropdownDisplayTaxSummarySales}}" userInput="Yes"/> + <checkOption stepKey="clickDisplayZeroTaxSales" selector="{{AdminConfigureTaxSection.systemValueDisplayZeroTaxSales}}"/> + <selectOption stepKey="selectDisplayZeroTaxSales" selector="{{AdminConfigureTaxSection.dropdownDisplayZeroTaxSales}}" userInput="Yes"/> + + <scrollToTopOfPage stepKey="scrollToTop"/> + <click stepKey="saveTaxOptions" selector="{{AdminCategoryMainActionsSection.SaveButton}}"/> + <see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/> + </actionGroup> + + <actionGroup name="addCustomTaxRate" extends="addNewTaxRateNoZip"> + <annotations> + <description>EXTENDS: addNewTaxRateNoZip. Removes 'fillZipCode' and 'fillRate'. Fills in the Zip Code and Rate. PLEASE NOTE: The values are Hardcoded.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddCustomTaxRateActionGroup` instead --> + <remove keyForRemoval="fillZipCode"/> + <remove keyForRemoval="fillRate"/> + <fillField stepKey="fillZipCode" selector="{{AdminTaxRulesSection.zipCode}}" userInput="US-NY-*-Rate 2" after="fillTaxIdentifier"/> + <fillField stepKey="fillRate" selector="{{AdminTaxRulesSection.rate}}" userInput="0" after="selectCountry"/> + </actionGroup> + + <actionGroup name="addNewTaxRateNoZip"> + <annotations> + <description>Goes to the Admin Tax Rules grid page. Adds the provided Tax Code.</description> + </annotations> + <arguments> + <argument name="taxCode"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddNewTaxRateNoZipActionGroup` instead --> + <click stepKey="addNewTaxRate" selector="{{AdminTaxRulesSection.addNewTaxRate}}"/> + + <fillField stepKey="fillTaxIdentifier" selector="{{AdminTaxRulesSection.taxIdentifier}}" userInput="{{taxCode.state}}-{{taxCode.rate}}"/> + <fillField stepKey="fillZipCode" selector="{{AdminTaxRulesSection.zipCode}}" userInput="{{taxCode.zip}}"/> + <selectOption stepKey="selectState" selector="{{AdminTaxRulesSection.state}}" userInput="{{taxCode.state}}"/> + <selectOption stepKey="selectCountry" selector="{{AdminTaxRulesSection.country}}" userInput="{{taxCode.country}}"/> + <fillField stepKey="fillRate" selector="{{AdminTaxRulesSection.rate}}" userInput="{{taxCode.rate}}"/> + + <click stepKey="saveTaxRate" selector="{{AdminTaxRulesSection.save}}"/> + </actionGroup> + + <actionGroup name="changeShippingTaxClass"> + <annotations> + <description>Goes to the 'Configuration' page for 'Tax'. Sets the 'Tax Class for Shipping' configuration setting to 'Taxable Goods'. Clicks on Save. Validates that the Success Message is present and correct.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ChangeShippingTaxClassActionGroup` instead --> + <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES"/> + <waitForPageLoad stepKey="waitForConfiguration"/> + <click selector="{{AdminMenuSection.configuration}}" stepKey="clickOnConfigurations"/> + <waitForPageLoad stepKey="waitForSales"/> + + <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES1"/> + <waitForPageLoad stepKey="waitForConfiguration1"/> + <click selector="{{AdminMenuSection.configuration}}" stepKey="clickOnConfigurations1"/> + <waitForPageLoad stepKey="waitForSales1" time="5"/> + + <click selector="{{ConfigurationListSection.sales}}" stepKey="clickOnSales"/> + <waitForPageLoad stepKey="waitForPaymentMethods"/> + <click selector="{{AdminConfigureTaxSection.salesTax}}" stepKey="clickOnTax"/> + <waitForPageLoad stepKey="waitForTax"/> + <seeInCurrentUrl url="{{AdminTaxConfigurationPage.url}}" stepKey="adminTaxConfiguration"/> + <seeElement selector="{{AdminConfigureTaxSection.taxClasses}}" stepKey="taxClassSectionC"/> + <click selector="{{AdminConfigureTaxSection.taxClasses}}" stepKey="openTaxClassSection"/> + <click selector="{{AdminConfigureTaxSection.taxShippingClassSystem}}" stepKey="uncheckSystemValue"/> + <selectOption selector="{{AdminConfigureTaxSection.taxClassShipping}}" userInput="Taxable Goods" stepKey="setTaxClassForShipping"/> + + <scrollToTopOfPage stepKey="scrollToTop"/> + <click stepKey="saveTaxOptions" selector="{{AdminCategoryMainActionsSection.SaveButton}}"/> + <waitForPageLoad stepKey="waitForTaxSaved"/> + <see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/> + </actionGroup> + + <actionGroup name="setDefaultShippingTaxClass"> + <annotations> + <description>Goes to the 'Configuration' page via the Admin Side Menu. Sets the 'Tax Class for Shipping' to the System Default. Clicks on Save. Validates that the Success Message is present and correct.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SetDefaultShippingTaxClassActionGroup` instead --> + <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES"/> + <waitForPageLoad stepKey="waitForConfiguration"/> + <click selector="{{AdminMenuSection.configuration}}" stepKey="clickOnConfigurations"/> + <waitForPageLoad stepKey="waitForSales"/> + + <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES1"/> + <waitForPageLoad stepKey="waitForConfiguration1"/> + <click selector="{{AdminMenuSection.configuration}}" stepKey="clickOnConfigurations1"/> + <waitForPageLoad stepKey="waitForSales1"/> + + <click selector="{{ConfigurationListSection.sales}}" stepKey="clickOnSales"/> + <waitForPageLoad stepKey="waitForPaymentMethods"/> + <click selector="{{AdminConfigureTaxSection.salesTax}}" stepKey="clickOnTax"/> + <waitForPageLoad stepKey="waitForTax"/> + <seeElement selector="{{AdminConfigureTaxSection.taxClasses}}" stepKey="taxClassSectionC"/> + <click selector="{{AdminConfigureTaxSection.taxShippingClassSystem}}" stepKey="checkSystemDefaultValue"/> + <click selector="{{AdminConfigureTaxSection.taxClasses}}" stepKey="closeTaxClassSection"/> + + <scrollToTopOfPage stepKey="scrollToTop"/> + <click stepKey="saveTaxOptions" selector="{{AdminCategoryMainActionsSection.SaveButton}}"/> + <waitForPageLoad stepKey="waitForTaxSaved"/> + <see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/> + </actionGroup> + + <actionGroup name="addProductTaxClass"> + <annotations> + <description>Adds the provided Product Tax Class to a Tax Rule. Clicks on Save.</description> + </annotations> + <arguments> + <argument name="prodTaxClassName" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddProductTaxClassActionGroup` instead --> + <click stepKey="clickAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> + <click stepKey="clickProdAddNewTaxClassBtn" selector="{{AdminTaxRulesSection.productAddNewTaxClass}}"/> + <fillField stepKey="fillProdNewTaxClass" selector="{{AdminTaxRulesSection.fieldProdNewTaxClass}}" userInput="{{prodTaxClassName}}"/> + <click stepKey="saveProdTaxRate" selector="{{AdminTaxRulesSection.saveProdNewTaxClass}}"/> + </actionGroup> + + <actionGroup name="addNewTaxRuleActionGroup"> + <annotations> + <description>Goes to the Admin Tax Rules grid page. Clicks on the Add New Tax Rule button.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddNewTaxRuleActionGroup` instead --> + <amOnPage url="{{AdminTaxRuleGridPage.url}}" stepKey="goToTaxRulePage"/> + <waitForPageLoad stepKey="waitForTaxRatePage"/> + <click stepKey="addNewTaxRate" selector="{{AdminGridMainControls.add}}"/> + </actionGroup> + + <actionGroup name="deleteProductTaxClass"> + <annotations> + <description>Goes to the Admin Tax Rule creation page. Deletes the provided Tax Class.</description> + </annotations> + <arguments> + <argument name="taxClassName" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `DeleteProductTaxClassActionGroup` instead --> + <amOnPage url="{{AdminNewTaxRulePage.url}}" stepKey="goToNewTaxRulePage"/> + <waitForPageLoad stepKey="waitForTaxRatePage"/> + <click stepKey="clickAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> + <scrollTo stepKey="scrollToAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> + <moveMouseOver stepKey="hoverDeleteElement" selector="{{AdminTaxRulesSection.deleteTaxClassName(taxClassName)}}"/> + <click stepKey="deleteFirstTaxClass" selector="{{AdminTaxRulesSection.deleteTaxClass(taxClassName)}}"/> + <waitForElementVisible selector="{{AdminTaxRulesSection.popUpDialogOK}}" stepKey="waitForElementBecomeVisible"/> + <click stepKey="acceptPopUpDialog" selector="{{AdminTaxRulesSection.popUpDialogOK}}"/> + <waitForPageLoad stepKey="waitForProductTaxClassDeleted"/> + </actionGroup> +</actionGroups> From c58d35203e88d87d4b08bf1b981173134e00652d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Wed, 4 Dec 2019 22:39:57 +0100 Subject: [PATCH 173/586] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- .../ActionGroup/_Deprecated_ActionGroup.xml | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 app/code/Magento/Swatches/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..676d6bb2d3e37 --- /dev/null +++ b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,115 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="setColorPickerByHex"> + <annotations> + <description>Sets the provided HEX value in the provided Color Picker.</description> + </annotations> + <arguments> + <argument name="nthColorPicker" type="string" defaultValue="1"/> + <argument name="hexColor" type="string" defaultValue="e74c3c"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SetColorPickerByHexActionGroup` instead --> + <pressKey selector="{{AdminColorPickerSection.hexByIndex(nthColorPicker)}}" parameterArray="[\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,'{{hexColor}}']" stepKey="fillHex1"/> + <click selector="{{AdminColorPickerSection.submitByIndex(nthColorPicker)}}" stepKey="submitColor1"/> + </actionGroup> + + <actionGroup name="assertSwatchColor"> + <annotations> + <description>Validates that the provided Color Picker contains the provided Style.</description> + </annotations> + <arguments> + <argument name="nthSwatch" type="string" defaultValue="1"/> + <argument name="expectedStyle" type="string" defaultValue="background: rgb(0, 0, 0);"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertSwatchColorActionGroup` instead --> + <grabAttributeFrom selector="{{AdminManageSwatchSection.nthSwatch(nthSwatch)}}" userInput="style" stepKey="grabStyle1"/> + <assertEquals stepKey="assertStyle1"> + <actualResult type="string">{$grabStyle1}</actualResult> + <expectedResult type="string">{{expectedStyle}}</expectedResult> + </assertEquals> + </actionGroup> + + <actionGroup name="assertStorefrontSwatchColor"> + <annotations> + <description>Validates that the Storefront Product has the provided Swatch with the provided Color.</description> + </annotations> + <arguments> + <argument name="nthSwatch" type="string" defaultValue="1"/> + <argument name="expectedRgb" type="string" defaultValue="rgb(231, 77, 60)"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertStorefrontSwatchColorActionGroup` instead --> + <grabAttributeFrom selector="{{StorefrontProductInfoMainSection.nthSwatchOption(nthSwatch)}}" userInput="style" stepKey="grabStyle1"/> + <assertEquals stepKey="assertStyle1"> + <actualResult type="string">{$grabStyle1}</actualResult> + <expectedResult type="string">background: center center no-repeat {{expectedRgb}};</expectedResult> + </assertEquals> + </actionGroup> + + <actionGroup name="openSwatchMenuByIndex"> + <annotations> + <description>Options the Swatch Menu based on the provided Index.</description> + </annotations> + <arguments> + <argument name="index" type="string" defaultValue="0"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `OpenSwatchMenuByIndexActionGroup` instead --> + <executeJS function="jQuery('#swatch_window_option_option_{{index}}').click()" stepKey="clickSwatch1"/> + </actionGroup> + + <actionGroup name="StorefrontSelectSwatchOptionOnProductPage"> + <arguments> + <argument name="optionName" type="string"/> + </arguments> + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontSelectSwatchOptionOnProductPageActionGroup` instead --> + <click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel(optionName)}}" stepKey="clickSwatchOption"/> + </actionGroup> + + <actionGroup name="StorefrontAssertSwatchOptionPrice"> + <arguments> + <argument name="optionName" type="string"/> + <argument name="optionPrice" type="string"/> + </arguments> + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontAssertSwatchOptionPriceActionGroup` instead --> + <click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel(optionName)}}" stepKey="clickOnOption"/> + <see userInput="{{optionPrice}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="seeOptionPrice"/> + </actionGroup> + + <actionGroup name="StorefrontSelectSwatchOptionOnProductPageAndCheckImage" extends="StorefrontSelectSwatchOptionOnProductPage"> + <arguments> + <argument name="fileName" type="string" defaultValue="magento-logo"/> + </arguments> + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontSelectSwatchOptionOnProductPageAndCheckImageActionGroup` instead --> + <seeElement selector="{{StorefrontProductMediaSection.productImageActive(fileName)}}" stepKey="seeActiveImageDefault"/> + </actionGroup> + + <actionGroup name="StorefrontUpdateCartConfigurableProductWithSwatches"> + <arguments> + <argument name="product"/> + <argument name="productOption" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontUpdateCartConfigurableProductWithSwatchesActionGroup` instead --> + <click selector="{{CheckoutCartProductSection.nthEditButton('1')}}" stepKey="clickEditConfigurableProductButton"/> + <waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> + <click selector="{{StorefrontProductInfoMainSection.visualSwatchOption(productOption)}}" stepKey="changeSwatchAttributeOption"/> + <click selector="{{StorefrontProductInfoMainSection.updateCart}}" stepKey="clickUpdateCartButton"/> + <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/> + <see selector="{{StorefrontMessagesSection.success}}" userInput="{{product.name}} was updated in your shopping cart." stepKey="assertSuccessMessage"/> + </actionGroup> +</actionGroups> From a00875e37b6adea0be3511426bbb066d52544fe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Wed, 4 Dec 2019 22:49:45 +0100 Subject: [PATCH 174/586] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- .../ActionGroup/_Deprecated_ActionGroup.xml | 247 ++++++++++++++++++ 1 file changed, 247 insertions(+) create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..7654b1baef2d8 --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,247 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="CreateCustomStore"> + <annotations> + <description>Goes to the Admin Stores grid page. Clicks on 'Create Store'. Fills in the provided Details (Website, Store Group Name and Store Group Code). Clicks on Save. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="website" type="string"/> + <argument name="store" type="string"/> + <argument name="rootCategory" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateCustomStoreActionGroup` instead --> + <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> + <waitForPageLoad stepKey="waitForSystemStorePage"/> + <click selector="{{AdminStoresMainActionsSection.createStoreButton}}" stepKey="selectCreateStore"/> + <selectOption userInput="{{website}}" selector="{{AdminNewStoreGroupSection.storeGrpWebsiteDropdown}}" stepKey="selectMainWebsite"/> + <fillField userInput="{{store}}" selector="{{AdminNewStoreGroupSection.storeGrpNameTextField}}" stepKey="fillStoreName"/> + <fillField userInput="{{store}}" selector="{{AdminNewStoreGroupSection.storeGrpCodeTextField}}" stepKey="fillStoreCode"/> + <selectOption userInput="{{rootCategory}}" selector="{{AdminNewStoreGroupSection.storeRootCategoryDropdown}}" stepKey="selectStoreStatus"/> + <click selector="{{AdminStoreGroupActionsSection.saveButton}}" stepKey="clickSaveStoreGroup"/> + <waitForElementVisible selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="waitForStoreGridReload"/> + <see userInput="You saved the store." stepKey="seeSavedMessage"/> + </actionGroup> + + <actionGroup name="AssertStoreGroupInGrid"> + <annotations> + <description>Goes to the Admin Stores grid page. Searches for the provided Store Group Name. Validates that the provided Store Group Name is present in the grid.</description> + </annotations> + <arguments> + <argument name="storeGroupName" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertStoreGroupInGridActionGroup` instead --> + <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> + <waitForPageLoad stepKey="waitForAdminSystemStorePageLoad"/> + <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> + <fillField userInput="{{storeGroupName}}" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="fillSearchStoreGroupField"/> + <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> + <waitForPageLoad stepKey="waitForStoreToLoad"/> + <see selector="{{AdminStoresGridSection.nthRow('1')}}" userInput="{{storeGroupName}}" stepKey="seeAssertStoreGroupInGridMessage"/> + </actionGroup> + + <actionGroup name="AssertStoreGroupForm"> + <annotations> + <description>Clicks on the 1st Store in the 'Stores' grid. Validates that the provided Details (Website, Store Group Name, Store Group Code and Root Category) are present and correct.</description> + </annotations> + <arguments> + <argument name="website" type="string"/> + <argument name="storeGroupName" type="string"/> + <argument name="storeGroupCode" type="string"/> + <argument name="rootCategory" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertStoreGroupFormActionGroup` instead --> + <click selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="clickEditExistingStoreRow"/> + <waitForPageLoad stepKey="waitTillAdminSystemStoreGroupPage"/> + <seeInField selector="{{AdminNewStoreGroupSection.storeGrpWebsiteDropdown}}" userInput="{{website}}" stepKey="seeAssertWebsite"/> + <seeInField selector="{{AdminNewStoreGroupSection.storeGrpNameTextField}}" userInput="{{storeGroupName}}" stepKey="seeAssertStoreGroupName"/> + <seeInField selector="{{AdminNewStoreGroupSection.storeGrpCodeTextField}}" userInput="{{storeGroupCode}}" stepKey="seeAssertStoreGroupCode"/> + <seeInField selector="{{AdminNewStoreGroupSection.storeRootCategoryDropdown}}" userInput="{{rootCategory}}" stepKey="seeAssertRootCategory"/> + </actionGroup> + + <actionGroup name="AdminCreateStoreViewActionSaveGroup"> + <annotations> + <description>Validates that the Success Message is present and correct.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminCreateStoreViewSaveActionGroup` instead --> + <waitForLoadingMaskToDisappear stepKey="waitForGridLoad"/> + <waitForElementVisible selector="{{AdminStoresGridSection.websiteFilterTextField}}" stepKey="waitForStoreGridToReload2"/> + <see userInput="You saved the store view." stepKey="seeSavedMessage"/> + </actionGroup> + + <actionGroup name="navigateToAdminContentManagementPage"> + <annotations> + <description>Goes to the 'Configuration' page for 'Content Management'.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `NavigateToAdminContentManagementPageActionGroup` instead --> + <amOnPage url="{{AdminContentManagementPage.url}}" stepKey="navigateToConfigurationPage"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + </actionGroup> + + <actionGroup name="saveStoreConfiguration"> + <annotations> + <description>Clicks on the Save button.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SaveStoreConfigurationActionGroup` instead --> + <comment userInput="saveStoreConfiguration" stepKey="comment"/> + <waitForElementVisible selector="{{StoreConfigSection.Save}}" stepKey="waitForSaveButton"/> + <click selector="{{StoreConfigSection.Save}}" stepKey="clickSaveButton"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> + + <actionGroup name="saveStoreConfigurationAndValidateFieldError"> + <annotations> + <description>Clicks on Save. Validates that the fields are required.</description> + </annotations> + <arguments> + <argument name="inputFieldError" type="string"/> + <argument name="errorMessageSelector" type="string"/> + <argument name="errorMessage" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SaveStoreConfigurationAndValidateFieldErrorActionGroup` instead --> + <comment userInput="saveStoreConfigurationAndValidateFieldError" stepKey="comment"/> + <waitForElementVisible selector="{{StoreConfigSection.Save}}" stepKey="waitForSaveButton"/> + <click selector="{{StoreConfigSection.Save}}" stepKey="clickSaveButton"/> + <waitForElement selector="{{inputFieldError}}" stepKey="waitForErrorField"/> + <waitForElementVisible selector="{{errorMessageSelector}}" stepKey="waitForErrorMessage"/> + <see selector="{{errorMessageSelector}}" userInput="{{errorMessage}}" stepKey="seeErrorMessage"/> + </actionGroup> + + <actionGroup name="AssertWebsiteInGrid"> + <annotations> + <description>Goes to the Admin Stores grid page. Searches the grid for the provided Website Name. Validates that the Website appears in the grid.</description> + </annotations> + <arguments> + <argument name="websiteName" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertWebsiteInGridActionGroup` instead --> + <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> + <waitForPageLoad stepKey="waitForAdminSystemStorePageLoad"/> + <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> + <fillField userInput="{{websiteName}}" selector="{{AdminStoresGridSection.websiteFilterTextField}}" stepKey="fillWebsiteField"/> + <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> + <waitForPageLoad stepKey="waitForStoreToLoad"/> + <seeElement selector="{{AdminStoresGridSection.websiteName(websiteName)}}" stepKey="seeAssertWebsiteInGrid"/> + </actionGroup> + + <actionGroup name="AssertWebsiteForm"> + <annotations> + <description>Clicks on the provided Website Name in the Admin Stores grid. Validates that the URL, Website Name/Code are present and correct.</description> + </annotations> + <arguments> + <argument name="websiteName" type="string"/> + <argument name="websiteCode" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertWebsiteFormActionGroup` instead --> + <click selector="{{AdminStoresGridSection.websiteName(websiteName)}}" stepKey="clickWebsiteFirstRowInGrid"/> + <waitForPageLoad stepKey="waitTillWebsiteFormPageIsOpened"/> + <grabFromCurrentUrl regex="~(\d+)/~" stepKey="grabWebsiteIdFromCurrentUrl"/> + <seeInCurrentUrl url="/system_store/editWebsite/website_id/{$grabWebsiteIdFromCurrentUrl}" stepKey="seeWebsiteId"/> + <seeInField selector="{{AdminNewWebsiteSection.name}}" userInput="{{websiteName}}" stepKey="seeAssertWebsiteName"/> + <seeInField selector="{{AdminNewWebsiteSection.code}}" userInput="{{websiteCode}}" stepKey="seeAssertWebsiteCode"/> + </actionGroup> + + <actionGroup name="AssertStoreViewNotInGrid"> + <annotations> + <description>Goes to the Admin Stores grid page. Searches the grid for the provided Store View name. Validates that it does NOT appear in the grid.</description> + </annotations> + <arguments> + <argument name="storeViewName" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertStoreViewNotInGridActionGroup` instead --> + <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> + <waitForPageLoad stepKey="waitForAdminSystemStorePageLoad"/> + <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> + <fillField userInput="{{storeViewName}}" selector="{{AdminStoresGridSection.storeFilterTextField}}" stepKey="fillSearchStoreViewField"/> + <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> + <waitForPageLoad stepKey="waitForStoreToLoad"/> + <see selector="{{AdminStoresGridSection.emptyText}}" userInput="We couldn't find any records." stepKey="seeAssertStoreViewNotInGridMessage"/> + </actionGroup> + + <actionGroup name="AdminAddCustomWebSiteToStoreGroup"> + <annotations> + <description>Goes to the Admin Stores grid page. Searches the grid for the provided Store Group. Edits the Store. Adds the provided Website to the Store. Clicks on Save. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="storeGroup" defaultValue="customStoreGroup"/> + <argument name="website" defaultValue="customWebsite"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminAddCustomWebSiteToStoreGroupActionGroup` instead --> + <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> + <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> + <fillField userInput="{{storeGroup.name}}" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="fillSearchStoreGroupField"/> + <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> + <see userInput="{{storeGroup.name}}" selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="verifyThatCorrectStoreGroupFound"/> + <click selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="clickEditExistingStoreRow"/> + <waitForPageLoad stepKey="waitForStoreGroupPageLoad"/> + <selectOption selector="{{AdminNewStoreGroupSection.storeGrpWebsiteDropdown}}" userInput="{{website.name}}" stepKey="selectWebsite"/> + <selectOption selector="{{AdminNewStoreGroupSection.storeRootCategoryDropdown}}" userInput="Default Category" stepKey="chooseRootCategory"/> + <click selector="{{AdminNewStoreGroupActionsSection.saveButton}}" stepKey="clickSaveStoreGroup"/> + <conditionalClick selector="{{AdminNewStoreGroupSection.acceptNewStoreGroupCreation}}" dependentSelector="{{AdminNewStoreGroupSection.acceptNewStoreGroupCreation}}" visible="true" stepKey="clickAcceptNewStoreGroupCreationButton"/> + <waitForElementVisible selector="{{AdminStoresGridSection.storeFilterTextField}}" stepKey="waitForPageReload"/> + <see userInput="You saved the store." stepKey="seeSavedMessage"/> + </actionGroup> + + <actionGroup name="CreateStoreView"> + <annotations> + <description>Goes to the Admin Store Views creation page. Fills in the provided Store View, Store Group Name and Store View Status. Clicks on Save. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="storeView" defaultValue="customStore"/> + <argument name="storeGroupName" defaultValue="_defaultStoreGroup.name"/> + <argument name="storeViewStatus" defaultValue="_defaultStore.is_active"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateStoreViewActionGroup` instead --> + <amOnPage url="{{AdminSystemStoreViewPage.url}}" stepKey="amOnAdminSystemStoreViewPage"/> + <waitForPageLoad stepKey="waitForProductPageLoad"/> + <selectOption userInput="{{storeGroupName}}" selector="{{AdminNewStoreSection.storeGrpDropdown}}" stepKey="selectStoreGroup"/> + <fillField userInput="{{storeView.name}}" selector="{{AdminNewStoreSection.storeNameTextField}}" stepKey="fillStoreViewName"/> + <fillField userInput="{{storeView.code}}" selector="{{AdminNewStoreSection.storeCodeTextField}}" stepKey="fillStoreViewCode"/> + <selectOption userInput="{{storeViewStatus}}" selector="{{AdminNewStoreSection.statusDropdown}}" stepKey="selectStoreViewStatus"/> + <click selector="{{AdminStoresMainActionsSection.saveButton}}" stepKey="clickSaveStoreViewButton"/> + <waitForElementVisible selector="{{AdminNewStoreSection.acceptNewStoreViewCreation}}" stepKey="waitForAcceptNewStoreViewCreationButton"/> + <conditionalClick selector="{{AdminNewStoreSection.acceptNewStoreViewCreation}}" dependentSelector="{{AdminNewStoreSection.acceptNewStoreViewCreation}}" visible="true" stepKey="clickAcceptNewStoreViewCreationButton"/> + <see userInput="You saved the store view." stepKey="seeSavedMessage"/> + </actionGroup> + + <actionGroup name="AssertStoreNotInGrid"> + <annotations> + <description>Goes to the Admin Stores grid page. Validates that the provided Store Group Name is NOT present in the grid.</description> + </annotations> + <arguments> + <argument name="storeGroupName" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertStoreNotInGridActionGroup` instead --> + <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> + <waitForPageLoad stepKey="waitForAdminSystemStorePageLoad"/> + <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> + <fillField userInput="{{storeGroupName}}" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="fillSearchStoreGroupField"/> + <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> + <waitForPageLoad stepKey="waitForStoreToLoad"/> + <see selector="{{AdminStoresGridSection.emptyText}}" userInput="We couldn't find any records." stepKey="seeAssertStoreGroupNotInGridMessage"/> + </actionGroup> +</actionGroups> From ccb04de3b72da75e6fed51140fb79558f887452c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Wed, 4 Dec 2019 23:00:21 +0100 Subject: [PATCH 175/586] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- .../ActionGroup/_Deprecated_ActionGroup.xml | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 app/code/Magento/Search/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/Search/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Search/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..6c860e8273bab --- /dev/null +++ b/app/code/Magento/Search/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="searchTermFilterBySearchQuery"> + <annotations> + <description>Fills in the provided Search Query on the Admin Search Term grid page.</description> + </annotations> + <arguments> + <argument name="searchQuery" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminSearchTermFilterBySearchQueryActionGroup` instead --> + <click selector="{{AdminCatalogSearchTermIndexSection.resetFilterButton}}" stepKey="clickOnResetButton"/> + <waitForPageLoad stepKey="waitForResetFilter"/> + <fillField selector="{{AdminCatalogSearchTermIndexSection.searchQuery}}" userInput="{{searchQuery}}" stepKey="fillSearchQuery"/> + <click selector="{{AdminCatalogSearchTermIndexSection.searchButton}}" stepKey="clickSearchButton"/> + <waitForPageLoad stepKey="waitForSearchResultLoad"/> + <checkOption selector="{{AdminCatalogSearchTermIndexSection.searchTermRowCheckboxBySearchQuery(searchQuery)}}" stepKey="checkCheckBox"/> + </actionGroup> + + <actionGroup name="deleteSearchTerm"> + <annotations> + <description>Deletes the Search Terms in the Admin Search Term grid.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminDeleteSearchTermActionGroup` instead --> + <selectOption selector="{{AdminCatalogSearchTermIndexSection.massActions}}" userInput="delete" stepKey="selectDeleteOption"/> + <click selector="{{AdminCatalogSearchTermIndexSection.submit}}" stepKey="clickSubmitButton"/> + <click selector="{{AdminCatalogSearchTermIndexSection.okButton}}" stepKey="clickOkButton"/> + <waitForElementVisible selector="{{AdminCatalogSearchTermMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/> + </actionGroup> + + <actionGroup name="DeleteAllSearchTerms"> + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminDeleteAllSearchTermsActionGroup` instead --> + <selectOption userInput="selectAll" selector="{{AdminCatalogSearchTermIndexSection.selectMassActionCheckbox}}" stepKey="checkAllSearchTerms"/> + <selectOption selector="{{AdminCatalogSearchTermIndexSection.massActions}}" userInput="delete" stepKey="selectDeleteOption"/> + <click selector="{{AdminCatalogSearchTermIndexSection.submit}}" stepKey="clickSubmitButton"/> + <click selector="{{AdminCatalogSearchTermIndexSection.okButton}}" stepKey="clickOkButton"/> + </actionGroup> +</actionGroups> From 8ff30a8dc9d2ce8854793d1654fcf5f7122b5ffa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Wed, 4 Dec 2019 23:11:51 +0100 Subject: [PATCH 176/586] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- .../ActionGroup/_Deprecated_ActionGroup.xml | 110 ++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..648500bcaeb40 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,110 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="selectNotLoggedInCustomerGroup"> + <annotations> + <description>Selects 'NOT LOGGED IN' from the 'Customer Groups' list (Magento 2 B2B). PLEASE NOTE: The value is Hardcoded.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SelectNotLoggedInCustomerGroupActionGroup` instead --> + <selectOption selector="{{AdminCartPriceRulesFormSection.customerGroups}}" userInput="NOT LOGGED IN" stepKey="selectCustomerGroup"/> + </actionGroup> + + <actionGroup name="selectRetailerCustomerGroup"> + <annotations> + <description>Selects 'Retailer' from the 'Customer Groups' list (Magento 2 B2B). PLEASE NOTE: The value is Hardcoded.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SelectRetailerCustomerGroupActionGroup` instead --> + <selectOption selector="{{AdminCartPriceRulesFormSection.customerGroups}}" userInput="Retailer" stepKey="selectRetailerCustomerGroup"/> + </actionGroup> + + <actionGroup name="AdminCreateCartPriceRuleWithCouponCode" extends="AdminCreateCartPriceRuleActionGroup"> + <annotations> + <description>EXTENDS: AdminCreateCartPriceRuleActionGroup. Removes 'selectActionType' and 'fillDiscountAmount'. Adds the provided Coupon Code to a Cart Price Rule.</description> + </annotations> + <arguments> + <argument name="couponCode" defaultValue="_defaultCoupon.code"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminCreateCartPriceRuleWithCouponCodeActionGroup` instead --> + <remove keyForRemoval="selectActionType"/> + <remove keyForRemoval="fillDiscountAmount"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.coupon}}" userInput="Specific Coupon" stepKey="selectCouponType" after="fillRuleName"/> + <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.couponCode}}" stepKey="waitForElementVisible" after="selectCouponType"/> + <fillField selector="{{AdminCartPriceRulesFormSection.couponCode}}" userInput="{{couponCode}}" stepKey="fillCouponCode" after="waitForElementVisible"/> + <fillField selector="{{AdminCartPriceRulesFormSection.userPerCoupon}}" userInput="99" stepKey="fillUserPerCoupon" after="fillCouponCode"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.apply}}" userInput="Fixed amount discount for whole cart" stepKey="selectActionTypeToFixed" after="clickToExpandActions"/> + <fillField selector="{{AdminCartPriceRulesFormSection.discountAmount}}" userInput="1" stepKey="fillDiscountAmount" after="selectActionTypeToFixed"/> + </actionGroup> + + <actionGroup name="AdminCreateCartPriceRuleWithConditions" extends="AdminCreateCartPriceRuleActionGroup"> + <annotations> + <description>EXTENDS: AdminCreateCartPriceRuleActionGroup. Removes 'fillDiscountAmount'. Adds the 2 provided Conditions (Name, Rule, Rule to Change and Category Name) to a Cart Price Rule.</description> + </annotations> + <arguments> + <argument name="condition1" type="string" defaultValue="Products subselection"/> + <argument name="condition2" type="string" defaultValue="Category"/> + <argument name="ruleToChange1" type="string" defaultValue="is"/> + <argument name="rule1" type="string" defaultValue="equals or greater than"/> + <argument name="ruleToChange2" type="string" defaultValue="..."/> + <argument name="rule2" type="string" defaultValue="2"/> + <argument name="categoryName" type="string" defaultValue="_defaultCategory.name"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminCreateCartPriceRuleWithConditionsActionGroup` instead --> + <remove keyForRemoval="fillDiscountAmount"/> + + <click selector="{{AdminCartPriceRulesFormSection.conditionsHeader}}" stepKey="openConditionsSection" after="selectActionType"/> + <click selector="{{AdminCartPriceRulesFormSection.addCondition('1')}}" stepKey="addFirstCondition" after="openConditionsSection"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.ruleCondition('1')}}" userInput="{{condition1}}" stepKey="selectRule" after="addFirstCondition"/> + <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange1)}}" stepKey="waitForFirstRuleElement" after="selectRule"/> + <click selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange1)}}" stepKey="clickToChangeRule" after="waitForFirstRuleElement"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.ruleParameterSelect('1--1')}}" userInput="{{rule1}}" stepKey="selectRule1" after="clickToChangeRule"/> + <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange2)}}" stepKey="waitForSecondRuleElement" after="selectRule1"/> + <click selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange2)}}" stepKey="clickToChangeRule1" after="waitForSecondRuleElement"/> + <fillField selector="{{AdminCartPriceRulesFormSection.ruleParameterInput('1--1')}}" userInput="{{rule2}}" stepKey="fillRule" after="clickToChangeRule1"/> + <click selector="{{AdminCartPriceRulesFormSection.addCondition('1--1')}}" stepKey="addSecondCondition" after="fillRule"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.ruleCondition('1--1')}}" userInput="{{condition2}}" stepKey="selectSecondCondition" after="addSecondCondition"/> + <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange2)}}" stepKey="waitForThirdRuleElement" after="selectSecondCondition"/> + <click selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange2)}}" stepKey="addThirdCondition" after="waitForThirdRuleElement"/> + <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.openChooser('1--1--1')}}" stepKey="waitForForthRuleElement" after="addThirdCondition"/> + <click selector="{{AdminCartPriceRulesFormSection.openChooser('1--1--1')}}" stepKey="openChooser" after="waitForForthRuleElement"/> + <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.categoryCheckbox(categoryName)}}" stepKey="waitForCategoryVisible" after="openChooser"/> + <checkOption selector="{{AdminCartPriceRulesFormSection.categoryCheckbox(categoryName)}}" stepKey="checkCategoryName" after="waitForCategoryVisible"/> + </actionGroup> + + <actionGroup name="VerifyDiscountAmount"> + <annotations> + <description>Goes to the provided Storefront Product URL. Fills in provided Quantity. Clicks Add to Cart. Goes to Checkout. Validates that the provided Discount Amount is present and correct.</description> + </annotations> + <arguments> + <argument name="productUrl" type="string"/> + <argument name="quantity" type="string"/> + <argument name="expectedDiscount" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `VerifyDiscountAmountActionGroup` instead --> + <amOnPage url="{{productUrl}}" stepKey="goToProductPage"/> + <waitForPageLoad stepKey="waitForProductPageLoad"/> + <fillField selector="{{StorefrontProductActionSection.quantity}}" userInput="{{quantity}}" stepKey="fillQuantity"/> + <click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="addProductToCart"/> + <waitForPageLoad stepKey="waitForAddToCart"/> + <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/> + <amOnPage url="{{CheckoutCartPage.url}}" stepKey="goToCartPage"/> + <waitForPageLoad stepKey="waitForCartPage"/> + <waitForElementVisible selector="{{CheckoutCartSummarySection.discountAmount}}" stepKey="waitForDiscountElement"/> + <see selector="{{CheckoutCartSummarySection.discountAmount}}" userInput="{{expectedDiscount}}" stepKey="seeDiscountTotal"/> + </actionGroup> +</actionGroups> From 7311141cbd79bab02bb19b8e024610cadebae689 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Wed, 4 Dec 2019 23:30:56 +0100 Subject: [PATCH 177/586] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- ...BasicCreditMemoInformationActionGroup.xml} | 0 .../ActionGroup/_Deprecated_ActionGroup.xml | 673 ++++++++++++++++++ 2 files changed, 673 insertions(+) rename app/code/Magento/Sales/Test/Mftf/ActionGroup/{AdminCreditMemoActionGroup.xml => VerifyBasicCreditMemoInformationActionGroup.xml} (100%) create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCreditMemoActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/VerifyBasicCreditMemoInformationActionGroup.xml similarity index 100% rename from app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCreditMemoActionGroup.xml rename to app/code/Magento/Sales/Test/Mftf/ActionGroup/VerifyBasicCreditMemoInformationActionGroup.xml diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..6a6ddfb514890 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,673 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="verifyBasicCreditMemoInformation"> + <annotations> + <description>Validates that the provided Customer, Shipping/Billing Address and Customer Group are present and correct on the Admin Credit Memo view page.</description> + </annotations> + <arguments> + <argument name="customer" defaultValue=""/> + <argument name="shippingAddress" defaultValue=""/> + <argument name="billingAddress" defaultValue=""/> + <argument name="customerGroup" defaultValue="GeneralCustomerGroup"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `VerifyBasicCreditMemoInformationActionGroup` instead --> + <see selector="{{AdminCreditMemoOrderInformationSection.customerName}}" userInput="{{customer.firstname}}" stepKey="seeCustomerName"/> + <see selector="{{AdminCreditMemoOrderInformationSection.customerEmail}}" userInput="{{customer.email}}" stepKey="seeCustomerEmail"/> + <see selector="{{AdminCreditMemoOrderInformationSection.customerGroup}}" userInput="{{customerGroup.code}}" stepKey="seeCustomerGroup"/> + + <see selector="{{AdminCreditMemoAddressInformationSection.billingAddress}}" userInput="{{billingAddress.street[0]}}" stepKey="seeBillingAddressStreet"/> + <see selector="{{AdminCreditMemoAddressInformationSection.billingAddress}}" userInput="{{billingAddress.city}}" stepKey="seeBillingAddressCity"/> + <see selector="{{AdminCreditMemoAddressInformationSection.billingAddress}}" userInput="{{billingAddress.country_id}}" stepKey="seeBillingAddressCountry"/> + <see selector="{{AdminCreditMemoAddressInformationSection.billingAddress}}" userInput="{{billingAddress.postcode}}" stepKey="seeBillingAddressPostcode"/> + + <see selector="{{AdminCreditMemoAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.street[0]}}" stepKey="seeShippingAddressStreet"/> + <see selector="{{AdminCreditMemoAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.city}}" stepKey="seeShippingAddressCity"/> + <see selector="{{AdminCreditMemoAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.country_id}}" stepKey="seeShippingAddressCountry"/> + <see selector="{{AdminCreditMemoAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.postcode}}" stepKey="seeShippingAddressPostcode"/> + </actionGroup> + + <actionGroup name="seeProductInItemsRefunded"> + <annotations> + <description>Validates that the provided Product appears in the 'Product' column on the Admin Credit Memo view page.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SeeProductInItemsRefundedActionGroup` instead --> + <see selector="{{AdminCreditMemoItemsSection.skuColumn}}" userInput="{{product.sku}}" stepKey="seeProductSkuInGrid"/> + </actionGroup> + + <actionGroup name="verifyBasicInvoiceInformation"> + <annotations> + <description>Validates that the provided Customer, Address and Customer Group details are present and correct on the Admin View Invoice page.</description> + </annotations> + <arguments> + <argument name="customer"/> + <argument name="shippingAddress"/> + <argument name="billingAddress"/> + <argument name="customerGroup" defaultValue="GeneralCustomerGroup"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `VerifyBasicInvoiceInformationActionGroup` instead --> + <see selector="{{AdminInvoiceOrderInformationSection.customerName}}" userInput="{{customer.firstname}}" stepKey="seeCustomerName"/> + <see selector="{{AdminInvoiceOrderInformationSection.customerEmail}}" userInput="{{customer.email}}" stepKey="seeCustomerEmail"/> + <see selector="{{AdminInvoiceOrderInformationSection.customerGroup}}" userInput="{{customerGroup.code}}" stepKey="seeCustomerGroup"/> + <see selector="{{AdminInvoiceAddressInformationSection.billingAddress}}" userInput="{{billingAddress.street[0]}}" stepKey="seeBillingAddressStreet"/> + <see selector="{{AdminInvoiceAddressInformationSection.billingAddress}}" userInput="{{billingAddress.city}}" stepKey="seeBillingAddressCity"/> + <see selector="{{AdminInvoiceAddressInformationSection.billingAddress}}" userInput="{{billingAddress.country_id}}" stepKey="seeBillingAddressCountry"/> + <see selector="{{AdminInvoiceAddressInformationSection.billingAddress}}" userInput="{{billingAddress.postcode}}" stepKey="seeBillingAddressPostcode"/> + <see selector="{{AdminInvoiceAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.street[0]}}" stepKey="seeShippingAddressStreet"/> + <see selector="{{AdminInvoiceAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.city}}" stepKey="seeShippingAddressCity"/> + <see selector="{{AdminInvoiceAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.country_id}}" stepKey="seeShippingAddressCountry"/> + <see selector="{{AdminInvoiceAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.postcode}}" stepKey="seeShippingAddressPostcode"/> + </actionGroup> + + <actionGroup name="seeProductInInvoiceItems"> + <annotations> + <description>Validates that the provided Product appears under the 'SKU' column in the Admin Invoices edit page.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SeeProductInInvoiceItemsActionGroup` instead --> + <see selector="{{AdminInvoiceItemsSection.skuColumn}}" userInput="{{product.sku}}" stepKey="seeProductSkuInGrid"/> + </actionGroup> + + <actionGroup name="adminFastCreateInvoice"> + <annotations> + <description>Clicks on 'Invoice' on the Admin Orders view page. Clicks on 'Submit Invoice'. Clicks on 'View Invoice'.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminFastCreateInvoiceActionGroup` instead --> + <click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceButton"/> + <waitForPageLoad stepKey="waitForNewInvoicePageLoad"/> + <click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/> + <see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The invoice has been created." stepKey="seeSuccessMessage"/> + <click selector="{{AdminOrderDetailsOrderViewSection.invoices}}" stepKey="clickInvoices"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask5"/> + <conditionalClick selector="{{AdminOrderInvoicesTabSection.clearFilters}}" dependentSelector="{{AdminOrderInvoicesTabSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> + <click selector="{{AdminOrderInvoicesTabSection.viewInvoice}}" stepKey="openInvoicePage"/> + <waitForPageLoad stepKey="waitForInvoicePageLoad"/> + </actionGroup> + + <actionGroup name="clearInvoicesGridFilters"> + <annotations> + <description>Goes to the Admin Invoices grid page. Clicks on 'Clear Filters', if present.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ClearInvoicesGridFiltersActionGroup` instead --> + <amOnPage url="{{AdminInvoicesPage.url}}" stepKey="goToInvoices"/> + <waitForPageLoad stepKey="waitInvoicesGridToLoad"/> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearFilters"/> + <waitForPageLoad stepKey="waitInvoicesGrid"/> + </actionGroup> + + <actionGroup name="goToInvoiceIntoOrder"> + <annotations> + <description>Clicks on 'Invoice' on the Admin Orders view page. Validates that the URL and Page Title are correct.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `GoToInvoiceIntoOrderActionGroup` instead --> + <click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceAction"/> + <seeInCurrentUrl url="{{AdminInvoiceNewPage.url}}" stepKey="seeOrderInvoiceUrl"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seePageNameNewInvoicePage"/> + </actionGroup> + + <actionGroup name="StartCreateInvoiceFromOrderPage"> + <annotations> + <description>Clicks on 'Invoice' on the Admin Orders view page. Validates that the URL and Page Title are correct.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StartCreateInvoiceFromOrderPageActionGroup` instead --> + <click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceAction"/> + <seeInCurrentUrl url="{{AdminInvoiceNewPage.url}}" stepKey="seeNewInvoiceUrl"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seeNewInvoicePageTitle"/> + </actionGroup> + + <actionGroup name="SubmitInvoice"> + <annotations> + <description>Clicks on 'Submit Invoice' on the Admin 'New Invoice' page. Validates that the Success Message is present and correct. Validates that the Order ID appears in the URL.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SubmitInvoiceActionGroup` instead --> + <click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForMessageAppears"/> + <see selector="{{AdminMessagesSection.success}}" userInput="The invoice has been created." stepKey="seeInvoiceCreateSuccess"/> + <grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="grabOrderId"/> + <seeInCurrentUrl url="{{AdminOrderDetailsPage.url('$grabOrderId')}}" stepKey="seeViewOrderPageInvoice"/> + </actionGroup> + + <actionGroup name="filterInvoiceGridByOrderId"> + <annotations> + <description>Goes to the Admin Invoices grid page. Filters the grid for the provided Order ID.</description> + </annotations> + <arguments> + <argument name="orderId" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FilterInvoiceGridByOrderIdActionGroup` instead --> + <amOnPage url="{{AdminInvoicesPage.url}}" stepKey="goToInvoices"/> + <click selector="{{AdminInvoicesGridSection.filter}}" stepKey="clickFilter"/> + <fillField selector="{{AdminInvoicesFiltersSection.orderNum}}" userInput="{{orderId}}" stepKey="fillOrderIdForFilter"/> + <click selector="{{AdminInvoicesFiltersSection.applyFilters}}" stepKey="clickApplyFilters"/> + <waitForPageLoad stepKey="waitForFiltersApply"/> + </actionGroup> + + <actionGroup name="navigateToNewOrderPageNewCustomer"> + <annotations> + <description>Goes to the Admin Orders grid page. Clicks on 'Create New Order'. Clicks on 'Create New Customer'. Select the provided Store View, if present. Validates that Page Title is present and correct.</description> + </annotations> + <arguments> + <argument name="storeView" defaultValue="_defaultStore"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `NavigateToNewOrderPageNewCustomerActionGroup` instead --> + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/> + <waitForPageLoad stepKey="waitForIndexPageLoad"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/> + <click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/> + <click selector="{{AdminOrderFormActionSection.CreateNewCustomer}}" stepKey="clickCreateCustomer"/> + <conditionalClick selector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" dependentSelector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" visible="true" stepKey="selectStoreViewIfAppears"/> + <waitForPageLoad stepKey="waitForCreateOrderPageLoadAfterStoreSelect"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/> + </actionGroup> + + <actionGroup name="navigateToNewOrderPageNewCustomerSingleStore"> + <annotations> + <description>Goes to the Admin Orders grid page. Clicks on 'Create New Order'. Clicks on 'Create New Customer'. Validates that Page Title is present and correct.</description> + </annotations> + <arguments> + <argument name="storeView" defaultValue="_defaultStore"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `NavigateToNewOrderPageNewCustomerSingleStoreActionGroup` instead --> + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/> + <waitForPageLoad stepKey="waitForIndexPageLoad"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/> + <click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/> + <click selector="{{AdminOrderFormActionSection.CreateNewCustomer}}" stepKey="clickCreateCustomer"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/> + </actionGroup> + + <actionGroup name="navigateToNewOrderPageExistingCustomer"> + <annotations> + <description>Goes tot he Admin Orders grid page. Clicks on 'Create New Order'. Filters the grid for the provided Customer. Clicks on the Customer. Selects the provided Store View, if present. Validates that the Page Title is present and correct.</description> + </annotations> + <arguments> + <argument name="customer"/> + <argument name="storeView" defaultValue="_defaultStore"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `NavigateToNewOrderPageExistingCustomerActionGroup` instead --> + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/> + <waitForPageLoad stepKey="waitForIndexPageLoad"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/> + <click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/> + <waitForPageLoad stepKey="waitForCustomerGridLoad"/> + + <conditionalClick selector="{{AdminOrderCustomersGridSection.resetButton}}" dependentSelector="{{AdminOrderCustomersGridSection.resetButton}}" visible="true" stepKey="clearExistingCustomerFilters"/> + <fillField userInput="{{customer.email}}" selector="{{AdminOrderCustomersGridSection.emailInput}}" stepKey="filterEmail"/> + <click selector="{{AdminOrderCustomersGridSection.apply}}" stepKey="applyFilter"/> + <waitForPageLoad stepKey="waitForFilteredCustomerGridLoad"/> + <click selector="{{AdminOrderCustomersGridSection.firstRow}}" stepKey="clickOnCustomer"/> + <waitForPageLoad stepKey="waitForCreateOrderPageLoad"/> + + <conditionalClick selector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" dependentSelector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" visible="true" stepKey="selectStoreViewIfAppears"/> + <waitForPageLoad stepKey="waitForCreateOrderPageLoadAfterStoreSelect"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/> + </actionGroup> + + <actionGroup name="checkRequiredFieldsNewOrderForm"> + <annotations> + <description>Clears the Email, First Name, Last Name, Street Line 1, City, Postal Code and Phone fields when adding an Order and then verifies that they are required after attempting to Save.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CheckRequiredFieldsNewOrderFormActionGroup` instead --> + <seeElement selector="{{AdminOrderFormAccountSection.requiredGroup}}" stepKey="seeCustomerGroupRequired"/> + <seeElement selector="{{AdminOrderFormAccountSection.requiredEmail}}" stepKey="seeEmailRequired"/> + <clearField selector="{{AdminOrderFormAccountSection.email}}" stepKey="clearEmailField"/> + <clearField selector="{{AdminOrderFormBillingAddressSection.FirstName}}" stepKey="clearFirstNameField"/> + <clearField selector="{{AdminOrderFormBillingAddressSection.LastName}}" stepKey="clearLastNameField"/> + <clearField selector="{{AdminOrderFormBillingAddressSection.StreetLine1}}" stepKey="clearStreetField"/> + <clearField selector="{{AdminOrderFormBillingAddressSection.City}}" stepKey="clearCityField"/> + <selectOption selector="{{AdminOrderFormBillingAddressSection.Country}}" userInput="United States" stepKey="selectUSCountry"/> + <selectOption selector="{{AdminOrderFormBillingAddressSection.State}}" userInput="Please select" stepKey="selectNoState"/> + <clearField selector="{{AdminOrderFormBillingAddressSection.PostalCode}}" stepKey="clearPostalCodeField"/> + <clearField selector="{{AdminOrderFormBillingAddressSection.Phone}}" stepKey="clearPhoneField"/> + <seeElement selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="seeShippingMethodNotSelected"/> + <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="trySubmitOrder"/> + <see selector="{{AdminOrderFormBillingAddressSection.emailError}}" userInput="This is a required field." stepKey="seeThatEmailIsRequired"/> + <see selector="{{AdminOrderFormBillingAddressSection.firstNameError}}" userInput="This is a required field." stepKey="seeFirstNameRequired"/> + <see selector="{{AdminOrderFormBillingAddressSection.lastNameError}}" userInput="This is a required field." stepKey="seeLastNameRequired"/> + <see selector="{{AdminOrderFormBillingAddressSection.streetAddressError}}" userInput="This is a required field." stepKey="seeStreetRequired"/> + <see selector="{{AdminOrderFormBillingAddressSection.cityError}}" userInput="This is a required field." stepKey="seeCityRequired"/> + <see selector="{{AdminOrderFormBillingAddressSection.stateError}}" userInput="This is a required field." stepKey="seeStateRequired"/> + <see selector="{{AdminOrderFormBillingAddressSection.postalCodeError}}" userInput="This is a required field." stepKey="seePostalCodeRequired"/> + <see selector="{{AdminOrderFormBillingAddressSection.phoneError}}" userInput="This is a required field." stepKey="seePhoneRequired"/> + <see selector="{{AdminOrderFormPaymentSection.shippingError}}" userInput="This is a required field." stepKey="seeShippingMethodRequired"/> + </actionGroup> + + <actionGroup name="addSimpleProductToOrder"> + <annotations> + <description>Adds the provided Simple Product to an Order. Fills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> + </annotations> + <arguments> + <argument name="product" defaultValue="_defaultProduct" type="entity"/> + <argument name="productQty" defaultValue="1" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddSimpleProductToOrderActionGroup` instead --> + <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> + <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilter"/> + <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearch"/> + <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> + <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectProduct"/> + <fillField selector="{{AdminOrderFormItemsSection.rowQty('1')}}" userInput="{{productQty}}" stepKey="fillProductQty"/> + <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> + <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> + <wait time="5" stepKey="waitForOptionsToLoad"/> + </actionGroup> + + <actionGroup name="addConfigurableProductToOrder"> + <annotations> + <description>Adds the provided Configurable Product with the provided Option to an Order. Fills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="attribute"/> + <argument name="option"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddConfigurableProductToOrderActionGroup` instead --> + <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> + <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterConfigurable"/> + <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchConfigurable"/> + <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> + <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectConfigurableProduct"/> + <waitForElementVisible selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_label)}}" stepKey="waitForConfigurablePopover"/> + <wait time="2" stepKey="waitForOptionsToLoad"/> + <selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_label)}}" userInput="{{option.name}}" stepKey="selectionConfigurableOption"/> + <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkConfigurablePopover"/> + <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> + <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> + </actionGroup> + + <actionGroup name="newAddConfigurableProductToOrder" extends="addConfigurableProductToOrder"> + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `NewAddConfigurableProductToOrderActionGroup` instead --> + <remove keyForRemoval="waitForConfigurablePopover"/> + <remove keyForRemoval="selectionConfigurableOption"/> + <selectOption selector="{{AdminOrderFormConfigureProductSection.selectOption}}" userInput="{{option.value}}" stepKey="selectOption" after="waitForOptionsToLoad"/> + </actionGroup> + + <actionGroup name="addConfigurableProductToOrderFromAdmin" extends="addConfigurableProductToOrder"> + <annotations> + <description>EXTENDS: addConfigurableProductToOrder. Selects the provided Option to the Configurable Product.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddConfigurableProductToOrderFromAdminActionGroup` instead --> + <waitForElementVisible selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}" stepKey="waitForConfigurablePopover"/> + <selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}" userInput="{{option.label}}" stepKey="selectionConfigurableOption"/> + </actionGroup> + + <actionGroup name="configureOrderedConfigurableProduct"> + <annotations> + <description>Clicks on 'Configure' for a Product in the 'Please select products' under the 'Create New Order for' page. Selects the provided Option and Attribute. Fills in the provided Qty. Clicks on Ok.</description> + </annotations> + <arguments> + <argument name="attribute"/> + <argument name="option"/> + <argument name="quantity" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ConfigureOrderedConfigurableProductActionGroup` instead --> + <click selector="{{AdminOrderFormItemsSection.configure}}" stepKey="clickConfigure"/> + <waitForElementVisible selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}" stepKey="waitForConfigurablePopover"/> + <wait time="2" stepKey="waitForOptionsToLoad"/> + <selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}" userInput="{{option.label}}" stepKey="selectionConfigurableOption"/> + <fillField selector="{{AdminOrderFormConfigureProductSection.quantity}}" userInput="{{quantity}}" stepKey="fillQuantity"/> + <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkConfigurablePopover"/> + </actionGroup> + + <actionGroup name="addBundleProductToOrder"> + <annotations> + <description>Adds the provided Bundled Product with the provided Option to an Order. Fills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="quantity" type="string" defaultValue="1"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddBundleProductToOrderActionGroup` instead --> + <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> + <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterBundle"/> + <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchBundle"/> + <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> + <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectBundleProduct"/> + <waitForElementVisible selector="{{AdminOrderFormBundleProductSection.quantity}}" stepKey="waitForBundleOptionLoad"/> + <wait time="2" stepKey="waitForOptionsToLoad"/> + <fillField selector="{{AdminOrderFormBundleProductSection.quantity}}" userInput="{{quantity}}" stepKey="fillQuantity"/> + <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOk"/> + <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> + <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> + </actionGroup> + + <actionGroup name="addBundleProductToOrderAndCheckPriceInGrid" extends="addBundleProductToOrder"> + <annotations> + <description>EXTENDS: addBundleProductToOrder. Validates that the provided Product Price is present and correct in the 'Items Ordered' section.</description> + </annotations> + <arguments> + <argument name="price" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddBundleProductToOrderAndCheckPriceInGridActionGroup` instead --> + <grabTextFrom selector="{{AdminOrderFormItemsSection.rowPrice('1')}}" stepKey="grabProductPriceFromGrid" after="clickOk"/> + <assertEquals stepKey="assertProductPriceInGrid" message="Bundle product price in grid should be equal {{price}}" after="grabProductPriceFromGrid"> + <expectedResult type="string">{{price}}</expectedResult> + <actualResult type="variable">grabProductPriceFromGrid</actualResult> + </assertEquals> + </actionGroup> + + <actionGroup name="addDownloadableProductToOrder"> + <annotations> + <description>Adds a Downloadable Product to an Order. Clicks on 'Add Selected Product(s) to Order'.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddDownloadableProductToOrderActionGroup` instead --> + <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> + <waitForPageLoad time="30" stepKey="waitForPageLoad1"/> + <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterDownloadable"/> + <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchDownloadable"/> + <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> + <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectDownloadableProduct"/> + <waitForElementVisible selector="{{AdminOrderFormDownloadableProductSection.optionSelect(link.title)}}" stepKey="waitForLinkLoad"/> + <click selector="{{AdminOrderFormDownloadableProductSection.optionSelect(link.title)}}" stepKey="selectLink"/> + <fillField selector="{{AdminOrderFormDownloadableProductSection.quantity}}" userInput="{{quantity}}" stepKey="setQuantity"/> + <click selector="{{AdminOrderFormDownloadableProductSection.ok}}" stepKey="confirmConfiguration"/> + <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> + <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> + </actionGroup> + + <actionGroup name="addGroupedProductOptionToOrder"> + <annotations> + <description>Adds the provided Grouped Product with the provided Option to an Order. Fills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="option"/> + <argument name="quantity" type="string" defaultValue="1"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddGroupedProductOptionToOrderActionGroup` instead --> + <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> + <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterGrouped"/> + <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchGrouped"/> + <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> + <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectGroupedProduct"/> + <waitForElementVisible selector="{{AdminOrderFormGroupedProductSection.optionQty(option.sku)}}" stepKey="waitForGroupedOptionLoad"/> + <wait time="2" stepKey="waitForOptionsToLoad"/> + <fillField selector="{{AdminOrderFormGroupedProductSection.optionQty(option.sku)}}" userInput="{{quantity}}" stepKey="fillOptionQuantity"/> + <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOk"/> + <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> + <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> + </actionGroup> + + <actionGroup name="fillOrderCustomerInformation"> + <annotations> + <description>Fills in the provided Customer and Address details on the Admin 'Create New Order for' page.</description> + </annotations> + <arguments> + <argument name="customer"/> + <argument name="address"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FillOrderCustomerInformationActionGroup` instead --> + <fillField selector="{{AdminOrderFormBillingAddressSection.FirstName}}" userInput="{{customer.firstname}}" stepKey="fillFirstName"/> + <fillField selector="{{AdminOrderFormBillingAddressSection.LastName}}" userInput="{{customer.lastname}}" stepKey="fillLastName"/> + <fillField selector="{{AdminOrderFormBillingAddressSection.StreetLine1}}" userInput="{{address.street[0]}}" stepKey="fillStreetLine1"/> + <fillField selector="{{AdminOrderFormBillingAddressSection.City}}" userInput="{{address.city}}" stepKey="fillCity"/> + <selectOption selector="{{AdminOrderFormBillingAddressSection.Country}}" userInput="{{address.country_id}}" stepKey="fillCountry"/> + <selectOption selector="{{AdminOrderFormBillingAddressSection.State}}" userInput="{{address.state}}" stepKey="fillState"/> + <fillField selector="{{AdminOrderFormBillingAddressSection.PostalCode}}" userInput="{{address.postcode}}" stepKey="fillPostalCode"/> + <fillField selector="{{AdminOrderFormBillingAddressSection.Phone}}" userInput="{{address.telephone}}" stepKey="fillPhone"/> + </actionGroup> + + <actionGroup name="orderSelectFlatRateShipping"> + <annotations> + <description>Selects the 'Flat Rate' Shipping Method on the Admin 'Create New Order for' page.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `OrderSelectFlatRateShippingActionGroup` instead --> + <click selector="{{AdminOrderFormPaymentSection.header}}" stepKey="unfocus"/> + <waitForPageLoad stepKey="waitForJavascriptToFinish"/> + <click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickShippingMethods"/> + <waitForElementVisible selector="{{AdminOrderFormPaymentSection.flatRateOption}}" stepKey="waitForShippingOptions"/> + <selectOption selector="{{AdminOrderFormPaymentSection.flatRateOption}}" userInput="flatrate_flatrate" stepKey="checkFlatRate"/> + </actionGroup> + + <actionGroup name="changeShippingMethod"> + <annotations> + <description>Change Shipping Method on the Admin 'Create New Order for' page.</description> + </annotations> + <arguments> + <argument name="shippingMethod" defaultValue="flatrate_flatrate" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ChangeShippingMethodActionGroup` instead --> + <click selector="{{AdminOrderFormPaymentSection.header}}" stepKey="unfocus"/> + <waitForPageLoad stepKey="waitForJavascriptToFinish"/> + <click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickShippingMethods1"/> + <waitForElementVisible selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="waitForChangeShippingMethod"/> + <click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickShippingMethods2"/> + <waitForElementVisible selector="{{AdminOrderFormPaymentSection.shippingMethod}}" stepKey="waitForShippingOptions2"/> + <selectOption selector="{{AdminOrderFormPaymentSection.shippingMethod}}" userInput="{{shippingMethod}}" stepKey="checkFlatRate"/> + </actionGroup> + + <actionGroup name="orderSelectFreeShipping"> + <annotations> + <description>Selects the 'Free Shipping' Shipping Method on the Admin 'Create New Order for' page.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `OrderSelectFreeShippingActionGroup` instead --> + <click selector="{{AdminOrderFormPaymentSection.header}}" stepKey="unfocus"/> + <waitForPageLoad stepKey="waitForJavascriptToFinish"/> + <click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickShippingMethods"/> + <waitForElementVisible selector="{{AdminOrderFormPaymentSection.freeShippingOption}}" stepKey="waitForShippingOptions"/> + <selectOption selector="{{AdminOrderFormPaymentSection.freeShippingOption}}" userInput="freeshipping_freeshipping" stepKey="checkFreeShipping"/> + </actionGroup> + + <actionGroup name="verifyBasicOrderInformation"> + <annotations> + <description>Validates that the provided Customer, Shipping/Billing Address and Customer Group are present and correct on the Admin Orders view page.</description> + </annotations> + <arguments> + <argument name="customer"/> + <argument name="shippingAddress"/> + <argument name="billingAddress"/> + <argument name="customerGroup" defaultValue="GeneralCustomerGroup"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `VerifyBasicOrderInformationActionGroup` instead --> + <see selector="{{AdminOrderDetailsInformationSection.customerName}}" userInput="{{customer.firstname}}" stepKey="seeCustomerName"/> + <see selector="{{AdminOrderDetailsInformationSection.customerEmail}}" userInput="{{customer.email}}" stepKey="seeCustomerEmail"/> + <see selector="{{AdminOrderDetailsInformationSection.customerGroup}}" userInput="{{customerGroup.code}}" stepKey="seeCustomerGroup"/> + <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.street[0]}}" stepKey="seeBillingAddressStreet"/> + <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.city}}" stepKey="seeBillingAddressCity"/> + <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.country_id}}" stepKey="seeBillingAddressCountry"/> + <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.postcode}}" stepKey="seeBillingAddressPostcode"/> + <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.street[0]}}" stepKey="seeShippingAddressStreet"/> + <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.city}}" stepKey="seeShippingAddressCity"/> + <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.country_id}}" stepKey="seeShippingAddressCountry"/> + <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.postcode}}" stepKey="seeShippingAddressPostcode"/> + </actionGroup> + + <actionGroup name="verifyCreatedOrderInformation"> + <annotations> + <description>Validates that the Success Message, Order Status (Pending) and Order ID are present and correct.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `VerifyCreatedOrderInformationActionGroup` instead --> + <see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="You created the order." stepKey="seeSuccessMessage"/> + <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Pending" stepKey="seeOrderPendingStatus" after="seeSuccessMessage"/> + <grabTextFrom selector="|Order # (\d+)|" stepKey="getOrderId" after="seeOrderPendingStatus"/> + <assertNotEmpty actual="$getOrderId" stepKey="assertOrderIdIsNotEmpty" after="getOrderId"/> + </actionGroup> + + <actionGroup name="seeProductInItemsOrdered"> + <annotations> + <description>Validates that the provided Product is present and correct in the 'Items Ordered' section on the Admin Orders view page.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SeeProductInItemsOrderedActionGroup` instead --> + <see selector="{{AdminOrderItemsOrderedSection.productSkuColumn}}" userInput="{{product.sku}}" stepKey="seeSkuInItemsOrdered"/> + </actionGroup> + + <actionGroup name="cancelPendingOrder"> + <annotations> + <description>Cancels the Pending Order on the Admin Orders view page. Validates that the provided Order Status is present and correct.</description> + </annotations> + <arguments> + <argument name="orderStatus" type="string" defaultValue="Canceled"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CancelPendingOrderActionGroup` instead --> + <click selector="{{AdminOrderDetailsMainActionsSection.cancel}}" stepKey="clickCancelOrder"/> + <waitForElement selector="{{AdminConfirmationModalSection.message}}" stepKey="waitForCancelConfirmation"/> + <see selector="{{AdminConfirmationModalSection.message}}" userInput="Are you sure you want to cancel this order?" stepKey="seeConfirmationMessage"/> + <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmOrderCancel"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You canceled the order." stepKey="seeCancelSuccessMessage"/> + <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="{{orderStatus}}" stepKey="seeOrderStatusCanceled"/> + </actionGroup> + + <actionGroup name="dontSeeProductInItemsOrdered"> + <arguments> + <argument name="product"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `DontSeeProductInItemsOrderedActionGroup` instead --> + <dontSee selector="{{AdminOrderItemsOrderedSection.productSkuColumn}}" userInput="{{product.sku}}" stepKey="dontseeSkuInItemsOrdered"/> + </actionGroup> + + <actionGroup name="SelectCheckMoneyPaymentMethod"> + <annotations> + <description>Selects the 'Check / Money Order' Payment Method on the Admin Create New Order page.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SelectCheckMoneyPaymentMethodActionGroup` instead --> + <waitForElementVisible selector="{{AdminOrderFormPaymentSection.paymentBlock}}" stepKey="waitForPaymentOptions"/> + <conditionalClick selector="{{AdminOrderFormPaymentSection.checkMoneyOption}}" dependentSelector="{{AdminOrderFormPaymentSection.checkMoneyOption}}" visible="true" stepKey="checkCheckMoneyOption"/> + </actionGroup> + + <actionGroup name="filterOrderGridById"> + <annotations> + <description>Goes to the Admin Orders page. Filters the grid based on the provided Order ID.</description> + </annotations> + <arguments> + <argument name="orderId" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FilterOrderGridByIdActionGroup` instead --> + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderGridPage"/> + <waitForPageLoad stepKey="waitForOrdersPage"/> + <conditionalClick selector="{{AdminOrdersGridSection.clearFilters}}" dependentSelector="{{AdminOrdersGridSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> + <waitForPageLoad stepKey="waitForClearFilters"/> + <click selector="{{AdminOrdersGridSection.filters}}" stepKey="openOrderGridFilters"/> + <waitForPageLoad stepKey="waitForClickFilters"/> + <fillField selector="{{AdminOrdersGridSection.idFilter}}" userInput="{{orderId}}" stepKey="fillOrderIdFilter"/> + <click selector="{{AdminOrdersGridSection.applyFilters}}" stepKey="clickOrderApplyFilters"/> + <waitForPageLoad stepKey="waitForApplyFilters"/> + </actionGroup> + + <actionGroup name="filterOrderGridByBillingName"> + <annotations> + <description>Goes to the Admin Orders page. Filters the grid based on the provided Customer.</description> + </annotations> + <arguments> + <argument name="customer"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FilterOrderGridByBillingNameActionGroup` instead --> + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderGridPage"/> + <waitForPageLoad stepKey="waitForOrderGridLoad"/> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> + <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openOrderGridFilters"/> + <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('billing_name')}}" userInput="{{customer.fullname}}" stepKey="fillBillToNameFilter"/> + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickOrderApplyFilters"/> + </actionGroup> + + <actionGroup name="filterOrderGridByBaseTotalRange"> + <annotations> + <description>Goes to the Admin Orders page. Filters the grid based on the provided Grand Total From/To values.</description> + </annotations> + <arguments> + <argument name="from"/> + <argument name="to"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FilterOrderGridByBaseTotalRangeActionGroup` instead --> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> + <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openOrderGridFilters"/> + <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('base_grand_total[from]')}}" userInput="{{from}}" stepKey="fillOrderTotalFrom"/> + <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('base_grand_total[to]')}}" userInput="{{to}}" stepKey="fillOrderTotalTo"/> + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFilters"/> + </actionGroup> + + <actionGroup name="filterOrderGridByPurchaseDate"> + <annotations> + <description>Goes to the Admin Orders page. Filters the grid based on the provided Purchased Date From/To values.</description> + </annotations> + <arguments> + <argument name="from"/> + <argument name="to"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FilterOrderGridByPurchaseDateActionGroup` instead --> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> + <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openOrderGridFilters"/> + <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('created_at[from]')}}" userInput="{{from}}" stepKey="fillOrderPurchaseDateFrom"/> + <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('created_at[to]')}}" userInput="{{to}}" stepKey="fillOrderPurchaseDateTo"/> + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFilters"/> + </actionGroup> + + <actionGroup name="filterOrderGridByStatus"> + <annotations> + <description>Filters the Admin Orders grid based on the provided Order Status.</description> + </annotations> + <arguments> + <argument name="status"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FilterOrderGridByStatusActionGroup` instead --> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> + <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openOrderGridFilters"/> + <selectOption selector="{{AdminDataGridHeaderSection.filterFieldSelect('status')}}" userInput="{{status}}" stepKey="fillOrderStatusFilter"/> + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFilters"/> + </actionGroup> + + <actionGroup name="OpenOrderById" extends="filterOrderGridById"> + <annotations> + <description>EXTENDS: filterOrderGridById. Clicks on the 1st row of the Admin Orders grid.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `OpenOrderByIdActionGroup` instead --> + <click selector="{{AdminDataGridTableSection.firstRow}}" after="clickOrderApplyFilters" stepKey="openOrderViewPage"/> + <waitForPageLoad after="openOrderViewPage" stepKey="waitForOrderViewPageOpened"/> + </actionGroup> +</actionGroups> From 80f734bdf7cd0048780e5a83e8532081418f5472 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Wed, 4 Dec 2019 23:35:54 +0100 Subject: [PATCH 178/586] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- .../ActionGroup/_Deprecated_ActionGroup.xml | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..e9b6ec37f8f0a --- /dev/null +++ b/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,105 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="addProductVideo"> + <annotations> + <description>Expands the 'Images And Videos' section on the Admin Product creation/edit page. Adds the provided Video to the Product. Clicks on Save.</description> + </annotations> + <arguments> + <argument name="video" defaultValue="mftfTestProductVideo"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddProductVideoActionGroup` instead --> + <scrollTo selector="{{AdminProductImagesSection.productImagesToggle}}" x="0" y="-100" stepKey="scrollToArea"/> + <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductVideoSection"/> + <waitForElementVisible selector="{{AdminProductImagesSection.addVideoButton}}" stepKey="waitForAddVideoButtonVisible" time="30"/> + <click selector="{{AdminProductImagesSection.addVideoButton}}" stepKey="addVideo"/> + <waitForElementVisible selector=".modal-slide.mage-new-video-dialog.form-inline._show" stepKey="waitForUrlElementVisibleslide" time="30"/> + <waitForElementVisible selector="{{AdminProductNewVideoSection.videoUrlTextField}}" stepKey="waitForUrlElementVisible" time="60"/> + <fillField selector="{{AdminProductNewVideoSection.videoUrlTextField}}" userInput="{{video.videoUrl}}" stepKey="fillFieldVideoUrl"/> + <fillField selector="{{AdminProductNewVideoSection.videoTitleTextField}}" userInput="{{video.videoTitle}}" stepKey="fillFieldVideoTitle"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <waitForElementNotVisible selector="{{AdminProductNewVideoSection.saveButtonDisabled}}" stepKey="waitForSaveButtonVisible" time="30"/> + <click selector="{{AdminProductNewVideoSection.saveButton}}" stepKey="saveVideo"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/> + </actionGroup> + + <actionGroup name="removeProductVideo"> + <annotations> + <description>Expands the 'Images And Videos' section on the Admin Product creation/edit page. Clicks on the Remove Video button.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `RemoveProductVideoActionGroup` instead --> + <scrollTo selector="{{AdminProductImagesSection.productImagesToggle}}" x="0" y="-100" stepKey="scrollToArea"/> + <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductVideoSection"/> + <waitForElementVisible selector="{{AdminProductImagesSection.addVideoButton}}" stepKey="waitForAddVideoButtonVisible" time="30"/> + <click selector="{{AdminProductImagesSection.removeVideoButton}}" stepKey="removeVideo"/> + </actionGroup> + + <actionGroup name="assertProductVideoAdminProductPage"> + <annotations> + <description>Validates that the provided Video is present on the Admin Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="video" defaultValue="mftfTestProductVideo"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertProductVideoAdminProductPageActionGroup` instead --> + <scrollTo selector="{{AdminProductImagesSection.productImagesToggle}}" x="0" y="-100" stepKey="scrollToArea"/> + <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductVideoSection"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <seeElement selector="{{AdminProductImagesSection.videoTitleText(video.videoShortTitle)}}" stepKey="seeVideoTitle"/> + <seeElementInDOM selector="{{AdminProductImagesSection.videoUrlHiddenField(video.videoUrl)}}" stepKey="seeVideoItem"/> + </actionGroup> + + <actionGroup name="assertProductVideoNotInAdminProductPage"> + <annotations> + <description>Validates that the provided Video is NOT present on the Admin Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="video" defaultValue="mftfTestProductVideo"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertProductVideoNotInAdminProductPageActionGroup` instead --> + <scrollTo selector="{{AdminProductImagesSection.productImagesToggle}}" x="0" y="-100" stepKey="scrollToArea"/> + <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductVideoSection"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <dontSeeElement selector="{{AdminProductImagesSection.videoTitleText(video.videoShortTitle)}}" stepKey="seeVideoTitle"/> + <dontSeeElementInDOM selector="{{AdminProductImagesSection.videoUrlHiddenField(video.videoUrl)}}" stepKey="seeVideoItem"/> + </actionGroup> + + <actionGroup name="assertProductVideoStorefrontProductPage"> + <annotations> + <description>Validates that the provided Video is present on the Storefront Product page.</description> + </annotations> + <arguments> + <argument name="dataTypeAttribute" defaultValue="'youtube'"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertProductVideoStorefrontProductPageActionGroup` instead --> + <seeElement selector="{{StorefrontProductInfoMainSection.productVideo(dataTypeAttribute)}}" stepKey="seeProductVideoDataType"/> + </actionGroup> + + <actionGroup name="assertProductVideoNotInStorefrontProductPage"> + <annotations> + <description>Validates that the provided Video is NOT present on the Storefront Product page.</description> + </annotations> + <arguments> + <argument name="dataTypeAttribute" defaultValue="'youtube'"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertProductVideoNotInStorefrontProductPageActionGroup` instead --> + <dontSeeElement selector="{{StorefrontProductInfoMainSection.productVideo(dataTypeAttribute)}}" stepKey="dontSeeProductVideoDataType"/> + </actionGroup> +</actionGroups> From f4f7ca689126b093e87283b1123438624c266ac3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Wed, 4 Dec 2019 23:44:01 +0100 Subject: [PATCH 179/586] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- .../ActionGroup/_Deprecated_ActionGroup.xml | 150 ++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 app/code/Magento/Paypal/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/Paypal/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..e6765a6a520e1 --- /dev/null +++ b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,150 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="EnablePayPalConfiguration"> + <annotations> + <description>Expands the 'OTHER PAYPAL PAYMENT SOLUTIONS' tab on the Admin Configuration page. Enables the provided PayPal Config type for the provided Country Code.</description> + </annotations> + <arguments> + <argument name="payPalConfigType"/> + <argument name="countryCode" type="string" defaultValue="us"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `EnablePayPalConfigurationActionGroup` instead --> + <waitForElementVisible selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" stepKey="waitForOtherPayPalPaymentsSection"/> + <conditionalClick selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" dependentSelector="{{OtherPayPalPaymentsConfigSection.expandedTab(countryCode)}}" visible="false" stepKey="clickOtherPayPalPaymentsSection"/> + <waitForElementVisible selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="waitForWPSExpressConfigureBtn"/> + <click selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="clickWPSExpressConfigureBtn"/> + <waitForElementVisible selector="{{payPalConfigType.enableSolution(countryCode)}}" stepKey="waitForWPSExpressEnable"/> + <selectOption selector="{{payPalConfigType.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableWPSExpressSolution"/> + <seeInPopup userInput="There is already another PayPal solution enabled. Enable this solution instead?" stepKey="seeAlertMessage"/> + <acceptPopup stepKey="acceptEnablePopUp"/> + <click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + </actionGroup> + + <actionGroup name="EnablePayPalSolutionWithoutSave" > + <annotations> + <description>Expands the 'OTHER PAYPAL PAYMENT SOLUTIONS' tab on the Admin Configuration page. Enables the provided PayPal Config type for the provided Country Code without saving.</description> + </annotations> + <arguments> + <argument name="payPalConfigType"/> + <argument name="countryCode" type="string" defaultValue="us"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `EnablePayPalSolutionWithoutSaveActionGroup` instead --> + <waitForElementVisible selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" stepKey="waitForOtherPayPalPaymentsSection"/> + <conditionalClick selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" dependentSelector="{{OtherPayPalPaymentsConfigSection.expandedTab(countryCode)}}" visible="false" stepKey="clickOtherPayPalPaymentsSection"/> + <waitForElementVisible selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="waitForWPSExpressConfigureBtn"/> + <click selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="clickWPSExpressConfigureBtn"/> + <waitForElementVisible selector="{{payPalConfigType.enableSolution(countryCode)}}" stepKey="waitForWPSExpressEnable"/> + <selectOption selector="{{payPalConfigType.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableWPSExpressSolution"/> + </actionGroup> + + <actionGroup name="CheckEnableOptionPayPalConfiguration"> + <annotations> + <description>Expands the 'OTHER PAYPAL PAYMENT SOLUTIONS' tab on the Admin Configuration page. Enables the provided PayPal Config type for the provided Country Code.</description> + </annotations> + <arguments> + <argument name="payPalConfigType"/> + <argument name="enabledOption" type="string"/> + <argument name="countryCode" type="string" defaultValue="us"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CheckEnableOptionPayPalConfigurationActionGroup` instead --> + <waitForElementVisible selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" stepKey="waitForOtherPayPalPaymentsSection"/> + <conditionalClick selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" dependentSelector="{{OtherPayPalPaymentsConfigSection.expandedTab(countryCode)}}" visible="false" stepKey="clickOtherPayPalPaymentsSection"/> + <waitForElementVisible selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="waitForWPSExpressConfigureBtn"/> + <click selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="clickWPSExpressConfigureBtn1"/> + <waitForElementVisible selector="{{payPalConfigType.enableSolution(countryCode)}}" stepKey="waitForWPSExpressEnable"/> + <seeOptionIsSelected selector="{{payPalConfigType.enableSolution(countryCode)}}" userInput="{{enabledOption}}" stepKey="seeSelectedOption"/> + <click selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="clickWPSExpressConfigureBtn2"/> + </actionGroup> + + <actionGroup name="ConfigPayPalExpressCheckout"> + <annotations> + <description>Goes to the 'Configuration' page for 'Payment Methods'. Fills in the provided PayPal credentials and other details. Clicks on Save.</description> + </annotations> + <arguments> + <argument name="credentials" defaultValue="_CREDS"/> + <argument name="countryCode" type="string" defaultValue="us"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ConfigPayPalExpressCheckoutActionGroup` instead --> + <amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <click selector="{{PayPalExpressCheckoutConfigSection.configureBtn(countryCode)}}" stepKey="clickPayPalConfigureBtn"/> + <waitForElementVisible selector="{{PayPalAdvancedSettingConfigSection.advancedSettingTab(countryCode)}}" stepKey="waitForAdvancedSettingTab"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.email(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_business_account}}" stepKey="inputEmailAssociatedWithPayPalMerchantAccount"/> + <selectOption selector ="{{PayPalExpressCheckoutConfigSection.apiMethod(countryCode)}}" userInput="API Signature" stepKey="inputAPIAuthenticationMethods"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.username(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_api_username}}" stepKey="inputAPIUsername"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.password(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_api_password}}" stepKey="inputAPIPassword"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.signature(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_api_signature}}" stepKey="inputAPISignature"/> + <selectOption selector ="{{PayPalExpressCheckoutConfigSection.sandboxMode(countryCode)}}" userInput="Yes" stepKey="enableSandboxMode"/> + <selectOption selector="{{PayPalExpressCheckoutConfigSection.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableSolution"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.merchantID(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_merchant_id}}" stepKey="inputMerchantID"/> + <click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/> + </actionGroup> + + <actionGroup name="SampleConfigPayPalExpressCheckout"> + <annotations> + <description>Goes to the 'Configuration' page for 'Payment Methods'. Fills in the provided Sample PayPal credentials and other details. Clicks on Save.</description> + </annotations> + <arguments> + <argument name="credentials" defaultValue="SamplePaypalExpressConfig"/> + <argument name="countryCode" type="string" defaultValue="us"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SampleConfigPayPalExpressCheckoutActionGroup` instead --> + <amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <click selector="{{PayPalExpressCheckoutConfigSection.configureBtn(countryCode)}}" stepKey="clickPayPalConfigureBtn"/> + <waitForElementVisible selector="{{PayPalAdvancedSettingConfigSection.advancedSettingTab(countryCode)}}" stepKey="waitForAdvancedSettingTab"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.email(countryCode)}}" userInput="{{credentials.paypal_express_email}}" stepKey="inputEmailAssociatedWithPayPalMerchantAccount"/> + <selectOption selector ="{{PayPalExpressCheckoutConfigSection.apiMethod(countryCode)}}" userInput="API Signature" stepKey="inputAPIAuthenticationMethods"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.username(countryCode)}}" userInput="{{credentials.paypal_express_api_username}}" stepKey="inputAPIUsername"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.password(countryCode)}}" userInput="{{credentials.paypal_express_api_password}}" stepKey="inputAPIPassword"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.signature(countryCode)}}" userInput="{{credentials.paypal_express_api_signature}}" stepKey="inputAPISignature"/> + <selectOption selector ="{{PayPalExpressCheckoutConfigSection.sandboxMode(countryCode)}}" userInput="Yes" stepKey="enableSandboxMode"/> + <selectOption selector="{{PayPalExpressCheckoutConfigSection.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableSolution"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.merchantID(countryCode)}}" userInput="{{credentials.paypal_express_merchantID}}" stepKey="inputMerchantID"/> + <click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/> + </actionGroup> + + <actionGroup name="addProductToCheckoutPage"> + <annotations> + <description>Goes to the provided Category page on the Storefront. Adds the 1st Product to the Cart. Goes to Checkout. Select the Shipping Method. Selects PayPal as the Payment Method.</description> + </annotations> + <arguments> + <argument name="Category"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddProductToCheckoutPageActionGroup` instead --> + <amOnPage url="{{StorefrontCategoryPage.url(Category.name)}}" stepKey="onCategoryPage"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <moveMouseOver selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" stepKey="hoverProduct"/> + <click selector="{{StorefrontCategoryMainSection.AddToCartBtn}}" stepKey="addToCart"/> + <waitForElementVisible selector="{{StorefrontCategoryMainSection.SuccessMsg}}" time="30" stepKey="waitForProductAdded"/> + <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickCart"/> + <click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="goToCheckout"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> + <click selector="{{CheckoutShippingMethodsSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask2"/> + <waitForElement selector="{{CheckoutShippingMethodsSection.next}}" time="30" stepKey="waitForNextButton"/> + <click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickNext"/> + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPlaceOrderButton"/> + <click selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="clickPayPalCheckbox"/> + </actionGroup> +</actionGroups> From 76f310f82d94c2df8f6b8f4255577441a1ff1964 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Wed, 4 Dec 2019 23:47:06 +0100 Subject: [PATCH 180/586] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- .../ActionGroup/_Deprecated_ActionGroup.xml | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 app/code/Magento/PageCache/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/PageCache/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/PageCache/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..65e8a0604f505 --- /dev/null +++ b/app/code/Magento/PageCache/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="clearPageCache"> + <annotations> + <description>Goes to the Admin Cache Management page. Selects 'Refresh'. Checks the 'Page Cache' row. Clicks on Submit.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ClearPageCacheActionGroup` instead --> + <amOnPage url="{{_ENV.MAGENTO_BACKEND_NAME}}/admin/cache/" stepKey="amOnCacheManagementPage"/> + <waitForPageLoad stepKey="waitForCacheManagement"/> + <selectOption selector="{{AdminCacheManagementSection.massActionSelect}}" userInput="refresh" stepKey="selectRefresh"/> + <click selector="{{AdminCacheManagementSection.pageCacheCheckbox}}" stepKey="selectPageCache"/> + <click selector="{{AdminCacheManagementSection.massActionSubmit}}" stepKey="submitCacheForm"/> + <waitForPageLoad stepKey="waitForCacheFlush"/> + </actionGroup> +</actionGroups> From b04160805c925901fe7c0e397a3590c8cfacada7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Wed, 4 Dec 2019 23:53:08 +0100 Subject: [PATCH 181/586] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- .../ActionGroup/_Deprecated_ActionGroup.xml | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 app/code/Magento/Newsletter/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..c3f29feb63b8d --- /dev/null +++ b/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontCreateNewAccountNewsletterChecked" extends="SignUpNewUserFromStorefrontActionGroup"> + <annotations> + <description>EXTENDS: SignUpNewUserFromStorefrontActionGroup. Clicks on 'Sign Up for Newsletter'. Validates that the Subscription Confirmation message is present and correct.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCreateNewAccountNewsletterCheckedActionGroup` instead --> + <click selector="{{StorefrontCustomerCreateFormSection.signUpForNewsletter}}" stepKey="selectSignUpForNewsletterCheckbox" after="fillLastName"/> + <see stepKey="seeDescriptionNewsletter" userInput='You are subscribed to "General Subscription".' selector="{{CustomerMyAccountPage.DescriptionNewsletter}}"/> + </actionGroup> + + <actionGroup name="StorefrontCreateNewAccountNewsletterUnchecked" extends="SignUpNewUserFromStorefrontActionGroup"> + <annotations> + <description>EXTENDS: SignUpNewUserFromStorefrontActionGroup. Validates that the you are NOT subscribed message is present and correct.</description> + </annotations> + <arguments> + <argument name="Customer"/> + <argument name="Store"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCreateNewAccountNewsletterUncheckedActionGroup` instead --> + <amOnPage stepKey="amOnStorefrontPage" url="{{Store.code}}"/> + <see stepKey="seeDescriptionNewsletter" userInput="You aren't subscribed to our newsletter." selector="{{CustomerMyAccountPage.DescriptionNewsletter}}"/> + <see stepKey="seeThankYouMessage" userInput="Thank you for registering with NewStore."/> + </actionGroup> +</actionGroups> From a5a025a47f2f9a0940aac1453a9c61f27e87e701 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Wed, 4 Dec 2019 23:56:15 +0100 Subject: [PATCH 182/586] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- .../ActionGroup/_Deprecated_ActionGroup.xml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 app/code/Magento/Multishipping/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..41d8803a253f9 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontGoCheckoutWithMultipleAddresses"> + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontGoCheckoutWithMultipleAddressesActionGroup` instead --> + <click selector="{{MultishippingSection.shippingMultipleCheckout}}" stepKey="clickToMultipleAddressShippingButton"/> + </actionGroup> +</actionGroups> From 450138063018e4cf893e5da8a6c9f4ea8ccfb642 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Wed, 4 Dec 2019 23:59:53 +0100 Subject: [PATCH 183/586] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- .../ActionGroup/_Deprecated_ActionGroup.xml | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..6da85827f77ec --- /dev/null +++ b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,96 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="checkRequiredFieldsInGroupedProductForm"> + <annotations> + <description>Clears the Product Name and SKU fields when adding a Grouped Product and then verifies that they are required after attempting to Save.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CheckRequiredFieldsInGroupedProductFormActionGroup` instead --> + <clearField selector="{{AdminProductFormSection.productName}}" stepKey="clearProductSku"/> + <clearField selector="{{AdminProductFormSection.productSku}}" stepKey="clearProductName"/> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Product" stepKey="seeStillOnEditPage"/> + <see selector="{{AdminProductFormSection.fieldError('name')}}" userInput="This is a required field." stepKey="seeNameRequired"/> + <see selector="{{AdminProductFormSection.fieldError('sku')}}" userInput="This is a required field." stepKey="seeSkuRequired"/> + </actionGroup> + + <!--Fill main fields in grouped product form--> + <actionGroup name="fillGroupedProductForm"> + <annotations> + <description>Fills in the provided Product Name and SKU on the Grouped Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="product" defaultValue="GroupedProduct"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FillGroupedProductFormActionGroup` instead --> + <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductSku"/> + <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductName"/> + </actionGroup> + + <actionGroup name="viewGroupedProductInAdminGrid"> + <annotations> + <description>Goes to the Admin Products grid page. Filters the grid for the provided Product. Validates that the provided Product appears in the grid.</description> + </annotations> + <arguments> + <argument name="product" defaultValue="GroupedProduct"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ViewGroupedProductInAdminGridActionGroup` instead --> + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> + <waitForPageLoad stepKey="waitForPageLoadInitial"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{product.name}}" stepKey="fillProductNameFilter"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> + <selectOption selector="{{AdminProductGridFilterSection.typeFilter}}" userInput="{{product.type_id}}" stepKey="selectionProductType"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.name}}" stepKey="seeProductNameInGrid"/> + <click selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="clickClearFiltersAfter"/> + </actionGroup> + + <actionGroup name="fillDefaultQuantityForLinkedToGroupProductInGrid"> + <annotations> + <description>Fills the provided Qty for a Product linked to a Grouped Product.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + <argument name="qty" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FillDefaultQuantityForLinkedToGroupProductInGridActionGroup` instead --> + <fillField selector="{{AdminAddedProductsToGroupGrid.inputByProductName(productName)}}" userInput="{{qty}}" stepKey="fillDefaultQtyForLinkedProduct"/> + </actionGroup> + + <actionGroup name="AdminAssignProductToGroup"> + <annotations> + <description>Adds the provided Product to a Grouped Product on an Admin Grouped Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminAssignProductToGroupActionGroup` instead --> + <scrollTo selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" x="0" y="-100" stepKey="scrollToGroupedSection"/> + <conditionalClick selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" dependentSelector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" visible="false" stepKey="openGroupedProductsSection"/> + <click selector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" stepKey="clickAddProductsToGroup"/> + <conditionalClick selector="{{AdminAddProductsToGroupPanel.clearFilters}}" dependentSelector="{{AdminAddProductsToGroupPanel.clearFilters}}" visible="true" stepKey="clearExistingFilters"/> + <click selector="{{AdminAddProductsToGroupPanel.filters}}" stepKey="showFiltersPanel"/> + <fillField userInput="{{product.name}}" selector="{{AdminAddProductsToGroupPanel.nameFilter}}" stepKey="fillNameFilter"/> + <click selector="{{AdminAddProductsToGroupPanel.applyFilters}}" stepKey="clickApplyFilters"/> + <click selector="{{AdminAddProductsToGroupPanel.firstCheckbox}}" stepKey="selectProduct"/> + <click selector="{{AdminAddProductsToGroupPanel.addSelectedProducts}}" stepKey="clickAddSelectedGroupProducts"/> + </actionGroup> +</actionGroups> From 6245374d9b178a94f722ecc65e498769bbbeac79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 5 Dec 2019 00:03:42 +0100 Subject: [PATCH 184/586] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- .../ActionGroup/_Deprecated_ActionGroup.xml | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 app/code/Magento/Email/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/Email/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Email/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..855ec8790f8f2 --- /dev/null +++ b/app/code/Magento/Email/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,90 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="CreateNewTemplate"> + <annotations> + <description>Clicks on Add New Template. Fills the Template details. Clicks on Save. PLEASE NOTE: The values are Hardcoded.</description> + </annotations> + <arguments> + <argument name="template" defaultValue="EmailTemplate"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateNewTemplateActionGroup` instead --> + <amOnPage url="{{AdminEmailTemplateIndexPage.url}}" stepKey="navigateToEmailTemplatePage"/> + <click selector="{{AdminMainActionsSection.add}}" stepKey="clickAddNewTemplateButton"/> + <selectOption selector="{{AdminEmailTemplateEditSection.templateDropDown}}" userInput="Registry Update" stepKey="selectValueFromTemplateDropDown"/> + <click selector="{{AdminEmailTemplateEditSection.loadTemplateButton}}" stepKey="clickLoadTemplateButton"/> + <fillField selector="{{AdminEmailTemplateEditSection.templateCode}}" userInput="{{EmailTemplate.templateName}}" stepKey="fillTemplateNameField"/> + <click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveTemplateButton"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You saved the email template." stepKey="seeSuccessMessage"/> + </actionGroup> + + <actionGroup name="CreateCustomTemplate" extends="CreateNewTemplate"> + <remove keyForRemoval="selectValueFromTemplateDropDown"/> + <remove keyForRemoval="clickLoadTemplateButton"/> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateCustomTemplateActionGroup` instead --> + <fillField selector="{{AdminEmailTemplateEditSection.templateSubject}}" userInput="{{template.templateSubject}}" after="fillTemplateNameField" stepKey="fillTemplateSubject"/> + <fillField selector="{{AdminEmailTemplateEditSection.templateText}}" userInput="{{template.templateText}}" after="fillTemplateSubject" stepKey="fillTemplateText"/> + </actionGroup> + + <actionGroup name="FindAndOpenEmailTemplate"> + <arguments> + <argument name="template" defaultValue="EmailTemplate"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FindAndOpenEmailTemplateActionGroup` instead --> + <amOnPage url="{{AdminEmailTemplateIndexPage.url}}" stepKey="navigateEmailTemplatePage" /> + <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clearFilters"/> + <fillField selector="{{AdminEmailTemplateIndexSection.searchTemplateField}}" userInput="{{template.templateName}}" stepKey="findCreatedTemplate"/> + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearch"/> + <waitForElementVisible selector="{{AdminEmailTemplateIndexSection.templateRowByName(template.templateName)}}" stepKey="waitForTemplatesAppeared"/> + <click selector="{{AdminEmailTemplateIndexSection.templateRowByName(template.templateName)}}" stepKey="clickToOpenTemplate"/> + <waitForElementVisible selector="{{AdminEmailTemplateEditSection.templateCode}}" stepKey="waitForTemplateNameisible"/> + <seeInField selector="{{AdminEmailTemplateEditSection.templateCode}}" userInput="{{template.templateName}}" stepKey="checkTemplateName"/> + </actionGroup> + + <actionGroup name="DeleteEmailTemplate" extends="FindAndOpenEmailTemplate"> + <annotations> + <description>Clicks on Delete Template. Accepts the Popup. Validates that the Email Template is NOT present in the Email Templates Grid.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `DeleteEmailTemplateActionGroup` instead --> + <click selector="{{AdminEmailTemplateEditSection.deleteTemplateButton}}" after="checkTemplateName" stepKey="deleteTemplate"/> + <waitForElementVisible selector="{{AdminEmailTemplateEditSection.acceptPopupButton}}" after="deleteTemplate" stepKey="waitForConfirmButton"/> + <click selector="{{AdminEmailTemplateEditSection.acceptPopupButton}}" after="waitForConfirmButton" stepKey="acceptPopup"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" after="acceptPopup" stepKey="waitForSuccessMessage"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You deleted the email template." after="waitForSuccessMessage" stepKey="seeSuccessfulMessage"/> + </actionGroup> + + <actionGroup name="PreviewEmailTemplateActionGroup" extends="FindAndOpenEmailTemplate"> + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateSystemBackupActionGroup` instead --> + <click selector="{{AdminEmailTemplateEditSection.previewTemplateButton}}" after="checkTemplateName" stepKey="clickPreviewTemplate"/> + <switchToNextTab after="clickPreviewTemplate" stepKey="switchToNewOpenedTab"/> + <seeInCurrentUrl url="{{AdminEmailTemplatePreviewPage.url}}" after="switchToNewOpenedTab" stepKey="seeCurrentUrl"/> + <seeElement selector="{{AdminEmailTemplatePreviewSection.iframe}}" after="seeCurrentUrl" stepKey="seeIframeOnPage"/> + <switchToIFrame userInput="preview_iframe" after="seeIframeOnPage" stepKey="switchToIframe"/> + <waitForPageLoad after="switchToIframe" stepKey="waitForPageLoaded"/> + </actionGroup> + + <actionGroup name="AssertEmailTemplateContent"> + <arguments> + <argument name="expectedContent" type="string" defaultValue="{{EmailTemplate.templateText}}"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertEmailTemplateContentActionGroup` instead --> + <see userInput="{{expectedContent}}" stepKey="checkTemplateContainText"/> + </actionGroup> +</actionGroups> From 84f9267d61c0f278849381d2bdb3b07a1f1c064a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 5 Dec 2019 00:07:15 +0100 Subject: [PATCH 185/586] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- .../ActionGroup/_Deprecated_ActionGroup.xml | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 app/code/Magento/Downloadable/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..9d739995e99e6 --- /dev/null +++ b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,106 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="fillMainDownloadableProductForm"> + <annotations> + <description>Fills the Name, SKU, Price and Quantity on the Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="product" defaultValue="DownloadableProduct"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FillMainDownloadableProductFormActionGroup` instead --> + <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductSku"/> + <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductName"/> + <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{product.price}}" stepKey="fillProductPrice"/> + <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{product.quantity}}" stepKey="fillProductQty"/> + </actionGroup> + + <actionGroup name="addDownloadableProductLinkWithMaxDownloads"> + <annotations> + <description>Clicks on 'Add Link'. Fills in the provided Link details including a Max Downloads limit.</description> + </annotations> + <arguments> + <argument name="link" defaultValue="downloadableLinkWithMaxDownloads"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddDownloadableProductLinkWithMaxDownloadsActionGroup` instead --> + <click selector="{{AdminProductDownloadableSection.linksAddLinkButton}}" stepKey="clickLinkAddLinkButton"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <fillField userInput="{{link.title}}" selector="{{AdminProductDownloadableSection.addLinkTitleInput('0')}}" stepKey="fillDownloadableLinkTitle"/> + <fillField userInput="{{link.price}}" selector="{{AdminProductDownloadableSection.addLinkPriceInput('0')}}" stepKey="fillDownloadableLinkPrice"/> + <selectOption userInput="{{link.file_type}}" selector="{{AdminProductDownloadableSection.addLinkFileTypeSelector('0')}}" stepKey="selectDownloadableLinkFileType"/> + <selectOption userInput="{{link.sample_type}}" selector="{{AdminProductDownloadableSection.addLinkSampleTypeSelector('0')}}" stepKey="selectDownloadableLinkSampleType"/> + <selectOption userInput="{{link.shareable}}" selector="{{AdminProductDownloadableSection.addLinkShareableSelector('0')}}" stepKey="selectDownloadableLinkShareable"/> + <fillField userInput="{{link.max_downloads}}" selector="{{AdminProductDownloadableSection.addLinkMaxDownloadsInput('0')}}" stepKey="fillDownloadableLinkMaxDownloads"/> + <attachFile userInput="{{link.file}}" selector="{{AdminProductDownloadableSection.addLinkFileUploadFile('0')}}" stepKey="fillDownloadableLinkUploadFile"/> + <fillField userInput="{{link.sample}}" selector="{{AdminProductDownloadableSection.addLinkSampleUrlInput('0')}}" stepKey="fillDownloadableLinkSampleUrl"/> + </actionGroup> + + <actionGroup name="addDownloadableProductLink"> + <annotations> + <description>Clicks on 'Add Link', under the 'Links' section. Fills in the provided Link details including Unlimited Downloads.</description> + </annotations> + <arguments> + <argument name="link" defaultValue="downloadableLink"/> + <argument name="index" type="string" defaultValue="1"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddDownloadableProductLinkActionGroup` instead --> + <click selector="{{AdminProductDownloadableSection.linksAddLinkButton}}" stepKey="clickLinkAddLinkButton"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <fillField userInput="{{link.title}}" selector="{{AdminProductDownloadableSection.addLinkTitleInput(index)}}" stepKey="fillDownloadableLinkTitle"/> + <fillField userInput="{{link.price}}" selector="{{AdminProductDownloadableSection.addLinkPriceInput(index)}}" stepKey="fillDownloadableLinkPrice"/> + <selectOption userInput="{{link.file_type}}" selector="{{AdminProductDownloadableSection.addLinkFileTypeSelector(index)}}" stepKey="selectDownloadableLinkFileType"/> + <selectOption userInput="{{link.sample_type}}" selector="{{AdminProductDownloadableSection.addLinkSampleTypeSelector(index)}}" stepKey="selectDownloadableLinkSampleType"/> + <selectOption userInput="{{link.shareable}}" selector="{{AdminProductDownloadableSection.addLinkShareableSelector(index)}}" stepKey="selectDownloadableLinkShareable"/> + <checkOption selector="{{AdminProductDownloadableSection.addLinkIsUnlimitedDownloads(index)}}" stepKey="checkDownloadableLinkUnlimited"/> + <fillField userInput="{{link.file}}" selector="{{AdminProductDownloadableSection.addLinkFileUrlInput(index)}}" stepKey="fillDownloadableLinkFileUrl"/> + <attachFile userInput="{{link.sample}}" selector="{{AdminProductDownloadableSection.addLinkSampleUploadFile(index)}}" stepKey="attachDownloadableLinkUploadSample"/> + <waitForPageLoad stepKey="waitForPageLoadAfterFillingOutForm" /> + </actionGroup> + + <actionGroup name="addDownloadableSampleFile"> + <annotations> + <description>Clicks on 'Add Link' under the 'Samples' section. Fills in the provided Downloadable Sample File details.</description> + </annotations> + <arguments> + <argument name="sample" defaultValue="downloadableSampleFile"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddDownloadableSampleFileActionGroup` instead --> + <click selector="{{AdminProductDownloadableSection.samplesAddLinkButton}}" stepKey="clickSampleAddLinkButton"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <fillField userInput="{{sample.title}}" selector="{{AdminProductDownloadableSection.addSampleTitleInput('0')}}" stepKey="fillDownloadableSampleTitle"/> + <selectOption userInput="{{sample.file_type}}" selector="{{AdminProductDownloadableSection.addSampleFileTypeSelector('0')}}" stepKey="selectDownloadableSampleFileType"/> + <attachFile userInput="{{sample.file}}" selector="{{AdminProductDownloadableSection.addSampleFileUploadFile('0')}}" stepKey="selectDownloadableSampleUpload"/> + <waitForAjaxLoad stepKey="waitForSampleFileUpload"/> + </actionGroup> + + <actionGroup name="addDownloadableSampleUrl"> + <annotations> + <description>Clicks on 'Add Link' under the 'Samples' section. Fills in the provided Downloadable Sample URL details.</description> + </annotations> + <arguments> + <argument name="sample" defaultValue="downloadableSampleUrl"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddDownloadableSampleUrlActionGroup` instead --> + <click selector="{{AdminProductDownloadableSection.samplesAddLinkButton}}" stepKey="clickSampleAddLinkButton2"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <fillField userInput="{{sample.title}}" selector="{{AdminProductDownloadableSection.addSampleTitleInput('1')}}" stepKey="fillDownloadableSampleTitle"/> + <selectOption userInput="{{sample.file_type}}" selector="{{AdminProductDownloadableSection.addSampleFileTypeSelector('1')}}" stepKey="selectDownloadableSampleFileType"/> + <fillField userInput="{{sample.file}}" selector="{{AdminProductDownloadableSection.addSampleFileUrlInput('1')}}" stepKey="fillDownloadableSampleFileUrl"/> + </actionGroup> +</actionGroups> From c60bbaa506e08541081deed8c3562164947ebea5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 5 Dec 2019 00:22:21 +0100 Subject: [PATCH 186/586] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- ...> StorefrontSwitchCurrencyActionGroup.xml} | 0 .../ActionGroup/_Deprecated_ActionGroup.xml | 27 +++++++++++++++++++ 2 files changed, 27 insertions(+) rename app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/{StorefrontCurrencyRatesActionGroup.xml => StorefrontSwitchCurrencyActionGroup.xml} (100%) create mode 100644 app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/StorefrontCurrencyRatesActionGroup.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/StorefrontSwitchCurrencyActionGroup.xml similarity index 100% rename from app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/StorefrontCurrencyRatesActionGroup.xml rename to app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/StorefrontSwitchCurrencyActionGroup.xml diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..0bb23b04b66a9 --- /dev/null +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + + <actionGroup name="StorefrontSwitchCurrency"> + <arguments> + <argument name="currency" type="string" defaultValue="EUR"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontSwitchCurrencyActionGroup` instead --> + <click selector="{{StorefrontSwitchCurrencyRatesSection.currencyTrigger}}" stepKey="openTrigger"/> + <waitForElementVisible selector="{{StorefrontSwitchCurrencyRatesSection.currency(currency)}}" stepKey="waitForCurrency"/> + <click selector="{{StorefrontSwitchCurrencyRatesSection.currency(currency)}}" stepKey="chooseCurrency"/> + <see selector="{{StorefrontSwitchCurrencyRatesSection.selectedCurrency}}" userInput="{{currency}}" stepKey="seeSelectedCurrency"/> + </actionGroup> +</actionGroups> From 910cc76c985b5559be0bfc287c5593803fc9ac0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 5 Dec 2019 00:36:29 +0100 Subject: [PATCH 187/586] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- .../ActionGroup/_Deprecated_ActionGroup.xml | 853 ++++++++++++++++++ 1 file changed, 853 insertions(+) create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..672465ad4120b --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,853 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="CreateConfigurableProductWithAttributeSet"> + <annotations> + <description>Admin edit created product as configurable. Choose created options</description> + </annotations> + <arguments> + <argument name="product" defaultValue="_defaultProduct"/> + <argument name="category" defaultValue="_defaultCategory"/> + <argument name="label" type="string" defaultValue="mySet"/> + <argument name="option" type="string" defaultValue="['option1', 'option2', 'option3', 'option4']"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateConfigurableProductWithAttributeSetActionGroup` instead --> + <click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet"/> + <fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{label}}" stepKey="searchForAttrSet"/> + <click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttrSet"/> + <fillField userInput="{{product.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/> + <selectOption selector="{{AdminProductFormSection.additionalOptions}}" parameterArray="{{option}}" stepKey="searchAndMultiSelectCreatedOption"/> + </actionGroup> + + <actionGroup name="AdminCreateConfigurationsForAttribute" extends="generateConfigurationsByAttributeCode"> + <annotations> + <description>EXTENDS: generateConfigurationsByAttributeCode. Click to apply single price to all Skus. Enter Attribute price</description> + </annotations> + <arguments> + <argument name="price" type="string" defaultValue="100"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminCreateConfigurationsForAttributeActionGroup` instead --> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" after="clickOnNextButton2" stepKey="waitForNextPageOpened2"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" after="waitForNextPageOpened2" stepKey="clickOnApplySinglePriceToAllSkus"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.singlePrice}}" userInput="{{price}}" before="clickOnApplySingleQuantityToEachSku" stepKey="enterAttributePrice"/> + </actionGroup> + + <actionGroup name="AdminCreateConfigurableProductWithAttributeUncheckOption" extends="generateConfigurationsByAttributeCode"> + <annotations> + <description>EXTENDS: generateConfigurationsByAttributeCode. Click to uncheck created option. Enter Attribute price</description> + </annotations> + <arguments> + <argument name="attributeOption" type="string" defaultValue="option1"/> + <argument name="price" type="string" defaultValue="100"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminCreateConfigurableProductWithAttributeUncheckOptionActionGroup` instead --> + <click selector="{{AdminCreateProductConfigurationsPanel.attributeOption('attributeOption')}}" after="clickOnSelectAll" stepKey="clickToUncheckOption"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" after="clickToUncheckOption" stepKey="clickOnNextButton22"/> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" after="clickOnNextButton22" stepKey="waitForNextPageOpened2"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" after="waitForNextPageOpened2" stepKey="clickOnApplySinglePriceToAllSkus"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.singlePrice}}" userInput="{{price}}" before="clickOnApplySingleQuantityToEachSku" stepKey="enterAttributePrice"/> + </actionGroup> + + <actionGroup name="viewConfigurableProductInAdminGrid"> + <annotations> + <description>Goes to the Admin Product grid page. Validates the provided Configurable Product is present and correct in the grid.</description> + </annotations> + <arguments> + <argument name="product" defaultValue="_defaultProduct"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ViewConfigurableProductInAdminGridActionGroup` instead --> + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> + <waitForPageLoad stepKey="waitForPageLoadInitial"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <seeNumberOfElements selector="{{AdminProductGridSection.productGridRows}}" userInput="3" stepKey="seeCorrectNumberOfProducts"/> + + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFiltersSimple"/> + <selectOption selector="{{AdminProductGridFilterSection.typeFilter}}" userInput="simple" stepKey="selectionProductType"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFiltersWithSimpleType"/> + <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.name}}" stepKey="seeSimpleProductNameInGrid"/> + <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.price}}" stepKey="seeSimpleProductPriceInGrid"/> + + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFiltersConfigurable"/> + <selectOption selector="{{AdminProductGridFilterSection.typeFilter}}" userInput="{{product.type_id}}" stepKey="selectionConfigurableProductType"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFiltersWithConfigurableType"/> + <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.name}}" stepKey="seeConfigurableProductNameInGrid"/> + <dontSee selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.price}}" stepKey="dontSeeProductPriceNameInGrid"/> + + <click selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="clickClearFiltersAfter"/> + </actionGroup> + + <actionGroup name="createConfigurableProduct"> + <annotations> + <description>Goes to the Admin Product grid page. Creates a Configurable Product using the default Product Options.</description> + </annotations> + <arguments> + <argument name="product" defaultValue="_defaultProduct"/> + <argument name="category" defaultValue="_defaultCategory"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateConfigurableProductActionGroup` instead --> + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> + <waitForPageLoad time="30" stepKey="wait1"/> + <click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickOnAddProductToggle"/> + <click selector="{{AdminProductGridActionSection.addConfigurableProduct}}" stepKey="clickOnAddConfigurableProduct"/> + <fillField userInput="{{product.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/> + <fillField userInput="{{product.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="fillSKU"/> + <fillField userInput="{{product.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="fillPrice"/> + <fillField userInput="{{product.quantity}}" selector="{{AdminProductFormSection.productQuantity}}" stepKey="fillQuantity"/> + <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{category.name}}]" stepKey="fillCategory"/> + <selectOption userInput="{{product.visibility}}" selector="{{AdminProductFormSection.visibility}}" stepKey="fillVisibility"/> + <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/> + <fillField userInput="{{product.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/> + + <click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickOnCreateConfigurations"/> + <click selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" stepKey="clickOnNewAttribute"/> + <waitForPageLoad stepKey="waitForIFrame"/> + <switchToIFrame selector="{{AdminNewAttributePanel.newAttributeIFrame}}" stepKey="switchToNewAttributeIFrame"/> + <fillField selector="{{AdminNewAttributePanel.defaultLabel}}" userInput="{{colorProductAttribute.default_label}}" stepKey="fillDefaultLabel"/> + <click selector="{{AdminNewAttributePanel.saveAttribute}}" stepKey="clickOnNewAttributePanel"/> + <waitForPageLoad stepKey="waitForSaveAttribute"/> + <switchToIFrame stepKey="switchOutOfIFrame"/> + <waitForPageLoad stepKey="waitForFilters"/> + <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickOnFilters"/> + <fillField userInput="{{colorProductAttribute.default_label}}" selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" stepKey="fillFilterAttributeCodeField"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/> + <click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton1"/> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="waitCreateNewValueAppears"/> + <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateNewValue1"/> + <fillField userInput="{{colorProductAttribute1.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewAttribute1"/> + <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute1"/> + <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateNewValue2"/> + <fillField userInput="{{colorProductAttribute2.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewAttribute2"/> + <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute2"/> + <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateNewValue3"/> + <fillField userInput="{{colorProductAttribute3.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewAttribute3"/> + <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute3"/> + <click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="clickOnSelectAll"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton2"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applyUniquePricesByAttributeToEachSku}}" stepKey="clickOnApplyUniquePricesByAttributeToEachSku"/> + <selectOption selector="{{AdminCreateProductConfigurationsPanel.selectAttribute}}" userInput="{{colorProductAttribute.default_label}}" stepKey="selectAttributes"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.attribute1}}" userInput="{{colorProductAttribute1.price}}" stepKey="fillAttributePrice1"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.attribute2}}" userInput="{{colorProductAttribute2.price}}" stepKey="fillAttributePrice2"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.attribute3}}" userInput="{{colorProductAttribute3.price}}" stepKey="fillAttributePrice3"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickOnApplySingleQuantityToEachSku"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="1" stepKey="enterAttributeQuantity"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton3"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton4"/> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/> + <seeInTitle userInput="{{product.name}}" stepKey="seeProductNameInTitle"/> + </actionGroup> + + <actionGroup name="createConfigurableProductWithTwoAttributes" extends="createConfigurableProduct"> + <annotations> + <description>Goes to the Admin Product grid page. Creates a Configurable Product with 2 product attributes.</description> + </annotations> + <arguments> + <argument name="attribute1" defaultValue="ProductColorAttribute"/> + <argument name="attribute2" defaultValue="ProductSizeAttribute"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateConfigurableProductWithTwoAttributesActionGroup` instead --> + <remove keyForRemoval="clickOnNewAttribute"/> + <remove keyForRemoval="waitForIFrame"/> + <remove keyForRemoval="switchToNewAttributeIFrame"/> + <remove keyForRemoval="fillDefaultLabel"/> + <remove keyForRemoval="clickOnNewAttributePanel"/> + <remove keyForRemoval="waitForSaveAttribute"/> + <remove keyForRemoval="switchOutOfIFrame"/> + <remove keyForRemoval="waitForFilters"/> + <remove keyForRemoval="clickOnFilters"/> + <remove keyForRemoval="fillFilterAttributeCodeField"/> + <remove keyForRemoval="clickApplyFiltersButton"/> + <remove keyForRemoval="clickOnFirstCheckbox"/> + <click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox(attribute1.attribute_code)}}" stepKey="selectAttribute1" after="clickOnCreateConfigurations"/> + <click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox(attribute2.attribute_code)}}" stepKey="selectAttribute2" after="selectAttribute1"/> + <remove keyForRemoval="waitCreateNewValueAppears"/> + <remove keyForRemoval="clickOnCreateNewValue1"/> + <remove keyForRemoval="fillFieldForNewAttribute1"/> + <remove keyForRemoval="clickOnSaveNewAttribute1"/> + <remove keyForRemoval="clickOnCreateNewValue2"/> + <remove keyForRemoval="fillFieldForNewAttribute2"/> + <remove keyForRemoval="clickOnSaveNewAttribute2"/> + <remove keyForRemoval="clickOnCreateNewValue3"/> + <remove keyForRemoval="fillFieldForNewAttribute3"/> + <remove keyForRemoval="clickOnSaveNewAttribute3"/> + <remove keyForRemoval="clickOnSelectAll"/> + <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(attribute1.frontend_label)}}" stepKey="selectAllOptionsOfAttribute1" before="clickOnNextButton2"/> + <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(attribute2.frontend_label)}}" stepKey="selectAllOptionsOfAttribute2" before="clickOnNextButton2"/> + <remove keyForRemoval="applyUniquePricesByAttributeToEachSku"/> + <remove keyForRemoval="clickOnApplyUniquePricesByAttributeToEachSku"/> + <remove keyForRemoval="selectAttributes"/> + <remove keyForRemoval="fillAttributePrice1"/> + <remove keyForRemoval="fillAttributePrice2"/> + <remove keyForRemoval="fillAttributePrice3"/> + <remove keyForRemoval="clickOnSaveButton2"/> + <remove keyForRemoval="clickOnConfirmInPopup"/> + <remove keyForRemoval="seeSaveProductMessage"/> + <remove keyForRemoval="seeProductNameInTitle"/> + </actionGroup> + + <actionGroup name="saveConfigurableProduct"> + <annotations> + <description>Save configurable product</description> + </annotations> + <arguments> + <argument name="product" defaultValue="_defaultProduct"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SaveConfigurableProductActionGroup` instead --> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/> + <seeInTitle userInput="{{product.name}}" stepKey="seeProductNameInTitle"/> + </actionGroup> + + <actionGroup name="generateConfigurationsByAttributeCode"> + <annotations> + <description>Generates the Product Configurations for the provided Attribute Code on the Configurable Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="attributeCode" type="string" defaultValue="SomeString"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `GenerateConfigurationsByAttributeCodeActionGroup` instead --> + <click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickCreateConfigurations"/> + <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickFilters"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" userInput="{{attributeCode}}" stepKey="fillFilterAttributeCodeField"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/> + <click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton1"/> + <click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="clickOnSelectAll"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton2"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickOnApplySingleQuantityToEachSku"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="99" stepKey="enterAttributeQuantity"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton3"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton4"/> + </actionGroup> + + <actionGroup name="createOptionsForAttribute"> + <arguments> + <argument name="attributeName" type="string" defaultValue="{{productAttributeColor.default_label}}"/> + <argument name="firstOptionName" type="string" defaultValue="option1"/> + <argument name="secondOptionName" type="string" defaultValue="option2"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateOptionsForAttributeActionGroup` instead --> + <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickOnFilters"/> + <fillField userInput="{{attributeName}}" selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" stepKey="fillFilterAttributeCodeField"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/> + <click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton"/> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="waitCreateNewValueAppears"/> + <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateFirstNewValue"/> + <fillField userInput="{{firstOptionName}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewFirstOption"/> + <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute"/> + <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateSecondNewValue"/> + <fillField userInput="{{secondOptionName}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewSecondOption"/> + <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveAttribute"/> + <click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="clickOnSelectAll"/> + </actionGroup> + + <actionGroup name="createConfigurationsForAttribute" extends="generateConfigurationsByAttributeCode"> + <annotations> + <description>EXTENDS: generateConfigurationsByAttributeCode. Clicks on the Save button. Clicks on the Confirm button.</description> + </annotations> + <arguments> + <argument name="attributeCode" type="string" defaultValue="SomeString"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateConfigurationsForAttributeActionGroup` instead --> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> + </actionGroup> + + <actionGroup name="createConfigurationsForAttributeWithImages" extends="generateConfigurationsByAttributeCode"> + <annotations> + <description>EXTENDS: generateConfigurationsByAttributeCode. Adds the provided Attribute Image to the provided Attribute Code.</description> + </annotations> + <arguments> + <argument name="attributeCode" type="string" defaultValue="SomeString"/> + <argument name="image" defaultValue="ProductImage"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateConfigurationsForAttributeWithImagesActionGroup` instead --> + <click selector="{{AdminCreateProductConfigurationsPanel.applySingleSetOfImages}}" stepKey="clickOnApplySingleImageSetToAllSku" after="enterAttributeQuantity"/> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.imageUploadButton}}" stepKey="seeImageSectionIsReady" after="clickOnApplySingleImageSetToAllSku"/> + <attachFile selector="{{AdminCreateProductConfigurationsPanel.imageFileUpload}}" userInput="{{image.file}}" stepKey="uploadFile" after="seeImageSectionIsReady"/> + <waitForElementNotVisible selector="{{AdminCreateProductConfigurationsPanel.uploadProgressBar}}" stepKey="waitForUpload" after="uploadFile"/> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.imageFile(image.fileName)}}" stepKey="waitForThumbnail" after="waitForUpload"/> + + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2" after="clickOnNextButton4"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup" after="clickOnSaveButton2"/> + </actionGroup> + + <actionGroup name="createConfigurationsForTwoAttribute" extends="generateConfigurationsByAttributeCode"> + <annotations> + <description>EXTENDS: generateConfigurationsByAttributeCode. Generates the Product Configurations for the 2 provided Attribute Codes on the Configurable Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="secondAttributeCode" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateConfigurationsForTwoAttributeActionGroup` instead --> + <remove keyForRemoval="clickOnSelectAll"/> + <remove keyForRemoval="clickFilters"/> + <remove keyForRemoval="fillFilterAttributeCodeField"/> + <remove keyForRemoval="clickApplyFiltersButton"/> + <remove keyForRemoval="clickOnFirstCheckbox"/> + + <click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox(attributeCode)}}" stepKey="clickOnFirstAttributeCheckbox" after="clickCreateConfigurations"/> + <click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox(secondAttributeCode)}}" stepKey="clickOnSecondAttributeCheckbox" after="clickOnFirstAttributeCheckbox"/> + <grabTextFrom selector="{{AdminCreateProductConfigurationsPanel.defaultLabel(attributeCode)}}" stepKey="grabFirstAttributeDefaultLabel" after="clickOnSecondAttributeCheckbox"/> + <grabTextFrom selector="{{AdminCreateProductConfigurationsPanel.defaultLabel(secondAttributeCode)}}" stepKey="grabSecondAttributeDefaultLabel" after="grabFirstAttributeDefaultLabel"/> + <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute({$grabFirstAttributeDefaultLabel})}}" stepKey="clickOnSelectAllForFirstAttribute" after="clickOnNextButton1"/> + <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute({$grabSecondAttributeDefaultLabel})}}" stepKey="clickOnSelectAllForSecondAttribute" after="clickOnSelectAllForFirstAttribute"/> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> + </actionGroup> + + <actionGroup name="saveConfiguredProduct"> + <annotations> + <description>Save the Configurable Product on the Configurable Product creation/edit page. Validates that the Success Message is present.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SaveConfiguredProductActionGroup` instead --> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/> + </actionGroup> + + <actionGroup name="GenerateAndSaveConfiguredProductAfterSettingOptions" extends="saveConfiguredProduct"> + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `GenerateAndSaveConfiguredProductAfterSettingOptionsActionGroup` instead --> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" before="clickOnSaveButton2" stepKey="clickOnNextButton"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" after="clickOnNextButton" stepKey="clickOnGenerateProductsButton"/> + </actionGroup> + + <actionGroup name="addNewProductConfigurationAttribute"> + <annotations> + <description>Generates the Product Configurations for the 2 provided Attribute Names on the Configurable Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="attribute" type="entity"/> + <argument name="firstOption" type="entity"/> + <argument name="secondOption" type="entity"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddNewProductConfigurationAttributeActionGroup` instead --> + <click selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" stepKey="clickOnNewAttribute"/> + <waitForPageLoad stepKey="waitForIFrame"/> + <switchToIFrame selector="{{AdminNewAttributePanel.newAttributeIFrame}}" stepKey="switchToNewAttributeIFrame"/> + <fillField selector="{{AdminNewAttributePanel.defaultLabel}}" userInput="{{attribute.default_label}}" stepKey="fillDefaultLabel"/> + <click selector="{{AdminNewAttributePanel.saveAttribute}}" stepKey="clickOnNewAttributePanel"/> + <waitForPageLoad stepKey="waitForSaveAttribute"/> + <switchToIFrame stepKey="switchOutOfIFrame"/> + <waitForPageLoad stepKey="waitForFilters"/> + + <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickOnFilters"/> + <fillField userInput="{{attribute.default_label}}" selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" stepKey="fillFilterAttributeCodeField"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/> + <click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton"/> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="waitCreateNewValueAppears"/> + <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateFirstNewValue"/> + <fillField userInput="{{firstOption.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewFirstOption"/> + <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute"/> + <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateSecondNewValue"/> + <fillField userInput="{{secondOption.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewSecondOption"/> + <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveAttribute"/> + <click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="clickOnSelectAll"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnSecondNextButton"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnThirdNextButton"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnFourthNextButton"/> + </actionGroup> + + <actionGroup name="selectCreatedAttributeAndCreateTwoOptions" extends="addNewProductConfigurationAttribute"> + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SelectCreatedAttributeAndCreateTwoOptionsActionGroup` instead --> + <remove keyForRemoval="clickOnNewAttribute"/> + <remove keyForRemoval="waitForIFrame"/> + <remove keyForRemoval="switchToNewAttributeIFrame"/> + <remove keyForRemoval="fillDefaultLabel"/> + <remove keyForRemoval="clickOnNewAttributePanel"/> + <remove keyForRemoval="waitForSaveAttribute"/> + <remove keyForRemoval="switchOutOfIFrame"/> + <remove keyForRemoval="waitForFilters"/> + <fillField userInput="{{attribute.attribute_code}}" selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" stepKey="fillFilterAttributeCodeField"/> + <fillField userInput="{{firstOption.label}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewFirstOption"/> + <fillField userInput="{{secondOption.label}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewSecondOption"/> + <remove keyForRemoval="clickOnSelectAll"/> + <remove keyForRemoval="clickOnSecondNextButton"/> + <remove keyForRemoval="clickOnThirdNextButton"/> + <remove keyForRemoval="clickOnFourthNextButton"/> + </actionGroup> + + <actionGroup name="changeProductConfigurationsInGrid"> + <annotations> + <description>Edit the Product Configuration via the Admin Product grid page.</description> + </annotations> + <arguments> + <argument name="firstOption" type="entity"/> + <argument name="secondOption" type="entity"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ChangeProductConfigurationsInGridActionGroup` instead --> + <fillField userInput="{{firstOption.name}}" selector="{{AdminProductFormConfigurationsSection.confProductNameCell(firstOption.name)}}" stepKey="fillFieldNameForFirstAttributeOption"/> + <fillField userInput="{{secondOption.name}}" selector="{{AdminProductFormConfigurationsSection.confProductNameCell(secondOption.name)}}" stepKey="fillFieldNameForSecondAttributeOption"/> + <fillField userInput="{{firstOption.sku}}" selector="{{AdminProductFormConfigurationsSection.confProductSkuCell(firstOption.name)}}" stepKey="fillFieldSkuForFirstAttributeOption"/> + <fillField userInput="{{secondOption.sku}}" selector="{{AdminProductFormConfigurationsSection.confProductSkuCell(secondOption.name)}}" stepKey="fillFieldSkuForSecondAttributeOption"/> + <fillField userInput="{{firstOption.price}}" selector="{{AdminProductFormConfigurationsSection.confProductPriceCell(firstOption.name)}}" stepKey="fillFieldPriceForFirstAttributeOption"/> + <fillField userInput="{{secondOption.price}}" selector="{{AdminProductFormConfigurationsSection.confProductPriceCell(secondOption.name)}}" stepKey="fillFieldPriceForSecondAttributeOption"/> + <fillField userInput="{{firstOption.quantity}}" selector="{{AdminProductFormConfigurationsSection.confProductQuantityCell(firstOption.name)}}" stepKey="fillFieldQuantityForFirstAttributeOption"/> + <fillField userInput="{{secondOption.quantity}}" selector="{{AdminProductFormConfigurationsSection.confProductQuantityCell(secondOption.name)}}" stepKey="fillFieldQuantityForSecondAttributeOption"/> + <fillField userInput="{{firstOption.weight}}" selector="{{AdminProductFormConfigurationsSection.confProductWeightCell(firstOption.name)}}" stepKey="fillFieldWeightForFirstAttributeOption"/> + <fillField userInput="{{secondOption.weight}}" selector="{{AdminProductFormConfigurationsSection.confProductWeightCell(secondOption.name)}}" stepKey="fillFieldWeightForSecondAttributeOption"/> + </actionGroup> + + <actionGroup name="changeConfigurableProductChildProductPrice"> + <annotations> + <description>Change the price of a configurable child product in the grid under configurations.</description> + </annotations> + <arguments> + <argument name="productAttributes" type="string"/> + <argument name="productPrice" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ChangeConfigurableProductChildProductPriceActionGroup` instead --> + <fillField userInput="{{productPrice}}" selector="{{AdminProductFormConfigurationsSection.confProductPriceCell(productAttributes)}}" stepKey="fillPriceForConfigurableProductAttributeOption"/> + </actionGroup> + + <actionGroup name="changeProductConfigurationsInGridExceptSku" extends="changeProductConfigurationsInGrid"> + <annotations> + <description>EXTENDS: changeProductConfigurationsInGrid. Removes 'fillFieldSkuForFirstAttributeOption' and 'fillFieldSkuForSecondAttributeOption'.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ChangeProductConfigurationsInGridExceptSkuActionGroup` instead --> + <remove keyForRemoval="fillFieldSkuForFirstAttributeOption"/> + <remove keyForRemoval="fillFieldSkuForSecondAttributeOption"/> + </actionGroup> + + <actionGroup name="addProductToConfigurationsGrid"> + <annotations> + <description>Adds the provided Product SKU to the provided Product Name.</description> + </annotations> + <arguments> + <argument name="sku" type="string"/> + <argument name="name" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddProductToConfigurationsGridActionGroup` instead --> + <click selector="{{AdminProductFormConfigurationsSection.actionsBtnByProductName(name)}}" stepKey="clickToExpandFirstActions"/> + <click selector="{{AdminProductFormConfigurationsSection.addProduct(name)}}" stepKey="clickChooseFirstDifferentProduct"/> + <switchToIFrame stepKey="switchOutOfIFrame"/> + <waitForPageLoad stepKey="waitForFilters"/> + <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickFilters"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <click selector="{{AdminProductGridFilterSection.firstRowBySku(sku)}}" stepKey="clickOnFirstRow"/> + </actionGroup> + + <actionGroup name="addUniqueImageToConfigurableProductOption"> + <annotations> + <description>Adds the provided Image to a Configurable Product on the Admin Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="image" defaultValue="ProductImage"/> + <argument name="frontend_label" type="string"/> + <argument name="label" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddUniqueImageToConfigurableProductOptionActionGroup` instead --> + <click selector="{{AdminCreateProductConfigurationsPanel.applyUniqueImagesToEachSkus}}" stepKey="clickOnApplyUniqueImagesToEachSku"/> + <selectOption userInput="{{frontend_label}}" selector="{{AdminCreateProductConfigurationsPanel.selectImagesButton}}" stepKey="selectOption"/> + <attachFile selector="{{AdminCreateProductConfigurationsPanel.uploadImagesButton(label)}}" userInput="{{image.file}}" stepKey="uploadFile"/> + <waitForElementNotVisible selector="{{AdminCreateProductConfigurationsPanel.uploadProgressBar}}" stepKey="waitForUpload"/> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.imageFile(image.fileName)}}" stepKey="waitForThumbnail"/> + </actionGroup> + + <actionGroup name="addUniquePriceToConfigurableProductOption"> + <annotations> + <description>On the 'Step 3: Bulk Images, Price and Quantity' page of the 'Create Product Configurations' model click on 'Apply unique prices...'. Select provided Option. Fill price.</description> + </annotations> + <arguments> + <argument name="frontend_label" type="string"/> + <argument name="label" type="string"/> + <argument name="price" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddUniquePriceToConfigurableProductOptionActionGroup` instead --> + <click selector="{{AdminCreateProductConfigurationsPanel.applyUniquePricesToEachSkus}}" stepKey="clickOnApplyUniquePricesToEachSku"/> + <selectOption userInput="{{frontend_label}}" selector="{{AdminCreateProductConfigurationsPanel.selectPriceButton}}" stepKey="selectOption"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.price(label)}}" userInput="{{price}}" stepKey="enterAttributeQuantity"/> + </actionGroup> + + <actionGroup name="addUniqueQuantityToConfigurableProductOption"> + <arguments> + <argument name="frontend_label" type="string" defaultValue="{{productAttributeColor.default_label}}"/> + <argument name="label" type="string" defaultValue="option1"/> + <argument name="quantity" type="string" defaultValue="10"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddUniqueQuantityToConfigurableProductOptionActionGroup` instead --> + <click selector="{{AdminCreateProductConfigurationsPanel.applyUniqueQuantityToEachSkus}}" stepKey="clickOnApplyUniqueQuantitiesToEachSku"/> + <selectOption selector="{{AdminCreateProductConfigurationsPanel.selectQuantity}}" userInput="{{frontend_label}}" stepKey="selectOption"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.applyUniqueQuantity(label)}}" userInput="{{quantity}}" stepKey="enterAttributeQuantity"/> + </actionGroup> + + <actionGroup name="saveConfigurableProductWithNewAttributeSet"> + <annotations> + <description>Clicks on 'Save'. Clicks radio for '...new Attribute Set...' in the 'Choose Affected Attribute Set' modal. Clicks on 'Confirm' in the model on the Configurable Product creation/edit page.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SaveConfigurableProductWithNewAttributeSetActionGroup` instead --> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveConfigurableProduct"/> + <waitForElementVisible selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" time="30" stepKey="waitForAttributeSetConfirmation"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.addNewAttrSet}}" stepKey="clickAddNewAttributeSet"/> + <fillField selector="{{AdminChooseAffectedAttributeSetPopup.createNewAttrSetName}}" userInput="{{ProductAttributeFrontendLabel.label}}" stepKey="fillFieldNewAttrSetName"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickConfirmAttributeSet"/> + <see selector="You saved the product" stepKey="seeConfigurableSaveConfirmation" after="clickConfirmAttributeSet"/> + </actionGroup> + + <actionGroup name="saveConfigurableProductAddToCurrentAttributeSet"> + <annotations> + <description>Clicks on 'Save'. Clicks on 'Confirm' in the 'Choose Affected Attribute Set' model on the Configurable Product creation/edit page.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SaveConfigurableProductAddToCurrentAttributeSetActionGroup` instead --> + <waitForElementVisible selector="{{AdminProductFormActionSection.saveButton}}" stepKey="waitForSaveBtnVisible"/> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProductAgain"/> + <waitForElementVisible selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="waitPopUpVisible"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmPopup"/> + <seeElement selector="{{AdminMessagesSection.success}}" stepKey="seeSaveProductMessage"/> + </actionGroup> + + <actionGroup name="assertConfigurableProductOnAdminProductPage"> + <annotations> + <description>Validates that the provided Configurable Product Name, SKU and Price are present and correct on the Configurable Product creation/edit page. PLEASE NOTE: The Product Data is Hardcoded.</description> + </annotations> + <arguments> + <argument name="product" type="entity"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertConfigurableProductOnAdminProductPageActionGroup` instead --> + <seeInField userInput="{{ApiConfigurableProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="seeNameRequired"/> + <seeInField userInput="{{ApiConfigurableProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="seeSkuRequired"/> + <dontSeeInField userInput="{{ApiConfigurableProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="dontSeePriceRequired"/> + </actionGroup> + + <actionGroup name="StartCreateConfigurationsForAttribute" extends="generateConfigurationsByAttributeCode"> + <remove keyForRemoval="clickOnNextButton3"/> + <remove keyForRemoval="clickOnNextButton4"/> + </actionGroup> + + <actionGroup name="GotoCatalogProductsPage"> + <annotations> + <description>Goes to the Admin Products grid via the Admin Side Menu.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `GotoCatalogProductsPageActionGroup` instead --> + <click stepKey="clickOnCatalogItem" selector="{{CatalogProductsSection.catalogItem}}"/> + <waitForPageLoad stepKey="waitForCatalogLoad"/> + <click stepKey="clickOnProductItem" selector="{{CatalogProductsSection.productItem}}"/> + <waitForPageLoad stepKey="waitForCatalogProductPageLoad"/> + <seeInCurrentUrl stepKey="assertWeAreOnTheCatalogProductPage" url="{{assertionData.catalogProduct}}"/> + </actionGroup> + + <actionGroup name="GotoConfigurableProductPage"> + <annotations> + <description>Clicks on create Configurable Product from the Admin Products grid page.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `GotoConfigurableProductPageActionGroup` instead --> + <click stepKey="clickOnAddProductItem" selector="{{ConfigurableProductSection.addProductItem}}"/> + <click stepKey="clickOnConfigurationProductItem" selector="{{ConfigurableProductSection.configProductItem}}"/> + <waitForPageLoad stepKey="waitForConfigurableProductPageLoad"/> + <seeInCurrentUrl stepKey="assertWeAreOnTheConfigurableProductPage" url="{{assertionData.configurableProduct}}"/> + </actionGroup> + + <actionGroup name="FillAllRequiredFields"> + <annotations> + <description>Fills the Product Name, Price and Weight fields. Clicks on 'Create Configurations'. Clicks on 'Create New Attribute'.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FillAllRequiredFieldsActionGroup` instead --> + <fillField stepKey="fillInProductNameFields" selector="{{NewProduct.productName}}" userInput="{{NewProductsData.productName}}"/> + <fillField stepKey="fillInPriceFields" selector="{{NewProduct.price}}" userInput="{{NewProductsData.price}}"/> + <fillField stepKey="fillInWeightFields" selector="{{NewProduct.weight}}" userInput="{{NewProductsData.weight}}"/> + <click stepKey="clickOnCreateConfigurationsButton" selector="{{NewProduct.createConfigurationButton}}"/> + <waitForPageLoad stepKey="waitForCreateProductConfigurationsPageLoad"/> + <click stepKey="clickOnCreateNewAttributeButton" selector="{{NewProduct.createNewAttributeButton}}"/> + <waitForPageLoad stepKey="waitForNewAttributePageLoad"/> + </actionGroup> + + <actionGroup name="CreateNewAttribute"> + <annotations> + <description>Creates a new Product Attribute via the Admin Products creation/edit page. PLEASE NOTE: The Product Attributes are Hardcoded.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateNewAttributeActionGroup` instead --> + <switchToIFrame stepKey="NewAttributePage" selector="{{NewProduct.newAttributeIFrame}}"/> + <fillField stepKey="fillInDefaultLabelField" selector="{{NewProduct.defaultLabel}}" userInput="{{NewProductsData.defaultLabel}}"/> + + <!--Add option 1 to attribute--> + <click selector="{{NewProduct.addOptionButton}}" stepKey="clickAddOption1"/> + <waitForPageLoad stepKey="waitForOption1"/> + <fillField stepKey="fillInAdminFieldRed" selector="{{NewProduct.adminFieldRed}}" userInput="{{NewProductsData.adminFieldRed}}"/> + <fillField stepKey="fillInDefaultStoreViewFieldRed" selector="{{NewProduct.defaultStoreViewFieldRed}}" userInput="{{NewProductsData.defaultStoreViewFieldRed}}"/> + + <!--Add option 2 to attribute--> + <click selector="{{NewProduct.addOptionButton}}" stepKey="clickAddOption2"/> + <waitForPageLoad stepKey="waitForOption2"/> + <fillField stepKey="fillInAdminFieldBlue" selector="{{NewProduct.adminFieldBlue}}" userInput="{{NewProductsData.adminFieldBlue}}"/> + <fillField stepKey="fillInDefaultStoreViewFieldBlue" selector="{{NewProduct.defaultStoreViewFieldBlue}}" userInput="{{NewProductsData.defaultStoreViewFieldBlue}}"/> + + <!--Add option 3 to attribute--> + <click selector="{{NewProduct.addOptionButton}}" stepKey="clickAddOption3"/> + <waitForPageLoad stepKey="waitForOption3"/> + <fillField stepKey="fillInAdminFieldYellow" selector="{{NewProduct.adminFieldYellow}}" userInput="{{NewProductsData.adminFieldYellow}}"/> + <fillField stepKey="fillInDefaultStoreViewFieldYellow" selector="{{NewProduct.defaultStoreViewFieldYellow}}" userInput="{{NewProductsData.defaultStoreViewFieldYellow}}"/> + + <!--Add option 4 to attribute--> + <click selector="{{NewProduct.addOptionButton}}" stepKey="clickAddOption4"/> + <waitForPageLoad stepKey="waitForOption4"/> + <fillField stepKey="fillInAdminFieldGreen" selector="{{NewProduct.adminFieldGreen}}" userInput="{{NewProductsData.adminFieldGreen}}"/> + <fillField stepKey="fillInDefaultStoreViewFieldGreen" selector="{{NewProduct.defaultStoreViewFieldGreen}}" userInput="{{NewProductsData.defaultStoreViewFieldGreen}}"/> + + <!--Add option 5 to attribute--> + <click selector="{{NewProduct.addOptionButton}}" stepKey="clickAddOption5"/> + <waitForPageLoad stepKey="waitForOption5"/> + <fillField stepKey="fillInAdminFieldBlack" selector="{{NewProduct.adminFieldBlack}}" userInput="{{NewProductsData.adminFieldBlack}}"/> + <fillField stepKey="fillInDefaultStoreViewFieldBlack" selector="{{NewProduct.defaultStoreViewFieldBlack}}" userInput="{{NewProductsData.defaultStoreViewFieldBlack}}"/> + + <!--Click Save Attribute button--> + <click selector="{{NewProduct.saveAttributeButton}}" stepKey="clickSaveAttributeButton"/> + <waitForPageLoad stepKey="waitForSavingSettings"/> + + <!--Select created Attribute --> + <click selector="{{ConfigurableProductSection.selectCreatedAttribute}}" stepKey="selectCreatedAttribute"/> + + <!--Click Next button--> + <click selector="{{ConfigurableProductSection.nextButton}}" stepKey="clickNextButton"/> + <waitForPageLoad stepKey="waitForNextPageLoaded"/> + + <!--Select all the options of all the attributes button--> + <click selector="{{CreateProductConfigurations.checkboxRed}}" stepKey="selectCheckboxRed"/> + <click selector="{{CreateProductConfigurations.checkboxBlue}}" stepKey="selectCheckboxBlue"/> + <click selector="{{CreateProductConfigurations.checkboxYellow}}" stepKey="selectCheckboxYellow"/> + <click selector="{{CreateProductConfigurations.checkboxGreen}}" stepKey="selectCheckboxGreen"/> + <click selector="{{CreateProductConfigurations.checkboxBlack}}" stepKey="selectCheckboxBlack"/> + + <!--Click Next button--> + <click selector="{{ConfigurableProductSection.nextButton}}" stepKey="clickNextButton2"/> + <waitForPageLoad stepKey="waitForBulkImagesPricePageLoaded"/> + + <!--Click Next button--> + <click selector="{{ConfigurableProductSection.nextButton}}" stepKey="clickNextButton3"/> + <waitForPageLoad stepKey="waitForSummaryPageLoaded"/> + + <!--Click Generate Configure button--> + <click selector="{{ConfigurableProductSection.generateConfigure}}" stepKey="generateConfigure"/> + <waitForPageLoad stepKey="waitForGenerateConfigure"/> + + <!-- This Error message shouldn't appear: Test will pass when bug will be fixed--> + <dontSee selector="{{CreateProductConfigurations.errorMessage}}" userInput="{{assertionData.errorMessage}}" stepKey="dontSeeError"/> + + <!--Close frame--> + <conditionalClick selector="{{ConfigurableProductSection.closeFrame}}" dependentSelector="{{ConfigurableProductSection.closeFrame}}" visible="1" stepKey="closeFrame"/> + <waitForPageLoad stepKey="waitForClosingFrame"/> + </actionGroup> + + <actionGroup name="DeleteCreatedAttribute"> + <annotations> + <description>Deletes the Configurable Product Attribute.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `DeleteCreatedAttributeActionGroup` instead --> + <click stepKey="clickOnStoresItem" selector="{{CatalogProductsSection.storesItem}}"/> + <waitForPageLoad stepKey="waitForNavigationPanel"/> + + <!--Click on Products item--> + <waitForElementVisible selector="{{CatalogProductsSection.storesProductItem}}" stepKey="waitForCatalogLoad"/> + <click stepKey="clickOnStoresProductItem" selector="{{CatalogProductsSection.storesProductItem}}"/> + <waitForPageLoad stepKey="waitForStoresProductPageLoad"/> + + <!--Click on created Attribute --> + <fillField stepKey="searchProductDefaultLabel" selector="{{CatalogProductsSection.searchDefaultLabelField}}" userInput="{{NewProductsData.defaultLabel}}"/> + <click stepKey="clickSearchButton" selector="{{CatalogProductsSection.searchButton}}"/> + <waitForPageLoad stepKey="waitForCreatedAttributeLoad"/> + <click stepKey="clickOnCreatedAttributeItem" selector="{{CatalogProductsSection.createdAttributeItem}}"/> + <waitForPageLoad stepKey="waitForAttributePropertiesPageLoad"/> + + <!--Click on Delete Attribute item--> + <click stepKey="clickOnDeleteAttributeItem" selector="{{CatalogProductsSection.deleteAttributeItem}}"/> + <waitForPageLoad stepKey="waitForDeletedDialogOpened"/> + + <!--Click on OK button--> + <click stepKey="clickOnOKButton" selector="{{CatalogProductsSection.okButton}}"/> + <waitForPageLoad stepKey="waitFordAttributeDeleted"/> + <see userInput="You deleted the product attribute." stepKey="seeDeletedTheProductAttributeMessage"/> + + <!-- Click Reset Filter button--> + <click stepKey="clickResetFilterButton" selector="{{CatalogProductsSection.resetFilter}}"/> + <waitForPageLoad stepKey="waitForAllFilterReset"/> + </actionGroup> + + <actionGroup name="StorefrontCheckCategoryConfigurableProduct"> + <annotations> + <description>Validates that the provided Configurable Product is present and correct on a Category page.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="optionProduct"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCheckCategoryConfigurableProductActionGroup` instead --> + <seeElement selector="{{StorefrontCategoryProductSection.ProductTitleByName(product.name)}}" stepKey="assertProductName"/> + <see userInput="${{optionProduct.price}}.00" selector="{{StorefrontCategoryProductSection.ProductPriceByName(product.name)}}" stepKey="AssertProductPrice"/> + <!-- @TODO: MAGETWO-80272 Move to Magento_Checkout --> + <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct"/> + <!-- @TODO: MAGETWO-80272 Move to Magento_Checkout --> + <seeElement selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="AssertAddToCart"/> + </actionGroup> + + <actionGroup name="StorefrontCheckCategoryOutOfStockConfigurableProduct"> + <annotations> + <description>Validates that the provided Configurable Product is present and correct on a Category page.</description> + </annotations> + <arguments> + <argument name="product" type="entity"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCheckCategoryOutOfStockConfigurableProductActionGroup` instead --> + <seeElement selector="{{StorefrontCategoryProductSection.ProductTitleByName(product.name)}}" stepKey="assertProductName"/> + <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct"/> + <seeElement selector="{{StorefrontCategoryProductSection.ProductStockUnavailable}}" stepKey="AssertOutOfStock"/> + <dontSeeElement selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="AssertAddToCart"/> + </actionGroup> + + <actionGroup name="StorefrontCheckConfigurableProduct"> + <annotations> + <description>Goes to the provided Storefront Product page. Validates that the Product details are present and correct.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="optionProduct"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCheckConfigurableProductActionGroup` instead --> + <seeInCurrentUrl url="/{{product.custom_attributes[url_key]}}.html" stepKey="checkUrl"/> + <seeInTitle userInput="{{product.name}}" stepKey="AssertProductNameInTitle"/> + <see userInput="{{product.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertProductName"/> + <see userInput="{{product.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="assertProductSku"/> + <see userInput="${{optionProduct.price}}.00" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="assertProductPrice"/> + <see userInput="IN STOCK" selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="assertInStock"/> + <seeElement selector="{{StorefrontProductInfoMainSection.AddToCart}}" stepKey="assertAddToCart"/> + <see userInput="{{product.custom_attributes[description]}}" selector="{{StorefrontProductInfoMainSection.productDescription}}" stepKey="assertProductDescription"/> + <see userInput="{{product.custom_attributes[short_description]}}" selector="{{StorefrontProductInfoMainSection.productShortDescription}}" stepKey="assertProductShortDescription"/> + </actionGroup> + + <actionGroup name="VerifyOptionInProductStorefront"> + <annotations> + <description>Validates that the provided Option Code and Option Name are present and correct on a Configurable Product page.</description> + </annotations> + <arguments> + <argument name="attributeCode" type="string"/> + <argument name="optionName" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `VerifyOptionInProductStorefrontActionGroup` instead --> + <seeElement selector="{{StorefrontProductInfoMainSection.attributeOptionByAttributeID(attributeCode, optionName)}}" stepKey="verifyOptionExists"/> + </actionGroup> + + <actionGroup name="SelectSingleAttributeAndAddToCart"> + <annotations> + <description>Selects a Product Option. Clicks 'Add to Cart'. Validates that the Product Added Success message appears.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + <argument name="attributeCode" type="string"/> + <argument name="optionName" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SelectSingleAttributeAndAddToCartActionGroup` instead --> + <selectOption selector="{{StorefrontProductInfoMainSection.attributeSelectByAttributeID(attributeCode)}}" userInput="{{optionName}}" stepKey="selectAttribute"/> + <click stepKey="addProduct" selector="{{StorefrontProductActionSection.addToCart}}"/> + <waitForElementVisible selector="{{StorefrontQuickSearchResultsSection.messageSection}}" time="30" stepKey="waitForProductAdded"/> + <see selector="{{StorefrontQuickSearchResultsSection.messageSection}}" userInput="You added {{productName}} to your shopping cart." stepKey="seeAddedToCartMessage"/> + </actionGroup> + + <actionGroup name="storefrontCheckConfigurableProductOptions"> + <annotations> + <description>Validates that the Options for a Configurable Product are present and correct.</description> + </annotations> + <arguments> + <argument name="product" type="entity"/> + <argument name="firstOption" type="entity"/> + <argument name="secondOption" type="entity"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCheckConfigurableProductOptionsActionGroup` instead --> + <selectOption userInput="{{firstOption.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption1"/> + <see userInput="{{product.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="seeConfigurableProductName"/> + <see userInput="{{firstOption.price}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="assertProductPricePresent"/> + <see userInput="{{product.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="seeConfigurableProductSku"/> + <see userInput="IN STOCK" selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="assertInStock"/> + <see userInput="{{colorProductAttribute.default_label}}" selector="{{StorefrontProductInfoMainSection.productAttributeTitle1}}" stepKey="seeColorAttributeName"/> + <dontSee userInput="As low as" selector="{{StorefrontProductInfoMainSection.productPriceLabel}}" stepKey="dontSeeProductPriceLabel1"/> + <selectOption userInput="{{secondOption.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption2"/> + <dontSee userInput="As low as" selector="{{StorefrontProductInfoMainSection.productPriceLabel}}" stepKey="dontSeeProductPriceLabel2"/> + <see userInput="{{secondOption.price}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="seeProductPrice2"/> + </actionGroup> + + <actionGroup name="assertOptionImageInStorefrontProductPage"> + <annotations> + <description>Validates that the provided Product Image is present when the provided Product Option is selected.</description> + </annotations> + <arguments> + <argument name="product" type="entity"/> + <argument name="label" type="string"/> + <argument name="image" defaultValue="MagentoLogo"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertOptionImageInStorefrontProductPageActionGroup` instead --> + <seeInCurrentUrl url="/{{product.urlKey}}.html" stepKey="checkUrl"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <selectOption userInput="{{label}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption1"/> + <seeElement selector="{{StorefrontProductMediaSection.imageFile(image.filename)}}" stepKey="seeFirstImage"/> + </actionGroup> + + <actionGroup name="assertConfigurableProductWithSpecialPriceOnStorefrontProductPage"> + <annotations> + <description>Validates that Special Price for a Configurable Product is present and correct when the provided Product Option is selected.</description> + </annotations> + <arguments> + <argument name="option" type="string"/> + <argument name="price" type="string"/> + <argument name="specialPrice" defaultValue="specialProductPrice"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertConfigurableProductWithSpecialPriceOnStorefrontProductPageActionGroup` instead --> + <selectOption userInput="{{option}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOptionWithSpecialPrice"/> + <see userInput="{{specialProductPrice.price}}" selector="{{StorefrontProductInfoMainSection.productSpecialPrice}}" stepKey="seeSpecialProductPrice"/> + <see userInput="Regular Price" selector="{{StorefrontProductInfoMainSection.specialProductText}}" stepKey="seeText"/> + <see userInput="{{price}}" selector="{{StorefrontProductInfoMainSection.oldProductPrice}}" stepKey="seeOldProductPrice"/> + </actionGroup> +</actionGroups> From 0efac967654583795f5a068e6d18188d87491f56 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <p.bystritsky@yandex.ru> Date: Thu, 5 Dec 2019 13:21:10 +0200 Subject: [PATCH 188/586] MFTF test update. --- .../ActionGroup/StorefrontCompareActionGroup.xml | 16 +++++++++++++++- ...uctAttributeWithoutValueInCompareListTest.xml | 14 ++++++-------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCompareActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCompareActionGroup.xml index 706de58a87840..3228d8926e890 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCompareActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCompareActionGroup.xml @@ -31,7 +31,6 @@ <arguments> <argument name="productVar"/> </arguments> - <waitForElementVisible selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="seeAddToCompareLink"/> <click selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="clickAddToCompare"/> @@ -94,4 +93,19 @@ <waitForElement selector="{{StorefrontMessagesSection.message('You cleared the comparison list.')}}" time="30" stepKey="AssertMessageCleared"/> <waitForElement selector="{{StorefrontComparisonSidebarSection.NoItemsMessage}}" time="30" stepKey="assertNoItems"/> </actionGroup> + + <!-- Check Product is present in the comparison list --> + <actionGroup name="SeeProductInComparisonListActionGroup"> + <annotations> + <description>Validate that the Product is present in the comparison list</description> + </annotations> + <arguments> + <argument name="productVar"/> + </arguments> + + <amOnPage url="{{StorefrontProductComparePage.url}}" stepKey="navigateToComparePage"/> + <waitForPageLoad stepKey="waitForStorefrontProductComparePageLoad"/> + <seeElement selector="{{StorefrontProductCompareMainSection.ProductLinkByName(productVar.name)}}" + stepKey="seeProductInCompareList"/> + </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/ProductAttributeWithoutValueInCompareListTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/ProductAttributeWithoutValueInCompareListTest.xml index f926a2aa2f4ad..f32ce60706423 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/ProductAttributeWithoutValueInCompareListTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/ProductAttributeWithoutValueInCompareListTest.xml @@ -53,10 +53,9 @@ <argument name="productVar" value="$$createProductDefault$$"/> </actionGroup> <!--See product in the comparison list--> - <amOnPage url="{{StorefrontProductComparePage.url}}" stepKey="navigateToComparePage"/> - <waitForPageLoad stepKey="waitForStorefrontProductComparePageLoad"/> - <seeElement selector="{{StorefrontProductCompareMainSection.ProductLinkByName($createProductDefault.name$)}}" - stepKey="seeProductInCompareList"/> + <actionGroup ref="SeeProductInComparisonListActionGroup" stepKey="seeProductDefaultInComparisonListActionGroup"> + <argument name="productVar" value="$$createProductDefault$$"/> + </actionGroup> <!--Open product with custom attribute page--> <amOnPage url="{{StorefrontProductPage.url($$createProductCustom.name$$)}}" stepKey="goToProductCustomPage"/> <waitForPageLoad stepKey="waitForProductCustomPage"/> @@ -65,10 +64,9 @@ <argument name="productVar" value="$$createProductCustom$$"/> </actionGroup> <!--See product with custom attribute in the comparison list--> - <amOnPage url="{{StorefrontProductComparePage.url}}" stepKey="navigateToComparePageCustom"/> - <waitForPageLoad stepKey="waitForStorefrontProductCustomComparePageLoad"/> - <seeElement selector="{{StorefrontProductCompareMainSection.ProductLinkByName($createProductCustom.name$)}}" - stepKey="seeProductCustomInCompareList"/> + <actionGroup ref="SeeProductInComparisonListActionGroup" stepKey="seeProductCustomInComparisonListActionGroup"> + <argument name="productVar" value="$$createProductCustom$$"/> + </actionGroup> <!--See attribute default value in the comparison list--> <see userInput="$createProductAttribute.defaultValue$" selector="{{StorefrontProductCompareMainSection.ProductAttributeByCodeAndProductName(ProductAttributeFrontendLabel.label, $createProductCustom.name$)}}" From 954f124017b54beedf87327bec8bde6a1810a76b Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <p.bystritsky@yandex.ru> Date: Thu, 5 Dec 2019 14:49:59 +0200 Subject: [PATCH 189/586] Test for magento/magento2#25051. --- .../StorefrontProductInfoMainSection.xml | 1 + ...avascriptErrorOnAddYourReviewClickTest.xml | 50 +++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 app/code/Magento/Review/Test/Mftf/Test/StorefrontNoJavascriptErrorOnAddYourReviewClickTest.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductInfoMainSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductInfoMainSection.xml index fd412d3c7dee1..631649e33b0fd 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductInfoMainSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductInfoMainSection.xml @@ -34,6 +34,7 @@ <element name="specialPriceValue" type="text" selector="//span[@class='special-price']//span[@class='price']"/> <element name="mapPrice" type="text" selector="//div[@class='price-box price-final_price']//span[contains(@class, 'price-msrp_price')]"/> <element name="clickForPriceLink" type="text" selector="//div[@class='price-box price-final_price']//a[contains(text(), 'Click for price')]"/> + <element name="addReviewLink" type="text" selector="//div[@class='reviews-actions']//a[@class='action add']"/> <!-- The parameter is the nth custom option that you want to get --> <element name="nthCustomOption" type="block" selector="//*[@id='product-options-wrapper']/*[@class='fieldset']/*[contains(@class, 'field')][{{customOptionNum}}]" parameterized="true" /> diff --git a/app/code/Magento/Review/Test/Mftf/Test/StorefrontNoJavascriptErrorOnAddYourReviewClickTest.xml b/app/code/Magento/Review/Test/Mftf/Test/StorefrontNoJavascriptErrorOnAddYourReviewClickTest.xml new file mode 100644 index 0000000000000..667e352cde837 --- /dev/null +++ b/app/code/Magento/Review/Test/Mftf/Test/StorefrontNoJavascriptErrorOnAddYourReviewClickTest.xml @@ -0,0 +1,50 @@ +<?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="StorefrontNoJavascriptErrorOnAddYourReviewClickTest"> + <annotations> + <features value="Review"/> + <title value="Storefront no javascript error on 'Add Your Review' click test"/> + <description value="Verify no javascript error occurs when customer clicks 'Add Your Review' link"/> + <severity value="MAJOR"/> + <group value="review"/> + </annotations> + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <createData entity="textProductAttribute" stepKey="createProductAttribute"/> + <createData entity="CatalogAttributeSet" stepKey="createAttributeSet"/> + <amOnPage url="{{AdminProductAttributeSetEditPage.url}}/$$createAttributeSet.attribute_set_id$$/" + stepKey="onAttributeSetEdit"/> + <actionGroup ref="AssignAttributeToGroup" stepKey="assignAttributeToGroup"> + <argument name="group" value="Product Details"/> + <argument name="attribute" value="$$createProductAttribute.attribute_code$$"/> + </actionGroup> + <actionGroup ref="SaveAttributeSet" stepKey="SaveAttributeSet"/> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="SimpleProductWithCustomAttributeSet" stepKey="createProduct"> + <requiredEntity createDataKey="createCategory"/> + <requiredEntity createDataKey="createAttributeSet"/> + </createData> + </before> + <after> + <deleteData createDataKey="createProduct" stepKey="deleteProductCustom"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createAttributeSet" stepKey="deleteAttributeSet"/> + <deleteData createDataKey="createProductAttribute" stepKey="deleteProductAttribute"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <amOnPage url="{{StorefrontProductPage.url($$createProduct.name$$)}}" stepKey="goToProductPage"/> + <dontSeeElement selector="{{StorefrontProductInfoDetailsSection.productNameForReview}}" stepKey="dontSeeReviewTab"/> + <click selector="{{StorefrontProductInfoMainSection.addReviewLink}}" stepKey="clickAddReview"/> + <dontSeeJsError stepKey="dontSeeJsError"/> + <seeElement selector="{{StorefrontProductInfoDetailsSection.productNameForReview}}" stepKey="seeReviewTab"/> + </test> +</tests> From 55585c872996da60661fc196da8363350d27a5b5 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <p.bystritsky@yandex.ru> Date: Thu, 5 Dec 2019 16:29:13 +0200 Subject: [PATCH 190/586] Test for magento/magento2#24907. --- ...CategoryAccessibleWhenSuffixIsNullTest.xml | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/StorefrontCategoryAccessibleWhenSuffixIsNullTest.xml diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/StorefrontCategoryAccessibleWhenSuffixIsNullTest.xml b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/StorefrontCategoryAccessibleWhenSuffixIsNullTest.xml new file mode 100644 index 0000000000000..ef8f2b6b1a3e2 --- /dev/null +++ b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/StorefrontCategoryAccessibleWhenSuffixIsNullTest.xml @@ -0,0 +1,38 @@ +<?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="StorefrontCategoryAccessibleWhenSuffixIsNullTest"> + <annotations> + <title value="Storefront category is accessible when url suffix is set to null test"/> + <description value="Check no crash occurs on Category page when catalog/seo/category_url_suffix is set to null"/> + <features value="CatalogUrlRewrite"/> + <severity value="MAJOR"/> + <group value="CatalogUrlRewrite"/> + </annotations> + <before> + <magentoCLI command="config:set catalog/seo/category_url_suffix ''" stepKey="setCategoryUrlSuffix"/> + <magentoCLI command="config:set catalog/seo/generate_category_product_rewrites 0" + stepKey="setCategoryProductRewrites"/> + <magentoCLI command="cache:flush" stepKey="flushCacheBefore"/> + <createData entity="_defaultCategory" stepKey="createCategory"/> + </before> + <after> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <magentoCLI command="config:set catalog/seo/category_url_suffix '.html'" + stepKey="restoreCategoryUrlSuffix"/> + <magentoCLI command="config:set catalog/seo/generate_category_product_rewrites 1" + stepKey="restoreCategoryProductRewrites"/> + <magentoCLI command="cache:flush" stepKey="flushCacheAfter"/> + </after> + + <amOnPage url="/$$createCategory.name$$" stepKey="onCategoryPage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <seeInTitle userInput="$$createCategory.name$$" stepKey="assertCategoryNameInTitle"/> + </test> +</tests> From d67374f1b888dfd9b40da3c89dd191075e0ea618 Mon Sep 17 00:00:00 2001 From: Sathish <srsathish92@gmail.com> Date: Thu, 5 Dec 2019 21:24:48 +0530 Subject: [PATCH 191/586] Code refactor in Catalog Viewmodel breadcrumbs --- .../Catalog/ViewModel/Product/Breadcrumbs.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php b/app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php index d1424d637937b..330d1e0d3fbdf 100644 --- a/app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php +++ b/app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php @@ -10,7 +10,7 @@ use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\App\ObjectManager; use Magento\Framework\DataObject; -use Magento\Framework\Serialize\Serializer\Json; +use Magento\Framework\Serialize\Serializer\JsonHexTag; use Magento\Framework\View\Element\Block\ArgumentInterface; use Magento\Framework\Escaper; @@ -31,6 +31,11 @@ class Breadcrumbs extends DataObject implements ArgumentInterface */ private $scopeConfig; + /** + * @var JsonHexTag + */ + private $jsonSerializer; + /** * @var Escaper */ @@ -39,20 +44,21 @@ class Breadcrumbs extends DataObject implements ArgumentInterface /** * @param Data $catalogData * @param ScopeConfigInterface $scopeConfig - * @param Json|null $json + * @param JsonHexTag $jsonSerializer * @param Escaper|null $escaper * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function __construct( Data $catalogData, ScopeConfigInterface $scopeConfig, - Json $json = null, + JsonHexTag $jsonSerializer, Escaper $escaper = null ) { parent::__construct(); $this->catalogData = $catalogData; $this->scopeConfig = $scopeConfig; + $this->jsonSerializer = $jsonSerializer; $this->escaper = $escaper ?: ObjectManager::getInstance()->get(Escaper::class); } @@ -101,15 +107,14 @@ public function getProductName(): string */ public function getJsonConfigurationHtmlEscaped() : string { - return json_encode( + return $this->jsonSerializer->serialize( [ 'breadcrumbs' => [ 'categoryUrlSuffix' => $this->escaper->escapeHtml($this->getCategoryUrlSuffix()), 'useCategoryPathInUrl' => (int)$this->isCategoryUsedInProductUrl(), 'product' => $this->escaper->escapeHtml($this->getProductName()) ] - ], - JSON_HEX_TAG + ] ); } From 1e5a9db638e79f527e9c1865dc380d35d30f30b2 Mon Sep 17 00:00:00 2001 From: Sathish <srsathish92@gmail.com> Date: Thu, 5 Dec 2019 21:34:40 +0530 Subject: [PATCH 192/586] Updated unit test with JsonHexTag --- .../Catalog/Test/Unit/ViewModel/Product/BreadcrumbsTest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/BreadcrumbsTest.php b/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/BreadcrumbsTest.php index a4ccaffc8fb6a..38b5f35634ad7 100644 --- a/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/BreadcrumbsTest.php +++ b/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/BreadcrumbsTest.php @@ -54,12 +54,14 @@ protected function setUp() : void ->getMockForAbstractClass(); $escaper = $this->getObjectManager()->getObject(\Magento\Framework\Escaper::class); + $this->serializer = $this->createMock(\Magento\Framework\Serialize\Serializer\JsonHexTag::class); $this->viewModel = $this->getObjectManager()->getObject( Breadcrumbs::class, [ 'catalogData' => $this->catalogHelper, 'scopeConfig' => $this->scopeConfig, + 'jsonSerializer' => $this->serializer, 'escaper' => $escaper ] ); @@ -141,6 +143,8 @@ public function testGetJsonConfiguration($product, string $expectedJson) : void ->with('catalog/seo/category_url_suffix', \Magento\Store\Model\ScopeInterface::SCOPE_STORE) ->willReturn('."html'); + $this->serializer->expects($this->once())->method('serialize')->willReturn($expectedJson); + $this->assertEquals($expectedJson, $this->viewModel->getJsonConfiguration()); } From 37a9929ad036fd8e8309111d87f8ce7f1e0e35cc Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Fri, 6 Dec 2019 08:19:27 +0700 Subject: [PATCH 193/586] Resolve A "500 (Internal Server Error)" appears in Developer Console if Delete the image that is added to Page Content issue25893 --- .../Adminhtml/Wysiwyg/Directive.php | 17 ++++++++--- .../Adminhtml/Wysiwyg/DirectiveTest.php | 29 +++++++++++++++++++ 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Directive.php b/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Directive.php index b21ea9fd7ef7b..db53c6a415ddd 100644 --- a/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Directive.php +++ b/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Directive.php @@ -4,6 +4,9 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + +declare(strict_types=1); + namespace Magento\Cms\Controller\Adminhtml\Wysiwyg; use Magento\Backend\App\Action; @@ -13,6 +16,8 @@ /** * Process template text for wysiwyg editor. + * + * Class Directive */ class Directive extends Action implements HttpGetActionInterface { @@ -73,10 +78,14 @@ public function execute() /** @var Config $config */ $config = $this->_objectManager->get(Config::class); $imagePath = $config->getSkinImagePlaceholderPath(); - $image->open($imagePath); - $resultRaw->setHeader('Content-Type', $image->getMimeType()); - $resultRaw->setContents($image->getImage()); - $this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e); + try { + $image->open($imagePath); + $resultRaw->setHeader('Content-Type', $image->getMimeType()); + $resultRaw->setContents($image->getImage()); + $this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e); + } catch (\Exception $e) { + $this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e); + } } return $resultRaw; } diff --git a/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Wysiwyg/DirectiveTest.php b/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Wysiwyg/DirectiveTest.php index 16b218ebf6493..85c48e3fa3b7d 100644 --- a/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Wysiwyg/DirectiveTest.php +++ b/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Wysiwyg/DirectiveTest.php @@ -274,4 +274,33 @@ protected function prepareExecuteTest() ->method('create') ->willReturn($this->imageAdapterMock); } + + /** + * Test Execute With Deleted Image + * + * @covers \Magento\Cms\Controller\Adminhtml\Wysiwyg\Directive::execute + */ + public function testExecuteWithDeletedImage() + { + $exception = new \Exception('epic fail'); + $placeholderPath = 'pub/static/adminhtml/Magento/backend/en_US/Magento_Cms/images/wysiwyg_skin_image.png'; + $this->prepareExecuteTest(); + + $this->imageAdapterMock->expects($this->at(0)) + ->method('open') + ->with(self::IMAGE_PATH) + ->willThrowException($exception); + $this->wysiwygConfigMock->expects($this->once()) + ->method('getSkinImagePlaceholderPath') + ->willReturn($placeholderPath); + $this->imageAdapterMock->expects($this->at(1)) + ->method('open') + ->willThrowException($exception); + + $this->loggerMock->expects($this->once()) + ->method('critical') + ->with($exception); + + $this->wysiwygDirective->execute(); + } } From 66bf8d18bf6d5f88ffd5dc674106c52a8fd066a2 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Fri, 6 Dec 2019 08:21:24 +0700 Subject: [PATCH 194/586] Unit Test for Directive --- .../Unit/Controller/Adminhtml/Wysiwyg/DirectiveTest.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Wysiwyg/DirectiveTest.php b/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Wysiwyg/DirectiveTest.php index 85c48e3fa3b7d..cede3a80cb98b 100644 --- a/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Wysiwyg/DirectiveTest.php +++ b/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Wysiwyg/DirectiveTest.php @@ -286,15 +286,18 @@ public function testExecuteWithDeletedImage() $placeholderPath = 'pub/static/adminhtml/Magento/backend/en_US/Magento_Cms/images/wysiwyg_skin_image.png'; $this->prepareExecuteTest(); - $this->imageAdapterMock->expects($this->at(0)) + $this->imageAdapterMock->expects($this->any()) ->method('open') ->with(self::IMAGE_PATH) ->willThrowException($exception); + $this->wysiwygConfigMock->expects($this->once()) ->method('getSkinImagePlaceholderPath') ->willReturn($placeholderPath); - $this->imageAdapterMock->expects($this->at(1)) + + $this->imageAdapterMock->expects($this->any()) ->method('open') + ->with($placeholderPath) ->willThrowException($exception); $this->loggerMock->expects($this->once()) From 35493855269d06d80ed2e13b62c50c62069711f7 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <p.bystritsky@yandex.ru> Date: Fri, 6 Dec 2019 09:54:09 +0200 Subject: [PATCH 195/586] Static test fix. --- .../Catalog/Model/ResourceModel/Product/CollectionTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/CollectionTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/CollectionTest.php index e8d472fb98c6f..2100920ab8ac9 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/CollectionTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/CollectionTest.php @@ -14,7 +14,7 @@ use Magento\TestFramework\Helper\Bootstrap; /** - * Collection test + * Test for Magento\Catalog\Model\ResourceModel\Product\Collection * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ From f9a510a10ed9cf8a3c8a1f0f4ffd374b59333f82 Mon Sep 17 00:00:00 2001 From: Serhiy Yelahin <serhiy.yelahin@transoftgroup.com> Date: Fri, 6 Dec 2019 15:04:15 +0200 Subject: [PATCH 196/586] MC-23900: Authorize Net issue on the admin order creation page --- .../Magento/Sales/view/adminhtml/web/order/create/scripts.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js b/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js index 4e07414510748..8803e2ea48f02 100644 --- a/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js +++ b/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js @@ -482,11 +482,6 @@ define([ }, switchPaymentMethod: function(method){ - jQuery('#edit_form') - .off('submitOrder') - .on('submitOrder', function(){ - jQuery(this).trigger('realOrder'); - }); jQuery('#edit_form').trigger('changePaymentMethod', [method]); this.setPaymentMethod(method); var data = {}; From fbea751258747182da71d1175e466405c80b01ab Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <p.bystritsky@yandex.ru> Date: Mon, 2 Dec 2019 12:49:27 +0200 Subject: [PATCH 197/586] magento/magento2#22856: Integration tests fix. --- .../Product/Option/DataProvider/Type/File.php | 120 +++++++++++------- 1 file changed, 73 insertions(+), 47 deletions(-) diff --git a/dev/tests/integration/framework/Magento/TestFramework/Catalog/Model/Product/Option/DataProvider/Type/File.php b/dev/tests/integration/framework/Magento/TestFramework/Catalog/Model/Product/Option/DataProvider/Type/File.php index 35f449a404410..d2aa20a005ec4 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Catalog/Model/Product/Option/DataProvider/Type/File.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Catalog/Model/Product/Option/DataProvider/Type/File.php @@ -8,7 +8,7 @@ namespace Magento\TestFramework\Catalog\Model\Product\Option\DataProvider\Type; use Magento\Catalog\Api\Data\ProductCustomOptionInterface; -use Magento\TestFramework\Catalog\Model\Product\Option\DataProvider\Type\AbstractBase; +use Magento\Catalog\Model\Product\Option; /** * Data provider for options from file group with type "file". @@ -20,41 +20,44 @@ class File extends AbstractBase */ public function getDataForCreateOptions(): array { - return array_merge_recursive( - parent::getDataForCreateOptions(), - [ - "type_{$this->getType()}_option_file_extension" => [ - [ - 'record_id' => 0, - 'sort_order' => 1, - 'is_require' => 1, - 'sku' => 'test-option-title-1', - 'max_characters' => 30, - 'title' => 'Test option title 1', - 'type' => $this->getType(), - 'price' => 10, - 'price_type' => 'fixed', - 'file_extension' => 'gif', - 'image_size_x' => 10, - 'image_size_y' => 20, + return $this->injectFileExtension( + array_merge_recursive( + parent::getDataForCreateOptions(), + [ + "type_{$this->getType()}_option_file_extension" => [ + [ + 'record_id' => 0, + 'sort_order' => 1, + 'is_require' => 1, + 'sku' => 'test-option-title-1', + 'max_characters' => 30, + 'title' => 'Test option title 1', + 'type' => $this->getType(), + 'price' => 10, + 'price_type' => 'fixed', + 'file_extension' => 'gif', + 'image_size_x' => 10, + 'image_size_y' => 20, + ], ], - ], - "type_{$this->getType()}_option_maximum_file_size" => [ - [ - 'record_id' => 0, - 'sort_order' => 1, - 'is_require' => 1, - 'sku' => 'test-option-title-1', - 'title' => 'Test option title 1', - 'type' => $this->getType(), - 'price' => 10, - 'price_type' => 'fixed', - 'file_extension' => 'gif', - 'image_size_x' => 10, - 'image_size_y' => 20, + "type_{$this->getType()}_option_maximum_file_size" => [ + [ + 'record_id' => 0, + 'sort_order' => 1, + 'is_require' => 1, + 'sku' => 'test-option-title-1', + 'title' => 'Test option title 1', + 'type' => $this->getType(), + 'price' => 10, + 'price_type' => 'fixed', + 'file_extension' => 'gif', + 'image_size_x' => 10, + 'image_size_y' => 20, + ], ], - ], - ] + ] + ), + 'png' ); } @@ -63,21 +66,24 @@ public function getDataForCreateOptions(): array */ public function getDataForUpdateOptions(): array { - return array_merge_recursive( - parent::getDataForUpdateOptions(), - [ - "type_{$this->getType()}_option_file_extension" => [ - [ - 'file_extension' => 'jpg', + return $this->injectFileExtension( + array_merge_recursive( + parent::getDataForUpdateOptions(), + [ + "type_{$this->getType()}_option_file_extension" => [ + [ + 'file_extension' => 'jpg', + ], ], - ], - "type_{$this->getType()}_option_maximum_file_size" => [ - [ - 'image_size_x' => 300, - 'image_size_y' => 815, + "type_{$this->getType()}_option_maximum_file_size" => [ + [ + 'image_size_x' => 300, + 'image_size_y' => 815, + ], ], - ], - ] + ] + ), + '' ); } @@ -88,4 +94,24 @@ protected function getType(): string { return ProductCustomOptionInterface::OPTION_TYPE_FILE; } + + /** + * Add 'file_extension' value to each option. + * + * @param array $data + * @param string $extension + * @return array + */ + private function injectFileExtension(array $data, string $extension): array + { + foreach ($data as &$caseData) { + foreach ($caseData as &$option) { + if (!isset($option[Option::KEY_FILE_EXTENSION])) { + $option[Option::KEY_FILE_EXTENSION] = $extension; + } + } + } + + return $data; + } } From dc8821dc2e297c1b73064ea49c1c4e7253b7e84f Mon Sep 17 00:00:00 2001 From: sdovbenko <sdovbenko@magecom.us> Date: Fri, 6 Dec 2019 19:44:52 +0200 Subject: [PATCH 198/586] Add OperationStatusPool and OperationStatusValidator --- .../Model/Operation.php | 21 +++++++++ .../Model/OperationStatusPool.php | 37 +++++++++++++++ .../Model/OperationStatusValidator.php | 47 +++++++++++++++++++ .../Magento/AsynchronousOperations/etc/di.xml | 11 +++++ 4 files changed, 116 insertions(+) create mode 100644 app/code/Magento/AsynchronousOperations/Model/OperationStatusPool.php create mode 100644 app/code/Magento/AsynchronousOperations/Model/OperationStatusValidator.php diff --git a/app/code/Magento/AsynchronousOperations/Model/Operation.php b/app/code/Magento/AsynchronousOperations/Model/Operation.php index dbe6ecc1b6b1f..9e0039d2ee151 100644 --- a/app/code/Magento/AsynchronousOperations/Model/Operation.php +++ b/app/code/Magento/AsynchronousOperations/Model/Operation.php @@ -6,6 +6,7 @@ namespace Magento\AsynchronousOperations\Model; use Magento\AsynchronousOperations\Api\Data\OperationInterface; +use Magento\AsynchronousOperations\Model\OperationStatusValidator; use Magento\Framework\DataObject; /** @@ -13,6 +14,25 @@ */ class Operation extends DataObject implements OperationInterface { + /** + * @var OperationStatusValidator + */ + protected $operationStatusValidator; + + /** + * Operation constructor. + * + * @param array $data + * @param OperationStatusValidator $operationStatusValidator + */ + public function __construct( + array $data = [], + OperationStatusValidator $operationStatusValidator + ) { + $this->operationStatusValidator = $operationStatusValidator; + parent::__construct($data); + } + /** * @inheritDoc */ @@ -106,6 +126,7 @@ public function getStatus() */ public function setStatus($status) { + $this->operationStatusValidator->validate($status); return $this->setData(self::STATUS, $status); } diff --git a/app/code/Magento/AsynchronousOperations/Model/OperationStatusPool.php b/app/code/Magento/AsynchronousOperations/Model/OperationStatusPool.php new file mode 100644 index 0000000000000..73eeedbdb7a20 --- /dev/null +++ b/app/code/Magento/AsynchronousOperations/Model/OperationStatusPool.php @@ -0,0 +1,37 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\AsynchronousOperations\Model; + +/** + * Class OperationStatusPool + * + * Pool of statuses that require validate + */ +class OperationStatusPool +{ + /** + * @var array + */ + protected $statuses; + + /** + * @param array $statuses + */ + public function __construct(array $statuses = []) + { + $this->statuses = $statuses; + } + + /** + * Retrieve statuses that require validate + * + * @return array + */ + public function getStatuses() + { + return $this->statuses; + } +} diff --git a/app/code/Magento/AsynchronousOperations/Model/OperationStatusValidator.php b/app/code/Magento/AsynchronousOperations/Model/OperationStatusValidator.php new file mode 100644 index 0000000000000..3da94f1c4d7fb --- /dev/null +++ b/app/code/Magento/AsynchronousOperations/Model/OperationStatusValidator.php @@ -0,0 +1,47 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\AsynchronousOperations\Model; + +use Magento\AsynchronousOperations\Model\OperationStatusPool; +use Magento\Framework\Exception\NoSuchEntityException; +use Doctrine\Instantiator\Exception\InvalidArgumentException; + +/** + * Class OperationStatusValidator to validate operation status + */ +class OperationStatusValidator +{ + /** + * @var OperationStatusPool + */ + protected $operationStatusPool; + + /** + * OperationStatusValidator constructor. + * + * @param OperationStatusPool $operationStatusPool + */ + public function __construct(OperationStatusPool $operationStatusPool) + { + $this->operationStatusPool = $operationStatusPool; + } + + /** + * Validate method + * + * @param $status + */ + public function validate($status) + { + $statuses = $this->operationStatusPool->getStatuses(); + + if (!in_array($status, $statuses)) { + throw new \InvalidArgumentException('Invalid Operation Status.'); + } + + return; + } +} diff --git a/app/code/Magento/AsynchronousOperations/etc/di.xml b/app/code/Magento/AsynchronousOperations/etc/di.xml index 94a4c56c19cea..171a01cedf289 100644 --- a/app/code/Magento/AsynchronousOperations/etc/di.xml +++ b/app/code/Magento/AsynchronousOperations/etc/di.xml @@ -80,6 +80,17 @@ </argument> </arguments> </type> + <type name="Magento\AsynchronousOperations\Model\OperationStatusPool"> + <arguments> + <argument name="statuses" xsi:type="array"> + <item name="complete" xsi:type="string">1</item> + <item name="retriablyFailed" xsi:type="string">2</item> + <item name="notRetriablyFailed" xsi:type="string">3</item> + <item name="open" xsi:type="string">4</item> + <item name="rejected" xsi:type="string">5</item> + </argument> + </arguments> + </type> <virtualType name="Magento\AsynchronousOperations\Ui\Component\DataProvider" type="Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider"/> From f305a84472fc0222147844ffa83542c01cd1c023 Mon Sep 17 00:00:00 2001 From: sdovbenko <sdovbenko@magecom.us> Date: Fri, 6 Dec 2019 20:12:55 +0200 Subject: [PATCH 199/586] Changed protected to private modifier --- app/code/Magento/AsynchronousOperations/Model/Operation.php | 2 +- .../AsynchronousOperations/Model/OperationStatusPool.php | 2 +- .../AsynchronousOperations/Model/OperationStatusValidator.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/AsynchronousOperations/Model/Operation.php b/app/code/Magento/AsynchronousOperations/Model/Operation.php index 9e0039d2ee151..de2b56d0a0dd7 100644 --- a/app/code/Magento/AsynchronousOperations/Model/Operation.php +++ b/app/code/Magento/AsynchronousOperations/Model/Operation.php @@ -17,7 +17,7 @@ class Operation extends DataObject implements OperationInterface /** * @var OperationStatusValidator */ - protected $operationStatusValidator; + private $operationStatusValidator; /** * Operation constructor. diff --git a/app/code/Magento/AsynchronousOperations/Model/OperationStatusPool.php b/app/code/Magento/AsynchronousOperations/Model/OperationStatusPool.php index 73eeedbdb7a20..890eb8c1c8c75 100644 --- a/app/code/Magento/AsynchronousOperations/Model/OperationStatusPool.php +++ b/app/code/Magento/AsynchronousOperations/Model/OperationStatusPool.php @@ -15,7 +15,7 @@ class OperationStatusPool /** * @var array */ - protected $statuses; + private $statuses; /** * @param array $statuses diff --git a/app/code/Magento/AsynchronousOperations/Model/OperationStatusValidator.php b/app/code/Magento/AsynchronousOperations/Model/OperationStatusValidator.php index 3da94f1c4d7fb..ae154edfb50f7 100644 --- a/app/code/Magento/AsynchronousOperations/Model/OperationStatusValidator.php +++ b/app/code/Magento/AsynchronousOperations/Model/OperationStatusValidator.php @@ -17,7 +17,7 @@ class OperationStatusValidator /** * @var OperationStatusPool */ - protected $operationStatusPool; + private $operationStatusPool; /** * OperationStatusValidator constructor. From 345ece3f5277c1add6a1fd31cf8c830b3615c96f Mon Sep 17 00:00:00 2001 From: sdovbenko <sdovbenko@magecom.us> Date: Fri, 6 Dec 2019 20:13:59 +0200 Subject: [PATCH 200/586] Added OperationStatusValidatorTest class to Unit --- .../Model/OperationStatusValidatorTest.php | 155 ++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 app/code/Magento/AsynchronousOperations/Test/Unit/Model/OperationStatusValidatorTest.php diff --git a/app/code/Magento/AsynchronousOperations/Test/Unit/Model/OperationStatusValidatorTest.php b/app/code/Magento/AsynchronousOperations/Test/Unit/Model/OperationStatusValidatorTest.php new file mode 100644 index 0000000000000..2209564d03aee --- /dev/null +++ b/app/code/Magento/AsynchronousOperations/Test/Unit/Model/OperationStatusValidatorTest.php @@ -0,0 +1,155 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\AsynchronousOperations\Test\Unit\Model; + +use Magento\AsynchronousOperations\Model\OperationStatusValidator; +use Magento\AsynchronousOperations\Model\Operation; +use Magento\AsynchronousOperations\Model\OperationStatusPool; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use PHPUnit\Framework\TestCase; + +/** + * Class OperationStatusValidatorTest + */ +class OperationStatusValidatorTest extends TestCase +{ + /** + * @var OperationStatusPool + */ + private $operationStatusPool; + + /** + * @var OperationStatusValidator + */ + private $operationStatusValidator; + + /** + * @var Operation + */ + private $operation; + + protected function setUp() + { + $this->operationStatusPool = $this->getMockBuilder(OperationStatusPool::class) + ->disableOriginalConstructor() + ->getMock(); + + $objectManager = new ObjectManager($this); + + $this->operationStatusValidator = $objectManager->getObject( + OperationStatusValidator::class, + [ + 'operationStatusPool' => $this->operationStatusPool + ] + ); + + $this->operation = $objectManager->getObject( + Operation::class, + [ + 'operationStatusValidator' => $this->operationStatusValidator + ] + ); + } + + /** + * @param string $status + * @param array $statusPool + * @param string $expectedResult + * @dataProvider dataProviderForTestSetStatus + */ + public function testSetStatus ( + string $status, + array $statusPool, + string $expectedResult + ) { + $this->operationStatusPool + ->expects($this->any()) + ->method('getStatuses') + ->willReturn($statusPool); + + try { + $this->operation->setStatus($status); + $this->assertEquals($expectedResult, $this->operation->getStatus()); + } catch (\Exception $exception) { + $this->assertEquals($expectedResult, $exception->getMessage()); + } + } + + /** + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + */ + public function dataProviderForTestSetStatus() + { + return [ + [ + 'status' => 0, + 'statusPool' => [ + 'complete' => 1, + 'retriablyFailed' => 2, + 'notRetriablyFailed' => 3, + 'open' => 4, + 'rejected' => 5 + ], + 'expectedResult' => 'Invalid Operation Status.' + ], + [ + 'status' => 1, + 'statusPool' => [ + 'complete' => 1, + 'retriablyFailed' => 2, + 'notRetriablyFailed' => 3, + 'open' => 4, + 'rejected' => 5 + ], + 'expectedResult' => 1 + ], + [ + 'status' => 2, + 'statusPool' => [ + 'complete' => 1, + 'retriablyFailed' => 2, + 'notRetriablyFailed' => 3, + 'open' => 4, + 'rejected' => 5 + ], + 'expectedResult' => 2 + ], + [ + 'status' => 3, + 'statusPool' => [ + 'complete' => 1, + 'retriablyFailed' => 2, + 'notRetriablyFailed' => 3, + 'open' => 4, + 'rejected' => 5 + ], + 'expectedResult' => 3 + ], + [ + 'status' => 4, + 'statusPool' => [ + 'complete' => 1, + 'retriablyFailed' => 2, + 'notRetriablyFailed' => 3, + 'open' => 4, + 'rejected' => 5 + ], + 'expectedResult' => 4 + ], + [ + 'status' => 5, + 'statusPool' => [ + 'complete' => 1, + 'retriablyFailed' => 2, + 'notRetriablyFailed' => 3, + 'open' => 4, + 'rejected' => 5 + ], + 'expectedResult' => 5 + ] + ]; + } +} From b1e518ca649a862abca2856db0c99d385ba964a3 Mon Sep 17 00:00:00 2001 From: Sergey Dovbenko <sdovbenko@magecom.us> Date: Fri, 6 Dec 2019 18:16:25 +0000 Subject: [PATCH 201/586] Corrected Code Styles --- .../Magento/AsynchronousOperations/Model/Operation.php | 8 ++++---- .../Model/OperationStatusValidator.php | 6 +++--- .../Test/Unit/Model/OperationStatusValidatorTest.php | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/AsynchronousOperations/Model/Operation.php b/app/code/Magento/AsynchronousOperations/Model/Operation.php index de2b56d0a0dd7..00f33d10a1e1b 100644 --- a/app/code/Magento/AsynchronousOperations/Model/Operation.php +++ b/app/code/Magento/AsynchronousOperations/Model/Operation.php @@ -10,7 +10,7 @@ use Magento\Framework\DataObject; /** - * Class Operation + * Class Operation encapsulates methods for Operation Model Object */ class Operation extends DataObject implements OperationInterface { @@ -22,12 +22,12 @@ class Operation extends DataObject implements OperationInterface /** * Operation constructor. * - * @param array $data * @param OperationStatusValidator $operationStatusValidator + * @param array $data */ public function __construct( - array $data = [], - OperationStatusValidator $operationStatusValidator + OperationStatusValidator $operationStatusValidator, + array $data = [] ) { $this->operationStatusValidator = $operationStatusValidator; parent::__construct($data); diff --git a/app/code/Magento/AsynchronousOperations/Model/OperationStatusValidator.php b/app/code/Magento/AsynchronousOperations/Model/OperationStatusValidator.php index ae154edfb50f7..f2ae135e4303c 100644 --- a/app/code/Magento/AsynchronousOperations/Model/OperationStatusValidator.php +++ b/app/code/Magento/AsynchronousOperations/Model/OperationStatusValidator.php @@ -32,7 +32,9 @@ public function __construct(OperationStatusPool $operationStatusPool) /** * Validate method * - * @param $status + * @param int $status + * @throws \InvalidArgumentException + * @return void */ public function validate($status) { @@ -41,7 +43,5 @@ public function validate($status) if (!in_array($status, $statuses)) { throw new \InvalidArgumentException('Invalid Operation Status.'); } - - return; } } diff --git a/app/code/Magento/AsynchronousOperations/Test/Unit/Model/OperationStatusValidatorTest.php b/app/code/Magento/AsynchronousOperations/Test/Unit/Model/OperationStatusValidatorTest.php index 2209564d03aee..b93d9701a7a69 100644 --- a/app/code/Magento/AsynchronousOperations/Test/Unit/Model/OperationStatusValidatorTest.php +++ b/app/code/Magento/AsynchronousOperations/Test/Unit/Model/OperationStatusValidatorTest.php @@ -12,7 +12,7 @@ use PHPUnit\Framework\TestCase; /** - * Class OperationStatusValidatorTest + * Class OperationStatusValidatorTest implements logic for testing Operation::setStatus() method */ class OperationStatusValidatorTest extends TestCase { @@ -60,7 +60,7 @@ protected function setUp() * @param string $expectedResult * @dataProvider dataProviderForTestSetStatus */ - public function testSetStatus ( + public function testSetStatus( string $status, array $statusPool, string $expectedResult From 12217115413c9028658b552c9fa4b46029aaeaba Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Fri, 6 Dec 2019 15:07:18 -0600 Subject: [PATCH 202/586] Remove deprecated action groups that were introduced to backward compatibility --- .../ActionGroup/_Deprecated_ActionGroup.xml | 68 -- .../_Deprecated_ActionGroup.xml .xml | 139 --- .../ActionGroup/_Deprecated_ActionGroup.xml | 263 ------ .../ActionGroup/_Deprecated_ActionGroup.xml | 853 ------------------ .../ActionGroup/_Deprecated_ActionGroup.xml | 27 - .../ActionGroup/_Deprecated_ActionGroup.xml | 106 --- .../ActionGroup/_Deprecated_ActionGroup.xml | 90 -- .../ActionGroup/_Deprecated_ActionGroup.xml | 96 -- .../ActionGroup/_Deprecated_ActionGroup.xml | 19 - .../ActionGroup/_Deprecated_ActionGroup.xml | 39 - .../ActionGroup/_Deprecated_ActionGroup.xml | 28 - .../ActionGroup/_Deprecated_ActionGroup.xml | 150 --- .../ActionGroup/_Deprecated_ActionGroup.xml | 105 --- .../ActionGroup/_Deprecated_ActionGroup.xml | 673 -------------- .../ActionGroup/_Deprecated_ActionGroup.xml | 110 --- .../ActionGroup/_Deprecated_ActionGroup.xml | 51 -- .../ActionGroup/_Deprecated_ActionGroup.xml | 247 ----- .../ActionGroup/_Deprecated_ActionGroup.xml | 115 --- .../ActionGroup/_Deprecated_ActionGroup.xml | 271 ------ .../ActionGroup/_Deprecated_ActionGroup.xml | 98 -- .../ActionGroup/_Deprecated_ActionGroup.xml | 296 ------ .../ActionGroup/_Deprecated_ActionGroup.xml | 69 -- .../ActionGroup/_Deprecated_ActionGroup.xml | 99 -- 23 files changed, 4012 deletions(-) delete mode 100644 app/code/Magento/Backup/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/Braintree/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml .xml delete mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/Downloadable/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/Email/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/Multishipping/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/Newsletter/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/PageCache/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/Paypal/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/Search/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/Swatches/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/Tax/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/Ui/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/User/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/Wishlist/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/Backup/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Backup/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index 84c6812ddf183..0000000000000 --- a/app/code/Magento/Backup/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,68 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="createSystemBackup"> - <annotations> - <description>Creates a System Backup using provided Backup Entity.</description> - </annotations> - <arguments> - <argument name="backup" defaultValue="SystemBackup"/> - </arguments> - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateSystemBackupActionGroup` instead --> - <click selector="{{AdminMainActionsSection.systemBackup}}" stepKey="clickCreateBackupButton"/> - <waitForElementVisible selector="{{AdminCreateBackupFormSection.backupNameField}}" stepKey="waitForForm"/> - <fillField selector="{{AdminCreateBackupFormSection.backupNameField}}" userInput="{{backup.name}}" stepKey="fillBackupName"/> - <click selector="{{AdminCreateBackupFormSection.ok}}" stepKey="clickOk"/> - <waitForElementNotVisible selector=".loading-mask" time="300" stepKey="waitForBackupProcess"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You created the system backup." stepKey="seeSuccessMessage"/> - <see selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="seeBackupInGrid"/> - <see selector="{{AdminGridTableSection.backupTypeByName(backup.name)}}" userInput="{{backup.type}}" stepKey="seeBackupType"/> - </actionGroup> - - <actionGroup name="createMediaBackup"> - <annotations> - <description>Creates a Media Backup using provided Backup Entity.</description> - </annotations> - <arguments> - <argument name="backup" defaultValue="MediaBackup"/> - </arguments> - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateMediaBackupActionGroup` instead --> - <click selector="{{AdminMainActionsSection.mediaBackup}}" stepKey="clickCreateBackupButton"/> - <waitForElementVisible selector="{{AdminCreateBackupFormSection.backupNameField}}" stepKey="waitForForm"/> - <fillField selector="{{AdminCreateBackupFormSection.backupNameField}}" userInput="{{backup.name}}" stepKey="fillBackupName"/> - <click selector="{{AdminCreateBackupFormSection.ok}}" stepKey="clickOk"/> - <waitForPageLoad time="120" stepKey="waitForBackupProcess"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You created the database and media backup." stepKey="seeSuccessMessage"/> - <see selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="seeBackupInGrid"/> - <see selector="{{AdminGridTableSection.backupTypeByName(backup.name)}}" userInput="{{backup.type}}" stepKey="seeBackupType"/> - </actionGroup> - - <actionGroup name="createDatabaseBackup"> - <annotations> - <description>Creates a Database Backup using provided Backup Entity.</description> - </annotations> - <arguments> - <argument name="backup" defaultValue="DatabaseBackup"/> - </arguments> - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateDatabaseBackupActionGroup` instead --> - <click selector="{{AdminMainActionsSection.databaseBackup}}" stepKey="clickCreateBackupButton"/> - <waitForElementVisible selector="{{AdminCreateBackupFormSection.backupNameField}}" stepKey="waitForForm"/> - <fillField selector="{{AdminCreateBackupFormSection.backupNameField}}" userInput="{{backup.name}}" stepKey="fillBackupName"/> - <click selector="{{AdminCreateBackupFormSection.ok}}" stepKey="clickOk"/> - <waitForPageLoad time="120" stepKey="waitForBackupProcess"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You created the database backup." stepKey="seeSuccessMessage"/> - <see selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="seeBackupInGrid"/> - <see selector="{{AdminGridTableSection.backupTypeByName(backup.name)}}" userInput="{{backup.type}}" stepKey="seeBackupType"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml .xml b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml .xml deleted file mode 100644 index 5bfd2d15de72a..0000000000000 --- a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml .xml +++ /dev/null @@ -1,139 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="GoToAllUsers"> - <annotations> - <description>Navigate to the Users page via Backend Admin Side Menu. PLEASE NOTE: Use the amOnPage action instead.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `GoToAllUsersActionGroup` instead --> - <click selector="{{AdminCreateUserSection.system}}" stepKey="clickOnSystemIcon"/> - <waitForPageLoad stepKey="waitForSystemsPageToOpen"/> - <click selector="{{AdminCreateUserSection.allUsers}}" stepKey="clickToSelectUserRoles"/> - <waitForPageLoad stepKey="waitForUserRolesPageToOpen"/> - </actionGroup> - - <actionGroup name="GoToUserRoles"> - <annotations> - <description>Navigate to the User Roles page via Backend Admin Side Menu. PLEASE NOTE: Use the amOnPage action instead.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `GoToUserRolesActionGroup` instead --> - <click selector="#menu-magento-backend-system" stepKey="clickOnSystemIcon"/> - <waitForPageLoad stepKey="waitForSystemsPageToOpen"/> - <click selector="//span[contains(text(), 'User Roles')]" stepKey="clickToSelectUserRoles"/> - <waitForPageLoad stepKey="waitForUserRolesPageToOpen"/> - </actionGroup> - - <actionGroup name="AdminCreateNewRole"> - <annotations> - <description>Creates a User Role using the provided Data.</description> - </annotations> - <arguments> - <argument name="role" type="string" defaultValue=""/> - <argument name="resource" type="string" defaultValue="All"/> - <argument name="scope" type="string" defaultValue="Custom"/> - <argument name="websites" type="string" defaultValue="Main Website"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminCreateNewRoleActionGroup` instead --> - <click selector="{{AdminCreateRoleSection.create}}" stepKey="clickToAddNewRole"/> - <fillField selector="{{AdminCreateRoleSection.name}}" userInput="{{role.name}}" stepKey="setRoleName"/> - <fillField stepKey="setPassword" selector="{{AdminCreateRoleSection.password}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/> - <click selector="{{AdminCreateRoleSection.roleResources}}" stepKey="clickToOpenRoleResources"/> - <waitForPageLoad stepKey="waitForRoleResourcePage" time="5"/> - <click stepKey="checkSales" selector="//a[text()='Sales']"/> - <click selector="{{AdminCreateRoleSection.save}}" stepKey="clickToSaveRole"/> - <waitForPageLoad stepKey="waitForPageLoad" time="10"/> - <see userInput="You saved the role." stepKey="seeSuccessMessage"/> - </actionGroup> - - <actionGroup name="AdminCreateUserAction"> - <annotations> - <description>Creates a User using the NewAdmin User Entity and User Role Entity. PLEASE NOTE: The Action Group values are Hardcoded.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminCreateUserActionGroup` instead --> - <click selector="{{AdminCreateUserSection.create}}" stepKey="clickToCreateNewUser"/> - <waitForPageLoad stepKey="waitForNewUserPageLoad" time="10"/> - <fillField selector="{{AdminCreateUserSection.usernameTextField}}" userInput="{{NewAdmin.username}}" stepKey="enterUserName"/> - <fillField selector="{{AdminCreateUserSection.firstNameTextField}}" userInput="{{NewAdmin.firstName}}" stepKey="enterFirstName"/> - <fillField selector="{{AdminCreateUserSection.lastNameTextField}}" userInput="{{NewAdmin.lastName}}" stepKey="enterLastName"/> - <fillField selector="{{AdminCreateUserSection.emailTextField}}" userInput="{{NewAdmin.email}}" stepKey="enterEmail"/> - <fillField selector="{{AdminCreateUserSection.passwordTextField}}" userInput="{{NewAdmin.password}}" stepKey="enterPassword"/> - <fillField selector="{{AdminCreateUserSection.pwConfirmationTextField}}" userInput="{{NewAdmin.password}}" stepKey="confirmPassword"/> - <fillField selector="{{AdminCreateUserSection.currentPasswordField}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="enterCurrentPassword"/> - <scrollToTopOfPage stepKey="scrollToTopOfPage"/> - <click selector="{{AdminCreateUserSection.userRoleTab}}" stepKey="clickUserRole"/> - <waitForAjaxLoad stepKey="waitForRoles" time="5"/> - <fillField selector="{{AdminCreateRoleSection.roleNameFilterTextField}}" userInput="{{role.name}}" stepKey="filterRole"/> - <click selector="{{AdminCreateRoleSection.searchButton}}" stepKey="clickSearch"/> - <waitForPageLoad stepKey="waitForSearch" time="10"/> - <click selector="{{AdminCreateRoleSection.searchResultFirstRow}}" stepKey="selectRole"/> - <click selector="{{AdminCreateUserSection.saveButton}}" stepKey="clickSaveUser"/> - <waitForPageLoad stepKey="waitForSaveUser" time="10"/> - <see userInput="You saved the user." stepKey="seeSuccessMessage"/> - </actionGroup> - - <actionGroup name="ConfigureBraintree"> - <annotations> - <description>Sets up the Braintree configuration setting using the BraintreeConfigurationSection Data Entity. PLEASE NOTE: The Action Group values are Hardcoded.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ConfigureBraintreeActionGroup` instead --> - <click stepKey="clickOnSTORES" selector="{{AdminMenuSection.stores}}"/> - <waitForPageLoad stepKey="waitForConfiguration" time="2"/> - <click stepKey="clickOnConfigurations" selector="{{AdminMenuSection.configuration}}"/> - <waitForPageLoad stepKey="waitForSales" time="2"/> - <click stepKey="clickOnSales" selector="{{ConfigurationListSection.sales}}"/> - <waitForPageLoad stepKey="waitForPaymentMethods" time="2"/> - <click stepKey="clickOnPaymentMethods" selector="{{ConfigurationListSection.salesPaymentMethods}}"/> - <waitForPageLoad stepKey="waitForConfigureButton" time="2"/> - <click stepKey="clickOnConfigureButtonForBraintree" selector="{{ConfigurationPaymentSection.configureButton}}"/> - <waitForPageLoad stepKey="BraintreeSettings" time="2"/> - - <fillField stepKey="fillTitleForBraintreeSettings" selector="{{BraintreeConfiguraionSection.titleForBraintreeSettings}}" userInput="{{BraintreeConfigurationData.title}}"/> - <click stepKey="openEnvironmentSelect" selector="{{BraintreeConfiguraionSection.environment}}"/> - <click stepKey="chooseEnvironment" selector="{{BraintreeConfiguraionSection.sandbox}}"/> - <click stepKey="openPaymentActionSelect" selector="{{BraintreeConfiguraionSection.paymentActionSelect}}"/> - <click stepKey="choosePaymentAction" selector="{{BraintreeConfiguraionSection.paymentAction}}"/> - <fillField stepKey="fillMerchantID" selector="{{BraintreeConfiguraionSection.merchantID}}" userInput="{{BraintreeConfigurationData.merchantID}}"/> - <fillField stepKey="fillPublicKey" selector="{{BraintreeConfiguraionSection.publicKey}}" userInput="{{BraintreeConfigurationData.publicKey}}"/> - <fillField stepKey="fillPrivateKey" selector="{{BraintreeConfiguraionSection.privateKey}}" userInput="{{BraintreeConfigurationData.privateKey}}"/> - <click stepKey="expandEnableThisSolution" selector="{{BraintreeConfiguraionSection.enableThisSolution}}"/> - <click stepKey="chooseYesForEnableThisSolution" selector="{{BraintreeConfiguraionSection.yesForEnable}}"/> - <click stepKey="expandEnablePayPalThroughBraintree" selector="{{BraintreeConfiguraionSection.payPalThroughBraintree}}"/> - <click stepKey="chooseYesForEnablePayPalThroughBraintree" selector="{{BraintreeConfiguraionSection.yesForPayPalThroughBraintree}}"/> - <click stepKey="expandAdvancedBraintreeSettings" selector="{{BraintreeConfiguraionSection.advancedBraintreeSettings}}"/> - <fillField stepKey="fillMerchantAccountID" selector="{{BraintreeConfiguraionSection.merchantAccountID}}" userInput="{{BraintreeConfigurationData.merchantAccountID}}"/> - <click stepKey="expandCVVVerification" selector="{{BraintreeConfiguraionSection.CVVVerification}}"/> - <click stepKey="chooseYes" selector="{{BraintreeConfiguraionSection.yesForCVV}}"/> - <click stepKey="expandPayPalThroughBraintree" selector="{{BraintreeConfiguraionSection.payPalThroughBraintreeSelector}}"/> - <fillField stepKey="fillTitleForPayPalThroughBraintree" selector="{{BraintreeConfiguraionSection.titleForPayPalThroughBraintree}}" userInput="{{BraintreeConfigurationData.titleForPayPalThroughBraintree}}"/> - <click stepKey="expandPaymentAction" selector="{{BraintreeConfiguraionSection.paymentActionInPayPal}}"/> - <click stepKey="chooseAuthorize" selector="{{BraintreeConfiguraionSection.actionAuthorize}}"/> - <click stepKey="save" selector="{{BraintreeConfiguraionSection.save}}"/> - <waitForElementVisible selector="{{BraintreeConfiguraionSection.successfulMessage}}" stepKey="waitForSuccessfullyConfigured" time="10"/> - </actionGroup> - - <actionGroup name="DisableBrainTree"> - <annotations> - <description>Disables the Braintree and BraintreePaypal configuration settings via the CLI.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `DisableBraintreeActionGroup` instead --> - <magentoCLI stepKey="disableBrainTree" command="config:set payment/braintree/active 0"/> - <magentoCLI stepKey="disableBrainTreePaypal" command="config:set payment/braintree_paypal/active 0"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index d5413d2269a5b..0000000000000 --- a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,263 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AncillaryPrepBundleProduct"> - <annotations> - <description>Requires Navigation to the Product Creation page. Fills out Name, Sku, and SEO information using the BundleProduct Data Entity. PLEASE NOTE: The Action Group values are Hardcoded.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AncillaryPrepBundleProductActionGroup` instead --> - <fillField selector="{{AdminProductFormBundleSection.productName}}" userInput="{{BundleProduct.name}}" stepKey="fillProductName"/> - <fillField selector="{{AdminProductFormBundleSection.productSku}}" userInput="{{BundleProduct.sku}}" stepKey="fillProductSku"/> - - <scrollTo selector="{{AdminProductFormBundleSection.seoDropdown}}" stepKey="moveToSEOSection"/> - <conditionalClick selector="{{AdminProductFormBundleSection.seoDropdown}}" dependentSelector="{{AdminProductFormBundleSection.urlKey}}" visible="false" stepKey="openDropDownIfClosed"/> - <waitForPageLoad stepKey="WaitForDropDownSEO"/> - - <fillField userInput="{{BundleProduct.urlKey}}" selector="{{AdminProductFormBundleSection.urlKey}}" stepKey="FillsinSEOlinkExtension"/> - </actionGroup> - - <actionGroup name="FindProductToEdit"> - <annotations> - <description>Clears the Backend Admin Grid Filters on the Backend Admin Product Grid page. Searches for the BundleProduct Data Entity. Then clicks on the first item in the Admin Grid. PLEASE NOTE: The Action Group values are Hardcoded.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FindProductToEditActionGroup` instead --> - <amOnPage url="{{ProductCatalogPage.url}}" stepKey="GoToProductCatalog"/> - <waitForPageLoad stepKey="WaitForCatalogProductPageToLoad"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <fillField userInput="{{BundleProduct.name}}" selector="#fulltext" stepKey="EnterProductNameInSearch"/> - <click stepKey="ClickSearch" selector="{{AdminProductFormBundleSection.searchButton}}"/> - <click stepKey="ClickOnProduct" selector="{{AdminProductFormBundleSection.firstCatalogProduct}}"/> - <waitForPageLoad stepKey="WaitForProductEditPageToLoad"/> - </actionGroup> - - <actionGroup name="CreateBasicBundleProduct"> - <annotations> - <description>Requires Navigation to the Product Creation page. Fills out Name, Sku, and SEO information using the BundleProduct Data Entity. PLEASE NOTE: The Action Group values are Hardcoded.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateBasicBundleProductActionGroup` instead --> - <fillField selector="{{AdminProductFormBundleSection.productName}}" userInput="{{BundleProduct.name}}" stepKey="fillProductName"/> - <fillField selector="{{AdminProductFormBundleSection.productSku}}" userInput="{{BundleProduct.sku}}" stepKey="fillProductSku"/> - - <scrollTo selector="{{AdminProductFormBundleSection.seoDropdown}}" stepKey="scrollToSeoDropDown"/> - <conditionalClick selector="{{AdminProductFormBundleSection.seoDropdown}}" dependentSelector="{{AdminProductFormBundleSection.urlKey}}" visible="false" stepKey="openDropDownIfClosed"/> - <waitForPageLoad stepKey="waitForDropDownSEO"/> - - <fillField userInput="{{BundleProduct.urlKey}}" selector="{{AdminProductFormBundleSection.urlKey}}" stepKey="fillsInSeoLinkExtension"/> - </actionGroup> - - <actionGroup name="addBundleOptionWithTwoProducts"> - <annotations> - <description>Requires Navigation to the Product Creation page. Adds Bundle Option with Two Products using the provided arguments. 'x' refers to Bundle option number. 'n' refers to the first number after x.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddBundleOptionWithTwoProductsActionGroup` instead --> - <arguments> - <argument name="x" type="string"/> - <argument name="n" type="string"/> - <argument name="prodOneSku" type="string"/> - <argument name="prodTwoSku" type="string"/> - <argument name="optionTitle" type="string"/> - <argument name="inputType" type="string"/> - </arguments> - - <conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/> - <scrollTo selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" stepKey="scrollUpABit"/> - <click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="clickAddOption"/> - <waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle(x)}}" stepKey="waitForOptions"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle(x)}}" userInput="{{optionTitle}}" stepKey="fillTitle"/> - <selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType(x)}}" userInput="{{inputType}}" stepKey="selectType"/> - <waitForElementVisible selector="{{AdminProductFormBundleSection.nthAddProductsToOption(n)}}" stepKey="waitForAddBtn"/> - <click selector="{{AdminProductFormBundleSection.nthAddProductsToOption(n)}}" stepKey="clickAdd"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters1"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters1"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodOneSku}}" stepKey="fillProductSkuFilter1"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters1"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad1" time="30"/> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct1"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters2"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters2"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodTwoSku}}" stepKey="fillProductSkuFilter2"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters2"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad2" time="30"/> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct2"/> - <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddButton1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="50" stepKey="fillQuantity1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '1')}}" userInput="50" stepKey="fillQuantity2"/> - </actionGroup> - - <actionGroup name="addBundleOptionWithOneProduct" extends="addBundleOptionWithTwoProducts"> - <annotations> - <description>Requires Navigation to the Product Creation page. Adds Bundle Option with One Product as specified in arguments. 'x' refers to Bundle option number. 'n' refers to the first number after x.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddBundleOptionWithOneProductActionGroup` instead --> - <remove keyForRemoval="openProductFilters2"/> - <remove keyForRemoval="fillProductSkuFilter2"/> - <remove keyForRemoval="clickApplyFilters2"/> - <remove keyForRemoval="waitForFilteredGridLoad2"/> - <remove keyForRemoval="selectProduct2"/> - <remove keyForRemoval="selectProduct2"/> - <remove keyForRemoval="fillQuantity1"/> - <remove keyForRemoval="fillQuantity2"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="1" stepKey="fillQuantity" after="clickAddButton1"/> - </actionGroup> - - <actionGroup name="addBundleOptionWithTreeProducts" extends="addBundleOptionWithTwoProducts"> - <annotations> - <description>Requires Navigation to the Product Creation page. Adds Bundle Option with Three Products using the provided arguments. 'x' refers to Bundle option number. 'n' refers to the first number after x.</description> - </annotations> - <arguments> - <argument name="prodTreeSku" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddBundleOptionWithThreeProductsActionGroup` instead --> - <remove keyForRemoval="fillQuantity1"/> - <remove keyForRemoval="fillQuantity2"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters3" after="selectProduct2"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters3" after="clickClearFilters3"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodTreeSku}}" stepKey="fillProductSkuFilter3" after="openProductFilters3"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters3" after="fillProductSkuFilter3"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad3" time="30" after="clickApplyFilters3"/> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct3" after="waitForFilteredGridLoad3"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="1" stepKey="fillQuantity1" after="clickAddButton1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '1')}}" userInput="1" stepKey="fillQuantity2" after="fillQuantity1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '2')}}" userInput="1" stepKey="fillQuantity3" after="fillQuantity2"/> - </actionGroup> - - <actionGroup name="addBundleOptionWithSixProducts" extends="addBundleOptionWithTwoProducts"> - <annotations> - <description>Requires Navigation to Product Creation page. Adds Bundle Option with Six Products as specified in arguments. 'x' refers to Bundle option number. 'n' refers to the first number after x.</description> - </annotations> - <arguments> - <argument name="prodTreeSku" type="string"/> - <argument name="prodFourSku" type="string"/> - <argument name="prodFiveSku" type="string"/> - <argument name="prodSixSku" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddBundleOptionWithSixProductsActionGroup` instead --> - <remove keyForRemoval="fillQuantity1"/> - <remove keyForRemoval="fillQuantity2"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters3" after="selectProduct2"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters3" after="clickClearFilters3"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodTreeSku}}" stepKey="fillProductSkuFilter3" after="openProductFilters3"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters3" after="fillProductSkuFilter3"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad3" time="30" after="clickApplyFilters3"/> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct3" after="waitForFilteredGridLoad3"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters4" after="selectProduct3"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters4" after="clickClearFilters4"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodFourSku}}" stepKey="fillProductSkuFilter4" after="openProductFilters4"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters4" after="fillProductSkuFilter4"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad4" time="30" after="clickApplyFilters4"/> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct4" after="clickApplyFilters4"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters5" after="selectProduct4"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters5" after="clickClearFilters5"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodFiveSku}}" stepKey="fillProductSkuFilter5" after="openProductFilters5"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters5" after="fillProductSkuFilter5"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad5" time="30" after="clickApplyFilters5"/> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct5" after="waitForFilteredGridLoad5"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters6" after="selectProduct5"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters6" after="clickClearFilters6"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodSixSku}}" stepKey="fillProductSkuFilter6" after="openProductFilters6"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters6" after="fillProductSkuFilter6"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad6" time="30" after="clickApplyFilters6"/> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct6" after="waitForFilteredGridLoad6"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="2" stepKey="fillQuantity1" after="clickAddButton1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '1')}}" userInput="2" stepKey="fillQuantity2" after="fillQuantity1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '2')}}" userInput="2" stepKey="fillQuantity3" after="fillQuantity2"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '3')}}" userInput="2" stepKey="fillQuantity4" after="fillQuantity3"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '4')}}" userInput="2" stepKey="fillQuantity5" after="fillQuantity4"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '5')}}" userInput="2" stepKey="fillQuantity6" after="fillQuantity5"/> - </actionGroup> - - <actionGroup name="deleteBundleOptionByIndex"> - <annotations> - <description>Requires Navigation to Product Creation page. Removes any Bundle Option by index specified in arguments. 'deleteIndex' refers to Bundle option number.</description> - </annotations> - <arguments> - <argument name="deleteIndex" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `DeleteBundleOptionByIndexActionGroup` instead --> - <conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/> - <scrollTo selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" stepKey="scrollUpABit"/> - <click selector="{{AdminProductFormBundleSection.deleteOption(deleteIndex)}}" stepKey="clickDeleteOption"/> - </actionGroup> - - <actionGroup name="StorefrontAddBundleProductFromProductToCartWithMultiOption" extends="StorefrontAddBundleProductFromProductToCartActionGroup"> - <annotations> - <description>Selects a Bundled Product option on the Bundled Product page. PLEASE NOTE: The Quantity selection is not available in the Action Group.</description> - </annotations> - <arguments> - <argument name="optionName" type="string"/> - <argument name="value" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontAddBundleProductFromProductToCartWithMultiOptionActionGroup` instead --> - <selectOption selector="{{StorefrontBundledSection.multiselectOptionFourProducts(optionName)}}" userInput="{{value}}" stepKey="selectValue" before="clickAddBundleProductToCart"/> - </actionGroup> - - <actionGroup name="fillMainBundleProductForm"> - <annotations> - <description>Fills the Name, SKU and Stock Status fields.</description> - </annotations> - <arguments> - <argument name="product" defaultValue="BundleProduct"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FillMainBundleProductFormActionGroup` instead --> - <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductSku"/> - <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductName"/> - <selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{product.status}}" stepKey="selectStockStatus"/> - </actionGroup> - - <actionGroup name="checkRequiredFieldsInBundleProductForm"> - <annotations> - <description>Clears the Name and SKU fields when adding a Product and then verifies that they are required after attempting to Save.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CheckRequiredFieldsInBundleProductFormActionGroup` instead --> - <clearField selector="{{AdminProductFormSection.productName}}" stepKey="clearProductSku"/> - <clearField selector="{{AdminProductFormSection.productSku}}" stepKey="clearProductName"/> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Product" stepKey="seeStillOnEditPage"/> - <see selector="{{AdminProductFormSection.fieldError('name')}}" userInput="This is a required field." stepKey="seeNameRequired"/> - <see selector="{{AdminProductFormSection.fieldError('sku')}}" userInput="This is a required field." stepKey="seeSkuRequired"/> - </actionGroup> - - <actionGroup name="viewBundleProductInAdminGrid"> - <annotations> - <description>Clears the Grid Filters on the Catalog Grid page and applies Filter by Name and Sku. Then checks to see if the Product exists in the 1st row. Then clears the Grid Filters again for future Tests.</description> - </annotations> - <arguments> - <argument name="product" defaultValue="BundleProduct"/> - <argument name="thumbnail" defaultValue="ProductPlaceholderImage"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ViewBundleProductInAdminGridActionGroup` instead --> - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> - <waitForPageLoad stepKey="waitForPageLoadInitial"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{product.name}}" stepKey="fillProductNameFilter"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> - <selectOption selector="{{AdminProductGridFilterSection.typeFilter}}" userInput="{{product.type_id}}" stepKey="selectionProductType"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.name}}" stepKey="seeProductNameInGrid"/> - <click selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="clickClearFiltersAfter"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index 672465ad4120b..0000000000000 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,853 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="CreateConfigurableProductWithAttributeSet"> - <annotations> - <description>Admin edit created product as configurable. Choose created options</description> - </annotations> - <arguments> - <argument name="product" defaultValue="_defaultProduct"/> - <argument name="category" defaultValue="_defaultCategory"/> - <argument name="label" type="string" defaultValue="mySet"/> - <argument name="option" type="string" defaultValue="['option1', 'option2', 'option3', 'option4']"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateConfigurableProductWithAttributeSetActionGroup` instead --> - <click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet"/> - <fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{label}}" stepKey="searchForAttrSet"/> - <click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttrSet"/> - <fillField userInput="{{product.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/> - <selectOption selector="{{AdminProductFormSection.additionalOptions}}" parameterArray="{{option}}" stepKey="searchAndMultiSelectCreatedOption"/> - </actionGroup> - - <actionGroup name="AdminCreateConfigurationsForAttribute" extends="generateConfigurationsByAttributeCode"> - <annotations> - <description>EXTENDS: generateConfigurationsByAttributeCode. Click to apply single price to all Skus. Enter Attribute price</description> - </annotations> - <arguments> - <argument name="price" type="string" defaultValue="100"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminCreateConfigurationsForAttributeActionGroup` instead --> - <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" after="clickOnNextButton2" stepKey="waitForNextPageOpened2"/> - <click selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" after="waitForNextPageOpened2" stepKey="clickOnApplySinglePriceToAllSkus"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.singlePrice}}" userInput="{{price}}" before="clickOnApplySingleQuantityToEachSku" stepKey="enterAttributePrice"/> - </actionGroup> - - <actionGroup name="AdminCreateConfigurableProductWithAttributeUncheckOption" extends="generateConfigurationsByAttributeCode"> - <annotations> - <description>EXTENDS: generateConfigurationsByAttributeCode. Click to uncheck created option. Enter Attribute price</description> - </annotations> - <arguments> - <argument name="attributeOption" type="string" defaultValue="option1"/> - <argument name="price" type="string" defaultValue="100"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminCreateConfigurableProductWithAttributeUncheckOptionActionGroup` instead --> - <click selector="{{AdminCreateProductConfigurationsPanel.attributeOption('attributeOption')}}" after="clickOnSelectAll" stepKey="clickToUncheckOption"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" after="clickToUncheckOption" stepKey="clickOnNextButton22"/> - <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" after="clickOnNextButton22" stepKey="waitForNextPageOpened2"/> - <click selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" after="waitForNextPageOpened2" stepKey="clickOnApplySinglePriceToAllSkus"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.singlePrice}}" userInput="{{price}}" before="clickOnApplySingleQuantityToEachSku" stepKey="enterAttributePrice"/> - </actionGroup> - - <actionGroup name="viewConfigurableProductInAdminGrid"> - <annotations> - <description>Goes to the Admin Product grid page. Validates the provided Configurable Product is present and correct in the grid.</description> - </annotations> - <arguments> - <argument name="product" defaultValue="_defaultProduct"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ViewConfigurableProductInAdminGridActionGroup` instead --> - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> - <waitForPageLoad stepKey="waitForPageLoadInitial"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <seeNumberOfElements selector="{{AdminProductGridSection.productGridRows}}" userInput="3" stepKey="seeCorrectNumberOfProducts"/> - - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFiltersSimple"/> - <selectOption selector="{{AdminProductGridFilterSection.typeFilter}}" userInput="simple" stepKey="selectionProductType"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFiltersWithSimpleType"/> - <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.name}}" stepKey="seeSimpleProductNameInGrid"/> - <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.price}}" stepKey="seeSimpleProductPriceInGrid"/> - - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFiltersConfigurable"/> - <selectOption selector="{{AdminProductGridFilterSection.typeFilter}}" userInput="{{product.type_id}}" stepKey="selectionConfigurableProductType"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFiltersWithConfigurableType"/> - <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.name}}" stepKey="seeConfigurableProductNameInGrid"/> - <dontSee selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.price}}" stepKey="dontSeeProductPriceNameInGrid"/> - - <click selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="clickClearFiltersAfter"/> - </actionGroup> - - <actionGroup name="createConfigurableProduct"> - <annotations> - <description>Goes to the Admin Product grid page. Creates a Configurable Product using the default Product Options.</description> - </annotations> - <arguments> - <argument name="product" defaultValue="_defaultProduct"/> - <argument name="category" defaultValue="_defaultCategory"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateConfigurableProductActionGroup` instead --> - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> - <waitForPageLoad time="30" stepKey="wait1"/> - <click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickOnAddProductToggle"/> - <click selector="{{AdminProductGridActionSection.addConfigurableProduct}}" stepKey="clickOnAddConfigurableProduct"/> - <fillField userInput="{{product.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/> - <fillField userInput="{{product.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="fillSKU"/> - <fillField userInput="{{product.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="fillPrice"/> - <fillField userInput="{{product.quantity}}" selector="{{AdminProductFormSection.productQuantity}}" stepKey="fillQuantity"/> - <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{category.name}}]" stepKey="fillCategory"/> - <selectOption userInput="{{product.visibility}}" selector="{{AdminProductFormSection.visibility}}" stepKey="fillVisibility"/> - <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/> - <fillField userInput="{{product.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/> - - <click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickOnCreateConfigurations"/> - <click selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" stepKey="clickOnNewAttribute"/> - <waitForPageLoad stepKey="waitForIFrame"/> - <switchToIFrame selector="{{AdminNewAttributePanel.newAttributeIFrame}}" stepKey="switchToNewAttributeIFrame"/> - <fillField selector="{{AdminNewAttributePanel.defaultLabel}}" userInput="{{colorProductAttribute.default_label}}" stepKey="fillDefaultLabel"/> - <click selector="{{AdminNewAttributePanel.saveAttribute}}" stepKey="clickOnNewAttributePanel"/> - <waitForPageLoad stepKey="waitForSaveAttribute"/> - <switchToIFrame stepKey="switchOutOfIFrame"/> - <waitForPageLoad stepKey="waitForFilters"/> - <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickOnFilters"/> - <fillField userInput="{{colorProductAttribute.default_label}}" selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" stepKey="fillFilterAttributeCodeField"/> - <click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/> - <click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton1"/> - <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="waitCreateNewValueAppears"/> - <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateNewValue1"/> - <fillField userInput="{{colorProductAttribute1.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewAttribute1"/> - <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute1"/> - <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateNewValue2"/> - <fillField userInput="{{colorProductAttribute2.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewAttribute2"/> - <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute2"/> - <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateNewValue3"/> - <fillField userInput="{{colorProductAttribute3.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewAttribute3"/> - <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute3"/> - <click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="clickOnSelectAll"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton2"/> - <click selector="{{AdminCreateProductConfigurationsPanel.applyUniquePricesByAttributeToEachSku}}" stepKey="clickOnApplyUniquePricesByAttributeToEachSku"/> - <selectOption selector="{{AdminCreateProductConfigurationsPanel.selectAttribute}}" userInput="{{colorProductAttribute.default_label}}" stepKey="selectAttributes"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.attribute1}}" userInput="{{colorProductAttribute1.price}}" stepKey="fillAttributePrice1"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.attribute2}}" userInput="{{colorProductAttribute2.price}}" stepKey="fillAttributePrice2"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.attribute3}}" userInput="{{colorProductAttribute3.price}}" stepKey="fillAttributePrice3"/> - <click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickOnApplySingleQuantityToEachSku"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="1" stepKey="enterAttributeQuantity"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton3"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton4"/> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/> - <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> - <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/> - <seeInTitle userInput="{{product.name}}" stepKey="seeProductNameInTitle"/> - </actionGroup> - - <actionGroup name="createConfigurableProductWithTwoAttributes" extends="createConfigurableProduct"> - <annotations> - <description>Goes to the Admin Product grid page. Creates a Configurable Product with 2 product attributes.</description> - </annotations> - <arguments> - <argument name="attribute1" defaultValue="ProductColorAttribute"/> - <argument name="attribute2" defaultValue="ProductSizeAttribute"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateConfigurableProductWithTwoAttributesActionGroup` instead --> - <remove keyForRemoval="clickOnNewAttribute"/> - <remove keyForRemoval="waitForIFrame"/> - <remove keyForRemoval="switchToNewAttributeIFrame"/> - <remove keyForRemoval="fillDefaultLabel"/> - <remove keyForRemoval="clickOnNewAttributePanel"/> - <remove keyForRemoval="waitForSaveAttribute"/> - <remove keyForRemoval="switchOutOfIFrame"/> - <remove keyForRemoval="waitForFilters"/> - <remove keyForRemoval="clickOnFilters"/> - <remove keyForRemoval="fillFilterAttributeCodeField"/> - <remove keyForRemoval="clickApplyFiltersButton"/> - <remove keyForRemoval="clickOnFirstCheckbox"/> - <click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox(attribute1.attribute_code)}}" stepKey="selectAttribute1" after="clickOnCreateConfigurations"/> - <click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox(attribute2.attribute_code)}}" stepKey="selectAttribute2" after="selectAttribute1"/> - <remove keyForRemoval="waitCreateNewValueAppears"/> - <remove keyForRemoval="clickOnCreateNewValue1"/> - <remove keyForRemoval="fillFieldForNewAttribute1"/> - <remove keyForRemoval="clickOnSaveNewAttribute1"/> - <remove keyForRemoval="clickOnCreateNewValue2"/> - <remove keyForRemoval="fillFieldForNewAttribute2"/> - <remove keyForRemoval="clickOnSaveNewAttribute2"/> - <remove keyForRemoval="clickOnCreateNewValue3"/> - <remove keyForRemoval="fillFieldForNewAttribute3"/> - <remove keyForRemoval="clickOnSaveNewAttribute3"/> - <remove keyForRemoval="clickOnSelectAll"/> - <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(attribute1.frontend_label)}}" stepKey="selectAllOptionsOfAttribute1" before="clickOnNextButton2"/> - <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(attribute2.frontend_label)}}" stepKey="selectAllOptionsOfAttribute2" before="clickOnNextButton2"/> - <remove keyForRemoval="applyUniquePricesByAttributeToEachSku"/> - <remove keyForRemoval="clickOnApplyUniquePricesByAttributeToEachSku"/> - <remove keyForRemoval="selectAttributes"/> - <remove keyForRemoval="fillAttributePrice1"/> - <remove keyForRemoval="fillAttributePrice2"/> - <remove keyForRemoval="fillAttributePrice3"/> - <remove keyForRemoval="clickOnSaveButton2"/> - <remove keyForRemoval="clickOnConfirmInPopup"/> - <remove keyForRemoval="seeSaveProductMessage"/> - <remove keyForRemoval="seeProductNameInTitle"/> - </actionGroup> - - <actionGroup name="saveConfigurableProduct"> - <annotations> - <description>Save configurable product</description> - </annotations> - <arguments> - <argument name="product" defaultValue="_defaultProduct"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SaveConfigurableProductActionGroup` instead --> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton"/> - <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> - <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/> - <seeInTitle userInput="{{product.name}}" stepKey="seeProductNameInTitle"/> - </actionGroup> - - <actionGroup name="generateConfigurationsByAttributeCode"> - <annotations> - <description>Generates the Product Configurations for the provided Attribute Code on the Configurable Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="attributeCode" type="string" defaultValue="SomeString"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `GenerateConfigurationsByAttributeCodeActionGroup` instead --> - <click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickCreateConfigurations"/> - <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickFilters"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" userInput="{{attributeCode}}" stepKey="fillFilterAttributeCodeField"/> - <click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/> - <click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton1"/> - <click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="clickOnSelectAll"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton2"/> - <click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickOnApplySingleQuantityToEachSku"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="99" stepKey="enterAttributeQuantity"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton3"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton4"/> - </actionGroup> - - <actionGroup name="createOptionsForAttribute"> - <arguments> - <argument name="attributeName" type="string" defaultValue="{{productAttributeColor.default_label}}"/> - <argument name="firstOptionName" type="string" defaultValue="option1"/> - <argument name="secondOptionName" type="string" defaultValue="option2"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateOptionsForAttributeActionGroup` instead --> - <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickOnFilters"/> - <fillField userInput="{{attributeName}}" selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" stepKey="fillFilterAttributeCodeField"/> - <click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/> - <click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton"/> - <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="waitCreateNewValueAppears"/> - <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateFirstNewValue"/> - <fillField userInput="{{firstOptionName}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewFirstOption"/> - <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute"/> - <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateSecondNewValue"/> - <fillField userInput="{{secondOptionName}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewSecondOption"/> - <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveAttribute"/> - <click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="clickOnSelectAll"/> - </actionGroup> - - <actionGroup name="createConfigurationsForAttribute" extends="generateConfigurationsByAttributeCode"> - <annotations> - <description>EXTENDS: generateConfigurationsByAttributeCode. Clicks on the Save button. Clicks on the Confirm button.</description> - </annotations> - <arguments> - <argument name="attributeCode" type="string" defaultValue="SomeString"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateConfigurationsForAttributeActionGroup` instead --> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/> - <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> - </actionGroup> - - <actionGroup name="createConfigurationsForAttributeWithImages" extends="generateConfigurationsByAttributeCode"> - <annotations> - <description>EXTENDS: generateConfigurationsByAttributeCode. Adds the provided Attribute Image to the provided Attribute Code.</description> - </annotations> - <arguments> - <argument name="attributeCode" type="string" defaultValue="SomeString"/> - <argument name="image" defaultValue="ProductImage"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateConfigurationsForAttributeWithImagesActionGroup` instead --> - <click selector="{{AdminCreateProductConfigurationsPanel.applySingleSetOfImages}}" stepKey="clickOnApplySingleImageSetToAllSku" after="enterAttributeQuantity"/> - <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.imageUploadButton}}" stepKey="seeImageSectionIsReady" after="clickOnApplySingleImageSetToAllSku"/> - <attachFile selector="{{AdminCreateProductConfigurationsPanel.imageFileUpload}}" userInput="{{image.file}}" stepKey="uploadFile" after="seeImageSectionIsReady"/> - <waitForElementNotVisible selector="{{AdminCreateProductConfigurationsPanel.uploadProgressBar}}" stepKey="waitForUpload" after="uploadFile"/> - <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.imageFile(image.fileName)}}" stepKey="waitForThumbnail" after="waitForUpload"/> - - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2" after="clickOnNextButton4"/> - <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup" after="clickOnSaveButton2"/> - </actionGroup> - - <actionGroup name="createConfigurationsForTwoAttribute" extends="generateConfigurationsByAttributeCode"> - <annotations> - <description>EXTENDS: generateConfigurationsByAttributeCode. Generates the Product Configurations for the 2 provided Attribute Codes on the Configurable Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="secondAttributeCode" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateConfigurationsForTwoAttributeActionGroup` instead --> - <remove keyForRemoval="clickOnSelectAll"/> - <remove keyForRemoval="clickFilters"/> - <remove keyForRemoval="fillFilterAttributeCodeField"/> - <remove keyForRemoval="clickApplyFiltersButton"/> - <remove keyForRemoval="clickOnFirstCheckbox"/> - - <click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox(attributeCode)}}" stepKey="clickOnFirstAttributeCheckbox" after="clickCreateConfigurations"/> - <click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox(secondAttributeCode)}}" stepKey="clickOnSecondAttributeCheckbox" after="clickOnFirstAttributeCheckbox"/> - <grabTextFrom selector="{{AdminCreateProductConfigurationsPanel.defaultLabel(attributeCode)}}" stepKey="grabFirstAttributeDefaultLabel" after="clickOnSecondAttributeCheckbox"/> - <grabTextFrom selector="{{AdminCreateProductConfigurationsPanel.defaultLabel(secondAttributeCode)}}" stepKey="grabSecondAttributeDefaultLabel" after="grabFirstAttributeDefaultLabel"/> - <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute({$grabFirstAttributeDefaultLabel})}}" stepKey="clickOnSelectAllForFirstAttribute" after="clickOnNextButton1"/> - <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute({$grabSecondAttributeDefaultLabel})}}" stepKey="clickOnSelectAllForSecondAttribute" after="clickOnSelectAllForFirstAttribute"/> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/> - <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> - </actionGroup> - - <actionGroup name="saveConfiguredProduct"> - <annotations> - <description>Save the Configurable Product on the Configurable Product creation/edit page. Validates that the Success Message is present.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SaveConfiguredProductActionGroup` instead --> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/> - <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> - <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/> - </actionGroup> - - <actionGroup name="GenerateAndSaveConfiguredProductAfterSettingOptions" extends="saveConfiguredProduct"> - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `GenerateAndSaveConfiguredProductAfterSettingOptionsActionGroup` instead --> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" before="clickOnSaveButton2" stepKey="clickOnNextButton"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" after="clickOnNextButton" stepKey="clickOnGenerateProductsButton"/> - </actionGroup> - - <actionGroup name="addNewProductConfigurationAttribute"> - <annotations> - <description>Generates the Product Configurations for the 2 provided Attribute Names on the Configurable Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="attribute" type="entity"/> - <argument name="firstOption" type="entity"/> - <argument name="secondOption" type="entity"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddNewProductConfigurationAttributeActionGroup` instead --> - <click selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" stepKey="clickOnNewAttribute"/> - <waitForPageLoad stepKey="waitForIFrame"/> - <switchToIFrame selector="{{AdminNewAttributePanel.newAttributeIFrame}}" stepKey="switchToNewAttributeIFrame"/> - <fillField selector="{{AdminNewAttributePanel.defaultLabel}}" userInput="{{attribute.default_label}}" stepKey="fillDefaultLabel"/> - <click selector="{{AdminNewAttributePanel.saveAttribute}}" stepKey="clickOnNewAttributePanel"/> - <waitForPageLoad stepKey="waitForSaveAttribute"/> - <switchToIFrame stepKey="switchOutOfIFrame"/> - <waitForPageLoad stepKey="waitForFilters"/> - - <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickOnFilters"/> - <fillField userInput="{{attribute.default_label}}" selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" stepKey="fillFilterAttributeCodeField"/> - <click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/> - <click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton"/> - <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="waitCreateNewValueAppears"/> - <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateFirstNewValue"/> - <fillField userInput="{{firstOption.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewFirstOption"/> - <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute"/> - <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateSecondNewValue"/> - <fillField userInput="{{secondOption.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewSecondOption"/> - <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveAttribute"/> - <click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="clickOnSelectAll"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnSecondNextButton"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnThirdNextButton"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnFourthNextButton"/> - </actionGroup> - - <actionGroup name="selectCreatedAttributeAndCreateTwoOptions" extends="addNewProductConfigurationAttribute"> - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SelectCreatedAttributeAndCreateTwoOptionsActionGroup` instead --> - <remove keyForRemoval="clickOnNewAttribute"/> - <remove keyForRemoval="waitForIFrame"/> - <remove keyForRemoval="switchToNewAttributeIFrame"/> - <remove keyForRemoval="fillDefaultLabel"/> - <remove keyForRemoval="clickOnNewAttributePanel"/> - <remove keyForRemoval="waitForSaveAttribute"/> - <remove keyForRemoval="switchOutOfIFrame"/> - <remove keyForRemoval="waitForFilters"/> - <fillField userInput="{{attribute.attribute_code}}" selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" stepKey="fillFilterAttributeCodeField"/> - <fillField userInput="{{firstOption.label}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewFirstOption"/> - <fillField userInput="{{secondOption.label}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewSecondOption"/> - <remove keyForRemoval="clickOnSelectAll"/> - <remove keyForRemoval="clickOnSecondNextButton"/> - <remove keyForRemoval="clickOnThirdNextButton"/> - <remove keyForRemoval="clickOnFourthNextButton"/> - </actionGroup> - - <actionGroup name="changeProductConfigurationsInGrid"> - <annotations> - <description>Edit the Product Configuration via the Admin Product grid page.</description> - </annotations> - <arguments> - <argument name="firstOption" type="entity"/> - <argument name="secondOption" type="entity"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ChangeProductConfigurationsInGridActionGroup` instead --> - <fillField userInput="{{firstOption.name}}" selector="{{AdminProductFormConfigurationsSection.confProductNameCell(firstOption.name)}}" stepKey="fillFieldNameForFirstAttributeOption"/> - <fillField userInput="{{secondOption.name}}" selector="{{AdminProductFormConfigurationsSection.confProductNameCell(secondOption.name)}}" stepKey="fillFieldNameForSecondAttributeOption"/> - <fillField userInput="{{firstOption.sku}}" selector="{{AdminProductFormConfigurationsSection.confProductSkuCell(firstOption.name)}}" stepKey="fillFieldSkuForFirstAttributeOption"/> - <fillField userInput="{{secondOption.sku}}" selector="{{AdminProductFormConfigurationsSection.confProductSkuCell(secondOption.name)}}" stepKey="fillFieldSkuForSecondAttributeOption"/> - <fillField userInput="{{firstOption.price}}" selector="{{AdminProductFormConfigurationsSection.confProductPriceCell(firstOption.name)}}" stepKey="fillFieldPriceForFirstAttributeOption"/> - <fillField userInput="{{secondOption.price}}" selector="{{AdminProductFormConfigurationsSection.confProductPriceCell(secondOption.name)}}" stepKey="fillFieldPriceForSecondAttributeOption"/> - <fillField userInput="{{firstOption.quantity}}" selector="{{AdminProductFormConfigurationsSection.confProductQuantityCell(firstOption.name)}}" stepKey="fillFieldQuantityForFirstAttributeOption"/> - <fillField userInput="{{secondOption.quantity}}" selector="{{AdminProductFormConfigurationsSection.confProductQuantityCell(secondOption.name)}}" stepKey="fillFieldQuantityForSecondAttributeOption"/> - <fillField userInput="{{firstOption.weight}}" selector="{{AdminProductFormConfigurationsSection.confProductWeightCell(firstOption.name)}}" stepKey="fillFieldWeightForFirstAttributeOption"/> - <fillField userInput="{{secondOption.weight}}" selector="{{AdminProductFormConfigurationsSection.confProductWeightCell(secondOption.name)}}" stepKey="fillFieldWeightForSecondAttributeOption"/> - </actionGroup> - - <actionGroup name="changeConfigurableProductChildProductPrice"> - <annotations> - <description>Change the price of a configurable child product in the grid under configurations.</description> - </annotations> - <arguments> - <argument name="productAttributes" type="string"/> - <argument name="productPrice" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ChangeConfigurableProductChildProductPriceActionGroup` instead --> - <fillField userInput="{{productPrice}}" selector="{{AdminProductFormConfigurationsSection.confProductPriceCell(productAttributes)}}" stepKey="fillPriceForConfigurableProductAttributeOption"/> - </actionGroup> - - <actionGroup name="changeProductConfigurationsInGridExceptSku" extends="changeProductConfigurationsInGrid"> - <annotations> - <description>EXTENDS: changeProductConfigurationsInGrid. Removes 'fillFieldSkuForFirstAttributeOption' and 'fillFieldSkuForSecondAttributeOption'.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ChangeProductConfigurationsInGridExceptSkuActionGroup` instead --> - <remove keyForRemoval="fillFieldSkuForFirstAttributeOption"/> - <remove keyForRemoval="fillFieldSkuForSecondAttributeOption"/> - </actionGroup> - - <actionGroup name="addProductToConfigurationsGrid"> - <annotations> - <description>Adds the provided Product SKU to the provided Product Name.</description> - </annotations> - <arguments> - <argument name="sku" type="string"/> - <argument name="name" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddProductToConfigurationsGridActionGroup` instead --> - <click selector="{{AdminProductFormConfigurationsSection.actionsBtnByProductName(name)}}" stepKey="clickToExpandFirstActions"/> - <click selector="{{AdminProductFormConfigurationsSection.addProduct(name)}}" stepKey="clickChooseFirstDifferentProduct"/> - <switchToIFrame stepKey="switchOutOfIFrame"/> - <waitForPageLoad stepKey="waitForFilters"/> - <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickFilters"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <click selector="{{AdminProductGridFilterSection.firstRowBySku(sku)}}" stepKey="clickOnFirstRow"/> - </actionGroup> - - <actionGroup name="addUniqueImageToConfigurableProductOption"> - <annotations> - <description>Adds the provided Image to a Configurable Product on the Admin Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="image" defaultValue="ProductImage"/> - <argument name="frontend_label" type="string"/> - <argument name="label" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddUniqueImageToConfigurableProductOptionActionGroup` instead --> - <click selector="{{AdminCreateProductConfigurationsPanel.applyUniqueImagesToEachSkus}}" stepKey="clickOnApplyUniqueImagesToEachSku"/> - <selectOption userInput="{{frontend_label}}" selector="{{AdminCreateProductConfigurationsPanel.selectImagesButton}}" stepKey="selectOption"/> - <attachFile selector="{{AdminCreateProductConfigurationsPanel.uploadImagesButton(label)}}" userInput="{{image.file}}" stepKey="uploadFile"/> - <waitForElementNotVisible selector="{{AdminCreateProductConfigurationsPanel.uploadProgressBar}}" stepKey="waitForUpload"/> - <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.imageFile(image.fileName)}}" stepKey="waitForThumbnail"/> - </actionGroup> - - <actionGroup name="addUniquePriceToConfigurableProductOption"> - <annotations> - <description>On the 'Step 3: Bulk Images, Price and Quantity' page of the 'Create Product Configurations' model click on 'Apply unique prices...'. Select provided Option. Fill price.</description> - </annotations> - <arguments> - <argument name="frontend_label" type="string"/> - <argument name="label" type="string"/> - <argument name="price" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddUniquePriceToConfigurableProductOptionActionGroup` instead --> - <click selector="{{AdminCreateProductConfigurationsPanel.applyUniquePricesToEachSkus}}" stepKey="clickOnApplyUniquePricesToEachSku"/> - <selectOption userInput="{{frontend_label}}" selector="{{AdminCreateProductConfigurationsPanel.selectPriceButton}}" stepKey="selectOption"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.price(label)}}" userInput="{{price}}" stepKey="enterAttributeQuantity"/> - </actionGroup> - - <actionGroup name="addUniqueQuantityToConfigurableProductOption"> - <arguments> - <argument name="frontend_label" type="string" defaultValue="{{productAttributeColor.default_label}}"/> - <argument name="label" type="string" defaultValue="option1"/> - <argument name="quantity" type="string" defaultValue="10"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddUniqueQuantityToConfigurableProductOptionActionGroup` instead --> - <click selector="{{AdminCreateProductConfigurationsPanel.applyUniqueQuantityToEachSkus}}" stepKey="clickOnApplyUniqueQuantitiesToEachSku"/> - <selectOption selector="{{AdminCreateProductConfigurationsPanel.selectQuantity}}" userInput="{{frontend_label}}" stepKey="selectOption"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.applyUniqueQuantity(label)}}" userInput="{{quantity}}" stepKey="enterAttributeQuantity"/> - </actionGroup> - - <actionGroup name="saveConfigurableProductWithNewAttributeSet"> - <annotations> - <description>Clicks on 'Save'. Clicks radio for '...new Attribute Set...' in the 'Choose Affected Attribute Set' modal. Clicks on 'Confirm' in the model on the Configurable Product creation/edit page.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SaveConfigurableProductWithNewAttributeSetActionGroup` instead --> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveConfigurableProduct"/> - <waitForElementVisible selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" time="30" stepKey="waitForAttributeSetConfirmation"/> - <click selector="{{AdminChooseAffectedAttributeSetPopup.addNewAttrSet}}" stepKey="clickAddNewAttributeSet"/> - <fillField selector="{{AdminChooseAffectedAttributeSetPopup.createNewAttrSetName}}" userInput="{{ProductAttributeFrontendLabel.label}}" stepKey="fillFieldNewAttrSetName"/> - <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickConfirmAttributeSet"/> - <see selector="You saved the product" stepKey="seeConfigurableSaveConfirmation" after="clickConfirmAttributeSet"/> - </actionGroup> - - <actionGroup name="saveConfigurableProductAddToCurrentAttributeSet"> - <annotations> - <description>Clicks on 'Save'. Clicks on 'Confirm' in the 'Choose Affected Attribute Set' model on the Configurable Product creation/edit page.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SaveConfigurableProductAddToCurrentAttributeSetActionGroup` instead --> - <waitForElementVisible selector="{{AdminProductFormActionSection.saveButton}}" stepKey="waitForSaveBtnVisible"/> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProductAgain"/> - <waitForElementVisible selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="waitPopUpVisible"/> - <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmPopup"/> - <seeElement selector="{{AdminMessagesSection.success}}" stepKey="seeSaveProductMessage"/> - </actionGroup> - - <actionGroup name="assertConfigurableProductOnAdminProductPage"> - <annotations> - <description>Validates that the provided Configurable Product Name, SKU and Price are present and correct on the Configurable Product creation/edit page. PLEASE NOTE: The Product Data is Hardcoded.</description> - </annotations> - <arguments> - <argument name="product" type="entity"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertConfigurableProductOnAdminProductPageActionGroup` instead --> - <seeInField userInput="{{ApiConfigurableProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="seeNameRequired"/> - <seeInField userInput="{{ApiConfigurableProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="seeSkuRequired"/> - <dontSeeInField userInput="{{ApiConfigurableProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="dontSeePriceRequired"/> - </actionGroup> - - <actionGroup name="StartCreateConfigurationsForAttribute" extends="generateConfigurationsByAttributeCode"> - <remove keyForRemoval="clickOnNextButton3"/> - <remove keyForRemoval="clickOnNextButton4"/> - </actionGroup> - - <actionGroup name="GotoCatalogProductsPage"> - <annotations> - <description>Goes to the Admin Products grid via the Admin Side Menu.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `GotoCatalogProductsPageActionGroup` instead --> - <click stepKey="clickOnCatalogItem" selector="{{CatalogProductsSection.catalogItem}}"/> - <waitForPageLoad stepKey="waitForCatalogLoad"/> - <click stepKey="clickOnProductItem" selector="{{CatalogProductsSection.productItem}}"/> - <waitForPageLoad stepKey="waitForCatalogProductPageLoad"/> - <seeInCurrentUrl stepKey="assertWeAreOnTheCatalogProductPage" url="{{assertionData.catalogProduct}}"/> - </actionGroup> - - <actionGroup name="GotoConfigurableProductPage"> - <annotations> - <description>Clicks on create Configurable Product from the Admin Products grid page.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `GotoConfigurableProductPageActionGroup` instead --> - <click stepKey="clickOnAddProductItem" selector="{{ConfigurableProductSection.addProductItem}}"/> - <click stepKey="clickOnConfigurationProductItem" selector="{{ConfigurableProductSection.configProductItem}}"/> - <waitForPageLoad stepKey="waitForConfigurableProductPageLoad"/> - <seeInCurrentUrl stepKey="assertWeAreOnTheConfigurableProductPage" url="{{assertionData.configurableProduct}}"/> - </actionGroup> - - <actionGroup name="FillAllRequiredFields"> - <annotations> - <description>Fills the Product Name, Price and Weight fields. Clicks on 'Create Configurations'. Clicks on 'Create New Attribute'.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FillAllRequiredFieldsActionGroup` instead --> - <fillField stepKey="fillInProductNameFields" selector="{{NewProduct.productName}}" userInput="{{NewProductsData.productName}}"/> - <fillField stepKey="fillInPriceFields" selector="{{NewProduct.price}}" userInput="{{NewProductsData.price}}"/> - <fillField stepKey="fillInWeightFields" selector="{{NewProduct.weight}}" userInput="{{NewProductsData.weight}}"/> - <click stepKey="clickOnCreateConfigurationsButton" selector="{{NewProduct.createConfigurationButton}}"/> - <waitForPageLoad stepKey="waitForCreateProductConfigurationsPageLoad"/> - <click stepKey="clickOnCreateNewAttributeButton" selector="{{NewProduct.createNewAttributeButton}}"/> - <waitForPageLoad stepKey="waitForNewAttributePageLoad"/> - </actionGroup> - - <actionGroup name="CreateNewAttribute"> - <annotations> - <description>Creates a new Product Attribute via the Admin Products creation/edit page. PLEASE NOTE: The Product Attributes are Hardcoded.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateNewAttributeActionGroup` instead --> - <switchToIFrame stepKey="NewAttributePage" selector="{{NewProduct.newAttributeIFrame}}"/> - <fillField stepKey="fillInDefaultLabelField" selector="{{NewProduct.defaultLabel}}" userInput="{{NewProductsData.defaultLabel}}"/> - - <!--Add option 1 to attribute--> - <click selector="{{NewProduct.addOptionButton}}" stepKey="clickAddOption1"/> - <waitForPageLoad stepKey="waitForOption1"/> - <fillField stepKey="fillInAdminFieldRed" selector="{{NewProduct.adminFieldRed}}" userInput="{{NewProductsData.adminFieldRed}}"/> - <fillField stepKey="fillInDefaultStoreViewFieldRed" selector="{{NewProduct.defaultStoreViewFieldRed}}" userInput="{{NewProductsData.defaultStoreViewFieldRed}}"/> - - <!--Add option 2 to attribute--> - <click selector="{{NewProduct.addOptionButton}}" stepKey="clickAddOption2"/> - <waitForPageLoad stepKey="waitForOption2"/> - <fillField stepKey="fillInAdminFieldBlue" selector="{{NewProduct.adminFieldBlue}}" userInput="{{NewProductsData.adminFieldBlue}}"/> - <fillField stepKey="fillInDefaultStoreViewFieldBlue" selector="{{NewProduct.defaultStoreViewFieldBlue}}" userInput="{{NewProductsData.defaultStoreViewFieldBlue}}"/> - - <!--Add option 3 to attribute--> - <click selector="{{NewProduct.addOptionButton}}" stepKey="clickAddOption3"/> - <waitForPageLoad stepKey="waitForOption3"/> - <fillField stepKey="fillInAdminFieldYellow" selector="{{NewProduct.adminFieldYellow}}" userInput="{{NewProductsData.adminFieldYellow}}"/> - <fillField stepKey="fillInDefaultStoreViewFieldYellow" selector="{{NewProduct.defaultStoreViewFieldYellow}}" userInput="{{NewProductsData.defaultStoreViewFieldYellow}}"/> - - <!--Add option 4 to attribute--> - <click selector="{{NewProduct.addOptionButton}}" stepKey="clickAddOption4"/> - <waitForPageLoad stepKey="waitForOption4"/> - <fillField stepKey="fillInAdminFieldGreen" selector="{{NewProduct.adminFieldGreen}}" userInput="{{NewProductsData.adminFieldGreen}}"/> - <fillField stepKey="fillInDefaultStoreViewFieldGreen" selector="{{NewProduct.defaultStoreViewFieldGreen}}" userInput="{{NewProductsData.defaultStoreViewFieldGreen}}"/> - - <!--Add option 5 to attribute--> - <click selector="{{NewProduct.addOptionButton}}" stepKey="clickAddOption5"/> - <waitForPageLoad stepKey="waitForOption5"/> - <fillField stepKey="fillInAdminFieldBlack" selector="{{NewProduct.adminFieldBlack}}" userInput="{{NewProductsData.adminFieldBlack}}"/> - <fillField stepKey="fillInDefaultStoreViewFieldBlack" selector="{{NewProduct.defaultStoreViewFieldBlack}}" userInput="{{NewProductsData.defaultStoreViewFieldBlack}}"/> - - <!--Click Save Attribute button--> - <click selector="{{NewProduct.saveAttributeButton}}" stepKey="clickSaveAttributeButton"/> - <waitForPageLoad stepKey="waitForSavingSettings"/> - - <!--Select created Attribute --> - <click selector="{{ConfigurableProductSection.selectCreatedAttribute}}" stepKey="selectCreatedAttribute"/> - - <!--Click Next button--> - <click selector="{{ConfigurableProductSection.nextButton}}" stepKey="clickNextButton"/> - <waitForPageLoad stepKey="waitForNextPageLoaded"/> - - <!--Select all the options of all the attributes button--> - <click selector="{{CreateProductConfigurations.checkboxRed}}" stepKey="selectCheckboxRed"/> - <click selector="{{CreateProductConfigurations.checkboxBlue}}" stepKey="selectCheckboxBlue"/> - <click selector="{{CreateProductConfigurations.checkboxYellow}}" stepKey="selectCheckboxYellow"/> - <click selector="{{CreateProductConfigurations.checkboxGreen}}" stepKey="selectCheckboxGreen"/> - <click selector="{{CreateProductConfigurations.checkboxBlack}}" stepKey="selectCheckboxBlack"/> - - <!--Click Next button--> - <click selector="{{ConfigurableProductSection.nextButton}}" stepKey="clickNextButton2"/> - <waitForPageLoad stepKey="waitForBulkImagesPricePageLoaded"/> - - <!--Click Next button--> - <click selector="{{ConfigurableProductSection.nextButton}}" stepKey="clickNextButton3"/> - <waitForPageLoad stepKey="waitForSummaryPageLoaded"/> - - <!--Click Generate Configure button--> - <click selector="{{ConfigurableProductSection.generateConfigure}}" stepKey="generateConfigure"/> - <waitForPageLoad stepKey="waitForGenerateConfigure"/> - - <!-- This Error message shouldn't appear: Test will pass when bug will be fixed--> - <dontSee selector="{{CreateProductConfigurations.errorMessage}}" userInput="{{assertionData.errorMessage}}" stepKey="dontSeeError"/> - - <!--Close frame--> - <conditionalClick selector="{{ConfigurableProductSection.closeFrame}}" dependentSelector="{{ConfigurableProductSection.closeFrame}}" visible="1" stepKey="closeFrame"/> - <waitForPageLoad stepKey="waitForClosingFrame"/> - </actionGroup> - - <actionGroup name="DeleteCreatedAttribute"> - <annotations> - <description>Deletes the Configurable Product Attribute.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `DeleteCreatedAttributeActionGroup` instead --> - <click stepKey="clickOnStoresItem" selector="{{CatalogProductsSection.storesItem}}"/> - <waitForPageLoad stepKey="waitForNavigationPanel"/> - - <!--Click on Products item--> - <waitForElementVisible selector="{{CatalogProductsSection.storesProductItem}}" stepKey="waitForCatalogLoad"/> - <click stepKey="clickOnStoresProductItem" selector="{{CatalogProductsSection.storesProductItem}}"/> - <waitForPageLoad stepKey="waitForStoresProductPageLoad"/> - - <!--Click on created Attribute --> - <fillField stepKey="searchProductDefaultLabel" selector="{{CatalogProductsSection.searchDefaultLabelField}}" userInput="{{NewProductsData.defaultLabel}}"/> - <click stepKey="clickSearchButton" selector="{{CatalogProductsSection.searchButton}}"/> - <waitForPageLoad stepKey="waitForCreatedAttributeLoad"/> - <click stepKey="clickOnCreatedAttributeItem" selector="{{CatalogProductsSection.createdAttributeItem}}"/> - <waitForPageLoad stepKey="waitForAttributePropertiesPageLoad"/> - - <!--Click on Delete Attribute item--> - <click stepKey="clickOnDeleteAttributeItem" selector="{{CatalogProductsSection.deleteAttributeItem}}"/> - <waitForPageLoad stepKey="waitForDeletedDialogOpened"/> - - <!--Click on OK button--> - <click stepKey="clickOnOKButton" selector="{{CatalogProductsSection.okButton}}"/> - <waitForPageLoad stepKey="waitFordAttributeDeleted"/> - <see userInput="You deleted the product attribute." stepKey="seeDeletedTheProductAttributeMessage"/> - - <!-- Click Reset Filter button--> - <click stepKey="clickResetFilterButton" selector="{{CatalogProductsSection.resetFilter}}"/> - <waitForPageLoad stepKey="waitForAllFilterReset"/> - </actionGroup> - - <actionGroup name="StorefrontCheckCategoryConfigurableProduct"> - <annotations> - <description>Validates that the provided Configurable Product is present and correct on a Category page.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="optionProduct"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCheckCategoryConfigurableProductActionGroup` instead --> - <seeElement selector="{{StorefrontCategoryProductSection.ProductTitleByName(product.name)}}" stepKey="assertProductName"/> - <see userInput="${{optionProduct.price}}.00" selector="{{StorefrontCategoryProductSection.ProductPriceByName(product.name)}}" stepKey="AssertProductPrice"/> - <!-- @TODO: MAGETWO-80272 Move to Magento_Checkout --> - <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct"/> - <!-- @TODO: MAGETWO-80272 Move to Magento_Checkout --> - <seeElement selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="AssertAddToCart"/> - </actionGroup> - - <actionGroup name="StorefrontCheckCategoryOutOfStockConfigurableProduct"> - <annotations> - <description>Validates that the provided Configurable Product is present and correct on a Category page.</description> - </annotations> - <arguments> - <argument name="product" type="entity"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCheckCategoryOutOfStockConfigurableProductActionGroup` instead --> - <seeElement selector="{{StorefrontCategoryProductSection.ProductTitleByName(product.name)}}" stepKey="assertProductName"/> - <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct"/> - <seeElement selector="{{StorefrontCategoryProductSection.ProductStockUnavailable}}" stepKey="AssertOutOfStock"/> - <dontSeeElement selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="AssertAddToCart"/> - </actionGroup> - - <actionGroup name="StorefrontCheckConfigurableProduct"> - <annotations> - <description>Goes to the provided Storefront Product page. Validates that the Product details are present and correct.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="optionProduct"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCheckConfigurableProductActionGroup` instead --> - <seeInCurrentUrl url="/{{product.custom_attributes[url_key]}}.html" stepKey="checkUrl"/> - <seeInTitle userInput="{{product.name}}" stepKey="AssertProductNameInTitle"/> - <see userInput="{{product.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertProductName"/> - <see userInput="{{product.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="assertProductSku"/> - <see userInput="${{optionProduct.price}}.00" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="assertProductPrice"/> - <see userInput="IN STOCK" selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="assertInStock"/> - <seeElement selector="{{StorefrontProductInfoMainSection.AddToCart}}" stepKey="assertAddToCart"/> - <see userInput="{{product.custom_attributes[description]}}" selector="{{StorefrontProductInfoMainSection.productDescription}}" stepKey="assertProductDescription"/> - <see userInput="{{product.custom_attributes[short_description]}}" selector="{{StorefrontProductInfoMainSection.productShortDescription}}" stepKey="assertProductShortDescription"/> - </actionGroup> - - <actionGroup name="VerifyOptionInProductStorefront"> - <annotations> - <description>Validates that the provided Option Code and Option Name are present and correct on a Configurable Product page.</description> - </annotations> - <arguments> - <argument name="attributeCode" type="string"/> - <argument name="optionName" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `VerifyOptionInProductStorefrontActionGroup` instead --> - <seeElement selector="{{StorefrontProductInfoMainSection.attributeOptionByAttributeID(attributeCode, optionName)}}" stepKey="verifyOptionExists"/> - </actionGroup> - - <actionGroup name="SelectSingleAttributeAndAddToCart"> - <annotations> - <description>Selects a Product Option. Clicks 'Add to Cart'. Validates that the Product Added Success message appears.</description> - </annotations> - <arguments> - <argument name="productName" type="string"/> - <argument name="attributeCode" type="string"/> - <argument name="optionName" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SelectSingleAttributeAndAddToCartActionGroup` instead --> - <selectOption selector="{{StorefrontProductInfoMainSection.attributeSelectByAttributeID(attributeCode)}}" userInput="{{optionName}}" stepKey="selectAttribute"/> - <click stepKey="addProduct" selector="{{StorefrontProductActionSection.addToCart}}"/> - <waitForElementVisible selector="{{StorefrontQuickSearchResultsSection.messageSection}}" time="30" stepKey="waitForProductAdded"/> - <see selector="{{StorefrontQuickSearchResultsSection.messageSection}}" userInput="You added {{productName}} to your shopping cart." stepKey="seeAddedToCartMessage"/> - </actionGroup> - - <actionGroup name="storefrontCheckConfigurableProductOptions"> - <annotations> - <description>Validates that the Options for a Configurable Product are present and correct.</description> - </annotations> - <arguments> - <argument name="product" type="entity"/> - <argument name="firstOption" type="entity"/> - <argument name="secondOption" type="entity"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCheckConfigurableProductOptionsActionGroup` instead --> - <selectOption userInput="{{firstOption.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption1"/> - <see userInput="{{product.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="seeConfigurableProductName"/> - <see userInput="{{firstOption.price}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="assertProductPricePresent"/> - <see userInput="{{product.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="seeConfigurableProductSku"/> - <see userInput="IN STOCK" selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="assertInStock"/> - <see userInput="{{colorProductAttribute.default_label}}" selector="{{StorefrontProductInfoMainSection.productAttributeTitle1}}" stepKey="seeColorAttributeName"/> - <dontSee userInput="As low as" selector="{{StorefrontProductInfoMainSection.productPriceLabel}}" stepKey="dontSeeProductPriceLabel1"/> - <selectOption userInput="{{secondOption.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption2"/> - <dontSee userInput="As low as" selector="{{StorefrontProductInfoMainSection.productPriceLabel}}" stepKey="dontSeeProductPriceLabel2"/> - <see userInput="{{secondOption.price}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="seeProductPrice2"/> - </actionGroup> - - <actionGroup name="assertOptionImageInStorefrontProductPage"> - <annotations> - <description>Validates that the provided Product Image is present when the provided Product Option is selected.</description> - </annotations> - <arguments> - <argument name="product" type="entity"/> - <argument name="label" type="string"/> - <argument name="image" defaultValue="MagentoLogo"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertOptionImageInStorefrontProductPageActionGroup` instead --> - <seeInCurrentUrl url="/{{product.urlKey}}.html" stepKey="checkUrl"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <selectOption userInput="{{label}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption1"/> - <seeElement selector="{{StorefrontProductMediaSection.imageFile(image.filename)}}" stepKey="seeFirstImage"/> - </actionGroup> - - <actionGroup name="assertConfigurableProductWithSpecialPriceOnStorefrontProductPage"> - <annotations> - <description>Validates that Special Price for a Configurable Product is present and correct when the provided Product Option is selected.</description> - </annotations> - <arguments> - <argument name="option" type="string"/> - <argument name="price" type="string"/> - <argument name="specialPrice" defaultValue="specialProductPrice"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertConfigurableProductWithSpecialPriceOnStorefrontProductPageActionGroup` instead --> - <selectOption userInput="{{option}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOptionWithSpecialPrice"/> - <see userInput="{{specialProductPrice.price}}" selector="{{StorefrontProductInfoMainSection.productSpecialPrice}}" stepKey="seeSpecialProductPrice"/> - <see userInput="Regular Price" selector="{{StorefrontProductInfoMainSection.specialProductText}}" stepKey="seeText"/> - <see userInput="{{price}}" selector="{{StorefrontProductInfoMainSection.oldProductPrice}}" stepKey="seeOldProductPrice"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index 0bb23b04b66a9..0000000000000 --- a/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,27 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - - <actionGroup name="StorefrontSwitchCurrency"> - <arguments> - <argument name="currency" type="string" defaultValue="EUR"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontSwitchCurrencyActionGroup` instead --> - <click selector="{{StorefrontSwitchCurrencyRatesSection.currencyTrigger}}" stepKey="openTrigger"/> - <waitForElementVisible selector="{{StorefrontSwitchCurrencyRatesSection.currency(currency)}}" stepKey="waitForCurrency"/> - <click selector="{{StorefrontSwitchCurrencyRatesSection.currency(currency)}}" stepKey="chooseCurrency"/> - <see selector="{{StorefrontSwitchCurrencyRatesSection.selectedCurrency}}" userInput="{{currency}}" stepKey="seeSelectedCurrency"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index 9d739995e99e6..0000000000000 --- a/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,106 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="fillMainDownloadableProductForm"> - <annotations> - <description>Fills the Name, SKU, Price and Quantity on the Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="product" defaultValue="DownloadableProduct"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FillMainDownloadableProductFormActionGroup` instead --> - <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductSku"/> - <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductName"/> - <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{product.price}}" stepKey="fillProductPrice"/> - <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{product.quantity}}" stepKey="fillProductQty"/> - </actionGroup> - - <actionGroup name="addDownloadableProductLinkWithMaxDownloads"> - <annotations> - <description>Clicks on 'Add Link'. Fills in the provided Link details including a Max Downloads limit.</description> - </annotations> - <arguments> - <argument name="link" defaultValue="downloadableLinkWithMaxDownloads"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddDownloadableProductLinkWithMaxDownloadsActionGroup` instead --> - <click selector="{{AdminProductDownloadableSection.linksAddLinkButton}}" stepKey="clickLinkAddLinkButton"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <fillField userInput="{{link.title}}" selector="{{AdminProductDownloadableSection.addLinkTitleInput('0')}}" stepKey="fillDownloadableLinkTitle"/> - <fillField userInput="{{link.price}}" selector="{{AdminProductDownloadableSection.addLinkPriceInput('0')}}" stepKey="fillDownloadableLinkPrice"/> - <selectOption userInput="{{link.file_type}}" selector="{{AdminProductDownloadableSection.addLinkFileTypeSelector('0')}}" stepKey="selectDownloadableLinkFileType"/> - <selectOption userInput="{{link.sample_type}}" selector="{{AdminProductDownloadableSection.addLinkSampleTypeSelector('0')}}" stepKey="selectDownloadableLinkSampleType"/> - <selectOption userInput="{{link.shareable}}" selector="{{AdminProductDownloadableSection.addLinkShareableSelector('0')}}" stepKey="selectDownloadableLinkShareable"/> - <fillField userInput="{{link.max_downloads}}" selector="{{AdminProductDownloadableSection.addLinkMaxDownloadsInput('0')}}" stepKey="fillDownloadableLinkMaxDownloads"/> - <attachFile userInput="{{link.file}}" selector="{{AdminProductDownloadableSection.addLinkFileUploadFile('0')}}" stepKey="fillDownloadableLinkUploadFile"/> - <fillField userInput="{{link.sample}}" selector="{{AdminProductDownloadableSection.addLinkSampleUrlInput('0')}}" stepKey="fillDownloadableLinkSampleUrl"/> - </actionGroup> - - <actionGroup name="addDownloadableProductLink"> - <annotations> - <description>Clicks on 'Add Link', under the 'Links' section. Fills in the provided Link details including Unlimited Downloads.</description> - </annotations> - <arguments> - <argument name="link" defaultValue="downloadableLink"/> - <argument name="index" type="string" defaultValue="1"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddDownloadableProductLinkActionGroup` instead --> - <click selector="{{AdminProductDownloadableSection.linksAddLinkButton}}" stepKey="clickLinkAddLinkButton"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <fillField userInput="{{link.title}}" selector="{{AdminProductDownloadableSection.addLinkTitleInput(index)}}" stepKey="fillDownloadableLinkTitle"/> - <fillField userInput="{{link.price}}" selector="{{AdminProductDownloadableSection.addLinkPriceInput(index)}}" stepKey="fillDownloadableLinkPrice"/> - <selectOption userInput="{{link.file_type}}" selector="{{AdminProductDownloadableSection.addLinkFileTypeSelector(index)}}" stepKey="selectDownloadableLinkFileType"/> - <selectOption userInput="{{link.sample_type}}" selector="{{AdminProductDownloadableSection.addLinkSampleTypeSelector(index)}}" stepKey="selectDownloadableLinkSampleType"/> - <selectOption userInput="{{link.shareable}}" selector="{{AdminProductDownloadableSection.addLinkShareableSelector(index)}}" stepKey="selectDownloadableLinkShareable"/> - <checkOption selector="{{AdminProductDownloadableSection.addLinkIsUnlimitedDownloads(index)}}" stepKey="checkDownloadableLinkUnlimited"/> - <fillField userInput="{{link.file}}" selector="{{AdminProductDownloadableSection.addLinkFileUrlInput(index)}}" stepKey="fillDownloadableLinkFileUrl"/> - <attachFile userInput="{{link.sample}}" selector="{{AdminProductDownloadableSection.addLinkSampleUploadFile(index)}}" stepKey="attachDownloadableLinkUploadSample"/> - <waitForPageLoad stepKey="waitForPageLoadAfterFillingOutForm" /> - </actionGroup> - - <actionGroup name="addDownloadableSampleFile"> - <annotations> - <description>Clicks on 'Add Link' under the 'Samples' section. Fills in the provided Downloadable Sample File details.</description> - </annotations> - <arguments> - <argument name="sample" defaultValue="downloadableSampleFile"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddDownloadableSampleFileActionGroup` instead --> - <click selector="{{AdminProductDownloadableSection.samplesAddLinkButton}}" stepKey="clickSampleAddLinkButton"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <fillField userInput="{{sample.title}}" selector="{{AdminProductDownloadableSection.addSampleTitleInput('0')}}" stepKey="fillDownloadableSampleTitle"/> - <selectOption userInput="{{sample.file_type}}" selector="{{AdminProductDownloadableSection.addSampleFileTypeSelector('0')}}" stepKey="selectDownloadableSampleFileType"/> - <attachFile userInput="{{sample.file}}" selector="{{AdminProductDownloadableSection.addSampleFileUploadFile('0')}}" stepKey="selectDownloadableSampleUpload"/> - <waitForAjaxLoad stepKey="waitForSampleFileUpload"/> - </actionGroup> - - <actionGroup name="addDownloadableSampleUrl"> - <annotations> - <description>Clicks on 'Add Link' under the 'Samples' section. Fills in the provided Downloadable Sample URL details.</description> - </annotations> - <arguments> - <argument name="sample" defaultValue="downloadableSampleUrl"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddDownloadableSampleUrlActionGroup` instead --> - <click selector="{{AdminProductDownloadableSection.samplesAddLinkButton}}" stepKey="clickSampleAddLinkButton2"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <fillField userInput="{{sample.title}}" selector="{{AdminProductDownloadableSection.addSampleTitleInput('1')}}" stepKey="fillDownloadableSampleTitle"/> - <selectOption userInput="{{sample.file_type}}" selector="{{AdminProductDownloadableSection.addSampleFileTypeSelector('1')}}" stepKey="selectDownloadableSampleFileType"/> - <fillField userInput="{{sample.file}}" selector="{{AdminProductDownloadableSection.addSampleFileUrlInput('1')}}" stepKey="fillDownloadableSampleFileUrl"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Email/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Email/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index 855ec8790f8f2..0000000000000 --- a/app/code/Magento/Email/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,90 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="CreateNewTemplate"> - <annotations> - <description>Clicks on Add New Template. Fills the Template details. Clicks on Save. PLEASE NOTE: The values are Hardcoded.</description> - </annotations> - <arguments> - <argument name="template" defaultValue="EmailTemplate"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateNewTemplateActionGroup` instead --> - <amOnPage url="{{AdminEmailTemplateIndexPage.url}}" stepKey="navigateToEmailTemplatePage"/> - <click selector="{{AdminMainActionsSection.add}}" stepKey="clickAddNewTemplateButton"/> - <selectOption selector="{{AdminEmailTemplateEditSection.templateDropDown}}" userInput="Registry Update" stepKey="selectValueFromTemplateDropDown"/> - <click selector="{{AdminEmailTemplateEditSection.loadTemplateButton}}" stepKey="clickLoadTemplateButton"/> - <fillField selector="{{AdminEmailTemplateEditSection.templateCode}}" userInput="{{EmailTemplate.templateName}}" stepKey="fillTemplateNameField"/> - <click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveTemplateButton"/> - <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You saved the email template." stepKey="seeSuccessMessage"/> - </actionGroup> - - <actionGroup name="CreateCustomTemplate" extends="CreateNewTemplate"> - <remove keyForRemoval="selectValueFromTemplateDropDown"/> - <remove keyForRemoval="clickLoadTemplateButton"/> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateCustomTemplateActionGroup` instead --> - <fillField selector="{{AdminEmailTemplateEditSection.templateSubject}}" userInput="{{template.templateSubject}}" after="fillTemplateNameField" stepKey="fillTemplateSubject"/> - <fillField selector="{{AdminEmailTemplateEditSection.templateText}}" userInput="{{template.templateText}}" after="fillTemplateSubject" stepKey="fillTemplateText"/> - </actionGroup> - - <actionGroup name="FindAndOpenEmailTemplate"> - <arguments> - <argument name="template" defaultValue="EmailTemplate"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FindAndOpenEmailTemplateActionGroup` instead --> - <amOnPage url="{{AdminEmailTemplateIndexPage.url}}" stepKey="navigateEmailTemplatePage" /> - <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clearFilters"/> - <fillField selector="{{AdminEmailTemplateIndexSection.searchTemplateField}}" userInput="{{template.templateName}}" stepKey="findCreatedTemplate"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearch"/> - <waitForElementVisible selector="{{AdminEmailTemplateIndexSection.templateRowByName(template.templateName)}}" stepKey="waitForTemplatesAppeared"/> - <click selector="{{AdminEmailTemplateIndexSection.templateRowByName(template.templateName)}}" stepKey="clickToOpenTemplate"/> - <waitForElementVisible selector="{{AdminEmailTemplateEditSection.templateCode}}" stepKey="waitForTemplateNameisible"/> - <seeInField selector="{{AdminEmailTemplateEditSection.templateCode}}" userInput="{{template.templateName}}" stepKey="checkTemplateName"/> - </actionGroup> - - <actionGroup name="DeleteEmailTemplate" extends="FindAndOpenEmailTemplate"> - <annotations> - <description>Clicks on Delete Template. Accepts the Popup. Validates that the Email Template is NOT present in the Email Templates Grid.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `DeleteEmailTemplateActionGroup` instead --> - <click selector="{{AdminEmailTemplateEditSection.deleteTemplateButton}}" after="checkTemplateName" stepKey="deleteTemplate"/> - <waitForElementVisible selector="{{AdminEmailTemplateEditSection.acceptPopupButton}}" after="deleteTemplate" stepKey="waitForConfirmButton"/> - <click selector="{{AdminEmailTemplateEditSection.acceptPopupButton}}" after="waitForConfirmButton" stepKey="acceptPopup"/> - <waitForElementVisible selector="{{AdminMessagesSection.success}}" after="acceptPopup" stepKey="waitForSuccessMessage"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You deleted the email template." after="waitForSuccessMessage" stepKey="seeSuccessfulMessage"/> - </actionGroup> - - <actionGroup name="PreviewEmailTemplateActionGroup" extends="FindAndOpenEmailTemplate"> - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateSystemBackupActionGroup` instead --> - <click selector="{{AdminEmailTemplateEditSection.previewTemplateButton}}" after="checkTemplateName" stepKey="clickPreviewTemplate"/> - <switchToNextTab after="clickPreviewTemplate" stepKey="switchToNewOpenedTab"/> - <seeInCurrentUrl url="{{AdminEmailTemplatePreviewPage.url}}" after="switchToNewOpenedTab" stepKey="seeCurrentUrl"/> - <seeElement selector="{{AdminEmailTemplatePreviewSection.iframe}}" after="seeCurrentUrl" stepKey="seeIframeOnPage"/> - <switchToIFrame userInput="preview_iframe" after="seeIframeOnPage" stepKey="switchToIframe"/> - <waitForPageLoad after="switchToIframe" stepKey="waitForPageLoaded"/> - </actionGroup> - - <actionGroup name="AssertEmailTemplateContent"> - <arguments> - <argument name="expectedContent" type="string" defaultValue="{{EmailTemplate.templateText}}"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertEmailTemplateContentActionGroup` instead --> - <see userInput="{{expectedContent}}" stepKey="checkTemplateContainText"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index 6da85827f77ec..0000000000000 --- a/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,96 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="checkRequiredFieldsInGroupedProductForm"> - <annotations> - <description>Clears the Product Name and SKU fields when adding a Grouped Product and then verifies that they are required after attempting to Save.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CheckRequiredFieldsInGroupedProductFormActionGroup` instead --> - <clearField selector="{{AdminProductFormSection.productName}}" stepKey="clearProductSku"/> - <clearField selector="{{AdminProductFormSection.productSku}}" stepKey="clearProductName"/> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Product" stepKey="seeStillOnEditPage"/> - <see selector="{{AdminProductFormSection.fieldError('name')}}" userInput="This is a required field." stepKey="seeNameRequired"/> - <see selector="{{AdminProductFormSection.fieldError('sku')}}" userInput="This is a required field." stepKey="seeSkuRequired"/> - </actionGroup> - - <!--Fill main fields in grouped product form--> - <actionGroup name="fillGroupedProductForm"> - <annotations> - <description>Fills in the provided Product Name and SKU on the Grouped Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="product" defaultValue="GroupedProduct"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FillGroupedProductFormActionGroup` instead --> - <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductSku"/> - <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductName"/> - </actionGroup> - - <actionGroup name="viewGroupedProductInAdminGrid"> - <annotations> - <description>Goes to the Admin Products grid page. Filters the grid for the provided Product. Validates that the provided Product appears in the grid.</description> - </annotations> - <arguments> - <argument name="product" defaultValue="GroupedProduct"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ViewGroupedProductInAdminGridActionGroup` instead --> - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> - <waitForPageLoad stepKey="waitForPageLoadInitial"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{product.name}}" stepKey="fillProductNameFilter"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> - <selectOption selector="{{AdminProductGridFilterSection.typeFilter}}" userInput="{{product.type_id}}" stepKey="selectionProductType"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.name}}" stepKey="seeProductNameInGrid"/> - <click selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="clickClearFiltersAfter"/> - </actionGroup> - - <actionGroup name="fillDefaultQuantityForLinkedToGroupProductInGrid"> - <annotations> - <description>Fills the provided Qty for a Product linked to a Grouped Product.</description> - </annotations> - <arguments> - <argument name="productName" type="string"/> - <argument name="qty" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FillDefaultQuantityForLinkedToGroupProductInGridActionGroup` instead --> - <fillField selector="{{AdminAddedProductsToGroupGrid.inputByProductName(productName)}}" userInput="{{qty}}" stepKey="fillDefaultQtyForLinkedProduct"/> - </actionGroup> - - <actionGroup name="AdminAssignProductToGroup"> - <annotations> - <description>Adds the provided Product to a Grouped Product on an Admin Grouped Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminAssignProductToGroupActionGroup` instead --> - <scrollTo selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" x="0" y="-100" stepKey="scrollToGroupedSection"/> - <conditionalClick selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" dependentSelector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" visible="false" stepKey="openGroupedProductsSection"/> - <click selector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" stepKey="clickAddProductsToGroup"/> - <conditionalClick selector="{{AdminAddProductsToGroupPanel.clearFilters}}" dependentSelector="{{AdminAddProductsToGroupPanel.clearFilters}}" visible="true" stepKey="clearExistingFilters"/> - <click selector="{{AdminAddProductsToGroupPanel.filters}}" stepKey="showFiltersPanel"/> - <fillField userInput="{{product.name}}" selector="{{AdminAddProductsToGroupPanel.nameFilter}}" stepKey="fillNameFilter"/> - <click selector="{{AdminAddProductsToGroupPanel.applyFilters}}" stepKey="clickApplyFilters"/> - <click selector="{{AdminAddProductsToGroupPanel.firstCheckbox}}" stepKey="selectProduct"/> - <click selector="{{AdminAddProductsToGroupPanel.addSelectedProducts}}" stepKey="clickAddSelectedGroupProducts"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index 41d8803a253f9..0000000000000 --- a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="StorefrontGoCheckoutWithMultipleAddresses"> - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontGoCheckoutWithMultipleAddressesActionGroup` instead --> - <click selector="{{MultishippingSection.shippingMultipleCheckout}}" stepKey="clickToMultipleAddressShippingButton"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index c3f29feb63b8d..0000000000000 --- a/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,39 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="StorefrontCreateNewAccountNewsletterChecked" extends="SignUpNewUserFromStorefrontActionGroup"> - <annotations> - <description>EXTENDS: SignUpNewUserFromStorefrontActionGroup. Clicks on 'Sign Up for Newsletter'. Validates that the Subscription Confirmation message is present and correct.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCreateNewAccountNewsletterCheckedActionGroup` instead --> - <click selector="{{StorefrontCustomerCreateFormSection.signUpForNewsletter}}" stepKey="selectSignUpForNewsletterCheckbox" after="fillLastName"/> - <see stepKey="seeDescriptionNewsletter" userInput='You are subscribed to "General Subscription".' selector="{{CustomerMyAccountPage.DescriptionNewsletter}}"/> - </actionGroup> - - <actionGroup name="StorefrontCreateNewAccountNewsletterUnchecked" extends="SignUpNewUserFromStorefrontActionGroup"> - <annotations> - <description>EXTENDS: SignUpNewUserFromStorefrontActionGroup. Validates that the you are NOT subscribed message is present and correct.</description> - </annotations> - <arguments> - <argument name="Customer"/> - <argument name="Store"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCreateNewAccountNewsletterUncheckedActionGroup` instead --> - <amOnPage stepKey="amOnStorefrontPage" url="{{Store.code}}"/> - <see stepKey="seeDescriptionNewsletter" userInput="You aren't subscribed to our newsletter." selector="{{CustomerMyAccountPage.DescriptionNewsletter}}"/> - <see stepKey="seeThankYouMessage" userInput="Thank you for registering with NewStore."/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/PageCache/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/PageCache/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index 65e8a0604f505..0000000000000 --- a/app/code/Magento/PageCache/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="clearPageCache"> - <annotations> - <description>Goes to the Admin Cache Management page. Selects 'Refresh'. Checks the 'Page Cache' row. Clicks on Submit.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ClearPageCacheActionGroup` instead --> - <amOnPage url="{{_ENV.MAGENTO_BACKEND_NAME}}/admin/cache/" stepKey="amOnCacheManagementPage"/> - <waitForPageLoad stepKey="waitForCacheManagement"/> - <selectOption selector="{{AdminCacheManagementSection.massActionSelect}}" userInput="refresh" stepKey="selectRefresh"/> - <click selector="{{AdminCacheManagementSection.pageCacheCheckbox}}" stepKey="selectPageCache"/> - <click selector="{{AdminCacheManagementSection.massActionSubmit}}" stepKey="submitCacheForm"/> - <waitForPageLoad stepKey="waitForCacheFlush"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Paypal/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index e6765a6a520e1..0000000000000 --- a/app/code/Magento/Paypal/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,150 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="EnablePayPalConfiguration"> - <annotations> - <description>Expands the 'OTHER PAYPAL PAYMENT SOLUTIONS' tab on the Admin Configuration page. Enables the provided PayPal Config type for the provided Country Code.</description> - </annotations> - <arguments> - <argument name="payPalConfigType"/> - <argument name="countryCode" type="string" defaultValue="us"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `EnablePayPalConfigurationActionGroup` instead --> - <waitForElementVisible selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" stepKey="waitForOtherPayPalPaymentsSection"/> - <conditionalClick selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" dependentSelector="{{OtherPayPalPaymentsConfigSection.expandedTab(countryCode)}}" visible="false" stepKey="clickOtherPayPalPaymentsSection"/> - <waitForElementVisible selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="waitForWPSExpressConfigureBtn"/> - <click selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="clickWPSExpressConfigureBtn"/> - <waitForElementVisible selector="{{payPalConfigType.enableSolution(countryCode)}}" stepKey="waitForWPSExpressEnable"/> - <selectOption selector="{{payPalConfigType.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableWPSExpressSolution"/> - <seeInPopup userInput="There is already another PayPal solution enabled. Enable this solution instead?" stepKey="seeAlertMessage"/> - <acceptPopup stepKey="acceptEnablePopUp"/> - <click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - </actionGroup> - - <actionGroup name="EnablePayPalSolutionWithoutSave" > - <annotations> - <description>Expands the 'OTHER PAYPAL PAYMENT SOLUTIONS' tab on the Admin Configuration page. Enables the provided PayPal Config type for the provided Country Code without saving.</description> - </annotations> - <arguments> - <argument name="payPalConfigType"/> - <argument name="countryCode" type="string" defaultValue="us"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `EnablePayPalSolutionWithoutSaveActionGroup` instead --> - <waitForElementVisible selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" stepKey="waitForOtherPayPalPaymentsSection"/> - <conditionalClick selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" dependentSelector="{{OtherPayPalPaymentsConfigSection.expandedTab(countryCode)}}" visible="false" stepKey="clickOtherPayPalPaymentsSection"/> - <waitForElementVisible selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="waitForWPSExpressConfigureBtn"/> - <click selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="clickWPSExpressConfigureBtn"/> - <waitForElementVisible selector="{{payPalConfigType.enableSolution(countryCode)}}" stepKey="waitForWPSExpressEnable"/> - <selectOption selector="{{payPalConfigType.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableWPSExpressSolution"/> - </actionGroup> - - <actionGroup name="CheckEnableOptionPayPalConfiguration"> - <annotations> - <description>Expands the 'OTHER PAYPAL PAYMENT SOLUTIONS' tab on the Admin Configuration page. Enables the provided PayPal Config type for the provided Country Code.</description> - </annotations> - <arguments> - <argument name="payPalConfigType"/> - <argument name="enabledOption" type="string"/> - <argument name="countryCode" type="string" defaultValue="us"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CheckEnableOptionPayPalConfigurationActionGroup` instead --> - <waitForElementVisible selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" stepKey="waitForOtherPayPalPaymentsSection"/> - <conditionalClick selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" dependentSelector="{{OtherPayPalPaymentsConfigSection.expandedTab(countryCode)}}" visible="false" stepKey="clickOtherPayPalPaymentsSection"/> - <waitForElementVisible selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="waitForWPSExpressConfigureBtn"/> - <click selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="clickWPSExpressConfigureBtn1"/> - <waitForElementVisible selector="{{payPalConfigType.enableSolution(countryCode)}}" stepKey="waitForWPSExpressEnable"/> - <seeOptionIsSelected selector="{{payPalConfigType.enableSolution(countryCode)}}" userInput="{{enabledOption}}" stepKey="seeSelectedOption"/> - <click selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="clickWPSExpressConfigureBtn2"/> - </actionGroup> - - <actionGroup name="ConfigPayPalExpressCheckout"> - <annotations> - <description>Goes to the 'Configuration' page for 'Payment Methods'. Fills in the provided PayPal credentials and other details. Clicks on Save.</description> - </annotations> - <arguments> - <argument name="credentials" defaultValue="_CREDS"/> - <argument name="countryCode" type="string" defaultValue="us"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ConfigPayPalExpressCheckoutActionGroup` instead --> - <amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - <click selector="{{PayPalExpressCheckoutConfigSection.configureBtn(countryCode)}}" stepKey="clickPayPalConfigureBtn"/> - <waitForElementVisible selector="{{PayPalAdvancedSettingConfigSection.advancedSettingTab(countryCode)}}" stepKey="waitForAdvancedSettingTab"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.email(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_business_account}}" stepKey="inputEmailAssociatedWithPayPalMerchantAccount"/> - <selectOption selector ="{{PayPalExpressCheckoutConfigSection.apiMethod(countryCode)}}" userInput="API Signature" stepKey="inputAPIAuthenticationMethods"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.username(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_api_username}}" stepKey="inputAPIUsername"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.password(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_api_password}}" stepKey="inputAPIPassword"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.signature(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_api_signature}}" stepKey="inputAPISignature"/> - <selectOption selector ="{{PayPalExpressCheckoutConfigSection.sandboxMode(countryCode)}}" userInput="Yes" stepKey="enableSandboxMode"/> - <selectOption selector="{{PayPalExpressCheckoutConfigSection.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableSolution"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.merchantID(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_merchant_id}}" stepKey="inputMerchantID"/> - <click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/> - </actionGroup> - - <actionGroup name="SampleConfigPayPalExpressCheckout"> - <annotations> - <description>Goes to the 'Configuration' page for 'Payment Methods'. Fills in the provided Sample PayPal credentials and other details. Clicks on Save.</description> - </annotations> - <arguments> - <argument name="credentials" defaultValue="SamplePaypalExpressConfig"/> - <argument name="countryCode" type="string" defaultValue="us"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SampleConfigPayPalExpressCheckoutActionGroup` instead --> - <amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - <click selector="{{PayPalExpressCheckoutConfigSection.configureBtn(countryCode)}}" stepKey="clickPayPalConfigureBtn"/> - <waitForElementVisible selector="{{PayPalAdvancedSettingConfigSection.advancedSettingTab(countryCode)}}" stepKey="waitForAdvancedSettingTab"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.email(countryCode)}}" userInput="{{credentials.paypal_express_email}}" stepKey="inputEmailAssociatedWithPayPalMerchantAccount"/> - <selectOption selector ="{{PayPalExpressCheckoutConfigSection.apiMethod(countryCode)}}" userInput="API Signature" stepKey="inputAPIAuthenticationMethods"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.username(countryCode)}}" userInput="{{credentials.paypal_express_api_username}}" stepKey="inputAPIUsername"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.password(countryCode)}}" userInput="{{credentials.paypal_express_api_password}}" stepKey="inputAPIPassword"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.signature(countryCode)}}" userInput="{{credentials.paypal_express_api_signature}}" stepKey="inputAPISignature"/> - <selectOption selector ="{{PayPalExpressCheckoutConfigSection.sandboxMode(countryCode)}}" userInput="Yes" stepKey="enableSandboxMode"/> - <selectOption selector="{{PayPalExpressCheckoutConfigSection.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableSolution"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.merchantID(countryCode)}}" userInput="{{credentials.paypal_express_merchantID}}" stepKey="inputMerchantID"/> - <click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/> - </actionGroup> - - <actionGroup name="addProductToCheckoutPage"> - <annotations> - <description>Goes to the provided Category page on the Storefront. Adds the 1st Product to the Cart. Goes to Checkout. Select the Shipping Method. Selects PayPal as the Payment Method.</description> - </annotations> - <arguments> - <argument name="Category"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddProductToCheckoutPageActionGroup` instead --> - <amOnPage url="{{StorefrontCategoryPage.url(Category.name)}}" stepKey="onCategoryPage"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - <moveMouseOver selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" stepKey="hoverProduct"/> - <click selector="{{StorefrontCategoryMainSection.AddToCartBtn}}" stepKey="addToCart"/> - <waitForElementVisible selector="{{StorefrontCategoryMainSection.SuccessMsg}}" time="30" stepKey="waitForProductAdded"/> - <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickCart"/> - <click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="goToCheckout"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> - <click selector="{{CheckoutShippingMethodsSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask2"/> - <waitForElement selector="{{CheckoutShippingMethodsSection.next}}" time="30" stepKey="waitForNextButton"/> - <click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickNext"/> - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPlaceOrderButton"/> - <click selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="clickPayPalCheckbox"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index e9b6ec37f8f0a..0000000000000 --- a/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,105 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="addProductVideo"> - <annotations> - <description>Expands the 'Images And Videos' section on the Admin Product creation/edit page. Adds the provided Video to the Product. Clicks on Save.</description> - </annotations> - <arguments> - <argument name="video" defaultValue="mftfTestProductVideo"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddProductVideoActionGroup` instead --> - <scrollTo selector="{{AdminProductImagesSection.productImagesToggle}}" x="0" y="-100" stepKey="scrollToArea"/> - <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductVideoSection"/> - <waitForElementVisible selector="{{AdminProductImagesSection.addVideoButton}}" stepKey="waitForAddVideoButtonVisible" time="30"/> - <click selector="{{AdminProductImagesSection.addVideoButton}}" stepKey="addVideo"/> - <waitForElementVisible selector=".modal-slide.mage-new-video-dialog.form-inline._show" stepKey="waitForUrlElementVisibleslide" time="30"/> - <waitForElementVisible selector="{{AdminProductNewVideoSection.videoUrlTextField}}" stepKey="waitForUrlElementVisible" time="60"/> - <fillField selector="{{AdminProductNewVideoSection.videoUrlTextField}}" userInput="{{video.videoUrl}}" stepKey="fillFieldVideoUrl"/> - <fillField selector="{{AdminProductNewVideoSection.videoTitleTextField}}" userInput="{{video.videoTitle}}" stepKey="fillFieldVideoTitle"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <waitForElementNotVisible selector="{{AdminProductNewVideoSection.saveButtonDisabled}}" stepKey="waitForSaveButtonVisible" time="30"/> - <click selector="{{AdminProductNewVideoSection.saveButton}}" stepKey="saveVideo"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/> - </actionGroup> - - <actionGroup name="removeProductVideo"> - <annotations> - <description>Expands the 'Images And Videos' section on the Admin Product creation/edit page. Clicks on the Remove Video button.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `RemoveProductVideoActionGroup` instead --> - <scrollTo selector="{{AdminProductImagesSection.productImagesToggle}}" x="0" y="-100" stepKey="scrollToArea"/> - <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductVideoSection"/> - <waitForElementVisible selector="{{AdminProductImagesSection.addVideoButton}}" stepKey="waitForAddVideoButtonVisible" time="30"/> - <click selector="{{AdminProductImagesSection.removeVideoButton}}" stepKey="removeVideo"/> - </actionGroup> - - <actionGroup name="assertProductVideoAdminProductPage"> - <annotations> - <description>Validates that the provided Video is present on the Admin Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="video" defaultValue="mftfTestProductVideo"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertProductVideoAdminProductPageActionGroup` instead --> - <scrollTo selector="{{AdminProductImagesSection.productImagesToggle}}" x="0" y="-100" stepKey="scrollToArea"/> - <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductVideoSection"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <seeElement selector="{{AdminProductImagesSection.videoTitleText(video.videoShortTitle)}}" stepKey="seeVideoTitle"/> - <seeElementInDOM selector="{{AdminProductImagesSection.videoUrlHiddenField(video.videoUrl)}}" stepKey="seeVideoItem"/> - </actionGroup> - - <actionGroup name="assertProductVideoNotInAdminProductPage"> - <annotations> - <description>Validates that the provided Video is NOT present on the Admin Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="video" defaultValue="mftfTestProductVideo"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertProductVideoNotInAdminProductPageActionGroup` instead --> - <scrollTo selector="{{AdminProductImagesSection.productImagesToggle}}" x="0" y="-100" stepKey="scrollToArea"/> - <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductVideoSection"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <dontSeeElement selector="{{AdminProductImagesSection.videoTitleText(video.videoShortTitle)}}" stepKey="seeVideoTitle"/> - <dontSeeElementInDOM selector="{{AdminProductImagesSection.videoUrlHiddenField(video.videoUrl)}}" stepKey="seeVideoItem"/> - </actionGroup> - - <actionGroup name="assertProductVideoStorefrontProductPage"> - <annotations> - <description>Validates that the provided Video is present on the Storefront Product page.</description> - </annotations> - <arguments> - <argument name="dataTypeAttribute" defaultValue="'youtube'"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertProductVideoStorefrontProductPageActionGroup` instead --> - <seeElement selector="{{StorefrontProductInfoMainSection.productVideo(dataTypeAttribute)}}" stepKey="seeProductVideoDataType"/> - </actionGroup> - - <actionGroup name="assertProductVideoNotInStorefrontProductPage"> - <annotations> - <description>Validates that the provided Video is NOT present on the Storefront Product page.</description> - </annotations> - <arguments> - <argument name="dataTypeAttribute" defaultValue="'youtube'"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertProductVideoNotInStorefrontProductPageActionGroup` instead --> - <dontSeeElement selector="{{StorefrontProductInfoMainSection.productVideo(dataTypeAttribute)}}" stepKey="dontSeeProductVideoDataType"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index 6a6ddfb514890..0000000000000 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,673 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="verifyBasicCreditMemoInformation"> - <annotations> - <description>Validates that the provided Customer, Shipping/Billing Address and Customer Group are present and correct on the Admin Credit Memo view page.</description> - </annotations> - <arguments> - <argument name="customer" defaultValue=""/> - <argument name="shippingAddress" defaultValue=""/> - <argument name="billingAddress" defaultValue=""/> - <argument name="customerGroup" defaultValue="GeneralCustomerGroup"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `VerifyBasicCreditMemoInformationActionGroup` instead --> - <see selector="{{AdminCreditMemoOrderInformationSection.customerName}}" userInput="{{customer.firstname}}" stepKey="seeCustomerName"/> - <see selector="{{AdminCreditMemoOrderInformationSection.customerEmail}}" userInput="{{customer.email}}" stepKey="seeCustomerEmail"/> - <see selector="{{AdminCreditMemoOrderInformationSection.customerGroup}}" userInput="{{customerGroup.code}}" stepKey="seeCustomerGroup"/> - - <see selector="{{AdminCreditMemoAddressInformationSection.billingAddress}}" userInput="{{billingAddress.street[0]}}" stepKey="seeBillingAddressStreet"/> - <see selector="{{AdminCreditMemoAddressInformationSection.billingAddress}}" userInput="{{billingAddress.city}}" stepKey="seeBillingAddressCity"/> - <see selector="{{AdminCreditMemoAddressInformationSection.billingAddress}}" userInput="{{billingAddress.country_id}}" stepKey="seeBillingAddressCountry"/> - <see selector="{{AdminCreditMemoAddressInformationSection.billingAddress}}" userInput="{{billingAddress.postcode}}" stepKey="seeBillingAddressPostcode"/> - - <see selector="{{AdminCreditMemoAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.street[0]}}" stepKey="seeShippingAddressStreet"/> - <see selector="{{AdminCreditMemoAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.city}}" stepKey="seeShippingAddressCity"/> - <see selector="{{AdminCreditMemoAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.country_id}}" stepKey="seeShippingAddressCountry"/> - <see selector="{{AdminCreditMemoAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.postcode}}" stepKey="seeShippingAddressPostcode"/> - </actionGroup> - - <actionGroup name="seeProductInItemsRefunded"> - <annotations> - <description>Validates that the provided Product appears in the 'Product' column on the Admin Credit Memo view page.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SeeProductInItemsRefundedActionGroup` instead --> - <see selector="{{AdminCreditMemoItemsSection.skuColumn}}" userInput="{{product.sku}}" stepKey="seeProductSkuInGrid"/> - </actionGroup> - - <actionGroup name="verifyBasicInvoiceInformation"> - <annotations> - <description>Validates that the provided Customer, Address and Customer Group details are present and correct on the Admin View Invoice page.</description> - </annotations> - <arguments> - <argument name="customer"/> - <argument name="shippingAddress"/> - <argument name="billingAddress"/> - <argument name="customerGroup" defaultValue="GeneralCustomerGroup"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `VerifyBasicInvoiceInformationActionGroup` instead --> - <see selector="{{AdminInvoiceOrderInformationSection.customerName}}" userInput="{{customer.firstname}}" stepKey="seeCustomerName"/> - <see selector="{{AdminInvoiceOrderInformationSection.customerEmail}}" userInput="{{customer.email}}" stepKey="seeCustomerEmail"/> - <see selector="{{AdminInvoiceOrderInformationSection.customerGroup}}" userInput="{{customerGroup.code}}" stepKey="seeCustomerGroup"/> - <see selector="{{AdminInvoiceAddressInformationSection.billingAddress}}" userInput="{{billingAddress.street[0]}}" stepKey="seeBillingAddressStreet"/> - <see selector="{{AdminInvoiceAddressInformationSection.billingAddress}}" userInput="{{billingAddress.city}}" stepKey="seeBillingAddressCity"/> - <see selector="{{AdminInvoiceAddressInformationSection.billingAddress}}" userInput="{{billingAddress.country_id}}" stepKey="seeBillingAddressCountry"/> - <see selector="{{AdminInvoiceAddressInformationSection.billingAddress}}" userInput="{{billingAddress.postcode}}" stepKey="seeBillingAddressPostcode"/> - <see selector="{{AdminInvoiceAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.street[0]}}" stepKey="seeShippingAddressStreet"/> - <see selector="{{AdminInvoiceAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.city}}" stepKey="seeShippingAddressCity"/> - <see selector="{{AdminInvoiceAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.country_id}}" stepKey="seeShippingAddressCountry"/> - <see selector="{{AdminInvoiceAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.postcode}}" stepKey="seeShippingAddressPostcode"/> - </actionGroup> - - <actionGroup name="seeProductInInvoiceItems"> - <annotations> - <description>Validates that the provided Product appears under the 'SKU' column in the Admin Invoices edit page.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SeeProductInInvoiceItemsActionGroup` instead --> - <see selector="{{AdminInvoiceItemsSection.skuColumn}}" userInput="{{product.sku}}" stepKey="seeProductSkuInGrid"/> - </actionGroup> - - <actionGroup name="adminFastCreateInvoice"> - <annotations> - <description>Clicks on 'Invoice' on the Admin Orders view page. Clicks on 'Submit Invoice'. Clicks on 'View Invoice'.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminFastCreateInvoiceActionGroup` instead --> - <click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceButton"/> - <waitForPageLoad stepKey="waitForNewInvoicePageLoad"/> - <click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/> - <see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The invoice has been created." stepKey="seeSuccessMessage"/> - <click selector="{{AdminOrderDetailsOrderViewSection.invoices}}" stepKey="clickInvoices"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask5"/> - <conditionalClick selector="{{AdminOrderInvoicesTabSection.clearFilters}}" dependentSelector="{{AdminOrderInvoicesTabSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> - <click selector="{{AdminOrderInvoicesTabSection.viewInvoice}}" stepKey="openInvoicePage"/> - <waitForPageLoad stepKey="waitForInvoicePageLoad"/> - </actionGroup> - - <actionGroup name="clearInvoicesGridFilters"> - <annotations> - <description>Goes to the Admin Invoices grid page. Clicks on 'Clear Filters', if present.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ClearInvoicesGridFiltersActionGroup` instead --> - <amOnPage url="{{AdminInvoicesPage.url}}" stepKey="goToInvoices"/> - <waitForPageLoad stepKey="waitInvoicesGridToLoad"/> - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearFilters"/> - <waitForPageLoad stepKey="waitInvoicesGrid"/> - </actionGroup> - - <actionGroup name="goToInvoiceIntoOrder"> - <annotations> - <description>Clicks on 'Invoice' on the Admin Orders view page. Validates that the URL and Page Title are correct.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `GoToInvoiceIntoOrderActionGroup` instead --> - <click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceAction"/> - <seeInCurrentUrl url="{{AdminInvoiceNewPage.url}}" stepKey="seeOrderInvoiceUrl"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seePageNameNewInvoicePage"/> - </actionGroup> - - <actionGroup name="StartCreateInvoiceFromOrderPage"> - <annotations> - <description>Clicks on 'Invoice' on the Admin Orders view page. Validates that the URL and Page Title are correct.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StartCreateInvoiceFromOrderPageActionGroup` instead --> - <click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceAction"/> - <seeInCurrentUrl url="{{AdminInvoiceNewPage.url}}" stepKey="seeNewInvoiceUrl"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seeNewInvoicePageTitle"/> - </actionGroup> - - <actionGroup name="SubmitInvoice"> - <annotations> - <description>Clicks on 'Submit Invoice' on the Admin 'New Invoice' page. Validates that the Success Message is present and correct. Validates that the Order ID appears in the URL.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SubmitInvoiceActionGroup` instead --> - <click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/> - <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForMessageAppears"/> - <see selector="{{AdminMessagesSection.success}}" userInput="The invoice has been created." stepKey="seeInvoiceCreateSuccess"/> - <grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="grabOrderId"/> - <seeInCurrentUrl url="{{AdminOrderDetailsPage.url('$grabOrderId')}}" stepKey="seeViewOrderPageInvoice"/> - </actionGroup> - - <actionGroup name="filterInvoiceGridByOrderId"> - <annotations> - <description>Goes to the Admin Invoices grid page. Filters the grid for the provided Order ID.</description> - </annotations> - <arguments> - <argument name="orderId" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FilterInvoiceGridByOrderIdActionGroup` instead --> - <amOnPage url="{{AdminInvoicesPage.url}}" stepKey="goToInvoices"/> - <click selector="{{AdminInvoicesGridSection.filter}}" stepKey="clickFilter"/> - <fillField selector="{{AdminInvoicesFiltersSection.orderNum}}" userInput="{{orderId}}" stepKey="fillOrderIdForFilter"/> - <click selector="{{AdminInvoicesFiltersSection.applyFilters}}" stepKey="clickApplyFilters"/> - <waitForPageLoad stepKey="waitForFiltersApply"/> - </actionGroup> - - <actionGroup name="navigateToNewOrderPageNewCustomer"> - <annotations> - <description>Goes to the Admin Orders grid page. Clicks on 'Create New Order'. Clicks on 'Create New Customer'. Select the provided Store View, if present. Validates that Page Title is present and correct.</description> - </annotations> - <arguments> - <argument name="storeView" defaultValue="_defaultStore"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `NavigateToNewOrderPageNewCustomerActionGroup` instead --> - <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/> - <waitForPageLoad stepKey="waitForIndexPageLoad"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/> - <click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/> - <click selector="{{AdminOrderFormActionSection.CreateNewCustomer}}" stepKey="clickCreateCustomer"/> - <conditionalClick selector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" dependentSelector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" visible="true" stepKey="selectStoreViewIfAppears"/> - <waitForPageLoad stepKey="waitForCreateOrderPageLoadAfterStoreSelect"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/> - </actionGroup> - - <actionGroup name="navigateToNewOrderPageNewCustomerSingleStore"> - <annotations> - <description>Goes to the Admin Orders grid page. Clicks on 'Create New Order'. Clicks on 'Create New Customer'. Validates that Page Title is present and correct.</description> - </annotations> - <arguments> - <argument name="storeView" defaultValue="_defaultStore"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `NavigateToNewOrderPageNewCustomerSingleStoreActionGroup` instead --> - <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/> - <waitForPageLoad stepKey="waitForIndexPageLoad"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/> - <click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/> - <click selector="{{AdminOrderFormActionSection.CreateNewCustomer}}" stepKey="clickCreateCustomer"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/> - </actionGroup> - - <actionGroup name="navigateToNewOrderPageExistingCustomer"> - <annotations> - <description>Goes tot he Admin Orders grid page. Clicks on 'Create New Order'. Filters the grid for the provided Customer. Clicks on the Customer. Selects the provided Store View, if present. Validates that the Page Title is present and correct.</description> - </annotations> - <arguments> - <argument name="customer"/> - <argument name="storeView" defaultValue="_defaultStore"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `NavigateToNewOrderPageExistingCustomerActionGroup` instead --> - <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/> - <waitForPageLoad stepKey="waitForIndexPageLoad"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/> - <click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/> - <waitForPageLoad stepKey="waitForCustomerGridLoad"/> - - <conditionalClick selector="{{AdminOrderCustomersGridSection.resetButton}}" dependentSelector="{{AdminOrderCustomersGridSection.resetButton}}" visible="true" stepKey="clearExistingCustomerFilters"/> - <fillField userInput="{{customer.email}}" selector="{{AdminOrderCustomersGridSection.emailInput}}" stepKey="filterEmail"/> - <click selector="{{AdminOrderCustomersGridSection.apply}}" stepKey="applyFilter"/> - <waitForPageLoad stepKey="waitForFilteredCustomerGridLoad"/> - <click selector="{{AdminOrderCustomersGridSection.firstRow}}" stepKey="clickOnCustomer"/> - <waitForPageLoad stepKey="waitForCreateOrderPageLoad"/> - - <conditionalClick selector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" dependentSelector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" visible="true" stepKey="selectStoreViewIfAppears"/> - <waitForPageLoad stepKey="waitForCreateOrderPageLoadAfterStoreSelect"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/> - </actionGroup> - - <actionGroup name="checkRequiredFieldsNewOrderForm"> - <annotations> - <description>Clears the Email, First Name, Last Name, Street Line 1, City, Postal Code and Phone fields when adding an Order and then verifies that they are required after attempting to Save.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CheckRequiredFieldsNewOrderFormActionGroup` instead --> - <seeElement selector="{{AdminOrderFormAccountSection.requiredGroup}}" stepKey="seeCustomerGroupRequired"/> - <seeElement selector="{{AdminOrderFormAccountSection.requiredEmail}}" stepKey="seeEmailRequired"/> - <clearField selector="{{AdminOrderFormAccountSection.email}}" stepKey="clearEmailField"/> - <clearField selector="{{AdminOrderFormBillingAddressSection.FirstName}}" stepKey="clearFirstNameField"/> - <clearField selector="{{AdminOrderFormBillingAddressSection.LastName}}" stepKey="clearLastNameField"/> - <clearField selector="{{AdminOrderFormBillingAddressSection.StreetLine1}}" stepKey="clearStreetField"/> - <clearField selector="{{AdminOrderFormBillingAddressSection.City}}" stepKey="clearCityField"/> - <selectOption selector="{{AdminOrderFormBillingAddressSection.Country}}" userInput="United States" stepKey="selectUSCountry"/> - <selectOption selector="{{AdminOrderFormBillingAddressSection.State}}" userInput="Please select" stepKey="selectNoState"/> - <clearField selector="{{AdminOrderFormBillingAddressSection.PostalCode}}" stepKey="clearPostalCodeField"/> - <clearField selector="{{AdminOrderFormBillingAddressSection.Phone}}" stepKey="clearPhoneField"/> - <seeElement selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="seeShippingMethodNotSelected"/> - <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="trySubmitOrder"/> - <see selector="{{AdminOrderFormBillingAddressSection.emailError}}" userInput="This is a required field." stepKey="seeThatEmailIsRequired"/> - <see selector="{{AdminOrderFormBillingAddressSection.firstNameError}}" userInput="This is a required field." stepKey="seeFirstNameRequired"/> - <see selector="{{AdminOrderFormBillingAddressSection.lastNameError}}" userInput="This is a required field." stepKey="seeLastNameRequired"/> - <see selector="{{AdminOrderFormBillingAddressSection.streetAddressError}}" userInput="This is a required field." stepKey="seeStreetRequired"/> - <see selector="{{AdminOrderFormBillingAddressSection.cityError}}" userInput="This is a required field." stepKey="seeCityRequired"/> - <see selector="{{AdminOrderFormBillingAddressSection.stateError}}" userInput="This is a required field." stepKey="seeStateRequired"/> - <see selector="{{AdminOrderFormBillingAddressSection.postalCodeError}}" userInput="This is a required field." stepKey="seePostalCodeRequired"/> - <see selector="{{AdminOrderFormBillingAddressSection.phoneError}}" userInput="This is a required field." stepKey="seePhoneRequired"/> - <see selector="{{AdminOrderFormPaymentSection.shippingError}}" userInput="This is a required field." stepKey="seeShippingMethodRequired"/> - </actionGroup> - - <actionGroup name="addSimpleProductToOrder"> - <annotations> - <description>Adds the provided Simple Product to an Order. Fills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> - </annotations> - <arguments> - <argument name="product" defaultValue="_defaultProduct" type="entity"/> - <argument name="productQty" defaultValue="1" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddSimpleProductToOrderActionGroup` instead --> - <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> - <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilter"/> - <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearch"/> - <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> - <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectProduct"/> - <fillField selector="{{AdminOrderFormItemsSection.rowQty('1')}}" userInput="{{productQty}}" stepKey="fillProductQty"/> - <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> - <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> - <wait time="5" stepKey="waitForOptionsToLoad"/> - </actionGroup> - - <actionGroup name="addConfigurableProductToOrder"> - <annotations> - <description>Adds the provided Configurable Product with the provided Option to an Order. Fills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="attribute"/> - <argument name="option"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddConfigurableProductToOrderActionGroup` instead --> - <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> - <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterConfigurable"/> - <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchConfigurable"/> - <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> - <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectConfigurableProduct"/> - <waitForElementVisible selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_label)}}" stepKey="waitForConfigurablePopover"/> - <wait time="2" stepKey="waitForOptionsToLoad"/> - <selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_label)}}" userInput="{{option.name}}" stepKey="selectionConfigurableOption"/> - <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkConfigurablePopover"/> - <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> - <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> - </actionGroup> - - <actionGroup name="newAddConfigurableProductToOrder" extends="addConfigurableProductToOrder"> - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `NewAddConfigurableProductToOrderActionGroup` instead --> - <remove keyForRemoval="waitForConfigurablePopover"/> - <remove keyForRemoval="selectionConfigurableOption"/> - <selectOption selector="{{AdminOrderFormConfigureProductSection.selectOption}}" userInput="{{option.value}}" stepKey="selectOption" after="waitForOptionsToLoad"/> - </actionGroup> - - <actionGroup name="addConfigurableProductToOrderFromAdmin" extends="addConfigurableProductToOrder"> - <annotations> - <description>EXTENDS: addConfigurableProductToOrder. Selects the provided Option to the Configurable Product.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddConfigurableProductToOrderFromAdminActionGroup` instead --> - <waitForElementVisible selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}" stepKey="waitForConfigurablePopover"/> - <selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}" userInput="{{option.label}}" stepKey="selectionConfigurableOption"/> - </actionGroup> - - <actionGroup name="configureOrderedConfigurableProduct"> - <annotations> - <description>Clicks on 'Configure' for a Product in the 'Please select products' under the 'Create New Order for' page. Selects the provided Option and Attribute. Fills in the provided Qty. Clicks on Ok.</description> - </annotations> - <arguments> - <argument name="attribute"/> - <argument name="option"/> - <argument name="quantity" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ConfigureOrderedConfigurableProductActionGroup` instead --> - <click selector="{{AdminOrderFormItemsSection.configure}}" stepKey="clickConfigure"/> - <waitForElementVisible selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}" stepKey="waitForConfigurablePopover"/> - <wait time="2" stepKey="waitForOptionsToLoad"/> - <selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}" userInput="{{option.label}}" stepKey="selectionConfigurableOption"/> - <fillField selector="{{AdminOrderFormConfigureProductSection.quantity}}" userInput="{{quantity}}" stepKey="fillQuantity"/> - <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkConfigurablePopover"/> - </actionGroup> - - <actionGroup name="addBundleProductToOrder"> - <annotations> - <description>Adds the provided Bundled Product with the provided Option to an Order. Fills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="quantity" type="string" defaultValue="1"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddBundleProductToOrderActionGroup` instead --> - <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> - <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterBundle"/> - <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchBundle"/> - <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> - <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectBundleProduct"/> - <waitForElementVisible selector="{{AdminOrderFormBundleProductSection.quantity}}" stepKey="waitForBundleOptionLoad"/> - <wait time="2" stepKey="waitForOptionsToLoad"/> - <fillField selector="{{AdminOrderFormBundleProductSection.quantity}}" userInput="{{quantity}}" stepKey="fillQuantity"/> - <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOk"/> - <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> - <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> - </actionGroup> - - <actionGroup name="addBundleProductToOrderAndCheckPriceInGrid" extends="addBundleProductToOrder"> - <annotations> - <description>EXTENDS: addBundleProductToOrder. Validates that the provided Product Price is present and correct in the 'Items Ordered' section.</description> - </annotations> - <arguments> - <argument name="price" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddBundleProductToOrderAndCheckPriceInGridActionGroup` instead --> - <grabTextFrom selector="{{AdminOrderFormItemsSection.rowPrice('1')}}" stepKey="grabProductPriceFromGrid" after="clickOk"/> - <assertEquals stepKey="assertProductPriceInGrid" message="Bundle product price in grid should be equal {{price}}" after="grabProductPriceFromGrid"> - <expectedResult type="string">{{price}}</expectedResult> - <actualResult type="variable">grabProductPriceFromGrid</actualResult> - </assertEquals> - </actionGroup> - - <actionGroup name="addDownloadableProductToOrder"> - <annotations> - <description>Adds a Downloadable Product to an Order. Clicks on 'Add Selected Product(s) to Order'.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddDownloadableProductToOrderActionGroup` instead --> - <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> - <waitForPageLoad time="30" stepKey="waitForPageLoad1"/> - <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterDownloadable"/> - <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchDownloadable"/> - <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> - <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectDownloadableProduct"/> - <waitForElementVisible selector="{{AdminOrderFormDownloadableProductSection.optionSelect(link.title)}}" stepKey="waitForLinkLoad"/> - <click selector="{{AdminOrderFormDownloadableProductSection.optionSelect(link.title)}}" stepKey="selectLink"/> - <fillField selector="{{AdminOrderFormDownloadableProductSection.quantity}}" userInput="{{quantity}}" stepKey="setQuantity"/> - <click selector="{{AdminOrderFormDownloadableProductSection.ok}}" stepKey="confirmConfiguration"/> - <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> - <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> - </actionGroup> - - <actionGroup name="addGroupedProductOptionToOrder"> - <annotations> - <description>Adds the provided Grouped Product with the provided Option to an Order. Fills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="option"/> - <argument name="quantity" type="string" defaultValue="1"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddGroupedProductOptionToOrderActionGroup` instead --> - <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> - <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterGrouped"/> - <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchGrouped"/> - <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> - <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectGroupedProduct"/> - <waitForElementVisible selector="{{AdminOrderFormGroupedProductSection.optionQty(option.sku)}}" stepKey="waitForGroupedOptionLoad"/> - <wait time="2" stepKey="waitForOptionsToLoad"/> - <fillField selector="{{AdminOrderFormGroupedProductSection.optionQty(option.sku)}}" userInput="{{quantity}}" stepKey="fillOptionQuantity"/> - <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOk"/> - <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> - <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> - </actionGroup> - - <actionGroup name="fillOrderCustomerInformation"> - <annotations> - <description>Fills in the provided Customer and Address details on the Admin 'Create New Order for' page.</description> - </annotations> - <arguments> - <argument name="customer"/> - <argument name="address"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FillOrderCustomerInformationActionGroup` instead --> - <fillField selector="{{AdminOrderFormBillingAddressSection.FirstName}}" userInput="{{customer.firstname}}" stepKey="fillFirstName"/> - <fillField selector="{{AdminOrderFormBillingAddressSection.LastName}}" userInput="{{customer.lastname}}" stepKey="fillLastName"/> - <fillField selector="{{AdminOrderFormBillingAddressSection.StreetLine1}}" userInput="{{address.street[0]}}" stepKey="fillStreetLine1"/> - <fillField selector="{{AdminOrderFormBillingAddressSection.City}}" userInput="{{address.city}}" stepKey="fillCity"/> - <selectOption selector="{{AdminOrderFormBillingAddressSection.Country}}" userInput="{{address.country_id}}" stepKey="fillCountry"/> - <selectOption selector="{{AdminOrderFormBillingAddressSection.State}}" userInput="{{address.state}}" stepKey="fillState"/> - <fillField selector="{{AdminOrderFormBillingAddressSection.PostalCode}}" userInput="{{address.postcode}}" stepKey="fillPostalCode"/> - <fillField selector="{{AdminOrderFormBillingAddressSection.Phone}}" userInput="{{address.telephone}}" stepKey="fillPhone"/> - </actionGroup> - - <actionGroup name="orderSelectFlatRateShipping"> - <annotations> - <description>Selects the 'Flat Rate' Shipping Method on the Admin 'Create New Order for' page.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `OrderSelectFlatRateShippingActionGroup` instead --> - <click selector="{{AdminOrderFormPaymentSection.header}}" stepKey="unfocus"/> - <waitForPageLoad stepKey="waitForJavascriptToFinish"/> - <click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickShippingMethods"/> - <waitForElementVisible selector="{{AdminOrderFormPaymentSection.flatRateOption}}" stepKey="waitForShippingOptions"/> - <selectOption selector="{{AdminOrderFormPaymentSection.flatRateOption}}" userInput="flatrate_flatrate" stepKey="checkFlatRate"/> - </actionGroup> - - <actionGroup name="changeShippingMethod"> - <annotations> - <description>Change Shipping Method on the Admin 'Create New Order for' page.</description> - </annotations> - <arguments> - <argument name="shippingMethod" defaultValue="flatrate_flatrate" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ChangeShippingMethodActionGroup` instead --> - <click selector="{{AdminOrderFormPaymentSection.header}}" stepKey="unfocus"/> - <waitForPageLoad stepKey="waitForJavascriptToFinish"/> - <click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickShippingMethods1"/> - <waitForElementVisible selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="waitForChangeShippingMethod"/> - <click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickShippingMethods2"/> - <waitForElementVisible selector="{{AdminOrderFormPaymentSection.shippingMethod}}" stepKey="waitForShippingOptions2"/> - <selectOption selector="{{AdminOrderFormPaymentSection.shippingMethod}}" userInput="{{shippingMethod}}" stepKey="checkFlatRate"/> - </actionGroup> - - <actionGroup name="orderSelectFreeShipping"> - <annotations> - <description>Selects the 'Free Shipping' Shipping Method on the Admin 'Create New Order for' page.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `OrderSelectFreeShippingActionGroup` instead --> - <click selector="{{AdminOrderFormPaymentSection.header}}" stepKey="unfocus"/> - <waitForPageLoad stepKey="waitForJavascriptToFinish"/> - <click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickShippingMethods"/> - <waitForElementVisible selector="{{AdminOrderFormPaymentSection.freeShippingOption}}" stepKey="waitForShippingOptions"/> - <selectOption selector="{{AdminOrderFormPaymentSection.freeShippingOption}}" userInput="freeshipping_freeshipping" stepKey="checkFreeShipping"/> - </actionGroup> - - <actionGroup name="verifyBasicOrderInformation"> - <annotations> - <description>Validates that the provided Customer, Shipping/Billing Address and Customer Group are present and correct on the Admin Orders view page.</description> - </annotations> - <arguments> - <argument name="customer"/> - <argument name="shippingAddress"/> - <argument name="billingAddress"/> - <argument name="customerGroup" defaultValue="GeneralCustomerGroup"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `VerifyBasicOrderInformationActionGroup` instead --> - <see selector="{{AdminOrderDetailsInformationSection.customerName}}" userInput="{{customer.firstname}}" stepKey="seeCustomerName"/> - <see selector="{{AdminOrderDetailsInformationSection.customerEmail}}" userInput="{{customer.email}}" stepKey="seeCustomerEmail"/> - <see selector="{{AdminOrderDetailsInformationSection.customerGroup}}" userInput="{{customerGroup.code}}" stepKey="seeCustomerGroup"/> - <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.street[0]}}" stepKey="seeBillingAddressStreet"/> - <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.city}}" stepKey="seeBillingAddressCity"/> - <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.country_id}}" stepKey="seeBillingAddressCountry"/> - <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.postcode}}" stepKey="seeBillingAddressPostcode"/> - <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.street[0]}}" stepKey="seeShippingAddressStreet"/> - <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.city}}" stepKey="seeShippingAddressCity"/> - <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.country_id}}" stepKey="seeShippingAddressCountry"/> - <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.postcode}}" stepKey="seeShippingAddressPostcode"/> - </actionGroup> - - <actionGroup name="verifyCreatedOrderInformation"> - <annotations> - <description>Validates that the Success Message, Order Status (Pending) and Order ID are present and correct.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `VerifyCreatedOrderInformationActionGroup` instead --> - <see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="You created the order." stepKey="seeSuccessMessage"/> - <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Pending" stepKey="seeOrderPendingStatus" after="seeSuccessMessage"/> - <grabTextFrom selector="|Order # (\d+)|" stepKey="getOrderId" after="seeOrderPendingStatus"/> - <assertNotEmpty actual="$getOrderId" stepKey="assertOrderIdIsNotEmpty" after="getOrderId"/> - </actionGroup> - - <actionGroup name="seeProductInItemsOrdered"> - <annotations> - <description>Validates that the provided Product is present and correct in the 'Items Ordered' section on the Admin Orders view page.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SeeProductInItemsOrderedActionGroup` instead --> - <see selector="{{AdminOrderItemsOrderedSection.productSkuColumn}}" userInput="{{product.sku}}" stepKey="seeSkuInItemsOrdered"/> - </actionGroup> - - <actionGroup name="cancelPendingOrder"> - <annotations> - <description>Cancels the Pending Order on the Admin Orders view page. Validates that the provided Order Status is present and correct.</description> - </annotations> - <arguments> - <argument name="orderStatus" type="string" defaultValue="Canceled"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CancelPendingOrderActionGroup` instead --> - <click selector="{{AdminOrderDetailsMainActionsSection.cancel}}" stepKey="clickCancelOrder"/> - <waitForElement selector="{{AdminConfirmationModalSection.message}}" stepKey="waitForCancelConfirmation"/> - <see selector="{{AdminConfirmationModalSection.message}}" userInput="Are you sure you want to cancel this order?" stepKey="seeConfirmationMessage"/> - <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmOrderCancel"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You canceled the order." stepKey="seeCancelSuccessMessage"/> - <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="{{orderStatus}}" stepKey="seeOrderStatusCanceled"/> - </actionGroup> - - <actionGroup name="dontSeeProductInItemsOrdered"> - <arguments> - <argument name="product"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `DontSeeProductInItemsOrderedActionGroup` instead --> - <dontSee selector="{{AdminOrderItemsOrderedSection.productSkuColumn}}" userInput="{{product.sku}}" stepKey="dontseeSkuInItemsOrdered"/> - </actionGroup> - - <actionGroup name="SelectCheckMoneyPaymentMethod"> - <annotations> - <description>Selects the 'Check / Money Order' Payment Method on the Admin Create New Order page.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SelectCheckMoneyPaymentMethodActionGroup` instead --> - <waitForElementVisible selector="{{AdminOrderFormPaymentSection.paymentBlock}}" stepKey="waitForPaymentOptions"/> - <conditionalClick selector="{{AdminOrderFormPaymentSection.checkMoneyOption}}" dependentSelector="{{AdminOrderFormPaymentSection.checkMoneyOption}}" visible="true" stepKey="checkCheckMoneyOption"/> - </actionGroup> - - <actionGroup name="filterOrderGridById"> - <annotations> - <description>Goes to the Admin Orders page. Filters the grid based on the provided Order ID.</description> - </annotations> - <arguments> - <argument name="orderId" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FilterOrderGridByIdActionGroup` instead --> - <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderGridPage"/> - <waitForPageLoad stepKey="waitForOrdersPage"/> - <conditionalClick selector="{{AdminOrdersGridSection.clearFilters}}" dependentSelector="{{AdminOrdersGridSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> - <waitForPageLoad stepKey="waitForClearFilters"/> - <click selector="{{AdminOrdersGridSection.filters}}" stepKey="openOrderGridFilters"/> - <waitForPageLoad stepKey="waitForClickFilters"/> - <fillField selector="{{AdminOrdersGridSection.idFilter}}" userInput="{{orderId}}" stepKey="fillOrderIdFilter"/> - <click selector="{{AdminOrdersGridSection.applyFilters}}" stepKey="clickOrderApplyFilters"/> - <waitForPageLoad stepKey="waitForApplyFilters"/> - </actionGroup> - - <actionGroup name="filterOrderGridByBillingName"> - <annotations> - <description>Goes to the Admin Orders page. Filters the grid based on the provided Customer.</description> - </annotations> - <arguments> - <argument name="customer"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FilterOrderGridByBillingNameActionGroup` instead --> - <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderGridPage"/> - <waitForPageLoad stepKey="waitForOrderGridLoad"/> - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> - <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openOrderGridFilters"/> - <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('billing_name')}}" userInput="{{customer.fullname}}" stepKey="fillBillToNameFilter"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickOrderApplyFilters"/> - </actionGroup> - - <actionGroup name="filterOrderGridByBaseTotalRange"> - <annotations> - <description>Goes to the Admin Orders page. Filters the grid based on the provided Grand Total From/To values.</description> - </annotations> - <arguments> - <argument name="from"/> - <argument name="to"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FilterOrderGridByBaseTotalRangeActionGroup` instead --> - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> - <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openOrderGridFilters"/> - <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('base_grand_total[from]')}}" userInput="{{from}}" stepKey="fillOrderTotalFrom"/> - <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('base_grand_total[to]')}}" userInput="{{to}}" stepKey="fillOrderTotalTo"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFilters"/> - </actionGroup> - - <actionGroup name="filterOrderGridByPurchaseDate"> - <annotations> - <description>Goes to the Admin Orders page. Filters the grid based on the provided Purchased Date From/To values.</description> - </annotations> - <arguments> - <argument name="from"/> - <argument name="to"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FilterOrderGridByPurchaseDateActionGroup` instead --> - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> - <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openOrderGridFilters"/> - <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('created_at[from]')}}" userInput="{{from}}" stepKey="fillOrderPurchaseDateFrom"/> - <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('created_at[to]')}}" userInput="{{to}}" stepKey="fillOrderPurchaseDateTo"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFilters"/> - </actionGroup> - - <actionGroup name="filterOrderGridByStatus"> - <annotations> - <description>Filters the Admin Orders grid based on the provided Order Status.</description> - </annotations> - <arguments> - <argument name="status"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FilterOrderGridByStatusActionGroup` instead --> - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> - <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openOrderGridFilters"/> - <selectOption selector="{{AdminDataGridHeaderSection.filterFieldSelect('status')}}" userInput="{{status}}" stepKey="fillOrderStatusFilter"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFilters"/> - </actionGroup> - - <actionGroup name="OpenOrderById" extends="filterOrderGridById"> - <annotations> - <description>EXTENDS: filterOrderGridById. Clicks on the 1st row of the Admin Orders grid.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `OpenOrderByIdActionGroup` instead --> - <click selector="{{AdminDataGridTableSection.firstRow}}" after="clickOrderApplyFilters" stepKey="openOrderViewPage"/> - <waitForPageLoad after="openOrderViewPage" stepKey="waitForOrderViewPageOpened"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index 648500bcaeb40..0000000000000 --- a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,110 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="selectNotLoggedInCustomerGroup"> - <annotations> - <description>Selects 'NOT LOGGED IN' from the 'Customer Groups' list (Magento 2 B2B). PLEASE NOTE: The value is Hardcoded.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SelectNotLoggedInCustomerGroupActionGroup` instead --> - <selectOption selector="{{AdminCartPriceRulesFormSection.customerGroups}}" userInput="NOT LOGGED IN" stepKey="selectCustomerGroup"/> - </actionGroup> - - <actionGroup name="selectRetailerCustomerGroup"> - <annotations> - <description>Selects 'Retailer' from the 'Customer Groups' list (Magento 2 B2B). PLEASE NOTE: The value is Hardcoded.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SelectRetailerCustomerGroupActionGroup` instead --> - <selectOption selector="{{AdminCartPriceRulesFormSection.customerGroups}}" userInput="Retailer" stepKey="selectRetailerCustomerGroup"/> - </actionGroup> - - <actionGroup name="AdminCreateCartPriceRuleWithCouponCode" extends="AdminCreateCartPriceRuleActionGroup"> - <annotations> - <description>EXTENDS: AdminCreateCartPriceRuleActionGroup. Removes 'selectActionType' and 'fillDiscountAmount'. Adds the provided Coupon Code to a Cart Price Rule.</description> - </annotations> - <arguments> - <argument name="couponCode" defaultValue="_defaultCoupon.code"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminCreateCartPriceRuleWithCouponCodeActionGroup` instead --> - <remove keyForRemoval="selectActionType"/> - <remove keyForRemoval="fillDiscountAmount"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.coupon}}" userInput="Specific Coupon" stepKey="selectCouponType" after="fillRuleName"/> - <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.couponCode}}" stepKey="waitForElementVisible" after="selectCouponType"/> - <fillField selector="{{AdminCartPriceRulesFormSection.couponCode}}" userInput="{{couponCode}}" stepKey="fillCouponCode" after="waitForElementVisible"/> - <fillField selector="{{AdminCartPriceRulesFormSection.userPerCoupon}}" userInput="99" stepKey="fillUserPerCoupon" after="fillCouponCode"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.apply}}" userInput="Fixed amount discount for whole cart" stepKey="selectActionTypeToFixed" after="clickToExpandActions"/> - <fillField selector="{{AdminCartPriceRulesFormSection.discountAmount}}" userInput="1" stepKey="fillDiscountAmount" after="selectActionTypeToFixed"/> - </actionGroup> - - <actionGroup name="AdminCreateCartPriceRuleWithConditions" extends="AdminCreateCartPriceRuleActionGroup"> - <annotations> - <description>EXTENDS: AdminCreateCartPriceRuleActionGroup. Removes 'fillDiscountAmount'. Adds the 2 provided Conditions (Name, Rule, Rule to Change and Category Name) to a Cart Price Rule.</description> - </annotations> - <arguments> - <argument name="condition1" type="string" defaultValue="Products subselection"/> - <argument name="condition2" type="string" defaultValue="Category"/> - <argument name="ruleToChange1" type="string" defaultValue="is"/> - <argument name="rule1" type="string" defaultValue="equals or greater than"/> - <argument name="ruleToChange2" type="string" defaultValue="..."/> - <argument name="rule2" type="string" defaultValue="2"/> - <argument name="categoryName" type="string" defaultValue="_defaultCategory.name"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminCreateCartPriceRuleWithConditionsActionGroup` instead --> - <remove keyForRemoval="fillDiscountAmount"/> - - <click selector="{{AdminCartPriceRulesFormSection.conditionsHeader}}" stepKey="openConditionsSection" after="selectActionType"/> - <click selector="{{AdminCartPriceRulesFormSection.addCondition('1')}}" stepKey="addFirstCondition" after="openConditionsSection"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.ruleCondition('1')}}" userInput="{{condition1}}" stepKey="selectRule" after="addFirstCondition"/> - <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange1)}}" stepKey="waitForFirstRuleElement" after="selectRule"/> - <click selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange1)}}" stepKey="clickToChangeRule" after="waitForFirstRuleElement"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.ruleParameterSelect('1--1')}}" userInput="{{rule1}}" stepKey="selectRule1" after="clickToChangeRule"/> - <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange2)}}" stepKey="waitForSecondRuleElement" after="selectRule1"/> - <click selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange2)}}" stepKey="clickToChangeRule1" after="waitForSecondRuleElement"/> - <fillField selector="{{AdminCartPriceRulesFormSection.ruleParameterInput('1--1')}}" userInput="{{rule2}}" stepKey="fillRule" after="clickToChangeRule1"/> - <click selector="{{AdminCartPriceRulesFormSection.addCondition('1--1')}}" stepKey="addSecondCondition" after="fillRule"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.ruleCondition('1--1')}}" userInput="{{condition2}}" stepKey="selectSecondCondition" after="addSecondCondition"/> - <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange2)}}" stepKey="waitForThirdRuleElement" after="selectSecondCondition"/> - <click selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange2)}}" stepKey="addThirdCondition" after="waitForThirdRuleElement"/> - <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.openChooser('1--1--1')}}" stepKey="waitForForthRuleElement" after="addThirdCondition"/> - <click selector="{{AdminCartPriceRulesFormSection.openChooser('1--1--1')}}" stepKey="openChooser" after="waitForForthRuleElement"/> - <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.categoryCheckbox(categoryName)}}" stepKey="waitForCategoryVisible" after="openChooser"/> - <checkOption selector="{{AdminCartPriceRulesFormSection.categoryCheckbox(categoryName)}}" stepKey="checkCategoryName" after="waitForCategoryVisible"/> - </actionGroup> - - <actionGroup name="VerifyDiscountAmount"> - <annotations> - <description>Goes to the provided Storefront Product URL. Fills in provided Quantity. Clicks Add to Cart. Goes to Checkout. Validates that the provided Discount Amount is present and correct.</description> - </annotations> - <arguments> - <argument name="productUrl" type="string"/> - <argument name="quantity" type="string"/> - <argument name="expectedDiscount" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `VerifyDiscountAmountActionGroup` instead --> - <amOnPage url="{{productUrl}}" stepKey="goToProductPage"/> - <waitForPageLoad stepKey="waitForProductPageLoad"/> - <fillField selector="{{StorefrontProductActionSection.quantity}}" userInput="{{quantity}}" stepKey="fillQuantity"/> - <click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="addProductToCart"/> - <waitForPageLoad stepKey="waitForAddToCart"/> - <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/> - <amOnPage url="{{CheckoutCartPage.url}}" stepKey="goToCartPage"/> - <waitForPageLoad stepKey="waitForCartPage"/> - <waitForElementVisible selector="{{CheckoutCartSummarySection.discountAmount}}" stepKey="waitForDiscountElement"/> - <see selector="{{CheckoutCartSummarySection.discountAmount}}" userInput="{{expectedDiscount}}" stepKey="seeDiscountTotal"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Search/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Search/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index 6c860e8273bab..0000000000000 --- a/app/code/Magento/Search/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,51 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="searchTermFilterBySearchQuery"> - <annotations> - <description>Fills in the provided Search Query on the Admin Search Term grid page.</description> - </annotations> - <arguments> - <argument name="searchQuery" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminSearchTermFilterBySearchQueryActionGroup` instead --> - <click selector="{{AdminCatalogSearchTermIndexSection.resetFilterButton}}" stepKey="clickOnResetButton"/> - <waitForPageLoad stepKey="waitForResetFilter"/> - <fillField selector="{{AdminCatalogSearchTermIndexSection.searchQuery}}" userInput="{{searchQuery}}" stepKey="fillSearchQuery"/> - <click selector="{{AdminCatalogSearchTermIndexSection.searchButton}}" stepKey="clickSearchButton"/> - <waitForPageLoad stepKey="waitForSearchResultLoad"/> - <checkOption selector="{{AdminCatalogSearchTermIndexSection.searchTermRowCheckboxBySearchQuery(searchQuery)}}" stepKey="checkCheckBox"/> - </actionGroup> - - <actionGroup name="deleteSearchTerm"> - <annotations> - <description>Deletes the Search Terms in the Admin Search Term grid.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminDeleteSearchTermActionGroup` instead --> - <selectOption selector="{{AdminCatalogSearchTermIndexSection.massActions}}" userInput="delete" stepKey="selectDeleteOption"/> - <click selector="{{AdminCatalogSearchTermIndexSection.submit}}" stepKey="clickSubmitButton"/> - <click selector="{{AdminCatalogSearchTermIndexSection.okButton}}" stepKey="clickOkButton"/> - <waitForElementVisible selector="{{AdminCatalogSearchTermMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/> - </actionGroup> - - <actionGroup name="DeleteAllSearchTerms"> - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminDeleteAllSearchTermsActionGroup` instead --> - <selectOption userInput="selectAll" selector="{{AdminCatalogSearchTermIndexSection.selectMassActionCheckbox}}" stepKey="checkAllSearchTerms"/> - <selectOption selector="{{AdminCatalogSearchTermIndexSection.massActions}}" userInput="delete" stepKey="selectDeleteOption"/> - <click selector="{{AdminCatalogSearchTermIndexSection.submit}}" stepKey="clickSubmitButton"/> - <click selector="{{AdminCatalogSearchTermIndexSection.okButton}}" stepKey="clickOkButton"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index 7654b1baef2d8..0000000000000 --- a/app/code/Magento/Store/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,247 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="CreateCustomStore"> - <annotations> - <description>Goes to the Admin Stores grid page. Clicks on 'Create Store'. Fills in the provided Details (Website, Store Group Name and Store Group Code). Clicks on Save. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="website" type="string"/> - <argument name="store" type="string"/> - <argument name="rootCategory" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateCustomStoreActionGroup` instead --> - <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> - <waitForPageLoad stepKey="waitForSystemStorePage"/> - <click selector="{{AdminStoresMainActionsSection.createStoreButton}}" stepKey="selectCreateStore"/> - <selectOption userInput="{{website}}" selector="{{AdminNewStoreGroupSection.storeGrpWebsiteDropdown}}" stepKey="selectMainWebsite"/> - <fillField userInput="{{store}}" selector="{{AdminNewStoreGroupSection.storeGrpNameTextField}}" stepKey="fillStoreName"/> - <fillField userInput="{{store}}" selector="{{AdminNewStoreGroupSection.storeGrpCodeTextField}}" stepKey="fillStoreCode"/> - <selectOption userInput="{{rootCategory}}" selector="{{AdminNewStoreGroupSection.storeRootCategoryDropdown}}" stepKey="selectStoreStatus"/> - <click selector="{{AdminStoreGroupActionsSection.saveButton}}" stepKey="clickSaveStoreGroup"/> - <waitForElementVisible selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="waitForStoreGridReload"/> - <see userInput="You saved the store." stepKey="seeSavedMessage"/> - </actionGroup> - - <actionGroup name="AssertStoreGroupInGrid"> - <annotations> - <description>Goes to the Admin Stores grid page. Searches for the provided Store Group Name. Validates that the provided Store Group Name is present in the grid.</description> - </annotations> - <arguments> - <argument name="storeGroupName" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertStoreGroupInGridActionGroup` instead --> - <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> - <waitForPageLoad stepKey="waitForAdminSystemStorePageLoad"/> - <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> - <fillField userInput="{{storeGroupName}}" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="fillSearchStoreGroupField"/> - <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> - <waitForPageLoad stepKey="waitForStoreToLoad"/> - <see selector="{{AdminStoresGridSection.nthRow('1')}}" userInput="{{storeGroupName}}" stepKey="seeAssertStoreGroupInGridMessage"/> - </actionGroup> - - <actionGroup name="AssertStoreGroupForm"> - <annotations> - <description>Clicks on the 1st Store in the 'Stores' grid. Validates that the provided Details (Website, Store Group Name, Store Group Code and Root Category) are present and correct.</description> - </annotations> - <arguments> - <argument name="website" type="string"/> - <argument name="storeGroupName" type="string"/> - <argument name="storeGroupCode" type="string"/> - <argument name="rootCategory" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertStoreGroupFormActionGroup` instead --> - <click selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="clickEditExistingStoreRow"/> - <waitForPageLoad stepKey="waitTillAdminSystemStoreGroupPage"/> - <seeInField selector="{{AdminNewStoreGroupSection.storeGrpWebsiteDropdown}}" userInput="{{website}}" stepKey="seeAssertWebsite"/> - <seeInField selector="{{AdminNewStoreGroupSection.storeGrpNameTextField}}" userInput="{{storeGroupName}}" stepKey="seeAssertStoreGroupName"/> - <seeInField selector="{{AdminNewStoreGroupSection.storeGrpCodeTextField}}" userInput="{{storeGroupCode}}" stepKey="seeAssertStoreGroupCode"/> - <seeInField selector="{{AdminNewStoreGroupSection.storeRootCategoryDropdown}}" userInput="{{rootCategory}}" stepKey="seeAssertRootCategory"/> - </actionGroup> - - <actionGroup name="AdminCreateStoreViewActionSaveGroup"> - <annotations> - <description>Validates that the Success Message is present and correct.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminCreateStoreViewSaveActionGroup` instead --> - <waitForLoadingMaskToDisappear stepKey="waitForGridLoad"/> - <waitForElementVisible selector="{{AdminStoresGridSection.websiteFilterTextField}}" stepKey="waitForStoreGridToReload2"/> - <see userInput="You saved the store view." stepKey="seeSavedMessage"/> - </actionGroup> - - <actionGroup name="navigateToAdminContentManagementPage"> - <annotations> - <description>Goes to the 'Configuration' page for 'Content Management'.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `NavigateToAdminContentManagementPageActionGroup` instead --> - <amOnPage url="{{AdminContentManagementPage.url}}" stepKey="navigateToConfigurationPage"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - </actionGroup> - - <actionGroup name="saveStoreConfiguration"> - <annotations> - <description>Clicks on the Save button.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SaveStoreConfigurationActionGroup` instead --> - <comment userInput="saveStoreConfiguration" stepKey="comment"/> - <waitForElementVisible selector="{{StoreConfigSection.Save}}" stepKey="waitForSaveButton"/> - <click selector="{{StoreConfigSection.Save}}" stepKey="clickSaveButton"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - </actionGroup> - - <actionGroup name="saveStoreConfigurationAndValidateFieldError"> - <annotations> - <description>Clicks on Save. Validates that the fields are required.</description> - </annotations> - <arguments> - <argument name="inputFieldError" type="string"/> - <argument name="errorMessageSelector" type="string"/> - <argument name="errorMessage" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SaveStoreConfigurationAndValidateFieldErrorActionGroup` instead --> - <comment userInput="saveStoreConfigurationAndValidateFieldError" stepKey="comment"/> - <waitForElementVisible selector="{{StoreConfigSection.Save}}" stepKey="waitForSaveButton"/> - <click selector="{{StoreConfigSection.Save}}" stepKey="clickSaveButton"/> - <waitForElement selector="{{inputFieldError}}" stepKey="waitForErrorField"/> - <waitForElementVisible selector="{{errorMessageSelector}}" stepKey="waitForErrorMessage"/> - <see selector="{{errorMessageSelector}}" userInput="{{errorMessage}}" stepKey="seeErrorMessage"/> - </actionGroup> - - <actionGroup name="AssertWebsiteInGrid"> - <annotations> - <description>Goes to the Admin Stores grid page. Searches the grid for the provided Website Name. Validates that the Website appears in the grid.</description> - </annotations> - <arguments> - <argument name="websiteName" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertWebsiteInGridActionGroup` instead --> - <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> - <waitForPageLoad stepKey="waitForAdminSystemStorePageLoad"/> - <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> - <fillField userInput="{{websiteName}}" selector="{{AdminStoresGridSection.websiteFilterTextField}}" stepKey="fillWebsiteField"/> - <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> - <waitForPageLoad stepKey="waitForStoreToLoad"/> - <seeElement selector="{{AdminStoresGridSection.websiteName(websiteName)}}" stepKey="seeAssertWebsiteInGrid"/> - </actionGroup> - - <actionGroup name="AssertWebsiteForm"> - <annotations> - <description>Clicks on the provided Website Name in the Admin Stores grid. Validates that the URL, Website Name/Code are present and correct.</description> - </annotations> - <arguments> - <argument name="websiteName" type="string"/> - <argument name="websiteCode" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertWebsiteFormActionGroup` instead --> - <click selector="{{AdminStoresGridSection.websiteName(websiteName)}}" stepKey="clickWebsiteFirstRowInGrid"/> - <waitForPageLoad stepKey="waitTillWebsiteFormPageIsOpened"/> - <grabFromCurrentUrl regex="~(\d+)/~" stepKey="grabWebsiteIdFromCurrentUrl"/> - <seeInCurrentUrl url="/system_store/editWebsite/website_id/{$grabWebsiteIdFromCurrentUrl}" stepKey="seeWebsiteId"/> - <seeInField selector="{{AdminNewWebsiteSection.name}}" userInput="{{websiteName}}" stepKey="seeAssertWebsiteName"/> - <seeInField selector="{{AdminNewWebsiteSection.code}}" userInput="{{websiteCode}}" stepKey="seeAssertWebsiteCode"/> - </actionGroup> - - <actionGroup name="AssertStoreViewNotInGrid"> - <annotations> - <description>Goes to the Admin Stores grid page. Searches the grid for the provided Store View name. Validates that it does NOT appear in the grid.</description> - </annotations> - <arguments> - <argument name="storeViewName" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertStoreViewNotInGridActionGroup` instead --> - <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> - <waitForPageLoad stepKey="waitForAdminSystemStorePageLoad"/> - <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> - <fillField userInput="{{storeViewName}}" selector="{{AdminStoresGridSection.storeFilterTextField}}" stepKey="fillSearchStoreViewField"/> - <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> - <waitForPageLoad stepKey="waitForStoreToLoad"/> - <see selector="{{AdminStoresGridSection.emptyText}}" userInput="We couldn't find any records." stepKey="seeAssertStoreViewNotInGridMessage"/> - </actionGroup> - - <actionGroup name="AdminAddCustomWebSiteToStoreGroup"> - <annotations> - <description>Goes to the Admin Stores grid page. Searches the grid for the provided Store Group. Edits the Store. Adds the provided Website to the Store. Clicks on Save. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="storeGroup" defaultValue="customStoreGroup"/> - <argument name="website" defaultValue="customWebsite"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminAddCustomWebSiteToStoreGroupActionGroup` instead --> - <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> - <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> - <fillField userInput="{{storeGroup.name}}" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="fillSearchStoreGroupField"/> - <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> - <see userInput="{{storeGroup.name}}" selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="verifyThatCorrectStoreGroupFound"/> - <click selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="clickEditExistingStoreRow"/> - <waitForPageLoad stepKey="waitForStoreGroupPageLoad"/> - <selectOption selector="{{AdminNewStoreGroupSection.storeGrpWebsiteDropdown}}" userInput="{{website.name}}" stepKey="selectWebsite"/> - <selectOption selector="{{AdminNewStoreGroupSection.storeRootCategoryDropdown}}" userInput="Default Category" stepKey="chooseRootCategory"/> - <click selector="{{AdminNewStoreGroupActionsSection.saveButton}}" stepKey="clickSaveStoreGroup"/> - <conditionalClick selector="{{AdminNewStoreGroupSection.acceptNewStoreGroupCreation}}" dependentSelector="{{AdminNewStoreGroupSection.acceptNewStoreGroupCreation}}" visible="true" stepKey="clickAcceptNewStoreGroupCreationButton"/> - <waitForElementVisible selector="{{AdminStoresGridSection.storeFilterTextField}}" stepKey="waitForPageReload"/> - <see userInput="You saved the store." stepKey="seeSavedMessage"/> - </actionGroup> - - <actionGroup name="CreateStoreView"> - <annotations> - <description>Goes to the Admin Store Views creation page. Fills in the provided Store View, Store Group Name and Store View Status. Clicks on Save. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="storeView" defaultValue="customStore"/> - <argument name="storeGroupName" defaultValue="_defaultStoreGroup.name"/> - <argument name="storeViewStatus" defaultValue="_defaultStore.is_active"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateStoreViewActionGroup` instead --> - <amOnPage url="{{AdminSystemStoreViewPage.url}}" stepKey="amOnAdminSystemStoreViewPage"/> - <waitForPageLoad stepKey="waitForProductPageLoad"/> - <selectOption userInput="{{storeGroupName}}" selector="{{AdminNewStoreSection.storeGrpDropdown}}" stepKey="selectStoreGroup"/> - <fillField userInput="{{storeView.name}}" selector="{{AdminNewStoreSection.storeNameTextField}}" stepKey="fillStoreViewName"/> - <fillField userInput="{{storeView.code}}" selector="{{AdminNewStoreSection.storeCodeTextField}}" stepKey="fillStoreViewCode"/> - <selectOption userInput="{{storeViewStatus}}" selector="{{AdminNewStoreSection.statusDropdown}}" stepKey="selectStoreViewStatus"/> - <click selector="{{AdminStoresMainActionsSection.saveButton}}" stepKey="clickSaveStoreViewButton"/> - <waitForElementVisible selector="{{AdminNewStoreSection.acceptNewStoreViewCreation}}" stepKey="waitForAcceptNewStoreViewCreationButton"/> - <conditionalClick selector="{{AdminNewStoreSection.acceptNewStoreViewCreation}}" dependentSelector="{{AdminNewStoreSection.acceptNewStoreViewCreation}}" visible="true" stepKey="clickAcceptNewStoreViewCreationButton"/> - <see userInput="You saved the store view." stepKey="seeSavedMessage"/> - </actionGroup> - - <actionGroup name="AssertStoreNotInGrid"> - <annotations> - <description>Goes to the Admin Stores grid page. Validates that the provided Store Group Name is NOT present in the grid.</description> - </annotations> - <arguments> - <argument name="storeGroupName" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertStoreNotInGridActionGroup` instead --> - <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> - <waitForPageLoad stepKey="waitForAdminSystemStorePageLoad"/> - <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> - <fillField userInput="{{storeGroupName}}" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="fillSearchStoreGroupField"/> - <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> - <waitForPageLoad stepKey="waitForStoreToLoad"/> - <see selector="{{AdminStoresGridSection.emptyText}}" userInput="We couldn't find any records." stepKey="seeAssertStoreGroupNotInGridMessage"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index 676d6bb2d3e37..0000000000000 --- a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,115 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="setColorPickerByHex"> - <annotations> - <description>Sets the provided HEX value in the provided Color Picker.</description> - </annotations> - <arguments> - <argument name="nthColorPicker" type="string" defaultValue="1"/> - <argument name="hexColor" type="string" defaultValue="e74c3c"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SetColorPickerByHexActionGroup` instead --> - <pressKey selector="{{AdminColorPickerSection.hexByIndex(nthColorPicker)}}" parameterArray="[\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,'{{hexColor}}']" stepKey="fillHex1"/> - <click selector="{{AdminColorPickerSection.submitByIndex(nthColorPicker)}}" stepKey="submitColor1"/> - </actionGroup> - - <actionGroup name="assertSwatchColor"> - <annotations> - <description>Validates that the provided Color Picker contains the provided Style.</description> - </annotations> - <arguments> - <argument name="nthSwatch" type="string" defaultValue="1"/> - <argument name="expectedStyle" type="string" defaultValue="background: rgb(0, 0, 0);"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertSwatchColorActionGroup` instead --> - <grabAttributeFrom selector="{{AdminManageSwatchSection.nthSwatch(nthSwatch)}}" userInput="style" stepKey="grabStyle1"/> - <assertEquals stepKey="assertStyle1"> - <actualResult type="string">{$grabStyle1}</actualResult> - <expectedResult type="string">{{expectedStyle}}</expectedResult> - </assertEquals> - </actionGroup> - - <actionGroup name="assertStorefrontSwatchColor"> - <annotations> - <description>Validates that the Storefront Product has the provided Swatch with the provided Color.</description> - </annotations> - <arguments> - <argument name="nthSwatch" type="string" defaultValue="1"/> - <argument name="expectedRgb" type="string" defaultValue="rgb(231, 77, 60)"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertStorefrontSwatchColorActionGroup` instead --> - <grabAttributeFrom selector="{{StorefrontProductInfoMainSection.nthSwatchOption(nthSwatch)}}" userInput="style" stepKey="grabStyle1"/> - <assertEquals stepKey="assertStyle1"> - <actualResult type="string">{$grabStyle1}</actualResult> - <expectedResult type="string">background: center center no-repeat {{expectedRgb}};</expectedResult> - </assertEquals> - </actionGroup> - - <actionGroup name="openSwatchMenuByIndex"> - <annotations> - <description>Options the Swatch Menu based on the provided Index.</description> - </annotations> - <arguments> - <argument name="index" type="string" defaultValue="0"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `OpenSwatchMenuByIndexActionGroup` instead --> - <executeJS function="jQuery('#swatch_window_option_option_{{index}}').click()" stepKey="clickSwatch1"/> - </actionGroup> - - <actionGroup name="StorefrontSelectSwatchOptionOnProductPage"> - <arguments> - <argument name="optionName" type="string"/> - </arguments> - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontSelectSwatchOptionOnProductPageActionGroup` instead --> - <click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel(optionName)}}" stepKey="clickSwatchOption"/> - </actionGroup> - - <actionGroup name="StorefrontAssertSwatchOptionPrice"> - <arguments> - <argument name="optionName" type="string"/> - <argument name="optionPrice" type="string"/> - </arguments> - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontAssertSwatchOptionPriceActionGroup` instead --> - <click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel(optionName)}}" stepKey="clickOnOption"/> - <see userInput="{{optionPrice}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="seeOptionPrice"/> - </actionGroup> - - <actionGroup name="StorefrontSelectSwatchOptionOnProductPageAndCheckImage" extends="StorefrontSelectSwatchOptionOnProductPage"> - <arguments> - <argument name="fileName" type="string" defaultValue="magento-logo"/> - </arguments> - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontSelectSwatchOptionOnProductPageAndCheckImageActionGroup` instead --> - <seeElement selector="{{StorefrontProductMediaSection.productImageActive(fileName)}}" stepKey="seeActiveImageDefault"/> - </actionGroup> - - <actionGroup name="StorefrontUpdateCartConfigurableProductWithSwatches"> - <arguments> - <argument name="product"/> - <argument name="productOption" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontUpdateCartConfigurableProductWithSwatchesActionGroup` instead --> - <click selector="{{CheckoutCartProductSection.nthEditButton('1')}}" stepKey="clickEditConfigurableProductButton"/> - <waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> - <click selector="{{StorefrontProductInfoMainSection.visualSwatchOption(productOption)}}" stepKey="changeSwatchAttributeOption"/> - <click selector="{{StorefrontProductInfoMainSection.updateCart}}" stepKey="clickUpdateCartButton"/> - <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/> - <see selector="{{StorefrontMessagesSection.success}}" userInput="{{product.name}} was updated in your shopping cart." stepKey="assertSuccessMessage"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index 95516361a74f5..0000000000000 --- a/app/code/Magento/Tax/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,271 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="addCustomerTaxClass"> - <annotations> - <description>Adds the provided Customer Tax Class on the Admin Tax Rule creation/edit page.</description> - </annotations> - <arguments> - <argument name="customerTaxClassName" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddCustomerTaxClassActionGroup` instead --> - <click stepKey="clickAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> - <click stepKey="clickCustomerAddNewTaxClassBtn" selector="{{AdminTaxRulesSection.customerAddNewTaxClass}}"/> - <fillField stepKey="fillCustomerNewTaxClass" selector="{{AdminTaxRulesSection.fieldCustomerNewTaxClass}}" userInput="{{customerTaxClassName}}"/> - <click stepKey="saveProdTaxRate" selector="{{AdminTaxRulesSection.saveCustomerNewTaxClass}}"/> - </actionGroup> - - <actionGroup name="deleteCustomerTaxClass"> - <annotations> - <description>Goes to the Admin New Tax Rule page. Deletes the provided Tax Class Name.</description> - </annotations> - <arguments> - <argument name="taxClassName" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `DeleteCustomerTaxClassActionGroup` instead --> - <amOnPage url="{{AdminNewTaxRulePage.url}}" stepKey="goToNewTaxRulePage"/> - <waitForPageLoad stepKey="waitForTaxRatePage"/> - <click stepKey="clickAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> - <scrollTo stepKey="scrollToAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> - <moveMouseOver stepKey="hoverDeleteElement" selector="{{AdminTaxRulesSection.deleteTaxClassName(taxClassName)}}"/> - <click stepKey="deleteFirstTaxClass" selector="{{AdminTaxRulesSection.deleteTaxClass(taxClassName)}}"/> - <waitForElementVisible selector="{{AdminTaxRulesSection.popUpDialogOK}}" stepKey="waitForElementBecomeVisible"/> - <click stepKey="acceptPopUpDialog" selector="{{AdminTaxRulesSection.popUpDialogOK}}"/> - <waitForPageLoad stepKey="waitForProductTaxClassDeleted"/> - </actionGroup> - <actionGroup name="editTaxConfigurationByUI"> - <annotations> - <description>Goes to the 'Configuration' page for 'Tax'. Enables the display of Taxes in the Storefront Shopping Cart and Checkout page.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `EditTaxConfigurationByUIActionGroup` instead --> - <amOnPage url="{{AdminTaxConfigurationPage.url}}" stepKey="goToAdminTaxPage"/> - <waitForPageLoad stepKey="waitForTaxConfigLoad"/> - - <scrollTo selector="#tax_defaults-head" x="0" y="-80" stepKey="scrollToTaxDefaults"/> - - <conditionalClick stepKey="clickCalculationSettings" selector="{{AdminConfigureTaxSection.defaultDestination}}" dependentSelector="#tax_defaults" visible="false"/> - <conditionalClick stepKey="clickCalculationSettingsAgain" selector="{{AdminConfigureTaxSection.defaultDestination}}" dependentSelector="#tax_defaults" visible="false"/> - <uncheckOption stepKey="clickDefaultState" selector="{{AdminConfigureTaxSection.systemValueDefaultState}}"/> - <selectOption stepKey="selectDefaultState" selector="{{AdminConfigureTaxSection.dropdownDefaultState}}" userInput="California"/> - <fillField stepKey="fillDefaultPostCode" selector="{{AdminConfigureTaxSection.defaultPostCode}}" userInput="*"/> - - <scrollTo selector="#tax_cart_display-head" x="0" y="-80" stepKey="scrollToTaxShoppingCartDisplay"/> - - <conditionalClick stepKey="clickShoppingCartDisplaySettings" selector="{{AdminConfigureTaxSection.shoppingCartDisplay}}" dependentSelector="#tax_cart_display" visible="false"/> - <conditionalClick stepKey="clickShoppingCartDisplaySettingsAgain" selector="{{AdminConfigureTaxSection.shoppingCartDisplay}}" dependentSelector="#tax_cart_display" visible="false"/> - <uncheckOption stepKey="clickTaxTotalCart" selector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalCart}}"/> - <selectOption stepKey="selectTaxTotalCart" selector="{{AdminConfigureTaxSection.dropdownIncludeTaxTotalCart}}" userInput="Yes"/> - <uncheckOption stepKey="clickDisplayTaxSummaryCart" selector="{{AdminConfigureTaxSection.systemValueDisplayTaxSummaryCart}}"/> - <selectOption stepKey="selectDisplayTaxSummaryCart" selector="{{AdminConfigureTaxSection.dropdownDisplayTaxSummaryCart}}" userInput="Yes"/> - <uncheckOption stepKey="clickDisplayZeroTaxCart" selector="{{AdminConfigureTaxSection.systemValueDisplayZeroTaxCart}}"/> - <selectOption stepKey="selectDisplayZeroTaxCart" selector="{{AdminConfigureTaxSection.dropdownDisplayZeroTaxCart}}" userInput="Yes"/> - - <scrollTo selector="#tax_sales_display-head" x="0" y="-80" stepKey="scrollToTaxSalesDisplay"/> - - <conditionalClick stepKey="clickOrdersInvoicesCreditSales" selector="{{AdminConfigureTaxSection.ordersInvoicesCreditSales}}" dependentSelector="#tax_sales_display" visible="false"/> - <conditionalClick stepKey="clickOrdersInvoicesCreditSalesAgain" selector="{{AdminConfigureTaxSection.ordersInvoicesCreditSales}}" dependentSelector="#tax_sales_display" visible="false"/> - <uncheckOption stepKey="clickTaxTotalSales" selector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalSales}}"/> - <selectOption stepKey="selectTaxTotalSales" selector="{{AdminConfigureTaxSection.dropdownIncludeTaxTotalSales}}" userInput="Yes"/> - <uncheckOption stepKey="clickDisplayTaxSummarySales" selector="{{AdminConfigureTaxSection.systemValueDisplayTaxSummarySales}}"/> - <selectOption stepKey="selectDisplayTaxSummarySales" selector="{{AdminConfigureTaxSection.dropdownDisplayTaxSummarySales}}" userInput="Yes"/> - <uncheckOption stepKey="clickDisplayZeroTaxSales" selector="{{AdminConfigureTaxSection.systemValueDisplayZeroTaxSales}}"/> - <selectOption stepKey="selectDisplayZeroTaxSales" selector="{{AdminConfigureTaxSection.dropdownDisplayZeroTaxSales}}" userInput="Yes"/> - - <scrollToTopOfPage stepKey="scrollToTop"/> - <click stepKey="saveTaxOptions" selector="{{AdminCategoryMainActionsSection.SaveButton}}"/> - <waitForPageLoad stepKey="waitForTaxSaved"/> - <see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/> - </actionGroup> - - <actionGroup name="changeToDefaultTaxConfigurationUI"> - <annotations> - <description>Goes to the 'Configuration' page for 'Tax'. Set the Tax Configuration Settings to the Default values. Clicks on Save. Validates that the Success Message is present and correct.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ChangeToDefaultTaxConfigurationUIActionGroup` instead --> - <amOnPage url="{{AdminTaxConfigurationPage.url}}" stepKey="goToAdminTaxPage"/> - <waitForPageLoad stepKey="waitForTaxConfigLoad"/> - - <conditionalClick stepKey="clickCalculationSettings" selector="{{AdminConfigureTaxSection.defaultDestination}}" dependentSelector="{{AdminConfigureTaxSection.systemValueDefaultState}}" visible="false"/> - <conditionalClick stepKey="clickCalculationSettingsAgain" selector="{{AdminConfigureTaxSection.defaultDestination}}" dependentSelector="{{AdminConfigureTaxSection.systemValueDefaultState}}" visible="false"/> - <checkOption stepKey="clickDefaultState" selector="{{AdminConfigureTaxSection.systemValueDefaultState}}"/> - <selectOption stepKey="selectDefaultState" selector="{{AdminConfigureTaxSection.dropdownDefaultState}}" userInput="California"/> - <fillField stepKey="fillDefaultPostCode" selector="{{AdminConfigureTaxSection.defaultPostCode}}" userInput=""/> - - <conditionalClick stepKey="clickShoppingCartDisplaySettings" selector="{{AdminConfigureTaxSection.shoppingCartDisplay}}" dependentSelector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalCart}}" visible="false"/> - <conditionalClick stepKey="clickShoppingCartDisplaySettingsAgain" selector="{{AdminConfigureTaxSection.shoppingCartDisplay}}" dependentSelector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalCart}}" visible="false"/> - <checkOption stepKey="clickTaxTotalCart" selector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalCart}}"/> - <selectOption stepKey="selectTaxTotalCart" selector="{{AdminConfigureTaxSection.dropdownIncludeTaxTotalCart}}" userInput="Yes"/> - <checkOption stepKey="clickDisplayTaxSummaryCart" selector="{{AdminConfigureTaxSection.systemValueDisplayTaxSummaryCart}}"/> - <selectOption stepKey="selectDisplayTaxSummaryCart" selector="{{AdminConfigureTaxSection.dropdownDisplayTaxSummaryCart}}" userInput="Yes"/> - <checkOption stepKey="clickDisplayZeroTaxCart" selector="{{AdminConfigureTaxSection.systemValueDisplayZeroTaxCart}}"/> - <selectOption stepKey="selectDisplayZeroTaxCart" selector="{{AdminConfigureTaxSection.dropdownDisplayZeroTaxCart}}" userInput="Yes"/> - - <conditionalClick stepKey="clickOrdersInvoicesCreditSales" selector="{{AdminConfigureTaxSection.ordersInvoicesCreditSales}}" dependentSelector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalSales}}" visible="false"/> - <conditionalClick stepKey="clickOrdersInvoicesCreditSalesAgain" selector="{{AdminConfigureTaxSection.ordersInvoicesCreditSales}}" dependentSelector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalSales}}" visible="false"/> - <checkOption stepKey="clickTaxTotalSales" selector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalSales}}"/> - <selectOption stepKey="selectTaxTotalSales" selector="{{AdminConfigureTaxSection.dropdownIncludeTaxTotalSales}}" userInput="Yes"/> - <checkOption stepKey="clickDisplayTaxSummarySales" selector="{{AdminConfigureTaxSection.systemValueDisplayTaxSummarySales}}"/> - <selectOption stepKey="selectDisplayTaxSummarySales" selector="{{AdminConfigureTaxSection.dropdownDisplayTaxSummarySales}}" userInput="Yes"/> - <checkOption stepKey="clickDisplayZeroTaxSales" selector="{{AdminConfigureTaxSection.systemValueDisplayZeroTaxSales}}"/> - <selectOption stepKey="selectDisplayZeroTaxSales" selector="{{AdminConfigureTaxSection.dropdownDisplayZeroTaxSales}}" userInput="Yes"/> - - <scrollToTopOfPage stepKey="scrollToTop"/> - <click stepKey="saveTaxOptions" selector="{{AdminCategoryMainActionsSection.SaveButton}}"/> - <see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/> - </actionGroup> - - <actionGroup name="addCustomTaxRate" extends="addNewTaxRateNoZip"> - <annotations> - <description>EXTENDS: addNewTaxRateNoZip. Removes 'fillZipCode' and 'fillRate'. Fills in the Zip Code and Rate. PLEASE NOTE: The values are Hardcoded.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddCustomTaxRateActionGroup` instead --> - <remove keyForRemoval="fillZipCode"/> - <remove keyForRemoval="fillRate"/> - <fillField stepKey="fillZipCode" selector="{{AdminTaxRulesSection.zipCode}}" userInput="US-NY-*-Rate 2" after="fillTaxIdentifier"/> - <fillField stepKey="fillRate" selector="{{AdminTaxRulesSection.rate}}" userInput="0" after="selectCountry"/> - </actionGroup> - - <actionGroup name="addNewTaxRateNoZip"> - <annotations> - <description>Goes to the Admin Tax Rules grid page. Adds the provided Tax Code.</description> - </annotations> - <arguments> - <argument name="taxCode"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddNewTaxRateNoZipActionGroup` instead --> - <click stepKey="addNewTaxRate" selector="{{AdminTaxRulesSection.addNewTaxRate}}"/> - - <fillField stepKey="fillTaxIdentifier" selector="{{AdminTaxRulesSection.taxIdentifier}}" userInput="{{taxCode.state}}-{{taxCode.rate}}"/> - <fillField stepKey="fillZipCode" selector="{{AdminTaxRulesSection.zipCode}}" userInput="{{taxCode.zip}}"/> - <selectOption stepKey="selectState" selector="{{AdminTaxRulesSection.state}}" userInput="{{taxCode.state}}"/> - <selectOption stepKey="selectCountry" selector="{{AdminTaxRulesSection.country}}" userInput="{{taxCode.country}}"/> - <fillField stepKey="fillRate" selector="{{AdminTaxRulesSection.rate}}" userInput="{{taxCode.rate}}"/> - - <click stepKey="saveTaxRate" selector="{{AdminTaxRulesSection.save}}"/> - </actionGroup> - - <actionGroup name="changeShippingTaxClass"> - <annotations> - <description>Goes to the 'Configuration' page for 'Tax'. Sets the 'Tax Class for Shipping' configuration setting to 'Taxable Goods'. Clicks on Save. Validates that the Success Message is present and correct.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ChangeShippingTaxClassActionGroup` instead --> - <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES"/> - <waitForPageLoad stepKey="waitForConfiguration"/> - <click selector="{{AdminMenuSection.configuration}}" stepKey="clickOnConfigurations"/> - <waitForPageLoad stepKey="waitForSales"/> - - <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES1"/> - <waitForPageLoad stepKey="waitForConfiguration1"/> - <click selector="{{AdminMenuSection.configuration}}" stepKey="clickOnConfigurations1"/> - <waitForPageLoad stepKey="waitForSales1" time="5"/> - - <click selector="{{ConfigurationListSection.sales}}" stepKey="clickOnSales"/> - <waitForPageLoad stepKey="waitForPaymentMethods"/> - <click selector="{{AdminConfigureTaxSection.salesTax}}" stepKey="clickOnTax"/> - <waitForPageLoad stepKey="waitForTax"/> - <seeInCurrentUrl url="{{AdminTaxConfigurationPage.url}}" stepKey="adminTaxConfiguration"/> - <seeElement selector="{{AdminConfigureTaxSection.taxClasses}}" stepKey="taxClassSectionC"/> - <click selector="{{AdminConfigureTaxSection.taxClasses}}" stepKey="openTaxClassSection"/> - <click selector="{{AdminConfigureTaxSection.taxShippingClassSystem}}" stepKey="uncheckSystemValue"/> - <selectOption selector="{{AdminConfigureTaxSection.taxClassShipping}}" userInput="Taxable Goods" stepKey="setTaxClassForShipping"/> - - <scrollToTopOfPage stepKey="scrollToTop"/> - <click stepKey="saveTaxOptions" selector="{{AdminCategoryMainActionsSection.SaveButton}}"/> - <waitForPageLoad stepKey="waitForTaxSaved"/> - <see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/> - </actionGroup> - - <actionGroup name="setDefaultShippingTaxClass"> - <annotations> - <description>Goes to the 'Configuration' page via the Admin Side Menu. Sets the 'Tax Class for Shipping' to the System Default. Clicks on Save. Validates that the Success Message is present and correct.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SetDefaultShippingTaxClassActionGroup` instead --> - <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES"/> - <waitForPageLoad stepKey="waitForConfiguration"/> - <click selector="{{AdminMenuSection.configuration}}" stepKey="clickOnConfigurations"/> - <waitForPageLoad stepKey="waitForSales"/> - - <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES1"/> - <waitForPageLoad stepKey="waitForConfiguration1"/> - <click selector="{{AdminMenuSection.configuration}}" stepKey="clickOnConfigurations1"/> - <waitForPageLoad stepKey="waitForSales1"/> - - <click selector="{{ConfigurationListSection.sales}}" stepKey="clickOnSales"/> - <waitForPageLoad stepKey="waitForPaymentMethods"/> - <click selector="{{AdminConfigureTaxSection.salesTax}}" stepKey="clickOnTax"/> - <waitForPageLoad stepKey="waitForTax"/> - <seeElement selector="{{AdminConfigureTaxSection.taxClasses}}" stepKey="taxClassSectionC"/> - <click selector="{{AdminConfigureTaxSection.taxShippingClassSystem}}" stepKey="checkSystemDefaultValue"/> - <click selector="{{AdminConfigureTaxSection.taxClasses}}" stepKey="closeTaxClassSection"/> - - <scrollToTopOfPage stepKey="scrollToTop"/> - <click stepKey="saveTaxOptions" selector="{{AdminCategoryMainActionsSection.SaveButton}}"/> - <waitForPageLoad stepKey="waitForTaxSaved"/> - <see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/> - </actionGroup> - - <actionGroup name="addProductTaxClass"> - <annotations> - <description>Adds the provided Product Tax Class to a Tax Rule. Clicks on Save.</description> - </annotations> - <arguments> - <argument name="prodTaxClassName" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddProductTaxClassActionGroup` instead --> - <click stepKey="clickAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> - <click stepKey="clickProdAddNewTaxClassBtn" selector="{{AdminTaxRulesSection.productAddNewTaxClass}}"/> - <fillField stepKey="fillProdNewTaxClass" selector="{{AdminTaxRulesSection.fieldProdNewTaxClass}}" userInput="{{prodTaxClassName}}"/> - <click stepKey="saveProdTaxRate" selector="{{AdminTaxRulesSection.saveProdNewTaxClass}}"/> - </actionGroup> - - <actionGroup name="addNewTaxRuleActionGroup"> - <annotations> - <description>Goes to the Admin Tax Rules grid page. Clicks on the Add New Tax Rule button.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddNewTaxRuleActionGroup` instead --> - <amOnPage url="{{AdminTaxRuleGridPage.url}}" stepKey="goToTaxRulePage"/> - <waitForPageLoad stepKey="waitForTaxRatePage"/> - <click stepKey="addNewTaxRate" selector="{{AdminGridMainControls.add}}"/> - </actionGroup> - - <actionGroup name="deleteProductTaxClass"> - <annotations> - <description>Goes to the Admin Tax Rule creation page. Deletes the provided Tax Class.</description> - </annotations> - <arguments> - <argument name="taxClassName" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `DeleteProductTaxClassActionGroup` instead --> - <amOnPage url="{{AdminNewTaxRulePage.url}}" stepKey="goToNewTaxRulePage"/> - <waitForPageLoad stepKey="waitForTaxRatePage"/> - <click stepKey="clickAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> - <scrollTo stepKey="scrollToAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> - <moveMouseOver stepKey="hoverDeleteElement" selector="{{AdminTaxRulesSection.deleteTaxClassName(taxClassName)}}"/> - <click stepKey="deleteFirstTaxClass" selector="{{AdminTaxRulesSection.deleteTaxClass(taxClassName)}}"/> - <waitForElementVisible selector="{{AdminTaxRulesSection.popUpDialogOK}}" stepKey="waitForElementBecomeVisible"/> - <click stepKey="acceptPopUpDialog" selector="{{AdminTaxRulesSection.popUpDialogOK}}"/> - <waitForPageLoad stepKey="waitForProductTaxClassDeleted"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Ui/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Ui/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index 48d6b90ddb8dc..0000000000000 --- a/app/code/Magento/Ui/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,98 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="searchAdminDataGridByKeyword"> - <annotations> - <description>Fills 'Search by keyword' on an Admin Grid page. Clicks on Submit Search.</description> - </annotations> - <arguments> - <argument name="keyword"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SearchAdminDataGridByKeywordActionGroup` instead --> - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> - <fillField selector="{{AdminDataGridHeaderSection.search}}" userInput="{{keyword}}" stepKey="fillKeywordSearchField"/> - <click selector="{{AdminDataGridHeaderSection.submitSearch}}" stepKey="clickKeywordSearch"/> - </actionGroup> - - <actionGroup name="resetAdminDataGridToDefaultView"> - <annotations> - <description>Resets an Admin Grid page to the 'Default View'.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ResetAdminDataGridToDefaultViewActionGroup` instead --> - <click selector="{{AdminDataGridHeaderSection.bookmarkToggle}}" stepKey="openViewBookmarks"/> - <click selector="{{AdminDataGridHeaderSection.bookmarkOption('Default View')}}" stepKey="selectDefaultGridView"/> - <see selector="{{AdminDataGridHeaderSection.bookmarkToggle}}" userInput="Default View" stepKey="seeDefaultViewSelected"/> - </actionGroup> - - <actionGroup name="clearFiltersAdminDataGrid"> - <annotations> - <description>Clicks on 'Clear Filters' on an Admin Grid page.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ClearFiltersAdminDataGridActionGroup` instead --> - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> - </actionGroup> - - <actionGroup name="adminDataGridSelectPerPage"> - <annotations> - <description>Sets the provided preset 'per page' display setting on an Admin Grid page.</description> - </annotations> - <arguments> - <argument name="perPage" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminDataGridSelectPerPageActionGroup` instead --> - <click selector="{{AdminDataGridPaginationSection.perPageDropdown}}" stepKey="clickPerPageDropdown"/> - <click selector="{{AdminDataGridPaginationSection.perPageOption(perPage)}}" stepKey="selectCustomPerPage"/> - <waitForPageLoad stepKey="waitForGridLoad"/> - </actionGroup> - - <actionGroup name="adminDataGridSelectCustomPerPage"> - <annotations> - <description>Sets the provided custom 'per page' display setting on an Admin Grid page.</description> - </annotations> - <arguments> - <argument name="perPage"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminDataGridSelectCustomPerPageActionGroup` instead --> - <click selector="{{AdminDataGridPaginationSection.perPageDropdown}}" stepKey="clickPerPageDropdown"/> - <click selector="{{AdminDataGridPaginationSection.perPageOption('Custom')}}" stepKey="selectCustomPerPage"/> - <waitForElementVisible selector="{{AdminDataGridPaginationSection.perPageInput}}" time="30" stepKey="waitForInputVisible"/> - <fillField selector="{{AdminDataGridPaginationSection.perPageInput}}" userInput="{{perPage}}" stepKey="fillCustomPerPage"/> - <click selector="{{AdminDataGridPaginationSection.perPageApplyInput}}" stepKey="applyCustomPerPage"/> - <waitForLoadingMaskToDisappear stepKey="waitForGridLoad"/> - <seeInField selector="{{AdminDataGridPaginationSection.perPageDropDownValue}}" userInput="{{perPage}}" stepKey="seePerPageValueInDropDown"/> - </actionGroup> - - <actionGroup name="adminDataGridDeleteCustomPerPage"> - <annotations> - <description>Sets the provided custom 'per page' display setting on an Admin Grid page. Deletes the Items listed in a grid. Validates that the 'per page' count in NOT present.</description> - </annotations> - <arguments> - <argument name="perPage"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminDataGridDeleteCustomPerPageActionGroup` instead --> - <click selector="{{AdminDataGridPaginationSection.perPageDropdown}}" stepKey="clickPerPageDropdown1"/> - <click selector="{{AdminDataGridPaginationSection.perPageEditCustomValue(perPage)}}" stepKey="clickToEditCustomPerPage"/> - <waitForElementVisible selector="{{AdminDataGridPaginationSection.perPageDeleteCustomValue(perPage)}}" time="30" stepKey="waitForDeleteButtonVisible"/> - <click selector="{{AdminDataGridPaginationSection.perPageDeleteCustomValue(perPage)}}" stepKey="clickToDeleteCustomPerPage"/> - <waitForLoadingMaskToDisappear stepKey="waitForGridLoad"/> - <click selector="{{AdminDataGridPaginationSection.perPageDropdown}}" stepKey="clickPerPageDropdown"/> - <dontSeeElement selector="{{AdminDataGridPaginationSection.perPageDropDownItem(perPage)}}" stepKey="dontSeeDropDownItem"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index c990db8cc3cf8..0000000000000 --- a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,296 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminAddUrlRewrite"> - <annotations> - <description>Goes to the Admin Add URL Rewrite edit page. Fills in the provided URL details. Clicks on Save. Validates that the Success Message is present.</description> - </annotations> - <arguments> - <argument name="category" type="string"/> - <argument name="customUrlRewriteValue" type="string"/> - <argument name="storeValue" type="string"/> - <argument name="requestPath" type="string"/> - <argument name="redirectTypeValue" type="string"/> - <argument name="description" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminAddUrlRewriteActionGroup` instead --> - <amOnPage url="{{AdminUrlRewriteEditPage.url}}" stepKey="openUrlRewriteEditPage"/> - <waitForElementVisible selector="{{AdminUrlRewriteEditSection.createCustomUrlRewrite}}" stepKey="waitForCreateUrlRewriteVisible"/> - <selectOption selector="{{AdminUrlRewriteEditSection.createCustomUrlRewrite}}" userInput="{{customUrlRewriteValue}}" stepKey="selectUrlRewriteTypeOption"/> - <waitForElementVisible selector="{{AdminUrlRewriteEditSection.categoryInTree(category)}}" stepKey="waitForCategoryInTreeVisible"/> - <click selector="{{AdminUrlRewriteEditSection.categoryInTree(category)}}" stepKey="clickOnCategoryInTree"/> - <waitForElementVisible selector="{{AdminUrlRewriteEditSection.store}}" stepKey="waitForStoreSelectVisible"/> - <selectOption selector="{{AdminUrlRewriteEditSection.store}}" userInput="{{storeValue}}" stepKey="selectStoreOption"/> - <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPathField"/> - <selectOption selector="{{AdminUrlRewriteEditSection.redirectType}}" userInput="{{redirectTypeValue}}" stepKey="selectRedirectType"/> - <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescriptionField"/> - <click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveButton"/> - <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/> - <see selector="{{AdminMessagesSection.success}}" userInput="The URL Rewrite has been saved." stepKey="seeSuccessMessage"/> - </actionGroup> - - <actionGroup name="AdminAddUrlRewriteForProduct"> - <annotations> - <description>Adds the provided URL Rewrite details for a Product.</description> - </annotations> - <arguments> - <argument name="storeValue" type="string"/> - <argument name="requestPath" type="string"/> - <argument name="redirectTypeValue" type="string"/> - <argument name="description" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminAddUrlRewriteForProductActionGroup` instead --> - <waitForElementVisible selector="{{AdminUrlRewriteProductSection.skipCategoryButton}}" stepKey="waitForSkipCategoryButton"/> - <click selector="{{AdminUrlRewriteProductSection.skipCategoryButton}}" stepKey="clickOnSkipCategoryButton"/> - <waitForPageLoad stepKey="waitForProductPageToLoad"/> - <click selector="{{AdminUrlRewriteEditSection.store}}" stepKey="clickOnStore"/> - <click selector="{{AdminUrlRewriteEditSection.storeValue('storeValue')}}" stepKey="clickOnStoreValue"/> - <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPath"/> - <click selector="{{AdminUrlRewriteEditSection.redirectType}}" stepKey="selectRedirectType"/> - <click selector="{{AdminUrlRewriteEditSection.redirectTypeValue('redirectTypeValue')}}" stepKey="clickOnRedirectTypeValue"/> - <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescription"/> - <click selector="{{AdminUrlRewriteEditSection.saveButton}}" stepKey="clickOnSaveButton"/> - <seeElement selector="{{AdminUrlRewriteIndexSection.successMessage}}" stepKey="seeSuccessSaveMessage"/> - </actionGroup> - - <actionGroup name="AdminAddCustomUrlRewrite"> - <annotations> - <description>Goes to the Admin URL Rewrite edit page. Adds the provided Custom URL Rewrite details. Clicks on Save. Validates that the Success Message is present.</description> - </annotations> - <arguments> - <argument name="customUrlRewriteValue" type="string"/> - <argument name="storeValue" type="string"/> - <argument name="requestPath" type="string"/> - <argument name="targetPath" type="string"/> - <argument name="redirectTypeValue" type="string"/> - <argument name="description" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminAddCustomUrlRewriteActionGroup` instead --> - <amOnPage url="{{AdminUrlRewriteEditPage.url}}" stepKey="openUrlRewriteEditPage"/> - <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad" after="openUrlRewriteEditPage"/> - <click selector="{{AdminUrlRewriteEditSection.createCustomUrlRewrite}}" stepKey="clickOnCustonUrlRewrite"/> - <click selector="{{AdminUrlRewriteEditSection.createCustomUrlRewriteValue('customUrlRewriteValue')}}" stepKey="selectCustom"/> - <click selector="{{AdminUrlRewriteEditSection.store}}" stepKey="clickOnStore"/> - <click selector="{{AdminUrlRewriteEditSection.storeValue('storeValue')}}" stepKey="clickOnStoreValue"/> - <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPath"/> - <fillField selector="{{AdminUrlRewriteEditSection.targetPath}}" userInput="{{targetPath}}" stepKey="fillTargetPath"/> - <click selector="{{AdminUrlRewriteEditSection.redirectType}}" stepKey="selectRedirectType"/> - <click selector="{{AdminUrlRewriteEditSection.redirectTypeValue('redirectTypeValue')}}" stepKey="selectRedirectTypeValue"/> - <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescription"/> - <click selector="{{AdminUrlRewriteEditSection.saveButton}}" stepKey="clickOnSaveButton"/> - <seeElement selector="{{AdminUrlRewriteIndexSection.successMessage}}" stepKey="seeSuccessSaveMessage"/> - </actionGroup> - - <actionGroup name="AdminUpdateUrlRewrite"> - <annotations> - <description>Updates the URL Rewrite fields with the provided details.</description> - </annotations> - <arguments> - <argument name="storeValue" type="string"/> - <argument name="requestPath" type="string"/> - <argument name="redirectTypeValue" type="string"/> - <argument name="description" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminUpdateUrlRewriteActionGroup` instead --> - <click selector="{{AdminUrlRewriteEditSection.store}}" stepKey="clickOnStore"/> - <click selector="{{AdminUrlRewriteEditSection.storeValue(storeValue)}}" stepKey="clickOnStoreValue"/> - <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPath"/> - <click selector="{{AdminUrlRewriteEditSection.redirectType}}" stepKey="selectRedirectType"/> - <click selector="{{AdminUrlRewriteEditSection.redirectTypeValue(redirectTypeValue)}}" stepKey="selectRedirectTypeValue"/> - <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescription"/> - <click selector="{{AdminUrlRewriteEditSection.saveButton}}" stepKey="clickOnSaveButton"/> - <seeElement selector="{{AdminUrlRewriteIndexSection.successMessage}}" stepKey="seeSuccessSaveMessage"/> - </actionGroup> - - <actionGroup name="AdminUpdateCustomUrlRewrite"> - <annotations> - <description>Updates the Custom URL Rewrite fields with the provided details.</description> - </annotations> - <arguments> - <argument name="storeValue" type="string"/> - <argument name="requestPath" type="string"/> - <argument name="targetPath" type="string"/> - <argument name="redirectTypeValue" type="string"/> - <argument name="description" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminUpdateCustomUrlRewriteActionGroup` instead --> - <click selector="{{AdminUrlRewriteEditSection.store}}" stepKey="clickOnStore"/> - <click selector="{{AdminUrlRewriteEditSection.storeValue('storeValue')}}" stepKey="clickOnStoreValue"/> - <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPath"/> - <fillField selector="{{AdminUrlRewriteEditSection.targetPath}}" userInput="{{targetPath}}" stepKey="fillTargetPath"/> - <selectOption selector="{{AdminUrlRewriteEditSection.redirectType}}" userInput="{{redirectTypeValue}}" stepKey="selectRedirectTypeValue"/> - <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescription"/> - <click selector="{{AdminUrlRewriteEditSection.saveButton}}" stepKey="clickOnSaveButton"/> - <seeElement selector="{{AdminUrlRewriteIndexSection.successMessage}}" stepKey="seeSuccessSaveMessage"/> - </actionGroup> - <actionGroup name="AdminSearchByRequestPath"> - <annotations> - <description>Goes to the Admin URL Rewrite grid page. Searches the grid based on the provided Redirect Path. Validates that the provided Redirect Path, Type and Target Path are present and correct in the grid.</description> - </annotations> - <arguments> - <argument name="redirectPath" type="string"/> - <argument name="redirectType" type="string"/> - <argument name="targetPath" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminSearchByRequestPathActionGroup` instead --> - <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="openUrlRewriteEditPage"/> - <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad"/> - <click selector="{{AdminUrlRewriteIndexSection.resetButton}}" stepKey="clickOnResetButton"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> - <fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="{{redirectPath}}" stepKey="fillRedirectPathFilter"/> - <click selector="{{AdminUrlRewriteIndexSection.searchButton}}" stepKey="clickOnSearchButton"/> - <waitForPageLoad stepKey="waitForPageToLoad1"/> - <see selector="{{AdminUrlRewriteIndexSection.requestPathColumn('1')}}" userInput="{{redirectPath}}" stepKey="seeTheRedirectPathForOldUrl"/> - <see selector="{{AdminUrlRewriteIndexSection.targetPathColumn('1')}}" userInput="{{targetPath}}" stepKey="seeTheTargetPath"/> - <see selector="{{AdminUrlRewriteIndexSection.redirectTypeColumn('1')}}" userInput="{{redirectType}}" stepKey="seeTheRedirectTypeForOldUrl"/> - </actionGroup> - - <actionGroup name="AdminSearchUrlRewriteProductBySku"> - <annotations> - <description>Goes to the Admin URL Rewrite grid page. Searches the grid based on the provided Product SKU. Clicks on the 1st row in the grid.</description> - </annotations> - <arguments> - <argument name="productSku" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminSearchUrlRewriteProductBySkuActionGroup` instead --> - <amOnPage url="{{AdminUrlRewriteProductPage.url}}" stepKey="openUrlRewriteProductPage"/> - <waitForPageLoad stepKey="waitForUrlRewriteProductPageToLoad"/> - <click selector="{{AdminUrlRewriteProductSection.resetFilter}}" stepKey="clickOnResetFilter"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> - <fillField selector="{{AdminUrlRewriteProductSection.skuFilter}}" userInput="{{productSku}}" stepKey="fillProductSkuFilter"/> - <click selector="{{AdminUrlRewriteProductSection.searchFilter}}" stepKey="clickOnSearchFilter"/> - <waitForPageLoad stepKey="waitForProductToLoad"/> - <click selector="{{AdminUrlRewriteProductSection.productRow}}" stepKey="clickOnFirstRow"/> - <waitForPageLoad stepKey="waitForProductCategoryPageToLoad"/> - </actionGroup> - - <actionGroup name="AdminSearchDeletedUrlRewrite"> - <annotations> - <description>Goes to the Admin URL Rewrite grid page. Searches the grid for the provided Request Path. Validates that it does NOT appear in the grid.</description> - </annotations> - <arguments> - <argument name="requestPath" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminSearchDeletedUrlRewriteActionGroup` instead --> - <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="openUrlRewriteEditPage"/> - <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad"/> - <click selector="{{AdminUrlRewriteIndexSection.resetButton}}" stepKey="clickOnResetButton"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> - <fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="{{requestPath}}" stepKey="fillRedirectPathFilter"/> - <click selector="{{AdminUrlRewriteIndexSection.searchButton}}" stepKey="clickOnSearchButton"/> - <waitForPageLoad stepKey="waitForPageToLoad1"/> - <see selector="{{AdminUrlRewriteIndexSection.emptyRecords}}" userInput="We couldn't find any records." stepKey="seeEmptyRecordMessage"/> - </actionGroup> - - <actionGroup name="AdminDeleteUrlRewrite"> - <annotations> - <description>Goes to the Admin URL Rewrite grid page. Deletes the provided Request Path. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="requestPath" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminDeleteUrlRewriteActionGroup` instead --> - <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="openUrlRewriteEditPage"/> - <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad"/> - <click selector="{{AdminUrlRewriteIndexSection.resetButton}}" stepKey="clickOnResetButton"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> - <fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="{{requestPath}}" stepKey="fillRedirectPathFilter"/> - <click selector="{{AdminUrlRewriteIndexSection.searchButton}}" stepKey="clickOnSearchButton"/> - <waitForPageLoad stepKey="waitForPageToLoad1"/> - <click selector="{{AdminUrlRewriteIndexSection.editButton('1')}}" stepKey="clickOnEditButton"/> - <waitForPageLoad stepKey="waitForEditPageToLoad"/> - <click selector="{{AdminUrlRewriteEditSection.deleteButton}}" stepKey="clickOnDeleteButton"/> - <waitForPageLoad stepKey="waitForPageToLoad2"/> - <waitForElementVisible selector="{{AdminUrlRewriteEditSection.okButton}}" stepKey="waitForOkButtonToVisible"/> - <click selector="{{AdminUrlRewriteEditSection.okButton}}" stepKey="clickOnOkButton"/> - <waitForPageLoad stepKey="waitForPageToLoad3"/> - <see selector="{{AdminUrlRewriteIndexSection.successMessage}}" userInput="You deleted the URL rewrite." stepKey="seeSuccessMessage"/> - </actionGroup> - - <actionGroup name="AssertPageByUrlRewriteIsNotFound"> - <annotations> - <description>Validates that the provided Request Path does NOT exist on the Storefront. Validates that the 'Whoops' message is present and correct.</description> - </annotations> - <arguments> - <argument name="requestPath" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertPageByUrlRewriteIsNotFoundActionGroup` instead --> - <amOnPage url="{{requestPath}}" stepKey="amOnPage"/> - <waitForPageLoad stepKey="waitForStorefrontPageLoad"/> - <see userInput="Whoops, our bad..." stepKey="seeWhoops"/> - </actionGroup> - - <actionGroup name="AdminSearchAndSelectUrlRewriteInGrid"> - <annotations> - <description>Goes to the Admin URL Rewrite grid page. Searches the grid for the provided Request Path. Clicks on Edit.</description> - </annotations> - <arguments> - <argument name="requestPath" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminSearchAndSelectUrlRewriteInGridActionGroup` instead --> - <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="openUrlRewriteEditPage"/> - <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad"/> - <click selector="{{AdminUrlRewriteIndexSection.resetButton}}" stepKey="clickOnResetButton"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> - <fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="{{requestPath}}" stepKey="fillRedirectPathFilter"/> - <click selector="{{AdminUrlRewriteIndexSection.searchButton}}" stepKey="clickOnSearchButton"/> - <waitForPageLoad stepKey="waitForPageToLoad1"/> - <click selector="{{AdminUrlRewriteIndexSection.editButton('1')}}" stepKey="clickOnEditButton"/> - <waitForPageLoad stepKey="waitForEditPageToLoad"/> - </actionGroup> - - <actionGroup name="AssertStorefrontUrlRewriteRedirect"> - <annotations> - <description>Goes to the provided New URL. Validates that the redirect works and the provided Category is present.</description> - </annotations> - <arguments> - <argument name="category" type="string"/> - <argument name="newRequestPath" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertStorefrontUrlRewriteRedirectActionGroup` instead --> - <amOnPage url="{{newRequestPath}}" stepKey="openCategoryInStorefront"/> - <waitForPageLoad stepKey="waitForCategoryPageToLoad"/> - <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(category)}}" stepKey="seeCategoryOnStoreNavigationBar"/> - <seeElement selector="{{StorefrontCategoryMainSection.CategoryTitle(category)}}" stepKey="seeCategoryInTitle"/> - </actionGroup> - - <actionGroup name="AssertStorefrontProductRedirect"> - <annotations> - <description>Goes to the provided New Product URL. Validates that the redirect works and the provided Product is present and correct.</description> - </annotations> - <arguments> - <argument name="productName" type="string"/> - <argument name="productSku" type="string"/> - <argument name="productRequestPath" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertStorefrontProductRedirectActionGroup` instead --> - <amOnPage url="{{productRequestPath}}" stepKey="openCategoryInStorefront"/> - <waitForPageLoad stepKey="waitForCategoryPageToLoad"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{productName}}" stepKey="seeProductNameInStoreFrontPage"/> - <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{productSku}}" stepKey="seeProductSkuInStoreFrontPage"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index 0230f5b1c8e3e..0000000000000 --- a/app/code/Magento/User/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,69 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - - - <actionGroup name="AdminAddNewUserRoleWithCustomRoleScopes" extends="AdminAddNewUserRoleActionGroup"> - <arguments> - <argument name="customWebsiteName" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminAddNewUserRoleWithCustomRoleScopesActionGroup` instead --> - <checkOption selector="{{AdminCreateRoleSection.selectWebsite(customWebsiteName)}}" stepKey="checkWebsite" after="selectRoleResources"/> - </actionGroup> - <actionGroup name="AdminFillUserRoleRequiredData" extends="AdminCreateRoleActionGroup"> - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminFillUserRoleRequiredDataActionGroup` instead --> - <remove keyForRemoval="clickRoleResourcesTab"/> - <remove keyForRemoval="waitForScopeSelection"/> - <remove keyForRemoval="selectResourceAccessCustom"/> - <remove keyForRemoval="waitForElementVisible"/> - <remove keyForRemoval="clickContentBlockCheckbox"/> - <remove keyForRemoval="clickSaveRoleButton"/> - <remove keyForRemoval="waitForPageLoad2"/> - </actionGroup> - <actionGroup name="AdminAddRestrictedRole" extends="AdminCreateRoleActionGroup"> - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminAddRestrictedRoleActionGroup` instead --> - <remove keyForRemoval="navigateToNewRole"/> - <remove keyForRemoval="waitForPageLoad1"/> - <remove keyForRemoval="fillRoleName"/> - <remove keyForRemoval="enterPassword"/> - <remove keyForRemoval="clickRoleResourcesTab"/> - <remove keyForRemoval="waitForScopeSelection"/> - <remove keyForRemoval="clickSaveRoleButton"/> - <remove keyForRemoval="waitForPageLoad2"/> - <scrollTo selector="{{AdminEditRoleInfoSection.blockName('restrictedRole')}}" x="0" y="-100" stepKey="scrollToResourceElement" after="selectResourceAccessCustom"/> - </actionGroup> - <actionGroup name="AdminCreateRole"> - <annotations> - <description>Clicks on 'Add New Role'. Fills in the provided details (Role, Resource, Scope and Websites). Clicks on Save. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="role" type="string" defaultValue=""/> - <argument name="resource" type="string" defaultValue="All"/> - <argument name="scope" type="string" defaultValue="Custom"/> - <argument name="websites" type="string" defaultValue="Main Website"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminCreateRoleActionGroup` instead --> - <click selector="{{AdminCreateRoleSection.create}}" stepKey="clickToAddNewRole"/> - <fillField selector="{{AdminCreateRoleSection.name}}" userInput="{{role.name}}" stepKey="setRoleName"/> - <fillField stepKey="setPassword" selector="{{AdminCreateRoleSection.password}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/> - <click selector="{{AdminCreateRoleSection.roleResources}}" stepKey="clickToOpenRoleResources"/> - <waitForPageLoad stepKey="waitForRoleResourcePage" time="5"/> - <click stepKey="checkSales" selector="//a[text()='Sales']"/> - <click selector="{{AdminCreateRoleSection.save}}" stepKey="clickToSaveRole"/> - <waitForPageLoad stepKey="waitForPageLoad" time="10"/> - <see userInput="You saved the role." stepKey="seeSuccessMessage"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index ca17b0275ed5b..0000000000000 --- a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,99 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - - <actionGroup name="StorefrontCustomerCheckProductInWishlist"> - <annotations> - <description>Validates that the provided Product details (Price and Name) are present in the Storefront Customer Dashboard Wish List.</description> - </annotations> - <arguments> - <argument name="productVar"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCustomerCheckProductInWishlistActionGroup` instead --> - <waitForElement selector="{{StorefrontCustomerWishlistProductSection.ProductTitleByName(productVar.name)}}" time="30" stepKey="assertWishlistProductName"/> - <see userInput="${{productVar.price}}.00" selector="{{StorefrontCustomerWishlistProductSection.ProductPriceByName(productVar.name)}}" stepKey="AssertWishlistProductPrice"/> - <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName(productVar.name)}}" stepKey="wishlistMoveMouseOverProduct"/> - <seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductAddToCartByName(productVar.name)}}" stepKey="AssertWishlistAddToCart"/> - <seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductImageByName(productVar.name)}}" stepKey="AssertWishlistProductImage"/> - </actionGroup> - - <actionGroup name="StorefrontCustomerCheckProductInWishlistSidebar"> - <annotations> - <description>Validates that the provided Product details (Name) are present in the Wish List side bar menu.</description> - </annotations> - <arguments> - <argument name="productVar"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCustomerCheckProductInWishlistSidebarActionGroup` instead --> - <waitForElement selector="{{StorefrontCustomerWishlistSidebarSection.ProductTitleByName(productVar.name)}}" time="30" stepKey="assertWishlistSidebarProductName"/> - <see userInput="${{productVar.price}}.00" selector="{{StorefrontCustomerWishlistSidebarSection.ProductPriceByName(productVar.name)}}" stepKey="AssertWishlistSidebarProductPrice"/> - <seeElement selector="{{StorefrontCustomerWishlistSidebarSection.ProductAddToCartByName(productVar.name)}}" stepKey="AssertWishlistSidebarAddToCart"/> - <seeElement selector="{{StorefrontCustomerWishlistSidebarSection.ProductImageByName(productVar.name)}}" stepKey="AssertWishlistSidebarProductImage"/> - </actionGroup> - - <actionGroup name="StorefrontCustomerRemoveProductFromWishlistUsingSidebar"> - <annotations> - <description>Removes the provided Product from the Wish List side bar menu. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCustomerRemoveProductFromWishlistUsingSidebarActionGroup` instead --> - <click selector="{{StorefrontCustomerWishlistSidebarSection.ProductRemoveByName(product.name)}}" stepKey="RemoveProductFromWishlistUsingSidebarClickRemoveItemFromWishlist"/> - <waitForElement selector="{{StorefrontCategoryMainSection.SuccessMsg}}" time="30" stepKey="RemoveProductFromWishlistUsingSidebarWaitForSuccessMessage"/> - <see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="{{product.name}} has been removed from your Wish List." stepKey="RemoveProductFromWishlistUsingSidebarSeeProductNameRemovedFromWishlist"/> - </actionGroup> - - <actionGroup name="StorefrontCustomerAddProductToCartFromWishlistUsingSidebar"> - <annotations> - <description>Add the provided Product to the Cart from the Wish List side bar menu. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCustomerAddProductToCartFromWishlistUsingSidebarActionGroup` instead --> - <click selector="{{StorefrontCustomerWishlistSidebarSection.ProductAddToCartByName(product.name)}}" stepKey="AddProductToCartFromWishlistUsingSidebarClickAddToCartFromWishlist"/> - <waitForElement selector="{{StorefrontCategoryMainSection.SuccessMsg}}" time="30" stepKey="AddProductToCartFromWishlistUsingSidebarWaitForSuccessMessage"/> - <see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="You added {{product.name}} to your shopping cart." stepKey="AddProductToCartFromWishlistUsingSidebarSeeProductNameAddedToCartFromWishlist"/> - </actionGroup> - - <actionGroup name="StorefrontCustomerEditProductInWishlist"> - <annotations> - <description>Edits the provided Product on the Storefront Wish List page. Fills in the provided Description and Quantity. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="description" type="string"/> - <argument name="quantity" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCustomerEditProductInWishlistActionGroup` instead --> - <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName(product.name)}}" stepKey="mouseOverOnProduct"/> - <fillField selector="{{StorefrontCustomerWishlistProductSection.ProductDescription(product.name)}}" userInput="{{description}}" stepKey="fillDescription"/> - <fillField selector="{{StorefrontCustomerWishlistProductSection.ProductQuantity(product.name)}}" userInput="{{quantity}}" stepKey="fillQuantity"/> - <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductAddAllToCart}}" stepKey="mouseOver"/> - <click selector="{{StorefrontCustomerWishlistProductSection.ProductUpdateWishList}}" stepKey="submitUpdateWishlist"/> - <see selector="{{StorefrontCustomerWishlistProductSection.ProductSuccessUpdateMessage}}" userInput="{{product.name}} has been updated in your Wish List." stepKey="successMessage"/> - </actionGroup> - - <actionGroup name="StorefrontAssertCustomerWishlistIsEmpty"> - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontAssertCustomerWishlistIsEmptyActionGroup` instead --> - <dontSeeElement selector="{{StorefrontCustomerWishlistProductSection.pager}}" stepKey="checkThatPagerIsAbsent"/> - <see selector="{{StorefrontCustomerWishlistProductSection.wishlistEmpty}}" userInput="You have no items in your wish list." stepKey="checkNoItemsMessage"/> - </actionGroup> -</actionGroups> From 30b5818dde145901eb0a7a0600ef65b9cd9a9cf3 Mon Sep 17 00:00:00 2001 From: lfolco <me@laurafolco.com> Date: Sat, 7 Dec 2019 15:56:25 -0500 Subject: [PATCH 203/586] Add plugin for SalesOrderItemRepository gift message (#19093) --- .../GiftMessage/Model/Plugin/OrderItemGet.php | 76 +++++++++++++++++++ app/code/Magento/GiftMessage/etc/di.xml | 3 + .../Api/OrderGetRepositoryTest.php | 56 ++++++++++++++ .../Api/OrderItemGetRepositoryTest.php | 69 +++++++++++++++++ 4 files changed, 204 insertions(+) create mode 100644 app/code/Magento/GiftMessage/Model/Plugin/OrderItemGet.php create mode 100644 dev/tests/api-functional/testsuite/Magento/GiftMessage/Api/OrderGetRepositoryTest.php create mode 100644 dev/tests/api-functional/testsuite/Magento/GiftMessage/Api/OrderItemGetRepositoryTest.php diff --git a/app/code/Magento/GiftMessage/Model/Plugin/OrderItemGet.php b/app/code/Magento/GiftMessage/Model/Plugin/OrderItemGet.php new file mode 100644 index 0000000000000..3de69da37eef8 --- /dev/null +++ b/app/code/Magento/GiftMessage/Model/Plugin/OrderItemGet.php @@ -0,0 +1,76 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\GiftMessage\Model\Plugin; + +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\GiftMessage\Api\OrderItemRepositoryInterface as GiftMessageItemRepositoryInterface; +use Magento\Sales\Api\Data\OrderItemExtensionFactory; +use Magento\Sales\Api\Data\OrderItemInterface; +use Magento\Sales\Api\OrderItemRepositoryInterface; + +/** + * Plugin for adding gift message to order item + */ +class OrderItemGet +{ + + /** + * @var OrderItemExtensionFactory + */ + private $orderItemExtensionFactory; + + /** + * @var GiftMessageItemRepositoryInterface + */ + private $giftMessageItemRepository; + + /** + * OrderItemGet constructor. + * + * @param GiftMessageItemRepositoryInterface $giftMessageItemRepository + * @param OrderItemExtensionFactory $orderItemExtensionFactory + */ + public function __construct( + GiftMessageItemRepositoryInterface $giftMessageItemRepository, + OrderItemExtensionFactory $orderItemExtensionFactory + ) { + $this->giftMessageItemRepository = $giftMessageItemRepository; + $this->orderItemExtensionFactory = $orderItemExtensionFactory; + } + + /** + * Add gift message for order item + * + * @param OrderItemRepositoryInterface $subject + * @param OrderItemInterface $orderItem + * @return OrderItemInterface + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterGet(OrderItemRepositoryInterface $subject, OrderItemInterface $orderItem) + { + $extensionAttributes = $orderItem->getExtensionAttributes(); + if ($extensionAttributes && $extensionAttributes->getGiftMessage()) { + return $orderItem; + } + try { + /* @var \Magento\GiftMessage\Api\Data\MessageInterface $giftMessage */ + $giftMessage = $this->giftMessageItemRepository->get( + $orderItem->getOrderId(), + $orderItem->getItemId() + ); + } catch (NoSuchEntityException $e) { + return $orderItem; + } + /** @var \Magento\Sales\Api\Data\OrderItemExtension $orderItemExtension */ + $orderItemExtension = $extensionAttributes ?: $this->orderItemExtensionFactory->create(); + $orderItemExtension->setGiftMessage($giftMessage); + $orderItem->setExtensionAttributes($orderItemExtension); + + return $orderItem; + } +} diff --git a/app/code/Magento/GiftMessage/etc/di.xml b/app/code/Magento/GiftMessage/etc/di.xml index 5333084c90b75..1b079f3c9fd55 100644 --- a/app/code/Magento/GiftMessage/etc/di.xml +++ b/app/code/Magento/GiftMessage/etc/di.xml @@ -37,4 +37,7 @@ </argument> </arguments> </type> + <type name="Magento\Sales\Api\OrderItemRepositoryInterface"> + <plugin name="get_gift_message" type="Magento\GiftMessage\Model\Plugin\OrderItemGet"/> + </type> </config> diff --git a/dev/tests/api-functional/testsuite/Magento/GiftMessage/Api/OrderGetRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/GiftMessage/Api/OrderGetRepositoryTest.php new file mode 100644 index 0000000000000..7ae7e200cfb5b --- /dev/null +++ b/dev/tests/api-functional/testsuite/Magento/GiftMessage/Api/OrderGetRepositoryTest.php @@ -0,0 +1,56 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\GiftMessage\Api; + +use Magento\TestFramework\TestCase\WebapiAbstract; + +class OrderGetRepositoryTest extends WebapiAbstract +{ + const SERVICE_VERSION = 'V1'; + + const SERVICE_NAME = 'giftMessageItemRepositoryV1'; + + const RESOURCE_PATH = '/V1/orders/'; + + /** + * @magentoDataFixture Magento/GiftMessage/_files/order_with_message.php + * @magentoConfigFixture default_store sales/gift_options/allow_order 1 + * @magentoAppIsolation enabled + * @magentoDbIsolation disabled + */ + public function testGet() + { + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + /** @var \Magento\Sales\Model\Order $order */ + $order = $objectManager->create(\Magento\Sales\Model\Order::class)->loadByIncrementId('100000001'); + $orderId = $order->getId(); + $serviceInfo = [ + 'rest' => [ + 'resourcePath' => self::RESOURCE_PATH . $orderId, + 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_GET, + ], + 'soap' => [ + 'service' => self::SERVICE_NAME, + 'serviceVersion' => self::SERVICE_VERSION, + 'operation' => self::SERVICE_NAME . 'Get', + ], + ]; + $expectedMessage = [ + 'recipient' => 'Mercutio', + 'sender' => 'Romeo', + 'message' => 'I thought all for the best.', + ]; + $requestData = ["orderId" => $orderId]; + $result = $this->_webApiCall($serviceInfo, $requestData); + $resultMessage = $result['extension_attributes']['gift_message']; + static::assertCount(5, $resultMessage); + unset($resultMessage['gift_message_id']); + unset($resultMessage['customer_id']); + static::assertEquals($expectedMessage, $resultMessage); + } +} diff --git a/dev/tests/api-functional/testsuite/Magento/GiftMessage/Api/OrderItemGetRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/GiftMessage/Api/OrderItemGetRepositoryTest.php new file mode 100644 index 0000000000000..f68b50b7746eb --- /dev/null +++ b/dev/tests/api-functional/testsuite/Magento/GiftMessage/Api/OrderItemGetRepositoryTest.php @@ -0,0 +1,69 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\GiftMessage\Api; + +use Magento\TestFramework\TestCase\WebapiAbstract; + +class OrderItemGetRepositoryTest extends WebapiAbstract +{ + + const SERVICE_VERSION = 'V1'; + + const SERVICE_NAME = 'giftMessageItemRepositoryV1'; + + const RESOURCE_PATH = '/V1/orders/items/'; + + /** + * @var \Magento\TestFramework\ObjectManager + */ + protected $objectManager; + + protected function setUp() + { + $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + } + + /** + * @magentoDataFixture Magento/GiftMessage/_files/order_with_message.php + * @magentoConfigFixture default_store sales/gift_options/allow_items 1 + * @magentoAppIsolation enabled + * @magentoDbIsolation disabled + */ + public function testGet() + { + /** @var \Magento\Sales\Model\Order $order */ + $order = $this->objectManager->create(\Magento\Sales\Model\Order::class)->loadByIncrementId('100000001'); + $items = $order->getItems(); + /** @var \Magento\Sales\Api\Data\OrderItemInterface $orderItem */ + $orderItem = array_shift($items); + $itemId = $orderItem->getItemId(); + $serviceInfo = [ + 'rest' => [ + 'resourcePath' => self::RESOURCE_PATH . $itemId, + 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_GET, + ], + 'soap' => [ + 'service' => self::SERVICE_NAME, + 'serviceVersion' => self::SERVICE_VERSION, + 'operation' => self::SERVICE_NAME . 'Get', + ], + ]; + $expectedMessage = [ + 'recipient' => 'Mercutio', + 'sender' => 'Romeo', + 'message' => 'I thought all for the best.', + ]; + $requestData = ["orderItemId" => $itemId]; + $result = $this->_webApiCall($serviceInfo, $requestData); + $resultMessage = $result['extension_attributes']['gift_message']; + static::assertCount(5, $resultMessage); + unset($resultMessage['gift_message_id']); + unset($resultMessage['customer_id']); + static::assertEquals($expectedMessage, $resultMessage); + } +} From 167e2ac04dcf3bcd6c9b7cf4aadb07ea67b1fd4a Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Sun, 8 Dec 2019 14:25:22 -0600 Subject: [PATCH 204/586] Change action groups name according to CE branch changes --- app/code/Magento/Bundle/Test/Mftf/Test/EndToEndB2CAdminTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/EndToEndB2CAdminTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/EndToEndB2CAdminTest.xml index 5f7a1827a6156..7e5db7643c2dd 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/EndToEndB2CAdminTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/EndToEndB2CAdminTest.xml @@ -31,7 +31,7 @@ <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts" after="selectFirstGridRow"/> <fillField selector="{{AdminProductFormBundleSection.firstProductQuantity}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty" after="clickAddSelectedBundleProducts"/> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveBundleProduct" after="fillProductDefaultQty"/> - <actionGroup ref="viewBundleProductInAdminGrid" stepKey="viewBundleProductInGrid" after="saveBundleProduct"> + <actionGroup ref="ViewBundleProductInAdminGridActionGroup" stepKey="viewBundleProductInGrid" after="saveBundleProduct"> <argument name="product" value="BundleProduct"/> </actionGroup> From 850db28b947c495c9a320a449568319f478ed784 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Sun, 8 Dec 2019 22:24:05 +0100 Subject: [PATCH 205/586] Refactor: Add method hints to Tracking Status --- .../Shipping/Model/Tracking/Result/Status.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Shipping/Model/Tracking/Result/Status.php b/app/code/Magento/Shipping/Model/Tracking/Result/Status.php index cb24bd8ebb0e8..f3e4dcfe986f0 100644 --- a/app/code/Magento/Shipping/Model/Tracking/Result/Status.php +++ b/app/code/Magento/Shipping/Model/Tracking/Result/Status.php @@ -1,21 +1,25 @@ <?php +declare(strict_types=1); + /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + namespace Magento\Shipping\Model\Tracking\Result; /** - * Fields: - * - carrier: carrier code - * - carrierTitle: carrier title + * @method string getCarrier() + * @method Status setCarrier(string $carrierCode) + * @method string getCarrierTitle() + * @method Status setCarrierTitle(string $carrierTitle) */ -class Status extends \Magento\Shipping\Model\Tracking\Result\AbstractResult +class Status extends AbstractResult { /** * @return array */ - public function getAllData() + public function getAllData(): array { return $this->_data; } From ec9380ee1cbbf115534dba9a88ac1c1e87414cc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Sun, 8 Dec 2019 23:30:41 +0100 Subject: [PATCH 206/586] Refactor: Add method hints to Tracking Status --- app/code/Magento/Shipping/Model/Tracking/Result/Status.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/code/Magento/Shipping/Model/Tracking/Result/Status.php b/app/code/Magento/Shipping/Model/Tracking/Result/Status.php index f3e4dcfe986f0..04ff29139d926 100644 --- a/app/code/Magento/Shipping/Model/Tracking/Result/Status.php +++ b/app/code/Magento/Shipping/Model/Tracking/Result/Status.php @@ -9,6 +9,8 @@ namespace Magento\Shipping\Model\Tracking\Result; /** + * Tracking Status DataObject + * * @method string getCarrier() * @method Status setCarrier(string $carrierCode) * @method string getCarrierTitle() @@ -17,6 +19,8 @@ class Status extends AbstractResult { /** + * Returns all Status data + * * @return array */ public function getAllData(): array From aa3660e3f568dc791ce5df536bd47f4485a79120 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Sun, 8 Dec 2019 16:48:12 -0600 Subject: [PATCH 207/586] Change action groups name according to CE branch changes --- .../Mftf/Test/StorefrontCheckoutDisabledBundleProductTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutDisabledBundleProductTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutDisabledBundleProductTest.xml index 97eceae962bfb..f5cd6720c07ad 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutDisabledBundleProductTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutDisabledBundleProductTest.xml @@ -47,7 +47,7 @@ <deleteData createDataKey="createBundleDynamicProduct" stepKey="deleteBundleProduct"/> </after> <!-- Add simple product to the cart --> - <actionGroup ref="AddSimpleProductToCart" stepKey="cartAddSimpleProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="cartAddSimpleProductToCart"> <argument name="product" value="$$createSimpleProduct$$"/> <argument name="productCount" value="1"/> </actionGroup> From 2baf1ea4d195ca75d50555570a9a54f212014d03 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Sun, 8 Dec 2019 19:53:43 -0600 Subject: [PATCH 208/586] Change action groups name according to CE branch changes --- .../Mftf/Test/StorefrontCheckoutDisabledBundleProductTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutDisabledBundleProductTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutDisabledBundleProductTest.xml index f5cd6720c07ad..7405a3100728f 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutDisabledBundleProductTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutDisabledBundleProductTest.xml @@ -56,7 +56,7 @@ <waitForPageLoad stepKey="waitForPageLoad"/> <!-- Add bundle product to the cart --> <click selector="{{StorefrontBundleProductActionSection.customizeAndAddToCartButton}}" stepKey="clickCustomizeAndAddToCart"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProductToCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProductToCart"> <argument name="productName" value="$$createBundleDynamicProduct.name$$"/> </actionGroup> <!-- Login to admin panel --> From 927f9dc0eac20bd6f24a29a64083588ba080e7a5 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Sun, 8 Dec 2019 21:09:24 -0600 Subject: [PATCH 209/586] Change action groups name according to CE branch changes --- .../DeleteAllDuplicateProductUsingProductGridActionGroup.xml | 2 +- .../Test/Mftf/Test/NoErrorForMiniCartItemEditTest.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteAllDuplicateProductUsingProductGridActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteAllDuplicateProductUsingProductGridActionGroup.xml index 8dabf2037bf39..8f057052d3e2c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteAllDuplicateProductUsingProductGridActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteAllDuplicateProductUsingProductGridActionGroup.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="DeleteAllDuplicateProductUsingProductGridActionGroup" extends="DeleteProductUsingProductGridActionGroup"> <annotations> - <description>EXTENDS: deleteProductUsingProductGrid. Removes 'seeProductSkuInGrid'.</description> + <description>EXTENDS: DeleteProductUsingProductGridActionGroup. Removes 'seeProductSkuInGrid'.</description> </annotations> <arguments> <argument name="product"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoErrorForMiniCartItemEditTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoErrorForMiniCartItemEditTest.xml index 2d0c4a05c1dec..85209595d620d 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoErrorForMiniCartItemEditTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoErrorForMiniCartItemEditTest.xml @@ -20,7 +20,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> <createData entity="ApiCategory" stepKey="createCategory"/> <!-- Create Configurable product --> - <actionGroup ref="createConfigurableProduct" stepKey="createProduct"> + <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> <argument name="product" value="_defaultProduct"/> <argument name="category" value="$$createCategory$$"/> </actionGroup> From dcfbbdf04a226cf4e8290e16109dcfbe142e2e4c Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Mon, 9 Dec 2019 00:27:18 -0600 Subject: [PATCH 210/586] Change action groups name according to CE branch changes --- .../Test/Mftf/ActionGroup/DeleteProductByNameActionGroup.xml | 2 +- .../Test/Mftf/Test/NoErrorForMiniCartItemEditTest.xml | 2 +- .../Sales/Test/Mftf/ActionGroup/OpenOrderByIdActionGroup.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductByNameActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductByNameActionGroup.xml index 0541a5ba67d30..3a4af44158497 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductByNameActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductByNameActionGroup.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="DeleteProductByNameActionGroup" extends="DeleteProductBySkuActionGroup"> <annotations> - <description>EXTENDS: deleteProductBySku. Deletes the provided Product Name.</description> + <description>EXTENDS: DeleteProductBySkuActionGroup. Deletes the provided Product Name.</description> </annotations> <arguments> <argument name="sku" type="string" defaultValue=""/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoErrorForMiniCartItemEditTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoErrorForMiniCartItemEditTest.xml index 85209595d620d..42bad3e4bb8bf 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoErrorForMiniCartItemEditTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoErrorForMiniCartItemEditTest.xml @@ -28,7 +28,7 @@ <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete the first simple product --> - <actionGroup stepKey="deleteProduct1" ref="deleteProductBySku"> + <actionGroup stepKey="deleteProduct1" ref="DeleteProductBySkuActionGroup"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/OpenOrderByIdActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/OpenOrderByIdActionGroup.xml index ca05041140f47..16dacff3ecf81 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/OpenOrderByIdActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/OpenOrderByIdActionGroup.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="OpenOrderByIdActionGroup" extends="FilterOrderGridByIdActionGroup"> <annotations> - <description>EXTENDS: filterOrderGridById. Clicks on the 1st row of the Admin Orders grid.</description> + <description>EXTENDS: FilterOrderGridByIdActionGroup. Clicks on the 1st row of the Admin Orders grid.</description> </annotations> <click selector="{{AdminDataGridTableSection.firstRow}}" after="clickOrderApplyFilters" stepKey="openOrderViewPage"/> From e64ce9d93b6b12f99f6d5b7c5e7b3d9a1de5547b Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Mon, 9 Dec 2019 01:07:24 -0600 Subject: [PATCH 211/586] Change action groups name according to CE branch changes --- .../AdminUpdateCmsPageRewriteEntityWithNoRedirectTest.xml | 4 ++-- ...dminUpdateCmsPageRewriteEntityWithPermanentReirectTest.xml | 4 ++-- ...minUpdateCmsPageRewriteEntityWithTemporaryRedirectTest.xml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithNoRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithNoRedirectTest.xml index 81dedfea7a35e..03027ce2ab7e9 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithNoRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithNoRedirectTest.xml @@ -29,7 +29,7 @@ <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView"/> <!-- Open CMS Edit Page, Get the CMS ID and Modify Store View Option to All Store Views --> - <actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPage"> + <actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage"> <argument name="CMSPage" value="$$createCMSPage$$"/> </actionGroup> <grabFromCurrentUrl stepKey="cmsId" regex="#\/([0-9]*)?\/$#"/> @@ -71,7 +71,7 @@ <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="storefrontSwitchToCustomStoreView"> <argument name="storeView" value="customStore"/> </actionGroup> - <actionGroup ref="navigateToStorefrontForCreatedPage" stepKey="navigateToTheStoreFront"> + <actionGroup ref="NavigateToStorefrontForCreatedPageActionGroup" stepKey="navigateToTheStoreFront"> <argument name="page" value="newrequestpath"/> </actionGroup> <actionGroup ref="AssertStoreFrontCMSPage" stepKey="assertCMSPage"> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithPermanentReirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithPermanentReirectTest.xml index f073794896c2c..9159b6536e486 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithPermanentReirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithPermanentReirectTest.xml @@ -29,7 +29,7 @@ <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView"/> <!-- Open CMS Edit Page, Get the CMS ID and Modify Store View Option to All Store Views --> - <actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPage"> + <actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage"> <argument name="CMSPage" value="$$createCMSPage$$"/> </actionGroup> <grabFromCurrentUrl stepKey="cmsId" regex="#\/([0-9]*)?\/$#"/> @@ -67,7 +67,7 @@ </actionGroup> <!-- Assert Url Rewrite Cms Page Redirect --> - <actionGroup ref="navigateToStorefrontForCreatedPage" stepKey="navigateToTheStoreFront"> + <actionGroup ref="NavigateToStorefrontForCreatedPageActionGroup" stepKey="navigateToTheStoreFront"> <argument name="page" value="permanentrequestpath.htm"/> </actionGroup> <actionGroup ref="AssertStoreFrontCMSPage" stepKey="assertCMSPage"> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithTemporaryRedirectTest.xml index 8f04fe7cf9ab9..9e509808427bb 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithTemporaryRedirectTest.xml @@ -29,7 +29,7 @@ <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView"/> <!-- Open CMS Edit Page, Get the CMS ID and Modify Store View Option to All Store Views --> - <actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPage"> + <actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage"> <argument name="CMSPage" value="$$createCMSPage$$"/> </actionGroup> <grabFromCurrentUrl stepKey="cmsId" regex="#\/([0-9]*)?\/$#"/> @@ -67,7 +67,7 @@ </actionGroup> <!-- Assert Url Rewrite Cms Page Redirect --> - <actionGroup ref="navigateToStorefrontForCreatedPage" stepKey="navigateToTheStoreFront"> + <actionGroup ref="NavigateToStorefrontForCreatedPageActionGroup" stepKey="navigateToTheStoreFront"> <argument name="page" value="temporaryrequestpath.html"/> </actionGroup> <actionGroup ref="AssertStoreFrontCMSPage" stepKey="assertCMSPage"> From fced55289bc6ce2ee6c7652bfa4b8cb5e80e2441 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Mon, 9 Dec 2019 01:42:18 -0600 Subject: [PATCH 212/586] Change action groups name according to CE branch changes --- ...minUpdateCmsPageRewriteEntityWithNoRedirectTest.xml | 10 +++++----- ...ateCmsPageRewriteEntityWithPermanentReirectTest.xml | 10 +++++----- ...teCmsPageRewriteEntityWithTemporaryRedirectTest.xml | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithNoRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithNoRedirectTest.xml index 03027ce2ab7e9..98c1839f99859 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithNoRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithNoRedirectTest.xml @@ -33,13 +33,13 @@ <argument name="CMSPage" value="$$createCMSPage$$"/> </actionGroup> <grabFromCurrentUrl stepKey="cmsId" regex="#\/([0-9]*)?\/$#"/> - <actionGroup ref="AddStoreViewToCmsPage" stepKey="updateStoreViewForCmsPage"> + <actionGroup ref="AddStoreViewToCmsPageActionGroup" stepKey="updateStoreViewForCmsPage"> <argument name="CMSPage" value="$$createCMSPage$$"/> <argument name="storeViewName" value="All Store Views"/> </actionGroup> <!--Create CMS Page URL Redirect--> - <actionGroup ref="AdminAddCustomUrlRewrite" stepKey="addCustomUrlRewrite"> + <actionGroup ref="AdminAddCustomUrlRewriteActionGroup" stepKey="addCustomUrlRewrite"> <argument name="customUrlRewriteValue" value="Custom"/> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="created-new-cms-page"/> @@ -49,7 +49,7 @@ </actionGroup> <!--Search created CMS page url rewrite in grid--> - <actionGroup ref="AdminSearchAndSelectUrlRewriteInGrid" stepKey="searchUrlRewrite"> + <actionGroup ref="AdminSearchAndSelectUrlRewriteInGridActionGroup" stepKey="searchUrlRewrite"> <argument name="requestPath" value="created-new-cms-page"/> </actionGroup> @@ -74,13 +74,13 @@ <actionGroup ref="NavigateToStorefrontForCreatedPageActionGroup" stepKey="navigateToTheStoreFront"> <argument name="page" value="newrequestpath"/> </actionGroup> - <actionGroup ref="AssertStoreFrontCMSPage" stepKey="assertCMSPage"> + <actionGroup ref="AssertStoreFrontCMSPageActionGroup" stepKey="assertCMSPage"> <argument name="cmsTitle" value="$$createCMSPage.title$$"/> <argument name="cmsContent" value="$$createCMSPage.content$$"/> <argument name="cmsContentHeading" value="$$createCMSPage.content_heading$$"/> </actionGroup> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite"> + <actionGroup ref="AdminDeleteUrlRewriteActionGroup" stepKey="deleteCustomUrlRewrite"> <argument name="requestPath" value="newrequestpath"/> </actionGroup> <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteCustomStoreView"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithPermanentReirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithPermanentReirectTest.xml index 9159b6536e486..c99cdb95758e5 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithPermanentReirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithPermanentReirectTest.xml @@ -33,13 +33,13 @@ <argument name="CMSPage" value="$$createCMSPage$$"/> </actionGroup> <grabFromCurrentUrl stepKey="cmsId" regex="#\/([0-9]*)?\/$#"/> - <actionGroup ref="AddStoreViewToCmsPage" stepKey="updateStoreViewForCmsPage"> + <actionGroup ref="AddStoreViewToCmsPageActionGroup" stepKey="updateStoreViewForCmsPage"> <argument name="CMSPage" value="$$createCMSPage$$"/> <argument name="storeViewName" value="All Store Views"/> </actionGroup> <!--Create CMS Page URL Redirect--> - <actionGroup ref="AdminAddCustomUrlRewrite" stepKey="addCustomUrlRewrite"> + <actionGroup ref="AdminAddCustomUrlRewriteActionGroup" stepKey="addCustomUrlRewrite"> <argument name="customUrlRewriteValue" value="Custom"/> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="created-new-cms-page"/> @@ -49,7 +49,7 @@ </actionGroup> <!--Search created CMS page url rewrite in grid--> - <actionGroup ref="AdminSearchAndSelectUrlRewriteInGrid" stepKey="searchUrlRewrite"> + <actionGroup ref="AdminSearchAndSelectUrlRewriteInGridActionGroup" stepKey="searchUrlRewrite"> <argument name="requestPath" value="created-new-cms-page"/> </actionGroup> @@ -70,13 +70,13 @@ <actionGroup ref="NavigateToStorefrontForCreatedPageActionGroup" stepKey="navigateToTheStoreFront"> <argument name="page" value="permanentrequestpath.htm"/> </actionGroup> - <actionGroup ref="AssertStoreFrontCMSPage" stepKey="assertCMSPage"> + <actionGroup ref="AssertStoreFrontCMSPageActionGroup" stepKey="assertCMSPage"> <argument name="cmsTitle" value="$$createCMSPage.title$$"/> <argument name="cmsContent" value="$$createCMSPage.content$$"/> <argument name="cmsContentHeading" value="$$createCMSPage.content_heading$$"/> </actionGroup> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite"> + <actionGroup ref="AdminDeleteUrlRewriteActionGroup" stepKey="deleteCustomUrlRewrite"> <argument name="requestPath" value="permanentrequestpath.htm"/> </actionGroup> <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteCustomStoreView"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithTemporaryRedirectTest.xml index 9e509808427bb..644f495856f07 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithTemporaryRedirectTest.xml @@ -33,13 +33,13 @@ <argument name="CMSPage" value="$$createCMSPage$$"/> </actionGroup> <grabFromCurrentUrl stepKey="cmsId" regex="#\/([0-9]*)?\/$#"/> - <actionGroup ref="AddStoreViewToCmsPage" stepKey="updateStoreViewForCmsPage"> + <actionGroup ref="AddStoreViewToCmsPageActionGroup" stepKey="updateStoreViewForCmsPage"> <argument name="CMSPage" value="$$createCMSPage$$"/> <argument name="storeViewName" value="All Store Views"/> </actionGroup> <!--Create CMS Page URL Redirect--> - <actionGroup ref="AdminAddCustomUrlRewrite" stepKey="addCustomUrlRewrite"> + <actionGroup ref="AdminAddCustomUrlRewriteActionGroup" stepKey="addCustomUrlRewrite"> <argument name="customUrlRewriteValue" value="Custom"/> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="created-new-cms-page"/> @@ -49,7 +49,7 @@ </actionGroup> <!--Search created CMS page url rewrite in grid--> - <actionGroup ref="AdminSearchAndSelectUrlRewriteInGrid" stepKey="searchUrlRewrite"> + <actionGroup ref="AdminSearchAndSelectUrlRewriteInGridActionGroup" stepKey="searchUrlRewrite"> <argument name="requestPath" value="created-new-cms-page"/> </actionGroup> @@ -70,13 +70,13 @@ <actionGroup ref="NavigateToStorefrontForCreatedPageActionGroup" stepKey="navigateToTheStoreFront"> <argument name="page" value="temporaryrequestpath.html"/> </actionGroup> - <actionGroup ref="AssertStoreFrontCMSPage" stepKey="assertCMSPage"> + <actionGroup ref="AssertStoreFrontCMSPageActionGroup" stepKey="assertCMSPage"> <argument name="cmsTitle" value="$$createCMSPage.title$$"/> <argument name="cmsContent" value="$$createCMSPage.content$$"/> <argument name="cmsContentHeading" value="$$createCMSPage.content_heading$$"/> </actionGroup> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite"> + <actionGroup ref="AdminDeleteUrlRewriteActionGroup" stepKey="deleteCustomUrlRewrite"> <argument name="requestPath" value="temporaryrequestpath.html"/> </actionGroup> <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteCustomStoreView"/> From 206f2dd8928ef5f2198c2c199f80bc568e59debf Mon Sep 17 00:00:00 2001 From: Lukasz Bajsarowicz <lukasz.bajsarowicz@gmail.com> Date: Mon, 9 Dec 2019 11:00:18 +0100 Subject: [PATCH 213/586] Update app/code/Magento/Shipping/Model/Tracking/Result/Status.php Co-Authored-By: Ihor Sviziev <ihor-sviziev@users.noreply.github.com> --- app/code/Magento/Shipping/Model/Tracking/Result/Status.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Shipping/Model/Tracking/Result/Status.php b/app/code/Magento/Shipping/Model/Tracking/Result/Status.php index 04ff29139d926..5f80c31120ec1 100644 --- a/app/code/Magento/Shipping/Model/Tracking/Result/Status.php +++ b/app/code/Magento/Shipping/Model/Tracking/Result/Status.php @@ -13,7 +13,7 @@ * * @method string getCarrier() * @method Status setCarrier(string $carrierCode) - * @method string getCarrierTitle() + * @method string|null getCarrierTitle() * @method Status setCarrierTitle(string $carrierTitle) */ class Status extends AbstractResult From 9a40b1656a6568963c540bd234889d736dbbf492 Mon Sep 17 00:00:00 2001 From: Lukasz Bajsarowicz <lukasz.bajsarowicz@gmail.com> Date: Mon, 9 Dec 2019 11:00:29 +0100 Subject: [PATCH 214/586] Update app/code/Magento/Shipping/Model/Tracking/Result/Status.php Co-Authored-By: Ihor Sviziev <ihor-sviziev@users.noreply.github.com> --- app/code/Magento/Shipping/Model/Tracking/Result/Status.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Shipping/Model/Tracking/Result/Status.php b/app/code/Magento/Shipping/Model/Tracking/Result/Status.php index 5f80c31120ec1..784b806fa3f86 100644 --- a/app/code/Magento/Shipping/Model/Tracking/Result/Status.php +++ b/app/code/Magento/Shipping/Model/Tracking/Result/Status.php @@ -11,7 +11,7 @@ /** * Tracking Status DataObject * - * @method string getCarrier() + * @method string|null getCarrier() * @method Status setCarrier(string $carrierCode) * @method string|null getCarrierTitle() * @method Status setCarrierTitle(string $carrierTitle) From 232e80880ac92153109032a5f5409aad6d5ae38d Mon Sep 17 00:00:00 2001 From: Max Romanov <maxromanov4669@gmail.com> Date: Mon, 9 Dec 2019 13:11:50 +0200 Subject: [PATCH 215/586] 14663-customer-group-rest-api-fix --- .../Model/ResourceModel/CustomerRepository.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/code/Magento/Customer/Model/ResourceModel/CustomerRepository.php b/app/code/Magento/Customer/Model/ResourceModel/CustomerRepository.php index 03cf4b1bdddec..1f2d3726b8fa7 100644 --- a/app/code/Magento/Customer/Model/ResourceModel/CustomerRepository.php +++ b/app/code/Magento/Customer/Model/ResourceModel/CustomerRepository.php @@ -214,6 +214,7 @@ public function save(CustomerInterface $customer, $passwordHash = null) $prevCustomerData ? $prevCustomerData->getStoreId() : $this->storeManager->getStore()->getId() ); } + $this->setCustomerGroupId($customerModel, $customerArr, $prevCustomerDataArr); // Need to use attribute set or future updates can cause data loss if (!$customerModel->getAttributeSetId()) { $customerModel->setAttributeSetId(CustomerMetadataInterface::ATTRIBUTE_SET_ID_CUSTOMER); @@ -452,4 +453,18 @@ private function setValidationFlag($customerArray, $customerModel) $customerModel->setData('ignore_validation_flag', true); } } + + /** + * Set customer group id + * + * @param Customer $customerModel + * @param array $customerArr + * @param array $prevCustomerDataArr + */ + private function setCustomerGroupId($customerModel, $customerArr, $prevCustomerDataArr) + { + if (!isset($customerArr['group_id']) && $prevCustomerDataArr && isset($prevCustomerDataArr['group_id'])) { + $customerModel->setGroupId($prevCustomerDataArr['group_id']); + } + } } From 9be67b62f0250a4c8b1af534ab49e44ff95b2d44 Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <nazarn96@gmail.com> Date: Mon, 9 Dec 2019 12:59:53 +0200 Subject: [PATCH 216/586] Static test fix --- .../Model/OperationProcessor.php | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/app/code/Magento/AsynchronousOperations/Model/OperationProcessor.php b/app/code/Magento/AsynchronousOperations/Model/OperationProcessor.php index b1bc990159bf3..453f786bdf47b 100644 --- a/app/code/Magento/AsynchronousOperations/Model/OperationProcessor.php +++ b/app/code/Magento/AsynchronousOperations/Model/OperationProcessor.php @@ -8,24 +8,24 @@ namespace Magento\AsynchronousOperations\Model; -use Magento\Framework\Serialize\Serializer\Json; use Magento\AsynchronousOperations\Api\Data\OperationInterface; -use Magento\Framework\Bulk\OperationManagementInterface; use Magento\AsynchronousOperations\Model\ConfigInterface as AsyncConfig; -use Magento\Framework\MessageQueue\MessageValidator; -use Magento\Framework\MessageQueue\MessageEncoder; -use Magento\Framework\Exception\NoSuchEntityException; -use Magento\Framework\MessageQueue\ConsumerConfigurationInterface; -use Psr\Log\LoggerInterface; -use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Bulk\OperationManagementInterface; +use Magento\Framework\Communication\ConfigInterface as CommunicationConfig; use Magento\Framework\DB\Adapter\ConnectionException; use Magento\Framework\DB\Adapter\DeadlockException; use Magento\Framework\DB\Adapter\LockWaitException; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\MessageQueue\ConsumerConfigurationInterface; +use Magento\Framework\MessageQueue\MessageEncoder; +use Magento\Framework\MessageQueue\MessageValidator; +use Magento\Framework\Serialize\Serializer\Json; use Magento\Framework\Webapi\ServiceOutputProcessor; -use Magento\Framework\Communication\ConfigInterface as CommunicationConfig; +use Psr\Log\LoggerInterface; /** - * Class OperationProcessor + * Proccess operation * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ @@ -136,7 +136,9 @@ public function process(string $encodedMessage) $result = $this->executeHandler($callback, $entityParams); $status = $result['status']; $errorCode = $result['error_code']; + // phpcs:disable Magento2.Performance.ForeachArrayMerge $messages = array_merge($messages, $result['messages']); + // phpcs:enable Magento2.Performance.ForeachArrayMerge $outputData = $result['output_data']; } } @@ -186,7 +188,9 @@ private function executeHandler($callback, $entityParams) 'output_data' => null ]; try { + // phpcs:disable Magento2.Functions.DiscouragedFunction $result['output_data'] = call_user_func_array($callback, $entityParams); + // phpcs:enable Magento2.Functions.DiscouragedFunction $result['messages'][] = sprintf('Service execution success %s::%s', get_class($callback[0]), $callback[1]); } catch (\Zend_Db_Adapter_Exception $e) { $this->logger->critical($e->getMessage()); From 9dc550be1bd09a2c44bf292d3c9ed7299367871c Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <nazarn96@gmail.com> Date: Mon, 9 Dec 2019 15:11:23 +0200 Subject: [PATCH 217/586] Static test fix --- .../Magento/AdminNotification/Block/Grid/Renderer/Actions.php | 2 -- .../Magento/AdminNotification/Block/Grid/Renderer/Notice.php | 2 -- .../Magento/AdminNotification/Block/Grid/Renderer/Severity.php | 2 -- 3 files changed, 6 deletions(-) diff --git a/app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php b/app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php index 0a19531a34a0c..f74f62ef000e6 100644 --- a/app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php +++ b/app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php @@ -18,8 +18,6 @@ /** * Renderer class for action in the admin notifications grid - * - * @package Magento\AdminNotification\Block\Grid\Renderer */ class Actions extends AbstractRenderer { diff --git a/app/code/Magento/AdminNotification/Block/Grid/Renderer/Notice.php b/app/code/Magento/AdminNotification/Block/Grid/Renderer/Notice.php index bd553e97aff79..4aa5d90e08014 100644 --- a/app/code/Magento/AdminNotification/Block/Grid/Renderer/Notice.php +++ b/app/code/Magento/AdminNotification/Block/Grid/Renderer/Notice.php @@ -14,8 +14,6 @@ /** * Renderer class for notice in the admin notifications grid - * - * @package Magento\AdminNotification\Block\Grid\Renderer */ class Notice extends AbstractRenderer { diff --git a/app/code/Magento/AdminNotification/Block/Grid/Renderer/Severity.php b/app/code/Magento/AdminNotification/Block/Grid/Renderer/Severity.php index f7f8633e42e79..fd3d5c584d6fa 100644 --- a/app/code/Magento/AdminNotification/Block/Grid/Renderer/Severity.php +++ b/app/code/Magento/AdminNotification/Block/Grid/Renderer/Severity.php @@ -17,8 +17,6 @@ /** * Renderer class for severity in the admin notifications grid - * - * @package Magento\AdminNotification\Block\Grid\Renderer */ class Severity extends AbstractRenderer { From 1a1ca42ff4af7e5621455ed92eb76e5dddadeadb Mon Sep 17 00:00:00 2001 From: Max Romanov <maxromanov4669@gmail.com> Date: Mon, 9 Dec 2019 16:31:50 +0200 Subject: [PATCH 218/586] fix code style --- .../Customer/Model/ResourceModel/CustomerRepository.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Customer/Model/ResourceModel/CustomerRepository.php b/app/code/Magento/Customer/Model/ResourceModel/CustomerRepository.php index 1f2d3726b8fa7..323b6c5d53714 100644 --- a/app/code/Magento/Customer/Model/ResourceModel/CustomerRepository.php +++ b/app/code/Magento/Customer/Model/ResourceModel/CustomerRepository.php @@ -31,6 +31,8 @@ /** * Customer repository. * + * CRUD operations for customer entity + * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @SuppressWarnings(PHPMD.TooManyFields) */ @@ -187,8 +189,7 @@ public function save(CustomerInterface $customer, $passwordHash = null) { /** @var NewOperation|null $delegatedNewOperation */ $delegatedNewOperation = !$customer->getId() ? $this->delegatedStorage->consumeNewOperation() : null; - $prevCustomerData = null; - $prevCustomerDataArr = null; + $prevCustomerData = $prevCustomerDataArr = null; if ($customer->getId()) { $prevCustomerData = $this->getById($customer->getId()); $prevCustomerDataArr = $prevCustomerData->__toArray(); From 799b72a666c42120961a7b147c1a34a687b27265 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Mon, 9 Dec 2019 10:29:01 -0600 Subject: [PATCH 219/586] Change action groups name according to CE branch changes --- .../Test/AdminUpdateCmsPageRewriteEntityWithNoRedirectTest.xml | 2 +- .../AdminUpdateCmsPageRewriteEntityWithPermanentReirectTest.xml | 2 +- ...AdminUpdateCmsPageRewriteEntityWithTemporaryRedirectTest.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithNoRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithNoRedirectTest.xml index 98c1839f99859..6467a5051631d 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithNoRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithNoRedirectTest.xml @@ -54,7 +54,7 @@ </actionGroup> <!-- Update URL Rewrite for CMS Page --> - <actionGroup ref="AdminUpdateUrlRewrite" stepKey="updateUrlRewriteFirstAttempt"> + <actionGroup ref="AdminUpdateUrlRewriteActionGroup" stepKey="updateUrlRewriteFirstAttempt"> <argument name="storeValue" value="{{customStore.name}}"/> <argument name="requestPath" value="newrequestpath"/> <argument name="redirectTypeValue" value="No"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithPermanentReirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithPermanentReirectTest.xml index c99cdb95758e5..3bf278db8410a 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithPermanentReirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithPermanentReirectTest.xml @@ -54,7 +54,7 @@ </actionGroup> <!-- Update URL Rewrite for CMS Page --> - <actionGroup ref="AdminUpdateUrlRewrite" stepKey="updateUrlRewrite"> + <actionGroup ref="AdminUpdateUrlRewriteActionGroup" stepKey="updateUrlRewrite"> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="permanentrequestpath.htm"/> <argument name="redirectTypeValue" value="Permanent (301)"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithTemporaryRedirectTest.xml index 644f495856f07..a7cadcdf753c3 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithTemporaryRedirectTest.xml @@ -54,7 +54,7 @@ </actionGroup> <!-- Update URL Rewrite for CMS Page --> - <actionGroup ref="AdminUpdateUrlRewrite" stepKey="updateUrlRewrite"> + <actionGroup ref="AdminUpdateUrlRewriteActionGroup" stepKey="updateUrlRewrite"> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="temporaryrequestpath.html"/> <argument name="redirectTypeValue" value="Temporary (302)"/> From 2c705123e2ea9f5fdb34fc89eaf568f2336c1239 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Szubert?= <bartlomiejszubert@gmail.com> Date: Tue, 1 Oct 2019 23:40:57 +0200 Subject: [PATCH 220/586] Fix #21684 - Currency sign for "Layered Navigation Price Step" is not according to default settings --- .../Catalog/Model/Category/DataProvider.php | 198 ++++++++---------- .../Unit/Model/Category/DataProviderTest.php | 112 +++++----- .../adminhtml/ui_component/category_form.xml | 1 - 3 files changed, 149 insertions(+), 162 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Category/DataProvider.php b/app/code/Magento/Catalog/Model/Category/DataProvider.php index 283e3f87686b9..e4fa897e65b67 100644 --- a/app/code/Magento/Catalog/Model/Category/DataProvider.php +++ b/app/code/Magento/Catalog/Model/Category/DataProvider.php @@ -20,8 +20,11 @@ use Magento\Eav\Model\Entity\Attribute\Source\SpecificSourceInterface; use Magento\Eav\Model\Entity\Type; use Magento\Framework\App\ObjectManager; +use Magento\Framework\App\RequestInterface; +use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\Filesystem; +use Magento\Framework\Registry; use Magento\Framework\Stdlib\ArrayManager; use Magento\Framework\Stdlib\ArrayUtils; use Magento\Store\Model\Store; @@ -30,6 +33,7 @@ use Magento\Ui\DataProvider\EavValidationRules; use Magento\Ui\DataProvider\Modifier\PoolInterface; use Magento\Framework\AuthorizationInterface; +use Magento\Ui\DataProvider\ModifierPoolDataProvider; /** * Category form data provider. @@ -39,7 +43,7 @@ * @SuppressWarnings(PHPMD.TooManyFields) * @since 101.0.0 */ -class DataProvider extends \Magento\Ui\DataProvider\ModifierPoolDataProvider +class DataProvider extends ModifierPoolDataProvider { /** * @var string @@ -106,6 +110,15 @@ class DataProvider extends \Magento\Ui\DataProvider\ModifierPoolDataProvider 'position' ]; + /** + * Elements with currency symbol + * + * @var array + */ + private $elementsWithCurrencySymbol = [ + 'filter_price_range', + ]; + /** * @var EavValidationRules * @since 101.0.0 @@ -113,13 +126,13 @@ class DataProvider extends \Magento\Ui\DataProvider\ModifierPoolDataProvider protected $eavValidationRules; /** - * @var \Magento\Framework\Registry + * @var Registry * @since 101.0.0 */ protected $registry; /** - * @var \Magento\Framework\App\RequestInterface + * @var RequestInterface * @since 101.0.0 */ protected $request; @@ -171,16 +184,19 @@ class DataProvider extends \Magento\Ui\DataProvider\ModifierPoolDataProvider * @param EavValidationRules $eavValidationRules * @param CategoryCollectionFactory $categoryCollectionFactory * @param StoreManagerInterface $storeManager - * @param \Magento\Framework\Registry $registry + * @param Registry $registry * @param Config $eavConfig - * @param \Magento\Framework\App\RequestInterface $request + * @param RequestInterface $request * @param CategoryFactory $categoryFactory * @param array $meta * @param array $data * @param PoolInterface|null $pool * @param AuthorizationInterface|null $auth * @param ArrayUtils|null $arrayUtils - * @throws \Magento\Framework\Exception\LocalizedException + * @param ScopeOverriddenValue|null $scopeOverriddenValue + * @param ArrayManager|null $arrayManager + * @param Filesystem|null $fileInfo + * @throws LocalizedException * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -190,15 +206,18 @@ public function __construct( EavValidationRules $eavValidationRules, CategoryCollectionFactory $categoryCollectionFactory, StoreManagerInterface $storeManager, - \Magento\Framework\Registry $registry, + Registry $registry, Config $eavConfig, - \Magento\Framework\App\RequestInterface $request, + RequestInterface $request, CategoryFactory $categoryFactory, array $meta = [], array $data = [], PoolInterface $pool = null, ?AuthorizationInterface $auth = null, - ?ArrayUtils $arrayUtils = null + ?ArrayUtils $arrayUtils = null, + ScopeOverriddenValue $scopeOverriddenValue = null, + ArrayManager $arrayManager = null, + Filesystem $fileInfo = null ) { $this->eavValidationRules = $eavValidationRules; $this->collection = $categoryCollectionFactory->create(); @@ -210,6 +229,10 @@ public function __construct( $this->categoryFactory = $categoryFactory; $this->auth = $auth ?? ObjectManager::getInstance()->get(AuthorizationInterface::class); $this->arrayUtils = $arrayUtils ?? ObjectManager::getInstance()->get(ArrayUtils::class); + $this->scopeOverriddenValue = $scopeOverriddenValue ?: + ObjectManager::getInstance()->get(ScopeOverriddenValue::class); + $this->arrayManager = $arrayManager ?: ObjectManager::getInstance()->get(ArrayManager::class); + $this->fileInfo = $fileInfo ?: ObjectManager::getInstance()->get(Filesystem::class); parent::__construct($name, $primaryFieldName, $requestFieldName, $meta, $data, $pool); } @@ -247,7 +270,7 @@ private function addUseDefaultValueCheckbox(Category $category, array $meta): ar $canDisplayUseDefault = $attribute->getScope() != EavAttributeInterface::SCOPE_GLOBAL_TEXT && $category->getId() && $category->getStoreId(); - $attributePath = $this->getArrayManager()->findPath($attributeCode, $meta); + $attributePath = $this->arrayManager->findPath($attributeCode, $meta); if (!$attributePath || !$canDisplayUseDefault @@ -256,14 +279,14 @@ private function addUseDefaultValueCheckbox(Category $category, array $meta): ar continue; } - $meta = $this->getArrayManager()->merge( + $meta = $this->arrayManager->merge( [$attributePath, 'arguments/data/config'], $meta, [ 'service' => [ 'template' => 'ui/form/element/helper/service', ], - 'disabled' => !$this->getScopeOverriddenValue()->containsValue( + 'disabled' => !$this->scopeOverriddenValue->containsValue( CategoryInterface::class, $category, $attributeCode, @@ -354,7 +377,7 @@ public function getData() * * @param Type $entityType * @return array - * @throws \Magento\Framework\Exception\LocalizedException + * @throws LocalizedException * @SuppressWarnings(PHPMD.NPathComplexity) * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @since 101.0.0 @@ -407,11 +430,22 @@ public function getAttributesMeta(Type $entityType) if ($category) { $attributeIsLocked = $category->isLockedAttribute($code); $meta[$code]['disabled'] = $attributeIsLocked; - $hasUseConfigField = (bool) array_search('use_config.' . $code, $fields, true); + $hasUseConfigField = (bool)array_search('use_config.' . $code, $fields, true); if ($hasUseConfigField && $meta[$code]['disabled']) { $meta['use_config.' . $code]['disabled'] = true; } } + + if (in_array($code, $this->elementsWithCurrencySymbol, false)) { + $requestScope = $this->request->getParam( + $this->requestScopeFieldName, + Store::DEFAULT_STORE_ID + ); + + $meta[$code]['addbefore'] = $this->storeManager->getStore($requestScope) + ->getBaseCurrency() + ->getCurrencySymbol(); + } } $result = []; @@ -560,16 +594,15 @@ private function convertValues($category, $categoryData): array unset($categoryData[$attributeCode]); $fileName = $category->getData($attributeCode); - $fileInfo = $this->getFileInfo(); - if ($fileInfo->isExist($fileName)) { - $stat = $fileInfo->getStat($fileName); - $mime = $fileInfo->getMimeType($fileName); + if ($this->fileInfo->isExist($fileName)) { + $stat = $this->fileInfo->getStat($fileName); + $mime = $this->fileInfo->getMimeType($fileName); // phpcs:ignore Magento2.Functions.DiscouragedFunction $categoryData[$attributeCode][0]['name'] = basename($fileName); - if ($fileInfo->isBeginsWithMediaDirectoryPath($fileName)) { + if ($this->fileInfo->isBeginsWithMediaDirectoryPath($fileName)) { $categoryData[$attributeCode][0]['url'] = $fileName; } else { $categoryData[$attributeCode][0]['url'] = $category->getImageUrl($attributeCode); @@ -611,53 +644,53 @@ protected function getFieldsMap() { return [ 'general' => [ - 'parent', - 'path', - 'is_active', - 'include_in_menu', - 'name', - ], + 'parent', + 'path', + 'is_active', + 'include_in_menu', + 'name', + ], 'content' => [ - 'image', - 'description', - 'landing_page', - ], + 'image', + 'description', + 'landing_page', + ], 'display_settings' => [ - 'display_mode', - 'is_anchor', - 'available_sort_by', - 'use_config.available_sort_by', - 'default_sort_by', - 'use_config.default_sort_by', - 'filter_price_range', - 'use_config.filter_price_range', - ], + 'display_mode', + 'is_anchor', + 'available_sort_by', + 'use_config.available_sort_by', + 'default_sort_by', + 'use_config.default_sort_by', + 'filter_price_range', + 'use_config.filter_price_range', + ], 'search_engine_optimization' => [ - 'url_key', - 'url_key_create_redirect', - 'url_key_group', - 'meta_title', - 'meta_keywords', - 'meta_description', - ], + 'url_key', + 'url_key_create_redirect', + 'url_key_group', + 'meta_title', + 'meta_keywords', + 'meta_description', + ], 'assign_products' => [ - ], + ], 'design' => [ - 'custom_use_parent_settings', - 'custom_apply_to_products', - 'custom_design', - 'page_layout', - 'custom_layout_update', - 'custom_layout_update_file' - ], + 'custom_use_parent_settings', + 'custom_apply_to_products', + 'custom_design', + 'page_layout', + 'custom_layout_update', + 'custom_layout_update_file' + ], 'schedule_design_update' => [ - 'custom_design_from', - 'custom_design_to', - ], + 'custom_design_from', + 'custom_design_to', + ], 'category_view_optimization' => [ - ], + ], 'category_permissions' => [ - ], + ], ]; } @@ -671,53 +704,4 @@ private function getFields(): array $fieldsMap = $this->getFieldsMap(); return $this->arrayUtils->flatten($fieldsMap); } - - /** - * Retrieve scope overridden value - * - * @return ScopeOverriddenValue - * @deprecated 101.1.0 - */ - private function getScopeOverriddenValue(): ScopeOverriddenValue - { - if (null === $this->scopeOverriddenValue) { - $this->scopeOverriddenValue = \Magento\Framework\App\ObjectManager::getInstance()->get( - ScopeOverriddenValue::class - ); - } - - return $this->scopeOverriddenValue; - } - - /** - * Retrieve array manager - * - * @return ArrayManager - * @deprecated 101.1.0 - */ - private function getArrayManager(): ArrayManager - { - if (null === $this->arrayManager) { - $this->arrayManager = \Magento\Framework\App\ObjectManager::getInstance()->get( - ArrayManager::class - ); - } - - return $this->arrayManager; - } - - /** - * Get FileInfo instance - * - * @return FileInfo - * - * @deprecated 101.1.0 - */ - private function getFileInfo(): FileInfo - { - if ($this->fileInfo === null) { - $this->fileInfo = ObjectManager::getInstance()->get(FileInfo::class); - } - return $this->fileInfo; - } } diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Category/DataProviderTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Category/DataProviderTest.php index 4c3450d555f1d..349ecc55e288d 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Category/DataProviderTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Category/DataProviderTest.php @@ -5,85 +5,98 @@ */ namespace Magento\Catalog\Test\Unit\Model\Category; +use Magento\Catalog\Model\Category; +use Magento\Catalog\Model\Category\Attribute\Backend\Image; use Magento\Catalog\Model\Category\DataProvider; use Magento\Catalog\Model\Category\FileInfo; use Magento\Catalog\Model\CategoryFactory; use Magento\Catalog\Model\ResourceModel\Category\Collection; use Magento\Catalog\Model\ResourceModel\Category\CollectionFactory; +use Magento\Catalog\Model\ResourceModel\Eav\Attribute; use Magento\Eav\Model\Config; use Magento\Eav\Model\Entity\Type; use Magento\Framework\App\RequestInterface; +use Magento\Framework\AuthorizationInterface; use Magento\Framework\Registry; +use Magento\Framework\Stdlib\ArrayUtils; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Store\Model\Store; use Magento\Store\Model\StoreManagerInterface; use Magento\Ui\DataProvider\EavValidationRules; use Magento\Ui\DataProvider\Modifier\PoolInterface; -use Magento\Framework\Stdlib\ArrayUtils; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; /** * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class DataProviderTest extends \PHPUnit\Framework\TestCase +class DataProviderTest extends TestCase { /** - * @var EavValidationRules|\PHPUnit_Framework_MockObject_MockObject + * @var EavValidationRules|MockObject */ private $eavValidationRules; /** - * @var CollectionFactory|\PHPUnit_Framework_MockObject_MockObject + * @var CollectionFactory|MockObject */ private $categoryCollectionFactory; /** - * @var StoreManagerInterface|\PHPUnit_Framework_MockObject_MockObject + * @var StoreManagerInterface|MockObject */ private $storeManager; /** - * @var Registry|\PHPUnit_Framework_MockObject_MockObject + * @var Registry|MockObject */ private $registry; /** - * @var Config|\PHPUnit_Framework_MockObject_MockObject + * @var Config|MockObject */ private $eavConfig; /** - * @var RequestInterface|\PHPUnit_Framework_MockObject_MockObject + * @var RequestInterface|MockObject */ private $request; /** - * @var CategoryFactory|\PHPUnit_Framework_MockObject_MockObject + * @var CategoryFactory|MockObject */ private $categoryFactory; /** - * @var Collection|\PHPUnit_Framework_MockObject_MockObject + * @var Collection|MockObject */ private $collection; /** - * @var Type|\PHPUnit_Framework_MockObject_MockObject + * @var Type|MockObject */ private $eavEntityMock; /** - * @var FileInfo|\PHPUnit_Framework_MockObject_MockObject + * @var FileInfo|MockObject */ private $fileInfo; /** - * @var PoolInterface|\PHPUnit_Framework_MockObject_MockObject + * @var PoolInterface|MockObject */ private $modifierPool; /** - * @var ArrayUtils|\PHPUnit_Framework_MockObject_MockObject + * @var ArrayUtils|MockObject */ private $arrayUtils; + /** + * @var AuthorizationInterface|MockObject + */ + private $auth; + /** * @inheritDoc */ @@ -96,8 +109,7 @@ protected function setUp() $this->collection = $this->getMockBuilder(Collection::class) ->disableOriginalConstructor() ->getMock(); - $this->collection->expects($this->any()) - ->method('addAttributeToSelect') + $this->collection->method('addAttributeToSelect') ->with('*') ->willReturnSelf(); @@ -105,8 +117,7 @@ protected function setUp() ->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); - $this->categoryCollectionFactory->expects($this->any()) - ->method('create') + $this->categoryCollectionFactory->method('create') ->willReturn($this->collection); $this->storeManager = $this->getMockBuilder(StoreManagerInterface::class) @@ -138,6 +149,8 @@ protected function setUp() $this->modifierPool = $this->getMockBuilder(PoolInterface::class)->getMockForAbstractClass(); + $this->auth = $this->getMockBuilder(AuthorizationInterface::class)->getMockForAbstractClass(); + $this->arrayUtils = $this->getMockBuilder(ArrayUtils::class) ->setMethods(['flatten']) ->disableOriginalConstructor()->getMock(); @@ -152,12 +165,11 @@ private function getModel() ->method('getAttributeCollection') ->willReturn([]); - $this->eavConfig->expects($this->any()) - ->method('getEntityType') + $this->eavConfig->method('getEntityType') ->with('catalog_category') ->willReturn($this->eavEntityMock); - $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); + $objectManager = new ObjectManager($this); /** @var DataProvider $model */ $model = $objectManager->getObject( @@ -171,6 +183,7 @@ private function getModel() 'request' => $this->request, 'categoryFactory' => $this->categoryFactory, 'pool' => $this->modifierPool, + 'auth' => $this->auth, 'arrayUtils' => $this->arrayUtils ] ); @@ -204,35 +217,30 @@ public function testGetDataNoFileExists() 'image' => $fileName, ]; - $imageBackendMock = $this->getMockBuilder(\Magento\Catalog\Model\Category\Attribute\Backend\Image::class) - ->disableOriginalConstructor() + $imageBackendMock = $this->getMockBuilder(Image::class)->disableOriginalConstructor() ->getMock(); - $attributeMock = $this->getMockBuilder(\Magento\Catalog\Model\ResourceModel\Eav\Attribute::class) + $attributeMock = $this->getMockBuilder(Attribute::class) ->disableOriginalConstructor() ->getMock(); $attributeMock->expects($this->once()) ->method('getBackend') ->willReturn($imageBackendMock); - $categoryMock = $this->getMockBuilder(\Magento\Catalog\Model\Category::class) + $categoryMock = $this->getMockBuilder(Category::class) ->disableOriginalConstructor() ->getMock(); $categoryMock->expects($this->exactly(2)) ->method('getData') - ->willReturnMap( - [ - ['', null, $categoryData], - ['image', null, $categoryData['image']], - ] - ); - $categoryMock->expects($this->any()) - ->method('getExistsStoreValueFlag') + ->willReturnMap([ + ['', null, $categoryData], + ['image', null, $categoryData['image']], + ]); + $categoryMock->method('getExistsStoreValueFlag') ->with('url_key') ->willReturn(false); - $categoryMock->expects($this->any()) - ->method('getStoreId') - ->willReturn(\Magento\Store\Model\Store::DEFAULT_STORE_ID); + $categoryMock->method('getStoreId') + ->willReturn(Store::DEFAULT_STORE_ID); $categoryMock->expects($this->once()) ->method('getId') ->willReturn($categoryId); @@ -253,7 +261,7 @@ public function testGetDataNoFileExists() $model = $this->getModel(); $result = $model->getData(); - $this->assertTrue(is_array($result)); + $this->assertInternalType('array', $result); $this->assertArrayHasKey($categoryId, $result); $this->assertArrayNotHasKey('image', $result[$categoryId]); } @@ -280,35 +288,31 @@ public function testGetData() ], ]; - $imageBackendMock = $this->getMockBuilder(\Magento\Catalog\Model\Category\Attribute\Backend\Image::class) + $imageBackendMock = $this->getMockBuilder(Image::class) ->disableOriginalConstructor() ->getMock(); - $attributeMock = $this->getMockBuilder(\Magento\Catalog\Model\ResourceModel\Eav\Attribute::class) + $attributeMock = $this->getMockBuilder(Attribute::class) ->disableOriginalConstructor() ->getMock(); $attributeMock->expects($this->once()) ->method('getBackend') ->willReturn($imageBackendMock); - $categoryMock = $this->getMockBuilder(\Magento\Catalog\Model\Category::class) + $categoryMock = $this->getMockBuilder(Category::class) ->disableOriginalConstructor() ->getMock(); $categoryMock->expects($this->exactly(2)) ->method('getData') - ->willReturnMap( - [ - ['', null, $categoryData], - ['image', null, $categoryData['image']], - ] - ); - $categoryMock->expects($this->any()) - ->method('getExistsStoreValueFlag') + ->willReturnMap([ + ['', null, $categoryData], + ['image', null, $categoryData['image']], + ]); + $categoryMock->method('getExistsStoreValueFlag') ->with('url_key') ->willReturn(false); - $categoryMock->expects($this->any()) - ->method('getStoreId') - ->willReturn(\Magento\Store\Model\Store::DEFAULT_STORE_ID); + $categoryMock->method('getStoreId') + ->willReturn(Store::DEFAULT_STORE_ID); $categoryMock->expects($this->once()) ->method('getId') ->willReturn($categoryId); @@ -340,7 +344,7 @@ public function testGetData() $model = $this->getModel(); $result = $model->getData(); - $this->assertTrue(is_array($result)); + $this->assertInternalType('array', $result); $this->assertArrayHasKey($categoryId, $result); $this->assertArrayHasKey('image', $result[$categoryId]); @@ -351,14 +355,14 @@ public function testGetMetaWithoutParentInheritanceResolving() { $this->arrayUtils->expects($this->atLeastOnce())->method('flatten')->willReturn([1,3,3]); - $categoryMock = $this->getMockBuilder(\Magento\Catalog\Model\Category::class) + $categoryMock = $this->getMockBuilder(Category::class) ->disableOriginalConstructor() ->getMock(); $this->registry->expects($this->atLeastOnce()) ->method('registry') ->with('category') ->willReturn($categoryMock); - $attributeMock = $this->getMockBuilder(\Magento\Catalog\Model\ResourceModel\Eav\Attribute::class) + $attributeMock = $this->getMockBuilder(Attribute::class) ->disableOriginalConstructor() ->getMock(); $categoryMock->expects($this->once()) diff --git a/app/code/Magento/Catalog/view/adminhtml/ui_component/category_form.xml b/app/code/Magento/Catalog/view/adminhtml/ui_component/category_form.xml index f2afef1215017..d3689a0db1306 100644 --- a/app/code/Magento/Catalog/view/adminhtml/ui_component/category_form.xml +++ b/app/code/Magento/Catalog/view/adminhtml/ui_component/category_form.xml @@ -354,7 +354,6 @@ <additionalClasses> <class name="admin__field-small">true</class> </additionalClasses> - <addBefore>$</addBefore> <label translate="true">Layered Navigation Price Step</label> </settings> </field> From 2a5c87ce994e8aa0e8fe206d0af0be64606bd5dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Szubert?= <bartlomiejszubert@gmail.com> Date: Thu, 3 Oct 2019 15:32:59 +0200 Subject: [PATCH 221/586] Fix #21684 - fix class imported --- app/code/Magento/Catalog/Model/Category/DataProvider.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Category/DataProvider.php b/app/code/Magento/Catalog/Model/Category/DataProvider.php index e4fa897e65b67..efa65246fc3d8 100644 --- a/app/code/Magento/Catalog/Model/Category/DataProvider.php +++ b/app/code/Magento/Catalog/Model/Category/DataProvider.php @@ -23,7 +23,6 @@ use Magento\Framework\App\RequestInterface; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\NoSuchEntityException; -use Magento\Framework\Filesystem; use Magento\Framework\Registry; use Magento\Framework\Stdlib\ArrayManager; use Magento\Framework\Stdlib\ArrayUtils; @@ -168,7 +167,7 @@ class DataProvider extends ModifierPoolDataProvider private $arrayUtils; /** - * @var Filesystem + * @var FileInfo */ private $fileInfo; @@ -195,7 +194,7 @@ class DataProvider extends ModifierPoolDataProvider * @param ArrayUtils|null $arrayUtils * @param ScopeOverriddenValue|null $scopeOverriddenValue * @param ArrayManager|null $arrayManager - * @param Filesystem|null $fileInfo + * @param FileInfo|null $fileInfo * @throws LocalizedException * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ @@ -217,7 +216,7 @@ public function __construct( ?ArrayUtils $arrayUtils = null, ScopeOverriddenValue $scopeOverriddenValue = null, ArrayManager $arrayManager = null, - Filesystem $fileInfo = null + FileInfo $fileInfo = null ) { $this->eavValidationRules = $eavValidationRules; $this->collection = $categoryCollectionFactory->create(); @@ -232,7 +231,7 @@ public function __construct( $this->scopeOverriddenValue = $scopeOverriddenValue ?: ObjectManager::getInstance()->get(ScopeOverriddenValue::class); $this->arrayManager = $arrayManager ?: ObjectManager::getInstance()->get(ArrayManager::class); - $this->fileInfo = $fileInfo ?: ObjectManager::getInstance()->get(Filesystem::class); + $this->fileInfo = $fileInfo ?: ObjectManager::getInstance()->get(FileInfo::class); parent::__construct($name, $primaryFieldName, $requestFieldName, $meta, $data, $pool); } From d3515492bc36c960ca41e201d06a81725df03b2b Mon Sep 17 00:00:00 2001 From: Nazarn96 <nazarn96@gmail.com> Date: Mon, 7 Oct 2019 16:03:03 +0300 Subject: [PATCH 222/586] Fix health index, and static test. --- .../Unit/Model/Category/DataProviderTest.php | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Category/DataProviderTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Category/DataProviderTest.php index 349ecc55e288d..4ce50537f27bd 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Category/DataProviderTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Category/DataProviderTest.php @@ -3,6 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + namespace Magento\Catalog\Test\Unit\Model\Category; use Magento\Catalog\Model\Category; @@ -232,10 +233,12 @@ public function testGetDataNoFileExists() ->getMock(); $categoryMock->expects($this->exactly(2)) ->method('getData') - ->willReturnMap([ - ['', null, $categoryData], - ['image', null, $categoryData['image']], - ]); + ->willReturnMap( + [ + ['', null, $categoryData], + ['image', null, $categoryData['image']], + ] + ); $categoryMock->method('getExistsStoreValueFlag') ->with('url_key') ->willReturn(false); @@ -304,10 +307,12 @@ public function testGetData() ->getMock(); $categoryMock->expects($this->exactly(2)) ->method('getData') - ->willReturnMap([ - ['', null, $categoryData], - ['image', null, $categoryData['image']], - ]); + ->willReturnMap( + [ + ['', null, $categoryData], + ['image', null, $categoryData['image']], + ] + ); $categoryMock->method('getExistsStoreValueFlag') ->with('url_key') ->willReturn(false); From 46ebfa5b535ead3bc8a63769ce6922016a3b18f4 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Mon, 9 Dec 2019 15:07:58 -0600 Subject: [PATCH 223/586] Change action groups name according to CE branch changes --- .../ActionGroup/GoToSpecifiedCreateProductPageActionGroup.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToSpecifiedCreateProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToSpecifiedCreateProductPageActionGroup.xml index 26041974dbc80..acbe990ad4c8c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToSpecifiedCreateProductPageActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToSpecifiedCreateProductPageActionGroup.xml @@ -16,7 +16,7 @@ <argument type="string" name="productType" defaultValue="simple"/> </arguments> - <comment userInput="actionGroup:GoToSpecifiedCreateProductPage" stepKey="actionGroupComment"/> + <comment userInput="actionGroup:GoToSpecifiedCreateProductPageActionGroup" stepKey="actionGroupComment"/> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductDropdown"/> <click selector="{{AdminProductGridActionSection.addTypeProduct(productType)}}" stepKey="clickAddProduct"/> From 9c4c965d82a076be62667c38f70c81af3a71b7a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Szubert?= <bartlomiejszubert@gmail.com> Date: Mon, 9 Dec 2019 22:12:47 +0100 Subject: [PATCH 224/586] Fix #21684 - code style fix --- app/code/Magento/Catalog/Model/Category/DataProvider.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Category/DataProvider.php b/app/code/Magento/Catalog/Model/Category/DataProvider.php index efa65246fc3d8..fe7258398d191 100644 --- a/app/code/Magento/Catalog/Model/Category/DataProvider.php +++ b/app/code/Magento/Catalog/Model/Category/DataProvider.php @@ -12,6 +12,7 @@ use Magento\Catalog\Model\Attribute\ScopeOverriddenValue; use Magento\Catalog\Model\Category; use Magento\Catalog\Model\Category\Attribute\Backend\Image as ImageBackendModel; +use Magento\Catalog\Model\Category\Attribute\Backend\LayoutUpdate; use Magento\Catalog\Model\CategoryFactory; use Magento\Catalog\Model\ResourceModel\Category\CollectionFactory as CategoryCollectionFactory; use Magento\Catalog\Model\ResourceModel\Eav\Attribute as EavAttribute; @@ -195,7 +196,6 @@ class DataProvider extends ModifierPoolDataProvider * @param ScopeOverriddenValue|null $scopeOverriddenValue * @param ArrayManager|null $arrayManager * @param FileInfo|null $fileInfo - * @throws LocalizedException * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -484,7 +484,7 @@ protected function addUseConfigSettings($categoryData) /** * Add use default settings * - * @param \Magento\Catalog\Model\Category $category + * @param Category $category * @param array $categoryData * @return array * @deprecated 101.1.0 @@ -572,7 +572,7 @@ protected function filterFields($categoryData) /** * Converts category image data to acceptable for rendering format * - * @param \Magento\Catalog\Model\Category $category + * @param Category $category * @param array $categoryData * @return array */ @@ -582,7 +582,7 @@ private function convertValues($category, $categoryData): array if ($attributeCode === 'custom_layout_update_file') { if (!empty($categoryData['custom_layout_update'])) { $categoryData['custom_layout_update_file'] - = \Magento\Catalog\Model\Category\Attribute\Backend\LayoutUpdate::VALUE_USE_UPDATE_XML; + = LayoutUpdate::VALUE_USE_UPDATE_XML; } } if (!isset($categoryData[$attributeCode])) { From d19de1ac568f7d0e54a53adca686926c6df38d6c Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Mon, 9 Dec 2019 15:46:49 -0600 Subject: [PATCH 225/586] Change action groups name according to CE branch changes --- .../Test/Mftf/ActionGroup/AddUpSellProductBySkuActionGroup.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddUpSellProductBySkuActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddUpSellProductBySkuActionGroup.xml index b107aab956beb..0ba6b479885e3 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddUpSellProductBySkuActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddUpSellProductBySkuActionGroup.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AddUpSellProductBySkuActionGroup" extends="AddRelatedProductBySkuActionGroup"> <annotations> - <description>EXTENDS: addRelatedProductBySku. Add the provided Product as an Up Sell Product.</description> + <description>EXTENDS: AddRelatedProductBySkuActionGroup. Add the provided Product as an Up Sell Product.</description> </annotations> <click selector="{{AdminProductFormRelatedUpSellCrossSellSection.AddUpSellProductsButton}}" stepKey="clickAddRelatedProductButton"/> From 41aad64a1aedc6be608ab624069e15860bb8c734 Mon Sep 17 00:00:00 2001 From: Dan Wallis <mrdanwallis@gmail.com> Date: Mon, 9 Dec 2019 22:19:40 +0000 Subject: [PATCH 226/586] Update values to make linter happy --- .../adminhtml/Magento/backend/web/css/source/_actions.less | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/design/adminhtml/Magento/backend/web/css/source/_actions.less b/app/design/adminhtml/Magento/backend/web/css/source/_actions.less index 28912d873ae00..c86e9cdbf0866 100644 --- a/app/design/adminhtml/Magento/backend/web/css/source/_actions.less +++ b/app/design/adminhtml/Magento/backend/web/css/source/_actions.less @@ -446,12 +446,12 @@ button { } &::after { - border-color: transparent transparent transparent #000; + border-color: transparent transparent transparent @color-black; border-style: solid; - border-width: 0.4rem 0 0.4rem 0.5rem; + border-width: .4rem 0 .4rem .5rem; content: ''; height: 0; - margin-top: -0.2rem; + margin-top: -.2rem; position: absolute; right: 1rem; top: 50%; From 8039f7498e4e1edca652fab745a52f1816d69584 Mon Sep 17 00:00:00 2001 From: Dmytro Poperechnyy <dpoperechnyy@magento.com> Date: Mon, 9 Dec 2019 19:04:18 -0600 Subject: [PATCH 227/586] MC-23411: Random failure of PAT builds --- setup/src/Magento/Setup/Fixtures/_files/dictionary.csv | 2 +- .../Setup/Model/Address/AddressDataGenerator.php | 2 +- setup/src/Magento/Setup/Model/DataGenerator.php | 10 +++++----- .../Setup/Model/Description/DescriptionGenerator.php | 2 +- .../Description/DescriptionParagraphGenerator.php | 2 +- .../Model/Description/DescriptionSentenceGenerator.php | 2 +- .../Setup/Model/Description/Mixin/BoldMixin.php | 2 +- .../Description/Mixin/Helper/RandomWordSelector.php | 2 +- .../Setup/Model/Description/Mixin/ItalicMixin.php | 2 +- .../Setup/Model/Description/Mixin/SpanMixin.php | 2 +- setup/src/Magento/Setup/Model/Dictionary.php | 2 +- 11 files changed, 15 insertions(+), 15 deletions(-) diff --git a/setup/src/Magento/Setup/Fixtures/_files/dictionary.csv b/setup/src/Magento/Setup/Fixtures/_files/dictionary.csv index c839b7c46f51c..ba188534a3e24 100644 --- a/setup/src/Magento/Setup/Fixtures/_files/dictionary.csv +++ b/setup/src/Magento/Setup/Fixtures/_files/dictionary.csv @@ -7370,4 +7370,4 @@ Gregory pine borrowed bow -disturbing \ No newline at end of file +disturbing diff --git a/setup/src/Magento/Setup/Model/Address/AddressDataGenerator.php b/setup/src/Magento/Setup/Model/Address/AddressDataGenerator.php index 1bbd152f2ba4e..2d450a4374c5e 100644 --- a/setup/src/Magento/Setup/Model/Address/AddressDataGenerator.php +++ b/setup/src/Magento/Setup/Model/Address/AddressDataGenerator.php @@ -18,7 +18,7 @@ class AddressDataGenerator public function generateAddress() { return [ - 'postcode' => random_int(10000, 99999) + 'postcode' => mt_rand(10000, 99999) ]; } } diff --git a/setup/src/Magento/Setup/Model/DataGenerator.php b/setup/src/Magento/Setup/Model/DataGenerator.php index 540433e5aa3ec..c7c975f2d993d 100644 --- a/setup/src/Magento/Setup/Model/DataGenerator.php +++ b/setup/src/Magento/Setup/Model/DataGenerator.php @@ -4,11 +4,11 @@ * See COPYING.txt for license details. */ -/** - * A custom adapter that allows generating arbitrary descriptions - */ namespace Magento\Setup\Model; +/** + * A custom adapter that allows generating arbitrary descriptions. + */ class DataGenerator { /** @@ -67,12 +67,12 @@ protected function readData() */ public function generate($minAmountOfWords, $maxAmountOfWords, $key = null) { - $numberOfWords = random_int($minAmountOfWords, $maxAmountOfWords); + $numberOfWords = mt_rand($minAmountOfWords, $maxAmountOfWords); $result = ''; if ($key === null || !array_key_exists($key, $this->generatedValues)) { for ($i = 0; $i < $numberOfWords; $i++) { - $result .= ' ' . $this->dictionaryData[random_int(0, count($this->dictionaryData) - 1)]; + $result .= ' ' . $this->dictionaryData[mt_rand(0, count($this->dictionaryData) - 1)]; } $result = trim($result); diff --git a/setup/src/Magento/Setup/Model/Description/DescriptionGenerator.php b/setup/src/Magento/Setup/Model/Description/DescriptionGenerator.php index a790bfdbe608d..807e1fde7d90d 100644 --- a/setup/src/Magento/Setup/Model/Description/DescriptionGenerator.php +++ b/setup/src/Magento/Setup/Model/Description/DescriptionGenerator.php @@ -63,7 +63,7 @@ public function generate() */ private function generateRawDescription() { - $paragraphsCount = random_int( + $paragraphsCount = mt_rand( $this->descriptionConfig['paragraphs']['count-min'], $this->descriptionConfig['paragraphs']['count-max'] ); diff --git a/setup/src/Magento/Setup/Model/Description/DescriptionParagraphGenerator.php b/setup/src/Magento/Setup/Model/Description/DescriptionParagraphGenerator.php index 57ece1f9558c3..50544e6ea9726 100644 --- a/setup/src/Magento/Setup/Model/Description/DescriptionParagraphGenerator.php +++ b/setup/src/Magento/Setup/Model/Description/DescriptionParagraphGenerator.php @@ -39,7 +39,7 @@ public function __construct( */ public function generate() { - $sentencesCount = random_int( + $sentencesCount = mt_rand( $this->paragraphConfig['sentences']['count-min'], $this->paragraphConfig['sentences']['count-max'] ); diff --git a/setup/src/Magento/Setup/Model/Description/DescriptionSentenceGenerator.php b/setup/src/Magento/Setup/Model/Description/DescriptionSentenceGenerator.php index 10b07e7e1c7a2..299b4b50bed0f 100644 --- a/setup/src/Magento/Setup/Model/Description/DescriptionSentenceGenerator.php +++ b/setup/src/Magento/Setup/Model/Description/DescriptionSentenceGenerator.php @@ -39,7 +39,7 @@ public function __construct( */ public function generate() { - $sentenceWordsCount = random_int( + $sentenceWordsCount = mt_rand( $this->sentenceConfig['words']['count-min'], $this->sentenceConfig['words']['count-max'] ); diff --git a/setup/src/Magento/Setup/Model/Description/Mixin/BoldMixin.php b/setup/src/Magento/Setup/Model/Description/Mixin/BoldMixin.php index 927759c4bfa7c..db208adc67de8 100644 --- a/setup/src/Magento/Setup/Model/Description/Mixin/BoldMixin.php +++ b/setup/src/Magento/Setup/Model/Description/Mixin/BoldMixin.php @@ -48,7 +48,7 @@ public function apply($text) return $this->wordWrapper->wrapWords( $text, - $this->randomWordSelector->getRandomWords($rawText, random_int(5, 8)), + $this->randomWordSelector->getRandomWords($rawText, mt_rand(5, 8)), '<b>%s</b>' ); } diff --git a/setup/src/Magento/Setup/Model/Description/Mixin/Helper/RandomWordSelector.php b/setup/src/Magento/Setup/Model/Description/Mixin/Helper/RandomWordSelector.php index c7efcc7f12e0f..0598db218728f 100644 --- a/setup/src/Magento/Setup/Model/Description/Mixin/Helper/RandomWordSelector.php +++ b/setup/src/Magento/Setup/Model/Description/Mixin/Helper/RandomWordSelector.php @@ -27,7 +27,7 @@ public function getRandomWords($source, $count) $randWords = []; $wordsSize = count($words); while ($count) { - $randWords[] = $words[random_int(0, $wordsSize - 1)]; + $randWords[] = $words[mt_rand(0, $wordsSize - 1)]; $count--; } diff --git a/setup/src/Magento/Setup/Model/Description/Mixin/ItalicMixin.php b/setup/src/Magento/Setup/Model/Description/Mixin/ItalicMixin.php index 7621bccf08773..87e033be330cf 100644 --- a/setup/src/Magento/Setup/Model/Description/Mixin/ItalicMixin.php +++ b/setup/src/Magento/Setup/Model/Description/Mixin/ItalicMixin.php @@ -48,7 +48,7 @@ public function apply($text) return $this->wordWrapper->wrapWords( $text, - $this->randomWordSelector->getRandomWords($rawText, random_int(5, 8)), + $this->randomWordSelector->getRandomWords($rawText, mt_rand(5, 8)), '<i>%s</i>' ); } diff --git a/setup/src/Magento/Setup/Model/Description/Mixin/SpanMixin.php b/setup/src/Magento/Setup/Model/Description/Mixin/SpanMixin.php index fe53ebef535a8..ed5a836129460 100644 --- a/setup/src/Magento/Setup/Model/Description/Mixin/SpanMixin.php +++ b/setup/src/Magento/Setup/Model/Description/Mixin/SpanMixin.php @@ -48,7 +48,7 @@ public function apply($text) return $this->wordWrapper->wrapWords( $text, - $this->randomWordSelector->getRandomWords($rawText, random_int(5, 8)), + $this->randomWordSelector->getRandomWords($rawText, mt_rand(5, 8)), '<span>%s</span>' ); } diff --git a/setup/src/Magento/Setup/Model/Dictionary.php b/setup/src/Magento/Setup/Model/Dictionary.php index 52f7cc1bb5148..630d35092d0fc 100644 --- a/setup/src/Magento/Setup/Model/Dictionary.php +++ b/setup/src/Magento/Setup/Model/Dictionary.php @@ -40,7 +40,7 @@ public function getRandWord() $this->readDictionary(); } - $randIndex = random_int(0, count($this->dictionary) - 1); + $randIndex = mt_rand(0, count($this->dictionary) - 1); return trim($this->dictionary[$randIndex]); } From 08f3f7fb14fcd3a4ee97253e7c3091b029d0ccb2 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Mon, 9 Dec 2019 22:42:03 -0600 Subject: [PATCH 228/586] Change action groups name according to CE branch changes --- ...igateToNewOrderPageExistingCustomerAndStoreActionGroup.xml | 4 ++-- .../Magento/Tax/Test/Mftf/Test/CheckCreditMemoTotalsTest.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageExistingCustomerAndStoreActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageExistingCustomerAndStoreActionGroup.xml index 08f70f69013f3..883f1047feb79 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageExistingCustomerAndStoreActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageExistingCustomerAndStoreActionGroup.xml @@ -8,9 +8,9 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="NavigateToNewOrderPageExistingCustomerAndStoreActionGroup" extends="navigateToNewOrderPageExistingCustomer"> + <actionGroup name="NavigateToNewOrderPageExistingCustomerAndStoreActionGroup" extends="NavigateToNewOrderPageExistingCustomerActionGroup"> <annotations> - <description>EXTENDS: navigateToNewOrderPageExistingCustomer. Clicks on the provided Store View.</description> + <description>EXTENDS: NavigateToNewOrderPageExistingCustomerActionGroup. Clicks on the provided Store View.</description> </annotations> <arguments> <argument name="storeView" defaultValue="_defaultStore"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/CheckCreditMemoTotalsTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/CheckCreditMemoTotalsTest.xml index 8cd6fc03a402a..e7964a2dd29eb 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/CheckCreditMemoTotalsTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/CheckCreditMemoTotalsTest.xml @@ -112,7 +112,7 @@ <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> <waitForPageLoad stepKey="waitForPageLoad3"/> <!--Set shipping method--> - <actionGroup stepKey="orderSelectFlatRateShipping" ref="OrderSelectFlatRateShippingActionGroup"/> + <actionGroup stepKey="OrderSelectFlatRateShippingActionGroup" ref="OrderSelectFlatRateShippingActionGroup"/> <!--Submit order--> <click stepKey="SubmitOrder" selector="{{AdminOrderFormActionSection.SubmitOrder}}"/> <waitForPageLoad stepKey="waitForPageLoad4"/> From 393ef91131c4649784a887abe42cb242921d94e8 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Tue, 10 Dec 2019 10:11:19 +0200 Subject: [PATCH 229/586] MC-5233: DateTime product attributes support --- .../Unit/Ui/Component/ColumnFactoryTest.php | 3 ++- .../Product/Form/Modifier/EavTest.php | 3 ++- .../Catalog/Ui/Component/ColumnFactory.php | 2 +- .../Product/Form/Modifier/Eav.php | 2 +- .../catalog/product/attribute/js.phtml | 24 ++++++++++++------- .../Test/Unit/Model/Entity/AttributeTest.php | 23 +++++++++++------- .../Component/Form/Element/DataType/Date.php | 2 +- .../Unit/Component/Filters/Type/DateTest.php | 2 +- 8 files changed, 38 insertions(+), 23 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Unit/Ui/Component/ColumnFactoryTest.php b/app/code/Magento/Catalog/Test/Unit/Ui/Component/ColumnFactoryTest.php index 78e241100dc3b..b3acaa4b8bbed 100644 --- a/app/code/Magento/Catalog/Test/Unit/Ui/Component/ColumnFactoryTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Ui/Component/ColumnFactoryTest.php @@ -19,7 +19,7 @@ use PHPUnit\Framework\TestCase; /** - * ColumnFactory test. + * Test to Create columns factory on product grid page */ class ColumnFactoryTest extends TestCase { @@ -206,6 +206,7 @@ public function testCreateDateColumn( 'component' => 'Magento_Ui/js/grid/columns/date', 'timezone' => $expectedTimezone, 'dateFormat' => $expectedDateFormat, + '__disableTmpl' => ['label' => true], 'options' => [ 'showsTime' => $showsTime ] diff --git a/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/EavTest.php b/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/EavTest.php index 6221704d51112..91e22407acc43 100644 --- a/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/EavTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/EavTest.php @@ -41,7 +41,7 @@ use PHPUnit\Framework\MockObject\MockObject; /** - * Class EavTest + * Class to test Data provider for eav attributes on product page * * @method Eav getModel * @SuppressWarnings(PHPMD.TooManyFields) @@ -692,6 +692,7 @@ public function setupAttributeMetaDataProvider() 'scopeLabel' => '', 'globalScope' => false, 'sortOrder' => 0, + '__disableTmpl' => ['label' => true, 'code' => true] ], 'locked' => false, 'frontendInput' => 'datetime', diff --git a/app/code/Magento/Catalog/Ui/Component/ColumnFactory.php b/app/code/Magento/Catalog/Ui/Component/ColumnFactory.php index 61bc518756ba6..b902e741c006c 100644 --- a/app/code/Magento/Catalog/Ui/Component/ColumnFactory.php +++ b/app/code/Magento/Catalog/Ui/Component/ColumnFactory.php @@ -15,7 +15,7 @@ use Magento\Ui\Component\Listing\Columns\ColumnInterface; /** - * Column Factory + * Create columns factory on product grid page * * @api * @since 100.0.2 diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php index bc5bee64912c7..25e816f79639a 100644 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php @@ -40,7 +40,7 @@ use Magento\Eav\Model\ResourceModel\Entity\Attribute\CollectionFactory as AttributeCollectionFactory; /** - * Class Eav + * Data provider for eav attributes on product page * * @api * diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/js.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/js.phtml index 212a345f4bcbc..64384ac391a8d 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/js.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/js.phtml @@ -3,6 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +use Magento\Catalog\Helper\Data; // phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis ?> @@ -63,7 +64,12 @@ function bindAttributeInputType() { checkOptionsPanelVisibility(); switchDefaultValueField(); - if($('frontend_input') && ($('frontend_input').value=='boolean' || $('frontend_input').value=='select' || $('frontend_input').value=='multiselect' || $('frontend_input').value=='price')){ + if ($('frontend_input') + && ($('frontend_input').value=='boolean' + || $('frontend_input').value=='select' + || $('frontend_input').value=='multiselect' + || $('frontend_input').value=='price') + ){ if($('is_filterable') && !$('is_filterable').getAttribute('readonly')){ $('is_filterable').disabled = false; } @@ -75,8 +81,7 @@ function bindAttributeInputType() if($('backend_type').options[i].value=='int') $('backend_type').selectedIndex = i; } } - } - else { + } else { if($('is_filterable')){ $('is_filterable').selectedIndex=0; $('is_filterable').disabled = true; @@ -203,21 +208,22 @@ function switchDefaultValueField() setRowVisibility('frontend_class', false); break; - <?php foreach ($this->helper(Magento\Catalog\Helper\Data::class)->getAttributeHiddenFields() as $type => $fields) :?> + <?php // phpcs:ignore Magento2.Templates.ThisInTemplate ?> + <?php foreach ($this->helper(Data::class)->getAttributeHiddenFields() as $type => $fields): ?> case '<?= $block->escapeJs($type) ?>': var isFrontTabHidden = false; - <?php foreach ($fields as $one) :?> - <?php if ($one == '_front_fieldset') :?> + <?php foreach ($fields as $one): ?> + <?php if ($one == '_front_fieldset'): ?> getFrontTab().hide(); isFrontTabHidden = true; - <?php elseif ($one == '_default_value') :?> + <?php elseif ($one == '_default_value'): ?> defaultValueTextVisibility = defaultValueTextareaVisibility = defaultValueDateVisibility = defaultValueYesnoVisibility = false; - <?php elseif ($one == '_scope') :?> + <?php elseif ($one == '_scope'): ?> scopeVisibility = false; - <?php else :?> + <?php else: ?> setRowVisibility('<?= $block->escapeJs($one) ?>', false); <?php endif; ?> <?php endforeach; ?> diff --git a/app/code/Magento/Eav/Test/Unit/Model/Entity/AttributeTest.php b/app/code/Magento/Eav/Test/Unit/Model/Entity/AttributeTest.php index 7aa5bca00f0b6..ae4ae7ee707e3 100644 --- a/app/code/Magento/Eav/Test/Unit/Model/Entity/AttributeTest.php +++ b/app/code/Magento/Eav/Test/Unit/Model/Entity/AttributeTest.php @@ -5,14 +5,21 @@ */ namespace Magento\Eav\Test\Unit\Model\Entity; +use Magento\Eav\Model\Entity\Attribute; +use Magento\Eav\Model\Entity\Attribute\FrontendLabel; +use Magento\Eav\Model\Entity\Attribute\FrontendLabelFactory; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + /** - * Class AttributeTest. + * Test for EAV Entity attribute model */ -class AttributeTest extends \PHPUnit\Framework\TestCase +class AttributeTest extends TestCase { /** * Attribute model to be tested - * @var \Magento\Eav\Model\Entity\Attribute|\PHPUnit_Framework_MockObject_MockObject + * @var Attribute|MockObject */ protected $_model; @@ -21,7 +28,7 @@ class AttributeTest extends \PHPUnit\Framework\TestCase */ protected function setUp() { - $this->_model = $this->createPartialMock(\Magento\Eav\Model\Entity\Attribute::class, ['__wakeup']); + $this->_model = $this->createPartialMock(Attribute::class, ['__wakeup']); } /** @@ -132,7 +139,7 @@ public function testGetFrontendLabels() { $attributeId = 1; $storeLabels = ['test_attribute_store1']; - $frontendLabelFactory = $this->getMockBuilder(\Magento\Eav\Model\Entity\Attribute\FrontendLabelFactory::class) + $frontendLabelFactory = $this->getMockBuilder(FrontendLabelFactory::class) ->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); @@ -144,15 +151,15 @@ public function testGetFrontendLabels() '_resource' => $resource, 'frontendLabelFactory' => $frontendLabelFactory, ]; - $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - $this->_model = $objectManager->getObject(\Magento\Eav\Model\Entity\Attribute::class, $arguments); + $objectManager = new ObjectManager($this); + $this->_model = $objectManager->getObject(Attribute::class, $arguments); $this->_model->setAttributeId($attributeId); $resource->expects($this->once()) ->method('getStoreLabelsByAttributeId') ->with($attributeId) ->willReturn($storeLabels); - $frontendLabel = $this->getMockBuilder(\Magento\Eav\Model\Entity\Attribute\FrontendLabel::class) + $frontendLabel = $this->getMockBuilder(FrontendLabel::class) ->setMethods(['setStoreId', 'setLabel']) ->disableOriginalConstructor() ->getMock(); diff --git a/app/code/Magento/Ui/Component/Form/Element/DataType/Date.php b/app/code/Magento/Ui/Component/Form/Element/DataType/Date.php index 6bf1eacd161cc..ef2df77e7daff 100644 --- a/app/code/Magento/Ui/Component/Form/Element/DataType/Date.php +++ b/app/code/Magento/Ui/Component/Form/Element/DataType/Date.php @@ -11,7 +11,7 @@ use Magento\Framework\View\Element\UiComponent\ContextInterface; /** - * Class Date + * UI component date type */ class Date extends AbstractDataType { diff --git a/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php b/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php index 31d7ca92c5985..20af2627fbb04 100644 --- a/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php +++ b/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php @@ -16,7 +16,7 @@ use PHPUnit\Framework\MockObject\MockObject; /** - * Class DateTest + * Test for Date grid filter functionality */ class DateTest extends \PHPUnit\Framework\TestCase { From ff6365a275fda5a93fc591bad6fb11aeffc83225 Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <nazarn96@gmail.com> Date: Tue, 10 Dec 2019 11:00:58 +0200 Subject: [PATCH 230/586] Static-test fix --- .../Framework/App/ObjectManager/ConfigLoader/Compiled.php | 2 +- lib/internal/Magento/Framework/DB/Select/SelectRenderer.php | 2 +- lib/internal/Magento/Framework/Module/Dir.php | 4 +--- lib/internal/Magento/Framework/Phrase/Renderer/Translate.php | 4 +--- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/internal/Magento/Framework/App/ObjectManager/ConfigLoader/Compiled.php b/lib/internal/Magento/Framework/App/ObjectManager/ConfigLoader/Compiled.php index 7408e8b230bd9..50769e9e17774 100644 --- a/lib/internal/Magento/Framework/App/ObjectManager/ConfigLoader/Compiled.php +++ b/lib/internal/Magento/Framework/App/ObjectManager/ConfigLoader/Compiled.php @@ -9,7 +9,7 @@ use Magento\Framework\ObjectManager\ConfigLoaderInterface; /** - * Class Compiled + * Load configuration files */ class Compiled implements ConfigLoaderInterface { diff --git a/lib/internal/Magento/Framework/DB/Select/SelectRenderer.php b/lib/internal/Magento/Framework/DB/Select/SelectRenderer.php index ce53c07789bde..7c239913987a7 100644 --- a/lib/internal/Magento/Framework/DB/Select/SelectRenderer.php +++ b/lib/internal/Magento/Framework/DB/Select/SelectRenderer.php @@ -8,7 +8,7 @@ use Magento\Framework\DB\Select; /** - * Class SelectRenderer + * Phrase renderer interface */ class SelectRenderer implements RendererInterface { diff --git a/lib/internal/Magento/Framework/Module/Dir.php b/lib/internal/Magento/Framework/Module/Dir.php index 99570b97e7251..4a03d0edc49fd 100644 --- a/lib/internal/Magento/Framework/Module/Dir.php +++ b/lib/internal/Magento/Framework/Module/Dir.php @@ -1,7 +1,5 @@ <?php /** - * Encapsulates directories structure of a Magento module - * * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ @@ -11,7 +9,7 @@ use Magento\Framework\Component\ComponentRegistrarInterface; /** - * Class Dir + * Encapsulates directories structure of a Magento module */ class Dir { diff --git a/lib/internal/Magento/Framework/Phrase/Renderer/Translate.php b/lib/internal/Magento/Framework/Phrase/Renderer/Translate.php index 4edf0fe049902..34f47a02bfcf4 100644 --- a/lib/internal/Magento/Framework/Phrase/Renderer/Translate.php +++ b/lib/internal/Magento/Framework/Phrase/Renderer/Translate.php @@ -1,7 +1,5 @@ <?php /** - * Translate Phrase renderer - * * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ @@ -12,7 +10,7 @@ use Psr\Log\LoggerInterface; /** - * Class Translate + * Translate Phrase renderer */ class Translate implements RendererInterface { From 271a2862d39da787ed82175e15334deb00688ba4 Mon Sep 17 00:00:00 2001 From: Nikita Shcherbatykh <nikita.shcherbatykh@transoftgroup.com> Date: Tue, 10 Dec 2019 11:40:45 +0200 Subject: [PATCH 231/586] MC-29273: [Magento Cloud] - When admin URL is different to front-base URL admin redirects to storefront --- .../Adminhtml/System/Currencysymbol/Save.php | 51 ++++++-- .../System/Currencysymbol/SaveTest.php | 116 +++++++++--------- 2 files changed, 101 insertions(+), 66 deletions(-) diff --git a/app/code/Magento/CurrencySymbol/Controller/Adminhtml/System/Currencysymbol/Save.php b/app/code/Magento/CurrencySymbol/Controller/Adminhtml/System/Currencysymbol/Save.php index f77976cc9e2f2..07c7c553ac792 100644 --- a/app/code/Magento/CurrencySymbol/Controller/Adminhtml/System/Currencysymbol/Save.php +++ b/app/code/Magento/CurrencySymbol/Controller/Adminhtml/System/Currencysymbol/Save.php @@ -5,37 +5,68 @@ */ namespace Magento\CurrencySymbol\Controller\Adminhtml\System\Currencysymbol; -use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface; +use Magento\Backend\App\Action; +use Magento\Backend\Model\View\Result\Redirect; +use Magento\CurrencySymbol\Controller\Adminhtml\System\Currencysymbol as CurrencysymbolController; +use Magento\CurrencySymbol\Model\System\CurrencysymbolFactory; +use Magento\Framework\App\Action\HttpPostActionInterface; +use Magento\Framework\Controller\ResultInterface; +use Magento\Framework\Filter\FilterManager; /** - * Class Save + * Controller to save currency symbol */ -class Save extends \Magento\CurrencySymbol\Controller\Adminhtml\System\Currencysymbol implements HttpPostActionInterface +class Save extends CurrencysymbolController implements HttpPostActionInterface { + /** + * @var FilterManager + */ + private $filterManager; + + /** + * @var CurrencysymbolFactory + */ + private $currencySymbolFactory; + + /** + * @param Action\Context $context + * @param FilterManager $filterManager + * @param CurrencysymbolFactory $currencySymbolFactory + */ + public function __construct( + Action\Context $context, + FilterManager $filterManager, + CurrencysymbolFactory $currencySymbolFactory + ) { + parent::__construct($context); + $this->filterManager = $filterManager; + $this->currencySymbolFactory = $currencySymbolFactory; + } + /** * Save custom Currency symbol * - * @return void + * @return ResultInterface */ public function execute() { + /** @var Redirect $resultRedirect */ + $resultRedirect = $this->resultRedirectFactory->create(); $symbolsDataArray = $this->getRequest()->getParam('custom_currency_symbol', null); if (is_array($symbolsDataArray)) { foreach ($symbolsDataArray as &$symbolsData) { - /** @var $filterManager \Magento\Framework\Filter\FilterManager */ - $filterManager = $this->_objectManager->get(\Magento\Framework\Filter\FilterManager::class); - $symbolsData = $filterManager->stripTags($symbolsData); + $symbolsData = $this->filterManager->stripTags($symbolsData); } } try { - $this->_objectManager->create(\Magento\CurrencySymbol\Model\System\Currencysymbol::class) - ->setCurrencySymbolsData($symbolsDataArray); + $currencySymbol = $this->currencySymbolFactory->create(); + $currencySymbol->setCurrencySymbolsData($symbolsDataArray); $this->messageManager->addSuccessMessage(__('You applied the custom currency symbols.')); } catch (\Exception $e) { $this->messageManager->addErrorMessage($e->getMessage()); } - $this->getResponse()->setRedirect($this->_redirect->getRedirectUrl($this->getUrl('*'))); + return $resultRedirect->setPath('*'); } } diff --git a/app/code/Magento/CurrencySymbol/Test/Unit/Controller/Adminhtml/System/Currencysymbol/SaveTest.php b/app/code/Magento/CurrencySymbol/Test/Unit/Controller/Adminhtml/System/Currencysymbol/SaveTest.php index 06f4294ce6397..b3c69c352ac7d 100644 --- a/app/code/Magento/CurrencySymbol/Test/Unit/Controller/Adminhtml/System/Currencysymbol/SaveTest.php +++ b/app/code/Magento/CurrencySymbol/Test/Unit/Controller/Adminhtml/System/Currencysymbol/SaveTest.php @@ -5,132 +5,136 @@ */ namespace Magento\CurrencySymbol\Test\Unit\Controller\Adminhtml\System\Currencysymbol; +use Magento\Backend\Helper\Data; +use Magento\Backend\Model\View\Result\Redirect; +use Magento\Backend\Model\View\Result\RedirectFactory; +use Magento\CurrencySymbol\Controller\Adminhtml\System\Currencysymbol\Save; +use Magento\CurrencySymbol\Model\System\Currencysymbol; +use Magento\CurrencySymbol\Model\System\CurrencysymbolFactory; +use Magento\Framework\App\RequestInterface; +use Magento\Framework\App\Response\RedirectInterface; +use Magento\Framework\App\ResponseInterface; +use Magento\Framework\Filter\FilterManager; +use Magento\Framework\Message\ManagerInterface; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\MockObject\MockObject; /** - * Class SaveTest + * Test ot to save currency symbol controller */ -class SaveTest extends \PHPUnit\Framework\TestCase +class SaveTest extends TestCase { /** - * @var \Magento\CurrencySymbol\Controller\Adminhtml\System\Currencysymbol\Save + * @var Save */ protected $action; /** - * @var \Magento\Framework\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject + * @var RedirectFactory|MockObject + */ + private $resultRedirectFactory; + + /** + * @var RequestInterface|MockObject */ protected $requestMock; /** - * @var \Magento\Framework\App\ResponseInterface|\PHPUnit_Framework_MockObject_MockObject + * @var ResponseInterface|MockObject */ protected $responseMock; /** - * @var \Magento\Framework\ObjectManagerInterface|\PHPUnit_Framework_MockObject_MockObject + * @var ManagerInterface|MockObject */ - protected $objectManagerMock; + protected $messageManagerMock; /** - * @var \Magento\CurrencySymbol\Model\System\Currencysymbol|\PHPUnit_Framework_MockObject_MockObject + * @var RedirectInterface|MockObject */ - protected $currencySymbolMock; + protected $redirectMock; /** - * @var \Magento\Framework\Message\ManagerInterface|\PHPUnit_Framework_MockObject_MockObject + * @var Data|MockObject */ - protected $messageManagerMock; + protected $helperMock; /** - * @var \Magento\Framework\App\Response\RedirectInterface|\PHPUnit_Framework_MockObject_MockObject + * @var FilterManager|MockObject */ - protected $redirectMock; + private $filterManager; /** - * @var \Magento\Backend\Helper\Data|\PHPUnit_Framework_MockObject_MockObject + * @var CurrencysymbolFactory|MockObject */ - protected $helperMock; + private $currencySymbolFactory; /** - * @var \Magento\Framework\Filter\FilterManager|\PHPUnit_Framework_MockObject_MockObject + * @inheritdoc */ - protected $filterManagerMock; - protected function setUp() { $objectManager = new ObjectManager($this); - - $this->requestMock = $this->createMock(\Magento\Framework\App\RequestInterface::class); - - $this->helperMock = $this->createMock(\Magento\Backend\Helper\Data::class); - - $this->redirectMock = $this->createMock(\Magento\Framework\App\Response\RedirectInterface::class); - + $this->requestMock = $this->createMock(RequestInterface::class); + $this->helperMock = $this->createMock(Data::class); + $this->redirectMock = $this->createMock(RedirectInterface::class); $this->responseMock = $this->createPartialMock( - \Magento\Framework\App\ResponseInterface::class, + ResponseInterface::class, ['setRedirect', 'sendResponse'] ); - - $this->currencySymbolMock = $this->createMock(\Magento\CurrencySymbol\Model\System\Currencysymbol::class); - - $this->filterManagerMock = $this->createPartialMock( - \Magento\Framework\Filter\FilterManager::class, + $this->messageManagerMock = $this->createMock(ManagerInterface::class); + $this->resultRedirectFactory = $this->createMock(RedirectFactory::class); + $this->filterManager = $this->createPartialMock( + FilterManager::class, ['stripTags'] ); + $this->currencySymbolFactory = $this->createMock(CurrencysymbolFactory::class); - $this->objectManagerMock = $this->createMock(\Magento\Framework\ObjectManagerInterface::class); - - $this->messageManagerMock = $this->createMock(\Magento\Framework\Message\ManagerInterface::class); $this->action = $objectManager->getObject( - \Magento\CurrencySymbol\Controller\Adminhtml\System\Currencysymbol\Save::class, + Save::class, [ 'request' => $this->requestMock, 'response' => $this->responseMock, - 'objectManager' => $this->objectManagerMock, 'redirect' => $this->redirectMock, 'helper' => $this->helperMock, - 'messageManager' => $this->messageManagerMock + 'messageManager' => $this->messageManagerMock, + 'resultRedirectFactory' => $this->resultRedirectFactory, + 'filterManager' => $this->filterManager, + 'currencySymbolFactory' => $this->currencySymbolFactory, ] ); } + /** + * Test to Save custom Currency symbol + */ public function testExecute() { $firstElement = 'firstElement'; $symbolsDataArray = [$firstElement]; - $redirectUrl = 'redirectUrl'; $this->requestMock->expects($this->once()) ->method('getParam') ->with('custom_currency_symbol') ->willReturn($symbolsDataArray); - $this->helperMock->expects($this->once())->method('getUrl')->with('*'); - $this->redirectMock->expects($this->once())->method('getRedirectUrl')->willReturn($redirectUrl); - - $this->currencySymbolMock->expects($this->once())->method('setCurrencySymbolsData')->with($symbolsDataArray); - $this->responseMock->expects($this->once())->method('setRedirect'); - - $this->filterManagerMock->expects($this->once()) + $currencySymbol = $this->createMock(Currencysymbol::class); + $currencySymbol->expects($this->once())->method('setCurrencySymbolsData')->with($symbolsDataArray); + $this->currencySymbolFactory->method('create')->willReturn($currencySymbol); + $this->filterManager->expects($this->once()) ->method('stripTags') ->with($firstElement) ->willReturn($firstElement); - $this->objectManagerMock->expects($this->once()) - ->method('create') - ->with(\Magento\CurrencySymbol\Model\System\Currencysymbol::class) - ->willReturn($this->currencySymbolMock); - - $this->objectManagerMock->expects($this->once()) - ->method('get') - ->with(\Magento\Framework\Filter\FilterManager::class) - ->willReturn($this->filterManagerMock); - $this->messageManagerMock->expects($this->once()) ->method('addSuccessMessage') ->with(__('You applied the custom currency symbols.')); - $this->action->execute(); + $redirect = $this->createMock(Redirect::class); + $redirect->expects($this->once())->method('setPath')->with('*')->willReturnSelf(); + $this->resultRedirectFactory->method('create')->willReturn($redirect); + + $this->assertEquals($redirect, $this->action->execute()); } } From 672df31da48164562c28694685c22971bde58548 Mon Sep 17 00:00:00 2001 From: Sathish <srsathish92@gmail.com> Date: Tue, 10 Dec 2019 15:25:31 +0530 Subject: [PATCH 232/586] Kept original class for backward compatibility --- app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php b/app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php index 330d1e0d3fbdf..88a799f9505d4 100644 --- a/app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php +++ b/app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php @@ -10,6 +10,7 @@ use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\App\ObjectManager; use Magento\Framework\DataObject; +use Magento\Framework\Serialize\Serializer\Json; use Magento\Framework\Serialize\Serializer\JsonHexTag; use Magento\Framework\View\Element\Block\ArgumentInterface; use Magento\Framework\Escaper; @@ -44,6 +45,7 @@ class Breadcrumbs extends DataObject implements ArgumentInterface /** * @param Data $catalogData * @param ScopeConfigInterface $scopeConfig + * @param Json|null $json * @param JsonHexTag $jsonSerializer * @param Escaper|null $escaper * @SuppressWarnings(PHPMD.UnusedFormalParameter) @@ -51,6 +53,7 @@ class Breadcrumbs extends DataObject implements ArgumentInterface public function __construct( Data $catalogData, ScopeConfigInterface $scopeConfig, + Json $json = null, JsonHexTag $jsonSerializer, Escaper $escaper = null ) { @@ -114,7 +117,7 @@ public function getJsonConfigurationHtmlEscaped() : string 'useCategoryPathInUrl' => (int)$this->isCategoryUsedInProductUrl(), 'product' => $this->escaper->escapeHtml($this->getProductName()) ] - ] + ] ); } From 5ae32934cda53256c35eabcce27d92cb516a7411 Mon Sep 17 00:00:00 2001 From: "rostyslav.hymon" <rostyslav.hymon@transoftgroup.com> Date: Tue, 10 Dec 2019 13:30:03 +0200 Subject: [PATCH 233/586] MC-29362: Sitemap grid does not use base URL --- app/code/Magento/Sitemap/Model/Sitemap.php | 43 ++++++++- .../Sitemap/Test/Unit/Model/SitemapTest.php | 95 +++++++++++++++---- 2 files changed, 116 insertions(+), 22 deletions(-) diff --git a/app/code/Magento/Sitemap/Model/Sitemap.php b/app/code/Magento/Sitemap/Model/Sitemap.php index 2baa6ff2c71a7..ea5659cf909ff 100644 --- a/app/code/Magento/Sitemap/Model/Sitemap.php +++ b/app/code/Magento/Sitemap/Model/Sitemap.php @@ -739,8 +739,11 @@ protected function _getFormattedLastmodDate($date) */ protected function _getDocumentRoot() { - return $this->filesystem->getDirectoryRead($this->documentRoot->getPath()) - ->getAbsolutePath(); + if (PHP_SAPI === 'cli') { + return $this->getDocumentRootFromBaseDir() ?? ''; + } + // phpcs:ignore Magento2.Functions.DiscouragedFunction + return realpath($this->_request->getServer('DOCUMENT_ROOT')); } /** @@ -754,10 +757,14 @@ protected function _getStoreBaseDomain() $storeParsedUrl = parse_url($this->_getStoreBaseUrl()); $url = $storeParsedUrl['scheme'] . '://' . $storeParsedUrl['host']; - $documentRoot = trim(str_replace('\\', '/', $this->_getDocumentRoot()), '/'); - $baseDir = trim(str_replace('\\', '/', $this->_getBaseDir()), '/'); + // Set document root to false if we were unable to get it + $documentRoot = $this->_getDocumentRoot() ?: false; + if ($documentRoot) { + $documentRoot = trim(str_replace(DIRECTORY_SEPARATOR, '/', $documentRoot), '/'); + } + $baseDir = trim(str_replace(DIRECTORY_SEPARATOR, '/', $this->_getBaseDir()), '/'); - if (strpos($baseDir, (string) $documentRoot) === 0) { + if ($documentRoot !== false && strpos($baseDir, (string) $documentRoot) === 0) { //case when basedir is in document root $installationFolder = trim(str_replace($documentRoot, '', $baseDir), '/'); $storeDomain = rtrim($url . '/' . $installationFolder, '/'); @@ -878,4 +885,30 @@ public function getIdentities() Value::CACHE_TAG . '_' . $this->getStoreId(), ]; } + + /** + * Get document root using base directory (root directory) and base path (base url path) + * + * Document root is determined using formula: BaseDir = DocumentRoot + BasePath. + * Returns <b>NULL</b> if BaseDir does not end with BasePath (e.g document root contains a symlink to BaseDir). + * + * @return string|null + */ + private function getDocumentRootFromBaseDir(): ?string + { + // phpcs:ignore Magento2.Functions.DiscouragedFunction + $basePath = rtrim(parse_url($this->_getStoreBaseUrl(UrlInterface::URL_TYPE_WEB), PHP_URL_PATH) ?: '', '/'); + $basePath = str_replace('/', DIRECTORY_SEPARATOR, $basePath); + $basePath = rtrim($basePath, DIRECTORY_SEPARATOR); + $baseDir = rtrim($this->_getBaseDir(), DIRECTORY_SEPARATOR); + $length = strlen($basePath); + if (!$length) { + $documentRoot = $baseDir; + } elseif (substr($baseDir, -$length) === $basePath) { + $documentRoot = rtrim(substr($baseDir, 0, strlen($baseDir) - $length), DIRECTORY_SEPARATOR); + } else { + $documentRoot = null; + } + return $documentRoot; + } } diff --git a/app/code/Magento/Sitemap/Test/Unit/Model/SitemapTest.php b/app/code/Magento/Sitemap/Test/Unit/Model/SitemapTest.php index a5e40bf3fcff7..16d506c1cdfa3 100644 --- a/app/code/Magento/Sitemap/Test/Unit/Model/SitemapTest.php +++ b/app/code/Magento/Sitemap/Test/Unit/Model/SitemapTest.php @@ -5,6 +5,7 @@ */ namespace Magento\Sitemap\Test\Unit\Model; +use Magento\Framework\App\Request\Http; use Magento\Framework\DataObject; use Magento\Framework\Filesystem; use Magento\Framework\Filesystem\Directory\Write as DirectoryWrite; @@ -86,6 +87,15 @@ class SitemapTest extends \PHPUnit\Framework\TestCase */ private $configReaderMock; + /** + * @var Http|\PHPUnit_Framework_MockObject_MockObject + */ + private $request; + /** + * @var Store|\PHPUnit_Framework_MockObject_MockObject + */ + private $store; + /** * @inheritdoc */ @@ -143,6 +153,12 @@ protected function setUp() $this->configReaderMock = $this->getMockForAbstractClass(SitemapConfigReaderInterface::class); $this->itemProviderMock = $this->getMockForAbstractClass(ItemProviderInterface::class); + $this->request = $this->createMock(Http::class); + $this->store = $this->createPartialMock(Store::class, ['isFrontUrlSecure', 'getBaseUrl']); + $this->storeManagerMock = $this->createMock(StoreManagerInterface::class); + $this->storeManagerMock->expects($this->any()) + ->method('getStore') + ->willReturn($this->store); } /** @@ -476,25 +492,15 @@ function ($from, $to) { $model = $this->getModelMock(true); - $storeMock = $this->getMockBuilder(Store::class) - ->setMethods(['isFrontUrlSecure', 'getBaseUrl']) - ->disableOriginalConstructor() - ->getMock(); - - $storeMock->expects($this->atLeastOnce()) + $this->store->expects($this->atLeastOnce()) ->method('isFrontUrlSecure') ->willReturn(false); - $storeMock->expects($this->atLeastOnce()) + $this->store->expects($this->atLeastOnce()) ->method('getBaseUrl') ->with($this->isType('string'), false) ->willReturn('http://store.com/'); - $this->storeManagerMock->expects($this->atLeastOnce()) - ->method('getStore') - ->with(1) - ->willReturn($storeMock); - return $model; } @@ -599,10 +605,6 @@ private function getModelConstructorArgs() ->disableOriginalConstructor() ->getMock(); - $this->storeManagerMock = $this->getMockBuilder(StoreManagerInterface::class) - ->setMethods(['getStore']) - ->getMockForAbstractClass(); - $objectManager = new ObjectManager($this); $escaper = $objectManager->getObject(\Magento\Framework\Escaper::class); @@ -617,7 +619,8 @@ private function getModelConstructorArgs() 'filesystem' => $this->filesystemMock, 'itemProvider' => $this->itemProviderMock, 'configReader' => $this->configReaderMock, - 'escaper' => $escaper + 'escaper' => $escaper, + 'request' => $this->request, ] ); $constructArguments['resource'] = null; @@ -732,4 +735,62 @@ public static function siteUrlDataProvider() ] ]; } + + /** + * Check site URL getter + * + * @param string $storeBaseUrl + * @param string $baseDir + * @param string $documentRoot + * @dataProvider getDocumentRootFromBaseDirUrlDataProvider + */ + public function testGetDocumentRootFromBaseDir( + string $storeBaseUrl, + string $baseDir, + ?string $documentRoot + ) { + $this->store->setCode('store'); + $this->store->method('getBaseUrl')->willReturn($storeBaseUrl); + $this->directoryMock->method('getAbsolutePath')->willReturn($baseDir); + /** @var $model Sitemap */ + $model = $this->getMockBuilder(Sitemap::class) + ->setMethods(['_construct']) + ->setConstructorArgs($this->getModelConstructorArgs()) + ->getMock(); + + $method = new \ReflectionMethod($model, 'getDocumentRootFromBaseDir'); + $method->setAccessible(true); + $this->assertSame($documentRoot, $method->invoke($model)); + } + + /** + * Provides test cases for document root testing + * + * @return array + */ + public function getDocumentRootFromBaseDirUrlDataProvider(): array + { + return [ + [ + 'http://magento.com/', + '/var/www', + '/var/www', + ], + [ + 'http://magento.com/usa', + '/var/www/usa', + '/var/www', + ], + [ + 'http://magento.com/usa/tx', + '/var/www/usa/tx', + '/var/www', + ], + 'symlink <document root>/usa/txt -> /var/www/html' => [ + 'http://magento.com/usa/tx', + '/var/www/html', + null, + ], + ]; + } } From 200f51853bf8b5b10090d6ecd9abc46269ca364b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chitesh=40wagento=2Ecom=E2=80=9D?= <hitesh@wagento.com> Date: Tue, 10 Dec 2019 17:05:01 +0530 Subject: [PATCH 234/586] [Removed spacing in submenu on hover desktop] --- lib/web/css/source/lib/_navigation.less | 2 +- lib/web/css/source/lib/variables/_navigation.less | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/web/css/source/lib/_navigation.less b/lib/web/css/source/lib/_navigation.less index 9b13c28227eb9..38cd042591722 100644 --- a/lib/web/css/source/lib/_navigation.less +++ b/lib/web/css/source/lib/_navigation.less @@ -459,7 +459,7 @@ } .submenu { - top: 0 !important; + top: -1px !important; left: 100% !important; } diff --git a/lib/web/css/source/lib/variables/_navigation.less b/lib/web/css/source/lib/variables/_navigation.less index 3ef1742547426..4801b8874abcc 100644 --- a/lib/web/css/source/lib/variables/_navigation.less +++ b/lib/web/css/source/lib/variables/_navigation.less @@ -91,7 +91,7 @@ @submenu-desktop__font-size: ''; @submenu-desktop__font-weight: @font-weight__bold; @submenu-desktop__min-width: 230px; -@submenu-desktop__padding: 15px 0; +@submenu-desktop__padding: 0; @submenu-desktop-arrow: true; // [true|false] @submenu-desktop-arrow__size: 10px; From 04f6ac08242db072a832350faf17cc2f90ad7aee Mon Sep 17 00:00:00 2001 From: Nikita Shcherbatykh <nikita.shcherbatykh@transoftgroup.com> Date: Tue, 10 Dec 2019 13:42:52 +0200 Subject: [PATCH 235/586] MC-29388: Performance issue. The same item from change log table can be processed several times --- .../Framework/Mview/Test/Unit/ViewTest.php | 256 ++++++++++++++---- lib/internal/Magento/Framework/Mview/View.php | 35 ++- 2 files changed, 235 insertions(+), 56 deletions(-) diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/ViewTest.php b/lib/internal/Magento/Framework/Mview/Test/Unit/ViewTest.php index 54f6351e9651c..ebd9896e62558 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/ViewTest.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/ViewTest.php @@ -5,44 +5,60 @@ */ namespace Magento\Framework\Mview\Test\Unit; +use Magento\Framework\Mview\ActionFactory; +use Magento\Framework\Mview\ActionInterface; +use Magento\Framework\Mview\ConfigInterface; use \Magento\Framework\Mview\View; +use Magento\Framework\Mview\View\Changelog; +use Magento\Framework\Mview\View\StateInterface; +use Magento\Framework\Mview\View\Subscription; +use Magento\Framework\Mview\View\SubscriptionFactory; +use Magento\Indexer\Model\Mview\View\State; +use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\MockObject\MockObject; -class ViewTest extends \PHPUnit\Framework\TestCase +/** + * Class to test Mview functionality + */ +class ViewTest extends TestCase { /** - * @var \Magento\Framework\Mview\View + * @var View */ protected $model; /** - * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\Mview\ConfigInterface + * @var MockObject|ConfigInterface */ protected $configMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\Mview\ActionFactory + * @var MockObject|ActionFactory */ protected $actionFactoryMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Indexer\Model\Mview\View\State + * @var MockObject|State */ protected $stateMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\Mview\View\Changelog + * @var MockObject|Changelog */ protected $changelogMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\Mview\View\SubscriptionFactory + * @var MockObject|SubscriptionFactory */ protected $subscriptionFactoryMock; + /** + * @inheritdoc + */ protected function setUp() { $this->configMock = $this->getMockForAbstractClass( - \Magento\Framework\Mview\ConfigInterface::class, + ConfigInterface::class, [], '', false, @@ -50,9 +66,9 @@ protected function setUp() true, ['getView'] ); - $this->actionFactoryMock = $this->createPartialMock(\Magento\Framework\Mview\ActionFactory::class, ['get']); + $this->actionFactoryMock = $this->createPartialMock(ActionFactory::class, ['get']); $this->stateMock = $this->createPartialMock( - \Magento\Indexer\Model\Mview\View\State::class, + State::class, [ 'getViewId', 'loadByView', @@ -68,11 +84,11 @@ protected function setUp() ] ); $this->changelogMock = $this->createPartialMock( - \Magento\Framework\Mview\View\Changelog::class, + Changelog::class, ['getViewId', 'setViewId', 'create', 'drop', 'getVersion', 'getList', 'clear'] ); $this->subscriptionFactoryMock = $this->createPartialMock( - \Magento\Framework\Mview\View\SubscriptionFactory::class, + SubscriptionFactory::class, ['create'] ); $this->model = new View( @@ -84,24 +100,36 @@ protected function setUp() ); } + /** + * Test to Return view action class + */ public function testGetActionClass() { $this->model->setData('action_class', 'actionClass'); $this->assertEquals('actionClass', $this->model->getActionClass()); } + /** + * Test to Return view group + */ public function testGetGroup() { $this->model->setData('group', 'some_group'); $this->assertEquals('some_group', $this->model->getGroup()); } + /** + * Test to Return view subscriptions + */ public function testGetSubscriptions() { $this->model->setData('subscriptions', ['subscription']); $this->assertEquals(['subscription'], $this->model->getSubscriptions()); } + /** + * Test to Fill view data from config + */ public function testLoad() { $viewId = 'view_test'; @@ -114,10 +142,12 @@ public function testLoad() )->will( $this->returnValue($this->getViewData()) ); - $this->assertInstanceOf(\Magento\Framework\Mview\View::class, $this->model->load($viewId)); + $this->assertInstanceOf(View::class, $this->model->load($viewId)); } /** + * Test to Fill view data from config + * * @expectedException \InvalidArgumentException * @expectedExceptionMessage view_id view does not exist. */ @@ -136,18 +166,21 @@ public function testLoadWithException() $this->model->load($viewId); } + /** + * Test to Create subscriptions + */ public function testSubscribe() { $this->stateMock->expects($this->once()) ->method('getMode') - ->will($this->returnValue(\Magento\Framework\Mview\View\StateInterface::MODE_DISABLED)); + ->will($this->returnValue(StateInterface::MODE_DISABLED)); $this->stateMock->expects($this->once()) ->method('setMode') - ->with(\Magento\Framework\Mview\View\StateInterface::MODE_ENABLED) + ->with(StateInterface::MODE_ENABLED) ->will($this->returnSelf()); $this->changelogMock->expects($this->once()) ->method('create'); - $subscriptionMock = $this->createPartialMock(\Magento\Framework\Mview\View\Subscription::class, ['create']); + $subscriptionMock = $this->createPartialMock(Subscription::class, ['create']); $subscriptionMock->expects($this->exactly(1))->method('create'); $this->subscriptionFactoryMock->expects( $this->exactly(1) @@ -160,11 +193,14 @@ public function testSubscribe() $this->model->subscribe(); } + /** + * Test to Create subscriptions + */ public function testSubscribeEnabled() { $this->stateMock->expects($this->once()) ->method('getMode') - ->will($this->returnValue(\Magento\Framework\Mview\View\StateInterface::MODE_ENABLED)); + ->will($this->returnValue(StateInterface::MODE_ENABLED)); $this->stateMock->expects($this->never()) ->method('setMode'); $this->changelogMock->expects($this->never()) @@ -182,7 +218,7 @@ public function testSubscribeWithException() { $this->stateMock->expects($this->once()) ->method('getMode') - ->will($this->returnValue(\Magento\Framework\Mview\View\StateInterface::MODE_DISABLED)); + ->will($this->returnValue(StateInterface::MODE_DISABLED)); $this->changelogMock->expects($this->once()) ->method('create') @@ -196,18 +232,21 @@ function () { $this->model->subscribe(); } + /** + * Test to Remove subscriptions + */ public function testUnsubscribe() { $this->stateMock->expects($this->once()) ->method('getMode') - ->will($this->returnValue(\Magento\Framework\Mview\View\StateInterface::MODE_ENABLED)); + ->will($this->returnValue(StateInterface::MODE_ENABLED)); $this->stateMock->expects($this->once()) ->method('setMode') - ->with(\Magento\Framework\Mview\View\StateInterface::MODE_DISABLED) + ->with(StateInterface::MODE_DISABLED) ->will($this->returnSelf()); $this->changelogMock->expects($this->never()) ->method('drop'); - $subscriptionMock = $this->createPartialMock(\Magento\Framework\Mview\View\Subscription::class, ['remove']); + $subscriptionMock = $this->createPartialMock(Subscription::class, ['remove']); $subscriptionMock->expects($this->exactly(1))->method('remove'); $this->subscriptionFactoryMock->expects( $this->exactly(1) @@ -220,11 +259,14 @@ public function testUnsubscribe() $this->model->unsubscribe(); } + /** + * Test to Remove subscriptions + */ public function testUnsubscribeDisabled() { $this->stateMock->expects($this->once()) ->method('getMode') - ->will($this->returnValue(\Magento\Framework\Mview\View\StateInterface::MODE_DISABLED)); + ->will($this->returnValue(StateInterface::MODE_DISABLED)); $this->stateMock->expects($this->never()) ->method('setVersionId'); $this->stateMock->expects($this->never()) @@ -244,9 +286,9 @@ public function testUnsubscribeWithException() { $this->stateMock->expects($this->once()) ->method('getMode') - ->will($this->returnValue(\Magento\Framework\Mview\View\StateInterface::MODE_ENABLED)); + ->will($this->returnValue(StateInterface::MODE_ENABLED)); - $subscriptionMock = $this->createPartialMock(\Magento\Framework\Mview\View\Subscription::class, ['remove']); + $subscriptionMock = $this->createPartialMock(Subscription::class, ['remove']); $subscriptionMock->expects($this->exactly(1)) ->method('remove') ->willReturnCallback( @@ -262,6 +304,9 @@ function () { $this->model->unsubscribe(); } + /** + * Test to Materialize view by IDs in changelog + */ public function testUpdate() { $currentVersionId = 3; @@ -279,10 +324,10 @@ public function testUpdate() ->will($this->returnSelf()); $this->stateMock->expects($this->atLeastOnce()) ->method('getMode') - ->willReturn(\Magento\Framework\Mview\View\StateInterface::MODE_ENABLED); + ->willReturn(StateInterface::MODE_ENABLED); $this->stateMock->expects($this->exactly(2)) ->method('getStatus') - ->will($this->returnValue(\Magento\Framework\Mview\View\StateInterface::STATUS_IDLE)); + ->will($this->returnValue(StateInterface::STATUS_IDLE)); $this->stateMock->expects($this->exactly(2)) ->method('setStatus') ->will($this->returnSelf()); @@ -308,7 +353,7 @@ public function testUpdate() $this->returnValue($listId) ); - $actionMock = $this->createMock(\Magento\Framework\Mview\ActionInterface::class); + $actionMock = $this->createMock(ActionInterface::class); $actionMock->expects($this->once())->method('execute')->with($listId)->will($this->returnSelf()); $this->actionFactoryMock->expects( $this->once() @@ -325,6 +370,83 @@ public function testUpdate() } /** + * Test to Materialize view by IDs in changelog + */ + public function testUpdateEx(): void + { + $currentVersionId = 200100; + $lastVersionId = 1; + $listIdBatchOne = $this->generateChangeLog(100000, 1, 100); + $listIdBatchTwo = $this->generateChangeLog(100000, 1, 50); + $listIdBatchThree = $this->generateChangeLog(100, 100, 150); + + $this->stateMock->method('getViewId')->willReturn(1); + $this->stateMock->method('getVersionId')->willReturn($lastVersionId); + $this->stateMock->method('setVersionId')->willReturnSelf(); + $this->stateMock->expects($this->atLeastOnce()) + ->method('getMode') + ->willReturn(StateInterface::MODE_ENABLED); + $this->stateMock->expects($this->exactly(2)) + ->method('getStatus') + ->willReturn(StateInterface::STATUS_IDLE); + $this->stateMock->expects($this->exactly(2)) + ->method('setStatus') + ->willReturnSelf(); + $this->stateMock->expects($this->exactly(2)) + ->method('save') + ->willReturnSelf(); + $this->changelogMock + ->expects($this->once()) + ->method('getVersion') + ->willReturn($currentVersionId); + + $this->changelogMock->method('getList') + ->willReturnMap( + [ + [$lastVersionId, 100001, $listIdBatchOne], + [100001, 200001, $listIdBatchTwo], + [200001, $currentVersionId, $listIdBatchThree], + ] + ); + + $actionMock = $this->createMock(ActionInterface::class); + $actionMock->expects($this->once()) + ->method('execute') + ->with($this->generateChangeLog(150, 1, 150)) + ->willReturnSelf(); + $this->actionFactoryMock->method('get')->willReturn($actionMock); + $this->loadView(); + $this->model->update(); + } + + /** + * Generate change log + * + * @param int $count + * @param int $idFrom + * @param int $idTo + * @return array + */ + private function generateChangeLog(int $count, int $idFrom, int $idTo): array + { + $res = []; + $i = 0; + $id = $idFrom; + while ($i < $count) { + if ($id > $idTo) { + $id = $idFrom; + } + $res[] = $id; + $id++; + $i++; + } + + return $res; + } + + /** + * Test to Materialize view by IDs in changelog + * * @expectedException \Exception * @expectedExceptionMessage Test exception */ @@ -344,10 +466,10 @@ public function testUpdateWithException() ->method('setVersionId'); $this->stateMock->expects($this->atLeastOnce()) ->method('getMode') - ->willReturn(\Magento\Framework\Mview\View\StateInterface::MODE_ENABLED); + ->willReturn(StateInterface::MODE_ENABLED); $this->stateMock->expects($this->exactly(2)) ->method('getStatus') - ->will($this->returnValue(\Magento\Framework\Mview\View\StateInterface::STATUS_IDLE)); + ->will($this->returnValue(StateInterface::STATUS_IDLE)); $this->stateMock->expects($this->exactly(2)) ->method('setStatus') ->will($this->returnSelf()); @@ -373,7 +495,7 @@ public function testUpdateWithException() $this->returnValue($listId) ); - $actionMock = $this->createPartialMock(\Magento\Framework\Mview\ActionInterface::class, ['execute']); + $actionMock = $this->createPartialMock(ActionInterface::class, ['execute']); $actionMock->expects($this->once())->method('execute')->with($listId)->will( $this->returnCallback( function () { @@ -395,18 +517,21 @@ function () { $this->model->update(); } + /** + * Test to Suspend view updates and set version ID to changelog's end + */ public function testSuspend() { $this->stateMock->expects($this->once()) ->method('getMode') - ->will($this->returnValue(\Magento\Framework\Mview\View\StateInterface::MODE_ENABLED)); + ->will($this->returnValue(StateInterface::MODE_ENABLED)); $this->stateMock->expects($this->once()) ->method('setVersionId') ->with(11) ->will($this->returnSelf()); $this->stateMock->expects($this->once()) ->method('setStatus') - ->with(\Magento\Framework\Mview\View\StateInterface::STATUS_SUSPENDED) + ->with(StateInterface::STATUS_SUSPENDED) ->will($this->returnSelf()); $this->stateMock->expects($this->once()) ->method('save') @@ -420,11 +545,14 @@ public function testSuspend() $this->model->suspend(); } + /** + * Suspend view updates and set version ID to changelog's end + */ public function testSuspendDisabled() { $this->stateMock->expects($this->once()) ->method('getMode') - ->will($this->returnValue(\Magento\Framework\Mview\View\StateInterface::MODE_DISABLED)); + ->will($this->returnValue(StateInterface::MODE_DISABLED)); $this->stateMock->expects($this->never()) ->method('setVersionId'); $this->stateMock->expects($this->never()) @@ -439,14 +567,17 @@ public function testSuspendDisabled() $this->model->suspend(); } + /** + * Test to Resume view updates + */ public function testResume() { $this->stateMock->expects($this->once()) ->method('getStatus') - ->will($this->returnValue(\Magento\Framework\Mview\View\StateInterface::STATUS_SUSPENDED)); + ->will($this->returnValue(StateInterface::STATUS_SUSPENDED)); $this->stateMock->expects($this->once()) ->method('setStatus') - ->with(\Magento\Framework\Mview\View\StateInterface::STATUS_IDLE) + ->with(StateInterface::STATUS_IDLE) ->will($this->returnSelf()); $this->stateMock->expects($this->once()) ->method('save') @@ -457,6 +588,8 @@ public function testResume() } /** + * Test to Resume view updates + * * @param string $status * @dataProvider dataProviderResumeNotSuspended */ @@ -480,16 +613,19 @@ public function testResumeNotSuspended($status) public function dataProviderResumeNotSuspended() { return [ - [\Magento\Framework\Mview\View\StateInterface::STATUS_IDLE], - [\Magento\Framework\Mview\View\StateInterface::STATUS_WORKING], + [StateInterface::STATUS_IDLE], + [StateInterface::STATUS_WORKING], ]; } + /** + * Test to Clear precessed changelog entries + */ public function testClearChangelog() { $this->stateMock->expects($this->once()) ->method('getMode') - ->will($this->returnValue(\Magento\Framework\Mview\View\StateInterface::MODE_ENABLED)); + ->will($this->returnValue(StateInterface::MODE_ENABLED)); $this->stateMock->expects($this->once()) ->method('getVersionId') ->will($this->returnValue(11)); @@ -501,11 +637,14 @@ public function testClearChangelog() $this->model->clearChangelog(); } + /** + * Test to Clear precessed changelog entries + */ public function testClearChangelogDisabled() { $this->stateMock->expects($this->once()) ->method('getMode') - ->will($this->returnValue(\Magento\Framework\Mview\View\StateInterface::MODE_DISABLED)); + ->will($this->returnValue(StateInterface::MODE_DISABLED)); $this->stateMock->expects($this->never()) ->method('getVersionId'); $this->changelogMock->expects($this->never()) @@ -514,6 +653,9 @@ public function testClearChangelogDisabled() $this->model->clearChangelog(); } + /** + * Test to Return related state object + */ public function testSetState() { $this->model->setState($this->stateMock); @@ -521,6 +663,8 @@ public function testSetState() } /** + * Test to Check whether view is enabled + * * @param string $mode * @param bool $result * @dataProvider dataProviderIsEnabled @@ -539,12 +683,14 @@ public function testIsEnabled($mode, $result) public function dataProviderIsEnabled() { return [ - [\Magento\Framework\Mview\View\StateInterface::MODE_ENABLED, true], - [\Magento\Framework\Mview\View\StateInterface::MODE_DISABLED, false], + [StateInterface::MODE_ENABLED, true], + [StateInterface::MODE_DISABLED, false], ]; } /** + * Test to Check whether view is idle + * * @param string $status * @param bool $result * @dataProvider dataProviderIsIdle @@ -563,13 +709,15 @@ public function testIsIdle($status, $result) public function dataProviderIsIdle() { return [ - [\Magento\Framework\Mview\View\StateInterface::STATUS_IDLE, true], - [\Magento\Framework\Mview\View\StateInterface::STATUS_WORKING, false], - [\Magento\Framework\Mview\View\StateInterface::STATUS_SUSPENDED, false], + [StateInterface::STATUS_IDLE, true], + [StateInterface::STATUS_WORKING, false], + [StateInterface::STATUS_SUSPENDED, false], ]; } /** + * Test to Check whether view is working + * * @param string $status * @param bool $result * @dataProvider dataProviderIsWorking @@ -588,13 +736,15 @@ public function testIsWorking($status, $result) public function dataProviderIsWorking() { return [ - [\Magento\Framework\Mview\View\StateInterface::STATUS_IDLE, false], - [\Magento\Framework\Mview\View\StateInterface::STATUS_WORKING, true], - [\Magento\Framework\Mview\View\StateInterface::STATUS_SUSPENDED, false], + [StateInterface::STATUS_IDLE, false], + [StateInterface::STATUS_WORKING, true], + [StateInterface::STATUS_SUSPENDED, false], ]; } /** + * Test to Check whether view is suspended + * * @param string $status * @param bool $result * @dataProvider dataProviderIsSuspended @@ -613,12 +763,15 @@ public function testIsSuspended($status, $result) public function dataProviderIsSuspended() { return [ - [\Magento\Framework\Mview\View\StateInterface::STATUS_IDLE, false], - [\Magento\Framework\Mview\View\StateInterface::STATUS_WORKING, false], - [\Magento\Framework\Mview\View\StateInterface::STATUS_SUSPENDED, true], + [StateInterface::STATUS_IDLE, false], + [StateInterface::STATUS_WORKING, false], + [StateInterface::STATUS_SUSPENDED, true], ]; } + /** + * Test to Return view updated datetime + */ public function testGetUpdated() { $this->stateMock->expects($this->once()) @@ -627,6 +780,9 @@ public function testGetUpdated() $this->assertEquals('some datetime', $this->model->getUpdated()); } + /** + * Fill view data from config + */ protected function loadView() { $viewId = 'view_test'; diff --git a/lib/internal/Magento/Framework/Mview/View.php b/lib/internal/Magento/Framework/Mview/View.php index b2372eaaafaad..dade475a20482 100644 --- a/lib/internal/Magento/Framework/Mview/View.php +++ b/lib/internal/Magento/Framework/Mview/View.php @@ -291,16 +291,13 @@ public function update() */ private function executeAction(ActionInterface $action, int $lastVersionId, int $currentVersionId) { - $versionBatchSize = self::$maxVersionQueryBatch; $batchSize = isset($this->changelogBatchSize[$this->getChangelog()->getViewId()]) ? (int) $this->changelogBatchSize[$this->getChangelog()->getViewId()] : self::DEFAULT_BATCH_SIZE; - for ($vsFrom = $lastVersionId; $vsFrom < $currentVersionId; $vsFrom += $versionBatchSize) { - // Don't go past the current version for atomicity. - $versionTo = min($currentVersionId, $vsFrom + $versionBatchSize); - $ids = $this->getChangelog()->getList($vsFrom, $versionTo); - + $vsFrom = $lastVersionId; + while ($vsFrom < $currentVersionId) { + $ids = $this->getBatchOfIds($vsFrom, $currentVersionId); // We run the actual indexer in batches. // Chunked AFTER loading to avoid duplicates in separate chunks. $chunks = array_chunk($ids, $batchSize); @@ -310,6 +307,32 @@ private function executeAction(ActionInterface $action, int $lastVersionId, int } } + /** + * Get batch of entity ids + * + * @param int $lastVersionId + * @param int $currentVersionId + * @return array + */ + private function getBatchOfIds(int &$lastVersionId, int $currentVersionId): array + { + $ids = []; + $versionBatchSize = self::$maxVersionQueryBatch; + $idsBatchSize = self::$maxVersionQueryBatch; + for ($vsFrom = $lastVersionId; $vsFrom < $currentVersionId; $vsFrom += $versionBatchSize) { + // Don't go past the current version for atomicity. + $versionTo = min($currentVersionId, $vsFrom + $versionBatchSize); + /** To avoid duplicate ids need to flip and merge the array */ + $ids += array_flip($this->getChangelog()->getList($vsFrom, $versionTo)); + $lastVersionId = $versionTo; + if (count($ids) >= $idsBatchSize) { + break; + } + } + + return array_keys($ids); + } + /** * Suspend view updates and set version ID to changelog's end * From c63286e7ab569cbe2a18a69edd140a7779b6d75d Mon Sep 17 00:00:00 2001 From: Sathish <srsathish92@gmail.com> Date: Tue, 10 Dec 2019 18:12:27 +0530 Subject: [PATCH 236/586] Updated the jsonSerializer as optional parameters --- .../Catalog/ViewModel/Product/Breadcrumbs.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php b/app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php index 88a799f9505d4..1aad46fc1e2f5 100644 --- a/app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php +++ b/app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php @@ -33,36 +33,36 @@ class Breadcrumbs extends DataObject implements ArgumentInterface private $scopeConfig; /** - * @var JsonHexTag + * @var Escaper */ - private $jsonSerializer; + private $escaper; /** - * @var Escaper + * @var JsonHexTag */ - private $escaper; + private $jsonSerializer; /** * @param Data $catalogData * @param ScopeConfigInterface $scopeConfig * @param Json|null $json - * @param JsonHexTag $jsonSerializer * @param Escaper|null $escaper + * @param JsonHexTag|null $jsonSerializer * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function __construct( Data $catalogData, ScopeConfigInterface $scopeConfig, Json $json = null, - JsonHexTag $jsonSerializer, - Escaper $escaper = null + Escaper $escaper = null, + JsonHexTag $jsonSerializer = null ) { parent::__construct(); $this->catalogData = $catalogData; $this->scopeConfig = $scopeConfig; - $this->jsonSerializer = $jsonSerializer; $this->escaper = $escaper ?: ObjectManager::getInstance()->get(Escaper::class); + $this->jsonSerializer = $jsonSerializer ?: ObjectManager::getInstance()->get(JsonHexTag::class); } /** From 96f502e107bdb6f127207060055020b9d0a9c3ad Mon Sep 17 00:00:00 2001 From: maslii <maslii@users.noreply.github.com> Date: Tue, 10 Dec 2019 14:48:43 +0200 Subject: [PATCH 237/586] phpdoc fix return type --- app/code/Magento/Customer/Controller/Account/CreatePost.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Customer/Controller/Account/CreatePost.php b/app/code/Magento/Customer/Controller/Account/CreatePost.php index a006cfe6725f3..e2a7c085a0b44 100644 --- a/app/code/Magento/Customer/Controller/Account/CreatePost.php +++ b/app/code/Magento/Customer/Controller/Account/CreatePost.php @@ -327,7 +327,7 @@ public function validateForCsrf(RequestInterface $request): ?bool /** * Create customer account action * - * @return void + * @return \Magento\Framework\Controller\Result\Redirect * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) */ From ab4fa339c24d0868fa7471d347ac98ad22f4d3fe Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Tue, 10 Dec 2019 20:28:28 +0700 Subject: [PATCH 238/586] Refactor and unit test for issue 25893 --- .../Adminhtml/Wysiwyg/Directive.php | 76 ++++++++++++++----- .../Adminhtml/Wysiwyg/DirectiveTest.php | 25 +++--- 2 files changed, 67 insertions(+), 34 deletions(-) diff --git a/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Directive.php b/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Directive.php index db53c6a415ddd..97d0b35a2354f 100644 --- a/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Directive.php +++ b/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Directive.php @@ -13,6 +13,14 @@ use Magento\Cms\Model\Template\Filter; use Magento\Cms\Model\Wysiwyg\Config; use Magento\Framework\App\Action\HttpGetActionInterface; +use Magento\Framework\Image\Adapter\AdapterInterface; +use Magento\Framework\Image\AdapterFactory; +use Psr\Log\LoggerInterface; +use Magento\Framework\Url\DecoderInterface; +use Magento\Framework\Controller\Result\Raw; +use Magento\Framework\Controller\Result\RawFactory; +use Magento\Backend\App\Action\Context; +use Magento\Framework\App\ObjectManager; /** * Process template text for wysiwyg editor. @@ -30,34 +38,68 @@ class Directive extends Action implements HttpGetActionInterface const ADMIN_RESOURCE = 'Magento_Cms::media_gallery'; /** - * @var \Magento\Framework\Url\DecoderInterface + * @var DecoderInterface */ protected $urlDecoder; /** - * @var \Magento\Framework\Controller\Result\RawFactory + * @var RawFactory */ protected $resultRawFactory; /** - * @param Action\Context $context - * @param \Magento\Framework\Url\DecoderInterface $urlDecoder - * @param \Magento\Framework\Controller\Result\RawFactory $resultRawFactory + * @var LoggerInterface + */ + private $logger; + + /** + * @var AdapterFactory + */ + private $adapterFactory; + + /** + * @var Config + */ + private $config; + + /** + * @var Filter + */ + private $filter; + + /** + * Constructor + * + * @param Context $context + * @param DecoderInterface $urlDecoder + * @param RawFactory $resultRawFactory + * @param AdapterFactory|null $adapterFactory + * @param LoggerInterface|null $logger + * @param Config|null $config + * @param Filter|null $filter */ public function __construct( - Action\Context $context, - \Magento\Framework\Url\DecoderInterface $urlDecoder, - \Magento\Framework\Controller\Result\RawFactory $resultRawFactory + Context $context, + DecoderInterface $urlDecoder, + RawFactory $resultRawFactory, + AdapterFactory $adapterFactory = null, + LoggerInterface $logger = null, + Config $config = null, + Filter $filter = null ) { parent::__construct($context); $this->urlDecoder = $urlDecoder; $this->resultRawFactory = $resultRawFactory; + $this->adapterFactory = $adapterFactory ?: ObjectManager::getInstance()->get(AdapterFactory::class); + $this->logger = $logger ?: ObjectManager::getInstance()->get(LoggerInterface::class); + $this->config = $config ?: ObjectManager::getInstance()->get(Config::class); + $this->filter = $filter ?: ObjectManager::getInstance()->get(Filter::class); } /** * Template directives callback * - * @return \Magento\Framework\Controller\Result\Raw + * @return Raw */ public function execute() { @@ -65,26 +107,24 @@ public function execute() $directive = $this->urlDecoder->decode($directive); try { /** @var Filter $filter */ - $filter = $this->_objectManager->create(Filter::class); - $imagePath = $filter->filter($directive); - /** @var \Magento\Framework\Image\Adapter\AdapterInterface $image */ - $image = $this->_objectManager->get(\Magento\Framework\Image\AdapterFactory::class)->create(); - /** @var \Magento\Framework\Controller\Result\Raw $resultRaw */ + $imagePath = $this->filter->filter($directive); + /** @var AdapterInterface $image */ + $image = $this->adapterFactory->create(); + /** @var Raw $resultRaw */ $resultRaw = $this->resultRawFactory->create(); $image->open($imagePath); $resultRaw->setHeader('Content-Type', $image->getMimeType()); $resultRaw->setContents($image->getImage()); } catch (\Exception $e) { /** @var Config $config */ - $config = $this->_objectManager->get(Config::class); - $imagePath = $config->getSkinImagePlaceholderPath(); + $imagePath = $this->config->getSkinImagePlaceholderPath(); try { $image->open($imagePath); $resultRaw->setHeader('Content-Type', $image->getMimeType()); $resultRaw->setContents($image->getImage()); - $this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e); + $this->logger->warning($e); } catch (\Exception $e) { - $this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e); + $this->logger->warning($e); } } return $resultRaw; diff --git a/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Wysiwyg/DirectiveTest.php b/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Wysiwyg/DirectiveTest.php index cede3a80cb98b..5fea276225622 100644 --- a/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Wysiwyg/DirectiveTest.php +++ b/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Wysiwyg/DirectiveTest.php @@ -151,7 +151,11 @@ protected function setUp() [ 'context' => $this->actionContextMock, 'urlDecoder' => $this->urlDecoderMock, - 'resultRawFactory' => $this->rawFactoryMock + 'resultRawFactory' => $this->rawFactoryMock, + 'adapterFactory' => $this->imageAdapterFactoryMock, + 'logger' => $this->loggerMock, + 'config' => $this->wysiwygConfigMock, + 'filter' => $this->templateFilterMock ] ); } @@ -228,7 +232,7 @@ public function testExecuteException() ->method('getImage') ->willReturn($imageBody); $this->loggerMock->expects($this->once()) - ->method('critical') + ->method('warning') ->with($exception); $this->rawFactoryMock->expects($this->any()) ->method('create') @@ -253,23 +257,12 @@ protected function prepareExecuteTest() ->method('decode') ->with($directiveParam) ->willReturn($directive); - $this->objectManagerMock->expects($this->once()) - ->method('create') - ->with(\Magento\Cms\Model\Template\Filter::class) - ->willReturn($this->templateFilterMock); + $this->templateFilterMock->expects($this->once()) ->method('filter') ->with($directive) ->willReturn(self::IMAGE_PATH); - $this->objectManagerMock->expects($this->any()) - ->method('get') - ->willReturnMap( - [ - [\Magento\Framework\Image\AdapterFactory::class, $this->imageAdapterFactoryMock], - [\Magento\Cms\Model\Wysiwyg\Config::class, $this->wysiwygConfigMock], - [\Psr\Log\LoggerInterface::class, $this->loggerMock] - ] - ); + $this->imageAdapterFactoryMock->expects($this->once()) ->method('create') ->willReturn($this->imageAdapterMock); @@ -301,7 +294,7 @@ public function testExecuteWithDeletedImage() ->willThrowException($exception); $this->loggerMock->expects($this->once()) - ->method('critical') + ->method('warning') ->with($exception); $this->wysiwygDirective->execute(); From e8eb43a84cb861cedda424aaf8be83aa1c6c1c29 Mon Sep 17 00:00:00 2001 From: Mastiuhin Olexandr <mastiuhin.olexandr@transoftgroup.com> Date: Tue, 10 Dec 2019 16:08:13 +0200 Subject: [PATCH 239/586] MC-25036: Marketing Email preview doesn't work with enabled js minification --- app/code/Magento/Email/composer.json | 1 + .../view/adminhtml/layout/adminhtml_email_template_preview.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/app/code/Magento/Email/composer.json b/app/code/Magento/Email/composer.json index 548d9a422c132..9070fbac7c653 100644 --- a/app/code/Magento/Email/composer.json +++ b/app/code/Magento/Email/composer.json @@ -12,6 +12,7 @@ "magento/module-config": "*", "magento/module-store": "*", "magento/module-theme": "*", + "magento/module-require-js": "*", "magento/module-media-storage": "*", "magento/module-variable": "*" }, diff --git a/app/code/Magento/Email/view/adminhtml/layout/adminhtml_email_template_preview.xml b/app/code/Magento/Email/view/adminhtml/layout/adminhtml_email_template_preview.xml index e7cbc675ce386..886a76b3af6f8 100644 --- a/app/code/Magento/Email/view/adminhtml/layout/adminhtml_email_template_preview.xml +++ b/app/code/Magento/Email/view/adminhtml/layout/adminhtml_email_template_preview.xml @@ -17,6 +17,7 @@ <argument name="preview_form_view_model" xsi:type="object">Magento\Email\ViewModel\Template\Preview\Form</argument> </arguments> </block> + <block class="Magento\RequireJs\Block\Html\Head\Config" name="requirejs-config"/> </referenceContainer> </body> </page> From 25eb81ce660014deb8461be19babff66d6d4fda6 Mon Sep 17 00:00:00 2001 From: Sathish <srsathish92@gmail.com> Date: Tue, 10 Dec 2019 20:16:29 +0530 Subject: [PATCH 240/586] Updated the jsonSerializer position in unit test --- .../Test/Unit/ViewModel/Product/BreadcrumbsTest.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/BreadcrumbsTest.php b/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/BreadcrumbsTest.php index 38b5f35634ad7..a442041660893 100644 --- a/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/BreadcrumbsTest.php +++ b/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/BreadcrumbsTest.php @@ -12,6 +12,7 @@ use Magento\Catalog\ViewModel\Product\Breadcrumbs; use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Framework\Serialize\Serializer\JsonHexTag; /** * Unit test for Magento\Catalog\ViewModel\Product\Breadcrumbs. @@ -38,6 +39,11 @@ class BreadcrumbsTest extends \PHPUnit\Framework\TestCase */ private $objectManager; + /** + * @var JsonHexTag|\PHPUnit_Framework_MockObject_MockObject + */ + private $serializer; + /** * @inheritdoc */ @@ -54,15 +60,16 @@ protected function setUp() : void ->getMockForAbstractClass(); $escaper = $this->getObjectManager()->getObject(\Magento\Framework\Escaper::class); - $this->serializer = $this->createMock(\Magento\Framework\Serialize\Serializer\JsonHexTag::class); + + $this->serializer = $this->createMock(JsonHexTag::class); $this->viewModel = $this->getObjectManager()->getObject( Breadcrumbs::class, [ 'catalogData' => $this->catalogHelper, 'scopeConfig' => $this->scopeConfig, - 'jsonSerializer' => $this->serializer, - 'escaper' => $escaper + 'escaper' => $escaper, + 'jsonSerializer' => $this->serializer ] ); } From 721f8cedc063e405074c0ceaea200f0c44f905eb Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Tue, 10 Dec 2019 21:53:06 +0700 Subject: [PATCH 241/586] Update .csv for issue 25896 --- app/code/Magento/Cms/i18n/en_US.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Cms/i18n/en_US.csv b/app/code/Magento/Cms/i18n/en_US.csv index 2947c567d75ff..6a623f947cbc2 100644 --- a/app/code/Magento/Cms/i18n/en_US.csv +++ b/app/code/Magento/Cms/i18n/en_US.csv @@ -75,7 +75,7 @@ Pages,Pages "A block identifier with the same properties already exists in the selected store.","A block identifier with the same properties already exists in the selected store." "The page URL key contains capital letters or disallowed symbols.","The page URL key contains capital letters or disallowed symbols." "The page URL key cannot be made of only numbers.","The page URL key cannot be made of only numbers." -"Please rename the folder using only letters, numbers, underscores and dashes.","Please rename the folder using only letters, numbers, underscores and dashes." +"Please rename the folder using only Latin letters, numbers, underscores and dashes.","Please rename the folder using only Latin letters, numbers, underscores and dashes." "We found a directory with the same name. Please try another folder name.","We found a directory with the same name. Please try another folder name." "We cannot create a new directory.","We cannot create a new directory." "We cannot delete directory %1.","We cannot delete directory %1." From 17a575a1ed64b6c74d969051877f01e25621ef58 Mon Sep 17 00:00:00 2001 From: Dmytro Cheshun <d.cheshun@atwix.com> Date: Tue, 10 Dec 2019 18:23:11 +0200 Subject: [PATCH 242/586] Restore the translatable phrase for backward compatibility --- app/code/Magento/Cms/i18n/en_US.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Cms/i18n/en_US.csv b/app/code/Magento/Cms/i18n/en_US.csv index 6a623f947cbc2..b860a8fb1041e 100644 --- a/app/code/Magento/Cms/i18n/en_US.csv +++ b/app/code/Magento/Cms/i18n/en_US.csv @@ -75,6 +75,7 @@ Pages,Pages "A block identifier with the same properties already exists in the selected store.","A block identifier with the same properties already exists in the selected store." "The page URL key contains capital letters or disallowed symbols.","The page URL key contains capital letters or disallowed symbols." "The page URL key cannot be made of only numbers.","The page URL key cannot be made of only numbers." +"Please rename the folder using only letters, numbers, underscores and dashes.","Please rename the folder using only letters, numbers, underscores and dashes." "Please rename the folder using only Latin letters, numbers, underscores and dashes.","Please rename the folder using only Latin letters, numbers, underscores and dashes." "We found a directory with the same name. Please try another folder name.","We found a directory with the same name. Please try another folder name." "We cannot create a new directory.","We cannot create a new directory." From d97d7f6e322f91f9d28fb19ccd77395f5ab3dbce Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Tue, 10 Dec 2019 11:28:53 -0600 Subject: [PATCH 243/586] Change action groups name according to CE branch changes --- ...WithRegularPriceOutOfStockVisibleInCategoryAndSearchTest.xml | 2 +- ...oductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml | 2 +- ...ProductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml | 2 +- ...uctWithSpecialPriceInStockVisibleInCategoryAndSearchTest.xml | 2 +- ...WithSpecialPriceOutOfStockVisibleInCategoryAndSearchTest.xml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryAndSearchTest.xml index bbde98f8fc043..021ed5593c738 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryAndSearchTest.xml @@ -28,7 +28,7 @@ <createData entity="SimpleSubCategory" stepKey="categoryEntity"/> </before> <after> - <actionGroup ref="deleteProductBySku" stepKey="deleteDefaultVirtualProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteDefaultVirtualProduct"> <argument name="sku" value="{{updateVirtualProductRegularPrice5OutOfStock.sku}}"/> </actionGroup> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml index 15e5be210b73a..d74a6ce508b88 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml @@ -28,7 +28,7 @@ <createData entity="SimpleSubCategory" stepKey="categoryEntity"/> </before> <after> - <actionGroup ref="deleteProductBySku" stepKey="deleteDefaultVirtualProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteDefaultVirtualProduct"> <argument name="sku" value="{{updateVirtualProductRegularPrice5OutOfStock.sku}}"/> </actionGroup> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml index 8b4518007ea29..aa90d018f7710 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml @@ -27,7 +27,7 @@ </createData> </before> <after> - <actionGroup ref="deleteProductBySku" stepKey="deleteDefaultVirtualProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteDefaultVirtualProduct"> <argument name="sku" value="{{updateVirtualProductRegularPrice99OutOfStock.sku}}"/> </actionGroup> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceInStockVisibleInCategoryAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceInStockVisibleInCategoryAndSearchTest.xml index 984c296845113..94ddb3dc5e5da 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceInStockVisibleInCategoryAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceInStockVisibleInCategoryAndSearchTest.xml @@ -28,7 +28,7 @@ <createData entity="SimpleSubCategory" stepKey="categoryEntity"/> </before> <after> - <actionGroup ref="deleteProductBySku" stepKey="deleteDefaultVirtualProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteDefaultVirtualProduct"> <argument name="sku" value="{{updateVirtualProductSpecialPrice.sku}}"/> </actionGroup> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceOutOfStockVisibleInCategoryAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceOutOfStockVisibleInCategoryAndSearchTest.xml index 1c590563d4cfc..a6a629b35091e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceOutOfStockVisibleInCategoryAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceOutOfStockVisibleInCategoryAndSearchTest.xml @@ -28,7 +28,7 @@ <createData entity="SimpleSubCategory" stepKey="categoryEntity"/> </before> <after> - <actionGroup ref="deleteProductBySku" stepKey="deleteDefaultVirtualProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteDefaultVirtualProduct"> <argument name="sku" value="{{updateVirtualProductSpecialPriceOutOfStock.sku}}"/> </actionGroup> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> From e853bf692bbff2a4b3811bb14f8d3d09b24e9386 Mon Sep 17 00:00:00 2001 From: Buba Suma <soumah@adobe.com> Date: Tue, 10 Dec 2019 13:23:05 -0600 Subject: [PATCH 244/586] MC-17629: Control over search results min terms to match - Fix static tests --- .../Model/Config/Backend/MinimumShouldMatch.php | 5 ++++- .../Test/Unit/Model/Client/ElasticsearchTest.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Elasticsearch/Model/Config/Backend/MinimumShouldMatch.php b/app/code/Magento/Elasticsearch/Model/Config/Backend/MinimumShouldMatch.php index 434270c62d3d9..ea64ccd772682 100644 --- a/app/code/Magento/Elasticsearch/Model/Config/Backend/MinimumShouldMatch.php +++ b/app/code/Magento/Elasticsearch/Model/Config/Backend/MinimumShouldMatch.php @@ -34,7 +34,10 @@ public function validateValue(): void { if (strlen($this->getValue()) && !preg_match('/^((\d+<)?-?\d+%?\s?)+$/', $this->getValue())) { throw new LocalizedException( - __('Value for the field "%1" was not saved because of the incorrect format.', __('Minimum Terms to Match')) + __( + 'Value for the field "%1" was not saved because of the incorrect format.', + __('Minimum Terms to Match') + ) ); } } diff --git a/app/code/Magento/Elasticsearch6/Test/Unit/Model/Client/ElasticsearchTest.php b/app/code/Magento/Elasticsearch6/Test/Unit/Model/Client/ElasticsearchTest.php index 8bb27d366ae26..607624d7b5e8e 100644 --- a/app/code/Magento/Elasticsearch6/Test/Unit/Model/Client/ElasticsearchTest.php +++ b/app/code/Magento/Elasticsearch6/Test/Unit/Model/Client/ElasticsearchTest.php @@ -12,7 +12,7 @@ use Magento\Elasticsearch6\Model\Client\Elasticsearch; /** - * Class ElasticsearchTest + * Test elasticsearch client methods */ class ElasticsearchTest extends \PHPUnit\Framework\TestCase { From 8f3b2823fa6f2f7f1800bcab7c00961536b6685e Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Tue, 10 Dec 2019 13:53:45 -0600 Subject: [PATCH 245/586] Change action groups name according to CE branch changes --- .../Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml index cea026577f98f..d0502b41e2856 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml @@ -41,7 +41,7 @@ <after> <deleteData createDataKey="createSimpleProductApi" stepKey="deleteSimpleProductApi"/> <!-- Delete the rule --> - <actionGroup ref="RemoveCatalogPriceRule" stepKey="deletePriceRule"> + <actionGroup ref="RemoveCatalogPriceRuleActionGroup" stepKey="deletePriceRule"> <argument name="ruleName" value="{{CatalogRuleToPercent.name}}" /> </actionGroup> <!--Clear all filters in grid--> From fa095edbfafe4d99248ca7ea9e99bec3be415fcf Mon Sep 17 00:00:00 2001 From: Buba Suma <soumah@adobe.com> Date: Tue, 10 Dec 2019 14:02:38 -0600 Subject: [PATCH 246/586] MC-22572: Shuffle related, up-sale and cross-sale products either by priority and weight - Fix static tests --- .../templates/product/list/items.phtml | 50 ++++++++++--------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml index 8f1fe3fa6874c..fc4d85044a8d6 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml @@ -6,6 +6,8 @@ // phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis // phpcs:disable Generic.WhiteSpace.ScopeIndent.Incorrect +// phpcs:disable Generic.Files.LineLength +// phpcs:disable Magento2.Templates.ThisInTemplate.FoundHelper /* @var $block \Magento\Catalog\Block\Product\AbstractProduct */ ?> @@ -156,22 +158,22 @@ switch ($type = $block->getType()) { } ?> -<?php if ($exist) :?> +<?php if ($exist):?> -<?php if ($type == 'related' || $type == 'upsell') :?> -<?php if ($type == 'related') :?> +<?php if ($type == 'related' || $type == 'upsell'):?> +<?php if ($type == 'related'):?> <div class="block <?= $block->escapeHtmlAttr($class) ?>" data-mage-init='{"relatedProducts":{"relatedCheckbox":".related.checkbox"}}' data-limit="<?= $block->escapeHtmlAttr($limit) ?>" data-shuffle="<?= /* @noEscape */ $shuffle ?>" data-shuffle-weighted="<?= /* @noEscape */ $isWeightedRandom ?>"> - <?php else :?> + <?php else:?> <div class="block <?= $block->escapeHtmlAttr($class) ?>" data-mage-init='{"upsellProducts":{}}' data-limit="<?= $block->escapeHtmlAttr($limit) ?>" data-shuffle="<?= /* @noEscape */ $shuffle ?>" data-shuffle-weighted="<?= /* @noEscape */ $isWeightedRandom ?>"> <?php endif; ?> - <?php else :?> + <?php else:?> <div class="block <?= $block->escapeHtmlAttr($class) ?>"> <?php endif; ?> <div class="block-title title"> <strong id="block-<?= $block->escapeHtmlAttr($class) ?>-heading" role="heading" aria-level="2"><?= $block->escapeHtml($title) ?></strong> </div> <div class="block-content content" aria-labelledby="block-<?= $block->escapeHtmlAttr($class) ?>-heading"> - <?php if ($type == 'related' && $canItemsAddToCart) :?> + <?php if ($type == 'related' && $canItemsAddToCart):?> <div class="block-actions"> <?= $block->escapeHtml(__('Check items to add to the cart or')) ?> <button type="button" class="action select" data-role="select-all"><span><?= $block->escapeHtml(__('select all')) ?></span></button> @@ -179,16 +181,16 @@ switch ($type = $block->getType()) { <?php endif; ?> <div class="products wrapper grid products-grid products-<?= $block->escapeHtmlAttr($type) ?>"> <ol class="products list items product-items"> - <?php foreach ($items as $_item) :?> + <?php foreach ($items as $_item):?> <?php $available = ''; ?> - <?php if (!$_item->isComposite() && $_item->isSaleable() && $type == 'related') :?> - <?php if (!$_item->getRequiredOptions()) :?> + <?php if (!$_item->isComposite() && $_item->isSaleable() && $type == 'related'):?> + <?php if (!$_item->getRequiredOptions()):?> <?php $available = 'related-available'; ?> <?php endif; ?> <?php endif; ?> - <?php if ($type == 'related' || $type == 'upsell') :?> + <?php if ($type == 'related' || $type == 'upsell'):?> <li class="item product product-item" style="display: none;" data-shuffle-group="<?= $block->escapeHtmlAttr($_item->getPriority()) ?>" > - <?php else :?> + <?php else:?> <li class="item product product-item"> <?php endif; ?> <div class="product-item-info <?= /* @noEscape */ $available ?>"> @@ -203,12 +205,12 @@ switch ($type = $block->getType()) { <?= /* @noEscape */ $block->getProductPrice($_item) ?> - <?php if ($templateType) :?> + <?php if ($templateType):?> <?= $block->getReviewsSummaryHtml($_item, $templateType) ?> <?php endif; ?> - <?php if ($canItemsAddToCart && !$_item->isComposite() && $_item->isSaleable() && $type == 'related') :?> - <?php if (!$_item->getRequiredOptions()) :?> + <?php if ($canItemsAddToCart && !$_item->isComposite() && $_item->isSaleable() && $type == 'related'):?> + <?php if (!$_item->getRequiredOptions()):?> <div class="field choice related"> <input type="checkbox" class="checkbox related" id="related-checkbox<?= $block->escapeHtmlAttr($_item->getId()) ?>" name="related_products[]" value="<?= $block->escapeHtmlAttr($_item->getId()) ?>" /> <label class="label" for="related-checkbox<?= $block->escapeHtmlAttr($_item->getId()) ?>"><span><?= $block->escapeHtml(__('Add to Cart')) ?></span></label> @@ -216,16 +218,16 @@ switch ($type = $block->getType()) { <?php endif; ?> <?php endif; ?> - <?php if ($showAddTo || $showCart) :?> + <?php if ($showAddTo || $showCart):?> <div class="product actions product-item-actions"> - <?php if ($showCart) :?> + <?php if ($showCart):?> <div class="actions-primary"> - <?php if ($_item->isSaleable()) :?> - <?php if ($_item->getTypeInstance()->hasRequiredOptions($_item)) :?> + <?php if ($_item->isSaleable()):?> + <?php if ($_item->getTypeInstance()->hasRequiredOptions($_item)):?> <button class="action tocart primary" data-mage-init='{"redirectUrl": {"url": "<?= $block->escapeUrl($block->getAddToCartUrl($_item)) ?>"}}' type="button" title="<?= $block->escapeHtmlAttr(__('Add to Cart')) ?>"> <span><?= $block->escapeHtml(__('Add to Cart')) ?></span> </button> - <?php else :?> + <?php else:?> <?php $postDataHelper = $this->helper(Magento\Framework\Data\Helper\PostHelper::class); $postData = $postDataHelper->getPostData($block->escapeUrl($block->getAddToCartUrl($_item)), ['product' => $_item->getEntityId()]) ?> @@ -235,19 +237,19 @@ switch ($type = $block->getType()) { <span><?= $block->escapeHtml(__('Add to Cart')) ?></span> </button> <?php endif; ?> - <?php else :?> - <?php if ($_item->getIsSalable()) :?> + <?php else:?> + <?php if ($_item->getIsSalable()):?> <div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div> - <?php else :?> + <?php else:?> <div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div> <?php endif; ?> <?php endif; ?> </div> <?php endif; ?> - <?php if ($showAddTo) :?> + <?php if ($showAddTo):?> <div class="secondary-addto-links actions-secondary" data-role="add-to-links"> - <?php if ($addToBlock = $block->getChildBlock('addto')) :?> + <?php if ($addToBlock = $block->getChildBlock('addto')):?> <?= $addToBlock->setProduct($_item)->getChildHtml() ?> <?php endif; ?> </div> From dcd38bbd474acdd8b1ad02527dfc5ac90e65ba1f Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Tue, 10 Dec 2019 17:18:32 -0600 Subject: [PATCH 247/586] Change action groups name according to CE branch changes --- ...uctToWishListSuccessMessageActionGroup.xml | 22 +++++++++++++++++ ...ertProductDetailsInWishlistActionGroup.xml | 24 +++++++++++++++++++ ...tProductIsPresentInWishListActionGroup.xml | 15 ++++++++---- ...eProductFromShoppingCartToWishlistTest.xml | 6 ++--- ...eProductFromShoppingCartToWishlistTest.xml | 6 ++--- ...eProductFromShoppingCartToWishlistTest.xml | 6 ++--- ...lProductFromShoppingCartToWishlistTest.xml | 4 ++-- 7 files changed, 67 insertions(+), 16 deletions(-) diff --git a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/AssertMoveProductToWishListSuccessMessageActionGroup.xml b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/AssertMoveProductToWishListSuccessMessageActionGroup.xml index e69de29bb2d1d..37d26f984b3eb 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/AssertMoveProductToWishListSuccessMessageActionGroup.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/AssertMoveProductToWishListSuccessMessageActionGroup.xml @@ -0,0 +1,22 @@ +<?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="AssertMoveProductToWishListSuccessMessageActionGroup"> + <annotations> + <description>Moves a product from the cart to the wishlist.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + </arguments> + <click selector="{{CheckoutCartProductSection.moveToWishlistByProductName(productName)}}" stepKey="moveToWishlist"/> + <waitForPageLoad stepKey="waitForMove"/> + <see userInput="{{productName}} has been moved to your wish list." selector="{{CheckoutCartMessageSection.successMessage}}" stepKey="assertSuccess"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/AssertProductDetailsInWishlistActionGroup.xml b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/AssertProductDetailsInWishlistActionGroup.xml index e69de29bb2d1d..4498882a206d1 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/AssertProductDetailsInWishlistActionGroup.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/AssertProductDetailsInWishlistActionGroup.xml @@ -0,0 +1,24 @@ +<?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="AssertProductIsPresentInWishListActionGroup"> + <annotations> + <description>Go to storefront customer wishlist page and assert product name and price is present.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + <argument name="productPrice" type="string"/> + </arguments> + <amOnPage url="{{StorefrontCustomerWishlistPage.url}}" stepKey="goToWishList"/> + <waitForPageLoad stepKey="waitForWishList"/> + <waitForElement selector="{{StorefrontCustomerWishlistProductSection.ProductTitleByName(productName)}}" time="30" stepKey="assertProductName"/> + <see userInput="{{productPrice}}" selector="{{StorefrontCustomerWishlistProductSection.ProductPriceByName(productName)}}" stepKey="assertProductPrice"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/AssertProductIsPresentInWishListActionGroup.xml b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/AssertProductIsPresentInWishListActionGroup.xml index 37d26f984b3eb..85c91e1a0f14c 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/AssertProductIsPresentInWishListActionGroup.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/AssertProductIsPresentInWishListActionGroup.xml @@ -8,15 +8,20 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AssertMoveProductToWishListSuccessMessageActionGroup"> + <actionGroup name="AssertProductDetailsInWishlistActionGroup"> <annotations> - <description>Moves a product from the cart to the wishlist.</description> + <description>Assert product name and price in wishlist on hover.</description> </annotations> <arguments> <argument name="productName" type="string"/> + <argument name="label" type="string"/> + <argument name="labelValue" type="string"/> </arguments> - <click selector="{{CheckoutCartProductSection.moveToWishlistByProductName(productName)}}" stepKey="moveToWishlist"/> - <waitForPageLoad stepKey="waitForMove"/> - <see userInput="{{productName}} has been moved to your wish list." selector="{{CheckoutCartMessageSection.successMessage}}" stepKey="assertSuccess"/> + <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName(productName)}}" stepKey="moveMouseOverProductInfo"/> + <seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductAddToCartByName(productName)}}" stepKey="seeAddToCart"/> + <seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductImageByName(productName)}}" stepKey="seeImage"/> + <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsByName(productName)}}" stepKey="moveMouseOverProductDetails"/> + <see userInput="{{label}}" selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsLabelByName(productName)}}" stepKey="seeLabel"/> + <see userInput="{{labelValue}}" selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsValueByName(productName)}}" stepKey="seeLabelValue"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest.xml index 70268f4e14e8f..c7e1be33c963a 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest.xml @@ -144,18 +144,18 @@ <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> <!-- Assert move product to wishlist success message --> - <actionGroup ref="AssertMoveProductToWishListSuccessMessage" stepKey="moveToWishlist"> + <actionGroup ref="AssertMoveProductToWishListSuccessMessageActionGroup" stepKey="moveToWishlist"> <argument name="productName" value="$$createConfigProduct.name$$"/> </actionGroup> <!-- Assert product is present in wishlist --> - <actionGroup ref="AssertProductIsPresentInWishList" stepKey="assertProductPresent"> + <actionGroup ref="AssertProductIsPresentInWishListActionGroup" stepKey="assertProductPresent"> <argument name="productName" value="$$createConfigProduct.name$$"/> <argument name="productPrice" value="$20.00"/> </actionGroup> <!-- Assert product details in Wishlist --> - <actionGroup ref="AssertProductDetailsInWishlist" stepKey="assertProductDetails"> + <actionGroup ref="AssertProductDetailsInWishlistActionGroup" stepKey="assertProductDetails"> <argument name="productName" value="$$createConfigProduct.name$$"/> <argument name="label" value="$$createConfigProductAttribute.default_value$$"/> <argument name="labelValue" value="$$getConfigAttributeOption2.label$$"/> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml index 6faf4c1002c1a..d527056ca89fd 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml @@ -87,18 +87,18 @@ <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> <!-- Assert move product to wishlist success message --> - <actionGroup ref="AssertMoveProductToWishListSuccessMessage" stepKey="moveToWishlist"> + <actionGroup ref="AssertMoveProductToWishListSuccessMessageActionGroup" stepKey="moveToWishlist"> <argument name="productName" value="$$createBundleProduct.name$$"/> </actionGroup> <!-- Assert product is present in wishlist --> - <actionGroup ref="AssertProductIsPresentInWishList" stepKey="assertProductPresent"> + <actionGroup ref="AssertProductIsPresentInWishListActionGroup" stepKey="assertProductPresent"> <argument name="productName" value="$$createBundleProduct.name$$"/> <argument name="productPrice" value="$100.00"/> </actionGroup> <!-- Assert product details in Wishlist --> - <actionGroup ref="AssertProductDetailsInWishlist" stepKey="assertProductDetails"> + <actionGroup ref="AssertProductDetailsInWishlistActionGroup" stepKey="assertProductDetails"> <argument name="productName" value="$$createBundleProduct.name$$"/> <argument name="label" value="$$createBundleOption1_1.title$$"/> <argument name="labelValue" value="$$simpleProduct1.sku$$ $100.00"/> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveFixedBundleProductFromShoppingCartToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveFixedBundleProductFromShoppingCartToWishlistTest.xml index 3906767d04cc1..4d7371854dfef 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveFixedBundleProductFromShoppingCartToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveFixedBundleProductFromShoppingCartToWishlistTest.xml @@ -78,18 +78,18 @@ <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> <!-- Assert move product to wishlist success message --> - <actionGroup ref="AssertMoveProductToWishListSuccessMessage" stepKey="moveToWishlist"> + <actionGroup ref="AssertMoveProductToWishListSuccessMessageActionGroup" stepKey="moveToWishlist"> <argument name="productName" value="$$createBundleProduct.name$$"/> </actionGroup> <!-- Assert product is present in wishlist --> - <actionGroup ref="AssertProductIsPresentInWishList" stepKey="assertProductPresent"> + <actionGroup ref="AssertProductIsPresentInWishListActionGroup" stepKey="assertProductPresent"> <argument name="productName" value="$$createBundleProduct.name$$"/> <argument name="productPrice" value="$101.23"/> </actionGroup> <!-- Assert product details in Wishlist --> - <actionGroup ref="AssertProductDetailsInWishlist" stepKey="assertProductDetails"> + <actionGroup ref="AssertProductDetailsInWishlistActionGroup" stepKey="assertProductDetails"> <argument name="productName" value="$$createBundleProduct.name$$"/> <argument name="label" value="$$createBundleOption1_1.title$$"/> <argument name="labelValue" value="$$simpleProduct1.sku$$ $100.00"/> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveVirtualProductFromShoppingCartToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveVirtualProductFromShoppingCartToWishlistTest.xml index dc1580797e5be..adf1e4953badc 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveVirtualProductFromShoppingCartToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveVirtualProductFromShoppingCartToWishlistTest.xml @@ -53,12 +53,12 @@ <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> <!-- Assert move product to wishlist success message --> - <actionGroup ref="AssertMoveProductToWishListSuccessMessage" stepKey="moveToWishlist"> + <actionGroup ref="AssertMoveProductToWishListSuccessMessageActionGroup" stepKey="moveToWishlist"> <argument name="productName" value="$$createProduct.name$$"/> </actionGroup> <!-- Assert product is present in wishlist --> - <actionGroup ref="AssertProductIsPresentInWishList" stepKey="assertProductPresent"> + <actionGroup ref="AssertProductIsPresentInWishListActionGroup" stepKey="assertProductPresent"> <argument name="productName" value="$$createProduct.name$$"/> <argument name="productPrice" value="$$createProduct.price$$"/> </actionGroup> From 9c32f0ad5fe4116abcbf0b1051027963d63bb045 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Tue, 10 Dec 2019 18:55:49 -0600 Subject: [PATCH 248/586] Change action groups name according to CE branch changes --- .../AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml | 2 +- .../Test/AdminDeleteCategoryUrlRewriteWithRequestPathTest.xml | 2 +- ...tMoveConfigurableProductFromShoppingCartToWishlistTest.xml | 4 ++-- ...MoveDynamicBundleProductFromShoppingCartToWishlistTest.xml | 4 ++-- ...ntMoveFixedBundleProductFromShoppingCartToWishlistTest.xml | 4 ++-- ...efrontMoveVirtualProductFromShoppingCartToWishlistTest.xml | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml index 5a05dab7aa707..97e1f16016045 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml @@ -28,7 +28,7 @@ </after> <!--Create the Category Url Rewrite--> - <actionGroup ref="AdminAddUrlRewrite" stepKey="addUrlRewrite"> + <actionGroup ref="AdminAddUrlRewriteActionGroup" stepKey="addUrlRewrite"> <argument name="category" value="$$category.name$$"/> <argument name="customUrlRewriteValue" value="For Category"/> <argument name="storeValue" value="Default Store View"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteWithRequestPathTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteWithRequestPathTest.xml index e94e10767c632..18c3e1abe59c4 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteWithRequestPathTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteWithRequestPathTest.xml @@ -28,7 +28,7 @@ </after> <!--Create the Category Url Rewrite--> - <actionGroup ref="AdminAddUrlRewrite" stepKey="addUrlRewriteSecondTime"> + <actionGroup ref="AdminAddUrlRewriteActionGroup" stepKey="addUrlRewriteSecondTime"> <argument name="category" value="$$category.name$$"/> <argument name="customUrlRewriteValue" value="For Category"/> <argument name="storeValue" value="Default Store View"/> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest.xml index c7e1be33c963a..0f94a08328c95 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest.xml @@ -136,12 +136,12 @@ <scrollTo selector="{{StorefrontProductInfoMainSection.productAddToWishlist}}" y="-200" stepKey="scroll"/> <!-- Add product to the cart and Assert add product to cart success message--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartVirtualProductFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartVirtualProductFromStorefrontProductPage"> <argument name="productName" value="$$createConfigProduct.name$$"/> </actionGroup> <!-- Select Mini Cart and select 'View And Edit Cart' --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="selectViewAndEditCart"/> <!-- Assert move product to wishlist success message --> <actionGroup ref="AssertMoveProductToWishListSuccessMessageActionGroup" stepKey="moveToWishlist"> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml index d527056ca89fd..76e1240b0df77 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml @@ -79,12 +79,12 @@ <fillField selector="{{StorefrontBundledSection.dropDownOptionOneQuantity($$createBundleOption1_1.title$$)}}" userInput="1" stepKey="fillQuantity00"/> <!-- Add product to the cart and Assert add product to cart success message--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartVirtualProductFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartVirtualProductFromStorefrontProductPage"> <argument name="productName" value="$$createBundleProduct.name$$"/> </actionGroup> <!-- Select Mini Cart and select 'View And Edit Cart' --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="selectViewAndEditCart"/> <!-- Assert move product to wishlist success message --> <actionGroup ref="AssertMoveProductToWishListSuccessMessageActionGroup" stepKey="moveToWishlist"> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveFixedBundleProductFromShoppingCartToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveFixedBundleProductFromShoppingCartToWishlistTest.xml index 4d7371854dfef..2d83043f81318 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveFixedBundleProductFromShoppingCartToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveFixedBundleProductFromShoppingCartToWishlistTest.xml @@ -70,12 +70,12 @@ <fillField selector="{{StorefrontBundledSection.dropDownOptionOneQuantity($$createBundleOption1_1.title$$)}}" userInput="1" stepKey="fillQuantity00"/> <!-- Add product to the cart and Assert add product to cart success message--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartVirtualProductFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartVirtualProductFromStorefrontProductPage"> <argument name="productName" value="$$createBundleProduct.name$$"/> </actionGroup> <!-- Select Mini Cart and select 'View And Edit Cart' --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="selectViewAndEditCart"/> <!-- Assert move product to wishlist success message --> <actionGroup ref="AssertMoveProductToWishListSuccessMessageActionGroup" stepKey="moveToWishlist"> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveVirtualProductFromShoppingCartToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveVirtualProductFromShoppingCartToWishlistTest.xml index adf1e4953badc..ad10b8d01bbbd 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveVirtualProductFromShoppingCartToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveVirtualProductFromShoppingCartToWishlistTest.xml @@ -45,12 +45,12 @@ <waitForPageLoad stepKey="waitForPageToLoad"/> <!-- Add Virtual product to the cart and Assert add product to cart success message--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartVirtualProductFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartVirtualProductFromStorefrontProductPage"> <argument name="productName" value="$$createProduct.name$$"/> </actionGroup> <!-- Select Mini Cart and select 'View And Edit Cart' --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="selectViewAndEditCart"/> <!-- Assert move product to wishlist success message --> <actionGroup ref="AssertMoveProductToWishListSuccessMessageActionGroup" stepKey="moveToWishlist"> From 802126ceaf0aba31101b83c0c7f934c8c0520ff4 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Tue, 10 Dec 2019 20:42:07 -0600 Subject: [PATCH 249/586] Change action groups name according to CE branch changes --- .../CreateNewPageWithAllValuesAndContentActionGroup.xml | 2 +- .../AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml | 4 ++-- .../Test/AdminDeleteCategoryUrlRewriteWithRequestPathTest.xml | 4 ++-- ...MoveDynamicBundleProductFromShoppingCartToWishlistTest.xml | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateNewPageWithAllValuesAndContentActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateNewPageWithAllValuesAndContentActionGroup.xml index 201e78fff6dbe..f231cdbbbfe37 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateNewPageWithAllValuesAndContentActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateNewPageWithAllValuesAndContentActionGroup.xml @@ -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="CreateNewPageWithAllValuesAndContentActionGroup" extends="CreateNewPageWithAllValues"> + <actionGroup name="CreateNewPageWithAllValuesAndContentActionGroup" extends="CreateNewPageWithAllValuesActionGroup"> <arguments> <argument name="pageContent" type="string"/> </arguments> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml index 97e1f16016045..1c1f7af5a5cd5 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml @@ -38,7 +38,7 @@ </actionGroup> <!--Delete the Category Url Rewrite--> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite"> + <actionGroup ref="AssertPageByUrlRewriteIsNotFoundActionGroup" stepKey="deleteCustomUrlRewrite"> <argument name="requestPath" value="-"/> </actionGroup> <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage"> @@ -46,7 +46,7 @@ </actionGroup> <!--Verify AssertPageByUrlRewriteIsNotFound--> - <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="checkUrlOnFrontend"> + <actionGroup ref="AssertPageByUrlRewriteIsNotFoundActionGroup" stepKey="checkUrlOnFrontend"> <argument name="requestPath" value="-"/> </actionGroup> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteWithRequestPathTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteWithRequestPathTest.xml index 18c3e1abe59c4..7c4023c6d0f75 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteWithRequestPathTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteWithRequestPathTest.xml @@ -38,7 +38,7 @@ </actionGroup> <!--Delete the Category Url Rewrite--> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewriteSecondTime"> + <actionGroup ref="AdminDeleteUrlRewriteActionGroup" stepKey="deleteCustomUrlRewriteSecondTime"> <argument name="requestPath" value="newrequestpath.html"/> </actionGroup> <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessageSecondTime"> @@ -46,7 +46,7 @@ </actionGroup> <!--Verify AssertPageByUrlRewriteIsNotFound--> - <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="checkUrlOnFrontendSecondTime"> + <actionGroup ref="AssertPageByUrlRewriteIsNotFoundActionGroup" stepKey="checkUrlOnFrontendSecondTime"> <argument name="requestPath" value="newrequestpath.html"/> </actionGroup> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml index 76e1240b0df77..3a823efbcdf61 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml @@ -46,12 +46,12 @@ <requiredEntity createDataKey="simpleProduct2"/> </createData> <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> - <actionGroup ref="goToProductPageViaID" stepKey="goToProduct"> + <actionGroup ref="GoToProductPageViaIDActionGroup" stepKey="goToProduct"> <argument name="productId" value="$$createBundleProduct.id$$"/> </actionGroup> <scrollTo selector="{{AdminProductFormBundleSection.contentDropDown}}" stepKey="scrollToBundleSection"/> <selectOption userInput="Separately" selector="{{AdminProductFormBundleSection.shipmentType}}" stepKey="selectSeparately"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <magentoCLI stepKey="reindex" command="indexer:reindex"/> <magentoCLI stepKey="flushCache" command="cache:flush"/> </before> From d37620eff93dd5e92381c1cad8c91a6229ffb1e1 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Wed, 11 Dec 2019 10:52:51 +0700 Subject: [PATCH 250/586] [Catalog] Cover Price Validation Result class by Unit Test --- .../Product/Price/Validation/ResultTest.php | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 app/code/Magento/Catalog/Test/Unit/Model/Product/Price/Validation/ResultTest.php diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/Price/Validation/ResultTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/Price/Validation/ResultTest.php new file mode 100644 index 0000000000000..7ed32d564ca19 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/Price/Validation/ResultTest.php @@ -0,0 +1,91 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Catalog\Test\Unit\Model\Product\Price\Validation; + +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use Magento\Catalog\Model\Product\Price\Validation\Result; +use PHPUnit\Framework\TestCase; +use Magento\Catalog\Api\Data\PriceUpdateResultInterface; +use Magento\Catalog\Api\Data\PriceUpdateResultInterfaceFactory; + +class ResultTest extends TestCase +{ + /** + * @var Result + */ + private $model; + + /** + * @var PriceUpdateResultInterfaceFactory|PHPUnit_Framework_MockObject_MockObject + */ + private $priceUpdateResultFactory; + + /** + * @var ObjectManagerHelper|PHPUnit_Framework_MockObject_MockObject + */ + private $objectManager; + + /** + * Setup environment for test + */ + protected function setUp() + { + $this->priceUpdateResultFactory = $this->getMockBuilder(PriceUpdateResultInterfaceFactory::class) + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + + $this->objectManager = new ObjectManagerHelper($this); + $this->model = $this->objectManager->getObject( + Result::class, + [ + 'priceUpdateResultFactory' => $this->priceUpdateResultFactory + ] + ); + + $this->model->addFailedItem(1, 'Invalid attribute color = 1', ['SKU' => 'ABC', 'storeId' => 1]); + $this->model->addFailedItem(2, 'Invalid attribute size = M', ['SKU' => 'DEF', 'storeId' => 1]); + } + + /** + * Test getFailedRowIds() function + */ + public function testGetFailedRowIds() + { + $this->assertEquals([1, 2], $this->model->getFailedRowIds()); + } + + /** + * Test getFailedItems() function + */ + public function testGetFailedItems() + { + $priceUpdateResult1 = $this->createMock(PriceUpdateResultInterface::class); + $priceUpdateResult2 = $this->createMock(PriceUpdateResultInterface::class); + + $this->priceUpdateResultFactory->expects($this->at(0)) + ->method('create') + ->willReturn($priceUpdateResult1); + $this->priceUpdateResultFactory->expects($this->at(1)) + ->method('create') + ->willReturn($priceUpdateResult2); + + $priceUpdateResult1->expects($this->once())->method('setMessage') + ->with('Invalid attribute color = 1'); + $priceUpdateResult1->expects($this->once())->method('setParameters') + ->with(['SKU' => 'ABC', 'storeId' => 1]); + + $priceUpdateResult2->expects($this->once())->method('setMessage') + ->with('Invalid attribute size = M'); + $priceUpdateResult2->expects($this->once())->method('setParameters') + ->with(['SKU' => 'DEF', 'storeId' => 1]); + + $this->assertEquals([$priceUpdateResult1, $priceUpdateResult2], $this->model->getFailedItems()); + } +} From c3a97c015461c39e58f58c41a8c818d2da909571 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Wed, 11 Dec 2019 15:06:30 +0700 Subject: [PATCH 251/586] [Customer] Cover CustomerData\Customer and CustomerData\JsLayoutDataProviderPool by Unit Test --- .../Test/Unit/CustomerData/CustomerTest.php | 90 +++++++++++++++++++ .../JsLayoutDataProviderPoolTest.php | 84 +++++++++++++++++ 2 files changed, 174 insertions(+) create mode 100644 app/code/Magento/Customer/Test/Unit/CustomerData/CustomerTest.php create mode 100644 app/code/Magento/Customer/Test/Unit/CustomerData/JsLayoutDataProviderPoolTest.php diff --git a/app/code/Magento/Customer/Test/Unit/CustomerData/CustomerTest.php b/app/code/Magento/Customer/Test/Unit/CustomerData/CustomerTest.php new file mode 100644 index 0000000000000..735c526878b6b --- /dev/null +++ b/app/code/Magento/Customer/Test/Unit/CustomerData/CustomerTest.php @@ -0,0 +1,90 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Customer\Test\Unit\CustomerData; + +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use Magento\Customer\CustomerData\Customer as CustomerData; +use Magento\Customer\Helper\Session\CurrentCustomer; +use Magento\Customer\Helper\View; +use Magento\Customer\Api\Data\CustomerInterface; +use PHPUnit\Framework\TestCase; + +class CustomerTest extends TestCase +{ + /** + * @var ObjectManagerHelper + */ + private $objectManagerHelper; + + /** + * @var CustomerData + */ + private $customerData; + + /** + * @var CurrentCustomer + */ + private $currentCustomerMock; + + /** + * @var View + */ + private $customerViewHelperMock; + + /** + * Setup environment to test + */ + protected function setUp() + { + $this->currentCustomerMock = $this->createMock(CurrentCustomer::class); + $this->customerViewHelperMock = $this->createMock(View::class); + $this->objectManagerHelper = new ObjectManagerHelper($this); + + $this->customerData = $this->objectManagerHelper->getObject( + CustomerData::class, + [ + 'currentCustomer' => $this->currentCustomerMock, + 'customerViewHelper' => $this->customerViewHelperMock + ] + ); + } + + /** + * Test getSectionData() without customer Id + */ + public function testGetSectionDataWithoutCustomerId() + { + $this->currentCustomerMock->expects($this->any())->method('getCustomerId')->willReturn(null); + $this->assertEquals([], $this->customerData->getSectionData()); + } + + /** + * Test getSectionData() with customer + */ + public function testGetSectionDataWithCustomer() + { + $this->currentCustomerMock->expects($this->any())->method('getCustomerId')->willReturn(1); + $customerMock = $this->createMock(CustomerInterface::class); + $customerMock->expects($this->any())->method('getFirstname')->willReturn('John'); + $customerMock->expects($this->any())->method('getWebsiteId')->willReturn(1); + $this->currentCustomerMock->expects($this->any())->method('getCustomer')->willReturn($customerMock); + $this->customerViewHelperMock->expects($this->any())->method('getCustomerName') + ->with($customerMock) + ->willReturn('John Adam'); + + $this->assertEquals( + [ + 'fullname' => 'John Adam', + 'firstname' => 'John', + 'websiteId' => 1, + ], + $this->customerData->getSectionData() + ); + } +} diff --git a/app/code/Magento/Customer/Test/Unit/CustomerData/JsLayoutDataProviderPoolTest.php b/app/code/Magento/Customer/Test/Unit/CustomerData/JsLayoutDataProviderPoolTest.php new file mode 100644 index 0000000000000..7b7f6ec9f841b --- /dev/null +++ b/app/code/Magento/Customer/Test/Unit/CustomerData/JsLayoutDataProviderPoolTest.php @@ -0,0 +1,84 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Customer\Test\Unit\CustomerData; + +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use Magento\Tax\CustomerData\CheckoutTotalsJsLayoutDataProvider as CheckoutTotalsJs; +use Magento\Customer\CustomerData\JsLayoutDataProviderPool; +use PHPUnit\Framework\TestCase; + +class JsLayoutDataProviderPoolTest extends TestCase +{ + /** + * @var ObjectManagerHelper + */ + private $objectManagerHelper; + + /** + * @var CheckoutTotalsJs + */ + private $checkoutTotalsJsLayoutDataProviderMock; + + /** + * @var JsLayoutDataProviderPool + */ + private $jsLayoutDataProviderPool; + + /** + * Setup environment to test + */ + protected function setUp() + { + $this->checkoutTotalsJsLayoutDataProviderMock = $this->createMock(CheckoutTotalsJs::class); + $this->objectManagerHelper = new ObjectManagerHelper($this); + + $this->jsLayoutDataProviderPool = $this->objectManagerHelper->getObject( + JsLayoutDataProviderPool::class, + [ + 'jsLayoutDataProviders' => [ + 'checkout_totals' => $this->checkoutTotalsJsLayoutDataProviderMock + ] + ] + ); + } + + /** + * Test getData() function + */ + public function testGetData() + { + $checkoutTotalsJsData = [ + 'components' => [ + 'minicart_content' => [ + 'children' => [ + 'subtotal.container' => [ + 'children' => [ + 'subtotal' => [ + 'children' => [ + 'subtotal.totals' => [ + 'config' => [ + 'display_cart_subtotal_incl_tax' => 1, + 'display_cart_subtotal_excl_tax' => 1 + ] + ], + ], + ], + ], + ], + ], + ], + ] + ]; + $this->checkoutTotalsJsLayoutDataProviderMock->expects($this->any()) + ->method('getData') + ->willReturn($checkoutTotalsJsData); + + $this->assertEquals($checkoutTotalsJsData, $this->jsLayoutDataProviderPool->getData()); + } +} From c273067b6a6236883ff623f40589b298c461692d Mon Sep 17 00:00:00 2001 From: "a.chorniy" <a.chorniy@atwix.com> Date: Wed, 11 Dec 2019 10:19:04 +0200 Subject: [PATCH 252/586] fix for system xml. --- app/code/Magento/Config/Model/Config/Structure.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Config/Model/Config/Structure.php b/app/code/Magento/Config/Model/Config/Structure.php index a380dc82a7c5e..a51a26a80ca46 100644 --- a/app/code/Magento/Config/Model/Config/Structure.php +++ b/app/code/Magento/Config/Model/Config/Structure.php @@ -398,7 +398,7 @@ private function getFieldsRecursively(array $elements = []) $this->getFieldsRecursively($element['children']) ); } else { - if ($element['_elementType'] === 'field' && isset($element['label'])) { + if ($element['_elementType'] === 'field') { $structurePath = (isset($element['path']) ? $element['path'] . '/' : '') . $element['id']; $configPath = isset($element['config_path']) ? $element['config_path'] : $structurePath; From eb408932576b485b668d8c44b0e2bacdda764eff Mon Sep 17 00:00:00 2001 From: "a.chorniy" <a.chorniy@atwix.com> Date: Wed, 11 Dec 2019 12:16:54 +0200 Subject: [PATCH 253/586] add ignore phpcs:ignore Magento2.Performance.ForeachArrayMerge.ForeachArrayMerge --- app/code/Magento/Config/Model/Config/Structure.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Config/Model/Config/Structure.php b/app/code/Magento/Config/Model/Config/Structure.php index a51a26a80ca46..a16920f0dc527 100644 --- a/app/code/Magento/Config/Model/Config/Structure.php +++ b/app/code/Magento/Config/Model/Config/Structure.php @@ -292,6 +292,7 @@ public function getFieldPathsByAttribute($attributeName, $attributeValue) foreach ($section['children'] as $group) { if (isset($group['children'])) { $path = $section['id'] . '/' . $group['id']; + // phpcs:ignore Magento2.Performance.ForeachArrayMerge.ForeachArrayMerge $result = array_merge( $result, $this->_getGroupFieldPathsByAttribute( From 4b81e7b87c1d2100b8f58f740d363d920ab4f223 Mon Sep 17 00:00:00 2001 From: Viktor Petryk <victor.petryk@transoftgroup.com> Date: Wed, 11 Dec 2019 12:47:52 +0200 Subject: [PATCH 254/586] MC-29444: Extra Values of UPS and USPS are in dropdown list Cart Price Rule - Condition - Shipping Method --- app/code/Magento/Ups/Model/Carrier.php | 55 +++++---- .../Ups/Test/Unit/Model/CarrierTest.php | 110 ++++++++++++++++-- app/code/Magento/Usps/etc/config.xml | 2 +- 3 files changed, 130 insertions(+), 37 deletions(-) diff --git a/app/code/Magento/Ups/Model/Carrier.php b/app/code/Magento/Ups/Model/Carrier.php index 9e33b86ea8215..e752b0005dbee 100644 --- a/app/code/Magento/Ups/Model/Carrier.php +++ b/app/code/Magento/Ups/Model/Carrier.php @@ -27,7 +27,8 @@ use Magento\Shipping\Model\Shipment\Request as Shipment; /** - * UPS shipping implementation + * UPS shipping implementation. + * * @SuppressWarnings(PHPMD.ExcessiveClassComplexity) * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ @@ -135,7 +136,9 @@ class Carrier extends AbstractCarrierOnline implements CarrierInterface * @inheritdoc */ protected $_debugReplacePrivateDataKeys = [ - 'UserId', 'Password', 'AccessLicenseNumber' + 'UserId', + 'Password', + 'AccessLicenseNumber', ]; /** @@ -352,9 +355,10 @@ public function setRequest(RateRequest $request) $destCountry = self::USA_COUNTRY_ID; } - //for UPS, puero rico state for US will assume as puerto rico country - if ($destCountry == self::USA_COUNTRY_ID && ($request->getDestPostcode() == '00912' || - $request->getDestRegionCode() == self::PUERTORICO_COUNTRY_ID) + //for UPS, puerto rico state for US will assume as puerto rico country + if ($destCountry == self::USA_COUNTRY_ID + && ($request->getDestPostcode() == '00912' + || $request->getDestRegionCode() == self::PUERTORICO_COUNTRY_ID) ) { $destCountry = self::PUERTORICO_COUNTRY_ID; } @@ -727,7 +731,7 @@ protected function _getXmlQuotes() <StateProvinceCode>{$shipperStateProvince}</StateProvinceCode> </Address> </Shipper> - + <ShipTo> <Address> <PostalCode>{$params['19_destPostal']}</PostalCode> @@ -743,7 +747,7 @@ protected function _getXmlQuotes() $xmlParams .= <<<XMLRequest </Address> </ShipTo> - + <ShipFrom> <Address> <PostalCode>{$params['15_origPostal']}</PostalCode> @@ -1302,20 +1306,23 @@ public function getResponse() } /** - * Get allowed shipping methods + * Get allowed shipping methods. * * @return array */ public function getAllowedMethods() { - $allowed = explode(',', $this->getConfigData('allowed_methods')); - $arr = []; - $isByCode = $this->getConfigData('type') == 'UPS_XML'; - foreach ($allowed as $code) { - $arr[$code] = $isByCode ? $this->getShipmentByCode($code) : $this->configHelper->getCode('method', $code); + $isUpsXml = $this->getConfigData('type') === 'UPS_XML'; + $origin = $this->getConfigData('origin_shipment'); + $allowedMethods = $isUpsXml + ? $this->configHelper->getCode('originShipment', $origin) + : $this->configHelper->getCode('method'); + $methods = []; + foreach ($allowedMethods as $methodCode => $methodData) { + $methods[$methodCode] = $methodData->getText(); } - return $arr; + return $methods; } /** @@ -1876,20 +1883,18 @@ public function getContainerTypes(\Magento\Framework\DataObject $params = null) ]; } $containerTypes = $containerTypes + [ - '03' => __('UPS Tube'), - '04' => __('PAK'), - '2a' => __('Small Express Box'), - '2b' => __('Medium Express Box'), - '2c' => __('Large Express Box'), - ]; + '03' => __('UPS Tube'), + '04' => __('PAK'), + '2a' => __('Small Express Box'), + '2b' => __('Medium Express Box'), + '2c' => __('Large Express Box'), + ]; } return ['00' => __('Customer Packaging')] + $containerTypes; - } elseif ($countryShipper == self::USA_COUNTRY_ID && - $countryRecipient == self::PUERTORICO_COUNTRY_ID && - ($method == '03' || - $method == '02' || - $method == '01') + } elseif ($countryShipper == self::USA_COUNTRY_ID + && $countryRecipient == self::PUERTORICO_COUNTRY_ID + && ($method == '03' || $method == '02' || $method == '01') ) { // Container types should be the same as for domestic $params->setCountryRecipient(self::USA_COUNTRY_ID); diff --git a/app/code/Magento/Ups/Test/Unit/Model/CarrierTest.php b/app/code/Magento/Ups/Test/Unit/Model/CarrierTest.php index 0d33087a0f3bc..7af86c30cb5b3 100644 --- a/app/code/Magento/Ups/Test/Unit/Model/CarrierTest.php +++ b/app/code/Magento/Ups/Test/Unit/Model/CarrierTest.php @@ -3,15 +3,16 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + namespace Magento\Ups\Test\Unit\Model; use Magento\Directory\Model\Country; use Magento\Directory\Model\CountryFactory; use Magento\Framework\App\Config\ScopeConfigInterface; -use Magento\Framework\DataObject; use Magento\Framework\HTTP\ClientFactory; use Magento\Framework\HTTP\ClientInterface; use Magento\Framework\Model\AbstractModel; +use Magento\Framework\Phrase; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use Magento\Quote\Model\Quote\Address\RateRequest; use Magento\Quote\Model\Quote\Address\RateResult\Error; @@ -20,11 +21,15 @@ use Magento\Shipping\Model\Rate\ResultFactory; use Magento\Shipping\Model\Simplexml\Element; use Magento\Shipping\Model\Simplexml\ElementFactory; +use Magento\Store\Model\ScopeInterface; +use Magento\Ups\Helper\Config; use Magento\Ups\Model\Carrier; use PHPUnit_Framework_MockObject_MockObject as MockObject; use Psr\Log\LoggerInterface; /** + * Unit tests for \Magento\Ups\Model\Carrier class. + * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class CarrierTest extends \PHPUnit\Framework\TestCase @@ -92,17 +97,23 @@ class CarrierTest extends \PHPUnit\Framework\TestCase */ private $logger; + /** + * @var Config|MockObject + */ + private $configHelper; + + /** + * @inheritdoc + */ protected function setUp() { $this->helper = new ObjectManager($this); $this->scope = $this->getMockBuilder(ScopeConfigInterface::class) ->disableOriginalConstructor() + ->setMethods(['getValue', 'isSetFlag']) ->getMock(); - $this->scope->method('getValue') - ->willReturnCallback([$this, 'scopeConfigGetValue']); - $this->error = $this->getMockBuilder(Error::class) ->setMethods(['setCarrier', 'setCarrierTitle', 'setErrorMessage']) ->getMock(); @@ -143,6 +154,11 @@ protected function setUp() $this->logger = $this->getMockForAbstractClass(LoggerInterface::class); + $this->configHelper = $this->getMockBuilder(Config::class) + ->disableOriginalConstructor() + ->setMethods(['getCode']) + ->getMock(); + $this->model = $this->helper->getObject( Carrier::class, [ @@ -153,6 +169,7 @@ protected function setUp() 'xmlElFactory' => $xmlFactory, 'logger' => $this->logger, 'httpClientFactory' => $httpClientFactory, + 'configHelper' => $this->configHelper, ] ); } @@ -189,14 +206,17 @@ public function scopeConfigGetValue(string $path) * @param bool $freeShippingEnabled * @param int $requestSubtotal * @param int $expectedPrice + * @return void */ public function testGetMethodPrice( - $cost, - $shippingMethod, - $freeShippingEnabled, - $requestSubtotal, - $expectedPrice - ) { + int $cost, + string $shippingMethod, + bool $freeShippingEnabled, + int $requestSubtotal, + int $expectedPrice + ): void { + $this->scope->method('getValue') + ->willReturnCallback([$this, 'scopeConfigGetValue']); $path = 'carriers/' . $this->model->getCarrierCode() . '/'; $this->scope->method('isSetFlag') ->with($path . 'free_shipping_enable') @@ -244,8 +264,13 @@ public function getMethodPriceProvider() ]; } - public function testCollectRatesErrorMessage() + /** + * @return void + */ + public function testCollectRatesErrorMessage(): void { + $this->scope->method('getValue') + ->willReturnCallback([$this, 'scopeConfigGetValue']); $this->scope->method('isSetFlag') ->willReturn(false); @@ -373,6 +398,69 @@ public function countryDataProvider() ]; } + /** + * @dataProvider allowedMethodsDataProvider + * @param string $carrierType + * @param string $methodType + * @param string $methodCode + * @param string $methodTitle + * @param array $expectedMethods + * @return void + */ + public function testGetAllowedMethods( + string $carrierType, + string $methodType, + string $methodCode, + string $methodTitle, + array $expectedMethods + ): void { + $this->scope->method('getValue') + ->willReturnMap( + [ + [ + 'carriers/ups/type', + ScopeInterface::SCOPE_STORE, + null, + $carrierType + ], + [ + 'carriers/ups/origin_shipment', + ScopeInterface::SCOPE_STORE, + null, + 'Shipments Originating in United States', + ], + ] + ); + $this->configHelper->method('getCode') + ->with($methodType) + ->willReturn([$methodCode => new Phrase($methodTitle)]); + $actualMethods = $this->model->getAllowedMethods(); + $this->assertEquals($expectedMethods, $actualMethods); + } + + /** + * @return array + */ + public function allowedMethodsDataProvider(): array + { + return [ + [ + 'UPS', + 'method', + '1DM', + 'Next Day Air Early AM', + ['1DM' => 'Next Day Air Early AM'], + ], + [ + 'UPS_XML', + 'originShipment', + '01', + 'UPS Next Day Air', + ['01' => 'UPS Next Day Air'], + ], + ]; + } + /** * Creates mock for XML factory. * diff --git a/app/code/Magento/Usps/etc/config.xml b/app/code/Magento/Usps/etc/config.xml index 68c1b31fcd515..7bfe3dc86a06e 100644 --- a/app/code/Magento/Usps/etc/config.xml +++ b/app/code/Magento/Usps/etc/config.xml @@ -11,7 +11,7 @@ <usps> <active>0</active> <sallowspecific>0</sallowspecific> - <allowed_methods>0_FCLE,0_FCL,0_FCP,1,2,3,4,6,7,13,16,17,22,23,25,27,28,33,34,35,36,37,42,43,53,55,56,57,61,INT_1,INT_2,INT_4,INT_6,INT_7,INT_8,INT_9,INT_10,INT_11,INT_12,INT_13,INT_14,INT_15,INT_16,INT_20,INT_26</allowed_methods> + <allowed_methods>0_FCLE,0_FCL,0_FCP,1,2,3,4,6,7,13,16,17,22,23,25,27,28,33,34,35,36,37,42,43,53,57,61,INT_1,INT_2,INT_4,INT_6,INT_7,INT_8,INT_9,INT_10,INT_11,INT_12,INT_13,INT_14,INT_15,INT_16,INT_20</allowed_methods> <container>VARIABLE</container> <cutoff_cost /> <free_method /> From bad9717027a4b4a54eb427ed5915b9315f045034 Mon Sep 17 00:00:00 2001 From: Buba Suma <soumah@adobe.com> Date: Wed, 11 Dec 2019 13:43:45 +0200 Subject: [PATCH 255/586] MC-29417: hide_from_product_page not working for import using store views --- .../Model/Import/Product.php | 51 ++++++++------ .../Import/Product/MediaGalleryProcessor.php | 20 +++--- .../Model/Import/ProductTest.php | 70 +++++++++++++++++-- ...mport_change_image_label_for_storeview.csv | 2 + .../import_hide_image_for_storeview.csv | 2 + 5 files changed, 111 insertions(+), 34 deletions(-) create mode 100644 dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_change_image_label_for_storeview.csv create mode 100644 dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_hide_image_for_storeview.csv diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product.php b/app/code/Magento/CatalogImportExport/Model/Import/Product.php index 8f70ea88f4ba7..7ebc397cbe650 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product.php @@ -1569,6 +1569,13 @@ protected function _saveProducts() continue; } + $storeId = !empty($rowData[self::COL_STORE]) + ? $this->getStoreIdByCode($rowData[self::COL_STORE]) + : Store::DEFAULT_STORE_ID; + $rowExistingImages = $existingImages[$storeId][$rowSku] ?? []; + $rowStoreMediaGalleryValues = $rowExistingImages; + $rowExistingImages += $existingImages[Store::DEFAULT_STORE_ID][$rowSku] ?? []; + if (self::SCOPE_STORE == $rowScope) { // set necessary data from SCOPE_DEFAULT row $rowData[self::COL_TYPE] = $this->skuProcessor->getNewSku($rowSku)['type_id']; @@ -1672,19 +1679,16 @@ protected function _saveProducts() // 5. Media gallery phase list($rowImages, $rowLabels) = $this->getImagesFromRow($rowData); - $storeId = !empty($rowData[self::COL_STORE]) - ? $this->getStoreIdByCode($rowData[self::COL_STORE]) - : Store::DEFAULT_STORE_ID; $imageHiddenStates = $this->getImagesHiddenStates($rowData); foreach (array_keys($imageHiddenStates) as $image) { - if (array_key_exists($rowSku, $existingImages) - && array_key_exists($image, $existingImages[$rowSku]) - ) { - $rowImages[self::COL_MEDIA_IMAGE][] = $image; + //Mark image as uploaded if it exists + if (array_key_exists($image, $rowExistingImages)) { $uploadedImages[$image] = $image; } - - if (empty($rowImages)) { + //Add image to hide to images list if it does not exist + if (empty($rowImages[self::COL_MEDIA_IMAGE]) + || !in_array($image, $rowImages[self::COL_MEDIA_IMAGE]) + ) { $rowImages[self::COL_MEDIA_IMAGE][] = $image; } } @@ -1725,24 +1729,29 @@ protected function _saveProducts() continue; } - if (isset($existingImages[$rowSku][$uploadedFile])) { - $currentFileData = $existingImages[$rowSku][$uploadedFile]; + if (isset($rowExistingImages[$uploadedFile])) { + $currentFileData = $rowExistingImages[$uploadedFile]; + $currentFileData['store_id'] = $storeId; + $storeMediaGalleryValueExists = isset($rowStoreMediaGalleryValues[$uploadedFile]); + if (array_key_exists($uploadedFile, $imageHiddenStates) + && $currentFileData['disabled'] != $imageHiddenStates[$uploadedFile] + ) { + $imagesForChangeVisibility[] = [ + 'disabled' => $imageHiddenStates[$uploadedFile], + 'imageData' => $currentFileData, + 'exists' => $storeMediaGalleryValueExists + ]; + $storeMediaGalleryValueExists = true; + } + if (isset($rowLabels[$column][$columnImageKey]) && $rowLabels[$column][$columnImageKey] != $currentFileData['label'] ) { $labelsForUpdate[] = [ 'label' => $rowLabels[$column][$columnImageKey], - 'imageData' => $currentFileData - ]; - } - - if (array_key_exists($uploadedFile, $imageHiddenStates) - && $currentFileData['disabled'] != $imageHiddenStates[$uploadedFile] - ) { - $imagesForChangeVisibility[] = [ - 'disabled' => $imageHiddenStates[$uploadedFile], - 'imageData' => $currentFileData + 'imageData' => $currentFileData, + 'exists' => $storeMediaGalleryValueExists ]; } } else { diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product/MediaGalleryProcessor.php b/app/code/Magento/CatalogImportExport/Model/Import/Product/MediaGalleryProcessor.php index 00e6da0ebe077..bd8523a4e396e 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product/MediaGalleryProcessor.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product/MediaGalleryProcessor.php @@ -12,7 +12,6 @@ use Magento\Framework\App\ResourceConnection; use Magento\Framework\EntityManager\MetadataPool; use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface; -use Magento\Store\Model\Store; /** * Process and saves images during import. @@ -179,13 +178,15 @@ private function updateMediaGalleryField(array $data, $field) $insertData = []; foreach ($data as $datum) { $imageData = $datum['imageData']; + $exists = $datum['exists'] ?? true; - if ($imageData[$field] === null) { + if (!$exists) { $insertData[] = [ $field => $datum[$field], $this->getProductEntityLinkField() => $imageData[$this->getProductEntityLinkField()], 'value_id' => $imageData['value_id'], - 'store_id' => Store::DEFAULT_STORE_ID, + 'store_id' => $imageData['store_id'], + 'position' => $imageData['position'], ]; } else { $this->connection->update( @@ -196,7 +197,7 @@ private function updateMediaGalleryField(array $data, $field) [ $this->getProductEntityLinkField() . ' = ?' => $imageData[$this->getProductEntityLinkField()], 'value_id = ?' => $imageData['value_id'], - 'store_id = ?' => Store::DEFAULT_STORE_ID, + 'store_id = ?' => $imageData['store_id'], ] ); } @@ -240,14 +241,15 @@ public function getExistingImages(array $bunch) )->joinLeft( ['mgv' => $this->mediaGalleryValueTableName], sprintf( - '(mg.value_id = mgv.value_id AND mgv.%s = mgvte.%s AND mgv.store_id = %d)', + '(mgv.%s = mgvte.%s AND mg.value_id = mgv.value_id)', $this->getProductEntityLinkField(), - $this->getProductEntityLinkField(), - Store::DEFAULT_STORE_ID + $this->getProductEntityLinkField() ), [ + 'store_id' => 'mgv.store_id', 'label' => 'mgv.label', 'disabled' => 'mgv.disabled', + 'position' => 'mgv.position', ] )->joinInner( ['pe' => $this->productEntityTableName], @@ -259,7 +261,9 @@ public function getExistingImages(array $bunch) ); foreach ($this->connection->fetchAll($select) as $image) { - $result[$image['sku']][$image['value']] = $image; + $storeId = $image['store_id']; + unset($image['store_id']); + $result[$storeId][$image['sku']][$image['value']] = $image; } return $result; diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php index 3a039217d61fc..c47a4f340f983 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php @@ -29,6 +29,7 @@ use Magento\ImportExport\Model\Import; use Magento\ImportExport\Model\Import\Source\Csv; use Magento\Store\Model\Store; +use Magento\Store\Model\StoreManagerInterface; use Magento\UrlRewrite\Model\ResourceModel\UrlRewriteCollection; use Psr\Log\LoggerInterface; use Magento\TestFramework\Helper\Bootstrap as BootstrapHelper; @@ -386,14 +387,14 @@ public function testSaveCustomOptions(string $importFile, string $sku, int $expe public function testSaveCustomOptionsWithMultipleStoreViews() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var \Magento\Store\Model\StoreManagerInterface $storeManager */ - $storeManager = $objectManager->get(\Magento\Store\Model\StoreManagerInterface::class); + /** @var StoreManagerInterface $storeManager */ + $storeManager = $objectManager->get(StoreManagerInterface::class); $storeCodes = [ 'admin', 'default', 'secondstore', ]; - /** @var \Magento\Store\Model\StoreManagerInterface $storeManager */ + /** @var StoreManagerInterface $storeManager */ $importFile = 'product_with_custom_options_and_multiple_store_views.csv'; $sku = 'simple'; $pathToFile = __DIR__ . '/_files/' . $importFile; @@ -1187,7 +1188,7 @@ public function testProductsWithMultipleStores() $product->load($id); $this->assertEquals('1', $product->getHasOptions()); - $objectManager->get(\Magento\Store\Model\StoreManagerInterface::class)->setCurrentStore('fixturestore'); + $objectManager->get(StoreManagerInterface::class)->setCurrentStore('fixturestore'); /** @var \Magento\Catalog\Model\Product $simpleProduct */ $simpleProduct = $objectManager->create(\Magento\Catalog\Model\Product::class); @@ -2246,13 +2247,20 @@ function ($output, $error) { * Load product by given product sku * * @param string $sku + * @param mixed $store * @return \Magento\Catalog\Model\Product */ - private function getProductBySku($sku) + private function getProductBySku($sku, $store = null) { $resource = $this->objectManager->get(\Magento\Catalog\Model\ResourceModel\Product::class); $productId = $resource->getIdBySku($sku); $product = $this->objectManager->create(\Magento\Catalog\Model\Product::class); + if ($store) { + /** @var StoreManagerInterface $storeManager */ + $storeManager = $this->objectManager->get(StoreManagerInterface::class); + $store = $storeManager->getStore($store); + $product->setStoreId($store->getId()); + } $product->load($productId); return $product; @@ -2773,4 +2781,56 @@ public function testProductBaseImageAfterImport() $productAfterImport = $this->getProductBySku('simple_new'); $this->assertNotEquals('/no/exists/image/magento_image.jpg', $productAfterImport->getData('image')); } + + /** + * Tests that images are hidden only for a store view in "store_view_code". + * + * @magentoDataFixture mediaImportImageFixture + * @magentoDataFixture Magento/Store/_files/core_fixturestore.php + * @magentoDataFixture Magento/Catalog/_files/product_with_image.php + */ + public function testHideImageForStoreView() + { + $expectedImageFile = '/m/a/magento_image.jpg'; + $secondStoreCode = 'fixturestore'; + $productSku = 'simple'; + $this->importDataForMediaTest('import_hide_image_for_storeview.csv'); + $product = $this->getProductBySku($productSku); + $imageItems = $product->getMediaGalleryImages()->getItems(); + $this->assertCount(1, $imageItems); + $imageItem = array_shift($imageItems); + $this->assertEquals($expectedImageFile, $imageItem->getFile()); + $product = $this->getProductBySku($productSku, $secondStoreCode); + $imageItems = $product->getMediaGalleryImages()->getItems(); + $this->assertCount(0, $imageItems); + } + + /** + * Test that images labels are updated only for a store view in "store_view_code". + * + * @magentoDataFixture mediaImportImageFixture + * @magentoDataFixture Magento/Store/_files/core_fixturestore.php + * @magentoDataFixture Magento/Catalog/_files/product_with_image.php + */ + public function testChangeImageLabelForStoreView() + { + $expectedImageFile = '/m/a/magento_image.jpg'; + $expectedLabelForDefaultStoreView = 'Image Alt Text'; + $expectedLabelForSecondStoreView = 'Magento Logo'; + $secondStoreCode = 'fixturestore'; + $productSku = 'simple'; + $this->importDataForMediaTest('import_change_image_label_for_storeview.csv'); + $product = $this->getProductBySku($productSku); + $imageItems = $product->getMediaGalleryImages()->getItems(); + $this->assertCount(1, $imageItems); + $imageItem = array_shift($imageItems); + $this->assertEquals($expectedImageFile, $imageItem->getFile()); + $this->assertEquals($expectedLabelForDefaultStoreView, $imageItem->getLabel()); + $product = $this->getProductBySku($productSku, $secondStoreCode); + $imageItems = $product->getMediaGalleryImages()->getItems(); + $this->assertCount(1, $imageItems); + $imageItem = array_shift($imageItems); + $this->assertEquals($expectedImageFile, $imageItem->getFile()); + $this->assertEquals($expectedLabelForSecondStoreView, $imageItem->getLabel()); + } } diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_change_image_label_for_storeview.csv b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_change_image_label_for_storeview.csv new file mode 100644 index 0000000000000..95321df2b6b01 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_change_image_label_for_storeview.csv @@ -0,0 +1,2 @@ +"sku","store_view_code","base_image", "base_image_label" +"simple","fixturestore","/m/a/magento_image.jpg", "Magento Logo" diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_hide_image_for_storeview.csv b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_hide_image_for_storeview.csv new file mode 100644 index 0000000000000..8400dc17d2a29 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_hide_image_for_storeview.csv @@ -0,0 +1,2 @@ +"sku","store_view_code","hide_from_product_page" +"simple","fixturestore","/m/a/magento_image.jpg" From d407e0106d0311c064af7cd988396a852a1e152d Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <nazarn96@gmail.com> Date: Wed, 11 Dec 2019 14:46:00 +0200 Subject: [PATCH 256/586] Cover magento/magento2#25556 with jasmine test --- .../js/jasmine/tests/lib/mage/browser.test.js | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 dev/tests/js/jasmine/tests/lib/mage/browser.test.js diff --git a/dev/tests/js/jasmine/tests/lib/mage/browser.test.js b/dev/tests/js/jasmine/tests/lib/mage/browser.test.js new file mode 100644 index 0000000000000..2c60497ce1bcc --- /dev/null +++ b/dev/tests/js/jasmine/tests/lib/mage/browser.test.js @@ -0,0 +1,62 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +define([ + 'mage/adminhtml/browser', + 'jquery' +], function (browser, $) { + 'use strict'; + + var obj; + + beforeEach(function () { + + /** + * Dummy constructor to use for instantiation + * @constructor + */ + var Constr = function () {}; + + Constr.prototype = browser; + + obj = new Constr(); + }); + + describe('"openDialog" method', function () { + it('Opens dialog with provided targetElementId', function () { + var options = { + 'targetElementId': 1 + }; + + spyOn($, 'ajax').and.callFake( + function () { + return { + done: function (data) { + obj.targetElementId = 1; + } + } + }); + obj.openDialog('instance/url', 100, 100, 'title', options); + obj.openDialog('instance/url', 100, 100, 'title', options); + expect($.ajax.calls.count()).toBe(1); + + }); + + it('Opens dialog with provided url param', function () { + spyOn($, 'ajax').and.callFake( + function () { + return { + done: function (data) { + obj.targetElementId = 'instance/url'; + obj.modalLoaded = true; + } + } + }); + obj.openDialog('instance/url', 100, 100, 'title', undefined); + obj.openDialog('instance/url', 100, 100, 'title', undefined); + expect($.ajax.calls.count()).toBe(1); + }); + }); +}); From 47e3ada764fc943fc63d88671ce10b2877fe57d0 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Mon, 25 Nov 2019 12:57:40 +0200 Subject: [PATCH 257/586] MC-4242: Newsletter subscriptions per website --- .../Mftf/Test/SearchEntityResultsTest.xml | 3 + .../Customer/Block/Account/Dashboard.php | 47 +- .../Customer/Block/Account/Dashboard/Info.php | 51 +- .../Block/Adminhtml/Edit/Tab/Newsletter.php | 371 +++++++--- .../Adminhtml/Edit/Tab/Newsletter/Grid.php | 105 ++- .../Form/Element/Newsletter/Subscriptions.php | 161 +++++ .../Adminhtml/Index/MassSubscribe.php | 18 +- .../Adminhtml/Index/MassUnsubscribe.php | 17 +- .../Controller/Adminhtml/Index/Save.php | 158 +++-- ...CustomerSubscribeNewsletterActionGroup.xml | 34 + ...CustomerSubscribeNewsletterActionGroup.xml | 36 + .../AdminEditCustomerNewsletterSection.xml | 4 +- ...stomerOnStorefrontSignupNewsletterTest.xml | 2 +- ...tomerSubscribeNewsletterPerWebsiteTest.xml | 101 +++ .../Adminhtml/Edit/Tab/NewsletterTest.php | 346 +++++++--- .../Element/Newsletter/SubscriptionsTest.php | 185 +++++ .../Adminhtml/Index/MassSubscribeTest.php | 118 ++-- .../Adminhtml/Index/MassUnsubscribeTest.php | 118 ++-- .../Controller/Adminhtml/Index/SaveTest.php | 348 +++++----- .../adminhtml/templates/tab/newsletter.phtml | 1 + .../Customer/ChangeSubscriptionStatus.php | 48 -- .../Model/Customer/CreateCustomerAccount.php | 25 +- .../Model/Customer/UpdateCustomerAccount.php | 23 +- .../Newsletter/Controller/Manage/Save.php | 29 +- .../Controller/Subscriber/NewAction.php | 54 +- .../Model/Plugin/CustomerPlugin.php | 281 ++++++-- .../Model/ResourceModel/Queue/Collection.php | 25 + .../Model/ResourceModel/Subscriber.php | 144 ++-- .../Magento/Newsletter/Model/Subscriber.php | 634 +++++++---------- .../Newsletter/Model/SubscriptionManager.php | 314 +++++++++ .../Model/SubscriptionManagerInterface.php | 51 ++ .../Unit/Model/Plugin/CustomerPluginTest.php | 389 ++++++----- .../Test/Unit/Model/SubscriberTest.php | 517 +++++++------- .../Unit/Model/SubscriptionManagerTest.php | 651 ++++++++++++++++++ app/code/Magento/Newsletter/etc/di.xml | 7 + app/code/Magento/Store/Model/System/Store.php | 62 +- .../web/css/source/_module.less | 30 + .../Adminhtml/Edit/Tab/NewsletterTest.php | 3 +- .../Controller/Adminhtml/IndexTest.php | 3 +- 39 files changed, 3817 insertions(+), 1697 deletions(-) create mode 100644 app/code/Magento/Customer/Block/Adminhtml/Form/Element/Newsletter/Subscriptions.php create mode 100644 app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminAssertCustomerSubscribeNewsletterActionGroup.xml create mode 100644 app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCustomerSubscribeNewsletterActionGroup.xml create mode 100644 app/code/Magento/Customer/Test/Mftf/Test/AdminCustomerSubscribeNewsletterPerWebsiteTest.xml create mode 100644 app/code/Magento/Customer/Test/Unit/Block/Adminhtml/From/Element/Newsletter/SubscriptionsTest.php delete mode 100644 app/code/Magento/CustomerGraphQl/Model/Customer/ChangeSubscriptionStatus.php create mode 100644 app/code/Magento/Newsletter/Model/SubscriptionManager.php create mode 100644 app/code/Magento/Newsletter/Model/SubscriptionManagerInterface.php create mode 100644 app/code/Magento/Newsletter/Test/Unit/Model/SubscriptionManagerTest.php diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml index 3b60e4b09de28..40a02d2ce24f3 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml @@ -308,6 +308,9 @@ <createData entity="_defaultProduct" stepKey="createSimpleProduct"> <requiredEntity createDataKey="createCategory"/> </createData> + <!-- Perform reindex and flush cache --> + <magentoCLI command="indexer:reindex" stepKey="reindex"/> + <magentoCLI command="cache:flush" arguments="full_page" stepKey="flushCache"/> </before> <after> <deleteData stepKey="deleteProduct" createDataKey="createSimpleProduct"/> diff --git a/app/code/Magento/Customer/Block/Account/Dashboard.php b/app/code/Magento/Customer/Block/Account/Dashboard.php index 8e0f79d45770a..547074d0bcd81 100644 --- a/app/code/Magento/Customer/Block/Account/Dashboard.php +++ b/app/code/Magento/Customer/Block/Account/Dashboard.php @@ -7,6 +7,14 @@ use Magento\Customer\Api\AccountManagementInterface; use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\AddressInterface; +use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Customer\Model\Session; +use Magento\Framework\Phrase; +use Magento\Framework\View\Element\Template; +use Magento\Framework\View\Element\Template\Context; +use Magento\Newsletter\Model\Subscriber; +use Magento\Newsletter\Model\SubscriberFactory; /** * Customer dashboard block @@ -14,20 +22,20 @@ * @api * @since 100.0.2 */ -class Dashboard extends \Magento\Framework\View\Element\Template +class Dashboard extends Template { /** - * @var \Magento\Newsletter\Model\Subscriber + * @var Subscriber */ protected $subscription; /** - * @var \Magento\Customer\Model\Session + * @var Session */ protected $customerSession; /** - * @var \Magento\Newsletter\Model\SubscriberFactory + * @var SubscriberFactory */ protected $subscriberFactory; @@ -42,19 +50,17 @@ class Dashboard extends \Magento\Framework\View\Element\Template protected $customerAccountManagement; /** - * Constructor - * - * @param \Magento\Framework\View\Element\Template\Context $context - * @param \Magento\Customer\Model\Session $customerSession - * @param \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory + * @param Context $context + * @param Session $customerSession + * @param SubscriberFactory $subscriberFactory * @param CustomerRepositoryInterface $customerRepository * @param AccountManagementInterface $customerAccountManagement * @param array $data */ public function __construct( - \Magento\Framework\View\Element\Template\Context $context, - \Magento\Customer\Model\Session $customerSession, - \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory, + Context $context, + Session $customerSession, + SubscriberFactory $subscriberFactory, CustomerRepositoryInterface $customerRepository, AccountManagementInterface $customerAccountManagement, array $data = [] @@ -69,7 +75,7 @@ public function __construct( /** * Return the Customer given the customer Id stored in the session. * - * @return \Magento\Customer\Api\Data\CustomerInterface + * @return CustomerInterface */ public function getCustomer() { @@ -99,7 +105,7 @@ public function getAddressesUrl() /** * Retrieve the Url for editing the specified address. * - * @param \Magento\Customer\Api\Data\AddressInterface $address + * @param AddressInterface $address * @return string */ public function getAddressEditUrl($address) @@ -146,13 +152,14 @@ public function getWishlistUrl() /** * Retrieve the subscription object (i.e. the subscriber). * - * @return \Magento\Newsletter\Model\Subscriber + * @return Subscriber */ public function getSubscriptionObject() { if ($this->subscription === null) { - $this->subscription = - $this->_createSubscriber()->loadByCustomerId($this->customerSession->getCustomerId()); + $websiteId = (int)$this->_storeManager->getWebsite()->getId(); + $this->subscription = $this->_createSubscriber(); + $this->subscription->loadByCustomer((int)$this->getCustomer()->getId(), $websiteId); } return $this->subscription; @@ -171,7 +178,7 @@ public function getManageNewsletterUrl() /** * Retrieve subscription text, either subscribed or not. * - * @return \Magento\Framework\Phrase + * @return Phrase */ public function getSubscriptionText() { @@ -185,7 +192,7 @@ public function getSubscriptionText() /** * Retrieve the customer's primary addresses (i.e. default billing and shipping). * - * @return \Magento\Customer\Api\Data\AddressInterface[]|bool + * @return AddressInterface[]|bool */ public function getPrimaryAddresses() { @@ -230,7 +237,7 @@ public function getBackUrl() /** * Create an instance of a subscriber. * - * @return \Magento\Newsletter\Model\Subscriber + * @return Subscriber */ protected function _createSubscriber() { diff --git a/app/code/Magento/Customer/Block/Account/Dashboard/Info.php b/app/code/Magento/Customer/Block/Account/Dashboard/Info.php index 87132c3afb8bc..a48c706124c92 100644 --- a/app/code/Magento/Customer/Block/Account/Dashboard/Info.php +++ b/app/code/Magento/Customer/Block/Account/Dashboard/Info.php @@ -5,7 +5,15 @@ */ namespace Magento\Customer\Block\Account\Dashboard; +use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Customer\Block\Form\Register; +use Magento\Customer\Helper\Session\CurrentCustomer; +use Magento\Customer\Helper\View; use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\View\Element\Template; +use Magento\Framework\View\Element\Template\Context; +use Magento\Newsletter\Model\Subscriber; +use Magento\Newsletter\Model\SubscriberFactory; /** * Dashboard Customer Info @@ -13,44 +21,44 @@ * @api * @since 100.0.2 */ -class Info extends \Magento\Framework\View\Element\Template +class Info extends Template { /** * Cached subscription object * - * @var \Magento\Newsletter\Model\Subscriber + * @var Subscriber */ protected $_subscription; /** - * @var \Magento\Newsletter\Model\SubscriberFactory + * @var SubscriberFactory */ protected $_subscriberFactory; /** - * @var \Magento\Customer\Helper\View + * @var View */ protected $_helperView; /** - * @var \Magento\Customer\Helper\Session\CurrentCustomer + * @var CurrentCustomer */ protected $currentCustomer; /** * Constructor * - * @param \Magento\Framework\View\Element\Template\Context $context - * @param \Magento\Customer\Helper\Session\CurrentCustomer $currentCustomer - * @param \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory - * @param \Magento\Customer\Helper\View $helperView + * @param Context $context + * @param CurrentCustomer $currentCustomer + * @param SubscriberFactory $subscriberFactory + * @param View $helperView * @param array $data */ public function __construct( - \Magento\Framework\View\Element\Template\Context $context, - \Magento\Customer\Helper\Session\CurrentCustomer $currentCustomer, - \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory, - \Magento\Customer\Helper\View $helperView, + Context $context, + CurrentCustomer $currentCustomer, + SubscriberFactory $subscriberFactory, + View $helperView, array $data = [] ) { $this->currentCustomer = $currentCustomer; @@ -62,7 +70,7 @@ public function __construct( /** * Returns the Magento Customer Model for this block * - * @return \Magento\Customer\Api\Data\CustomerInterface|null + * @return CustomerInterface|null */ public function getCustomer() { @@ -84,6 +92,8 @@ public function getName() } /** + * Get the url to change password + * * @return string */ public function getChangePasswordUrl() @@ -94,7 +104,7 @@ public function getChangePasswordUrl() /** * Get Customer Subscription Object Information * - * @return \Magento\Newsletter\Model\Subscriber + * @return Subscriber */ public function getSubscriptionObject() { @@ -102,7 +112,8 @@ public function getSubscriptionObject() $this->_subscription = $this->_createSubscriber(); $customer = $this->getCustomer(); if ($customer) { - $this->_subscription->loadByCustomerId($customer->getId()); + $websiteId = (int)$this->_storeManager->getWebsite()->getId(); + $this->_subscription->loadByCustomer((int)$customer->getId(), $websiteId); } } return $this->_subscription; @@ -128,12 +139,14 @@ public function getIsSubscribed() public function isNewsletterEnabled() { return $this->getLayout() - ->getBlockSingleton(\Magento\Customer\Block\Form\Register::class) + ->getBlockSingleton(Register::class) ->isNewsletterEnabled(); } /** - * @return \Magento\Newsletter\Model\Subscriber + * Create new instance of Subscriber + * + * @return Subscriber */ protected function _createSubscriber() { @@ -141,7 +154,7 @@ protected function _createSubscriber() } /** - * @return string + * @inheritdoc */ protected function _toHtml() { diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter.php index 46a8dcfb28f1b..0d94a01698b31 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter.php @@ -5,14 +5,30 @@ */ namespace Magento\Customer\Block\Adminhtml\Edit\Tab; +use Magento\Backend\Block\Template\Context; +use Magento\Backend\Block\Widget\Form\Generic; use Magento\Customer\Api\AccountManagementInterface; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Customer\Block\Adminhtml\Form\Element\Newsletter\Subscriptions as SubscriptionsElement; use Magento\Customer\Controller\RegistryConstants; +use Magento\Customer\Model\Config\Share; +use Magento\Framework\Data\Form; +use Magento\Framework\Data\Form\Element\Fieldset; +use Magento\Framework\Data\FormFactory; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Registry; +use Magento\Newsletter\Model\Subscriber; +use Magento\Newsletter\Model\SubscriberFactory; +use Magento\Store\Model\System\Store as SystemStore; use Magento\Ui\Component\Layout\Tabs\TabInterface; /** * Customer account form block + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class Newsletter extends \Magento\Backend\Block\Widget\Form\Generic implements TabInterface +class Newsletter extends Generic implements TabInterface { /** * @var string @@ -20,7 +36,7 @@ class Newsletter extends \Magento\Backend\Block\Widget\Form\Generic implements T protected $_template = 'Magento_Customer::tab/newsletter.phtml'; /** - * @var \Magento\Newsletter\Model\SubscriberFactory + * @var SubscriberFactory */ protected $_subscriberFactory; @@ -32,37 +48,57 @@ class Newsletter extends \Magento\Backend\Block\Widget\Form\Generic implements T /** * Core registry * - * @var \Magento\Framework\Registry + * @var Registry */ protected $_coreRegistry = null; /** - * Constructor - * - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Framework\Registry $registry - * @param \Magento\Framework\Data\FormFactory $formFactory - * @param \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory + * @var SystemStore + */ + private $systemStore; + + /** + * @var CustomerRepositoryInterface + */ + private $customerRepository; + + /** + * @var Share + */ + private $shareConfig; + + /** + * @param Context $context + * @param Registry $registry + * @param FormFactory $formFactory + * @param SubscriberFactory $subscriberFactory * @param AccountManagementInterface $customerAccountManagement + * @param SystemStore $systemStore + * @param CustomerRepositoryInterface $customerRepository + * @param Share $shareConfig * @param array $data */ public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Framework\Registry $registry, - \Magento\Framework\Data\FormFactory $formFactory, - \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory, + Context $context, + Registry $registry, + FormFactory $formFactory, + SubscriberFactory $subscriberFactory, AccountManagementInterface $customerAccountManagement, + SystemStore $systemStore, + CustomerRepositoryInterface $customerRepository, + Share $shareConfig, array $data = [] ) { $this->_subscriberFactory = $subscriberFactory; $this->customerAccountManagement = $customerAccountManagement; parent::__construct($context, $registry, $formFactory, $data); + $this->systemStore = $systemStore; + $this->customerRepository = $customerRepository; + $this->shareConfig = $shareConfig; } /** - * Return Tab label - * - * @return \Magento\Framework\Phrase + * @inheritdoc */ public function getTabLabel() { @@ -70,9 +106,7 @@ public function getTabLabel() } /** - * Return Tab title - * - * @return \Magento\Framework\Phrase + * @inheritdoc */ public function getTabTitle() { @@ -80,9 +114,7 @@ public function getTabTitle() } /** - * Tab class getter - * - * @return string + * @inheritdoc */ public function getTabClass() { @@ -90,9 +122,7 @@ public function getTabClass() } /** - * Return URL link to Tab content - * - * @return string + * @inheritdoc */ public function getTabUrl() { @@ -100,9 +130,7 @@ public function getTabUrl() } /** - * Tab should be loaded trough Ajax call - * - * @return bool + * @inheritdoc */ public function isAjaxLoaded() { @@ -110,19 +138,15 @@ public function isAjaxLoaded() } /** - * Can show tab in tabs - * - * @return boolean + * @inheritdoc */ public function canShowTab() { - return $this->_coreRegistry->registry(RegistryConstants::CURRENT_CUSTOMER_ID); + return (bool)$this->getCurrentCustomerId(); } /** - * Tab is hidden - * - * @return boolean + * @inheritdoc */ public function isHidden() { @@ -130,77 +154,256 @@ public function isHidden() } /** - * Initialize the form. + * @inheritdoc + */ + protected function _prepareForm() + { + $this->initForm(); + + return $this; + } + + /** + * Init form values * * @return $this - * @SuppressWarnings(PHPMD.NPathComplexity) */ public function initForm() { if (!$this->canShowTab()) { return $this; } - /**@var \Magento\Framework\Data\Form $form */ + $form = $this->_formFactory->create(); $form->setHtmlIdPrefix('_newsletter'); - $customerId = $this->_coreRegistry->registry(RegistryConstants::CURRENT_CUSTOMER_ID); - $subscriber = $this->_subscriberFactory->create()->loadByCustomerId($customerId); - $this->_coreRegistry->register('subscriber', $subscriber, true); + $this->setForm($form); + $fieldset = $form->addFieldset( + 'base_fieldset', + [ + 'legend' => __('Newsletter Information'), + 'class' => 'customer-newsletter-fieldset' . (!$this->isSingleWebsiteMode() ? ' multi-website' : ''), + ] + ); - $fieldset = $form->addFieldset('base_fieldset', ['legend' => __('Newsletter Information')]); + $customerSubscriptions = $this->getCustomerSubscriptionsOnWebsites(); + if (empty($customerSubscriptions)) { + return $this; + } - $fieldset->addField( - 'subscription', + if ($this->isSingleWebsiteMode()) { + $this->prepareFormSingleWebsite($fieldset, $customerSubscriptions); + $this->updateFromSession($form, $this->getCurrentCustomerId()); + } else { + $this->prepareFormMultiplyWebsite($fieldset, $customerSubscriptions); + } + + if ($this->customerAccountManagement->isReadonly($this->getCurrentCustomerId())) { + $fieldset->setReadonly(true, true); + } + + return $this; + } + + /** + * Prepare form fields for single website mode + * + * @param Fieldset $fieldset + * @param array $subscriptions + * @return void + */ + private function prepareFormSingleWebsite(Fieldset $fieldset, array $subscriptions): void + { + $customer = $this->getCurrentCustomer(); + $websiteId = (int)$this->_storeManager->getStore($customer->getStoreId())->getWebsiteId(); + $customerSubscription = $subscriptions[$websiteId] ?? $this->retrieveSubscriberData($customer, $websiteId); + + $checkboxElement = $fieldset->addField( + 'subscription_status_' . $websiteId, 'checkbox', [ 'label' => __('Subscribed to Newsletter'), - 'name' => 'subscription', + 'name' => "subscription_status[$websiteId]", 'data-form-part' => $this->getData('target_form'), - 'onchange' => 'this.value = this.checked;' + 'value' => $customerSubscription['status'], + 'onchange' => 'this.value = this.checked;', ] ); - - if ($this->customerAccountManagement->isReadonly($customerId)) { - $form->getElement('subscription')->setReadonly(true, true); + $checkboxElement->setIsChecked($customerSubscription['status']); + if (!$this->isSingleStoreMode()) { + $fieldset->addField( + 'subscription_store_' . $websiteId, + 'select', + [ + 'label' => __('Subscribed on Store View'), + 'name' => "subscription_store[$websiteId]", + 'data-form-part' => $this->getData('target_form'), + 'values' => $customerSubscription['store_options'], + 'value' => $customerSubscription['store_id'] ?? null, + ] + ); } - $isSubscribed = $subscriber->isSubscribed(); - $form->setValues(['subscription' => $isSubscribed ? 'true' : 'false']); - $form->getElement('subscription')->setIsChecked($isSubscribed); - - $this->updateFromSession($form, $customerId); - - $changedDate = $this->getStatusChangedDate(); - if ($changedDate) { + if (!empty($customerSubscription['last_updated'])) { + $text = $customerSubscription['status'] ? __('Last Date Subscribed') : __('Last Date Unsubscribed'); $fieldset->addField( - 'change_status_date', + 'change_status_date_' . $websiteId, 'label', [ - 'label' => $isSubscribed ? __('Last Date Subscribed') : __('Last Date Unsubscribed'), - 'value' => $changedDate, + 'label' => $text, + 'value' => $customerSubscription['last_updated'], 'bold' => true ] ); } + } - $this->setForm($form); - return $this; + /** + * Prepare form fields for multiply website mode + * + * @param Fieldset $fieldset + * @param array $subscriptions + * @return void + */ + private function prepareFormMultiplyWebsite(Fieldset $fieldset, array $subscriptions): void + { + $fieldset->addType('customer_subscription', SubscriptionsElement::class); + $fieldset->addField( + 'subscription', + 'customer_subscription', + [ + 'label' => __('Subscribed to Newsletter'), + 'name' => 'subscription', + 'subscriptions' => $subscriptions, + 'target_form' => $this->getData('target_form'), + 'class' => 'newsletter-subscriptions', + 'customer_id' => $this->getCurrentCustomerId(), + ] + ); + } + + /** + * Get current customer id + * + * @return int + */ + private function getCurrentCustomerId(): int + { + return (int)$this->_coreRegistry->registry(RegistryConstants::CURRENT_CUSTOMER_ID); + } + + /** + * Get current customer model + * + * @return CustomerInterface|null + */ + private function getCurrentCustomer(): ?CustomerInterface + { + $customerId = $this->getCurrentCustomerId(); + try { + $customer = $this->customerRepository->getById($customerId); + } catch (NoSuchEntityException $e) { + return null; + } + + return $customer; + } + + /** + * Get Customer Subscriptions on Websites + * + * @return array + */ + private function getCustomerSubscriptionsOnWebsites(): array + { + $customer = $this->getCurrentCustomer(); + if ($customer === null) { + return []; + } + + $subscriptions = []; + foreach ($this->_storeManager->getWebsites() as $website) { + /** Skip websites without stores */ + if ($website->getStoresCount() === 0) { + continue; + } + $websiteId = (int)$website->getId(); + $subscriptions[$websiteId] = $this->retrieveSubscriberData($customer, $websiteId); + } + + return $subscriptions; + } + + /** + * Retrieve subscriber data + * + * @param CustomerInterface $customer + * @param int $websiteId + * @return array + */ + private function retrieveSubscriberData(CustomerInterface $customer, int $websiteId): array + { + $subscriber = $this->_subscriberFactory->create()->loadByCustomer((int)$customer->getId(), $websiteId); + $storeOptions = $this->systemStore->getStoreOptionsTree(false, [], [], [$websiteId]); + $subscriberData = $subscriber->getData(); + $subscriberData['last_updated'] = $this->getSubscriberStatusChangeDate($subscriber); + $subscriberData['website_id'] = $websiteId; + $subscriberData['website_name'] = $this->systemStore->getWebsiteName($websiteId); + $subscriberData['status'] = $subscriber->isSubscribed(); + $subscriberData['store_options'] = $storeOptions; + + return $subscriberData; + } + + /** + * Is single systemStore mode + * + * @return bool + */ + private function isSingleStoreMode(): bool + { + return $this->_storeManager->isSingleStoreMode(); + } + + /** + * Is single website mode + * + * @return bool + */ + private function isSingleWebsiteMode(): bool + { + return $this->isSingleStoreMode() + || !$this->shareConfig->isGlobalScope() + || count($this->_storeManager->getWebsites()) === 1; } /** * Update form elements from session data * - * @param \Magento\Framework\Data\Form $form + * @param Form $form * @param int $customerId * @return void */ - protected function updateFromSession(\Magento\Framework\Data\Form $form, $customerId) + protected function updateFromSession(Form $form, $customerId) { + if (!$this->isSingleWebsiteMode()) { + return; + } $data = $this->_backendSession->getCustomerFormData(); - if (!empty($data)) { - $dataCustomerId = isset($data['customer']['entity_id']) ? $data['customer']['entity_id'] : null; - if (isset($data['subscription']) && $dataCustomerId == $customerId) { - $form->getElement('subscription')->setIsChecked($data['subscription']); - } + $sessionCustomerId = $data['customer']['entity_id'] ?? null; + if ($sessionCustomerId === null || (int)$sessionCustomerId !== (int)$customerId) { + return; + } + + $websiteId = (int)$this->getCurrentCustomer()->getWebsiteId(); + $statusSessionValue = $data['subscription_status'][$websiteId] ?? null; + if ($statusSessionValue !== null) { + $subscribeElement = $form->getElement('subscription_status_' . $websiteId); + $subscribeElement->setValue($statusSessionValue); + $subscribeElement->setChecked($statusSessionValue); + } + $storeSessionValue = $data['subscription_store'][$websiteId] ?? null; + $storeElement = $form->getElement('subscription_store_' . $websiteId); + if ($storeSessionValue !== null && $storeElement !== null) { + $storeElement->setValue($storeSessionValue); } } @@ -211,28 +414,32 @@ protected function updateFromSession(\Magento\Framework\Data\Form $form, $custom */ public function getStatusChangedDate() { - $subscriber = $this->_coreRegistry->registry('subscriber'); - if ($subscriber->getChangeStatusAt()) { - return $this->formatDate( - $subscriber->getChangeStatusAt(), - \IntlDateFormatter::MEDIUM, - true - ); + $customer = $this->getCurrentCustomerId(); + if ($customer === null) { + return ''; } + $customerId = (int)$customer->getId(); + $subscriber = $this->_subscriberFactory->create()->loadByCustomer($customerId, (int)$customer->getWebsiteId()); - return null; + return $this->getSubscriberStatusChangeDate($subscriber); } /** + * Retrieve the date when the subscriber status changed + * + * @param Subscriber $subscriber * @return string */ - protected function _toHtml() + private function getSubscriberStatusChangeDate(Subscriber $subscriber): string { - if ($this->canShowTab()) { - $this->initForm(); - return parent::_toHtml(); - } else { + if (empty($subscriber->getChangeStatusAt())) { return ''; } + + return $this->formatDate( + $subscriber->getChangeStatusAt(), + \IntlDateFormatter::MEDIUM, + true + ); } } diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter/Grid.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter/Grid.php index 4f49c3ba1db9b..97582fbdb19b2 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter/Grid.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter/Grid.php @@ -5,47 +5,75 @@ */ namespace Magento\Customer\Block\Adminhtml\Edit\Tab\Newsletter; +use Magento\Backend\Block\Template\Context; +use Magento\Backend\Block\Widget\Grid\Extended; +use Magento\Backend\Helper\Data; +use Magento\Customer\Block\Adminhtml\Edit\Tab\Newsletter\Grid\Renderer\Action; +use Magento\Customer\Block\Adminhtml\Edit\Tab\Newsletter\Grid\Renderer\Status; +use Magento\Customer\Controller\RegistryConstants; +use Magento\Customer\Model\Config\Share; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\Registry; +use Magento\Newsletter\Model\ResourceModel\Queue\CollectionFactory; +use Magento\Store\Model\System\Store as SystemStore; + /** * Adminhtml newsletter queue grid block * * @api * @since 100.0.2 */ -class Grid extends \Magento\Backend\Block\Widget\Grid\Extended +class Grid extends Extended { /** * Core registry * - * @var \Magento\Framework\Registry|null + * @var Registry|null */ protected $_coreRegistry = null; /** - * @var \Magento\Newsletter\Model\ResourceModel\Queue\CollectionFactory + * @var CollectionFactory */ protected $_collectionFactory; /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Backend\Helper\Data $backendHelper - * @param \Magento\Newsletter\Model\ResourceModel\Queue\CollectionFactory $collectionFactory - * @param \Magento\Framework\Registry $coreRegistry + * @var Share + */ + private $shareConfig; + + /** + * @var SystemStore + */ + private $systemStore; + + /** + * @param Context $context + * @param Data $backendHelper + * @param CollectionFactory $collectionFactory + * @param Registry $coreRegistry * @param array $data + * @param Share|null $shareConfig + * @param SystemStore|null $systemStore */ public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Backend\Helper\Data $backendHelper, - \Magento\Newsletter\Model\ResourceModel\Queue\CollectionFactory $collectionFactory, - \Magento\Framework\Registry $coreRegistry, - array $data = [] + Context $context, + Data $backendHelper, + CollectionFactory $collectionFactory, + Registry $coreRegistry, + array $data = [], + Share $shareConfig = null, + SystemStore $systemStore = null ) { $this->_coreRegistry = $coreRegistry; $this->_collectionFactory = $collectionFactory; parent::__construct($context, $backendHelper, $data); + $this->shareConfig = $shareConfig ?? ObjectManager::getInstance()->get(Share::class); + $this->systemStore = $systemStore ?? ObjectManager::getInstance()->get(SystemStore::class); } /** - * @return void + * @inheritdoc */ protected function _construct() { @@ -60,7 +88,7 @@ protected function _construct() } /** - * @return string + * @inheritdoc */ public function getGridUrl() { @@ -68,22 +96,19 @@ public function getGridUrl() } /** - * @return $this + * @inheritdoc */ protected function _prepareCollection() { - /** @var $collection \Magento\Newsletter\Model\ResourceModel\Queue\Collection */ - $collection = $this->_collectionFactory->create()->addTemplateInfo()->addSubscriberFilter( - $this->_coreRegistry->registry('subscriber')->getId() - ); - + $customerId = $this->getCurrentCustomerId(); + $collection = $this->_collectionFactory->create()->addTemplateInfo()->addCustomerFilter($customerId); $this->setCollection($collection); return parent::_prepareCollection(); } /** - * @return $this + * @inheritdoc */ protected function _prepareColumns() { @@ -132,6 +157,19 @@ protected function _prepareColumns() ['header' => __('Subject'), 'align' => 'center', 'index' => 'template_subject'] ); + if ($this->isMultiplyWebsiteMode()) { + $this->addColumn( + 'store_view', + [ + 'header' => __('Store View'), + 'align' => 'center', + 'index' => 'subscriber_store_id', + 'type' => 'options', + 'option_groups' => $this->systemStore->getStoreValuesForForm(), + ] + ); + } + $this->addColumn( 'status', [ @@ -139,7 +177,7 @@ protected function _prepareColumns() 'align' => 'center', 'filter' => \Magento\Customer\Block\Adminhtml\Edit\Tab\Newsletter\Grid\Filter\Status::class, 'index' => 'queue_status', - 'renderer' => \Magento\Customer\Block\Adminhtml\Edit\Tab\Newsletter\Grid\Renderer\Status::class + 'renderer' => Status::class ] ); @@ -150,10 +188,31 @@ protected function _prepareColumns() 'align' => 'center', 'filter' => false, 'sortable' => false, - 'renderer' => \Magento\Customer\Block\Adminhtml\Edit\Tab\Newsletter\Grid\Renderer\Action::class + 'renderer' => Action::class ] ); return parent::_prepareColumns(); } + + /** + * Get current customer id + * + * @return int + */ + private function getCurrentCustomerId(): int + { + return (int)$this->_coreRegistry->registry(RegistryConstants::CURRENT_CUSTOMER_ID); + } + + /** + * Is multiply website mode + * + * @return bool + */ + private function isMultiplyWebsiteMode(): bool + { + return $this->shareConfig->isGlobalScope() + && count($this->_storeManager->getWebsites()) > 1; + } } diff --git a/app/code/Magento/Customer/Block/Adminhtml/Form/Element/Newsletter/Subscriptions.php b/app/code/Magento/Customer/Block/Adminhtml/Form/Element/Newsletter/Subscriptions.php new file mode 100644 index 0000000000000..e9686daa3e3ab --- /dev/null +++ b/app/code/Magento/Customer/Block/Adminhtml/Form/Element/Newsletter/Subscriptions.php @@ -0,0 +1,161 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Block\Adminhtml\Form\Element\Newsletter; + +use Magento\Framework\App\Request\DataPersistorInterface; +use Magento\Framework\Data\Form\Element\AbstractElement; +use Magento\Framework\Data\Form\Element\CollectionFactory; +use Magento\Framework\Data\Form\Element\Factory; +use Magento\Framework\Escaper; + +/** + * Customer Newsletter Subscriptions Element + */ +class Subscriptions extends AbstractElement +{ + /** + * @var DataPersistorInterface + */ + private $dataPersistor; + + /** + * @param Factory $factoryElement + * @param CollectionFactory $factoryCollection + * @param Escaper $escaper + * @param DataPersistorInterface $dataPersistor + * @param array $data + */ + public function __construct( + Factory $factoryElement, + CollectionFactory $factoryCollection, + Escaper $escaper, + DataPersistorInterface $dataPersistor, + $data = [] + ) { + $this->dataPersistor = $dataPersistor; + parent::__construct($factoryElement, $factoryCollection, $escaper, $data); + } + + /** + * @inheritdoc + */ + public function getElementHtml() + { + $websiteHeader = $this->_escape(__('Website')); + $subscribedHeader = $this->_escape(__('Subscribed')); + $storeHeader = $this->_escape(__('Store View')); + $lastUpdatedHeader = $this->_escape(__('Last Updated At')); + $bodyHtml = ''; + foreach ($this->getData('subscriptions') as $subscriptions) { + $storeId = !empty($subscriptions['store_id']) ? (int)$subscriptions['store_id'] : null; + $websiteId = (int)$subscriptions['website_id']; + $websiteName = $this->_escape($subscriptions['website_name']); + $subscribed = (bool)$subscriptions['status']; + $options = (array)$subscriptions['store_options']; + $statusElement = $this->getSubscriptionStatusElementHtml($websiteId, $subscribed); + $storeSelectElement = $this->getStoreSelectElementHtml($websiteId, $options, $storeId); + $lastUpdated = !empty($subscriptions['last_updated']) ? $subscriptions['last_updated'] : ''; + + $bodyHtml .= "<tr><td>{$websiteName}</td><td class=\"subscriber-status\">$statusElement</td>" + . "<td>$storeSelectElement</td><td>$lastUpdated</td></tr>"; + } + $html = '<table class="admin__table-secondary">' + . "<tr><th>{$websiteHeader}</th><th class=\"subscriber-status\">{$subscribedHeader}</th>" + . "<th>{$storeHeader}</th><th>{$lastUpdatedHeader}</th></tr>" + . $bodyHtml + . '</table>'; + + return $html; + } + + /** + * Get store select element html + * + * @param int $websiteId + * @param array $options + * @param int|null $value + * @return string + */ + private function getStoreSelectElementHtml(int $websiteId, array $options, ?int $value): string + { + $name = $this->getData('name'); + $value = $this->getSessionFormValue("{$name}_store", $websiteId) ?? $value; + $elementId = $name . '_store_' . $websiteId; + $element = $this->_factoryElement->create( + 'select', + [ + 'data' => [ + 'name' => "{$name}_store[$websiteId]", + 'data-form-part' => $this->getData('target_form'), + 'values' => $options, + 'value' => $value, + 'required' => true, + ], + ] + ); + $element->setId($elementId); + $element->setForm($this->getForm()); + if ($this->getReadonly()) { + $element->setReadonly($this->getReadonly(), $this->getDisabled()); + } + + return $element->toHtml(); + } + + /** + * Get subscription status element html + * + * @param int $websiteId + * @param bool $value + * @return string + */ + private function getSubscriptionStatusElementHtml(int $websiteId, bool $value): string + { + $name = $this->getData('name'); + $value = $this->getSessionFormValue("{$name}_status", $websiteId) ?? $value; + $elementId = $name . '_status_' . $websiteId; + $element = $this->_factoryElement->create( + 'checkbox', + [ + 'data' => [ + 'name' => "{$name}_status[$websiteId]", + 'data-form-part' => $this->getData('target_form'), + 'value' => $value, + 'onchange' => 'this.value = this.checked;', + ], + ] + ); + $element->setId($elementId); + $element->setForm($this->getForm()); + $element->setIsChecked($value); + if ($this->getReadonly()) { + $element->setReadonly($this->getReadonly(), $this->getDisabled()); + } + + return $element->toHtml(); + } + + /** + * Get form data value from current session + * + * @param string $name + * @param int $arrayKey + * @return string|null + */ + private function getSessionFormValue(string $name, int $arrayKey): ?string + { + $data = $this->dataPersistor->get('customer_form'); + $currentCustomerId = $this->getData('customer_id'); + $sessionCustomerId = $data['customer']['entity_id'] ?? null; + if ($sessionCustomerId === null || $currentCustomerId !== (int)$sessionCustomerId) { + return null; + } + + return $data[$name][$arrayKey] ?? null; + } +} diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/MassSubscribe.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/MassSubscribe.php index 29a66bf1ff933..881c5caebcbee 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/MassSubscribe.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/MassSubscribe.php @@ -7,10 +7,10 @@ use Magento\Backend\App\Action\Context; use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface; +use Magento\Newsletter\Model\SubscriptionManagerInterface; use Magento\Ui\Component\MassAction\Filter; use Magento\Customer\Model\ResourceModel\Customer\CollectionFactory; use Magento\Customer\Api\CustomerRepositoryInterface; -use Magento\Newsletter\Model\SubscriberFactory; use Magento\Eav\Model\Entity\Collection\AbstractCollection; use Magento\Framework\Controller\ResultFactory; @@ -25,27 +25,27 @@ class MassSubscribe extends AbstractMassAction implements HttpPostActionInterfac protected $customerRepository; /** - * @var SubscriberFactory + * @var SubscriptionManagerInterface */ - protected $subscriberFactory; + private $subscriptionManager; /** * @param Context $context * @param Filter $filter * @param CollectionFactory $collectionFactory * @param CustomerRepositoryInterface $customerRepository - * @param SubscriberFactory $subscriberFactory + * @param SubscriptionManagerInterface $subscriptionManager */ public function __construct( Context $context, Filter $filter, CollectionFactory $collectionFactory, CustomerRepositoryInterface $customerRepository, - SubscriberFactory $subscriberFactory + SubscriptionManagerInterface $subscriptionManager ) { parent::__construct($context, $filter, $collectionFactory); $this->customerRepository = $customerRepository; - $this->subscriberFactory = $subscriberFactory; + $this->subscriptionManager = $subscriptionManager; } /** @@ -58,9 +58,9 @@ protected function massAction(AbstractCollection $collection) { $customersUpdated = 0; foreach ($collection->getAllIds() as $customerId) { - // Verify customer exists - $this->customerRepository->getById($customerId); - $this->subscriberFactory->create()->subscribeCustomerById($customerId); + $customer = $this->customerRepository->getById($customerId); + $storeId = (int)$customer->getStoreId(); + $this->subscriptionManager->subscribeCustomer($customerId, $storeId); $customersUpdated++; } diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/MassUnsubscribe.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/MassUnsubscribe.php index fddf18489b9a5..17f420d864df0 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/MassUnsubscribe.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/MassUnsubscribe.php @@ -9,7 +9,7 @@ use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface; use Magento\Framework\Controller\ResultFactory; use Magento\Backend\App\Action\Context; -use Magento\Newsletter\Model\SubscriberFactory; +use Magento\Newsletter\Model\SubscriptionManagerInterface; use Magento\Ui\Component\MassAction\Filter; use Magento\Customer\Model\ResourceModel\Customer\CollectionFactory; use Magento\Eav\Model\Entity\Collection\AbstractCollection; @@ -25,27 +25,27 @@ class MassUnsubscribe extends AbstractMassAction implements HttpPostActionInterf protected $customerRepository; /** - * @var SubscriberFactory + * @var SubscriptionManagerInterface */ - protected $subscriberFactory; + private $subscriptionManager; /** * @param Context $context * @param Filter $filter * @param CollectionFactory $collectionFactory * @param CustomerRepositoryInterface $customerRepository - * @param SubscriberFactory $subscriberFactory + * @param SubscriptionManagerInterface $subscriptionManager */ public function __construct( Context $context, Filter $filter, CollectionFactory $collectionFactory, CustomerRepositoryInterface $customerRepository, - SubscriberFactory $subscriberFactory + SubscriptionManagerInterface $subscriptionManager ) { parent::__construct($context, $filter, $collectionFactory); $this->customerRepository = $customerRepository; - $this->subscriberFactory = $subscriberFactory; + $this->subscriptionManager = $subscriptionManager; } /** @@ -59,8 +59,9 @@ protected function massAction(AbstractCollection $collection) $customersUpdated = 0; foreach ($collection->getAllIds() as $customerId) { // Verify customer exists - $this->customerRepository->getById($customerId); - $this->subscriberFactory->create()->unsubscribeCustomerById($customerId); + $customer = $this->customerRepository->getById($customerId); + $storeId = (int)$customer->getStoreId(); + $this->subscriptionManager->unsubscribeCustomer($customerId, $storeId); $customersUpdated++; } diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/Save.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/Save.php index 3ee33af9ec073..b85b735ea9c4f 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/Save.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/Save.php @@ -5,25 +5,45 @@ */ namespace Magento\Customer\Controller\Adminhtml\Index; +use Magento\Backend\App\Action\Context; +use Magento\Backend\Model\View\Result\ForwardFactory; +use Magento\Backend\Model\View\Result\Redirect; use Magento\Customer\Api\AccountManagementInterface; +use Magento\Customer\Api\AddressMetadataInterface; use Magento\Customer\Api\AddressRepositoryInterface; +use Magento\Customer\Api\CustomerMetadataInterface; use Magento\Customer\Api\CustomerRepositoryInterface; -use Magento\Customer\Model\Address\Mapper; -use Magento\Customer\Model\AddressRegistry; -use Magento\Framework\Api\DataObjectHelper; use Magento\Customer\Api\Data\AddressInterfaceFactory; -use Magento\Customer\Api\Data\CustomerInterfaceFactory; -use Magento\Framework\DataObjectFactory as ObjectFactory; -use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface; -use Magento\Customer\Api\AddressMetadataInterface; -use Magento\Customer\Api\CustomerMetadataInterface; +use Magento\Customer\Api\Data\AttributeMetadataInterface; use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Customer\Api\Data\CustomerInterfaceFactory; use Magento\Customer\Controller\RegistryConstants; +use Magento\Customer\Helper\View; +use Magento\Customer\Model\Address\Mapper; +use Magento\Customer\Model\AddressFactory; +use Magento\Customer\Model\AddressRegistry; +use Magento\Customer\Model\CustomerFactory; use Magento\Customer\Model\EmailNotificationInterface; use Magento\Customer\Model\Metadata\Form; +use Magento\Customer\Model\Metadata\FormFactory; +use Magento\Framework\Api\DataObjectHelper; +use Magento\Framework\Api\ExtensibleDataObjectConverter; +use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\App\Response\Http\FileFactory; +use Magento\Framework\Controller\Result\JsonFactory; +use Magento\Framework\DataObject; +use Magento\Framework\DataObjectFactory as ObjectFactory; +use Magento\Framework\Exception\AbstractAggregateException; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\NoSuchEntityException; -use Magento\Framework\App\ObjectManager; +use Magento\Framework\Math\Random; +use Magento\Framework\Reflection\DataObjectProcessor; +use Magento\Framework\Registry; +use Magento\Framework\View\Result\LayoutFactory; +use Magento\Framework\View\Result\PageFactory; +use Magento\Newsletter\Model\SubscriberFactory; +use Magento\Newsletter\Model\SubscriptionManagerInterface; /** * Save customer action. @@ -37,6 +57,11 @@ class Save extends \Magento\Customer\Controller\Adminhtml\Index implements HttpP */ private $emailNotification; + /** + * @var SubscriptionManagerInterface + */ + private $subscriptionManager; + /** * @var AddressRegistry */ @@ -45,60 +70,62 @@ class Save extends \Magento\Customer\Controller\Adminhtml\Index implements HttpP /** * Constructor * - * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Framework\Registry $coreRegistry - * @param \Magento\Framework\App\Response\Http\FileFactory $fileFactory - * @param \Magento\Customer\Model\CustomerFactory $customerFactory - * @param \Magento\Customer\Model\AddressFactory $addressFactory - * @param \Magento\Customer\Model\Metadata\FormFactory $formFactory - * @param \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory - * @param \Magento\Customer\Helper\View $viewHelper - * @param \Magento\Framework\Math\Random $random + * @param Context $context + * @param Registry $coreRegistry + * @param FileFactory $fileFactory + * @param CustomerFactory $customerFactory + * @param AddressFactory $addressFactory + * @param FormFactory $formFactory + * @param SubscriberFactory $subscriberFactory + * @param View $viewHelper + * @param Random $random * @param CustomerRepositoryInterface $customerRepository - * @param \Magento\Framework\Api\ExtensibleDataObjectConverter $extensibleDataObjectConverter + * @param ExtensibleDataObjectConverter $extensibleDataObjectConverter * @param Mapper $addressMapper * @param AccountManagementInterface $customerAccountManagement * @param AddressRepositoryInterface $addressRepository * @param CustomerInterfaceFactory $customerDataFactory * @param AddressInterfaceFactory $addressDataFactory * @param \Magento\Customer\Model\Customer\Mapper $customerMapper - * @param \Magento\Framework\Reflection\DataObjectProcessor $dataObjectProcessor + * @param DataObjectProcessor $dataObjectProcessor * @param DataObjectHelper $dataObjectHelper * @param ObjectFactory $objectFactory * @param \Magento\Framework\View\LayoutFactory $layoutFactory - * @param \Magento\Framework\View\Result\LayoutFactory $resultLayoutFactory - * @param \Magento\Framework\View\Result\PageFactory $resultPageFactory - * @param \Magento\Backend\Model\View\Result\ForwardFactory $resultForwardFactory - * @param \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory + * @param LayoutFactory $resultLayoutFactory + * @param PageFactory $resultPageFactory + * @param ForwardFactory $resultForwardFactory + * @param JsonFactory $resultJsonFactory + * @param SubscriptionManagerInterface $subscriptionManager * @param AddressRegistry|null $addressRegistry * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Backend\App\Action\Context $context, - \Magento\Framework\Registry $coreRegistry, - \Magento\Framework\App\Response\Http\FileFactory $fileFactory, - \Magento\Customer\Model\CustomerFactory $customerFactory, - \Magento\Customer\Model\AddressFactory $addressFactory, - \Magento\Customer\Model\Metadata\FormFactory $formFactory, - \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory, - \Magento\Customer\Helper\View $viewHelper, - \Magento\Framework\Math\Random $random, + Context $context, + Registry $coreRegistry, + FileFactory $fileFactory, + CustomerFactory $customerFactory, + AddressFactory $addressFactory, + FormFactory $formFactory, + SubscriberFactory $subscriberFactory, + View $viewHelper, + Random $random, CustomerRepositoryInterface $customerRepository, - \Magento\Framework\Api\ExtensibleDataObjectConverter $extensibleDataObjectConverter, + ExtensibleDataObjectConverter $extensibleDataObjectConverter, Mapper $addressMapper, AccountManagementInterface $customerAccountManagement, AddressRepositoryInterface $addressRepository, CustomerInterfaceFactory $customerDataFactory, AddressInterfaceFactory $addressDataFactory, \Magento\Customer\Model\Customer\Mapper $customerMapper, - \Magento\Framework\Reflection\DataObjectProcessor $dataObjectProcessor, + DataObjectProcessor $dataObjectProcessor, DataObjectHelper $dataObjectHelper, ObjectFactory $objectFactory, \Magento\Framework\View\LayoutFactory $layoutFactory, - \Magento\Framework\View\Result\LayoutFactory $resultLayoutFactory, - \Magento\Framework\View\Result\PageFactory $resultPageFactory, - \Magento\Backend\Model\View\Result\ForwardFactory $resultForwardFactory, - \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory, + LayoutFactory $resultLayoutFactory, + PageFactory $resultPageFactory, + ForwardFactory $resultForwardFactory, + JsonFactory $resultJsonFactory, + SubscriptionManagerInterface $subscriptionManager, AddressRegistry $addressRegistry = null ) { parent::__construct( @@ -128,6 +155,7 @@ public function __construct( $resultForwardFactory, $resultJsonFactory ); + $this->subscriptionManager = $subscriptionManager; $this->addressRegistry = $addressRegistry ?: ObjectManager::getInstance()->get(AddressRegistry::class); } @@ -186,7 +214,7 @@ protected function _extractData( $formData = $metadataForm->compactData($formData); // Initialize additional attributes - /** @var \Magento\Framework\DataObject $object */ + /** @var DataObject $object */ $object = $this->_objectFactory->create(['data' => $this->getRequest()->getPostValue()]); $requestData = $object->getData($scope); foreach ($additionalAttributes as $attributeCode) { @@ -196,7 +224,7 @@ protected function _extractData( // Unset unused attributes $formAttributes = $metadataForm->getAttributes(); foreach ($formAttributes as $attribute) { - /** @var \Magento\Customer\Api\Data\AttributeMetadataInterface $attribute */ + /** @var AttributeMetadataInterface $attribute */ $attributeCode = $attribute->getAttributeCode(); if ($attribute->getFrontendInput() != 'boolean' && $formData[$attributeCode] === false @@ -281,7 +309,7 @@ protected function _extractCustomerAddressData(array & $extractedCustomerData) /** * Save customer action * - * @return \Magento\Backend\Model\View\Result\Redirect + * @return Redirect * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.ExcessiveMethodLength) * @SuppressWarnings(PHPMD.NPathComplexity) @@ -312,7 +340,7 @@ public function execute() $this->dataObjectHelper->populateWithArray( $customer, $customerData, - \Magento\Customer\Api\Data\CustomerInterface::class + CustomerInterface::class ); $this->_eventManager->dispatch( @@ -334,17 +362,7 @@ public function execute() $customerId = $customer->getId(); } - $isSubscribed = null; - if ($this->_authorization->isAllowed(null)) { - $isSubscribed = $this->getRequest()->getPost('subscription'); - } - if ($isSubscribed !== null) { - if ($isSubscribed !== '0') { - $this->_subscriberFactory->create()->subscribeCustomerById($customerId); - } else { - $this->_subscriberFactory->create()->unsubscribeCustomerById($customerId); - } - } + $this->updateSubscriptions($customer); // After save $this->_eventManager->dispatch( @@ -364,7 +382,7 @@ public function execute() $this->_addSessionErrorMessages($messages); $this->_getSession()->setCustomerFormData($this->retrieveFormattedFormData()); $returnToEdit = true; - } catch (\Magento\Framework\Exception\AbstractAggregateException $exception) { + } catch (AbstractAggregateException $exception) { $errors = $exception->getErrors(); $messages = []; foreach ($errors as $error) { @@ -406,6 +424,34 @@ public function execute() return $resultRedirect; } + /** + * Update customer website subscriptions + * + * @param CustomerInterface $customer + * @return void + */ + private function updateSubscriptions(CustomerInterface $customer): void + { + if (!$this->_authorization->isAllowed(null)) { + return; + } + + $subscriptionStatus = (array)$this->getRequest()->getParam('subscription_status'); + $subscriptionStore = (array)$this->getRequest()->getParam('subscription_store'); + if (empty($subscriptionStatus)) { + return; + } + + foreach ($subscriptionStatus as $websiteId => $status) { + $storeId = $subscriptionStore[$websiteId] ?? $customer->getStoreId(); + if ($status) { + $this->subscriptionManager->subscribeCustomer((int)$customer->getId(), $storeId); + } else { + $this->subscriptionManager->unsubscribeCustomer((int)$customer->getId(), $storeId); + } + } + } + /** * Get email notification * @@ -415,7 +461,7 @@ public function execute() private function getEmailNotification() { if (!($this->emailNotification instanceof EmailNotificationInterface)) { - return \Magento\Framework\App\ObjectManager::getInstance()->get( + return ObjectManager::getInstance()->get( EmailNotificationInterface::class ); } else { diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminAssertCustomerSubscribeNewsletterActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminAssertCustomerSubscribeNewsletterActionGroup.xml new file mode 100644 index 0000000000000..49373bb7bebf9 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminAssertCustomerSubscribeNewsletterActionGroup.xml @@ -0,0 +1,34 @@ +<?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="AdminAssertCustomerIsSubscribedToNewsletters"> + <annotations> + <description>Verify that check box "Newsletter subscribed" is checked on "Newsletter" tab on customer edit page.</description> + </annotations> + <arguments> + <argument name="websiteId" type="string" defaultValue="1"/> + </arguments> + + <click selector="{{AdminEditCustomerInformationSection.newsLetter}}" stepKey="clickToNewsletterTabHeader"/> + <waitForPageLoad stepKey="waitForShowNewsletterTab"/> + <seeCheckboxIsChecked selector="{{AdminEditCustomerNewsletterSection.subscribedStatus(websiteId)}}" stepKey="assertSubscribedToNewsletter"/> + </actionGroup> + + <actionGroup name="AdminAssertCustomerIsSubscribedToNewslettersAndSelectedStoreView" extends="AdminAssertCustomerIsSubscribedToNewsletters"> + <annotations> + <description>Verify that check box "Newsletter subscribed" is checked and Store View is selected on "Newsletter" tab on customer edit page.</description> + </annotations> + <arguments> + <argument name="storeView"/> + </arguments> + + <seeOptionIsSelected selector="{{AdminEditCustomerNewsletterSection.subscribedStore(websiteId)}}" userInput="{{storeView.name}}" stepKey="assertSubscribedStoreView" after="assertSubscribedToNewsletter"/> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCustomerSubscribeNewsletterActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCustomerSubscribeNewsletterActionGroup.xml new file mode 100644 index 0000000000000..49ea772569cc0 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCustomerSubscribeNewsletterActionGroup.xml @@ -0,0 +1,36 @@ +<?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="AdminSubscribeCustomerToNewsletters"> + <annotations> + <description>Set checkbox "Newsletter subscribed" on "Newsletter" tab on customer edit page.</description> + </annotations> + <arguments> + <argument name="websiteId" type="string" defaultValue="1"/> + </arguments> + + <click selector="{{AdminEditCustomerInformationSection.newsLetter}}" stepKey="clickToNewsletterTabHeader"/> + <waitForPageLoad stepKey="waitForShowNewsletterTab"/> + <checkOption selector="{{AdminEditCustomerNewsletterSection.subscribedStatus(websiteId)}}" stepKey="subscribeToNewsletter"/> + <click selector="{{AdminCustomerMainActionsSection.saveAndContinue}}" stepKey="saveAndContinue"/> + <waitForPageLoad stepKey="waitForSaving"/> + <see userInput="You saved the customer." stepKey="seeSuccessMessage"/> + </actionGroup> + + <actionGroup name="AdminSubscribeCustomerToNewslettersAndSelectStoreView" extends="AdminSubscribeCustomerToNewsletters"> + <annotations> + <description>Set checkbox "Newsletter subscribed" and select Store View on "Newsletter" tab on customer edit page.</description> + </annotations> + <arguments> + <argument name="storeView"/> + </arguments> + <selectOption selector="{{AdminEditCustomerNewsletterSection.subscribedStore(websiteId)}}" userInput="{{storeView.name}}" stepKey="selectSubscribeStoreView" after="subscribeToNewsletter"/> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerNewsletterSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerNewsletterSection.xml index 51b4b54c5c8b6..e6bdf2819e2a5 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerNewsletterSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerNewsletterSection.xml @@ -9,6 +9,8 @@ <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminEditCustomerNewsletterSection"> - <element name="subscribedToNewsletter" type="checkbox" selector="//div[@class='admin__field-control control']/input[@name='subscription']"/> + <element name="subscribedStatus" type="checkbox" selector="//div[@class='admin__field-control control']//input[@name='subscription_status[{{websiteId}}]']" parameterized="true"/> + <element name="subscribedStore" type="select" selector="//div[@class='admin__field-control control']//select[@name='subscription_store[{{websiteId}}]']" parameterized="true"/> + <element name="subscribedLastUpdatedDate" type="text" selector="//div[@class='admin__field-control control']//div[@class='field-change_status_date_{{websiteId}}']//div[@class='control-value']" parameterized="true"/> </section> </sections> \ No newline at end of file diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateNewCustomerOnStorefrontSignupNewsletterTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateNewCustomerOnStorefrontSignupNewsletterTest.xml index 22ad60ff5de34..5d09f819bcbc0 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateNewCustomerOnStorefrontSignupNewsletterTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateNewCustomerOnStorefrontSignupNewsletterTest.xml @@ -49,6 +49,6 @@ <waitForPageLoad stepKey="waitForEditLinkLoad"/> <click selector="{{AdminEditCustomerInformationSection.newsLetter}}" stepKey="clickNewsLetter"/> <waitForPageLoad stepKey="waitForNewsletterTabToOpen"/> - <seeCheckboxIsChecked selector="{{AdminEditCustomerNewsletterSection.subscribedToNewsletter}}" stepKey="seeAssertSubscribedToNewsletterCheckboxIsChecked"/> + <seeCheckboxIsChecked selector="{{AdminEditCustomerNewsletterSection.subscribedStatus('1')}}" stepKey="seeAssertSubscribedToNewsletterCheckboxIsChecked"/> </test> </tests> \ No newline at end of file diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCustomerSubscribeNewsletterPerWebsiteTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCustomerSubscribeNewsletterPerWebsiteTest.xml new file mode 100644 index 0000000000000..6c1a27c395917 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCustomerSubscribeNewsletterPerWebsiteTest.xml @@ -0,0 +1,101 @@ +<?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="AdminCustomerSubscribeNewsletterPerWebsiteTest"> + <annotations> + <features value="Customer"/> + <stories value="Customer Subscriptions"/> + <title value="Newsletter subscriptions per website"/> + <description value="Admin should be able to subscribe customer to newsletters on each website separately"/> + <testCaseId value="MC-22173"/> + <severity value="MAJOR"/> + <group value="customer"/> + </annotations> + <before> + <createData entity="CustomerAccountSharingGlobal" stepKey="setConfigCustomerAccountToGlobal"/> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + </before> + <after> + <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView"> + <argument name="customStore" value="NewStoreViewData"/> + </actionGroup> + <actionGroup ref="DeleteCustomerByEmailActionGroup" stepKey="deleteCustomer"> + <argument name="email" value="{{CustomerEntityOne.email}}"/> + </actionGroup> + <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite"> + <argument name="websiteName" value="{{secondCustomWebsite.name}}"/> + </actionGroup> + <actionGroup ref="logout" stepKey="logout"/> + <createData entity="CustomerAccountSharingDefault" stepKey="setConfigCustomerAccountDefault"/> + </after> + + <!-- Create a new Store View --> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView"> + <argument name="customStore" value="NewStoreViewData"/> + </actionGroup> + <!-- Switch to the new Store View on storefront --> + <amOnPage url="{{StorefrontHomePage.url}}" stepKey="amOnHomePage"/> + <waitForPageLoad stepKey="waitForNavigateHomePage"/> + <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchToCustomStoreView"> + <argument name="storeView" value="NewStoreViewData"/> + </actionGroup> + <!-- Create a new customer and sign up newsletter on the new Store View --> + <actionGroup ref="StorefrontCreateCustomerSignedUpNewsletterActionGroup" stepKey="createCustomer"> + <argument name="customer" value="CustomerEntityOne" /> + </actionGroup> + <!-- Go to the customer edit page on admin area --> + <actionGroup ref="AdminFilterCustomerByEmail" stepKey="filterCustomerGrid"> + <argument name="email" value="{{CustomerEntityOne.email}}"/> + </actionGroup> + <click selector="{{AdminCustomerGridSection.firstRowEditLink}}" stepKey="clickToEditCustomerPage"/> + <waitForPageLoad stepKey="waitForOpenCustomerPage"/> + <grabFromCurrentUrl regex="~(\d+)/~" stepKey="grabCustomerId"/> + <!-- Assert that created customer is subscribed to newsletter on the new Store View --> + <actionGroup ref="AdminAssertCustomerIsSubscribedToNewslettersAndSelectedStoreView" stepKey="assertSubscribedToNewsletter"> + <argument name="storeView" value="NewStoreViewData"/> + </actionGroup> + <!-- Create second website --> + <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createSecondWebsite"> + <argument name="newWebsiteName" value="{{secondCustomWebsite.name}}"/> + <argument name="websiteCode" value="{{secondCustomWebsite.code}}"/> + </actionGroup> + <!-- Create second store --> + <actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="createSecondStoreGroup"> + <argument name="website" value="{{secondCustomWebsite.name}}"/> + <argument name="storeGroupName" value="{{SecondStoreGroupUnique.name}}"/> + <argument name="storeGroupCode" value="{{SecondStoreGroupUnique.code}}"/> + </actionGroup> + <!-- Create second store view --> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createSecondStoreView"> + <argument name="StoreGroup" value="SecondStoreGroupUnique"/> + <argument name="customStore" value="SecondStoreUnique"/> + </actionGroup> + <!-- Grab second website id into $grabFromCurrentUrlGetSecondWebsiteId --> + <actionGroup ref="AdminGetWebsiteIdActionGroup" stepKey="getSecondWebsiteId"> + <argument name="website" value="secondCustomWebsite"/> + </actionGroup> + <!-- Go to the customer edit page on admin area --> + <actionGroup ref="AdminOpenCustomerEditPageActionGroup" stepKey="openCustomerEditPage"> + <argument name="customerId" value="$grabCustomerId"/> + </actionGroup> + <!-- Assert that customer still subscribed to newsletter on default website --> + <actionGroup ref="AdminAssertCustomerIsSubscribedToNewsletters" stepKey="assertStillSubscribedToNewsletter"/> + <!-- Subscribe to newsletters customer on the second website --> + <actionGroup ref="AdminSubscribeCustomerToNewslettersAndSelectStoreView" stepKey="subscribeToNewsletterSecondWebsite"> + <argument name="websiteId" value="$grabFromCurrentUrlGetSecondWebsiteId"/> + <argument name="storeView" value="SecondStoreUnique"/> + </actionGroup> + <!-- Assert that created customer is subscribed to newsletter on second website --> + <actionGroup ref="AdminAssertCustomerIsSubscribedToNewslettersAndSelectedStoreView" stepKey="assertSubscribedToNewsletterSecondWebsite"> + <argument name="websiteId" value="$grabFromCurrentUrlGetSecondWebsiteId"/> + <argument name="storeView" value="SecondStoreUnique"/> + </actionGroup> + </test> +</tests> \ No newline at end of file diff --git a/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/Tab/NewsletterTest.php b/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/Tab/NewsletterTest.php index 1c252bfc75a53..22a22742cdb8d 100644 --- a/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/Tab/NewsletterTest.php +++ b/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/Tab/NewsletterTest.php @@ -3,192 +3,322 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ - namespace Magento\Customer\Test\Unit\Block\Adminhtml\Edit\Tab; +use Magento\Backend\Block\Template\Context; use Magento\Backend\Model\Session; +use Magento\Customer\Api\AccountManagementInterface; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Customer\Block\Adminhtml\Edit\Tab\Newsletter; use Magento\Customer\Controller\RegistryConstants; +use Magento\Customer\Model\Config\Share; +use Magento\Framework\Data\Form; +use Magento\Framework\Data\Form\Element\Checkbox; +use Magento\Framework\Data\Form\Element\Fieldset; +use \Magento\Framework\Data\Form\Element\Select; +use Magento\Framework\Data\FormFactory; +use Magento\Framework\Registry; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Framework\UrlInterface; +use Magento\Newsletter\Model\Subscriber; +use Magento\Newsletter\Model\SubscriberFactory; +use Magento\Store\Model\Store; +use Magento\Store\Model\StoreManagerInterface; +use Magento\Store\Model\System\Store as SystemStore; +use Magento\Store\Model\Website; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; /** + * Test Customer account form block + * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class NewsletterTest extends \PHPUnit\Framework\TestCase +class NewsletterTest extends TestCase { /** - * @var \Magento\Customer\Block\Adminhtml\Edit\Tab\Newsletter + * @var Newsletter + */ + private $model; + + /** + * @var Context|MockObject + */ + private $contextMock; + + /** + * Store manager + * + * @var StoreManagerInterface|MockObject + */ + private $storeManager; + + /** + * @var Registry|MockObject */ - protected $model; + private $registryMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var FormFactory|MockObject */ - protected $contextMock; + private $formFactoryMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var SubscriberFactory|MockObject */ - protected $registryMock; + private $subscriberFactoryMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var AccountManagementInterface|MockObject */ - protected $formFactoryMock; + private $accountManagementMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var UrlInterface|MockObject */ - protected $subscriberFactoryMock; + private $urlBuilderMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var Session|MockObject */ - protected $accountManagementMock; + private $backendSessionMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var SystemStore|MockObject */ - protected $urlBuilderMock; + private $systemStore; /** - * @var Session|\PHPUnit_Framework_MockObject_MockObject + * @var CustomerRepositoryInterface|MockObject */ - protected $backendSessionMock; + private $customerRepository; + /** + * @var Share|MockObject + */ + private $shareConfig; + + /** + * @inheritdoc + */ public function setUp() { - $this->contextMock = $this->createMock(\Magento\Backend\Block\Template\Context::class); - $this->registryMock = $this->createMock(\Magento\Framework\Registry::class); - $this->formFactoryMock = $this->createMock(\Magento\Framework\Data\FormFactory::class); + $this->contextMock = $this->createMock(Context::class); + $this->registryMock = $this->createMock(Registry::class); + $this->formFactoryMock = $this->createMock(FormFactory::class); $this->subscriberFactoryMock = $this->createPartialMock( - \Magento\Newsletter\Model\SubscriberFactory::class, + SubscriberFactory::class, ['create'] ); - $this->accountManagementMock = $this->createMock(\Magento\Customer\Api\AccountManagementInterface::class); - $this->urlBuilderMock = $this->createMock(\Magento\Framework\UrlInterface::class); - $this->backendSessionMock = $this->getMockBuilder(\Magento\Backend\Model\Session::class) + $this->accountManagementMock = $this->createMock(AccountManagementInterface::class); + $this->urlBuilderMock = $this->createMock(UrlInterface::class); + $this->storeManager = $this->createMock(StoreManagerInterface::class); + $this->backendSessionMock = $this->getMockBuilder(Session::class) ->setMethods(['getCustomerFormData']) ->disableOriginalConstructor() ->getMock(); - $this->contextMock->expects($this->once())->method('getUrlBuilder')->willReturn($this->urlBuilderMock); - $this->contextMock->expects($this->once())->method('getBackendSession')->willReturn($this->backendSessionMock); - - $this->model = new \Magento\Customer\Block\Adminhtml\Edit\Tab\Newsletter( - $this->contextMock, - $this->registryMock, - $this->formFactoryMock, - $this->subscriberFactoryMock, - $this->accountManagementMock + $this->contextMock->expects($this->once()) + ->method('getUrlBuilder') + ->willReturn($this->urlBuilderMock); + $this->contextMock->expects($this->once()) + ->method('getBackendSession') + ->willReturn($this->backendSessionMock); + $this->contextMock->method('getStoreManager') + ->willReturn($this->storeManager); + $this->systemStore = $this->createMock(SystemStore::class); + $this->customerRepository = $this->createMock(CustomerRepositoryInterface::class); + $this->shareConfig = $this->createMock(Share::class); + + $objectManager = new ObjectManager($this); + $this->model = $objectManager->getObject( + Newsletter::class, + [ + 'context' => $this->contextMock, + 'registry' => $this->registryMock, + 'formFactory' => $this->formFactoryMock, + 'subscriberFactory' => $this->subscriberFactoryMock, + 'customerAccountManagement' => $this->accountManagementMock, + 'systemStore' => $this->systemStore, + 'customerRepository' => $this->customerRepository, + 'shareConfig' => $this->shareConfig, + ] ); } + /** + * Test to initialize the form without current customer + */ public function testInitFormCanNotShowTab() { - $this->registryMock->expects($this->once())->method('registry')->with(RegistryConstants::CURRENT_CUSTOMER_ID) + $this->registryMock->expects($this->once()) + ->method('registry') + ->with(RegistryConstants::CURRENT_CUSTOMER_ID) ->willReturn(false); + $this->assertSame($this->model, $this->model->initForm()); } + /** + * Test to initialize the form + */ public function testInitForm() { $customerId = 1; + $websiteId = 1; + $storeId = 2; + $websiteName = 'Website Name'; + $isSubscribed = true; - $subscriberMock = $this->createMock(\Magento\Newsletter\Model\Subscriber::class); - $fieldsetMock = $this->createMock(\Magento\Framework\Data\Form\Element\Fieldset::class); - $elementMock = $this->createPartialMock(\Magento\Framework\Data\Form\Element\Checkbox::class, ['setIsChecked']); - $formMock = $this->createPartialMock( - \Magento\Framework\Data\Form::class, - ['setHtmlIdPrefix', 'addFieldset', 'setValues', 'getElement', 'setForm', 'setParent', 'setBaseUrl'] - ); - $this->registryMock->expects($this->exactly(3)) - ->method('registry') - ->willReturnMap( - [ - [RegistryConstants::CURRENT_CUSTOMER_ID, $customerId], - ['subscriber', $subscriberMock], - ] - ); - $this->formFactoryMock->expects($this->once())->method('create')->willReturn($formMock); - $formMock->expects($this->once())->method('setHtmlIdPrefix')->with('_newsletter'); + $this->registryMock->method('registry')->with(RegistryConstants::CURRENT_CUSTOMER_ID) + ->willReturn($customerId); + + $customer = $this->createMock(CustomerInterface::class); + $customer->method('getWebsiteId')->willReturn($websiteId); + $customer->method('getStoreId')->willReturn($storeId); + $customer->method('getId')->willReturn($customerId); + $this->customerRepository->method('getById')->with($customerId)->willReturn($customer); + $subscriberMock = $this->createMock(Subscriber::class); + $subscriberMock->method('loadByCustomer')->with($customerId, $websiteId)->willReturnSelf(); + $subscriberMock->method('isSubscribed')->willReturn($isSubscribed); + $subscriberMock->method('getData')->willReturn([]); $this->subscriberFactoryMock->expects($this->once())->method('create')->willReturn($subscriberMock); - $subscriberMock->expects($this->once())->method('loadByCustomerId')->with($customerId)->willReturnSelf(); - $this->registryMock->expects($this->once())->method('register')->with('subscriber', $subscriberMock); - $formMock->expects($this->once())->method('addFieldset')->willReturn($fieldsetMock); - $fieldsetMock->expects($this->once())->method('addField')->willReturn($elementMock); - $this->accountManagementMock->expects($this->once())->method('isReadOnly')->with($customerId) - ->willReturn(false); - $subscriberMock->expects($this->once())->method('isSubscribed')->willReturn(true); - $this->urlBuilderMock->expects($this->once())->method('getBaseUrl')->willReturn('domain.com'); - $this->backendSessionMock->expects($this->once())->method('getCustomerFormData')->willReturn(null); + $website = $this->createMock(Website::class); + $website->method('getStoresCount')->willReturn(1); + $website->method('getId')->willReturn($websiteId); + $store = $this->createMock(Store::class); + $store->method('getWebsiteId')->willReturn($websiteId); + $this->storeManager->method('getStore')->with($storeId)->willReturn($store); + $this->storeManager->method('getWebsites')->willReturn([$website]); + $this->storeManager->method('isSingleStoreMode')->willReturn(true); + $this->systemStore->method('getStoreOptionsTree')->willReturn([]); + $this->systemStore->method('getWebsiteName')->with($websiteId)->willReturn($websiteName); - $formMock->expects($this->once()) - ->method('getElement') - ->willReturnMap( + $statusElementMock = $this->createMock(Checkbox::class); + $statusElementMock->expects($this->once()) + ->method('setIsChecked') + ->with($isSubscribed); + $fieldsetMock = $this->createMock(Fieldset::class); + $fieldsetMock->expects($this->once()) + ->method('addField') + ->with( + 'subscription_status_' . $websiteId, + 'checkbox', [ - ['subscription', $elementMock], + 'label' => __('Subscribed to Newsletter'), + 'name' => "subscription_status[$websiteId]", + 'data-form-part' => null, + 'value' => $isSubscribed, + 'onchange' => 'this.value = this.checked;' ] - ); - - $elementMock->expects($this->once()) - ->method('setIsChecked') - ->with(true); + ) + ->willReturn($statusElementMock); + $fieldsetMock->expects($this->once())->method('setReadonly')->with(true, true); + $formMock = $this->createPartialMock( + Form::class, + ['setHtmlIdPrefix', 'addFieldset', 'setValues', 'getElement', 'setForm', 'setParent', 'setBaseUrl'] + ); + $formMock->expects($this->once())->method('setHtmlIdPrefix')->with('_newsletter'); + $formMock->expects($this->once())->method('addFieldset')->willReturn($fieldsetMock); + $this->formFactoryMock->expects($this->once())->method('create')->willReturn($formMock); + $this->accountManagementMock->expects($this->once()) + ->method('isReadOnly') + ->with($customerId) + ->willReturn(true); + $this->backendSessionMock->expects($this->once()) + ->method('getCustomerFormData') + ->willReturn(null); $this->assertSame($this->model, $this->model->initForm()); } + /** + * Test to initialize the form with session form data + */ public function testInitFormWithCustomerFormData() { $customerId = 1; + $websiteId = 1; + $storeId = 2; + $websiteName = 'Website Name'; + $isSubscribed = true; + $isSubscribedCustomerSession = false; - $subscriberMock = $this->createMock(\Magento\Newsletter\Model\Subscriber::class); - $fieldsetMock = $this->createMock(\Magento\Framework\Data\Form\Element\Fieldset::class); - $elementMock = $this->createPartialMock(\Magento\Framework\Data\Form\Element\Checkbox::class, ['setIsChecked']); + $this->registryMock->method('registry')->with(RegistryConstants::CURRENT_CUSTOMER_ID) + ->willReturn($customerId); + $customer = $this->createMock(CustomerInterface::class); + $customer->method('getWebsiteId')->willReturn($websiteId); + $customer->method('getStoreId')->willReturn($storeId); + $customer->method('getId')->willReturn($customerId); + $this->customerRepository->method('getById')->with($customerId)->willReturn($customer); + $subscriberMock = $this->createMock(Subscriber::class); + $subscriberMock->method('loadByCustomer')->with($customerId, $websiteId)->willReturnSelf(); + $subscriberMock->method('isSubscribed')->willReturn($isSubscribed); + $subscriberMock->method('getData')->willReturn([]); + $this->subscriberFactoryMock->expects($this->once())->method('create')->willReturn($subscriberMock); + $website = $this->createMock(Website::class); + $website->method('getStoresCount')->willReturn(1); + $website->method('getId')->willReturn($websiteId); + $store = $this->createMock(Store::class); + $store->method('getWebsiteId')->willReturn($websiteId); + $this->storeManager->method('getStore')->with($storeId)->willReturn($store); + $this->storeManager->method('getWebsites')->willReturn([$website]); + $this->storeManager->method('isSingleStoreMode')->willReturn(true); + $this->systemStore->method('getStoreOptionsTree')->willReturn([]); + $this->systemStore->method('getWebsiteName')->with($websiteId)->willReturn($websiteName); + $statusElementMock = $this->createMock(Checkbox::class); + $statusElementMock->expects($this->once()) + ->method('setIsChecked') + ->with($isSubscribed); + $fieldsetMock = $this->createMock(Fieldset::class); + $fieldsetMock->expects($this->once()) + ->method('addField') + ->with( + 'subscription_status_' . $websiteId, + 'checkbox', + [ + 'label' => __('Subscribed to Newsletter'), + 'name' => "subscription_status[$websiteId]", + 'data-form-part' => null, + 'value' => $isSubscribed, + 'onchange' => 'this.value = this.checked;' + ] + ) + ->willReturn($statusElementMock); + $fieldsetMock->expects($this->once())->method('setReadonly')->with(true, true); + $statusElementForm = $this->createPartialMock(Checkbox::class, ['setChecked', 'setValue']); + $statusElementForm->method('setValue') + ->with($isSubscribedCustomerSession); + $statusElementForm->method('setChecked') + ->with($isSubscribedCustomerSession); + $storeElementForm = $this->createPartialMock(Select::class, ['setValue']); + $storeElementForm->method('setValue') + ->with(Store::DEFAULT_STORE_ID); $formMock = $this->createPartialMock( - \Magento\Framework\Data\Form::class, + Form::class, ['setHtmlIdPrefix', 'addFieldset', 'setValues', 'getElement', 'setForm', 'setParent', 'setBaseUrl'] ); - $this->registryMock->expects($this->exactly(3)) - ->method('registry') + $formMock->expects($this->once())->method('setHtmlIdPrefix')->with('_newsletter'); + $formMock->expects($this->once())->method('addFieldset')->willReturn($fieldsetMock); + $formMock->method('getElement') ->willReturnMap( [ - [RegistryConstants::CURRENT_CUSTOMER_ID, $customerId], - ['subscriber', $subscriberMock], + ['subscription_status_' . $websiteId, $statusElementForm], + ['subscription_store_' . $websiteId, $storeElementForm], ] ); $this->formFactoryMock->expects($this->once())->method('create')->willReturn($formMock); - $formMock->expects($this->once())->method('setHtmlIdPrefix')->with('_newsletter'); - $this->subscriberFactoryMock->expects($this->once())->method('create')->willReturn($subscriberMock); - $subscriberMock->expects($this->once())->method('loadByCustomerId')->with($customerId)->willReturnSelf(); - $formMock->expects($this->once())->method('addFieldset')->willReturn($fieldsetMock); - $fieldsetMock->expects($this->once())->method('addField')->willReturn($elementMock); - $this->accountManagementMock->expects($this->once())->method('isReadOnly')->with($customerId) - ->willReturn(false); - $subscriberMock->expects($this->once())->method('isSubscribed')->willReturn(false); - $this->urlBuilderMock->expects($this->once())->method('getBaseUrl')->willReturn('domain.com'); - + $this->accountManagementMock->expects($this->once()) + ->method('isReadOnly') + ->with($customerId) + ->willReturn(true); $this->backendSessionMock->expects($this->once()) ->method('getCustomerFormData') - ->willReturn([ - 'customer' => [ - 'entity_id' => $customerId, - ], - 'subscription' => true, - ]); - - $formMock->expects($this->exactly(2)) - ->method('getElement') - ->willReturnMap( - [ - ['subscription', $elementMock], - ] - ); - - $elementMock->expects($this->exactly(2)) - ->method('setIsChecked') - ->willReturnMap( + ->willReturn( [ - [false], - [true], + 'customer' => ['entity_id' => $customerId], + 'subscription_status' => [$websiteId => $isSubscribedCustomerSession] ] ); diff --git a/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/From/Element/Newsletter/SubscriptionsTest.php b/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/From/Element/Newsletter/SubscriptionsTest.php new file mode 100644 index 0000000000000..f6d6777654c5b --- /dev/null +++ b/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/From/Element/Newsletter/SubscriptionsTest.php @@ -0,0 +1,185 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Customer\Test\Unit\Block\Adminhtml\From\Element\Newsletter; + +use Magento\Customer\Block\Adminhtml\Form\Element\Newsletter\Subscriptions; +use Magento\Framework\App\Request\DataPersistorInterface; +use Magento\Framework\Data\Form\Element\AbstractElement; +use Magento\Framework\Data\Form\Element\CollectionFactory; +use Magento\Framework\Data\Form\Element\Factory; +use Magento\Framework\Escaper; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Test class for Customer Newsletter Subscriptions Element + */ +class SubscriptionsTest extends TestCase +{ + /** + * @var Factory|MockObject + */ + private $factoryElement; + + /** + * @var CollectionFactory|MockObject + */ + private $factoryCollection; + + /** + * @var Escaper|MockObject + */ + private $escaper; + + /** + * @var DataPersistorInterface|MockObject + */ + private $dataPersistor; + + /** + * @var Subscriptions + */ + private $element; + + /** + * @inheritdoc + */ + public function setUp() + { + $this->factoryElement = $this->createMock(Factory::class); + $this->factoryCollection = $this->createMock(CollectionFactory::class); + $this->escaper = $this->createMock(Escaper::class); + $this->dataPersistor = $this->createMock(DataPersistorInterface::class); + + $objectManager = new ObjectManager($this); + $this->element = $objectManager->getObject( + Subscriptions::class, + [ + 'factoryElement' => $this->factoryElement, + 'factoryCollection' => $this->factoryCollection, + 'escaper' => $this->escaper, + 'dataPersistor' => $this->dataPersistor, + 'data' => [] + ] + ); + } + + /** + * Test to Get the Html for the element + * + * @param array $data + * @param array $elementsHtml + * @param string $expectedHtml + * @return void + * @dataProvider getElementHtmlDataProvider + */ + public function testGetElementHtml(array $data, array $elementsHtml, string $expectedHtml): void + { + $this->escaper->method('escapeHtml')->withAnyParameters()->willReturnArgument(0); + $selectElementId = $data['name'] . '_store_' . $data['subscriptions'][0]['website_id']; + $selectElement = $this->createMock(AbstractElement::class); + $selectElement->expects($this->once())->method('setId')->with($selectElementId); + $selectElement->expects($this->once())->method('setForm')->willReturnSelf(); + $selectElement->method('toHtml')->willReturn($elementsHtml['store']); + $statusElementId = $data['name'] . '_status_' . $data['subscriptions'][0]['website_id']; + $statusElement = $this->createMock(AbstractElement::class); + $statusElement->expects($this->once())->method('setId')->with($statusElementId); + $statusElement->expects($this->once())->method('setForm')->willReturnSelf(); + $statusElement->method('toHtml')->willReturn($elementsHtml['status']); + $this->factoryElement->method('create')->willReturnMap( + [ + [ + 'select', + [ + 'data' => [ + 'name' => "{$data['name']}_store[{$data['subscriptions'][0]['website_id']}]", + 'data-form-part' => $data['target_form'], + 'values' => $data['subscriptions'][0]['store_options'], + 'value' => $data['subscriptions'][0]['store_id'], + 'required' => true, + ] + ], + $selectElement + ], + [ + 'checkbox', + [ + 'data' => [ + 'name' => "{$data['name']}_status[{$data['subscriptions'][0]['website_id']}]", + 'data-form-part' => $data['target_form'], + 'value' => $data['subscriptions'][0]['status'], + 'onchange' => 'this.value = this.checked;', + ] + ], + $statusElement + ] + ] + ); + $this->dataPersistor->method('get')->willReturn([]); + $this->element->setData($data); + + $this->assertEquals($expectedHtml, $this->element->getElementHtml()); + } + + /** + * Data provider for test to get the html + * + * @return array + */ + public function getElementHtmlDataProvider(): array + { + $customerId = 33; + $elementName = 'element_name'; + $targetForm = 'target_form'; + $websiteId = 1; + $websiteName = 'Website 1'; + $storeId = 2; + $status = true; + $storeOptions = ['array_of_store_options']; + $lastUpdated = 'last updated'; + $storeElementHtml = 'storeElementHtml'; + $statusElementHtml = 'statusElementHtml'; + $outputHtmlTemplate = "<table class=\"admin__table-secondary\">" + . "<tr><th>%s</th><th class=\"subscriber-status\">%s</th><th>%s</th><th>%s</th></tr>" + . "<tr><td>%s</td><td class=\"subscriber-status\">%s</td><td>%s</td><td>%s</td></tr></table>"; + + return [ + [ + 'data' => [ + 'customer_id' => $customerId, + 'name' => $elementName, + 'target_form' => $targetForm, + 'subscriptions' => [ + [ + 'store_id' => $storeId, + 'website_id' => $websiteId, + 'website_name' => $websiteName, + 'status' => $status, + 'store_options' => $storeOptions, + 'last_updated' => $lastUpdated, + ], + ], + ], + 'elementsHtml' => [ + 'status' => $statusElementHtml, + 'store' => $storeElementHtml, + ], + 'expectedHtml' => sprintf( + $outputHtmlTemplate, + 'Website', + 'Subscribed', + 'Store View', + 'Last Updated At', + $websiteName, + $statusElementHtml, + $storeElementHtml, + $lastUpdated + ) + ], + ]; + } +} diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassSubscribeTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassSubscribeTest.php index 33e578224400b..8f672fbfb4da6 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassSubscribeTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassSubscribeTest.php @@ -6,119 +6,130 @@ namespace Magento\Customer\Test\Unit\Controller\Adminhtml\Index; +use Magento\Backend\Model\View\Result\Redirect; +use Magento\Backend\Model\View\Result\RedirectFactory; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Customer\Controller\Adminhtml\Index\MassSubscribe; +use Magento\Customer\Model\ResourceModel\Customer\Collection; +use Magento\Customer\Model\ResourceModel\Customer\CollectionFactory; use Magento\Framework\App\Action\Context; +use Magento\Framework\App\Request\Http; +use Magento\Framework\App\ResponseInterface; +use Magento\Framework\Controller\ResultFactory; +use Magento\Framework\Message\Manager; +use Magento\Framework\ObjectManager\ObjectManager; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use Magento\Newsletter\Model\SubscriptionManagerInterface; +use Magento\Ui\Component\MassAction\Filter; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; /** * Class MassSubscribeTest * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class MassSubscribeTest extends \PHPUnit\Framework\TestCase +class MassSubscribeTest extends TestCase { /** - * @var \Magento\Customer\Controller\Adminhtml\Index\MassSubscribe + * @var MassSubscribe */ protected $massAction; /** - * @var Context|\PHPUnit_Framework_MockObject_MockObject + * @var Context|MockObject */ protected $contextMock; /** - * @var \Magento\Backend\Model\View\Result\Redirect|\PHPUnit_Framework_MockObject_MockObject + * @var Redirect|MockObject */ protected $resultRedirectMock; /** - * @var \Magento\Framework\App\Request\Http|\PHPUnit_Framework_MockObject_MockObject + * @var Http|MockObject */ protected $requestMock; /** - * @var \Magento\Framework\App\ResponseInterface|\PHPUnit_Framework_MockObject_MockObject + * @var ResponseInterface|MockObject */ protected $responseMock; /** - * @var \Magento\Framework\Message\Manager|\PHPUnit_Framework_MockObject_MockObject + * @var Manager|MockObject */ protected $messageManagerMock; /** - * @var \Magento\Framework\ObjectManager\ObjectManager|\PHPUnit_Framework_MockObject_MockObject + * @var ObjectManager|MockObject */ protected $objectManagerMock; /** - * @var \Magento\Customer\Model\ResourceModel\Customer\Collection|\PHPUnit_Framework_MockObject_MockObject + * @var Collection|MockObject */ protected $customerCollectionMock; /** - * @var \Magento\Customer\Model\ResourceModel\Customer\CollectionFactory|\PHPUnit_Framework_MockObject_MockObject + * @var CollectionFactory|MockObject */ protected $customerCollectionFactoryMock; /** - * @var \Magento\Ui\Component\MassAction\Filter|\PHPUnit_Framework_MockObject_MockObject + * @var Filter|MockObject */ protected $filterMock; /** - * @var \Magento\Customer\Api\CustomerRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject + * @var CustomerRepositoryInterface|MockObject */ protected $customerRepositoryMock; /** - * @var \Magento\Newsletter\Model\Subscriber|\PHPUnit_Framework_MockObject_MockObject + * @var SubscriptionManagerInterface|MockObject */ - protected $subscriberMock; + private $subscriptionManager; + /** + * @inheritdoc + */ protected function setUp() { $objectManagerHelper = new ObjectManagerHelper($this); $this->contextMock = $this->createMock(\Magento\Backend\App\Action\Context::class); - $resultRedirectFactory = $this->createMock(\Magento\Backend\Model\View\Result\RedirectFactory::class); - $this->responseMock = $this->createMock(\Magento\Framework\App\ResponseInterface::class); - $this->requestMock = $this->getMockBuilder(\Magento\Framework\App\Request\Http::class) + $resultRedirectFactory = $this->createMock(RedirectFactory::class); + $this->responseMock = $this->createMock(ResponseInterface::class); + $this->requestMock = $this->getMockBuilder(Http::class) ->disableOriginalConstructor()->getMock(); $this->objectManagerMock = $this->createPartialMock( - \Magento\Framework\ObjectManager\ObjectManager::class, + ObjectManager::class, ['create'] ); - $this->messageManagerMock = $this->createMock(\Magento\Framework\Message\Manager::class); + $this->messageManagerMock = $this->createMock(Manager::class); $this->customerCollectionMock = - $this->getMockBuilder(\Magento\Customer\Model\ResourceModel\Customer\Collection::class) + $this->getMockBuilder(Collection::class) ->disableOriginalConstructor() ->getMock(); $this->customerCollectionFactoryMock = - $this->getMockBuilder(\Magento\Customer\Model\ResourceModel\Customer\CollectionFactory::class) + $this->getMockBuilder(CollectionFactory::class) ->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); - $redirectMock = $this->getMockBuilder(\Magento\Backend\Model\View\Result\Redirect::class) + $redirectMock = $this->getMockBuilder(Redirect::class) ->disableOriginalConstructor() ->getMock(); - $resultFactoryMock = $this->getMockBuilder(\Magento\Framework\Controller\ResultFactory::class) + $resultFactoryMock = $this->getMockBuilder(ResultFactory::class) ->disableOriginalConstructor() ->getMock(); $resultFactoryMock->expects($this->any()) ->method('create') - ->with(\Magento\Framework\Controller\ResultFactory::TYPE_REDIRECT) + ->with(ResultFactory::TYPE_REDIRECT) ->willReturn($redirectMock); - $this->subscriberMock = $this->createMock(\Magento\Newsletter\Model\Subscriber::class); - $subscriberFactoryMock = $this->getMockBuilder(\Magento\Newsletter\Model\SubscriberFactory::class) - ->setMethods(['create']) - ->disableOriginalConstructor() - ->getMock(); - $subscriberFactoryMock->expects($this->any()) - ->method('create') - ->willReturn($this->subscriberMock); - - $this->resultRedirectMock = $this->createMock(\Magento\Backend\Model\View\Result\Redirect::class); + $this->subscriptionManager = $this->createMock(SubscriptionManagerInterface::class); + $this->resultRedirectMock = $this->createMock(Redirect::class); $resultRedirectFactory->expects($this->any())->method('create')->willReturn($this->resultRedirectMock); $this->contextMock->expects($this->once())->method('getMessageManager')->willReturn($this->messageManagerMock); @@ -132,7 +143,7 @@ protected function setUp() ->method('getResultFactory') ->willReturn($resultFactoryMock); - $this->filterMock = $this->createMock(\Magento\Ui\Component\MassAction\Filter::class); + $this->filterMock = $this->createMock(Filter::class); $this->filterMock->expects($this->once()) ->method('getCollection') ->with($this->customerCollectionMock) @@ -140,35 +151,37 @@ protected function setUp() $this->customerCollectionFactoryMock->expects($this->once()) ->method('create') ->willReturn($this->customerCollectionMock); - $this->customerRepositoryMock = $this->getMockBuilder(\Magento\Customer\Api\CustomerRepositoryInterface::class) + $this->customerRepositoryMock = $this->getMockBuilder(CustomerRepositoryInterface::class) ->getMockForAbstractClass(); $this->massAction = $objectManagerHelper->getObject( - \Magento\Customer\Controller\Adminhtml\Index\MassSubscribe::class, + MassSubscribe::class, [ 'context' => $this->contextMock, 'filter' => $this->filterMock, 'collectionFactory' => $this->customerCollectionFactoryMock, 'customerRepository' => $this->customerRepositoryMock, - 'subscriberFactory' => $subscriberFactoryMock, + 'subscriptionManager' => $this->subscriptionManager, ] ); } + /** + * Test to mass subscribe customers to newsletters + */ public function testExecute() { - $customersIds = [10, 11, 12]; - - $this->customerCollectionMock->expects($this->any()) - ->method('getAllIds') - ->willReturn($customersIds); - - $this->customerRepositoryMock->expects($this->any()) - ->method('getById') - ->willReturnMap([[10, true], [11, true], [12, true]]); - - $this->subscriberMock->expects($this->any()) - ->method('subscribeCustomerById') - ->willReturnMap([[10, true], [11, true], [12, true]]); + $storeId = 2; + $customerId = 10; + $customersIds = [$customerId, $customerId, $customerId]; + + $this->customerCollectionMock->method('getAllIds')->willReturn($customersIds); + $customer = $this->createMock(CustomerInterface::class); + $customer->method('getStoreId')->willReturn($storeId); + $customer->method('getId')->willReturn($customerId); + $this->customerRepositoryMock->method('getById')->with($customerId)->willReturn($customer); + $this->subscriptionManager->expects($this->exactly(3)) + ->method('subscribeCustomer') + ->with($customerId, $storeId); $this->messageManagerMock->expects($this->once()) ->method('addSuccessMessage') @@ -182,6 +195,9 @@ public function testExecute() $this->massAction->execute(); } + /** + * Test to mass subscribe customers to newsletters with throws exception + */ public function testExecuteWithException() { $customersIds = [10, 11, 12]; diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassUnsubscribeTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassUnsubscribeTest.php index 971efc0e490bc..303a11989236f 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassUnsubscribeTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassUnsubscribeTest.php @@ -6,119 +6,130 @@ namespace Magento\Customer\Test\Unit\Controller\Adminhtml\Index; +use Magento\Backend\Model\View\Result\Redirect; +use Magento\Backend\Model\View\Result\RedirectFactory; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Customer\Controller\Adminhtml\Index\MassUnsubscribe; +use Magento\Customer\Model\ResourceModel\Customer\Collection; +use Magento\Customer\Model\ResourceModel\Customer\CollectionFactory; use Magento\Framework\App\Action\Context; +use Magento\Framework\App\Request\Http; +use Magento\Framework\App\ResponseInterface; +use Magento\Framework\Controller\ResultFactory; +use Magento\Framework\Message\Manager; +use Magento\Framework\ObjectManager\ObjectManager; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use Magento\Newsletter\Model\SubscriptionManagerInterface; +use Magento\Ui\Component\MassAction\Filter; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; /** * Class MassUnsubscribeTest * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class MassUnsubscribeTest extends \PHPUnit\Framework\TestCase +class MassUnsubscribeTest extends TestCase { /** - * @var \Magento\Customer\Controller\Adminhtml\Index\MassUnsubscribe + * @var MassUnsubscribe */ protected $massAction; /** - * @var Context|\PHPUnit_Framework_MockObject_MockObject + * @var Context|MockObject */ protected $contextMock; /** - * @var \Magento\Backend\Model\View\Result\Redirect|\PHPUnit_Framework_MockObject_MockObject + * @var Redirect|MockObject */ protected $resultRedirectMock; /** - * @var \Magento\Framework\App\Request\Http|\PHPUnit_Framework_MockObject_MockObject + * @var Http|MockObject */ protected $requestMock; /** - * @var \Magento\Framework\App\ResponseInterface|\PHPUnit_Framework_MockObject_MockObject + * @var ResponseInterface|MockObject */ protected $responseMock; /** - * @var \Magento\Framework\Message\Manager|\PHPUnit_Framework_MockObject_MockObject + * @var Manager|MockObject */ protected $messageManagerMock; /** - * @var \Magento\Framework\ObjectManager\ObjectManager|\PHPUnit_Framework_MockObject_MockObject + * @var ObjectManager|MockObject */ protected $objectManagerMock; /** - * @var \Magento\Customer\Model\ResourceModel\Customer\Collection|\PHPUnit_Framework_MockObject_MockObject + * @var Collection|MockObject */ protected $customerCollectionMock; /** - * @var \Magento\Customer\Model\ResourceModel\Customer\CollectionFactory|\PHPUnit_Framework_MockObject_MockObject + * @var CollectionFactory|MockObject */ protected $customerCollectionFactoryMock; /** - * @var \Magento\Ui\Component\MassAction\Filter|\PHPUnit_Framework_MockObject_MockObject + * @var Filter|MockObject */ protected $filterMock; /** - * @var \Magento\Customer\Api\CustomerRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject + * @var CustomerRepositoryInterface|MockObject */ protected $customerRepositoryMock; /** - * @var \Magento\Newsletter\Model\Subscriber|\PHPUnit_Framework_MockObject_MockObject + * @var SubscriptionManagerInterface|MockObject */ - protected $subscriberMock; + private $subscriptionManager; + /** + * @inheritdoc + */ protected function setUp() { $objectManagerHelper = new ObjectManagerHelper($this); $this->contextMock = $this->createMock(\Magento\Backend\App\Action\Context::class); - $resultRedirectFactory = $this->createMock(\Magento\Backend\Model\View\Result\RedirectFactory::class); - $this->responseMock = $this->createMock(\Magento\Framework\App\ResponseInterface::class); - $this->requestMock = $this->getMockBuilder(\Magento\Framework\App\Request\Http::class) + $resultRedirectFactory = $this->createMock(RedirectFactory::class); + $this->responseMock = $this->createMock(ResponseInterface::class); + $this->requestMock = $this->getMockBuilder(Http::class) ->disableOriginalConstructor()->getMock(); $this->objectManagerMock = $this->createPartialMock( - \Magento\Framework\ObjectManager\ObjectManager::class, + ObjectManager::class, ['create'] ); - $this->messageManagerMock = $this->createMock(\Magento\Framework\Message\Manager::class); + $this->messageManagerMock = $this->createMock(Manager::class); $this->customerCollectionMock = - $this->getMockBuilder(\Magento\Customer\Model\ResourceModel\Customer\Collection::class) + $this->getMockBuilder(Collection::class) ->disableOriginalConstructor() ->getMock(); $this->customerCollectionFactoryMock = - $this->getMockBuilder(\Magento\Customer\Model\ResourceModel\Customer\CollectionFactory::class) + $this->getMockBuilder(CollectionFactory::class) ->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); - $redirectMock = $this->getMockBuilder(\Magento\Backend\Model\View\Result\Redirect::class) + $redirectMock = $this->getMockBuilder(Redirect::class) ->disableOriginalConstructor() ->getMock(); - $resultFactoryMock = $this->getMockBuilder(\Magento\Framework\Controller\ResultFactory::class) + $resultFactoryMock = $this->getMockBuilder(ResultFactory::class) ->disableOriginalConstructor() ->getMock(); $resultFactoryMock->expects($this->any()) ->method('create') - ->with(\Magento\Framework\Controller\ResultFactory::TYPE_REDIRECT) + ->with(ResultFactory::TYPE_REDIRECT) ->willReturn($redirectMock); - $this->subscriberMock = $this->createMock(\Magento\Newsletter\Model\Subscriber::class); - $subscriberFactoryMock = $this->getMockBuilder(\Magento\Newsletter\Model\SubscriberFactory::class) - ->setMethods(['create']) - ->disableOriginalConstructor() - ->getMock(); - $subscriberFactoryMock->expects($this->any()) - ->method('create') - ->willReturn($this->subscriberMock); - - $this->resultRedirectMock = $this->createMock(\Magento\Backend\Model\View\Result\Redirect::class); + $this->subscriptionManager = $this->createMock(SubscriptionManagerInterface::class); + $this->resultRedirectMock = $this->createMock(Redirect::class); $resultRedirectFactory->expects($this->any())->method('create')->willReturn($this->resultRedirectMock); $this->contextMock->expects($this->once())->method('getMessageManager')->willReturn($this->messageManagerMock); @@ -132,7 +143,7 @@ protected function setUp() ->method('getResultFactory') ->willReturn($resultFactoryMock); - $this->filterMock = $this->createMock(\Magento\Ui\Component\MassAction\Filter::class); + $this->filterMock = $this->createMock(Filter::class); $this->filterMock->expects($this->once()) ->method('getCollection') ->with($this->customerCollectionMock) @@ -140,35 +151,37 @@ protected function setUp() $this->customerCollectionFactoryMock->expects($this->once()) ->method('create') ->willReturn($this->customerCollectionMock); - $this->customerRepositoryMock = $this->getMockBuilder(\Magento\Customer\Api\CustomerRepositoryInterface::class) + $this->customerRepositoryMock = $this->getMockBuilder(CustomerRepositoryInterface::class) ->getMockForAbstractClass(); $this->massAction = $objectManagerHelper->getObject( - \Magento\Customer\Controller\Adminhtml\Index\MassUnsubscribe::class, + MassUnsubscribe::class, [ 'context' => $this->contextMock, 'filter' => $this->filterMock, 'collectionFactory' => $this->customerCollectionFactoryMock, 'customerRepository' => $this->customerRepositoryMock, - 'subscriberFactory' => $subscriberFactoryMock, + 'subscriptionManager' => $this->subscriptionManager, ] ); } + /** + * Test to mass unsubscribe customers from newsletters + */ public function testExecute() { - $customersIds = [10, 11, 12]; - - $this->customerCollectionMock->expects($this->any()) - ->method('getAllIds') - ->willReturn($customersIds); - - $this->customerRepositoryMock->expects($this->any()) - ->method('getById') - ->willReturnMap([[10, true], [11, true], [12, true]]); - - $this->subscriberMock->expects($this->any()) - ->method('unsubscribeCustomerById') - ->willReturnMap([[10, true], [11, true], [12, true]]); + $storeId = 2; + $customerId = 10; + $customersIds = [$customerId, $customerId, $customerId]; + + $this->customerCollectionMock->method('getAllIds')->willReturn($customersIds); + $customer = $this->createMock(CustomerInterface::class); + $customer->method('getStoreId')->willReturn($storeId); + $customer->method('getId')->willReturn($customerId); + $this->customerRepositoryMock->method('getById')->with($customerId)->willReturn($customer); + $this->subscriptionManager->expects($this->exactly(3)) + ->method('unsubscribeCustomer') + ->with($customerId, $storeId); $this->messageManagerMock->expects($this->once()) ->method('addSuccessMessage') @@ -182,6 +195,9 @@ public function testExecute() $this->massAction->execute(); } + /** + * Test to mass unsubscribe customers to newsletters with throws exception + */ public function testExecuteWithException() { $customersIds = [10, 11, 12]; diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/SaveTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/SaveTest.php index 9724ac13dde8c..2e729873961c0 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/SaveTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/SaveTest.php @@ -5,13 +5,45 @@ */ namespace Magento\Customer\Test\Unit\Controller\Adminhtml\Index; +use Magento\Backend\App\Action\Context; +use Magento\Backend\Model\Session; +use Magento\Backend\Model\View\Result\Forward; +use Magento\Backend\Model\View\Result\ForwardFactory; +use Magento\Backend\Model\View\Result\RedirectFactory; +use Magento\Customer\Api\AddressRepositoryInterface; use Magento\Customer\Api\CustomerMetadataInterface; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\AddressInterfaceFactory; use Magento\Customer\Api\Data\AttributeMetadataInterface; use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Customer\Api\Data\CustomerInterfaceFactory; +use Magento\Customer\Controller\Adminhtml\Index\Save; use Magento\Customer\Controller\RegistryConstants; +use Magento\Customer\Model\AccountManagement; +use Magento\Customer\Model\Address\Mapper; use Magento\Customer\Model\EmailNotificationInterface; use Magento\Customer\Model\Metadata\Form; +use Magento\Customer\Model\Metadata\FormFactory; +use Magento\Framework\Api\DataObjectHelper; +use Magento\Framework\App\Request\Http; +use Magento\Framework\App\RequestInterface; +use Magento\Framework\AuthorizationInterface; use Magento\Framework\Controller\Result\Redirect; +use Magento\Framework\DataObject; +use Magento\Framework\DataObjectFactory; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Message\Error; +use Magento\Framework\Message\ManagerInterface; +use Magento\Framework\Registry; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Framework\View\Page\Config; +use Magento\Framework\View\Page\Title; +use Magento\Framework\View\Result\Page; +use Magento\Framework\View\Result\PageFactory; +use Magento\Newsletter\Model\SubscriberFactory; +use Magento\Newsletter\Model\SubscriptionManagerInterface; +use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\MockObject\MockObject; /** * Testing Save Customer use case from admin page @@ -20,220 +52,226 @@ * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @covers \Magento\Customer\Controller\Adminhtml\Index\Save */ -class SaveTest extends \PHPUnit\Framework\TestCase +class SaveTest extends TestCase { /** - * @var \Magento\Customer\Controller\Adminhtml\Index\Save + * @var Save */ protected $model; /** - * @var \Magento\Backend\App\Action\Context + * @var Context */ protected $context; /** - * @var \Magento\Framework\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject + * @var RequestInterface|MockObject */ protected $requestMock; /** - * @var \Magento\Backend\Model\View\Result\ForwardFactory|\PHPUnit_Framework_MockObject_MockObject + * @var ForwardFactory|MockObject */ protected $resultForwardFactoryMock; /** - * @var \Magento\Backend\Model\View\Result\Forward|\PHPUnit_Framework_MockObject_MockObject + * @var Forward|MockObject */ protected $resultForwardMock; /** - * @var \Magento\Framework\View\Result\PageFactory|\PHPUnit_Framework_MockObject_MockObject + * @var PageFactory|MockObject */ protected $resultPageFactoryMock; /** - * @var \Magento\Framework\View\Result\Page|\PHPUnit_Framework_MockObject_MockObject + * @var Page|MockObject */ protected $resultPageMock; /** - * @var \Magento\Framework\View\Page\Config|\PHPUnit_Framework_MockObject_MockObject + * @var Config|MockObject */ protected $pageConfigMock; /** - * @var \Magento\Framework\View\Page\Title|\PHPUnit_Framework_MockObject_MockObject + * @var Title|MockObject */ protected $pageTitleMock; /** - * @var \Magento\Backend\Model\Session|\PHPUnit_Framework_MockObject_MockObject + * @var Session|MockObject */ protected $sessionMock; /** - * @var \Magento\Customer\Model\Metadata\FormFactory|\PHPUnit_Framework_MockObject_MockObject + * @var FormFactory|MockObject */ protected $formFactoryMock; /** - * @var \Magento\Framework\DataObjectFactory|\PHPUnit_Framework_MockObject_MockObject + * @var DataObjectFactory|MockObject */ protected $objectFactoryMock; /** - * @var \Magento\Customer\Api\Data\CustomerInterfaceFactory|\PHPUnit_Framework_MockObject_MockObject + * @var CustomerInterfaceFactory|MockObject */ protected $customerDataFactoryMock; /** - * @var \Magento\Customer\Api\CustomerRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject + * @var CustomerRepositoryInterface|MockObject */ protected $customerRepositoryMock; /** - * @var \Magento\Customer\Model\Customer\Mapper|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Customer\Model\Customer\Mapper|MockObject */ protected $customerMapperMock; /** - * @var \Magento\Framework\Api\DataObjectHelper|\PHPUnit_Framework_MockObject_MockObject + * @var DataObjectHelper|MockObject */ protected $dataHelperMock; /** - * @var \Magento\Framework\AuthorizationInterface|\PHPUnit_Framework_MockObject_MockObject + * @var AuthorizationInterface|MockObject */ protected $authorizationMock; /** - * @var \Magento\Newsletter\Model\SubscriberFactory|\PHPUnit_Framework_MockObject_MockObject + * @var SubscriberFactory|MockObject */ protected $subscriberFactoryMock; /** - * @var \Magento\Framework\Registry|\PHPUnit_Framework_MockObject_MockObject + * @var Registry|MockObject */ protected $registryMock; /** - * @var \Magento\Framework\Message\ManagerInterface|\PHPUnit_Framework_MockObject_MockObject + * @var ManagerInterface|MockObject */ protected $messageManagerMock; /** - * @var \Magento\Backend\Model\View\Result\RedirectFactory|\PHPUnit_Framework_MockObject_MockObject + * @var RedirectFactory|MockObject */ protected $redirectFactoryMock; /** - * @var \Magento\Customer\Model\AccountManagement|\PHPUnit_Framework_MockObject_MockObject + * @var AccountManagement|MockObject */ protected $managementMock; /** - * @var \Magento\Customer\Api\Data\AddressInterfaceFactory|\PHPUnit_Framework_MockObject_MockObject + * @var AddressInterfaceFactory|MockObject */ protected $addressDataFactoryMock; /** - * @var EmailNotificationInterface|\PHPUnit_Framework_MockObject_MockObject + * @var EmailNotificationInterface|MockObject */ protected $emailNotificationMock; /** - * @var \Magento\Customer\Model\Address\Mapper|\PHPUnit_Framework_MockObject_MockObject + * @var Mapper|MockObject */ protected $customerAddressMapperMock; /** - * @var \Magento\Customer\Api\AddressRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject + * @var AddressRepositoryInterface|MockObject */ protected $customerAddressRepositoryMock; + /** + * @var SubscriptionManagerInterface|MockObject + */ + private $subscriptionManager; + /** * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ protected function setUp() { - $this->requestMock = $this->getMockBuilder(\Magento\Framework\App\Request\Http::class) + $this->requestMock = $this->getMockBuilder(Http::class) ->disableOriginalConstructor() ->getMock(); $this->resultForwardFactoryMock = $this->getMockBuilder( - \Magento\Backend\Model\View\Result\ForwardFactory::class + ForwardFactory::class )->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); - $this->resultForwardMock = $this->getMockBuilder(\Magento\Backend\Model\View\Result\Forward::class) + $this->resultForwardMock = $this->getMockBuilder(Forward::class) ->disableOriginalConstructor() ->getMock(); - $this->resultPageFactoryMock = $this->getMockBuilder(\Magento\Framework\View\Result\PageFactory::class) + $this->resultPageFactoryMock = $this->getMockBuilder(PageFactory::class) ->disableOriginalConstructor() ->getMock(); - $this->resultPageMock = $this->getMockBuilder(\Magento\Framework\View\Result\Page::class) + $this->resultPageMock = $this->getMockBuilder(Page::class) ->disableOriginalConstructor() ->setMethods(['setActiveMenu', 'getConfig', 'addBreadcrumb']) ->getMock(); - $this->pageConfigMock = $this->getMockBuilder(\Magento\Framework\View\Page\Config::class) + $this->pageConfigMock = $this->getMockBuilder(Config::class) ->disableOriginalConstructor() ->getMock(); - $this->pageTitleMock = $this->getMockBuilder(\Magento\Framework\View\Page\Title::class) + $this->pageTitleMock = $this->getMockBuilder(Title::class) ->disableOriginalConstructor() ->getMock(); - $this->sessionMock = $this->getMockBuilder(\Magento\Backend\Model\Session::class) + $this->sessionMock = $this->getMockBuilder(Session::class) ->disableOriginalConstructor() ->setMethods(['unsCustomerFormData', 'setCustomerFormData']) ->getMock(); - $this->formFactoryMock = $this->getMockBuilder(\Magento\Customer\Model\Metadata\FormFactory::class) + $this->formFactoryMock = $this->getMockBuilder(FormFactory::class) ->disableOriginalConstructor() ->getMock(); - $this->objectFactoryMock = $this->getMockBuilder(\Magento\Framework\DataObjectFactory::class) + $this->objectFactoryMock = $this->getMockBuilder(DataObjectFactory::class) ->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); $this->customerDataFactoryMock = $this->getMockBuilder( - \Magento\Customer\Api\Data\CustomerInterfaceFactory::class + CustomerInterfaceFactory::class )->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); - $this->customerRepositoryMock = $this->getMockBuilder(\Magento\Customer\Api\CustomerRepositoryInterface::class) + $this->customerRepositoryMock = $this->getMockBuilder(CustomerRepositoryInterface::class) ->disableOriginalConstructor() ->getMock(); $this->customerAddressRepositoryMock = $this->getMockBuilder( - \Magento\Customer\Api\AddressRepositoryInterface::class + AddressRepositoryInterface::class )->disableOriginalConstructor()->getMock(); $this->customerMapperMock = $this->getMockBuilder( \Magento\Customer\Model\Customer\Mapper::class )->disableOriginalConstructor()->getMock(); $this->customerAddressMapperMock = $this->getMockBuilder( - \Magento\Customer\Model\Address\Mapper::class + Mapper::class )->disableOriginalConstructor()->getMock(); $this->dataHelperMock = $this->getMockBuilder( - \Magento\Framework\Api\DataObjectHelper::class + DataObjectHelper::class )->disableOriginalConstructor()->getMock(); - $this->authorizationMock = $this->getMockBuilder(\Magento\Framework\AuthorizationInterface::class) + $this->authorizationMock = $this->getMockBuilder(AuthorizationInterface::class) ->disableOriginalConstructor() ->getMock(); - $this->subscriberFactoryMock = $this->getMockBuilder(\Magento\Newsletter\Model\SubscriberFactory::class) + $this->subscriberFactoryMock = $this->getMockBuilder(SubscriberFactory::class) ->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); - $this->registryMock = $this->getMockBuilder(\Magento\Framework\Registry::class) + $this->subscriptionManager = $this->createMock(SubscriptionManagerInterface::class); + $this->registryMock = $this->getMockBuilder(Registry::class) ->disableOriginalConstructor() ->getMock(); - $this->messageManagerMock = $this->getMockBuilder(\Magento\Framework\Message\ManagerInterface::class) + $this->messageManagerMock = $this->getMockBuilder(ManagerInterface::class) ->disableOriginalConstructor() ->getMock(); - $this->redirectFactoryMock = $this->getMockBuilder(\Magento\Backend\Model\View\Result\RedirectFactory::class) + $this->redirectFactoryMock = $this->getMockBuilder(RedirectFactory::class) ->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); - $this->managementMock = $this->getMockBuilder(\Magento\Customer\Model\AccountManagement::class) + $this->managementMock = $this->getMockBuilder(AccountManagement::class) ->disableOriginalConstructor() ->setMethods(['createAccount']) ->getMock(); - $this->addressDataFactoryMock = $this->getMockBuilder(\Magento\Customer\Api\Data\AddressInterfaceFactory::class) + $this->addressDataFactoryMock = $this->getMockBuilder(AddressInterfaceFactory::class) ->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); @@ -241,10 +279,10 @@ protected function setUp() ->disableOriginalConstructor() ->getMock(); - $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); + $objectManager = new ObjectManager($this); $this->model = $objectManager->getObject( - \Magento\Customer\Controller\Adminhtml\Index\Save::class, + Save::class, [ 'resultForwardFactory' => $this->resultForwardFactoryMock, 'resultPageFactory' => $this->resultPageFactoryMock, @@ -265,6 +303,7 @@ protected function setUp() 'resultRedirectFactory' => $this->redirectFactoryMock, 'addressRepository' => $this->customerAddressRepositoryMock, 'addressMapper' => $this->customerAddressMapperMock, + 'subscriptionManager' => $this->subscriptionManager, ] ); @@ -282,7 +321,10 @@ protected function setUp() public function testExecuteWithExistentCustomer() { $customerId = 22; - $subscription = 'true'; + $customerEmail = 'customer@email.com'; + $subscriptionWebsite = 1; + $subscriptionStatus = true; + $subscriptionStore = 3; $postValue = [ 'customer' => [ 'entity_id' => $customerId, @@ -290,7 +332,8 @@ public function testExecuteWithExistentCustomer() 'coolness' => false, 'disable_auto_group_change' => 'false', ], - 'subscription' => $subscription, + 'subscription_status' => [$subscriptionWebsite => $subscriptionStatus], + 'subscription_store' => [$subscriptionWebsite => $subscriptionStore], ]; $extractedData = [ 'entity_id' => $customerId, @@ -324,9 +367,9 @@ public function testExecuteWithExistentCustomer() 'id' => $customerId, ]; - /** @var AttributeMetadataInterface|\PHPUnit_Framework_MockObject_MockObject $customerFormMock */ + /** @var AttributeMetadataInterface|MockObject $customerFormMock */ $attributeMock = $this->getMockBuilder( - \Magento\Customer\Api\Data\AttributeMetadataInterface::class + AttributeMetadataInterface::class )->disableOriginalConstructor()->getMock(); $attributeMock->expects($this->atLeastOnce()) ->method('getAttributeCode') @@ -346,15 +389,20 @@ public function testExecuteWithExistentCustomer() ); $this->requestMock->expects($this->atLeastOnce()) ->method('getPost') + ->with('customer') + ->willReturn($postValue['customer']); + $this->requestMock->expects($this->atLeastOnce()) + ->method('getParam') ->willReturnMap( [ - ['customer', null, $postValue['customer']], - ['subscription', null, $subscription], + ['subscription_status', null, [$subscriptionWebsite => $subscriptionStatus]], + ['subscription_store', null, [$subscriptionWebsite => $subscriptionStore]], + ['back', false, true], ] ); - /** @var \Magento\Framework\DataObject|\PHPUnit_Framework_MockObject_MockObject $objectMock */ - $objectMock = $this->getMockBuilder(\Magento\Framework\DataObject::class) + /** @var DataObject|MockObject $objectMock */ + $objectMock = $this->getMockBuilder(DataObject::class) ->disableOriginalConstructor() ->getMock(); $objectMock->expects($this->atLeastOnce()) @@ -371,7 +419,7 @@ public function testExecuteWithExistentCustomer() ->willReturn($objectMock); $customerFormMock = $this->getMockBuilder( - \Magento\Customer\Model\Metadata\Form::class + Form::class )->disableOriginalConstructor()->getMock(); $customerFormMock->expects($this->once()) ->method('extractData') @@ -400,32 +448,26 @@ public function testExecuteWithExistentCustomer() ] ); - /** @var CustomerInterface|\PHPUnit_Framework_MockObject_MockObject $customerMock */ - $customerMock = $this->getMockBuilder( - \Magento\Customer\Api\Data\CustomerInterface::class - )->disableOriginalConstructor()->getMock(); - + /** @var CustomerInterface|MockObject $customerMock */ + $customerMock = $this->createMock(CustomerInterface::class); + $customerMock->method('getId')->willReturn($customerId); $this->customerDataFactoryMock->expects($this->once()) ->method('create') ->willReturn($customerMock); - - $this->customerRepositoryMock->expects($this->exactly(2)) - ->method('getById') + $this->customerRepositoryMock->method('getById') ->with($customerId) ->willReturn($customerMock); - $this->customerMapperMock->expects($this->exactly(2)) ->method('toFlatArray') ->with($customerMock) ->willReturn($savedData); - $this->dataHelperMock->expects($this->atLeastOnce()) ->method('populateWithArray') ->willReturnMap( [ [ $customerMock, - $mergedData, \Magento\Customer\Api\Data\CustomerInterface::class, + $mergedData, CustomerInterface::class, $this->dataHelperMock ], ] @@ -435,10 +477,7 @@ public function testExecuteWithExistentCustomer() ->method('save') ->with($customerMock) ->willReturnSelf(); - - $customerEmail = 'customer@email.com'; $customerMock->expects($this->once())->method('getEmail')->willReturn($customerEmail); - $customerMock->expects($this->once()) ->method('getAddresses') ->willReturn([]); @@ -453,25 +492,12 @@ public function testExecuteWithExistentCustomer() ->with(null) ->willReturn(true); - /** @var \Magento\Newsletter\Model\Subscriber|\PHPUnit_Framework_MockObject_MockObject $subscriberMock */ - $subscriberMock = $this->getMockBuilder(\Magento\Newsletter\Model\Subscriber::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->subscriberFactoryMock->expects($this->once()) - ->method('create') - ->with() - ->willReturn($subscriberMock); - - $subscriberMock->expects($this->once()) - ->method('subscribeCustomerById') - ->with($customerId); - $subscriberMock->expects($this->never()) - ->method('unsubscribeCustomerById'); + $this->subscriptionManager->expects($this->once()) + ->method($subscriptionStatus ? 'subscribeCustomer' : 'unsubscribeCustomer') + ->with($customerId, $subscriptionStore); $this->sessionMock->expects($this->once()) ->method('unsCustomerFormData'); - $this->registryMock->expects($this->once()) ->method('register') ->with(RegistryConstants::CURRENT_CUSTOMER_ID, $customerId); @@ -481,13 +507,8 @@ public function testExecuteWithExistentCustomer() ->with(__('You saved the customer.')) ->willReturnSelf(); - $this->requestMock->expects($this->once()) - ->method('getParam') - ->with('back', false) - ->willReturn(true); - - /** @var Redirect|\PHPUnit_Framework_MockObject_MockObject $redirectMock */ - $redirectMock = $this->getMockBuilder(\Magento\Framework\Controller\Result\Redirect::class) + /** @var Redirect|MockObject $redirectMock */ + $redirectMock = $this->getMockBuilder(Redirect::class) ->disableOriginalConstructor() ->getMock(); @@ -511,14 +532,17 @@ public function testExecuteWithExistentCustomer() public function testExecuteWithNewCustomer() { $customerId = 22; + $subscriptionWebsite = 1; + $subscriptionStatus = false; + $subscriptionStore = 3; - $subscription = '0'; $postValue = [ 'customer' => [ 'coolness' => false, 'disable_auto_group_change' => 'false', ], - 'subscription' => $subscription, + 'subscription_status' => [$subscriptionWebsite => $subscriptionStatus], + 'subscription_store' => [$subscriptionWebsite => $subscriptionStore], ]; $extractedData = [ 'coolness' => false, @@ -530,9 +554,9 @@ public function testExecuteWithNewCustomer() CustomerInterface::DEFAULT_SHIPPING => null, 'confirmation' => false, ]; - /** @var AttributeMetadataInterface|\PHPUnit_Framework_MockObject_MockObject $customerFormMock */ + /** @var AttributeMetadataInterface|MockObject $customerFormMock */ $attributeMock = $this->getMockBuilder( - \Magento\Customer\Api\Data\AttributeMetadataInterface::class + AttributeMetadataInterface::class )->disableOriginalConstructor()->getMock(); $attributeMock->expects($this->atLeastOnce()) ->method('getAttributeCode') @@ -552,15 +576,20 @@ public function testExecuteWithNewCustomer() ); $this->requestMock->expects($this->atLeastOnce()) ->method('getPost') + ->with('customer') + ->willReturn($postValue['customer']); + $this->requestMock->expects($this->atLeastOnce()) + ->method('getParam') ->willReturnMap( [ - ['customer', null, $postValue['customer']], - ['subscription', null, $subscription], + ['subscription_status', null, [$subscriptionWebsite => $subscriptionStatus]], + ['subscription_store', null, [$subscriptionWebsite => $subscriptionStore]], + ['back', false, false], ] ); - /** @var \Magento\Framework\DataObject|\PHPUnit_Framework_MockObject_MockObject $objectMock */ - $objectMock = $this->getMockBuilder(\Magento\Framework\DataObject::class) + /** @var DataObject|MockObject $objectMock */ + $objectMock = $this->getMockBuilder(DataObject::class) ->disableOriginalConstructor() ->getMock(); $objectMock->expects($this->atLeastOnce()) @@ -577,7 +606,7 @@ public function testExecuteWithNewCustomer() ->willReturn($objectMock); $customerFormMock = $this->getMockBuilder( - \Magento\Customer\Model\Metadata\Form::class + Form::class )->disableOriginalConstructor()->getMock(); $customerFormMock->expects($this->once()) ->method('extractData') @@ -607,60 +636,36 @@ public function testExecuteWithNewCustomer() ] ); - /** @var CustomerInterface|\PHPUnit_Framework_MockObject_MockObject $customerMock */ - $customerMock = $this->getMockBuilder( - \Magento\Customer\Api\Data\CustomerInterface::class - )->disableOriginalConstructor()->getMock(); - + /** @var CustomerInterface|MockObject $customerMock */ + $customerMock = $this->createMock(CustomerInterface::class); + $customerMock->method('getId')->willReturn($customerId); $this->customerDataFactoryMock->expects($this->once()) ->method('create') ->willReturn($customerMock); - $this->dataHelperMock->expects($this->atLeastOnce()) ->method('populateWithArray') ->willReturnMap( [ [ $customerMock, - $mergedData, \Magento\Customer\Api\Data\CustomerInterface::class, + $mergedData, CustomerInterface::class, $this->dataHelperMock ], ] ); - $this->managementMock->expects($this->once()) ->method('createAccount') ->with($customerMock, null, '') ->willReturn($customerMock); - - $customerMock->expects($this->once()) - ->method('getId') - ->willReturn($customerId); - $this->authorizationMock->expects($this->once()) ->method('isAllowed') ->with(null) ->willReturn(true); - - /** @var \Magento\Newsletter\Model\Subscriber|\PHPUnit_Framework_MockObject_MockObject $subscriberMock */ - $subscriberMock = $this->getMockBuilder(\Magento\Newsletter\Model\Subscriber::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->subscriberFactoryMock->expects($this->once()) - ->method('create') - ->with() - ->willReturn($subscriberMock); - - $subscriberMock->expects($this->once()) - ->method('unsubscribeCustomerById') - ->with($customerId); - $subscriberMock->expects($this->never()) - ->method('subscribeCustomerById'); - + $this->subscriptionManager->expects($this->once()) + ->method($subscriptionStatus ? 'subscribeCustomer' : 'unsubscribeCustomer') + ->with($customerId, $subscriptionStore); $this->sessionMock->expects($this->once()) ->method('unsCustomerFormData'); - $this->registryMock->expects($this->once()) ->method('register') ->with(RegistryConstants::CURRENT_CUSTOMER_ID, $customerId); @@ -670,13 +675,8 @@ public function testExecuteWithNewCustomer() ->with(__('You saved the customer.')) ->willReturnSelf(); - $this->requestMock->expects($this->once()) - ->method('getParam') - ->with('back', false) - ->willReturn(false); - - /** @var Redirect|\PHPUnit_Framework_MockObject_MockObject $redirectMock */ - $redirectMock = $this->getMockBuilder(\Magento\Framework\Controller\Result\Redirect::class) + /** @var Redirect|MockObject $redirectMock */ + $redirectMock = $this->getMockBuilder(Redirect::class) ->disableOriginalConstructor() ->getMock(); @@ -713,9 +713,9 @@ public function testExecuteWithNewCustomerAndValidationException() 'dob' => '1996-03-12', ]; - /** @var AttributeMetadataInterface|\PHPUnit_Framework_MockObject_MockObject $customerFormMock */ + /** @var AttributeMetadataInterface|MockObject $customerFormMock */ $attributeMock = $this->getMockBuilder( - \Magento\Customer\Api\Data\AttributeMetadataInterface::class + AttributeMetadataInterface::class )->disableOriginalConstructor()->getMock(); $attributeMock->expects($this->exactly(2)) ->method('getAttributeCode') @@ -741,8 +741,8 @@ public function testExecuteWithNewCustomerAndValidationException() ] ); - /** @var \Magento\Framework\DataObject|\PHPUnit_Framework_MockObject_MockObject $objectMock */ - $objectMock = $this->getMockBuilder(\Magento\Framework\DataObject::class) + /** @var DataObject|MockObject $objectMock */ + $objectMock = $this->getMockBuilder(DataObject::class) ->disableOriginalConstructor() ->getMock(); $objectMock->expects($this->exactly(2)) @@ -756,7 +756,7 @@ public function testExecuteWithNewCustomerAndValidationException() ->willReturn($objectMock); $customerFormMock = $this->getMockBuilder( - \Magento\Customer\Model\Metadata\Form::class + Form::class )->disableOriginalConstructor()->getMock(); $customerFormMock->expects($this->exactly(2)) ->method('extractData') @@ -780,9 +780,9 @@ public function testExecuteWithNewCustomerAndValidationException() Form::DONT_IGNORE_INVISIBLE )->willReturn($customerFormMock); - /** @var CustomerInterface|\PHPUnit_Framework_MockObject_MockObject $customerMock */ + /** @var CustomerInterface|MockObject $customerMock */ $customerMock = $this->getMockBuilder( - \Magento\Customer\Api\Data\CustomerInterface::class + CustomerInterface::class )->disableOriginalConstructor()->getMock(); $this->customerDataFactoryMock->expects($this->once()) @@ -814,7 +814,7 @@ public function testExecuteWithNewCustomerAndValidationException() $this->messageManagerMock->expects($this->once()) ->method('addMessage') - ->with(new \Magento\Framework\Message\Error('Validator Exception')); + ->with(new Error('Validator Exception')); $this->sessionMock->expects($this->once()) ->method('setCustomerFormData') @@ -825,8 +825,8 @@ public function testExecuteWithNewCustomerAndValidationException() ] ); - /** @var Redirect|\PHPUnit_Framework_MockObject_MockObject $redirectMock */ - $redirectMock = $this->getMockBuilder(\Magento\Framework\Controller\Result\Redirect::class) + /** @var Redirect|MockObject $redirectMock */ + $redirectMock = $this->getMockBuilder(Redirect::class) ->disableOriginalConstructor() ->getMock(); @@ -864,9 +864,9 @@ public function testExecuteWithNewCustomerAndLocalizedException() 'dob' => '1996-03-12', ]; - /** @var AttributeMetadataInterface|\PHPUnit_Framework_MockObject_MockObject $customerFormMock */ + /** @var AttributeMetadataInterface|MockObject $customerFormMock */ $attributeMock = $this->getMockBuilder( - \Magento\Customer\Api\Data\AttributeMetadataInterface::class + AttributeMetadataInterface::class )->disableOriginalConstructor()->getMock(); $attributeMock->expects($this->exactly(2)) ->method('getAttributeCode') @@ -892,8 +892,8 @@ public function testExecuteWithNewCustomerAndLocalizedException() ] ); - /** @var \Magento\Framework\DataObject|\PHPUnit_Framework_MockObject_MockObject $objectMock */ - $objectMock = $this->getMockBuilder(\Magento\Framework\DataObject::class) + /** @var DataObject|MockObject $objectMock */ + $objectMock = $this->getMockBuilder(DataObject::class) ->disableOriginalConstructor() ->getMock(); $objectMock->expects($this->exactly(2)) @@ -906,9 +906,9 @@ public function testExecuteWithNewCustomerAndLocalizedException() ->with(['data' => $postValue]) ->willReturn($objectMock); - /** @var Form|\PHPUnit_Framework_MockObject_MockObject $formMock */ + /** @var Form|MockObject $formMock */ $customerFormMock = $this->getMockBuilder( - \Magento\Customer\Model\Metadata\Form::class + Form::class )->disableOriginalConstructor()->getMock(); $customerFormMock->expects($this->exactly(2)) ->method('extractData') @@ -933,7 +933,7 @@ public function testExecuteWithNewCustomerAndLocalizedException() )->willReturn($customerFormMock); $customerMock = $this->getMockBuilder( - \Magento\Customer\Api\Data\CustomerInterface::class + CustomerInterface::class )->disableOriginalConstructor()->getMock(); $this->customerDataFactoryMock->expects($this->once()) @@ -943,7 +943,7 @@ public function testExecuteWithNewCustomerAndLocalizedException() $this->managementMock->expects($this->once()) ->method('createAccount') ->with($customerMock, null, '') - ->willThrowException(new \Magento\Framework\Exception\LocalizedException(__('Localized Exception'))); + ->willThrowException(new LocalizedException(__('Localized Exception'))); $customerMock->expects($this->never()) ->method('getId'); @@ -965,7 +965,7 @@ public function testExecuteWithNewCustomerAndLocalizedException() $this->messageManagerMock->expects($this->once()) ->method('addMessage') - ->with(new \Magento\Framework\Message\Error('Localized Exception')); + ->with(new Error('Localized Exception')); $this->sessionMock->expects($this->once()) ->method('setCustomerFormData') @@ -976,8 +976,8 @@ public function testExecuteWithNewCustomerAndLocalizedException() ] ); - /** @var Redirect|\PHPUnit_Framework_MockObject_MockObject $redirectMock */ - $redirectMock = $this->getMockBuilder(\Magento\Framework\Controller\Result\Redirect::class) + /** @var Redirect|MockObject $redirectMock */ + $redirectMock = $this->getMockBuilder(Redirect::class) ->disableOriginalConstructor() ->getMock(); @@ -1015,9 +1015,9 @@ public function testExecuteWithNewCustomerAndException() 'dob' => '1996-03-12', ]; - /** @var AttributeMetadataInterface|\PHPUnit_Framework_MockObject_MockObject $customerFormMock */ + /** @var AttributeMetadataInterface|MockObject $customerFormMock */ $attributeMock = $this->getMockBuilder( - \Magento\Customer\Api\Data\AttributeMetadataInterface::class + AttributeMetadataInterface::class )->disableOriginalConstructor()->getMock(); $attributeMock->expects($this->exactly(2)) ->method('getAttributeCode') @@ -1043,8 +1043,8 @@ public function testExecuteWithNewCustomerAndException() ] ); - /** @var \Magento\Framework\DataObject|\PHPUnit_Framework_MockObject_MockObject $objectMock */ - $objectMock = $this->getMockBuilder(\Magento\Framework\DataObject::class) + /** @var DataObject|MockObject $objectMock */ + $objectMock = $this->getMockBuilder(DataObject::class) ->disableOriginalConstructor() ->getMock(); $objectMock->expects($this->exactly(2)) @@ -1058,7 +1058,7 @@ public function testExecuteWithNewCustomerAndException() ->willReturn($objectMock); $customerFormMock = $this->getMockBuilder( - \Magento\Customer\Model\Metadata\Form::class + Form::class )->disableOriginalConstructor()->getMock(); $customerFormMock->expects($this->exactly(2)) ->method('extractData') @@ -1082,9 +1082,9 @@ public function testExecuteWithNewCustomerAndException() Form::DONT_IGNORE_INVISIBLE )->willReturn($customerFormMock); - /** @var CustomerInterface|\PHPUnit_Framework_MockObject_MockObject $customerMock */ + /** @var CustomerInterface|MockObject $customerMock */ $customerMock = $this->getMockBuilder( - \Magento\Customer\Api\Data\CustomerInterface::class + CustomerInterface::class )->disableOriginalConstructor()->getMock(); $this->customerDataFactoryMock->expects($this->once()) @@ -1128,8 +1128,8 @@ public function testExecuteWithNewCustomerAndException() ] ); - /** @var Redirect|\PHPUnit_Framework_MockObject_MockObject $redirectMock */ - $redirectMock = $this->getMockBuilder(\Magento\Framework\Controller\Result\Redirect::class) + /** @var Redirect|MockObject $redirectMock */ + $redirectMock = $this->getMockBuilder(Redirect::class) ->disableOriginalConstructor() ->getMock(); diff --git a/app/code/Magento/Customer/view/adminhtml/templates/tab/newsletter.phtml b/app/code/Magento/Customer/view/adminhtml/templates/tab/newsletter.phtml index 12d4902fb1892..d8bcc59689fac 100644 --- a/app/code/Magento/Customer/view/adminhtml/templates/tab/newsletter.phtml +++ b/app/code/Magento/Customer/view/adminhtml/templates/tab/newsletter.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ ?> +<?php /** @var \Magento\Customer\Block\Adminhtml\Edit\Tab\Newsletter $block */ ?> <div class="entry-edit"> <?= $block->getForm()->getHtml() ?> </div> diff --git a/app/code/Magento/CustomerGraphQl/Model/Customer/ChangeSubscriptionStatus.php b/app/code/Magento/CustomerGraphQl/Model/Customer/ChangeSubscriptionStatus.php deleted file mode 100644 index 1acb418e7bba6..0000000000000 --- a/app/code/Magento/CustomerGraphQl/Model/Customer/ChangeSubscriptionStatus.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -namespace Magento\CustomerGraphQl\Model\Customer; - -use Magento\Newsletter\Model\SubscriberFactory; - -/** - * Change subscription status. Subscribe OR unsubscribe if required - */ -class ChangeSubscriptionStatus -{ - /** - * @var SubscriberFactory - */ - private $subscriberFactory; - - /** - * @param SubscriberFactory $subscriberFactory - */ - public function __construct( - SubscriberFactory $subscriberFactory - ) { - $this->subscriberFactory = $subscriberFactory; - } - - /** - * Change subscription status. Subscribe OR unsubscribe if required - * - * @param int $customerId - * @param bool $subscriptionStatus - * @return void - */ - public function execute(int $customerId, bool $subscriptionStatus): void - { - $subscriber = $this->subscriberFactory->create()->loadByCustomerId($customerId); - - if ($subscriptionStatus === true && !$subscriber->isSubscribed()) { - $this->subscriberFactory->create()->subscribeCustomerById($customerId); - } elseif ($subscriptionStatus === false && $subscriber->isSubscribed()) { - $this->subscriberFactory->create()->unsubscribeCustomerById($customerId); - } - } -} diff --git a/app/code/Magento/CustomerGraphQl/Model/Customer/CreateCustomerAccount.php b/app/code/Magento/CustomerGraphQl/Model/Customer/CreateCustomerAccount.php index 969c205329f2b..a631b7ba86194 100644 --- a/app/code/Magento/CustomerGraphQl/Model/Customer/CreateCustomerAccount.php +++ b/app/code/Magento/CustomerGraphQl/Model/Customer/CreateCustomerAccount.php @@ -14,6 +14,7 @@ use Magento\Framework\Exception\LocalizedException; use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\Reflection\DataObjectProcessor; +use Magento\Newsletter\Model\SubscriptionManagerInterface; use Magento\Store\Api\Data\StoreInterface; /** @@ -36,11 +37,6 @@ class CreateCustomerAccount */ private $accountManagement; - /** - * @var ChangeSubscriptionStatus - */ - private $changeSubscriptionStatus; - /** * @var ValidateCustomerData */ @@ -51,30 +47,35 @@ class CreateCustomerAccount */ private $dataObjectProcessor; + /** + * @var SubscriptionManagerInterface + */ + private $subscriptionManager; + /** * CreateCustomerAccount constructor. * * @param DataObjectHelper $dataObjectHelper * @param CustomerInterfaceFactory $customerFactory * @param AccountManagementInterface $accountManagement - * @param ChangeSubscriptionStatus $changeSubscriptionStatus * @param DataObjectProcessor $dataObjectProcessor * @param ValidateCustomerData $validateCustomerData + * @param SubscriptionManagerInterface $subscriptionManager */ public function __construct( DataObjectHelper $dataObjectHelper, CustomerInterfaceFactory $customerFactory, AccountManagementInterface $accountManagement, - ChangeSubscriptionStatus $changeSubscriptionStatus, DataObjectProcessor $dataObjectProcessor, - ValidateCustomerData $validateCustomerData + ValidateCustomerData $validateCustomerData, + SubscriptionManagerInterface $subscriptionManager ) { $this->dataObjectHelper = $dataObjectHelper; $this->customerFactory = $customerFactory; $this->accountManagement = $accountManagement; - $this->changeSubscriptionStatus = $changeSubscriptionStatus; $this->validateCustomerData = $validateCustomerData; $this->dataObjectProcessor = $dataObjectProcessor; + $this->subscriptionManager = $subscriptionManager; } /** @@ -94,7 +95,11 @@ public function execute(array $data, StoreInterface $store): CustomerInterface } if (isset($data['is_subscribed'])) { - $this->changeSubscriptionStatus->execute((int)$customer->getId(), (bool)$data['is_subscribed']); + if ((bool)$data['is_subscribed']) { + $this->subscriptionManager->subscribeCustomer((int)$customer->getId(), (int)$store->getId()); + } else { + $this->subscriptionManager->unsubscribeCustomer((int)$customer->getId(), (int)$store->getId()); + } } return $customer; } diff --git a/app/code/Magento/CustomerGraphQl/Model/Customer/UpdateCustomerAccount.php b/app/code/Magento/CustomerGraphQl/Model/Customer/UpdateCustomerAccount.php index f7bf26513dc2e..d82b8c6f941fa 100644 --- a/app/code/Magento/CustomerGraphQl/Model/Customer/UpdateCustomerAccount.php +++ b/app/code/Magento/CustomerGraphQl/Model/Customer/UpdateCustomerAccount.php @@ -14,6 +14,7 @@ use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\GraphQl\Exception\GraphQlNoSuchEntityException; use Magento\Framework\Api\DataObjectHelper; +use Magento\Newsletter\Model\SubscriptionManagerInterface; use Magento\Store\Api\Data\StoreInterface; /** @@ -38,11 +39,6 @@ class UpdateCustomerAccount */ private $dataObjectHelper; - /** - * @var ChangeSubscriptionStatus - */ - private $changeSubscriptionStatus; - /** * @var ValidateCustomerData */ @@ -53,28 +49,33 @@ class UpdateCustomerAccount */ private $restrictedKeys; + /** + * @var SubscriptionManagerInterface + */ + private $subscriptionManager; + /** * @param SaveCustomer $saveCustomer * @param CheckCustomerPassword $checkCustomerPassword * @param DataObjectHelper $dataObjectHelper - * @param ChangeSubscriptionStatus $changeSubscriptionStatus * @param ValidateCustomerData $validateCustomerData + * @param SubscriptionManagerInterface $subscriptionManager * @param array $restrictedKeys */ public function __construct( SaveCustomer $saveCustomer, CheckCustomerPassword $checkCustomerPassword, DataObjectHelper $dataObjectHelper, - ChangeSubscriptionStatus $changeSubscriptionStatus, ValidateCustomerData $validateCustomerData, + SubscriptionManagerInterface $subscriptionManager, array $restrictedKeys = [] ) { $this->saveCustomer = $saveCustomer; $this->checkCustomerPassword = $checkCustomerPassword; $this->dataObjectHelper = $dataObjectHelper; $this->restrictedKeys = $restrictedKeys; - $this->changeSubscriptionStatus = $changeSubscriptionStatus; $this->validateCustomerData = $validateCustomerData; + $this->subscriptionManager = $subscriptionManager; } /** @@ -112,7 +113,11 @@ public function execute(CustomerInterface $customer, array $data, StoreInterface $this->saveCustomer->execute($customer); if (isset($data['is_subscribed'])) { - $this->changeSubscriptionStatus->execute((int)$customer->getId(), (bool)$data['is_subscribed']); + if ((bool)$data['is_subscribed']) { + $this->subscriptionManager->subscribeCustomer((int)$customer->getId(), (int)$store->getId()); + } else { + $this->subscriptionManager->unsubscribeCustomer((int)$customer->getId(), (int)$store->getId()); + } } } } diff --git a/app/code/Magento/Newsletter/Controller/Manage/Save.php b/app/code/Magento/Newsletter/Controller/Manage/Save.php index d7d511e2d1906..01012e39a992a 100644 --- a/app/code/Magento/Newsletter/Controller/Manage/Save.php +++ b/app/code/Magento/Newsletter/Controller/Manage/Save.php @@ -12,6 +12,7 @@ use Magento\Framework\App\Action\HttpGetActionInterface; use Magento\Framework\App\Action\HttpPostActionInterface; use Magento\Newsletter\Model\Subscriber; +use Magento\Newsletter\Model\SubscriptionManagerInterface; /** * Customers newsletter subscription save controller @@ -34,9 +35,9 @@ class Save extends \Magento\Newsletter\Controller\Manage implements HttpPostActi protected $customerRepository; /** - * @var \Magento\Newsletter\Model\SubscriberFactory + * @var SubscriptionManagerInterface */ - protected $subscriberFactory; + private $subscriptionManager; /** * Initialize dependencies. @@ -46,7 +47,7 @@ class Save extends \Magento\Newsletter\Controller\Manage implements HttpPostActi * @param \Magento\Framework\Data\Form\FormKey\Validator $formKeyValidator * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param CustomerRepository $customerRepository - * @param \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory + * @param SubscriptionManagerInterface $subscriptionManager */ public function __construct( \Magento\Framework\App\Action\Context $context, @@ -54,13 +55,13 @@ public function __construct( \Magento\Framework\Data\Form\FormKey\Validator $formKeyValidator, \Magento\Store\Model\StoreManagerInterface $storeManager, CustomerRepository $customerRepository, - \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory + SubscriptionManagerInterface $subscriptionManager ) { $this->storeManager = $storeManager; $this->formKeyValidator = $formKeyValidator; $this->customerRepository = $customerRepository; - $this->subscriberFactory = $subscriberFactory; parent::__construct($context, $customerSession); + $this->subscriptionManager = $subscriptionManager; } /** @@ -80,28 +81,24 @@ public function execute() } else { try { $customer = $this->customerRepository->getById($customerId); - $storeId = $this->storeManager->getStore()->getId(); + $storeId = (int)$this->storeManager->getStore()->getId(); $customer->setStoreId($storeId); - $isSubscribedState = $customer->getExtensionAttributes() - ->getIsSubscribed(); - $isSubscribedParam = (boolean)$this->getRequest() - ->getParam('is_subscribed', false); + $isSubscribedState = $customer->getExtensionAttributes()->getIsSubscribed(); + $isSubscribedParam = (boolean)$this->getRequest()->getParam('is_subscribed', false); if ($isSubscribedParam !== $isSubscribedState) { // No need to validate customer and customer address while saving subscription preferences $this->setIgnoreValidationFlag($customer); $this->customerRepository->save($customer); if ($isSubscribedParam) { - $subscribeModel = $this->subscriberFactory->create() - ->subscribeCustomerById($customerId); - $subscribeStatus = $subscribeModel->getStatus(); - if ($subscribeStatus == Subscriber::STATUS_SUBSCRIBED) { + $subscribeModel = $this->subscriptionManager->subscribeCustomer((int)$customerId, $storeId); + $subscribeStatus = (int)$subscribeModel->getStatus(); + if ($subscribeStatus === Subscriber::STATUS_SUBSCRIBED) { $this->messageManager->addSuccess(__('We have saved your subscription.')); } else { $this->messageManager->addSuccess(__('A confirmation request has been sent.')); } } else { - $this->subscriberFactory->create() - ->unsubscribeCustomerById($customerId); + $this->subscriptionManager->unsubscribeCustomer((int)$customerId, $storeId); $this->messageManager->addSuccess(__('We have removed your newsletter subscription.')); } } else { diff --git a/app/code/Magento/Newsletter/Controller/Subscriber/NewAction.php b/app/code/Magento/Newsletter/Controller/Subscriber/NewAction.php index 7557f1610b4f4..ea52ae8aaa864 100644 --- a/app/code/Magento/Newsletter/Controller/Subscriber/NewAction.php +++ b/app/code/Magento/Newsletter/Controller/Subscriber/NewAction.php @@ -4,7 +4,6 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ - namespace Magento\Newsletter\Controller\Subscriber; use Magento\Customer\Api\AccountManagementInterface as CustomerAccountManagement; @@ -14,11 +13,14 @@ use Magento\Framework\App\Action\HttpPostActionInterface; use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\App\ObjectManager; +use Magento\Framework\Controller\Result\Redirect; +use Magento\Framework\Controller\ResultFactory; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Phrase; use Magento\Framework\Validator\EmailAddress as EmailValidator; use Magento\Newsletter\Controller\Subscriber as SubscriberController; use Magento\Newsletter\Model\Subscriber; +use Magento\Newsletter\Model\SubscriptionManagerInterface; use Magento\Store\Model\ScopeInterface; use Magento\Store\Model\StoreManagerInterface; use Magento\Newsletter\Model\SubscriberFactory; @@ -40,6 +42,11 @@ class NewAction extends SubscriberController implements HttpPostActionInterface */ private $emailValidator; + /** + * @var SubscriptionManagerInterface + */ + private $subscriptionManager; + /** * Initialize dependencies. * @@ -49,6 +56,7 @@ class NewAction extends SubscriberController implements HttpPostActionInterface * @param StoreManagerInterface $storeManager * @param CustomerUrl $customerUrl * @param CustomerAccountManagement $customerAccountManagement + * @param SubscriptionManagerInterface $subscriptionManager * @param EmailValidator $emailValidator */ public function __construct( @@ -58,9 +66,11 @@ public function __construct( StoreManagerInterface $storeManager, CustomerUrl $customerUrl, CustomerAccountManagement $customerAccountManagement, + SubscriptionManagerInterface $subscriptionManager, EmailValidator $emailValidator = null ) { $this->customerAccountManagement = $customerAccountManagement; + $this->subscriptionManager = $subscriptionManager; $this->emailValidator = $emailValidator ?: ObjectManager::getInstance()->get(EmailValidator::class); parent::__construct( $context, @@ -132,7 +142,7 @@ protected function validateEmailFormat($email) /** * New subscription action * - * @return \Magento\Framework\Controller\Result\Redirect + * @return Redirect */ public function execute() { @@ -144,29 +154,55 @@ public function execute() $this->validateGuestSubscription(); $this->validateEmailAvailable($email); - $subscriber = $this->_subscriberFactory->create()->loadByEmail($email); + $websiteId = (int)$this->_storeManager->getStore()->getWebsiteId(); + /** @var Subscriber $subscriber */ + $subscriber = $this->_subscriberFactory->create()->loadBySubscriberEmail($email, $websiteId); if ($subscriber->getId() - && (int) $subscriber->getSubscriberStatus() === Subscriber::STATUS_SUBSCRIBED - ) { + && (int)$subscriber->getSubscriberStatus() === Subscriber::STATUS_SUBSCRIBED) { throw new LocalizedException( __('This email address is already subscribed.') ); } - $status = (int) $this->_subscriberFactory->create()->subscribe($email); - $this->messageManager->addSuccessMessage($this->getSuccessMessage($status)); + $storeId = (int)$this->_storeManager->getStore()->getId(); + $currentCustomerId = $this->getSessionCustomerId($email); + $subscriber = $currentCustomerId + ? $this->subscriptionManager->subscribeCustomer($currentCustomerId, $storeId) + : $this->subscriptionManager->subscribe($email, $storeId); + $message = $this->getSuccessMessage((int)$subscriber->getSubscriberStatus()); + $this->messageManager->addSuccessMessage($message); } catch (LocalizedException $e) { $this->messageManager->addErrorMessage($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addExceptionMessage($e, __('Something went wrong with the subscription.')); } } - /** @var \Magento\Framework\Controller\Result\Redirect $redirect */ - $redirect = $this->resultFactory->create(\Magento\Framework\Controller\ResultFactory::TYPE_REDIRECT); + /** @var Redirect $redirect */ + $redirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT); $redirectUrl = $this->_redirect->getRedirectUrl(); return $redirect->setUrl($redirectUrl); } + /** + * Get customer id from session if he is owner of the email + * + * @param string $email + * @return int|null + */ + private function getSessionCustomerId(string $email): ?int + { + if (!$this->_customerSession->isLoggedIn()) { + return null; + } + + $customer = $this->_customerSession->getCustomerDataObject(); + if ($customer->getEmail() !== $email) { + return null; + } + + return (int)$this->_customerSession->getId(); + } + /** * Get success message * diff --git a/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php b/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php index 309bfadab41b3..59e67e7aa32a7 100644 --- a/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php +++ b/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php @@ -5,12 +5,19 @@ */ namespace Magento\Newsletter\Model\Plugin; -use Magento\Customer\Api\CustomerRepositoryInterface as CustomerRepository; +use Magento\Customer\Api\CustomerRepositoryInterface; use Magento\Customer\Api\Data\CustomerInterface; -use Magento\Newsletter\Model\SubscriberFactory; +use Magento\Customer\Model\Config\Share; use Magento\Framework\Api\ExtensionAttributesFactory; -use Magento\Newsletter\Model\ResourceModel\Subscriber; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Newsletter\Model\Subscriber; +use Magento\Newsletter\Model\ResourceModel\Subscriber\CollectionFactory; use Magento\Customer\Api\Data\CustomerExtensionInterface; +use Magento\Newsletter\Model\SubscriberFactory; +use Magento\Newsletter\Model\SubscriptionManagerInterface; +use Magento\Store\Model\Store; +use Magento\Store\Model\StoreManagerInterface; +use Psr\Log\LoggerInterface; /** * Newsletter Plugin for customer @@ -18,42 +25,70 @@ class CustomerPlugin { /** - * Factory used for manipulating newsletter subscriptions - * - * @var SubscriberFactory + * @var ExtensionAttributesFactory */ - private $subscriberFactory; + private $extensionFactory; /** - * @var ExtensionAttributesFactory + * @var CollectionFactory */ - private $extensionFactory; + private $collectionFactory; + + /** + * @var SubscriptionManagerInterface + */ + private $subscriptionManager; /** - * @var Subscriber + * @var Share */ - private $subscriberResource; + private $shareConfig; + + /** + * @var StoreManagerInterface + */ + private $storeManager; /** * @var array */ - private $customerSubscriptionStatus = []; + private $customerSubscriber = []; + + /** + * @var SubscriberFactory + */ + private $subscriberFactory; + + /** + * @var LoggerInterface + */ + private $logger; /** - * Initialize dependencies. - * * @param SubscriberFactory $subscriberFactory * @param ExtensionAttributesFactory $extensionFactory - * @param Subscriber $subscriberResource + * @param CollectionFactory $collectionFactory + * @param SubscriptionManagerInterface $subscriptionManager + * @param Share $shareConfig + * @param StoreManagerInterface $storeManager + * @param LoggerInterface $logger */ public function __construct( SubscriberFactory $subscriberFactory, ExtensionAttributesFactory $extensionFactory, - Subscriber $subscriberResource + CollectionFactory $collectionFactory, + SubscriptionManagerInterface $subscriptionManager, + Share $shareConfig, + StoreManagerInterface $storeManager, + LoggerInterface $logger ) { $this->subscriberFactory = $subscriberFactory; $this->extensionFactory = $extensionFactory; - $this->subscriberResource = $subscriberResource; + $this->collectionFactory = $collectionFactory; + $this->subscriptionManager = $subscriptionManager; + $this->shareConfig = $shareConfig; + $this->storeManager = $storeManager; + $this->logger = $logger; } /** @@ -61,128 +96,228 @@ public function __construct( * * If we have extension attribute (is_subscribed) we need to subscribe that customer * - * @param CustomerRepository $subject + * @param CustomerRepositoryInterface $subject * @param CustomerInterface $result * @param CustomerInterface $customer * @return CustomerInterface * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function afterSave(CustomerRepository $subject, CustomerInterface $result, CustomerInterface $customer) - { - $resultId = $result->getId(); - /** @var \Magento\Newsletter\Model\Subscriber $subscriber */ - $subscriber = $this->subscriberFactory->create(); + public function afterSave( + CustomerRepositoryInterface $subject, + CustomerInterface $result, + CustomerInterface $customer + ) { + $subscriber = $this->getSubscriber($result); + $subscribeStatus = $this->getIsSubscribedFromExtensionAttr($customer) ?? $subscriber->isSubscribed(); + $needToUpdate = $this->isSubscriptionChanged($result, $subscriber, $subscribeStatus); - $subscriber->updateSubscription($resultId); - // update the result only if the original customer instance had different value. - $initialExtensionAttributes = $result->getExtensionAttributes(); - if ($initialExtensionAttributes === null) { - /** @var CustomerExtensionInterface $initialExtensionAttributes */ - $initialExtensionAttributes = $this->extensionFactory->create(CustomerInterface::class); - $result->setExtensionAttributes($initialExtensionAttributes); + /** + * If subscriber is waiting to confirm customer registration + * and customer is already confirmed registration + * than need to subscribe customer + */ + if ($subscriber->getStatus() === Subscriber::STATUS_UNCONFIRMED && empty($result->getConfirmation())) { + $needToUpdate = true; + $subscribeStatus = true; } + if ($needToUpdate) { + $storeId = $this->getCurrentStoreId($result); + $subscriber = $subscribeStatus + ? $this->subscriptionManager->subscribeCustomer((int)$result->getId(), $storeId) + : $this->subscriptionManager->unsubscribeCustomer((int)$result->getId(), $storeId); + $this->customerSubscriber[(int)$result->getId()] = $subscriber; + } + $this->addIsSubscribedExtensionAttr($result, $subscriber->isSubscribed()); + + return $result; + } + /** + * Get subscription status from extension customer attribute + * + * @param CustomerInterface $customer + * @return bool|null + */ + private function getIsSubscribedFromExtensionAttr(CustomerInterface $customer): ?bool + { $newExtensionAttributes = $customer->getExtensionAttributes(); - if ($newExtensionAttributes - && $initialExtensionAttributes->getIsSubscribed() !== $newExtensionAttributes->getIsSubscribed() - ) { - if ($newExtensionAttributes->getIsSubscribed()) { - $subscriber->subscribeCustomerById($resultId); - } else { - $subscriber->unsubscribeCustomerById($resultId); - } + if ($newExtensionAttributes === null || $newExtensionAttributes->getIsSubscribed() === null) { + return null; } - $isSubscribed = $subscriber->isSubscribed(); - $this->customerSubscriptionStatus[$resultId] = $isSubscribed; - $initialExtensionAttributes->setIsSubscribed($isSubscribed); + return (bool)$newExtensionAttributes->getIsSubscribed(); + } - return $result; + /** + * Get is customer subscription changed + * + * @param CustomerInterface $customer + * @param Subscriber $subscriber + * @param bool $newStatus + * @return bool + */ + private function isSubscriptionChanged(CustomerInterface $customer, Subscriber $subscriber, bool $newStatus): bool + { + if ($subscriber->isSubscribed() !== $newStatus) { + return true; + } + + if (!$subscriber->getId()) { + return false; + } + + /** + * If customer has changed email or subscriber was loaded by email + * than need to update customer subscription + */ + return $customer->getEmail() !== $subscriber->getEmail() || (int)$subscriber->getCustomerId() === 0; } /** * Plugin around delete customer that updates any newsletter subscription that may have existed. * - * @param CustomerRepository $subject + * @param CustomerRepositoryInterface $subject * @param callable $deleteCustomerById Function we are wrapping around * @param int $customerId Input to the function * @return bool */ public function aroundDeleteById( - CustomerRepository $subject, + CustomerRepositoryInterface $subject, callable $deleteCustomerById, $customerId ) { $customer = $subject->getById($customerId); $result = $deleteCustomerById($customerId); - /** @var \Magento\Newsletter\Model\Subscriber $subscriber */ - $subscriber = $this->subscriberFactory->create(); - $subscriber->loadByEmail($customer->getEmail()); - if ($subscriber->getId()) { - $subscriber->delete(); - } + $this->deleteSubscriptionsAfterCustomerDelete($customer); + return $result; } /** * Plugin after delete customer that updates any newsletter subscription that may have existed. * - * @param CustomerRepository $subject + * @param CustomerRepositoryInterface $subject * @param bool $result * @param CustomerInterface $customer * @return bool * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function afterDelete(CustomerRepository $subject, $result, CustomerInterface $customer) + public function afterDelete(CustomerRepositoryInterface $subject, $result, CustomerInterface $customer) { - $subscriber = $this->subscriberFactory->create(); - $subscriber->loadByEmail($customer->getEmail()); - if ($subscriber->getId()) { - $subscriber->delete(); - } + $this->deleteSubscriptionsAfterCustomerDelete($customer); return $result; } /** * Plugin after getById customer that obtains newsletter subscription status for given customer. * - * @param CustomerRepository $subject + * @param CustomerRepositoryInterface $subject * @param CustomerInterface $customer * @return CustomerInterface * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function afterGetById(CustomerRepository $subject, CustomerInterface $customer) + public function afterGetById(CustomerRepositoryInterface $subject, CustomerInterface $customer) { - $extensionAttributes = $customer->getExtensionAttributes(); + $isSubscribed = $this->getSubscriber($customer)->isSubscribed(); + $this->addIsSubscribedExtensionAttr($customer, $isSubscribed); + + return $customer; + } + /** + * Set Is Subscribed extension attribute + * + * @param CustomerInterface $customer + * @param bool $isSubscribed + */ + private function addIsSubscribedExtensionAttr(CustomerInterface $customer, bool $isSubscribed): void + { + $extensionAttributes = $customer->getExtensionAttributes(); if ($extensionAttributes === null) { /** @var CustomerExtensionInterface $extensionAttributes */ $extensionAttributes = $this->extensionFactory->create(CustomerInterface::class); $customer->setExtensionAttributes($extensionAttributes); } - if ($extensionAttributes->getIsSubscribed() === null) { - $isSubscribed = $this->isSubscribed($customer); - $extensionAttributes->setIsSubscribed($isSubscribed); + $extensionAttributes->setIsSubscribed($isSubscribed); + } + + /** + * Delete customer subscriptions + * + * @param CustomerInterface $customer + * @return void + */ + private function deleteSubscriptionsAfterCustomerDelete(CustomerInterface $customer): void + { + $collection = $this->collectionFactory->create(); + $collection->addFieldToFilter('subscriber_email', $customer->getEmail()); + if ($this->shareConfig->isWebsiteScope()) { + try { + $storeIds = $this->storeManager->getWebsite($customer->getWebsiteId())->getStoreIds(); + $collection->addFieldToFilter('store_id', ['in' => $storeIds]); + } catch (NoSuchEntityException $exception) { + $this->logger->error($exception); + } + } + /** @var Subscriber $subscriber */ + foreach ($collection as $subscriber) { + $subscriber->delete(); } + } - return $customer; + /** + * Get Subscriber model by customer + * + * @param CustomerInterface $customer + * @return Subscriber + */ + private function getSubscriber(CustomerInterface $customer): Subscriber + { + $customerId = (int)$customer->getId(); + if (isset($this->customerSubscriber[$customerId])) { + return $this->customerSubscriber[$customerId]; + } + + /** @var Subscriber $subscriber */ + $subscriber = $this->subscriberFactory->create(); + $websiteId = $this->getCurrentWebsiteId($customer); + $subscriber->loadByCustomer((int)$customer->getId(), $websiteId); + /** + * If subscriber was't found by customer id then try to find subscriber by customer email. + * It need when the customer is creating and he has already subscribed as guest by same email. + */ + if (!$subscriber->getId()) { + $subscriber->loadBySubscriberEmail((string)$customer->getEmail(), $websiteId); + } + $this->customerSubscriber[$customerId] = $subscriber; + + return $subscriber; } /** - * This method returns newsletters subscription status for given customer. + * Retrieve current website id * * @param CustomerInterface $customer - * @return bool + * @return int + */ + private function getCurrentWebsiteId(CustomerInterface $customer): int + { + return (int)$this->storeManager->getStore($this->getCurrentStoreId($customer))->getWebsiteId(); + } + + /** + * Retrieve current store id + * + * @param CustomerInterface $customer + * @return int */ - private function isSubscribed(CustomerInterface $customer) + private function getCurrentStoreId(CustomerInterface $customer): int { - $customerId = $customer->getId(); - if (!isset($this->customerSubscriptionStatus[$customerId])) { - $subscriber = $this->subscriberResource->loadByCustomerData($customer); - $this->customerSubscriptionStatus[$customerId] = isset($subscriber['subscriber_status']) - && $subscriber['subscriber_status'] == 1; + $storeId = (int)$this->storeManager->getStore()->getId(); + if ($storeId === Store::DEFAULT_STORE_ID) { + $storeId = (int)$customer->getStoreId(); } - return $this->customerSubscriptionStatus[$customerId]; + return $storeId; } } diff --git a/app/code/Magento/Newsletter/Model/ResourceModel/Queue/Collection.php b/app/code/Magento/Newsletter/Model/ResourceModel/Queue/Collection.php index 52009dad6614b..1fc68771e74cb 100644 --- a/app/code/Magento/Newsletter/Model/ResourceModel/Queue/Collection.php +++ b/app/code/Magento/Newsletter/Model/ResourceModel/Queue/Collection.php @@ -208,6 +208,31 @@ public function addSubscriberFilter($subscriberId) return $this; } + /** + * Set filter for queue by customer + * + * @param int $customerId + * @return $this + */ + public function addCustomerFilter(int $customerId): self + { + $this->getSelect() + ->join( + ['link' => $this->getTable('newsletter_queue_link')], + 'main_table.queue_id=link.queue_id', + ['letter_sent_at'] + )->join( + ['subscriber' => $this->getTable('newsletter_subscriber')], + 'link.subscriber_id=subscriber.subscriber_id', + ['subscriber_store_id' => 'subscriber.store_id'] + )->where( + 'subscriber.customer_id = ?', + $customerId + ); + + return $this; + } + /** * Add filter by only ready for sending item * diff --git a/app/code/Magento/Newsletter/Model/ResourceModel/Subscriber.php b/app/code/Magento/Newsletter/Model/ResourceModel/Subscriber.php index 8ca489d89c1df..6391219e23c7e 100644 --- a/app/code/Magento/Newsletter/Model/ResourceModel/Subscriber.php +++ b/app/code/Magento/Newsletter/Model/ResourceModel/Subscriber.php @@ -5,23 +5,30 @@ */ namespace Magento\Newsletter\Model\ResourceModel; +use Magento\Customer\Api\Data\CustomerInterface; use Magento\Framework\App\ObjectManager; +use Magento\Framework\DB\Adapter\AdapterInterface; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Math\Random; +use Magento\Framework\Model\ResourceModel\Db\AbstractDb; +use Magento\Framework\Model\ResourceModel\Db\Context; +use Magento\Framework\Stdlib\DateTime\DateTime; +use Magento\Newsletter\Model\Subscriber as SubscriberModel; use Magento\Store\Model\StoreManagerInterface; /** * Newsletter subscriber resource model * - * @author Magento Core Team <core@magentocommerce.com> - * + * @author Magento Core Team <core@magentocommerce.com> * @api * @since 100.0.2 */ -class Subscriber extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb +class Subscriber extends AbstractDb { /** * DB connection * - * @var \Magento\Framework\DB\Adapter\AdapterInterface + * @var AdapterInterface */ protected $connection; @@ -42,12 +49,12 @@ class Subscriber extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb /** * Date * - * @var \Magento\Framework\Stdlib\DateTime\DateTime + * @var DateTime */ protected $_date; /** - * @var \Magento\Framework\Math\Random + * @var Random */ protected $mathRandom; @@ -61,16 +68,16 @@ class Subscriber extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb /** * Construct * - * @param \Magento\Framework\Model\ResourceModel\Db\Context $context - * @param \Magento\Framework\Stdlib\DateTime\DateTime $date - * @param \Magento\Framework\Math\Random $mathRandom + * @param Context $context + * @param DateTime $date + * @param Random $mathRandom * @param string $connectionName * @param StoreManagerInterface $storeManager */ public function __construct( - \Magento\Framework\Model\ResourceModel\Db\Context $context, - \Magento\Framework\Stdlib\DateTime\DateTime $date, - \Magento\Framework\Math\Random $mathRandom, + Context $context, + DateTime $date, + Random $mathRandom, $connectionName = null, StoreManagerInterface $storeManager = null ) { @@ -104,65 +111,51 @@ public function setMessagesScope($scope) } /** - * Load subscriber from DB by email + * Load by subscriber email * - * @param string $subscriberEmail + * @param string $email + * @param int $websiteId * @return array */ - public function loadByEmail($subscriberEmail) + public function loadBySubscriberEmail(string $email, int $websiteId): array { - $select = $this->connection->select()->from($this->getMainTable())->where('subscriber_email=:subscriber_email'); - - $result = $this->connection->fetchRow($select, ['subscriber_email' => $subscriberEmail]); - - if (!$result) { + $storeIds = $this->storeManager->getWebsite($websiteId)->getStoreIds(); + $select = $this->connection->select() + ->from($this->getMainTable()) + ->where('subscriber_email = ?', $email) + ->where('store_id IN (?)', $storeIds) + ->limit(1); + + $data = $this->connection->fetchRow($select); + if (!$data) { return []; } - return $result; + return $data; } /** - * Load subscriber by customer + * Load by customer id * - * @param \Magento\Customer\Api\Data\CustomerInterface $customer + * @param int $customerId + * @param int $websiteId * @return array */ - public function loadByCustomerData(\Magento\Customer\Api\Data\CustomerInterface $customer) + public function loadByCustomerId(int $customerId, int $websiteId): array { - $storeIds = $this->storeManager->getWebsite()->getStoreIds(); - - if ($customer->getId()) { - $select = $this->connection - ->select() - ->from($this->getMainTable()) - ->where('customer_id = ?', $customer->getId()) - ->where('store_id IN (?)', $storeIds) - ->limit(1); - - $result = $this->connection->fetchRow($select); - - if ($result) { - return $result; - } - } - - if ($customer->getEmail()) { - $select = $this->connection - ->select() - ->from($this->getMainTable()) - ->where('subscriber_email = ?', $customer->getEmail()) - ->where('store_id IN (?)', $storeIds) - ->limit(1); - - $result = $this->connection->fetchRow($select); - - if ($result) { - return $result; - } + $storeIds = $this->storeManager->getWebsite($websiteId)->getStoreIds(); + $select = $this->connection->select() + ->from($this->getMainTable()) + ->where('customer_id = ?', $customerId) + ->where('store_id IN (?)', $storeIds) + ->limit(1); + + $data = $this->connection->fetchRow($select); + if (!$data) { + return []; } - return []; + return $data; } /** @@ -178,12 +171,12 @@ protected function _generateRandomCode() /** * Updates data when subscriber received * - * @param \Magento\Newsletter\Model\Subscriber $subscriber + * @param SubscriberModel $subscriber * @param \Magento\Newsletter\Model\Queue $queue * @return $this - * @throws \Magento\Framework\Exception\LocalizedException + * @throws LocalizedException */ - public function received(\Magento\Newsletter\Model\Subscriber $subscriber, \Magento\Newsletter\Model\Queue $queue) + public function received(SubscriberModel $subscriber, \Magento\Newsletter\Model\Queue $queue) { $this->connection->beginTransaction(); try { @@ -196,8 +189,41 @@ public function received(\Magento\Newsletter\Model\Subscriber $subscriber, \Mage $this->connection->commit(); } catch (\Exception $e) { $this->connection->rollBack(); - throw new \Magento\Framework\Exception\LocalizedException(__('We cannot mark as received subscriber.')); + throw new LocalizedException(__('We cannot mark as received subscriber.')); } return $this; } + + /** + * Load subscriber from DB by email + * + * @param string $subscriberEmail + * @return array + * @deprecated The subscription should be loaded by website id + * @see loadBySubscriberEmail + */ + public function loadByEmail($subscriberEmail) + { + $websiteId = (int)$this->storeManager->getWebsite()->getId(); + return $this->loadBySubscriberEmail((string)$subscriberEmail, $websiteId); + } + + /** + * Load subscriber by customer + * + * @param CustomerInterface $customer + * @return array + * @deprecated The subscription should be loaded by website id + * @see loadByCustomerId + */ + public function loadByCustomerData(CustomerInterface $customer) + { + $websiteId = (int)$this->storeManager->getWebsite()->getId(); + $data = $this->loadByCustomerId((int)$customer->getId(), $websiteId); + if (empty($data)) { + $data = $this->loadBySubscriberEmail((string)$customer->getEmail(), $websiteId); + } + + return $data; + } } diff --git a/app/code/Magento/Newsletter/Model/Subscriber.php b/app/code/Magento/Newsletter/Model/Subscriber.php index 5df9feacf654b..f33b9929435c3 100644 --- a/app/code/Magento/Newsletter/Model/Subscriber.php +++ b/app/code/Magento/Newsletter/Model/Subscriber.php @@ -9,9 +9,23 @@ use Magento\Customer\Api\CustomerRepositoryInterface; use Magento\Customer\Api\Data\CustomerInterfaceFactory; use Magento\Framework\Api\DataObjectHelper; +use Magento\Framework\App\Area; +use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\App\ObjectManager; -use Magento\Framework\Exception\MailException; +use Magento\Framework\Data\Collection\AbstractDb; +use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Mail\Template\TransportBuilder; +use Magento\Framework\Math\Random; +use Magento\Framework\Model\AbstractModel; +use Magento\Framework\Model\Context; +use Magento\Framework\Model\ResourceModel\AbstractResource; +use Magento\Framework\Registry; +use Magento\Framework\Stdlib\DateTime\DateTime; +use Magento\Framework\Translate\Inline\StateInterface; +use Magento\Newsletter\Helper\Data; +use Magento\Store\Model\ScopeInterface; +use Magento\Store\Model\StoreManagerInterface; /** * Subscriber model @@ -33,12 +47,11 @@ * * @SuppressWarnings(PHPMD.CookieAndSessionMisuse) * @SuppressWarnings(PHPMD.CouplingBetweenObjects) - * @SuppressWarnings(PHPMD.CyclomaticComplexity) * * @api * @since 100.0.2 */ -class Subscriber extends \Magento\Framework\Model\AbstractModel +class Subscriber extends AbstractModel { const STATUS_SUBSCRIBED = 1; const STATUS_NOT_ACTIVE = 2; @@ -80,14 +93,14 @@ class Subscriber extends \Magento\Framework\Model\AbstractModel /** * Newsletter data * - * @var \Magento\Newsletter\Helper\Data + * @var Data */ protected $_newsletterData = null; /** * Core store config * - * @var \Magento\Framework\App\Config\ScopeConfigInterface + * @var ScopeConfigInterface */ protected $_scopeConfig; @@ -100,14 +113,14 @@ class Subscriber extends \Magento\Framework\Model\AbstractModel /** * Date - * @var \Magento\Framework\Stdlib\DateTime\DateTime + * @var DateTime */ private $dateTime; /** * Store manager * - * @var \Magento\Store\Model\StoreManagerInterface + * @var StoreManagerInterface */ protected $_storeManager; @@ -122,12 +135,12 @@ class Subscriber extends \Magento\Framework\Model\AbstractModel protected $customerAccountManagement; /** - * @var \Magento\Framework\Mail\Template\TransportBuilder + * @var TransportBuilder */ protected $_transportBuilder; /** - * @var \Magento\Framework\Translate\Inline\StateInterface + * @var StateInterface */ protected $inlineTranslation; @@ -142,51 +155,56 @@ class Subscriber extends \Magento\Framework\Model\AbstractModel private $dataObjectHelper; /** - * Initialize dependencies. - * - * @param \Magento\Framework\Model\Context $context - * @param \Magento\Framework\Registry $registry - * @param \Magento\Newsletter\Helper\Data $newsletterData - * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\Framework\Mail\Template\TransportBuilder $transportBuilder - * @param \Magento\Store\Model\StoreManagerInterface $storeManager + * @var SubscriptionManagerInterface + */ + private $subscriptionManager; + + /** + * @param Context $context + * @param Registry $registry + * @param Data $newsletterData + * @param ScopeConfigInterface $scopeConfig + * @param TransportBuilder $transportBuilder + * @param StoreManagerInterface $storeManager * @param \Magento\Customer\Model\Session $customerSession * @param CustomerRepositoryInterface $customerRepository * @param AccountManagementInterface $customerAccountManagement - * @param \Magento\Framework\Translate\Inline\StateInterface $inlineTranslation - * @param \Magento\Framework\Model\ResourceModel\AbstractResource|null $resource - * @param \Magento\Framework\Data\Collection\AbstractDb|null $resourceCollection + * @param StateInterface $inlineTranslation + * @param AbstractResource|null $resource + * @param AbstractDb|null $resourceCollection * @param array $data - * @param \Magento\Framework\Stdlib\DateTime\DateTime|null $dateTime + * @param DateTime|null $dateTime * @param CustomerInterfaceFactory|null $customerFactory * @param DataObjectHelper|null $dataObjectHelper + * @param SubscriptionManagerInterface|null $subscriptionManager * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Framework\Model\Context $context, - \Magento\Framework\Registry $registry, - \Magento\Newsletter\Helper\Data $newsletterData, - \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Framework\Mail\Template\TransportBuilder $transportBuilder, - \Magento\Store\Model\StoreManagerInterface $storeManager, + Context $context, + Registry $registry, + Data $newsletterData, + ScopeConfigInterface $scopeConfig, + TransportBuilder $transportBuilder, + StoreManagerInterface $storeManager, \Magento\Customer\Model\Session $customerSession, CustomerRepositoryInterface $customerRepository, AccountManagementInterface $customerAccountManagement, - \Magento\Framework\Translate\Inline\StateInterface $inlineTranslation, - \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null, - \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, + StateInterface $inlineTranslation, + AbstractResource $resource = null, + AbstractDb $resourceCollection = null, array $data = [], - \Magento\Framework\Stdlib\DateTime\DateTime $dateTime = null, + DateTime $dateTime = null, CustomerInterfaceFactory $customerFactory = null, - DataObjectHelper $dataObjectHelper = null + DataObjectHelper $dataObjectHelper = null, + SubscriptionManagerInterface $subscriptionManager = null ) { $this->_newsletterData = $newsletterData; $this->_scopeConfig = $scopeConfig; $this->_transportBuilder = $transportBuilder; $this->_storeManager = $storeManager; $this->_customerSession = $customerSession; - $this->dateTime = $dateTime ?: \Magento\Framework\App\ObjectManager::getInstance()->get( - \Magento\Framework\Stdlib\DateTime\DateTime::class + $this->dateTime = $dateTime ?: ObjectManager::getInstance()->get( + DateTime::class ); $this->customerFactory = $customerFactory ?: ObjectManager::getInstance() ->get(CustomerInterfaceFactory::class); @@ -195,6 +213,8 @@ public function __construct( $this->customerRepository = $customerRepository; $this->customerAccountManagement = $customerAccountManagement; $this->inlineTranslation = $inlineTranslation; + $this->subscriptionManager = $subscriptionManager ?: ObjectManager::getInstance() + ->get(SubscriptionManagerInterface::class); parent::__construct($context, $registry, $resource, $resourceCollection, $data); } @@ -205,7 +225,7 @@ public function __construct( */ protected function _construct() { - $this->_init(\Magento\Newsletter\Model\ResourceModel\Subscriber::class); + $this->_init(ResourceModel\Subscriber::class); } /** @@ -357,51 +377,38 @@ public function isSubscribed() } /** - * Load subscriber data from resource model by email + * Load by subscriber email * - * @param string $subscriberEmail + * @param string $email + * @param int $websiteId * @return $this */ - public function loadByEmail($subscriberEmail) + public function loadBySubscriberEmail(string $email, int $websiteId): Subscriber { - $storeId = $this->_storeManager->getStore()->getId(); - $customerData = ['store_id' => $storeId, 'email'=> $subscriberEmail]; + /** @var ResourceModel\Subscriber $resource */ + $resource = $this->getResource(); + $data = $resource->loadBySubscriberEmail($email, $websiteId); + $this->addData($data); + $this->setOrigData(); - /** @var \Magento\Customer\Api\Data\CustomerInterface $customer */ - $customer = $this->customerFactory->create(); - $this->dataObjectHelper->populateWithArray( - $customer, - $customerData, - \Magento\Customer\Api\Data\CustomerInterface::class - ); - $this->addData($this->getResource()->loadByCustomerData($customer)); return $this; } /** - * Load subscriber info by customerId + * Load by customer id * * @param int $customerId + * @param int $websiteId * @return $this */ - public function loadByCustomerId($customerId) + public function loadByCustomer(int $customerId, int $websiteId): Subscriber { - try { - $customerData = $this->customerRepository->getById($customerId); - $customerData->setStoreId($this->_storeManager->getStore()->getId()); - if ($customerData->getWebsiteId() === null) { - $customerData->setWebsiteId($this->_storeManager->getStore()->getWebsiteId()); - } - $data = $this->getResource()->loadByCustomerData($customerData); - $this->addData($data); - if (!empty($data) && $customerData->getId() && !$this->getCustomerId()) { - $this->setCustomerId($customerData->getId()); - $this->setSubscriberConfirmCode($this->randomSequence()); - $this->save(); - } - // phpcs:ignore Magento2.CodeAnalysis.EmptyBlock - } catch (NoSuchEntityException $e) { - } + /** @var ResourceModel\Subscriber $resource */ + $resource = $this->getResource(); + $data = $resource->loadByCustomerId($customerId, $websiteId); + $this->addData($data); + $this->setOrigData(); + return $this; } @@ -418,95 +425,23 @@ public function randomSequence($length = 32) $char = array_merge(range('a', 'z'), range(0, 9)); $charLen = count($char) - 1; for ($i = 0; $i < $length; $i++) { - $disc = \Magento\Framework\Math\Random::getRandomNumber(0, $charLen); + $disc = Random::getRandomNumber(0, $charLen); $par[$i] = $char[$disc]; $id = $id . $char[$disc]; } return $id; } - /** - * Subscribes by email - * - * @param string $email - * @throws \Exception - * @return int - * - * @SuppressWarnings(PHPMD.CyclomaticComplexity) - * @SuppressWarnings(PHPMD.NPathComplexity) - */ - public function subscribe($email) - { - $this->loadByEmail($email); - - if ($this->getId() && $this->getStatus() == self::STATUS_SUBSCRIBED) { - return $this->getStatus(); - } - - if (!$this->getId()) { - $this->setSubscriberConfirmCode($this->randomSequence()); - } - - $isConfirmNeed = $this->_scopeConfig->getValue( - self::XML_PATH_CONFIRMATION_FLAG, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ) == 1 ? true : false; - - $isSubscribeOwnEmail = $this->_customerSession->isLoggedIn() - && $this->_customerSession->getCustomerDataObject()->getEmail() == $email; - - if (!$this->getId() || $this->getStatus() == self::STATUS_UNSUBSCRIBED - || $this->getStatus() == self::STATUS_NOT_ACTIVE - ) { - if ($isConfirmNeed === true) { - $this->setStatus(self::STATUS_NOT_ACTIVE); - } else { - $this->setStatus(self::STATUS_SUBSCRIBED); - } - $this->setSubscriberEmail($email); - } - - if ($isSubscribeOwnEmail) { - try { - $customer = $this->customerRepository->getById($this->_customerSession->getCustomerId()); - $this->setStoreId($customer->getStoreId()); - $this->setCustomerId($customer->getId()); - } catch (NoSuchEntityException $e) { - $this->setStoreId($this->_storeManager->getStore()->getId()); - $this->setCustomerId(0); - } - } else { - $this->setStoreId($this->_storeManager->getStore()->getId()); - $this->setCustomerId(0); - } - - $this->setStatusChanged(true); - - try { - /* Save model before sending out email */ - $this->save(); - if ($isConfirmNeed === true) { - $this->sendConfirmationRequestEmail(); - } else { - $this->sendConfirmationSuccessEmail(); - } - return $this->getStatus(); - } catch (\Exception $e) { - // phpcs:ignore Magento2.Exceptions.DirectThrow - throw new \Exception($e->getMessage()); - } - } - /** * Unsubscribes loaded subscription * - * @throws \Magento\Framework\Exception\LocalizedException + * @throws LocalizedException * @return $this */ public function unsubscribe() { if ($this->hasCheckCode() && $this->getCode() != $this->getCheckCode()) { - throw new \Magento\Framework\Exception\LocalizedException( + throw new LocalizedException( __('This is an invalid subscription confirmation code.') ); } @@ -518,149 +453,6 @@ public function unsubscribe() return $this; } - /** - * Subscribe the customer with the id provided - * - * @param int $customerId - * @return $this - */ - public function subscribeCustomerById($customerId) - { - return $this->_updateCustomerSubscription($customerId, true); - } - - /** - * Unsubscribe the customer with the id provided - * - * @param int $customerId - * @return $this - */ - public function unsubscribeCustomerById($customerId) - { - return $this->_updateCustomerSubscription($customerId, false); - } - - /** - * Update the subscription based on latest information of associated customer. - * - * @param int $customerId - * @return $this - */ - public function updateSubscription($customerId) - { - $this->loadByCustomerId($customerId); - $this->_updateCustomerSubscription($customerId, $this->isSubscribed()); - return $this; - } - - /** - * Saving customer subscription status - * - * @param int $customerId - * @param bool $subscribe indicates whether the customer should be subscribed or unsubscribed - * @return $this - * - * @SuppressWarnings(PHPMD.CyclomaticComplexity) - * @SuppressWarnings(PHPMD.NPathComplexity) - */ - protected function _updateCustomerSubscription($customerId, $subscribe) - { - try { - $customerData = $this->customerRepository->getById($customerId); - } catch (NoSuchEntityException $e) { - return $this; - } - - $this->loadByCustomerId($customerId); - if (!$subscribe && !$this->getId()) { - return $this; - } - - if (!$this->getId()) { - $this->setSubscriberConfirmCode($this->randomSequence()); - } - - $sendInformationEmail = false; - $status = self::STATUS_SUBSCRIBED; - $isConfirmNeed = $this->_scopeConfig->getValue( - self::XML_PATH_CONFIRMATION_FLAG, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ) == 1 ? true : false; - if ($subscribe) { - if (AccountManagementInterface::ACCOUNT_CONFIRMATION_REQUIRED - == $this->customerAccountManagement->getConfirmationStatus($customerId) - ) { - if ($this->getId() && $this->getStatus() == self::STATUS_SUBSCRIBED) { - // if a customer was already subscribed then keep the subscribed - $status = self::STATUS_SUBSCRIBED; - } else { - $status = self::STATUS_UNCONFIRMED; - } - } elseif ($isConfirmNeed) { - if ($this->getStatus() != self::STATUS_SUBSCRIBED) { - $status = self::STATUS_NOT_ACTIVE; - } - } - } elseif (($this->getStatus() == self::STATUS_UNCONFIRMED) && ($customerData->getConfirmation() === null)) { - $status = self::STATUS_SUBSCRIBED; - $sendInformationEmail = true; - } elseif (($this->getStatus() == self::STATUS_NOT_ACTIVE) && ($customerData->getConfirmation() === null)) { - $status = self::STATUS_NOT_ACTIVE; - } else { - $status = self::STATUS_UNSUBSCRIBED; - } - /** - * If subscription status has been changed then send email to the customer - */ - if ($status != self::STATUS_UNCONFIRMED && $status != $this->getStatus()) { - $sendInformationEmail = true; - } - - if ($status != $this->getStatus()) { - $this->setStatusChanged(true); - } - - $this->setStatus($status); - - $storeId = $customerData->getStoreId(); - if ((int)$customerData->getStoreId() === 0) { - $storeId = $this->_storeManager->getWebsite($customerData->getWebsiteId())->getDefaultStore()->getId(); - } - - if (!$this->getId()) { - $this->setStoreId($storeId) - ->setCustomerId($customerData->getId()) - ->setEmail($customerData->getEmail()); - } else { - $this->setStoreId($storeId) - ->setEmail($customerData->getEmail()); - } - - $this->save(); - $sendSubscription = $sendInformationEmail; - if ($sendSubscription === null xor $sendSubscription && $this->isStatusChanged()) { - try { - switch ($status) { - case self::STATUS_UNSUBSCRIBED: - $this->sendUnsubscriptionEmail(); - break; - case self::STATUS_SUBSCRIBED: - $this->sendConfirmationSuccessEmail(); - break; - case self::STATUS_NOT_ACTIVE: - if ($isConfirmNeed) { - $this->sendConfirmationRequestEmail(); - } - break; - } - } catch (MailException $e) { - // If we are not able to send a new account email, this should be ignored - $this->_logger->critical($e); - } - } - return $this; - } - /** * Confirms subscriber newsletter * @@ -684,10 +476,10 @@ public function confirm($code) /** * Mark receiving subscriber of queue newsletter * - * @param \Magento\Newsletter\Model\Queue $queue + * @param Queue $queue * @return Subscriber */ - public function received(\Magento\Newsletter\Model\Queue $queue) + public function received(Queue $queue) { $this->getResource()->received($this, $queue); return $this; @@ -700,54 +492,13 @@ public function received(\Magento\Newsletter\Model\Queue $queue) */ public function sendConfirmationRequestEmail() { - if ($this->getImportMode()) { - return $this; - } - - if (!$this->_scopeConfig->getValue( - self::XML_PATH_CONFIRM_EMAIL_TEMPLATE, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ) || !$this->_scopeConfig->getValue( - self::XML_PATH_CONFIRM_EMAIL_IDENTITY, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ) - ) { - return $this; - } - - $this->inlineTranslation->suspend(); - - $this->_transportBuilder->setTemplateIdentifier( - $this->_scopeConfig->getValue( - self::XML_PATH_CONFIRM_EMAIL_TEMPLATE, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ) - )->setTemplateOptions( - [ - 'area' => \Magento\Framework\App\Area::AREA_FRONTEND, - 'store' => $this->_storeManager->getStore()->getId(), - ] - )->setTemplateVars( - [ - 'subscriber' => $this, - 'store' => $this->_storeManager->getStore(), - 'subscriber_data' => [ - 'confirmation_link' => $this->getConfirmationLink(), - ], - ] - )->setFrom( - $this->_scopeConfig->getValue( - self::XML_PATH_CONFIRM_EMAIL_IDENTITY, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ) - )->addTo( - $this->getEmail(), - $this->getName() - ); - $transport = $this->_transportBuilder->getTransport(); - $transport->sendMessage(); - - $this->inlineTranslation->resume(); + $vars = [ + 'store' => $this->_storeManager->getStore($this->getStoreId()), + 'subscriber_data' => [ + 'confirmation_link' => $this->getConfirmationLink(), + ], + ]; + $this->sendEmail(self::XML_PATH_CONFIRM_EMAIL_TEMPLATE, self::XML_PATH_CONFIRM_EMAIL_IDENTITY, $vars); return $this; } @@ -759,48 +510,7 @@ public function sendConfirmationRequestEmail() */ public function sendConfirmationSuccessEmail() { - if ($this->getImportMode()) { - return $this; - } - - if (!$this->_scopeConfig->getValue( - self::XML_PATH_SUCCESS_EMAIL_TEMPLATE, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ) || !$this->_scopeConfig->getValue( - self::XML_PATH_SUCCESS_EMAIL_IDENTITY, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ) - ) { - return $this; - } - - $this->inlineTranslation->suspend(); - - $this->_transportBuilder->setTemplateIdentifier( - $this->_scopeConfig->getValue( - self::XML_PATH_SUCCESS_EMAIL_TEMPLATE, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ) - )->setTemplateOptions( - [ - 'area' => \Magento\Framework\App\Area::AREA_FRONTEND, - 'store' => $this->_storeManager->getStore()->getId(), - ] - )->setTemplateVars( - ['subscriber' => $this] - )->setFrom( - $this->_scopeConfig->getValue( - self::XML_PATH_SUCCESS_EMAIL_IDENTITY, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ) - )->addTo( - $this->getEmail(), - $this->getName() - ); - $transport = $this->_transportBuilder->getTransport(); - $transport->sendMessage(); - - $this->inlineTranslation->resume(); + $this->sendEmail(self::XML_PATH_SUCCESS_EMAIL_TEMPLATE, self::XML_PATH_SUCCESS_EMAIL_IDENTITY); return $this; } @@ -811,40 +521,45 @@ public function sendConfirmationSuccessEmail() * @return $this */ public function sendUnsubscriptionEmail() + { + $this->sendEmail(self::XML_PATH_UNSUBSCRIBE_EMAIL_TEMPLATE, self::XML_PATH_UNSUBSCRIBE_EMAIL_IDENTITY); + + return $this; + } + + /** + * Send email about change status + * + * @param string $emailTemplatePath + * @param string $emailIdentityPath + * @param array $templateVars + * @return void + */ + private function sendEmail(string $emailTemplatePath, string $emailIdentityPath, array $templateVars = []): void { if ($this->getImportMode()) { - return $this; + return; } - if (!$this->_scopeConfig->getValue( - self::XML_PATH_UNSUBSCRIBE_EMAIL_TEMPLATE, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ) || !$this->_scopeConfig->getValue( - self::XML_PATH_UNSUBSCRIBE_EMAIL_IDENTITY, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ) - ) { - return $this; + + $template = $this->_scopeConfig->getValue($emailTemplatePath, ScopeInterface::SCOPE_STORE, $this->getStoreId()); + $identity = $this->_scopeConfig->getValue($emailIdentityPath, ScopeInterface::SCOPE_STORE, $this->getStoreId()); + if (!$template || !$identity) { + return; } + $templateVars += ['subscriber' => $this]; $this->inlineTranslation->suspend(); - $this->_transportBuilder->setTemplateIdentifier( - $this->_scopeConfig->getValue( - self::XML_PATH_UNSUBSCRIBE_EMAIL_TEMPLATE, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ) + $template )->setTemplateOptions( [ - 'area' => \Magento\Framework\App\Area::AREA_FRONTEND, - 'store' => $this->_storeManager->getStore()->getId(), + 'area' => Area::AREA_FRONTEND, + 'store' => $this->getStoreId(), ] )->setTemplateVars( - ['subscriber' => $this] + $templateVars )->setFrom( - $this->_scopeConfig->getValue( - self::XML_PATH_UNSUBSCRIBE_EMAIL_IDENTITY, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ) + $identity )->addTo( $this->getEmail(), $this->getName() @@ -853,8 +568,6 @@ public function sendUnsubscriptionEmail() $transport->sendMessage(); $this->inlineTranslation->resume(); - - return $this; } /** @@ -884,4 +597,125 @@ public function beforeSave() } return $this; } + + /** + * Load subscriber data from resource model by email + * + * @param string $subscriberEmail + * @return $this + * @deprecated The subscription should be loaded by website id + * @see loadBySubscriberEmail + */ + public function loadByEmail($subscriberEmail) + { + $websiteId = (int)$this->_storeManager->getStore()->getWebsiteId(); + $this->loadBySubscriberEmail($subscriberEmail, $websiteId); + + return $this; + } + + /** + * Load subscriber info by customerId + * + * @param int $customerId + * @return $this + * @deprecated The subscription should be loaded by website id + * @see loadByCustomer + */ + public function loadByCustomerId($customerId) + { + try { + $customer = $this->customerRepository->getById($customerId); + $websiteId = (int)$this->_storeManager->getStore()->getWebsiteId(); + $this->loadByCustomer((int)$customerId, $websiteId); + if ($customer->getId() && !$this->getCustomerId()) { + $this->setCustomerId($customer->getId()); + $this->setSubscriberConfirmCode($this->randomSequence()); + $this->save(); + } + // phpcs:ignore Magento2.CodeAnalysis.EmptyBlock + } catch (NoSuchEntityException $e) { + } + return $this; + } + + /** + * Subscribes by email + * + * @param string $email + * @return int + * @deprecated The subscription should be updated by store id + * @see \Magento\Newsletter\Model\SubscriptionManager::subscribe + */ + public function subscribe($email) + { + $storeId = (int)$this->_storeManager->getStore()->getId(); + $subscriber = $this->subscriptionManager->subscribe($email, $storeId); + $this->addData($subscriber->getData()); + + return $this->getStatus(); + } + + /** + * Subscribe the customer with the id provided + * + * @param int $customerId + * @return $this + * @deprecated The subscription should be updated by store id + * @see \Magento\Newsletter\Model\SubscriptionManager::subscribeCustomer + */ + public function subscribeCustomerById($customerId) + { + return $this->_updateCustomerSubscription($customerId, true); + } + + /** + * Unsubscribe the customer with the id provided + * + * @param int $customerId + * @return $this + * @deprecated The subscription should be updated by store id + * @see \Magento\Newsletter\Model\SubscriptionManager::unsubscribeCustomer + */ + public function unsubscribeCustomerById($customerId) + { + return $this->_updateCustomerSubscription($customerId, false); + } + + /** + * Update the subscription based on latest information of associated customer. + * + * @param int $customerId + * @return $this + * @deprecated The subscription should be updated by store id + * @see \Magento\Newsletter\Model\SubscriptionManager::subscribeCustomer + */ + public function updateSubscription($customerId) + { + $this->loadByCustomerId($customerId); + $this->_updateCustomerSubscription($customerId, $this->isSubscribed()); + return $this; + } + + /** + * Saving customer subscription status + * + * @param int $customerId + * @param bool $subscribe indicates whether the customer should be subscribed or unsubscribed + * @return $this + * @deprecated The subscription should be updated by store id + * @see \Magento\Newsletter\Model\SubscriptionManager::subscribeCustomer + */ + protected function _updateCustomerSubscription($customerId, $subscribe) + { + $storeId = (int)$this->_storeManager->getStore()->getId(); + if ($subscribe) { + $subscriber = $this->subscriptionManager->subscribeCustomer((int)$customerId, $storeId); + } else { + $subscriber = $this->subscriptionManager->unsubscribeCustomer((int)$customerId, $storeId); + } + $this->addData($subscriber->getData()); + + return $this; + } } diff --git a/app/code/Magento/Newsletter/Model/SubscriptionManager.php b/app/code/Magento/Newsletter/Model/SubscriptionManager.php new file mode 100644 index 0000000000000..846d095625e0c --- /dev/null +++ b/app/code/Magento/Newsletter/Model/SubscriptionManager.php @@ -0,0 +1,314 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Newsletter\Model; + +use Magento\Customer\Api\AccountManagementInterface; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\Exception\MailException; +use Magento\Store\Model\ScopeInterface; +use Magento\Store\Model\StoreManagerInterface; +use Psr\Log\LoggerInterface; + +/** + * Class to update newsletter subscription status + */ +class SubscriptionManager implements SubscriptionManagerInterface +{ + /** + * @var SubscriberFactory + */ + private $subscriberFactory; + + /** + * @var LoggerInterface + */ + private $logger; + + /** + * @var StoreManagerInterface + */ + private $storeManager; + + /** + * @var ScopeConfigInterface + */ + private $scopeConfig; + + /** + * @var AccountManagementInterface + */ + private $customerAccountManagement; + + /** + * @var CustomerRepositoryInterface + */ + private $customerRepository; + + /** + * @param SubscriberFactory $subscriberFactory + * @param LoggerInterface $logger + * @param StoreManagerInterface $storeManager + * @param ScopeConfigInterface $scopeConfig + * @param AccountManagementInterface $customerAccountManagement + * @param CustomerRepositoryInterface $customerRepository + */ + public function __construct( + SubscriberFactory $subscriberFactory, + LoggerInterface $logger, + StoreManagerInterface $storeManager, + ScopeConfigInterface $scopeConfig, + AccountManagementInterface $customerAccountManagement, + CustomerRepositoryInterface $customerRepository + ) { + $this->subscriberFactory = $subscriberFactory; + $this->logger = $logger; + $this->storeManager = $storeManager; + $this->scopeConfig = $scopeConfig; + $this->customerAccountManagement = $customerAccountManagement; + $this->customerRepository = $customerRepository; + } + + /** + * @inheritdoc + */ + public function subscribe(string $email, int $storeId): Subscriber + { + $websiteId = (int)$this->storeManager->getStore($storeId)->getWebsiteId(); + $subscriber = $this->subscriberFactory->create()->loadBySubscriberEmail($email, $websiteId); + $currentStatus = (int)$subscriber->getStatus(); + if ($currentStatus === Subscriber::STATUS_SUBSCRIBED) { + return $subscriber; + } + + $status = $this->isConfirmNeed($storeId) ? Subscriber::STATUS_NOT_ACTIVE : Subscriber::STATUS_SUBSCRIBED; + if (!$subscriber->getId()) { + $subscriber->setSubscriberConfirmCode($subscriber->randomSequence()); + $subscriber->setSubscriberEmail($email); + } + $subscriber->setStatus($status) + ->setStoreId($storeId) + ->save(); + + $this->sendEmailAfterChangeStatus($subscriber); + + return $subscriber; + } + + /** + * @inheritdoc + */ + public function unsubscribe(string $email, int $storeId, string $confirmCode): Subscriber + { + $websiteId = (int)$this->storeManager->getStore($storeId)->getWebsiteId(); + /** @var Subscriber $subscriber */ + $subscriber = $this->subscriberFactory->create()->loadBySubscriberEmail($email, $websiteId); + if (!$subscriber->getId()) { + return $subscriber; + } + $subscriber->setCheckCode($confirmCode); + $subscriber->unsubscribe(); + + return $subscriber; + } + + /** + * @inheritdoc + */ + public function subscribeCustomer(int $customerId, int $storeId): Subscriber + { + return $this->updateCustomerSubscription($customerId, $storeId, true); + } + + /** + * @inheritdoc + */ + public function unsubscribeCustomer(int $customerId, int $storeId): Subscriber + { + return $this->updateCustomerSubscription($customerId, $storeId, false); + } + + /** + * Update customer newsletter subscription + * + * @param int $customerId + * @param int $storeId + * @param bool $status + * @return Subscriber + */ + private function updateCustomerSubscription(int $customerId, int $storeId, bool $status): Subscriber + { + $customer = $this->customerRepository->getById($customerId); + $websiteId = (int)$this->storeManager->getStore($storeId)->getWebsiteId(); + $subscriber = $this->loadSubscriberByCustomer($customer, $websiteId); + if (!$status && !$subscriber->getId()) { + return $subscriber; + } + + $newStatus = $this->getNewSubscriptionStatus($subscriber, $customer, $storeId, $status); + $needToSendLetter = $this->saveSubscriber($subscriber, $customer, $storeId, $newStatus); + if ($needToSendLetter) { + $this->sendEmailAfterChangeStatus($subscriber); + } + + return $subscriber; + } + + /** + * Load subscriber model by customer + * + * @param CustomerInterface $customer + * @param int $websiteId + * @return Subscriber + */ + private function loadSubscriberByCustomer(CustomerInterface $customer, int $websiteId): Subscriber + { + $subscriber = $this->subscriberFactory->create(); + $subscriber->loadByCustomer((int)$customer->getId(), $websiteId); + if (!$subscriber->getId()) { + $subscriber->loadBySubscriberEmail((string)$customer->getEmail(), $websiteId); + } + + return $subscriber; + } + + /** + * Save Subscriber model + * + * @param Subscriber $subscriber + * @param CustomerInterface $customer + * @param int $storeId + * @param int $status + * @return bool Need to send email + */ + private function saveSubscriber( + Subscriber $subscriber, + CustomerInterface $customer, + int $storeId, + int $status + ): bool { + $statusChanged = (int)$subscriber->getStatus() !== $status; + $emailChanged = $subscriber->getEmail() !== $customer->getEmail(); + if ($subscriber->getId() + && !$statusChanged + && (int)$subscriber->getCustomerId() === (int)$customer->getId() + && (int)$subscriber->getStoreId() === $storeId + && !$emailChanged + ) { + return false; + } + + if (!$subscriber->getId()) { + $subscriber->setSubscriberConfirmCode($subscriber->randomSequence()); + } + $subscriber->setStatus($status) + ->setStatusChanged($statusChanged) + ->setCustomerId($customer->getId()) + ->setStoreId($storeId) + ->setEmail($customer->getEmail()) + ->save(); + + if ($statusChanged) { + return true; + } + + /** + * If the subscriber is waiting to confirm from the customer + * and customer changed the email + * than need to send confirmation letter to the new email + */ + return $status === Subscriber::STATUS_NOT_ACTIVE && $emailChanged; + } + + /** + * Get new subscription status + * + * @param Subscriber $subscriber + * @param CustomerInterface $customer + * @param int $storeId + * @param bool $subscribe + * @return int + */ + private function getNewSubscriptionStatus( + Subscriber $subscriber, + CustomerInterface $customer, + int $storeId, + bool $subscribe + ): int { + $currentStatus = (int)$subscriber->getStatus(); + // If the current status is already as needed then return them + if (($subscribe && $currentStatus === Subscriber::STATUS_SUBSCRIBED) + || (!$subscribe && $currentStatus === Subscriber::STATUS_UNSUBSCRIBED) + ) { + return $currentStatus; + } + + $status = $currentStatus; + if ($subscribe) { + $customerConfirmStatus = $this->customerAccountManagement->getConfirmationStatus($customer->getId()); + if ($customerConfirmStatus === AccountManagementInterface::ACCOUNT_CONFIRMATION_REQUIRED) { + $status = Subscriber::STATUS_UNCONFIRMED; + } elseif ($this->isConfirmNeed($storeId)) { + $status = Subscriber::STATUS_NOT_ACTIVE; + } else { + $status = Subscriber::STATUS_SUBSCRIBED; + } + } elseif ($currentStatus === Subscriber::STATUS_SUBSCRIBED) { + $status = Subscriber::STATUS_UNSUBSCRIBED; + } + + return $status; + } + + /** + * Sends out email to customer after change subscription status + * + * @param Subscriber $subscriber + * @return void + */ + private function sendEmailAfterChangeStatus(Subscriber $subscriber): void + { + $status = (int)$subscriber->getStatus(); + if ($status === Subscriber::STATUS_UNCONFIRMED) { + return; + } + + try { + switch ($status) { + case Subscriber::STATUS_UNSUBSCRIBED: + $subscriber->sendUnsubscriptionEmail(); + break; + case Subscriber::STATUS_SUBSCRIBED: + $subscriber->sendConfirmationSuccessEmail(); + break; + case Subscriber::STATUS_NOT_ACTIVE: + $subscriber->sendConfirmationRequestEmail(); + break; + } + } catch (MailException $e) { + // If we are not able to send a new account email, this should be ignored + $this->logger->critical($e); + } + } + + /** + * Is need to confirm subscription + * + * @param int $storeId + * @return bool + */ + private function isConfirmNeed(int $storeId): bool + { + return (bool)$this->scopeConfig->isSetFlag( + Subscriber::XML_PATH_CONFIRMATION_FLAG, + ScopeInterface::SCOPE_STORE, + $storeId + ); + } +} diff --git a/app/code/Magento/Newsletter/Model/SubscriptionManagerInterface.php b/app/code/Magento/Newsletter/Model/SubscriptionManagerInterface.php new file mode 100644 index 0000000000000..8b92d825bdbcd --- /dev/null +++ b/app/code/Magento/Newsletter/Model/SubscriptionManagerInterface.php @@ -0,0 +1,51 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Newsletter\Model; + +/** + * Interface to update newsletter subscription status + */ +interface SubscriptionManagerInterface +{ + /** + * Subscribe to newsletters by email + * + * @param string $email + * @param int $storeId + * @return Subscriber + */ + public function subscribe(string $email, int $storeId): Subscriber; + + /** + * Unsubscribe from newsletters by email + * + * @param string $email + * @param int $storeId + * @param string $confirmCode + * @return Subscriber + */ + public function unsubscribe(string $email, int $storeId, string $confirmCode): Subscriber; + + /** + * Subscribe customer to newsletter + * + * @param int $customerId + * @param int $storeId + * @return Subscriber + */ + public function subscribeCustomer(int $customerId, int $storeId): Subscriber; + + /** + * Unsubscribe customer from newsletter + * + * @param int $customerId + * @param int $storeId + * @return Subscriber + */ + public function unsubscribeCustomer(int $customerId, int $storeId): Subscriber; +} diff --git a/app/code/Magento/Newsletter/Test/Unit/Model/Plugin/CustomerPluginTest.php b/app/code/Magento/Newsletter/Test/Unit/Model/Plugin/CustomerPluginTest.php index e809b7e37a432..52b3df8cb8aa6 100644 --- a/app/code/Magento/Newsletter/Test/Unit/Model/Plugin/CustomerPluginTest.php +++ b/app/code/Magento/Newsletter/Test/Unit/Model/Plugin/CustomerPluginTest.php @@ -5,149 +5,160 @@ */ namespace Magento\Newsletter\Test\Unit\Model\Plugin; +use Magento\Customer\Api\CustomerRepositoryInterface; use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Customer\Model\Config\Share; use Magento\Customer\Model\ResourceModel\CustomerRepository; use Magento\Customer\Api\Data\CustomerExtensionInterface; use Magento\Framework\Api\ExtensionAttributesFactory; -use Magento\Newsletter\Model\ResourceModel\Subscriber; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Newsletter\Model\Plugin\CustomerPlugin; +use Magento\Newsletter\Model\ResourceModel\Subscriber\Collection; +use Magento\Newsletter\Model\ResourceModel\Subscriber\CollectionFactory; +use Magento\Newsletter\Model\Subscriber; +use Magento\Newsletter\Model\SubscriberFactory; +use Magento\Newsletter\Model\SubscriptionManagerInterface; +use Magento\Store\Api\Data\StoreInterface; +use Magento\Store\Model\StoreManagerInterface; +use Magento\Store\Model\Website; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; -class CustomerPluginTest extends \PHPUnit\Framework\TestCase +/** + * Class to test Newsletter Plugin for customer + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ +class CustomerPluginTest extends TestCase { /** - * @var \Magento\Newsletter\Model\Plugin\CustomerPlugin + * @var SubscriberFactory|MockObject */ - private $plugin; + private $subscriberFactory; /** - * @var \Magento\Newsletter\Model\SubscriberFactory|\PHPUnit_Framework_MockObject_MockObject + * @var ExtensionAttributesFactory|MockObject */ - private $subscriberFactory; + private $extensionFactory; /** - * @var \Magento\Newsletter\Model\Subscriber|\PHPUnit_Framework_MockObject_MockObject + * @var CollectionFactory|MockObject */ - private $subscriber; + private $collectionFactory; /** - * @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager + * @var SubscriptionManagerInterface|MockObject */ - private $objectManager; + private $subscriptionManager; /** - * @var ExtensionAttributesFactory|\PHPUnit_Framework_MockObject_MockObject + * @var Share|MockObject */ - private $extensionFactoryMock; + private $shareConfig; /** - * @var CustomerExtensionInterface|\PHPUnit_Framework_MockObject_MockObject + * @var StoreManagerInterface|MockObject */ - private $customerExtensionMock; + private $storeManager; /** - * @var Subscriber|\PHPUnit_Framework_MockObject_MockObject + * @var ObjectManager */ - private $subscriberResourceMock; + private $objectManager; /** - * @var CustomerInterface|\PHPUnit_Framework_MockObject_MockObject + * @var CustomerPlugin */ - private $customerMock; + private $plugin; + /** + * @inheritdoc + */ protected function setUp() { - $this->subscriberFactory = $this->getMockBuilder(\Magento\Newsletter\Model\SubscriberFactory::class) - ->disableOriginalConstructor() - ->setMethods(['create']) - ->getMock(); - $this->subscriber = $this->getMockBuilder(\Magento\Newsletter\Model\Subscriber::class) - ->setMethods( - [ - 'loadByEmail', - 'getId', - 'delete', - 'updateSubscription', - 'subscribeCustomerById', - 'unsubscribeCustomerById', - 'isSubscribed', - ] - )->disableOriginalConstructor() - ->getMock(); - $this->extensionFactoryMock = $this->getMockBuilder(ExtensionAttributesFactory::class) - ->disableOriginalConstructor() - ->setMethods(['create']) - ->getMock(); - $this->customerExtensionMock = $this->getMockBuilder(CustomerExtensionInterface::class) - ->setMethods(['getIsSubscribed', 'setIsSubscribed']) - ->disableOriginalConstructor() - ->getMockForAbstractClass(); - $this->subscriberResourceMock = $this->getMockBuilder(Subscriber::class) - ->disableOriginalConstructor() - ->getMock(); - $this->customerMock = $this->getMockBuilder(CustomerInterface::class) - ->setMethods(['getExtensionAttributes']) - ->disableOriginalConstructor() - ->getMockForAbstractClass(); - $this->subscriberFactory->expects($this->any())->method('create')->willReturn($this->subscriber); - $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - + $this->subscriberFactory = $this->createMock(SubscriberFactory::class); + $this->extensionFactory = $this->createMock(ExtensionAttributesFactory::class); + $this->collectionFactory = $this->createMock(CollectionFactory::class); + $this->subscriptionManager = $this->createMock(SubscriptionManagerInterface::class); + $this->shareConfig = $this->createMock(Share::class); + $this->storeManager = $this->createMock(StoreManagerInterface::class); + $this->objectManager = new ObjectManager($this); $this->plugin = $this->objectManager->getObject( - \Magento\Newsletter\Model\Plugin\CustomerPlugin::class, + CustomerPlugin::class, [ 'subscriberFactory' => $this->subscriberFactory, - 'extensionFactory' => $this->extensionFactoryMock, - 'subscriberResource' => $this->subscriberResourceMock, + 'extensionFactory' => $this->extensionFactory, + 'collectionFactory' => $this->collectionFactory, + 'subscriptionManager' => $this->subscriptionManager, + 'shareConfig' => $this->shareConfig, + 'storeManager' => $this->storeManager, ] ); } /** - * @param bool $subscriptionOriginalValue - * @param bool $subscriptionNewValue + * Test to update customer subscription after save customer + * + * @param int|null $originalStatus + * @param bool|null $newValue + * @param bool|null $expectedSubscribe * @dataProvider afterSaveDataProvider - * @return void */ - public function testAfterSave($subscriptionOriginalValue, $subscriptionNewValue) + public function testAfterSave(?int $originalStatus, ?bool $newValue, ?bool $expectedSubscribe) { - $customerId = 1; - /** @var CustomerInterface | \PHPUnit_Framework_MockObject_MockObject $result */ - $result = $this->createMock(\Magento\Customer\Api\Data\CustomerInterface::class); - /** @var CustomerRepository | \PHPUnit_Framework_MockObject_MockObject $subject */ - $subject = $this->createMock(\Magento\Customer\Api\CustomerRepositoryInterface::class); + $storeId = 2; + $websiteId = 1; + $customerId = 3; + $customerEmail = 'email@example.com'; + + $store = $this->createMock(StoreInterface::class); + $store->method('getId')->willReturn($storeId); + $store->method('getWebsiteId')->willReturn($websiteId); + $this->storeManager->method('getStore')->willReturn($store); - /** @var CustomerExtensionInterface|\PHPUnit_Framework_MockObject_MockObject $resultExtensionAttributes */ - $resultExtensionAttributes = $this->getMockBuilder(CustomerExtensionInterface::class) - ->setMethods(['getIsSubscribed', 'setIsSubscribed']) - ->getMockForAbstractClass(); - $result->expects($this->atLeastOnce())->method('getId')->willReturn($customerId); - $result->expects($this->any())->method('getExtensionAttributes')->willReturn(null); - $this->extensionFactoryMock->expects($this->any()) - ->method('create') - ->willReturn($resultExtensionAttributes); - $result->expects($this->once()) - ->method('setExtensionAttributes') - ->with($resultExtensionAttributes) + $subscriber = $this->createMock(Subscriber::class); + $subscriber->method('getStatus')->willReturn($originalStatus); + $subscriber->method('getEmail')->willReturn($customerEmail); + $subscriber->method('isSubscribed')->willReturn($originalStatus === Subscriber::STATUS_SUBSCRIBED); + $subscriber->expects($this->once()) + ->method('loadByCustomer') + ->with($customerId, $websiteId) + ->willReturnSelf(); + $subscriber->expects($this->once()) + ->method('loadBySubscriberEmail') + ->with($customerEmail, $websiteId) ->willReturnSelf(); - $this->customerMock->expects($this->once()) - ->method('getExtensionAttributes') - ->willReturn($this->customerExtensionMock); - $resultExtensionAttributes->expects($this->any()) - ->method('getIsSubscribed') - ->willReturn($subscriptionOriginalValue); - $this->customerExtensionMock->expects($this->any()) - ->method('getIsSubscribed') - ->willReturn($subscriptionNewValue); + $this->subscriberFactory->method('create')->willReturn($subscriber); - if ($subscriptionOriginalValue !== $subscriptionNewValue) { - if ($subscriptionNewValue) { - $this->subscriber->expects($this->once())->method('subscribeCustomerById')->with($customerId); - } else { - $this->subscriber->expects($this->once())->method('unsubscribeCustomerById')->with($customerId); - } - $this->subscriber->expects($this->once())->method('isSubscribed')->willReturn($subscriptionNewValue); - $resultExtensionAttributes->expects($this->once())->method('setIsSubscribed')->with($subscriptionNewValue); + $customerExtension = $this->createPartialMock(CustomerExtensionInterface::class, ['getIsSubscribed']); + $customerExtension->method('getIsSubscribed')->willReturn($newValue); + /** @var CustomerInterface|MockObject $customer */ + $customer = $this->createMock(CustomerInterface::class); + $customer->method('getExtensionAttributes')->willReturn($customerExtension); + + $resultIsSubscribed = $newValue ?? $originalStatus === Subscriber::STATUS_SUBSCRIBED; + if ($expectedSubscribe !== null) { + $resultSubscriber = $this->createMock(Subscriber::class); + $resultSubscriber->method('isSubscribed')->willReturn($resultIsSubscribed); + $this->subscriptionManager->expects($this->once()) + ->method($expectedSubscribe ? 'subscribeCustomer' : 'unsubscribeCustomer') + ->with($customerId, $storeId) + ->willReturn($resultSubscriber); + } else { + $this->subscriptionManager->expects($this->never())->method('subscribeCustomer'); + $this->subscriptionManager->expects($this->never())->method('unsubscribeCustomer'); } + $resultExtension = $this->createPartialMock(CustomerExtensionInterface::class, ['setIsSubscribed']); + $resultExtension->expects($this->once())->method('setIsSubscribed')->with($resultIsSubscribed); + /** @var CustomerInterface|MockObject $result */ + $result = $this->createMock(CustomerInterface::class); + $result->method('getId')->willReturn($customerId); + $result->method('getEmail')->willReturn($customerEmail); + $result->method('getExtensionAttributes')->willReturn($resultExtension); - $this->assertEquals($result, $this->plugin->afterSave($subject, $result, $this->customerMock)); + /** @var CustomerRepository|MockObject $subject */ + $subject = $this->createMock(CustomerRepositoryInterface::class); + $this->assertEquals($result, $this->plugin->afterSave($subject, $result, $customer)); } /** @@ -156,115 +167,135 @@ public function testAfterSave($subscriptionOriginalValue, $subscriptionNewValue) public function afterSaveDataProvider() { return [ - [true, true], - [false, false], - [true, false], - [false, true], + [null, null, null], + [null, true, true], + [null, false, null], + [Subscriber::STATUS_SUBSCRIBED, null, null], + [Subscriber::STATUS_SUBSCRIBED, true, null], + [Subscriber::STATUS_SUBSCRIBED, false, false], + [Subscriber::STATUS_UNSUBSCRIBED, null, null], + [Subscriber::STATUS_UNSUBSCRIBED, true, true], + [Subscriber::STATUS_UNSUBSCRIBED, false, null], + [Subscriber::STATUS_UNCONFIRMED, null, true], + [Subscriber::STATUS_UNCONFIRMED, true, true], + [Subscriber::STATUS_UNCONFIRMED, false, true], ]; } + /** + * Test to delete subscriptions after delete customer + */ public function testAfterDelete() { - $subject = $this->createMock(\Magento\Customer\Api\CustomerRepositoryInterface::class); - $customer = $this->createMock(\Magento\Customer\Api\Data\CustomerInterface::class); - $customer->expects($this->once())->method('getEmail')->willReturn('test@test.com'); - $this->subscriber->expects($this->once())->method('loadByEmail')->with('test@test.com')->willReturnSelf(); - $this->subscriber->expects($this->once())->method('getId')->willReturn(1); - $this->subscriber->expects($this->once())->method('delete')->willReturnSelf(); + $customerEmail = 'email@example.com'; + $websiteId = 1; + $storeIds = [1, 2]; + + $subscriber = $this->createMock(Subscriber::class); + $subscriber->expects($this->once())->method('delete'); + $collection = $this->createMock(Collection::class); + $collection->expects($this->once()) + ->method('addFieldToFilter') + ->with('subscriber_email', $customerEmail) + ->willReturnSelf(); + $collection->method('getIterator')->willReturn(new \ArrayIterator([$subscriber])); + $this->collectionFactory->expects($this->once())->method('create')->willReturn($collection); + $this->shareConfig->method('isWebsiteScope')->willReturn(false); + $website = $this->createMock(Website::class); + $website->method('getStoreIds')->willReturn($storeIds); + $this->storeManager->method('getWebsite')->with($websiteId)->willReturn($website); - $this->assertEquals(true, $this->plugin->afterDelete($subject, true, $customer)); + /** @var CustomerRepositoryInterface|MockObject $subject */ + $subject = $this->createMock(CustomerRepositoryInterface::class); + /** @var CustomerInterface|MockObject $customer */ + $customer = $this->createMock(CustomerInterface::class); + $customer->method('getEmail')->willReturn($customerEmail); + + $this->assertTrue($this->plugin->afterDelete($subject, true, $customer)); } + /** + * Test to delete subscriptions after delete customer by id + */ public function testAroundDeleteById() { $customerId = 1; + $customerEmail = 'test@test.com'; + $websiteId = 1; + $storeIds = [1, 2]; $deleteCustomerById = function () { return true; }; - $subject = $this->createMock(\Magento\Customer\Api\CustomerRepositoryInterface::class); - $customer = $this->createMock(\Magento\Customer\Api\Data\CustomerInterface::class); - $subject->expects($this->once())->method('getById')->willReturn($customer); - $customer->expects($this->once())->method('getEmail')->willReturn('test@test.com'); - $this->subscriber->expects($this->once())->method('loadByEmail')->with('test@test.com')->willReturnSelf(); - $this->subscriber->expects($this->once())->method('getId')->willReturn(1); - $this->subscriber->expects($this->once())->method('delete')->willReturnSelf(); + $customer = $this->createMock(CustomerInterface::class); + $customer->expects($this->once())->method('getEmail')->willReturn($customerEmail); + /** @var CustomerRepositoryInterface|MockObject $subject */ + $subject = $this->createMock(CustomerRepositoryInterface::class); + $subject->expects($this->once())->method('getById')->with($customerId)->willReturn($customer); + + $subscriber = $this->createMock(Subscriber::class); + $subscriber->expects($this->once())->method('delete'); + $collection = $this->createMock(Collection::class); + $collection->expects($this->once()) + ->method('addFieldToFilter') + ->with('subscriber_email', $customerEmail) + ->willReturnSelf(); + $collection->method('getIterator')->willReturn(new \ArrayIterator([$subscriber])); + $this->collectionFactory->expects($this->once())->method('create')->willReturn($collection); + $this->shareConfig->method('isWebsiteScope')->willReturn(false); + $website = $this->createMock(Website::class); + $website->method('getStoreIds')->willReturn($storeIds); + $this->storeManager->method('getWebsite')->with($websiteId)->willReturn($website); - $this->assertEquals(true, $this->plugin->aroundDeleteById($subject, $deleteCustomerById, $customerId)); + $this->assertTrue($this->plugin->aroundDeleteById($subject, $deleteCustomerById, $customerId)); } /** - * @param int|null $subscriberStatusKey - * @param int|null $subscriberStatusValue - * @param bool $isSubscribed - * @dataProvider afterGetByIdDataProvider - * @return void + * Test to load extension attribute after get by id */ - public function testAfterGetByIdCreatesExtensionAttributesIfItIsNotSet( - $subscriberStatusKey, - $subscriberStatusValue, - $isSubscribed - ) { - $subject = $this->createMock(\Magento\Customer\Api\CustomerRepositoryInterface::class); - $subscriber = [$subscriberStatusKey => $subscriberStatusValue]; + public function testAfterGetByIdCreatesExtensionAttributes(): void + { + $storeId = 2; + $websiteId = 1; + $customerId = 3; + $customerEmail = 'email@example.com'; + $subscribed = true; - $this->extensionFactoryMock->expects($this->any()) - ->method('create') - ->willReturn($this->customerExtensionMock); - $this->customerMock->expects($this->once()) - ->method('setExtensionAttributes') - ->with($this->customerExtensionMock) - ->willReturnSelf(); - $this->customerMock->expects($this->any()) - ->method('getId') - ->willReturn(1); - $this->subscriberResourceMock->expects($this->once()) - ->method('loadByCustomerData') - ->with($this->customerMock) - ->willReturn($subscriber); - $this->customerExtensionMock->expects($this->once())->method('setIsSubscribed')->with($isSubscribed); + $store = $this->createMock(StoreInterface::class); + $store->method('getId')->willReturn($storeId); + $store->method('getWebsiteId')->willReturn($websiteId); + $this->storeManager->method('getStore')->willReturn($store); - $this->assertEquals( - $this->customerMock, - $this->plugin->afterGetById($subject, $this->customerMock) - ); - } + /** @var CustomerInterface|MockObject $customer */ + $customer = $this->createMock(CustomerInterface::class); + $customer->method('getId')->willReturn($customerId); + $customer->method('getEmail')->willReturn($customerEmail); - public function testAfterGetByIdSetsIsSubscribedFlagIfItIsNotSet() - { - $subject = $this->createMock(\Magento\Customer\Api\CustomerRepositoryInterface::class); - $subscriber = ['subscriber_id' => 1, 'subscriber_status' => 1]; - - $this->customerMock->expects($this->any()) - ->method('getExtensionAttributes') - ->willReturn($this->customerExtensionMock); - $this->customerExtensionMock->expects($this->any()) - ->method('getIsSubscribed') - ->willReturn(null); - $this->subscriberResourceMock->expects($this->once()) - ->method('loadByCustomerData') - ->with($this->customerMock) - ->willReturn($subscriber); - $this->customerExtensionMock->expects($this->once()) - ->method('setIsSubscribed') + $subscriber = $this->createMock(Subscriber::class); + $subscriber->method('getEmail')->willReturn($customerEmail); + $subscriber->method('isSubscribed')->willReturn($subscribed); + $subscriber->expects($this->once()) + ->method('loadByCustomer') + ->with($customerId, $websiteId) + ->willReturnSelf(); + $subscriber->expects($this->once()) + ->method('loadBySubscriberEmail') + ->with($customerEmail, $websiteId) ->willReturnSelf(); + $this->subscriberFactory->method('create')->willReturn($subscriber); - $this->assertEquals( - $this->customerMock, - $this->plugin->afterGetById($subject, $this->customerMock) + $customerExtension = $this->createPartialMock( + CustomerExtensionInterface::class, + ['getIsSubscribed', 'setIsSubscribed'] ); - } + $customerExtension->expects($this->once())->method('setIsSubscribed')->with($subscribed); + $this->extensionFactory->expects($this->once())->method('create')->willReturn($customerExtension); + $customer->expects($this->once())->method('setExtensionAttributes')->with($customerExtension); - /** - * @return array - */ - public function afterGetByIdDataProvider() - { - return [ - ['subscriber_status', 1, true], - ['subscriber_status', 2, false], - ['subscriber_status', 3, false], - ['subscriber_status', 4, false], - [null, null, false], - ]; + /** @var CustomerRepositoryInterface|MockObject $subject */ + $subject = $this->createMock(CustomerRepositoryInterface::class); + $this->assertEquals( + $customer, + $this->plugin->afterGetById($subject, $customer) + ); } } diff --git a/app/code/Magento/Newsletter/Test/Unit/Model/SubscriberTest.php b/app/code/Magento/Newsletter/Test/Unit/Model/SubscriberTest.php index 6ccbba9f8828b..c3814563aa46c 100644 --- a/app/code/Magento/Newsletter/Test/Unit/Model/SubscriberTest.php +++ b/app/code/Magento/Newsletter/Test/Unit/Model/SubscriberTest.php @@ -5,118 +5,152 @@ */ namespace Magento\Newsletter\Test\Unit\Model; +use Magento\Customer\Api\AccountManagementInterface; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\CustomerInterfaceFactory; +use Magento\Customer\Model\Session; +use Magento\Framework\Api\DataObjectHelper; +use Magento\Framework\App\Area; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\Mail\Template\TransportBuilder; +use Magento\Framework\Mail\TransportInterface; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Framework\Translate\Inline\StateInterface; +use Magento\Newsletter\Helper\Data; +use Magento\Newsletter\Model\Queue; use Magento\Newsletter\Model\Subscriber; +use Magento\Store\Api\Data\StoreInterface; +use Magento\Store\Model\ScopeInterface; +use Magento\Store\Model\StoreManagerInterface; +use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\MockObject\MockObject; /** + * Test Subscriber model functionality + * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class SubscriberTest extends \PHPUnit\Framework\TestCase +class SubscriberTest extends TestCase { /** - * @var \Magento\Newsletter\Helper\Data|\PHPUnit_Framework_MockObject_MockObject + * @var Data|MockObject */ - protected $newsletterData; + private $newsletterData; /** - * @var \Magento\Framework\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject + * @var ScopeConfigInterface|MockObject */ - protected $scopeConfig; + private $scopeConfig; /** - * @var \Magento\Framework\Mail\Template\TransportBuilder|\PHPUnit_Framework_MockObject_MockObject + * @var TransportBuilder|MockObject */ - protected $transportBuilder; + private $transportBuilder; /** - * @var \Magento\Store\Model\StoreManagerInterface|\PHPUnit_Framework_MockObject_MockObject + * @var StoreManagerInterface|MockObject */ - protected $storeManager; + private $storeManager; /** - * @var \Magento\Customer\Model\Session|\PHPUnit_Framework_MockObject_MockObject + * @var Session|MockObject */ - protected $customerSession; + private $customerSession; /** - * @var \Magento\Customer\Api\CustomerRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject + * @var CustomerRepositoryInterface|MockObject */ - protected $customerRepository; + private $customerRepository; /** - * @var \Magento\Customer\Api\AccountManagementInterface|\PHPUnit_Framework_MockObject_MockObject + * @var AccountManagementInterface|MockObject */ - protected $customerAccountManagement; + private $customerAccountManagement; /** - * @var \Magento\Framework\Translate\Inline\StateInterface|\PHPUnit_Framework_MockObject_MockObject + * @var StateInterface|MockObject */ - protected $inlineTranslation; + private $inlineTranslation; /** - * @var \Magento\Newsletter\Model\ResourceModel\Subscriber|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Newsletter\Model\ResourceModel\Subscriber|MockObject */ - protected $resource; + private $resource; /** - * @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager + * @var ObjectManager */ - protected $objectManager; + private $objectManager; /** - * @var \Magento\Framework\Api\DataObjectHelper|\PHPUnit_Framework_MockObject_MockObject + * @var DataObjectHelper|MockObject */ private $dataObjectHelper; /** - * @var \Magento\Customer\Api\Data\CustomerInterfaceFactory|\PHPUnit_Framework_MockObject_MockObject + * @var CustomerInterfaceFactory|MockObject */ private $customerFactory; /** - * @var \Magento\Newsletter\Model\Subscriber + * @var Subscriber */ - protected $subscriber; + private $subscriber; + /** + * @inheritdoc + */ protected function setUp() { - $this->newsletterData = $this->createMock(\Magento\Newsletter\Helper\Data::class); - $this->scopeConfig = $this->createMock(\Magento\Framework\App\Config\ScopeConfigInterface::class); - $this->transportBuilder = $this->createPartialMock(\Magento\Framework\Mail\Template\TransportBuilder::class, [ + $this->newsletterData = $this->createMock(Data::class); + $this->scopeConfig = $this->createMock(ScopeConfigInterface::class); + $this->transportBuilder = $this->createPartialMock( + TransportBuilder::class, + [ 'setTemplateIdentifier', 'setTemplateOptions', 'setTemplateVars', 'setFrom', 'addTo', 'getTransport' - ]); - $this->storeManager = $this->createMock(\Magento\Store\Model\StoreManagerInterface::class); - $this->customerSession = $this->createPartialMock(\Magento\Customer\Model\Session::class, [ + ] + ); + $this->storeManager = $this->createMock(StoreManagerInterface::class); + $this->customerSession = $this->createPartialMock( + Session::class, + [ 'isLoggedIn', 'getCustomerDataObject', 'getCustomerId' - ]); - $this->customerRepository = $this->createMock(\Magento\Customer\Api\CustomerRepositoryInterface::class); - $this->customerAccountManagement = $this->createMock(\Magento\Customer\Api\AccountManagementInterface::class); - $this->inlineTranslation = $this->createMock(\Magento\Framework\Translate\Inline\StateInterface::class); - $this->resource = $this->createPartialMock(\Magento\Newsletter\Model\ResourceModel\Subscriber::class, [ + ] + ); + $this->customerRepository = $this->createMock(CustomerRepositoryInterface::class); + $this->customerAccountManagement = $this->createMock(AccountManagementInterface::class); + $this->inlineTranslation = $this->createMock(StateInterface::class); + $this->resource = $this->createPartialMock( + \Magento\Newsletter\Model\ResourceModel\Subscriber::class, + [ 'loadByEmail', 'getIdFieldName', 'save', - 'loadByCustomerData', - 'received' - ]); - $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); + 'loadByCustomer', + 'received', + 'loadBySubscriberEmail', + 'loadByCustomerId', + ] + ); + $this->objectManager = new ObjectManager($this); - $this->customerFactory = $this->getMockBuilder(\Magento\Customer\Api\Data\CustomerInterfaceFactory::class) + $this->customerFactory = $this->getMockBuilder(CustomerInterfaceFactory::class) ->setMethods(['create']) ->disableOriginalConstructor() ->getMock(); - $this->dataObjectHelper = $this->getMockBuilder(\Magento\Framework\Api\DataObjectHelper::class) + $this->dataObjectHelper = $this->getMockBuilder(DataObjectHelper::class) ->disableOriginalConstructor() ->getMock(); $this->subscriber = $this->objectManager->getObject( - \Magento\Newsletter\Model\Subscriber::class, + Subscriber::class, [ 'newsletterData' => $this->newsletterData, 'scopeConfig' => $this->scopeConfig, @@ -128,250 +162,78 @@ protected function setUp() 'inlineTranslation' => $this->inlineTranslation, 'resource' => $this->resource, 'customerFactory' => $this->customerFactory, - 'dataObjectHelper' => $this->dataObjectHelper - ] - ); - } - - public function testSubscribe() - { - $email = 'subscriber_email@magento.com'; - $storeId = 1; - $customerData = ['store_id' => $storeId, 'email' => $email]; - $storeModel = $this->getMockBuilder(\Magento\Store\Model\Store::class) - ->disableOriginalConstructor() - ->getMock(); - $this->storeManager->expects($this->any())->method('getStore')->willReturn($storeModel); - $storeModel->expects($this->any())->method('getId')->willReturn($storeId); - $customer = $this->createMock(\Magento\Customer\Api\Data\CustomerInterface::class); - $this->customerFactory->expects($this->once())->method('create')->willReturn($customer); - $this->dataObjectHelper->expects($this->once())->method('populateWithArray')->with( - $customer, - $customerData, - \Magento\Customer\Api\Data\CustomerInterface::class - ); - $this->resource->expects($this->any())->method('loadByCustomerData')->with($customer)->willReturn( - [ - 'subscriber_status' => Subscriber::STATUS_UNSUBSCRIBED, - 'subscriber_email' => $email, - 'name' => 'subscriber_name' + 'dataObjectHelper' => $this->dataObjectHelper, ] ); - $this->scopeConfig->expects($this->any())->method('getValue')->willReturn(true); - $this->customerSession->expects($this->any())->method('isLoggedIn')->willReturn(true); - $customerDataModel = $this->createMock(\Magento\Customer\Api\Data\CustomerInterface::class); - $this->customerSession->expects($this->any())->method('getCustomerDataObject')->willReturn($customerDataModel); - $this->customerSession->expects($this->any())->method('getCustomerId')->willReturn(1); - $customerDataModel->expects($this->any())->method('getEmail')->willReturn($email); - $this->customerRepository->expects($this->any())->method('getById')->willReturn($customerDataModel); - $customerDataModel->expects($this->any())->method('getStoreId')->willReturn($storeId); - $customerDataModel->expects($this->any())->method('getId')->willReturn(1); - $this->sendEmailCheck(); - $this->resource->expects($this->atLeastOnce())->method('save')->willReturnSelf(); - - $this->assertEquals(Subscriber::STATUS_NOT_ACTIVE, $this->subscriber->subscribe($email)); } - public function testSubscribeNotLoggedIn() + /** + * Test to Load by subscriber email + * + * @return void + */ + public function testLoadBySubscriberEmail(): void { - $email = 'subscriber_email@magento.com'; - $storeId = 1; - $customerData = ['store_id' => $storeId, 'email' => $email]; - $storeModel = $this->getMockBuilder(\Magento\Store\Model\Store::class) - ->disableOriginalConstructor() - ->getMock(); - $this->storeManager->expects($this->any())->method('getStore')->willReturn($storeModel); - $storeModel->expects($this->any())->method('getId')->willReturn($storeId); - $customer = $this->createMock(\Magento\Customer\Api\Data\CustomerInterface::class); - $this->customerFactory->expects($this->once())->method('create')->willReturn($customer); - $this->dataObjectHelper->expects($this->once())->method('populateWithArray')->with( - $customer, - $customerData, - \Magento\Customer\Api\Data\CustomerInterface::class + $email = 'subscriber_email@example.com'; + $websiteId = 1; + $subscriberData = ['some_filed' => 'value']; + + $this->resource->expects($this->once()) + ->method('loadBySubscriberEmail') + ->with($email, $websiteId) + ->willReturn($subscriberData); + + $this->assertEquals( + $subscriberData, + $this->subscriber->loadBySubscriberEmail($email, $websiteId)->getData() ); - $this->resource->expects($this->any())->method('loadByCustomerData')->with($customer)->willReturn( - [ - 'subscriber_status' => Subscriber::STATUS_UNSUBSCRIBED, - 'subscriber_email' => $email, - 'name' => 'subscriber_name' - ] - ); - $this->scopeConfig->expects($this->any())->method('getValue')->willReturn(true); - $this->customerSession->expects($this->any())->method('isLoggedIn')->willReturn(false); - $customerDataModel = $this->createMock(\Magento\Customer\Api\Data\CustomerInterface::class); - $this->customerSession->expects($this->any())->method('getCustomerDataObject')->willReturn($customerDataModel); - $this->customerSession->expects($this->any())->method('getCustomerId')->willReturn(1); - $customerDataModel->expects($this->any())->method('getEmail')->willReturn($email); - $this->customerRepository->expects($this->any())->method('getById')->willReturn($customerDataModel); - $customerDataModel->expects($this->any())->method('getStoreId')->willReturn($storeId); - $customerDataModel->expects($this->any())->method('getId')->willReturn(1); - $this->sendEmailCheck(); - $this->resource->expects($this->atLeastOnce())->method('save')->willReturnSelf(); - - $this->assertEquals(Subscriber::STATUS_NOT_ACTIVE, $this->subscriber->subscribe($email)); } - public function testUpdateSubscription() - { - $storeId = 2; - $customerId = 1; - $customerDataMock = $this->getMockBuilder(\Magento\Customer\Api\Data\CustomerInterface::class) - ->getMock(); - $this->customerRepository->expects($this->atLeastOnce()) - ->method('getById') - ->with($customerId)->willReturn($customerDataMock); - $this->resource->expects($this->atLeastOnce()) - ->method('loadByCustomerData') - ->with($customerDataMock) - ->willReturn( - [ - 'subscriber_id' => 1, - 'subscriber_status' => Subscriber::STATUS_SUBSCRIBED - ] - ); - $customerDataMock->expects($this->atLeastOnce())->method('getId')->willReturn('id'); - $this->resource->expects($this->atLeastOnce())->method('save')->willReturnSelf(); - $this->customerAccountManagement->expects($this->once()) - ->method('getConfirmationStatus') - ->with($customerId) - ->willReturn('account_confirmation_required'); - $customerDataMock->expects($this->exactly(2))->method('getStoreId')->willReturn($storeId); - $customerDataMock->expects($this->once())->method('getEmail')->willReturn('email'); - - $storeModel = $this->getMockBuilder(\Magento\Store\Model\Store::class) - ->disableOriginalConstructor() - ->setMethods(['getId']) - ->getMock(); - $this->storeManager->expects($this->any())->method('getStore')->willReturn($storeModel); - - $this->assertEquals($this->subscriber, $this->subscriber->updateSubscription($customerId)); - } - - public function testUnsubscribeCustomerById() + /** + * Test to Load by customer + * + * @return void + */ + public function testLoadByCustomer(): void { - $storeId = 2; $customerId = 1; - $customerDataMock = $this->getMockBuilder(\Magento\Customer\Api\Data\CustomerInterface::class) - ->getMock(); - $this->customerRepository->expects($this->atLeastOnce()) - ->method('getById') - ->with($customerId)->willReturn($customerDataMock); - $this->resource->expects($this->atLeastOnce()) - ->method('loadByCustomerData') - ->with($customerDataMock) - ->willReturn( - [ - 'subscriber_id' => 1, - 'subscriber_status' => Subscriber::STATUS_SUBSCRIBED - ] - ); - $customerDataMock->expects($this->atLeastOnce())->method('getId')->willReturn('id'); - $this->resource->expects($this->atLeastOnce())->method('save')->willReturnSelf(); - $customerDataMock->expects($this->exactly(2))->method('getStoreId')->willReturn($storeId); - $customerDataMock->expects($this->once())->method('getEmail')->willReturn('email'); - $this->sendEmailCheck(); + $websiteId = 1; + $subscriberData = ['some_filed' => 'value']; - $this->subscriber->unsubscribeCustomerById($customerId); - } - - public function testSubscribeCustomerById() - { - $storeId = 2; - $customerId = 1; - $customerDataMock = $this->getMockBuilder(\Magento\Customer\Api\Data\CustomerInterface::class) - ->getMock(); - $this->customerRepository->expects($this->atLeastOnce()) - ->method('getById') - ->with($customerId)->willReturn($customerDataMock); - $this->resource->expects($this->atLeastOnce()) - ->method('loadByCustomerData') - ->with($customerDataMock) - ->willReturn( - [ - 'subscriber_id' => 1, - 'subscriber_status' => Subscriber::STATUS_UNSUBSCRIBED - ] - ); - $customerDataMock->expects($this->atLeastOnce())->method('getId')->willReturn('id'); - $this->resource->expects($this->atLeastOnce())->method('save')->willReturnSelf(); - $customerDataMock->expects($this->exactly(2))->method('getStoreId')->willReturn($storeId); - $customerDataMock->expects($this->once())->method('getEmail')->willReturn('email'); - $this->sendEmailCheck(); + $this->resource->expects($this->once()) + ->method('loadByCustomerId') + ->with($customerId, $websiteId) + ->willReturn($subscriberData); - $this->subscriber->subscribeCustomerById($customerId); - } - - public function testSubscribeCustomerById1() - { - $storeId = 2; - $customerId = 1; - $customerDataMock = $this->getMockBuilder(\Magento\Customer\Api\Data\CustomerInterface::class) - ->getMock(); - $this->customerRepository->expects($this->atLeastOnce()) - ->method('getById') - ->with($customerId)->willReturn($customerDataMock); - $this->resource->expects($this->atLeastOnce()) - ->method('loadByCustomerData') - ->with($customerDataMock) - ->willReturn( - [ - 'subscriber_id' => 1, - 'subscriber_status' => Subscriber::STATUS_UNSUBSCRIBED - ] - ); - $customerDataMock->expects($this->atLeastOnce())->method('getId')->willReturn('id'); - $this->resource->expects($this->atLeastOnce())->method('save')->willReturnSelf(); - $customerDataMock->expects($this->exactly(2))->method('getStoreId')->willReturn($storeId); - $customerDataMock->expects($this->once())->method('getEmail')->willReturn('email'); - $this->sendEmailCheck(); - $this->customerAccountManagement->expects($this->once()) - ->method('getConfirmationStatus') - ->willReturn(\Magento\Customer\Api\AccountManagementInterface::ACCOUNT_CONFIRMATION_NOT_REQUIRED); - $this->scopeConfig->expects($this->atLeastOnce())->method('getValue')->with()->willReturn(true); - - $this->subscriber->subscribeCustomerById($customerId); - $this->assertEquals(Subscriber::STATUS_NOT_ACTIVE, $this->subscriber->getStatus()); - } - - public function testSubscribeCustomerByIdAfterConfirmation() - { - $storeId = 2; - $customerId = 1; - $customerDataMock = $this->getMockBuilder(\Magento\Customer\Api\Data\CustomerInterface::class) - ->getMock(); - $this->customerRepository->expects($this->atLeastOnce()) - ->method('getById') - ->with($customerId)->willReturn($customerDataMock); - $this->resource->expects($this->atLeastOnce()) - ->method('loadByCustomerData') - ->with($customerDataMock) - ->willReturn( - [ - 'subscriber_id' => 1, - 'subscriber_status' => Subscriber::STATUS_UNCONFIRMED - ] - ); - $customerDataMock->expects($this->atLeastOnce())->method('getId')->willReturn('id'); - $this->resource->expects($this->atLeastOnce())->method('save')->willReturnSelf(); - $customerDataMock->expects($this->exactly(2))->method('getStoreId')->willReturn($storeId); - $customerDataMock->expects($this->once())->method('getEmail')->willReturn('email'); - $this->sendEmailCheck(); - $this->customerAccountManagement->expects($this->never())->method('getConfirmationStatus'); - $this->scopeConfig->expects($this->atLeastOnce())->method('getValue')->with()->willReturn(true); - - $this->subscriber->updateSubscription($customerId); - $this->assertEquals(Subscriber::STATUS_SUBSCRIBED, $this->subscriber->getStatus()); + $this->assertEquals( + $subscriberData, + $this->subscriber->loadByCustomer($customerId, $websiteId)->getData() + ); } + /** + * Test to unsubscribe customer from newsletters + */ public function testUnsubscribe() { $this->resource->expects($this->once())->method('save')->willReturnSelf(); - $this->sendEmailCheck(); + $subscriberData = [ + 'store_id' => 2, + 'email' => 'subscriber_email@example.com', + 'name' => 'Subscriber Name', + ]; + $this->subscriber->setData($subscriberData); + $this->sendEmailCheck( + Subscriber::XML_PATH_UNSUBSCRIBE_EMAIL_TEMPLATE, + Subscriber::XML_PATH_UNSUBSCRIBE_EMAIL_IDENTITY + ); $this->assertEquals($this->subscriber, $this->subscriber->unsubscribe()); } /** + * Test to try unsubscribe customer from newsletters with wrong confirmation code + * * @expectedException \Magento\Framework\Exception\LocalizedException * @expectedExceptionMessage This is an invalid subscription confirmation code. */ @@ -383,6 +245,9 @@ public function testUnsubscribeException() $this->subscriber->unsubscribe(); } + /** + * Test to get subscriber full name + */ public function testGetSubscriberFullName() { $this->subscriber->setFirstname('John'); @@ -391,6 +256,9 @@ public function testGetSubscriberFullName() $this->assertEquals('John Doe', $this->subscriber->getSubscriberFullName()); } + /** + * Test to confirm customer subscription + */ public function testConfirm() { $code = 111; @@ -400,6 +268,9 @@ public function testConfirm() $this->assertTrue($this->subscriber->confirm($code)); } + /** + * Test to doesn't confirm customer subscription + */ public function testConfirmWrongCode() { $code = 111; @@ -408,9 +279,12 @@ public function testConfirmWrongCode() $this->assertFalse($this->subscriber->confirm($code)); } + /** + * Test to mark receiving subscriber of queue newsletter + */ public function testReceived() { - $queue = $this->getMockBuilder(\Magento\Newsletter\Model\Queue::class) + $queue = $this->getMockBuilder(Queue::class) ->disableOriginalConstructor() ->getMock(); $this->resource->expects($this->once())->method('received')->with($this->subscriber, $queue)->willReturnSelf(); @@ -419,28 +293,103 @@ public function testReceived() } /** - * @return $this + * Test to Sends out confirmation email + * + * @return void */ - protected function sendEmailCheck() + public function testSendConfirmationRequestEmail(): void { - $storeModel = $this->getMockBuilder(\Magento\Store\Model\Store::class) - ->disableOriginalConstructor() - ->setMethods(['getId']) - ->getMock(); - $transport = $this->createMock(\Magento\Framework\Mail\TransportInterface::class); - $this->scopeConfig->expects($this->any())->method('getValue')->willReturn(true); - $this->transportBuilder->expects($this->once())->method('setTemplateIdentifier')->willReturnSelf(); - $this->transportBuilder->expects($this->once())->method('setTemplateOptions')->willReturnSelf(); - $this->transportBuilder->expects($this->once())->method('setTemplateVars')->willReturnSelf(); - $this->transportBuilder->expects($this->once())->method('setFrom')->willReturnSelf(); - $this->transportBuilder->expects($this->once())->method('addTo')->willReturnSelf(); - $this->storeManager->expects($this->any())->method('getStore')->willReturn($storeModel); - $storeModel->expects($this->any())->method('getId')->willReturn(1); - $this->transportBuilder->expects($this->once())->method('getTransport')->willReturn($transport); + $confirmLink = 'confirm link'; + $storeId = 2; + $subscriberData = [ + 'store_id' => $storeId, + 'email' => 'subscriber_email@example.com', + 'name' => 'Subscriber Name', + ]; + $store = $this->createMock(StoreInterface::class); + $this->storeManager->method('getStore')->with($storeId)->willReturn($store); + $this->newsletterData->expects($this->once()) + ->method('getConfirmationUrl') + ->with($this->subscriber) + ->willReturn($confirmLink); + $this->subscriber->setData($subscriberData); + $this->sendEmailCheck( + Subscriber::XML_PATH_CONFIRM_EMAIL_TEMPLATE, + Subscriber::XML_PATH_CONFIRM_EMAIL_IDENTITY, + [ + 'store' => $store, + 'subscriber_data' => [ + 'confirmation_link' => $confirmLink, + ], + ] + ); + $this->assertEquals($this->subscriber, $this->subscriber->sendConfirmationRequestEmail()); + } + + /** + * Test to Sends out success email + * + * @return void + */ + public function testSendConfirmationSuccessEmail(): void + { + $subscriberData = [ + 'store_id' => 2, + 'email' => 'subscriber_email@example.com', + 'name' => 'Subscriber Name', + ]; + $this->subscriber->setData($subscriberData); + $this->sendEmailCheck( + Subscriber::XML_PATH_SUCCESS_EMAIL_TEMPLATE, + Subscriber::XML_PATH_SUCCESS_EMAIL_IDENTITY + ); + $this->assertEquals($this->subscriber, $this->subscriber->sendConfirmationSuccessEmail()); + } + + /** + * Check to send email + * + * @param string $templateConfigPath + * @param string $identityTemplatePath + * @return void + */ + private function sendEmailCheck(string $templateConfigPath, string $identityTemplatePath, array $vars = []): void + { + $template = 'email_template'; + $identity = 'email_identity'; + $vars += ['subscriber' => $this->subscriber]; + + $this->scopeConfig->method('getValue') + ->willReturnMap( + [ + [$templateConfigPath, ScopeInterface::SCOPE_STORE, $this->subscriber->getStoreId(), $template], + [$identityTemplatePath, ScopeInterface::SCOPE_STORE, $this->subscriber->getStoreId(), $identity], + ] + ); + $this->transportBuilder->expects($this->once()) + ->method('setTemplateIdentifier') + ->with($template) + ->willReturnSelf(); + $this->transportBuilder->expects($this->once()) + ->method('setTemplateOptions') + ->with(['area' => Area::AREA_FRONTEND, 'store' => $this->subscriber->getStoreId()]) + ->willReturnSelf(); + $this->transportBuilder->expects($this->once()) + ->method('setTemplateVars') + ->with($vars) + ->willReturnSelf(); + $this->transportBuilder->expects($this->once()) + ->method('setFrom') + ->with($identity) + ->willReturnSelf(); + $this->transportBuilder->expects($this->once()) + ->method('addTo') + ->with($this->subscriber->getEmail(), $this->subscriber->getName()) + ->willReturnSelf(); + $transport = $this->createMock(TransportInterface::class); $transport->expects($this->once())->method('sendMessage')->willReturnSelf(); + $this->transportBuilder->expects($this->once())->method('getTransport')->willReturn($transport); $this->inlineTranslation->expects($this->once())->method('suspend')->willReturnSelf(); $this->inlineTranslation->expects($this->once())->method('resume')->willReturnSelf(); - - return $this; } } diff --git a/app/code/Magento/Newsletter/Test/Unit/Model/SubscriptionManagerTest.php b/app/code/Magento/Newsletter/Test/Unit/Model/SubscriptionManagerTest.php new file mode 100644 index 0000000000000..ecb30f12742c8 --- /dev/null +++ b/app/code/Magento/Newsletter/Test/Unit/Model/SubscriptionManagerTest.php @@ -0,0 +1,651 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Newsletter\Test\Unit\Model; + +use Magento\Customer\Api\AccountManagementInterface; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Newsletter\Model\Subscriber; +use Magento\Newsletter\Model\SubscriberFactory; +use Magento\Newsletter\Model\SubscriptionManager; +use Magento\Store\Api\Data\StoreInterface; +use Magento\Store\Model\ScopeInterface; +use Magento\Store\Model\StoreManagerInterface; +use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\MockObject\MockObject; +use Psr\Log\LoggerInterface; + +/** + * Test to update newsletter subscription status + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ +class SubscriptionManagerTest extends TestCase +{ + /** + * @var SubscriberFactory|MockObject + */ + private $subscriberFactory; + + /** + * @var LoggerInterface|MockObject + */ + private $logger; + + /** + * @var StoreManagerInterface|MockObject + */ + private $storeManager; + + /** + * @var ScopeConfigInterface|MockObject + */ + private $scopeConfig; + + /** + * @var AccountManagementInterface|MockObject + */ + private $customerAccountManagement; + + /** + * @var CustomerRepositoryInterface|MockObject + */ + private $customerRepository; + + /** + * @var SubscriptionManager + */ + private $subscriptionManager; + + /** + * @inheritdoc + */ + protected function setUp() + { + $this->subscriberFactory = $this->createMock(SubscriberFactory::class); + $this->logger = $this->createMock(LoggerInterface::class); + $this->storeManager = $this->createMock(StoreManagerInterface::class); + $this->scopeConfig = $this->createMock(ScopeConfigInterface::class); + $this->customerAccountManagement = $this->createMock(AccountManagementInterface::class); + $this->customerRepository = $this->createMock(CustomerRepositoryInterface::class); + + $objectManager = new ObjectManager($this); + $this->subscriptionManager = $objectManager->getObject( + SubscriptionManager::class, + [ + 'subscriberFactory' => $this->subscriberFactory, + 'logger' => $this->logger, + 'storeManager' => $this->storeManager, + 'scopeConfig' => $this->scopeConfig, + 'customerAccountManagement' => $this->customerAccountManagement, + 'customerRepository' => $this->customerRepository, + ] + ); + } + + /** + * Test to Subscribe to newsletters by email + * + * @param array $subscriberData + * @param string $email + * @param int $storeId + * @param bool $isConfirmNeed + * @param array $expectedData + * @dataProvider subscribeDataProvider + */ + public function testSubscribe( + array $subscriberData, + string $email, + int $storeId, + bool $isConfirmNeed, + array $expectedData + ): void { + $websiteId = 1; + $store = $this->createMock(StoreInterface::class); + $store->method('getWebsiteId')->willReturn($websiteId); + $this->storeManager->method('getStore')->with($storeId)->willReturn($store); + /** @var Subscriber|MockObject $subscriber */ + $subscriber = $this->createPartialMock( + Subscriber::class, + [ + 'loadBySubscriberEmail', + 'randomSequence', + 'save', + 'sendConfirmationRequestEmail', + 'sendConfirmationSuccessEmail', + 'sendUnsubscriptionEmail' + ] + ); + $subscriber->expects($this->once()) + ->method('loadBySubscriberEmail') + ->with($email, $websiteId) + ->willReturnSelf(); + $subscriber->setData($subscriberData); + if (empty($subscriberData['id'])) { + $subscriber->method('randomSequence')->willReturn($expectedData['subscriber_confirm_code']); + } + $this->subscriberFactory->method('create')->willReturn($subscriber); + $this->scopeConfig->method('isSetFlag') + ->with(Subscriber::XML_PATH_CONFIRMATION_FLAG, ScopeInterface::SCOPE_STORE, $storeId) + ->willReturn($isConfirmNeed); + + $this->assertEquals( + $subscriber, + $this->subscriptionManager->subscribe($email, $storeId) + ); + $this->assertEquals($subscriber->getData(), $expectedData); + } + + /** + * Subscribe customer data provider + * + * @return array + */ + public function subscribeDataProvider(): array + { + return [ + 'Subscribe new' => [ + 'subscriber_data' => [], + 'email' => 'email@example.com', + 'store_id' => 1, + 'is_confirm_need' => false, + 'expected_data' => [ + 'subscriber_email' => 'email@example.com', + 'store_id' => 1, + 'subscriber_status' => Subscriber::STATUS_SUBSCRIBED, + 'subscriber_confirm_code' => '', + ], + ], + 'Subscribe new: confirm required' => [ + 'subscriber_data' => [], + 'email' => 'email@example.com', + 'store_id' => 1, + 'is_confirm_need' => true, + 'expected_data' => [ + 'subscriber_email' => 'email@example.com', + 'store_id' => 1, + 'subscriber_status' => Subscriber::STATUS_NOT_ACTIVE, + 'subscriber_confirm_code' => '', + ], + ], + 'Subscribe existing' => [ + 'subscriber_data' => [ + 'subscriber_id' => 1, + 'subscriber_email' => 'email@example.com', + 'store_id' => 1, + 'subscriber_status' => Subscriber::STATUS_UNSUBSCRIBED, + 'subscriber_confirm_code' => '', + 'customer_id' => 0, + ], + 'email' => 'email@example.com', + 'store_id' => 1, + 'is_confirm_need' => false, + 'expected_data' => [ + 'subscriber_id' => 1, + 'subscriber_email' => 'email@example.com', + 'store_id' => 1, + 'subscriber_status' => Subscriber::STATUS_SUBSCRIBED, + 'subscriber_confirm_code' => '', + 'customer_id' => 0, + ], + ], + ]; + } + + /** + * Test to Unsubscribe from newsletters by email + */ + public function testUnsubscribe(): void + { + $email = 'email@example.com'; + $storeId = 2; + $websiteId = 1; + $store = $this->createMock(StoreInterface::class); + $store->method('getWebsiteId')->willReturn($websiteId); + $this->storeManager->method('getStore')->with($storeId)->willReturn($store); + $confirmCode = 'confirm code'; + /** @var Subscriber|MockObject $subscriber */ + $subscriber = $this->createPartialMock( + Subscriber::class, + ['loadBySubscriberEmail', 'getId', 'setCheckCode', 'unsubscribe'] + ); + $subscriber->expects($this->once()) + ->method('loadBySubscriberEmail') + ->with($email, $websiteId) + ->willReturnSelf(); + $subscriber->method('getId')->willReturn(1); + $subscriber->expects($this->once())->method('setCheckCode')->with($confirmCode)->willReturnSelf(); + $subscriber->expects($this->once())->method('unsubscribe')->willReturnSelf(); + $this->subscriberFactory->method('create')->willReturn($subscriber); + + $this->assertEquals( + $subscriber, + $this->subscriptionManager->unsubscribe($email, $storeId, $confirmCode) + ); + } + + /** + * Test to Subscribe customer to newsletter + * + * @param array $subscriberData + * @param array $customerData + * @param int $storeId + * @param bool $isConfirmNeed + * @param array $expectedData + * @param bool $needToSendEmail + * @dataProvider subscribeCustomerDataProvider + */ + public function testSubscribeCustomer( + array $subscriberData, + array $customerData, + int $storeId, + bool $isConfirmNeed, + array $expectedData, + bool $needToSendEmail + ): void { + $websiteId = 1; + $customerId = $customerData['id']; + $store = $this->createMock(StoreInterface::class); + $store->method('getWebsiteId')->willReturn($websiteId); + $this->storeManager->method('getStore')->with($storeId)->willReturn($store); + /** @var CustomerInterface|MockObject $customer */ + $customer = $this->createMock(CustomerInterface::class); + $customer->method('getId')->willReturn($customerId); + $customer->method('getEmail')->willReturn($customerData['email']); + $this->customerRepository->method('getById')->with($customerId)->willReturn($customer); + /** @var Subscriber|MockObject $subscriber */ + $subscriber = $this->createPartialMock( + Subscriber::class, + [ + 'loadByCustomer', + 'loadBySubscriberEmail', + 'randomSequence', + 'save', + 'sendConfirmationRequestEmail', + 'sendConfirmationSuccessEmail', + 'sendUnsubscriptionEmail' + ] + ); + $subscriber->expects($this->once()) + ->method('loadByCustomer') + ->with($customerId, $websiteId) + ->willReturnSelf(); + if (empty($subscriberData['subscriber_id'])) { + $subscriber->expects($this->once()) + ->method('loadBySubscriberEmail') + ->with($customerData['email'], $websiteId) + ->willReturnSelf(); + } + $subscriber->setData($subscriberData); + if (empty($subscriberData['subscriber_id'])) { + $subscriber->method('randomSequence')->willReturn($expectedData['subscriber_confirm_code']); + } + $sendEmailMethod = $this->getSendEmailMethod($expectedData['subscriber_status'] ?? 0); + if ($needToSendEmail) { + $subscriber->expects($this->once())->method($sendEmailMethod); + } else { + $subscriber->expects($this->never())->method('sendConfirmationRequestEmail'); + $subscriber->expects($this->never())->method('sendConfirmationSuccessEmail'); + $subscriber->expects($this->never())->method('sendUnsubscriptionEmail'); + } + $this->subscriberFactory->method('create')->willReturn($subscriber); + $this->scopeConfig->method('isSetFlag') + ->with(Subscriber::XML_PATH_CONFIRMATION_FLAG, ScopeInterface::SCOPE_STORE, $storeId) + ->willReturn($isConfirmNeed); + $this->customerAccountManagement + ->method('getConfirmationStatus') + ->willReturn($customerData['confirmation_status']); + + $this->assertEquals( + $subscriber, + $this->subscriptionManager->subscribeCustomer($customerId, $storeId) + ); + $this->assertEquals($subscriber->getData(), $expectedData); + } + + /** + * Get expected send email method + * + * @param int $status + * @return string + */ + private function getSendEmailMethod(int $status): string + { + switch ($status) { + case Subscriber::STATUS_SUBSCRIBED: + $sendEmailMethod = 'sendConfirmationSuccessEmail'; + break; + case Subscriber::STATUS_NOT_ACTIVE: + $sendEmailMethod = 'sendConfirmationRequestEmail'; + break; + case Subscriber::STATUS_UNSUBSCRIBED: + $sendEmailMethod = 'sendUnsubscriptionEmail'; + break; + default: + $sendEmailMethod = ''; + } + + return $sendEmailMethod; + } + + /** + * Subscribe customer data provider + * + * @return array + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + */ + public function subscribeCustomerDataProvider(): array + { + return [ + 'Subscribe new' => [ + 'subscriber_data' => [], + 'customer_data' => [ + 'id' => 1, + 'email' => 'email@example.com', + 'confirmation_status' => AccountManagementInterface::ACCOUNT_CONFIRMED, + ], + 'store_id' => 1, + 'is_confirm_need' => false, + 'expected_data' => [ + 'customer_id' => 1, + 'subscriber_email' => 'email@example.com', + 'store_id' => 1, + 'subscriber_status' => Subscriber::STATUS_SUBSCRIBED, + 'subscriber_confirm_code' => '', + ], + 'needToSendEmail' => true, + ], + 'Subscribe new: customer confirm required' => [ + 'subscriber_data' => [], + 'customer_data' => [ + 'id' => 1, + 'email' => 'email@example.com', + 'confirmation_status' => AccountManagementInterface::ACCOUNT_CONFIRMATION_REQUIRED, + ], + 'store_id' => 1, + 'is_confirm_need' => false, + 'expected_data' => [ + 'customer_id' => 1, + 'subscriber_email' => 'email@example.com', + 'store_id' => 1, + 'subscriber_status' => Subscriber::STATUS_UNCONFIRMED, + 'subscriber_confirm_code' => '', + ], + 'needToSendEmail' => false, + ], + 'Subscribe existing' => [ + 'subscriber_data' => [ + 'subscriber_id' => 1, + 'customer_id' => 1, + 'subscriber_email' => 'email@example.com', + 'store_id' => 1, + 'subscriber_status' => Subscriber::STATUS_UNSUBSCRIBED, + 'subscriber_confirm_code' => '', + ], + 'customer_data' => [ + 'id' => 1, + 'email' => 'email@example.com', + 'confirmation_status' => AccountManagementInterface::ACCOUNT_CONFIRMED, + ], + 'store_id' => 1, + 'is_confirm_need' => false, + 'expected_data' => [ + 'subscriber_id' => 1, + 'customer_id' => 1, + 'subscriber_email' => 'email@example.com', + 'store_id' => 1, + 'subscriber_status' => Subscriber::STATUS_SUBSCRIBED, + 'subscriber_confirm_code' => '', + ], + 'needToSendEmail' => true, + ], + 'Subscribe existing: subscription confirm required' => [ + 'subscriber_data' => [ + 'subscriber_id' => 1, + 'customer_id' => 1, + 'subscriber_email' => 'email@example.com', + 'store_id' => 1, + 'subscriber_status' => Subscriber::STATUS_UNSUBSCRIBED, + 'subscriber_confirm_code' => '', + ], + 'customer_data' => [ + 'id' => 1, + 'email' => 'email@example.com', + 'confirmation_status' => AccountManagementInterface::ACCOUNT_CONFIRMED, + ], + 'store_id' => 1, + 'is_confirm_need' => true, + 'expected_data' => [ + 'subscriber_id' => 1, + 'customer_id' => 1, + 'subscriber_email' => 'email@example.com', + 'store_id' => 1, + 'subscriber_status' => Subscriber::STATUS_NOT_ACTIVE, + 'subscriber_confirm_code' => '', + ], + 'needToSendEmail' => true, + ], + 'Update subscription data' => [ + 'subscriber_data' => [ + 'subscriber_id' => 1, + 'customer_id' => 1, + 'subscriber_email' => 'email@example.com', + 'store_id' => 1, + 'subscriber_status' => Subscriber::STATUS_SUBSCRIBED, + 'subscriber_confirm_code' => '', + ], + 'customer_data' => [ + 'id' => 1, + 'email' => 'email2@example.com', + 'confirmation_status' => AccountManagementInterface::ACCOUNT_CONFIRMED, + ], + 'store_id' => 2, + 'is_confirm_need' => false, + 'expected_data' => [ + 'subscriber_id' => 1, + 'customer_id' => 1, + 'subscriber_email' => 'email2@example.com', + 'store_id' => 2, + 'subscriber_status' => Subscriber::STATUS_SUBSCRIBED, + 'subscriber_confirm_code' => '', + ], + 'needToSendEmail' => false, + ], + 'Update subscription data: subscription confirm required ' => [ + 'subscriber_data' => [ + 'subscriber_id' => 1, + 'customer_id' => 1, + 'subscriber_email' => 'email@example.com', + 'store_id' => 1, + 'subscriber_status' => Subscriber::STATUS_NOT_ACTIVE, + 'subscriber_confirm_code' => '', + ], + 'customer_data' => [ + 'id' => 1, + 'email' => 'email2@example.com', + 'confirmation_status' => AccountManagementInterface::ACCOUNT_CONFIRMED, + ], + 'store_id' => 2, + 'is_confirm_need' => true, + 'expected_data' => [ + 'subscriber_id' => 1, + 'customer_id' => 1, + 'subscriber_email' => 'email2@example.com', + 'store_id' => 2, + 'subscriber_status' => Subscriber::STATUS_NOT_ACTIVE, + 'subscriber_confirm_code' => '', + ], + 'needToSendEmail' => true, + ], + ]; + } + + /** + * Test to Unsubscribe customer from newsletter + * + * @param array $subscriberData + * @param array $customerData + * @param int $storeId + * @param array $expectedData + * @param bool $needToSendEmail + * @dataProvider unsubscribeCustomerDataProvider + */ + public function testUnsubscribeCustomer( + array $subscriberData, + array $customerData, + int $storeId, + array $expectedData, + bool $needToSendEmail + ): void { + $websiteId = 1; + $customerId = $customerData['id']; + $store = $this->createMock(StoreInterface::class); + $store->method('getWebsiteId')->willReturn($websiteId); + $this->storeManager->method('getStore')->with($storeId)->willReturn($store); + /** @var CustomerInterface|MockObject $customer */ + $customer = $this->createMock(CustomerInterface::class); + $customer->method('getId')->willReturn($customerId); + $customer->method('getEmail')->willReturn($customerData['email']); + $this->customerRepository->method('getById')->with($customerId)->willReturn($customer); + /** @var Subscriber|MockObject $subscriber */ + $subscriber = $this->createPartialMock( + Subscriber::class, + [ + 'loadByCustomer', + 'loadBySubscriberEmail', + 'randomSequence', + 'save', + 'sendConfirmationRequestEmail', + 'sendConfirmationSuccessEmail', + 'sendUnsubscriptionEmail' + ] + ); + $subscriber->expects($this->once()) + ->method('loadByCustomer') + ->with($customerId, $websiteId) + ->willReturnSelf(); + if (empty($subscriberData['subscriber_id'])) { + $subscriber->expects($this->once()) + ->method('loadBySubscriberEmail') + ->with($customerData['email'], $websiteId) + ->willReturnSelf(); + } + $subscriber->setData($subscriberData); + $sendEmailMethod = $this->getSendEmailMethod($expectedData['subscriber_status'] ?? 0); + if ($needToSendEmail) { + $subscriber->expects($this->once())->method($sendEmailMethod); + } else { + $subscriber->expects($this->never())->method('sendConfirmationRequestEmail'); + $subscriber->expects($this->never())->method('sendConfirmationSuccessEmail'); + $subscriber->expects($this->never())->method('sendUnsubscriptionEmail'); + } + $this->subscriberFactory->method('create')->willReturn($subscriber); + + $this->assertEquals( + $subscriber, + $this->subscriptionManager->unsubscribeCustomer($customerId, $storeId) + ); + $this->assertEquals($subscriber->getData(), $expectedData); + } + + /** + * Unsubscribe customer data provider + * + * @return array + */ + public function unsubscribeCustomerDataProvider(): array + { + return [ + 'Unsubscribe new' => [ + 'subscriber_data' => [], + 'customer_data' => [ + 'id' => 1, + 'email' => 'email@example.com', + ], + 'store_id' => 1, + 'expected_data' => [ + ], + 'needToSendEmail' => false, + ], + 'Unsubscribe existing' => [ + 'subscriber_data' => [ + 'subscriber_id' => 1, + 'customer_id' => 1, + 'subscriber_email' => 'email@example.com', + 'store_id' => 1, + 'subscriber_status' => Subscriber::STATUS_SUBSCRIBED, + 'subscriber_confirm_code' => '', + ], + 'customer_data' => [ + 'id' => 1, + 'email' => 'email@example.com', + ], + 'store_id' => 1, + 'expected_data' => [ + 'subscriber_id' => 1, + 'customer_id' => 1, + 'subscriber_email' => 'email@example.com', + 'store_id' => 1, + 'subscriber_status' => Subscriber::STATUS_UNSUBSCRIBED, + 'subscriber_confirm_code' => '', + ], + 'needToSendEmail' => true, + ], + 'Unsubscribe existing: subscription confirm required' => [ + 'subscriber_data' => [ + 'subscriber_id' => 1, + 'customer_id' => 1, + 'subscriber_email' => 'email@example.com', + 'store_id' => 1, + 'subscriber_status' => Subscriber::STATUS_NOT_ACTIVE, + 'subscriber_confirm_code' => '', + ], + 'customer_data' => [ + 'id' => 1, + 'email' => 'email@example.com', + ], + 'store_id' => 1, + 'expected_data' => [ + 'subscriber_id' => 1, + 'customer_id' => 1, + 'subscriber_email' => 'email@example.com', + 'store_id' => 1, + 'subscriber_status' => Subscriber::STATUS_NOT_ACTIVE, + 'subscriber_confirm_code' => '', + ], + 'needToSendEmail' => false, + ], + 'Update subscription data' => [ + 'subscriber_data' => [ + 'subscriber_id' => 1, + 'customer_id' => 1, + 'subscriber_email' => 'email@example.com', + 'store_id' => 1, + 'subscriber_status' => Subscriber::STATUS_UNSUBSCRIBED, + 'subscriber_confirm_code' => '', + ], + 'customer_data' => [ + 'id' => 1, + 'email' => 'email2@example.com', + ], + 'store_id' => 2, + 'expected_data' => [ + 'subscriber_id' => 1, + 'customer_id' => 1, + 'subscriber_email' => 'email2@example.com', + 'store_id' => 2, + 'subscriber_status' => Subscriber::STATUS_UNSUBSCRIBED, + 'subscriber_confirm_code' => '', + ], + 'needToSendEmail' => false, + ], + ]; + } +} diff --git a/app/code/Magento/Newsletter/etc/di.xml b/app/code/Magento/Newsletter/etc/di.xml index 179ec19cccfc5..3c35936a2e8aa 100644 --- a/app/code/Magento/Newsletter/etc/di.xml +++ b/app/code/Magento/Newsletter/etc/di.xml @@ -25,4 +25,11 @@ <plugin name="update_newsletter_subscription_on_customer_update" type="Magento\Newsletter\Model\Plugin\CustomerPlugin"/> </type> + <type name="Magento\Newsletter\Model\Subscriber"> + <arguments> + <argument name="customerSession" xsi:type="object">Magento\Customer\Model\Session\Proxy</argument> + </arguments> + </type> + <preference for="Magento\Newsletter\Model\SubscriptionManagerInterface" + type="Magento\Newsletter\Model\SubscriptionManager"/> </config> diff --git a/app/code/Magento/Store/Model/System/Store.php b/app/code/Magento/Store/Model/System/Store.php index 744019b107247..d13781b8c146b 100644 --- a/app/code/Magento/Store/Model/System/Store.php +++ b/app/code/Magento/Store/Model/System/Store.php @@ -52,6 +52,11 @@ class Store extends \Magento\Framework\DataObject implements OptionSourceInterfa */ protected $_storeManager; + /** + * @var string + */ + private $nonEscapableNbspChar; + /** * Init model * Load Website, Group and Store collections @@ -61,6 +66,9 @@ class Store extends \Magento\Framework\DataObject implements OptionSourceInterfa public function __construct(\Magento\Store\Model\StoreManagerInterface $storeManager) { $this->_storeManager = $storeManager; + // phpcs:ignore Magento2.Functions.DiscouragedFunction + $this->nonEscapableNbspChar = html_entity_decode(' ', ENT_NOQUOTES, 'UTF-8'); + return $this->reload(); } @@ -121,9 +129,6 @@ public function getStoreValuesForForm($empty = false, $all = false) $options[] = ['label' => __('All Store Views'), 'value' => 0]; } - // phpcs:ignore Magento2.Functions.DiscouragedFunction - $nonEscapableNbspChar = html_entity_decode(' ', ENT_NOQUOTES, 'UTF-8'); - foreach ($this->_websiteCollection as $website) { $websiteShow = false; foreach ($this->_groupCollection as $group) { @@ -140,13 +145,13 @@ public function getStoreValuesForForm($empty = false, $all = false) $websiteShow = true; } $values[] = [ - 'label' => str_repeat($nonEscapableNbspChar, 4) . $store->getName(), + 'label' => str_repeat($this->nonEscapableNbspChar, 4) . $store->getName(), 'value' => $store->getId(), ]; } if (!empty($values)) { $options[] = [ - 'label' => str_repeat($nonEscapableNbspChar, 4) . $group->getName(), + 'label' => str_repeat($this->nonEscapableNbspChar, 4) . $group->getName(), 'value' => $values, ]; } @@ -216,6 +221,22 @@ public function getStoresStructure($isAll = false, $storeIds = [], $groupIds = [ return $out; } + /** + * Get store options in tree view + * + * @param bool $isAll + * @param array $storeIds + * @param array $groupIds + * @param array $websiteIds + * @return array Format: array(array('value' => '<value>', 'label' => '<label>'), ...) + */ + public function getStoreOptionsTree($isAll = false, $storeIds = [], $groupIds = [], $websiteIds = []): array + { + $storeStructure = $this->getStoresStructure($isAll, $storeIds, $groupIds, $websiteIds); + + return $this->retrieveOptionValues($storeStructure); + } + /** * Website label/value array getter, compatible with form dropdown options * @@ -480,4 +501,35 @@ public function toOptionArray() { return $this->getStoreValuesForForm(); } + + /** + * Retrieve option values + * + * Return array of options as value-label pairs in tree view + * + * @param array $structure + * @param bool $needSpacePrefix + * @return array + */ + private function retrieveOptionValues(array $structure, bool $needSpacePrefix = false): array + { + $prefix = ''; + if ($needSpacePrefix) { + $prefix = str_repeat($this->nonEscapableNbspChar, 4); + } + + $values = []; + foreach ($structure as $item) { + $value = !empty($item['children']) + ? $this->retrieveOptionValues($item['children'], true) + : $item['value']; + + $values[] = [ + 'label' => $prefix . $item['label'], + 'value' => $value, + ]; + } + + return $values; + } } diff --git a/app/design/adminhtml/Magento/backend/Magento_Customer/web/css/source/_module.less b/app/design/adminhtml/Magento/backend/Magento_Customer/web/css/source/_module.less index c8f2530df22e0..0c7dd7e7cb94c 100644 --- a/app/design/adminhtml/Magento/backend/Magento_Customer/web/css/source/_module.less +++ b/app/design/adminhtml/Magento/backend/Magento_Customer/web/css/source/_module.less @@ -78,3 +78,33 @@ } } } + +.customer-newsletter-fieldset.admin__fieldset { + &.multi-website { + > .admin__field > .admin__field-control { + width: ~'calc(100% * 0.75 - 30px)'; + + table { + th.subscriber-status { + text-align: center; + } + + td { + &.subscriber-status { + text-align: center; + } + + select.admin__control-select { + width: 100%; + } + } + } + } + } + + > .admin__field > .admin__field-control { + input[type='checkbox'] { + margin: 8px 0 0 0; + } + } +} diff --git a/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/NewsletterTest.php b/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/NewsletterTest.php index e28a9602b9377..a44101da77d6d 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/NewsletterTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/NewsletterTest.php @@ -61,12 +61,13 @@ public function tearDown() */ public function testRenderingNewsletterBlock() { + $websiteId = 1; $this->getRequest()->setParam('id', 1); $this->dispatch('backend/customer/index/edit'); $body = $this->getResponse()->getBody(); $this->assertContains('\u003Cspan\u003ENewsletter Information\u003C\/span\u003E', $body); - $this->assertContains('\u003Cinput id=\"_newslettersubscription\"', $body); + $this->assertContains('\u003Cinput id=\"_newslettersubscription_status_' . $websiteId . '\"', $body); $this->assertNotContains('checked="checked"', $body); $this->assertContains('\u003Cspan\u003ESubscribed to Newsletter\u003C\/span\u003E', $body); $this->assertContains('\u003ENo Newsletter Found\u003C', $body); diff --git a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/IndexTest.php b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/IndexTest.php index 1b7f2c1f7efdd..4fc549f3caf86 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/IndexTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/IndexTest.php @@ -128,6 +128,7 @@ public function testSaveActionWithInvalidFormData() public function testSaveActionExistingCustomerUnsubscribeNewsletter() { $customerId = 1; + $websiteId = 1; /** @var \Magento\Newsletter\Model\Subscriber $subscriber */ $subscriber = $this->objectManager->get(\Magento\Newsletter\Model\SubscriberFactory::class)->create(); @@ -144,7 +145,7 @@ public function testSaveActionExistingCustomerUnsubscribeNewsletter() 'lastname' => 'test lastname', 'sendemail_store_id' => 1 ], - 'subscription' => '0' + 'subscription_status' => [$websiteId => '0'] ]; $this->getRequest()->setPostValue($post)->setMethod(HttpRequest::METHOD_POST); $this->getRequest()->setParam('id', 1); From 72705ada1f90fa2afe7fdfdc14258c70d90bd014 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Mon, 25 Nov 2019 15:10:52 +0200 Subject: [PATCH 258/586] MC-4242: Newsletter subscriptions per website --- app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php b/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php index 59e67e7aa32a7..424a42f629cdc 100644 --- a/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php +++ b/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php @@ -21,6 +21,8 @@ /** * Newsletter Plugin for customer + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class CustomerPlugin { From 644c063d7c8ae32dee8861ae73a0fcf6d1e779c4 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Tue, 26 Nov 2019 09:21:18 +0200 Subject: [PATCH 259/586] MC-4242: Newsletter subscriptions per website --- .../Newsletter/Model/ResourceModel/Queue/Collection.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Newsletter/Model/ResourceModel/Queue/Collection.php b/app/code/Magento/Newsletter/Model/ResourceModel/Queue/Collection.php index 1fc68771e74cb..0553fae0f3b18 100644 --- a/app/code/Magento/Newsletter/Model/ResourceModel/Queue/Collection.php +++ b/app/code/Magento/Newsletter/Model/ResourceModel/Queue/Collection.php @@ -5,6 +5,8 @@ */ namespace Magento\Newsletter\Model\ResourceModel\Queue; +use Magento\Newsletter\Model\Subscriber; + /** * Newsletter queue collection. * @@ -214,7 +216,7 @@ public function addSubscriberFilter($subscriberId) * @param int $customerId * @return $this */ - public function addCustomerFilter(int $customerId): self + public function addCustomerFilter(int $customerId): Collection { $this->getSelect() ->join( From c16f055dae7c035c643bc66f27f6fa5173d2ce2a Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Tue, 26 Nov 2019 09:21:56 +0200 Subject: [PATCH 260/586] MC-4242: Newsletter subscriptions per website --- .../Magento/Newsletter/Model/ResourceModel/Queue/Collection.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/code/Magento/Newsletter/Model/ResourceModel/Queue/Collection.php b/app/code/Magento/Newsletter/Model/ResourceModel/Queue/Collection.php index 0553fae0f3b18..33c539fbba84f 100644 --- a/app/code/Magento/Newsletter/Model/ResourceModel/Queue/Collection.php +++ b/app/code/Magento/Newsletter/Model/ResourceModel/Queue/Collection.php @@ -5,8 +5,6 @@ */ namespace Magento\Newsletter\Model\ResourceModel\Queue; -use Magento\Newsletter\Model\Subscriber; - /** * Newsletter queue collection. * From 51c6d1d18c106a35b9fb4338e986dc38190b21f5 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Wed, 27 Nov 2019 15:49:05 +0200 Subject: [PATCH 261/586] MC-4242: Newsletter subscriptions per website --- app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php b/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php index 424a42f629cdc..83bafe5bf2887 100644 --- a/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php +++ b/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php @@ -118,7 +118,7 @@ public function afterSave( * and customer is already confirmed registration * than need to subscribe customer */ - if ($subscriber->getStatus() === Subscriber::STATUS_UNCONFIRMED && empty($result->getConfirmation())) { + if ((int)$subscriber->getStatus() === Subscriber::STATUS_UNCONFIRMED && empty($result->getConfirmation())) { $needToUpdate = true; $subscribeStatus = true; } From 107d68a6929bbbd396e8fb6b68c88227d282c2a2 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Tue, 3 Dec 2019 16:27:32 +0200 Subject: [PATCH 262/586] MC-4242: Newsletter subscriptions per website --- .../Magento/backend/web/css/styles-old.less | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/app/design/adminhtml/Magento/backend/web/css/styles-old.less b/app/design/adminhtml/Magento/backend/web/css/styles-old.less index 1703e87691788..247316ab0361b 100644 --- a/app/design/adminhtml/Magento/backend/web/css/styles-old.less +++ b/app/design/adminhtml/Magento/backend/web/css/styles-old.less @@ -3962,22 +3962,6 @@ .grid tr.headings th > span { white-space: normal; } - - .field { - &.field-subscription { - .admin__field-label { - margin-left: 10px; - float: none; - cursor: pointer; - } - - .admin__field-control { - float: left; - width: auto; - margin: 6px 0px 0px 0px; - } - } - } } } From 53548365e5c52bcdb76ce089b85276dbc447c6ff Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Thu, 5 Dec 2019 11:23:43 +0200 Subject: [PATCH 263/586] MC-4242: Newsletter subscriptions per website --- .../Adminhtml/Index/MassUnsubscribe.php | 45 +++++++++++++++++-- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/MassUnsubscribe.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/MassUnsubscribe.php index 17f420d864df0..723f325cb08c8 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/MassUnsubscribe.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/MassUnsubscribe.php @@ -6,10 +6,13 @@ namespace Magento\Customer\Controller\Adminhtml\Index; use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Customer\Model\Config\Share; use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface; use Magento\Framework\Controller\ResultFactory; use Magento\Backend\App\Action\Context; use Magento\Newsletter\Model\SubscriptionManagerInterface; +use Magento\Store\Model\StoreManagerInterface; use Magento\Ui\Component\MassAction\Filter; use Magento\Customer\Model\ResourceModel\Customer\CollectionFactory; use Magento\Eav\Model\Entity\Collection\AbstractCollection; @@ -29,23 +32,38 @@ class MassUnsubscribe extends AbstractMassAction implements HttpPostActionInterf */ private $subscriptionManager; + /** + * @var StoreManagerInterface + */ + private $storeManager; + + /** + * @var Share + */ + private $shareConfig; + /** * @param Context $context * @param Filter $filter * @param CollectionFactory $collectionFactory * @param CustomerRepositoryInterface $customerRepository * @param SubscriptionManagerInterface $subscriptionManager + * @param Share $shareConfig */ public function __construct( Context $context, Filter $filter, CollectionFactory $collectionFactory, CustomerRepositoryInterface $customerRepository, - SubscriptionManagerInterface $subscriptionManager + SubscriptionManagerInterface $subscriptionManager, + StoreManagerInterface $storeManager, + Share $shareConfig ) { parent::__construct($context, $filter, $collectionFactory); $this->customerRepository = $customerRepository; $this->subscriptionManager = $subscriptionManager; + $this->storeManager = $storeManager; + $this->shareConfig = $shareConfig; } /** @@ -60,8 +78,9 @@ protected function massAction(AbstractCollection $collection) foreach ($collection->getAllIds() as $customerId) { // Verify customer exists $customer = $this->customerRepository->getById($customerId); - $storeId = (int)$customer->getStoreId(); - $this->subscriptionManager->unsubscribeCustomer($customerId, $storeId); + foreach ($this->getUnsubscribeStoreIds($customer) as $storeId) { + $this->subscriptionManager->unsubscribeCustomer((int)$customerId, $storeId); + } $customersUpdated++; } @@ -74,4 +93,24 @@ protected function massAction(AbstractCollection $collection) return $resultRedirect; } + + /** + * Get store ids to unsubscribe customer + * + * @param CustomerInterface $customer + * @return array + */ + private function getUnsubscribeStoreIds(CustomerInterface $customer): array + { + $storeIds = []; + if ($this->shareConfig->isGlobalScope()) { + foreach ($this->storeManager->getStores() as $store) { + $storeIds[(int)$store->getWebsiteId()] = (int)$store->getId(); + } + } else { + $storeIds = [(int)$customer->getStoreId()]; + } + + return $storeIds; + } } From c6697f065e461a7f244c5379603ce2a75feece18 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Thu, 5 Dec 2019 14:17:27 +0200 Subject: [PATCH 264/586] MC-4242: Newsletter subscriptions per website --- .../Controller/Adminhtml/Index/MassUnsubscribe.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/MassUnsubscribe.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/MassUnsubscribe.php index 723f325cb08c8..05f8a24e30c42 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/MassUnsubscribe.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/MassUnsubscribe.php @@ -5,6 +5,7 @@ */ namespace Magento\Customer\Controller\Adminhtml\Index; +use Magento\Backend\Model\View\Result\Redirect; use Magento\Customer\Api\CustomerRepositoryInterface; use Magento\Customer\Api\Data\CustomerInterface; use Magento\Customer\Model\Config\Share; @@ -48,6 +49,7 @@ class MassUnsubscribe extends AbstractMassAction implements HttpPostActionInterf * @param CollectionFactory $collectionFactory * @param CustomerRepositoryInterface $customerRepository * @param SubscriptionManagerInterface $subscriptionManager + * @param StoreManagerInterface $storeManager * @param Share $shareConfig */ public function __construct( @@ -70,13 +72,13 @@ public function __construct( * Customer mass unsubscribe action * * @param AbstractCollection $collection - * @return \Magento\Backend\Model\View\Result\Redirect + * @return Redirect */ protected function massAction(AbstractCollection $collection) { $customersUpdated = 0; foreach ($collection->getAllIds() as $customerId) { - // Verify customer exists + // Verify that customer exists $customer = $this->customerRepository->getById($customerId); foreach ($this->getUnsubscribeStoreIds($customer) as $storeId) { $this->subscriptionManager->unsubscribeCustomer((int)$customerId, $storeId); @@ -87,7 +89,7 @@ protected function massAction(AbstractCollection $collection) if ($customersUpdated) { $this->messageManager->addSuccessMessage(__('A total of %1 record(s) were updated.', $customersUpdated)); } - /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */ + /** @var Redirect $resultRedirect */ $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT); $resultRedirect->setPath($this->getComponentRefererUrl()); From 74958a2004335596deb3f3a2799f06b6d47b1a1f Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Mon, 9 Dec 2019 15:46:11 +0200 Subject: [PATCH 265/586] MC-4242: Newsletter subscriptions per website --- .../Customer/Controller/Adminhtml/Index/MassSubscribe.php | 2 +- .../Customer/Controller/Adminhtml/Index/MassUnsubscribe.php | 2 +- .../Test/Unit/Controller/Adminhtml/Index/MassSubscribeTest.php | 3 ++- .../Unit/Controller/Adminhtml/Index/MassUnsubscribeTest.php | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/MassSubscribe.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/MassSubscribe.php index 881c5caebcbee..453035ad3151b 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/MassSubscribe.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/MassSubscribe.php @@ -15,7 +15,7 @@ use Magento\Framework\Controller\ResultFactory; /** - * Class MassSubscribe + * Class to mass subscribe customers by ids */ class MassSubscribe extends AbstractMassAction implements HttpPostActionInterface { diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/MassUnsubscribe.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/MassUnsubscribe.php index 05f8a24e30c42..245e06699e6b0 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/MassUnsubscribe.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/MassUnsubscribe.php @@ -19,7 +19,7 @@ use Magento\Eav\Model\Entity\Collection\AbstractCollection; /** - * Class MassUnsubscribe + * Class to mass unsubscribe customers by ids */ class MassUnsubscribe extends AbstractMassAction implements HttpPostActionInterface { diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassSubscribeTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassSubscribeTest.php index 8f672fbfb4da6..d8b88bba2cdbe 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassSubscribeTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassSubscribeTest.php @@ -26,7 +26,8 @@ use PHPUnit\Framework\TestCase; /** - * Class MassSubscribeTest + * Class to test mass subscribe customers by ids + * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class MassSubscribeTest extends TestCase diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassUnsubscribeTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassUnsubscribeTest.php index 303a11989236f..8220d50f418be 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassUnsubscribeTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassUnsubscribeTest.php @@ -26,7 +26,8 @@ use PHPUnit\Framework\TestCase; /** - * Class MassUnsubscribeTest + * Class to test mass unsubscribe customers by ids + * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class MassUnsubscribeTest extends TestCase From 3ccaec554c95517564aa41dd72dc3771e2d94907 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Mon, 9 Dec 2019 16:26:37 +0200 Subject: [PATCH 266/586] MC-4242: Newsletter subscriptions per website --- .../Test/Unit/Block/Adminhtml/Edit/Tab/NewsletterTest.php | 2 +- .../Customer/Block/Adminhtml/Edit/Tab/NewsletterTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/Tab/NewsletterTest.php b/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/Tab/NewsletterTest.php index 22a22742cdb8d..d0ea012a11e1e 100644 --- a/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/Tab/NewsletterTest.php +++ b/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/Tab/NewsletterTest.php @@ -16,7 +16,7 @@ use Magento\Framework\Data\Form; use Magento\Framework\Data\Form\Element\Checkbox; use Magento\Framework\Data\Form\Element\Fieldset; -use \Magento\Framework\Data\Form\Element\Select; +use Magento\Framework\Data\Form\Element\Select; use Magento\Framework\Data\FormFactory; use Magento\Framework\Registry; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; diff --git a/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/NewsletterTest.php b/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/NewsletterTest.php index a44101da77d6d..9ddba4b994b40 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/NewsletterTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/NewsletterTest.php @@ -9,7 +9,7 @@ use Magento\TestFramework\Helper\Bootstrap; /** - * Class NewsletterTest + * Test Customer account form block functionality * * @magentoAppArea adminhtml */ From ecca7514a4a956eea2fa7efb34f9f176f00d1e60 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Tue, 10 Dec 2019 10:40:13 +0200 Subject: [PATCH 267/586] MC-4242: Newsletter subscriptions per website --- .../Magento/Newsletter/Model/Plugin/CustomerPlugin.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php b/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php index 83bafe5bf2887..60b279b659ca6 100644 --- a/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php +++ b/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php @@ -220,8 +220,11 @@ public function afterDelete(CustomerRepositoryInterface $subject, $result, Custo */ public function afterGetById(CustomerRepositoryInterface $subject, CustomerInterface $customer) { - $isSubscribed = $this->getSubscriber($customer)->isSubscribed(); - $this->addIsSubscribedExtensionAttr($customer, $isSubscribed); + $extensionAttributes = $customer->getExtensionAttributes(); + if ($extensionAttributes === null || $extensionAttributes->getIsSubscribed() === null) { + $isSubscribed = $this->getSubscriber($customer)->isSubscribed(); + $this->addIsSubscribedExtensionAttr($customer, $isSubscribed); + } return $customer; } From f4373bcce058fafbfc818a9e17bd355cd9b1d4ef Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <nazarn96@gmail.com> Date: Wed, 11 Dec 2019 15:12:13 +0200 Subject: [PATCH 268/586] static-test fix --- .../js/jasmine/tests/lib/mage/browser.test.js | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/dev/tests/js/jasmine/tests/lib/mage/browser.test.js b/dev/tests/js/jasmine/tests/lib/mage/browser.test.js index 2c60497ce1bcc..ce76f5ec02b64 100644 --- a/dev/tests/js/jasmine/tests/lib/mage/browser.test.js +++ b/dev/tests/js/jasmine/tests/lib/mage/browser.test.js @@ -33,10 +33,13 @@ define([ spyOn($, 'ajax').and.callFake( function () { return { - done: function (data) { - obj.targetElementId = 1; - } - } + /** + * Succes result of ajax request + */ + done: function () { + obj.targetElementId = 1; + } + }; }); obj.openDialog('instance/url', 100, 100, 'title', options); obj.openDialog('instance/url', 100, 100, 'title', options); @@ -48,11 +51,14 @@ define([ spyOn($, 'ajax').and.callFake( function () { return { - done: function (data) { - obj.targetElementId = 'instance/url'; - obj.modalLoaded = true; - } - } + /** + * Succes result of ajax request + */ + done: function () { + obj.targetElementId = 'instance/url'; + obj.modalLoaded = true; + } + }; }); obj.openDialog('instance/url', 100, 100, 'title', undefined); obj.openDialog('instance/url', 100, 100, 'title', undefined); From d12ab03ef3788575ff69f1dc1ed0d9dd785de2ef Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Wed, 11 Dec 2019 21:54:17 +0700 Subject: [PATCH 269/586] [InstantPurchase] Cover Ui/CustomerAddressesFormatter and Ui/ShippingMethodFormatter by Unit Test --- .../Ui/CustomerAddressesFormatterTest.php | 56 +++++++++++++++++++ .../Model/Ui/ShippingMethodFormatterTest.php | 46 +++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 app/code/Magento/InstantPurchase/Test/Unit/Model/Ui/CustomerAddressesFormatterTest.php create mode 100644 app/code/Magento/InstantPurchase/Test/Unit/Model/Ui/ShippingMethodFormatterTest.php diff --git a/app/code/Magento/InstantPurchase/Test/Unit/Model/Ui/CustomerAddressesFormatterTest.php b/app/code/Magento/InstantPurchase/Test/Unit/Model/Ui/CustomerAddressesFormatterTest.php new file mode 100644 index 0000000000000..2abe6b82bc3a9 --- /dev/null +++ b/app/code/Magento/InstantPurchase/Test/Unit/Model/Ui/CustomerAddressesFormatterTest.php @@ -0,0 +1,56 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\InstantPurchase\Test\Unit\Model\Ui; + +use Magento\InstantPurchase\Model\Ui\CustomerAddressesFormatter; +use Magento\Customer\Model\Address; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use Magento\Directory\Model\Country; +use PHPUnit\Framework\TestCase; + +class CustomerAddressesFormatterTest extends TestCase +{ + /** + * @var CustomerAddressesFormatter|\PHPUnit_Framework_MockObject_MockObject + */ + private $customerAddressesFormatter; + + /** + * Setup environment for testing + */ + protected function setUp() + { + $objectManager = new ObjectManagerHelper($this); + $this->customerAddressesFormatter = $objectManager->getObject(CustomerAddressesFormatter::class); + } + + /** + * Test format() + */ + public function testFormat() + { + $addressMock = $this->createPartialMock( + Address::class, + ['getName', 'getStreetFull', 'getCity', 'getRegion', 'getPostcode', 'getCountryModel'] + ); + $countryMock = $this->createMock(Country::class); + + $countryMock->expects($this->any())->method('getName')->willReturn('USA'); + $addressMock->expects($this->any())->method('getName')->willReturn('Address Name'); + $addressMock->expects($this->any())->method('getStreetFull')->willReturn('Address Street Full'); + $addressMock->expects($this->any())->method('getCity')->willReturn('Address City'); + $addressMock->expects($this->any())->method('getRegion')->willReturn('Address Region'); + $addressMock->expects($this->any())->method('getPostcode')->willReturn('Address Postcode'); + $addressMock->expects($this->any())->method('getCountryModel')->willReturn($countryMock); + + $this->assertEquals( + 'Address Name, Address Street Full, Address City, Address Region Address Postcode, USA', + $this->customerAddressesFormatter->format($addressMock) + ); + } +} diff --git a/app/code/Magento/InstantPurchase/Test/Unit/Model/Ui/ShippingMethodFormatterTest.php b/app/code/Magento/InstantPurchase/Test/Unit/Model/Ui/ShippingMethodFormatterTest.php new file mode 100644 index 0000000000000..632392bcb35e3 --- /dev/null +++ b/app/code/Magento/InstantPurchase/Test/Unit/Model/Ui/ShippingMethodFormatterTest.php @@ -0,0 +1,46 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\InstantPurchase\Test\Unit\Model\Ui; + +use Magento\InstantPurchase\Model\Ui\ShippingMethodFormatter; +use Magento\Quote\Api\Data\ShippingMethodInterface; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use PHPUnit\Framework\TestCase; + +class ShippingMethodFormatterTest extends TestCase +{ + /** + * @var ShippingMethodFormatter|\PHPUnit_Framework_MockObject_MockObject + */ + private $shippingMethodFormatter; + + /** + * Setup environment for testing + */ + protected function setUp() + { + $objectManager = new ObjectManagerHelper($this); + $this->shippingMethodFormatter = $objectManager->getObject(ShippingMethodFormatter::class); + } + + /** + * Test format() + */ + public function testFormat() + { + $shippingMethodMock = $this->createMock(ShippingMethodInterface::class, ['getCarrierTitle', 'getMethodTitle']); + + $shippingMethodMock->expects($this->any())->method('getCarrierTitle')->willReturn('flatrate'); + $shippingMethodMock->expects($this->any())->method('getMethodTitle')->willReturn('flatrate'); + + $this->assertEquals( + 'flatrate - flatrate', + $this->shippingMethodFormatter->format($shippingMethodMock) + ); + } +} From f8452c7a24b12af236b19b66f7d29b49421d0d54 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Wed, 11 Dec 2019 21:59:59 +0700 Subject: [PATCH 270/586] [InstantPurchase] Cover Ui/CustomerAddressesFormatter and Ui/ShippingMethodFormatter by Unit Test --- .../Test/Unit/Model/Ui/CustomerAddressesFormatterTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/InstantPurchase/Test/Unit/Model/Ui/CustomerAddressesFormatterTest.php b/app/code/Magento/InstantPurchase/Test/Unit/Model/Ui/CustomerAddressesFormatterTest.php index 2abe6b82bc3a9..2a53a36a46cd6 100644 --- a/app/code/Magento/InstantPurchase/Test/Unit/Model/Ui/CustomerAddressesFormatterTest.php +++ b/app/code/Magento/InstantPurchase/Test/Unit/Model/Ui/CustomerAddressesFormatterTest.php @@ -44,12 +44,12 @@ public function testFormat() $addressMock->expects($this->any())->method('getName')->willReturn('Address Name'); $addressMock->expects($this->any())->method('getStreetFull')->willReturn('Address Street Full'); $addressMock->expects($this->any())->method('getCity')->willReturn('Address City'); - $addressMock->expects($this->any())->method('getRegion')->willReturn('Address Region'); - $addressMock->expects($this->any())->method('getPostcode')->willReturn('Address Postcode'); + $addressMock->expects($this->any())->method('getRegion')->willReturn('California'); + $addressMock->expects($this->any())->method('getPostcode')->willReturn('12345'); $addressMock->expects($this->any())->method('getCountryModel')->willReturn($countryMock); $this->assertEquals( - 'Address Name, Address Street Full, Address City, Address Region Address Postcode, USA', + 'Address Name, Address Street Full, Address City, California 12345, USA', $this->customerAddressesFormatter->format($addressMock) ); } From 4c32e54843990a66fa715921bd2ce38c979ad23d Mon Sep 17 00:00:00 2001 From: Andrii Meysar <andrii.meysar@transoftgroup.com> Date: Wed, 11 Dec 2019 17:11:19 +0200 Subject: [PATCH 271/586] MC-29658: [2.4] Strange changes in the URL structure for subcategories --- setup/src/Magento/Setup/Fixtures/CategoriesFixture.php | 10 ++++++---- .../Setup/Test/Unit/Fixtures/CategoriesFixtureTest.php | 10 +++++++++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/setup/src/Magento/Setup/Fixtures/CategoriesFixture.php b/setup/src/Magento/Setup/Fixtures/CategoriesFixture.php index e8a0a469e2ee5..782f688f8a09e 100644 --- a/setup/src/Magento/Setup/Fixtures/CategoriesFixture.php +++ b/setup/src/Magento/Setup/Fixtures/CategoriesFixture.php @@ -9,6 +9,7 @@ use Magento\Catalog\Model\Category; use Magento\Catalog\Model\CategoryFactory; use Magento\Catalog\Model\ResourceModel\Category\CollectionFactory; +use Magento\Store\Model\Store; use Magento\Store\Model\StoreManager; /** @@ -82,7 +83,7 @@ public function __construct( protected $priority = 20; /** - * {@inheritdoc} + * @inheritdoc */ public function execute() { @@ -97,7 +98,7 @@ public function execute() $category = $this->categoryFactory->create(); $category->load($parentCategoryId); // Need for generation url rewrites per all category store view - $category->setStoreId(\Magento\Store\Model\Store::DEFAULT_STORE_ID); + $category->setStoreId(Store::DEFAULT_STORE_ID); $categoryIndex = 1; $this->generateCategories( $category, @@ -130,6 +131,7 @@ private function generateCategories( $category->setId(null) ->setUrlKey(null) ->setUrlPath(null) + ->setStoreId(Store::DEFAULT_STORE_ID) ->setName($this->getCategoryName($parentCategory, $nestingLevel, $i)) ->setParentId($parentCategory->getId()) ->setLevel($parentCategory->getLevel() + 1) @@ -237,7 +239,7 @@ private function getCategoryPrefix() } /** - * {@inheritdoc} + * @inheritdoc */ public function getActionTitle() { @@ -245,7 +247,7 @@ public function getActionTitle() } /** - * {@inheritdoc} + * @inheritdoc */ public function introduceParamLabels() { diff --git a/setup/src/Magento/Setup/Test/Unit/Fixtures/CategoriesFixtureTest.php b/setup/src/Magento/Setup/Test/Unit/Fixtures/CategoriesFixtureTest.php index 9e2a7b46514bd..348afab198ab8 100644 --- a/setup/src/Magento/Setup/Test/Unit/Fixtures/CategoriesFixtureTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Fixtures/CategoriesFixtureTest.php @@ -12,6 +12,7 @@ use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use Magento\Setup\Fixtures\CategoriesFixture; use Magento\Setup\Fixtures\FixtureModel; +use Magento\Store\Model\Store; class CategoriesFixtureTest extends \PHPUnit\Framework\TestCase { @@ -40,7 +41,10 @@ class CategoriesFixtureTest extends \PHPUnit\Framework\TestCase */ private $categoryFactoryMock; - public function setUp() + /** + * @inhertidoc + */ + protected function setUp() { $this->fixtureModelMock = $this->createMock(FixtureModel::class); $this->collectionFactoryMock = $this->createPartialMock(CollectionFactory::class, ['create']); @@ -146,6 +150,10 @@ public function testExecute() $categoryMock->expects($this->once()) ->method('setIsActive') ->willReturnSelf(); + $categoryMock->expects($this->exactly(2)) + ->method('setStoreId') + ->with(Store::DEFAULT_STORE_ID) + ->willReturnSelf(); $this->categoryFactoryMock->expects($this->once())->method('create')->willReturn($categoryMock); From 9dea197f30e4dd40966805296efee6b69982710d Mon Sep 17 00:00:00 2001 From: Adam Mellen <github@mellen.io> Date: Wed, 11 Dec 2019 15:16:04 +0000 Subject: [PATCH 272/586] Updating wee -> weee as per https://github.com/magento/devdocs/pull/5911 --- app/code/Magento/Weee/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Weee/README.md b/app/code/Magento/Weee/README.md index 61f9b8d6d8970..ef433ec4c96f9 100644 --- a/app/code/Magento/Weee/README.md +++ b/app/code/Magento/Weee/README.md @@ -2,10 +2,10 @@ The Magento_Weee module enables the application of fees/fixed product taxes (FPT) on certain types of products, usually related to electronic devices and recycling. Fixed product taxes can be used to setup a WEEE tax that is a fixed amount, rather than a percentage of the product price. FPT can be configured to be displayed at various places in Magento. Rules, amounts, and display options can be configured in the backend. This module extends the existing functionality of Magento_Tax. -The Magento_Wee module includes the following: +The Magento_Weee module includes the following: * ability to add different number of fixed product taxes to product. They are treated as a product attribute; -* configuration of where Weee appears (on category, product, sales, invoice, or credit memo pages) and whether FPT should be taxed; +* configuration of where WEEE appears (on category, product, sales, invoice, or credit memo pages) and whether FPT should be taxed; * a new line item in the totals section. # System requirements From 01e0f9168b9724a99724dda89f3ee988c729476e Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Wed, 11 Dec 2019 22:28:55 +0700 Subject: [PATCH 273/586] [Newsletter] Refactor code and Cover Model/Observer class by Unit Test --- .../Magento/Newsletter/Model/Observer.php | 37 ++++++++--- .../Test/Unit/Model/ObserverTest.php | 63 +++++++++++++++++++ 2 files changed, 91 insertions(+), 9 deletions(-) create mode 100644 app/code/Magento/Newsletter/Test/Unit/Model/ObserverTest.php diff --git a/app/code/Magento/Newsletter/Model/Observer.php b/app/code/Magento/Newsletter/Model/Observer.php index d77371569601f..a6f8ffd461d08 100644 --- a/app/code/Magento/Newsletter/Model/Observer.php +++ b/app/code/Magento/Newsletter/Model/Observer.php @@ -3,8 +3,14 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + +declare(strict_types=1); + namespace Magento\Newsletter\Model; +use Magento\Newsletter\Model\ResourceModel\Queue\Collection; +use Magento\Newsletter\Model\ResourceModel\Queue\CollectionFactory; + /** * Newsletter module observer * @@ -12,20 +18,35 @@ */ class Observer { + /** + * Number of queue + */ + private const COUNT_OF_QUEUE = 3; + + /** + * Number of subscriptions + */ + private const COUNT_OF_SUBSCRIPTIONS = 20; + + /** + * First page in collection + */ + private const FIRST_PAGE = 1; + /** * Queue collection factory * - * @var \Magento\Newsletter\Model\ResourceModel\Queue\CollectionFactory + * @var CollectionFactory */ protected $_queueCollectionFactory; /** * Construct * - * @param \Magento\Newsletter\Model\ResourceModel\Queue\CollectionFactory $queueCollectionFactory + * @param CollectionFactory $queueCollectionFactory */ public function __construct( - \Magento\Newsletter\Model\ResourceModel\Queue\CollectionFactory $queueCollectionFactory + CollectionFactory $queueCollectionFactory ) { $this->_queueCollectionFactory = $queueCollectionFactory; } @@ -37,13 +58,11 @@ public function __construct( */ public function scheduledSend() { - $countOfQueue = 3; - $countOfSubscriptions = 20; - - /** @var \Magento\Newsletter\Model\ResourceModel\Queue\Collection $collection */ + /** @var Collection $collection */ $collection = $this->_queueCollectionFactory->create(); - $collection->setPageSize($countOfQueue)->setCurPage(1)->addOnlyForSendingFilter()->load(); + $collection->setPageSize(self::COUNT_OF_QUEUE) + ->setCurPage(self::FIRST_PAGE)->addOnlyForSendingFilter()->load(); - $collection->walk('sendPerSubscriber', [$countOfSubscriptions]); + $collection->walk('sendPerSubscriber', [self::COUNT_OF_SUBSCRIPTIONS]); } } diff --git a/app/code/Magento/Newsletter/Test/Unit/Model/ObserverTest.php b/app/code/Magento/Newsletter/Test/Unit/Model/ObserverTest.php new file mode 100644 index 0000000000000..7bf6d1e1c8671 --- /dev/null +++ b/app/code/Magento/Newsletter/Test/Unit/Model/ObserverTest.php @@ -0,0 +1,63 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Newsletter\Test\Unit\Model; + +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use Magento\Newsletter\Model\Observer; +use Magento\Newsletter\Model\ResourceModel\Queue\Collection; +use Magento\Newsletter\Model\ResourceModel\Queue\CollectionFactory; +use PHPUnit\Framework\TestCase; + +class ObserverTest extends TestCase +{ + /** + * @var Observer + */ + private $model; + + /** + * @var CollectionFactory|\PHPUnit_Framework_MockObject_MockObject + */ + private $collectionFactoryMock; + + /** + * Setup environment for test + */ + protected function setUp() + { + $objectManager = new ObjectManagerHelper($this); + + $this->collectionFactoryMock = $this->createPartialMock( + CollectionFactory::class, + ['create'] + ); + + $this->model = $objectManager->getObject( + Observer::class, + [ + 'queueCollectionFactory' => $this->collectionFactoryMock + ] + ); + } + + /** + * Test scheduledSend() method + */ + public function testScheduledSend() + { + $collectionMock = $this->createMock(Collection::class); + $this->collectionFactoryMock->expects($this->once())->method('create')->willReturn($collectionMock); + $collectionMock->expects($this->once())->method('setPageSize')->with(3)->willReturnSelf(); + $collectionMock->expects($this->once())->method('setCurPage')->with(1)->willReturnSelf(); + $collectionMock->expects($this->once())->method('addOnlyForSendingFilter')->willReturnSelf(); + $collectionMock->expects($this->once())->method('load')->willReturnSelf(); + $collectionMock->expects($this->once())->method('walk')->with('sendPerSubscriber', [20]); + + $this->model->scheduledSend(); + } +} From 3f4642ed3529467baafad828dd415749f0395176 Mon Sep 17 00:00:00 2001 From: Douglas Radburn <douglas.radburn@pinpointdesigns.co.uk> Date: Wed, 11 Dec 2019 15:32:16 +0000 Subject: [PATCH 274/586] Updated code test --- app/code/Magento/Theme/Block/Html/Pager.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Theme/Block/Html/Pager.php b/app/code/Magento/Theme/Block/Html/Pager.php index e86310b66bb4b..866203c72b83b 100644 --- a/app/code/Magento/Theme/Block/Html/Pager.php +++ b/app/code/Magento/Theme/Block/Html/Pager.php @@ -450,9 +450,11 @@ public function getLastPageUrl() */ public function getPageUrl($page) { - return $this->getPagerUrl([ - $this->getPageVarName() => $page > 1 ? $page : null, - ]); + return $this->getPagerUrl( + [ + $this->getPageVarName() => $page > 1 ? $page : null, + ] + ); } /** From 29f0417a28ad71d4dd42485b88da125ccd960a2e Mon Sep 17 00:00:00 2001 From: Mastiuhin Olexandr <mastiuhin.olexandr@transoftgroup.com> Date: Wed, 11 Dec 2019 18:08:28 +0200 Subject: [PATCH 275/586] MC-25098: Product is not deleted from minicart if not included in shared catalog --- app/code/Magento/Checkout/Model/Session.php | 4 +++ .../Magento/Checkout/Model/SessionTest.php | 30 +++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/app/code/Magento/Checkout/Model/Session.php b/app/code/Magento/Checkout/Model/Session.php index 4a4861fa9ccd2..7af00f1df8e95 100644 --- a/app/code/Magento/Checkout/Model/Session.php +++ b/app/code/Magento/Checkout/Model/Session.php @@ -272,6 +272,10 @@ public function getQuote() */ $quote = $this->quoteRepository->get($this->getQuoteId()); } + + if ($quote->getTotalsCollectedFlag() === false) { + $quote->collectTotals(); + } } catch (NoSuchEntityException $e) { $this->setQuoteId(null); } diff --git a/dev/tests/integration/testsuite/Magento/Checkout/Model/SessionTest.php b/dev/tests/integration/testsuite/Magento/Checkout/Model/SessionTest.php index 4682453012952..c7802f73a9a47 100644 --- a/dev/tests/integration/testsuite/Magento/Checkout/Model/SessionTest.php +++ b/dev/tests/integration/testsuite/Magento/Checkout/Model/SessionTest.php @@ -7,6 +7,7 @@ use Magento\Catalog\Api\Data\ProductTierPriceInterface; use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Product\Attribute\Source\Status; use Magento\Customer\Api\CustomerRepositoryInterface; use Magento\Customer\Model\Session as CustomerSession; use Magento\Framework\Api\FilterBuilder; @@ -54,6 +55,35 @@ protected function setUp() $this->checkoutSession = $this->objectManager->create(Session::class); } + /** + * Tests that quote items and totals are correct when product becomes unavailable. + * + * @magentoDataFixture Magento/Customer/_files/customer.php + * @magentoDataFixture Magento/Sales/_files/quote.php + * @magentoAppIsolation enabled + */ + public function testGetQuoteWithUnavailableProduct() + { + $reservedOrderId = 'test01'; + $quoteGrandTotal = 10; + + $quote = $this->getQuote($reservedOrderId); + $this->assertEquals(1, $quote->getItemsCount()); + $this->assertCount(1, $quote->getItems()); + $this->assertEquals($quoteGrandTotal, $quote->getShippingAddress()->getBaseGrandTotal()); + + $productRepository = $this->objectManager->get(ProductRepositoryInterface::class); + $product = $productRepository->get('simple'); + $product->setStatus(Status::STATUS_DISABLED); + $productRepository->save($product); + $this->checkoutSession->setQuoteId($quote->getId()); + $quote = $this->checkoutSession->getQuote(); + + $this->assertEquals(0, $quote->getItemsCount()); + $this->assertEmpty($quote->getItems()); + $this->assertEquals(0, $quote->getShippingAddress()->getBaseGrandTotal()); + } + /** * Test covers case when quote is not yet initialized and customer data is set to checkout session model. * From 5a1e0fff4c94a732e327ae4aec969365185f0289 Mon Sep 17 00:00:00 2001 From: Tom Reece <treece@adobe.com> Date: Wed, 11 Dec 2019 10:17:12 -0600 Subject: [PATCH 276/586] MQE-1921: [MTF-To-MFTF] Process PR 711 --- .../StorefrontClickHeaderLinkActionGroup.xml | 6 +-- .../StorefrontSeeHeaderLinksActionGroup.xml | 4 +- .../Mftf/Section/StorefrontHeaderSection.xml | 3 +- ...teAccountPasswordComplexityActionGroup.xml | 2 +- .../StorefrontCustomerCreateFormSection.xml | 2 +- .../NewCustomerPasswordComplexityTest.xml | 32 ++++++-------- .../Test/NewCustomerPasswordLengthTest.xml | 43 +++++++++++++++++++ .../NewCustomerPasswordComplexityTest.xml | 6 +-- 8 files changed, 66 insertions(+), 32 deletions(-) create mode 100644 app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordLengthTest.xml diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontClickHeaderLinkActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontClickHeaderLinkActionGroup.xml index 46c06e909b4d9..052a5ac6a14e6 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontClickHeaderLinkActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontClickHeaderLinkActionGroup.xml @@ -9,9 +9,9 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="StorefrontClickHeaderLinkActionGroup"> <arguments> - <argument name="LinkName" type="string" defaultValue="Create an Account"/> + <argument name="linkName" type="string" defaultValue="Create an Account"/> </arguments> - <click stepKey="ClickTheLink" selector="{{StorefrontHeaderSection.HeaderLinkByText(LinkName)}}"/> - <waitForPageLoad stepKey="Wait"/> + <click stepKey="clickTheLink" selector="{{StorefrontHeaderSection.headerLinkByText(linkName)}}"/> + <waitForPageLoad stepKey="wait"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontSeeHeaderLinksActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontSeeHeaderLinksActionGroup.xml index 3155cca583d59..f4498e3b6cdd7 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontSeeHeaderLinksActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontSeeHeaderLinksActionGroup.xml @@ -9,8 +9,8 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="StorefrontSeeHeaderLinksActionGroup"> <arguments> - <argument name="LinkName" type="string" defaultValue="Create an Account"/> + <argument name="linkName" type="string" defaultValue="Create an Account"/> </arguments> - <see stepKey="SeeElement" selector="{{StorefrontHeaderSection.headerlinks}}" userInput="{{LinkName}}"/> + <see stepKey="seeElement" selector="{{StorefrontHeaderSection.headerlinks}}" userInput="{{linkName}}"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/Section/StorefrontHeaderSection.xml b/app/code/Magento/Cms/Test/Mftf/Section/StorefrontHeaderSection.xml index fefde1e6035f3..7b47c6b49db7b 100644 --- a/app/code/Magento/Cms/Test/Mftf/Section/StorefrontHeaderSection.xml +++ b/app/code/Magento/Cms/Test/Mftf/Section/StorefrontHeaderSection.xml @@ -10,7 +10,6 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="StorefrontHeaderSection"> <element name="headerlinks" type="text" selector="ul.header.links"/> - <element name="HeaderLinkByText" type="text" selector="//ul[contains(@class, 'header') and contains(@class, 'links')]/li/a[contains(text(),'{{LinkName}}')]" - parameterized="true" /> + <element name="headerLinkByText" type="text" selector="//ul[contains(@class, 'header') and contains(@class, 'links')]/li/a[contains(text(),'{{LinkName}}')]" parameterized="true"/> </section> </sections> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertMessageCustomerCreateAccountPasswordComplexityActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertMessageCustomerCreateAccountPasswordComplexityActionGroup.xml index 9d7dbc604f59d..95a03042bec3b 100644 --- a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertMessageCustomerCreateAccountPasswordComplexityActionGroup.xml +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertMessageCustomerCreateAccountPasswordComplexityActionGroup.xml @@ -12,6 +12,6 @@ <arguments> <argument name="message" type="string"/> </arguments> - <see userInput="{{message}}" selector="{{StorefrontCustomerCreateFormSection.PasswordErrorMessages}}" stepKey="verifyMessage" /> + <see userInput="{{message}}" selector="{{StorefrontCustomerCreateFormSection.passwordErrorMessages}}" stepKey="verifyMessage"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection.xml index 17048dda688e6..9fc26a03b04ee 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection.xml @@ -17,7 +17,7 @@ <element name="passwordField" type="input" selector="#password"/> <element name="confirmPasswordField" type="input" selector="#password-confirmation"/> <element name="createAccountButton" type="button" selector="button.action.submit.primary" timeout="30"/> - <element name="PasswordErrorMessages" type="text" selector="#password-error"/> + <element name="passwordErrorMessages" type="text" selector="#password-error"/> </section> <section name="StoreFrontCustomerAdvancedAttributesSection"> <element name="textFieldAttribute" type="input" selector="//input[@id='{{var}}']" parameterized="true" /> diff --git a/app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordComplexityTest.xml b/app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordComplexityTest.xml index ccd97f83cd0a6..74a9c68cb2f79 100644 --- a/app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordComplexityTest.xml +++ b/app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordComplexityTest.xml @@ -11,39 +11,33 @@ <test name="NewCustomerPasswordComplexityTest"> <annotations> <features value="Security"/> - <stories value="Checking customer's password length and password complexity"/> - <title value="Notify the customer if password length or complexity is not match to requirements"/> - <description value="Show notifies to the customer if password length or complexity is not match to requirements"/> + <stories value="Checking customer's password complexity"/> + <title value="Notify the customer if password complexity does not match the requirements"/> + <description value="Notify the customer if password complexity does not match the requirements"/> + <testCaseId value="MC-14368"/> <group value="security"/> <group value="mtf_migrated"/> </annotations> - <!-- TEST BODY --> <!-- Go to storefront home page --> <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openStoreFrontHomePage"/> + <!-- See the Registration Link --> - <actionGroup ref="StorefrontSeeHeaderLinksActionGroup" stepKey="SeeTheLink"/> + <actionGroup ref="StorefrontSeeHeaderLinksActionGroup" stepKey="seeTheLink"/> + <!-- Click the Registration Link --> - <actionGroup ref="StorefrontClickHeaderLinkActionGroup" stepKey="ClickTheLink"> - <argument name="LinkName" value="Create an Account"/> - </actionGroup> - <!-- Fill Registration Form with Password length is bellow 8 Characters --> - <actionGroup ref="StorefrontFillCustomerAccountCreationFormActionGroup" stepKey="FillRegistrationFormPasswordLengthBellowEightCharacters"> - <argument name="customer" value="Simple_Customer_With_Password_Length_Is_Below_Eight_Characters"/> - </actionGroup> - <!-- See the Error --> - <actionGroup ref="AssertMessageCustomerCreateAccountPasswordComplexityActionGroup" stepKey="SeeTheErrorPasswordLength"> - <argument name="message" value="Minimum length of this field must be equal or greater than 8 symbols. Leading and trailing spaces will be ignored."/> + <actionGroup ref="StorefrontClickHeaderLinkActionGroup" stepKey="clickTheLink"> + <argument name="linkName" value="Create an Account"/> </actionGroup> + <!-- Fill Registration Form with not secure enough password --> - <actionGroup ref="StorefrontFillCustomerAccountCreationFormActionGroup" stepKey="FillRegistrationFormPasswordNotSecure"> + <actionGroup ref="StorefrontFillCustomerAccountCreationFormActionGroup" stepKey="fillRegistrationFormPasswordNotSecure"> <argument name="customer" value="Simple_Customer_With_Not_Secure_Password"/> </actionGroup> + <!-- See the Error --> - <actionGroup ref="AssertMessageCustomerCreateAccountPasswordComplexityActionGroup" stepKey="SeeTheErrorPasswordSecure"> + <actionGroup ref="AssertMessageCustomerCreateAccountPasswordComplexityActionGroup" stepKey="seeTheErrorPasswordSecure"> <argument name="message" value="Minimum of different classes of characters in password is 3. Classes of characters: Lower Case, Upper Case, Digits, Special Characters."/> </actionGroup> - <!--Test Body END--> - </test> </tests> diff --git a/app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordLengthTest.xml b/app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordLengthTest.xml new file mode 100644 index 0000000000000..a10059d0603c5 --- /dev/null +++ b/app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordLengthTest.xml @@ -0,0 +1,43 @@ +<?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="NewCustomerPasswordLengthTest"> + <annotations> + <features value="Security"/> + <stories value="Checking customer's password length"/> + <title value="Notify the customer if password length does not match the requirements"/> + <description value="Notify the customer if password length does not match the requirements"/> + <testCaseId value="MC-14367"/> + <group value="security"/> + <group value="mtf_migrated"/> + </annotations> + + <!-- Go to storefront home page --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openStoreFrontHomePage"/> + + <!-- See the Registration Link --> + <actionGroup ref="StorefrontSeeHeaderLinksActionGroup" stepKey="seeTheLink"/> + + <!-- Click the Registration Link --> + <actionGroup ref="StorefrontClickHeaderLinkActionGroup" stepKey="clickTheLink"> + <argument name="linkName" value="Create an Account"/> + </actionGroup> + + <!-- Fill Registration Form with Password length is bellow 8 Characters --> + <actionGroup ref="StorefrontFillCustomerAccountCreationFormActionGroup" stepKey="fillRegistrationFormPasswordLengthBellowEightCharacters"> + <argument name="customer" value="Simple_Customer_With_Password_Length_Is_Below_Eight_Characters"/> + </actionGroup> + + <!-- See the Error --> + <actionGroup ref="AssertMessageCustomerCreateAccountPasswordComplexityActionGroup" stepKey="seeTheErrorPasswordLength"> + <argument name="message" value="Minimum length of this field must be equal or greater than 8 symbols. Leading and trailing spaces will be ignored."/> + </actionGroup> + </test> +</tests> diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/NewCustomerPasswordComplexityTest.xml b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/NewCustomerPasswordComplexityTest.xml index 7b6f3e981714c..534f692a36aef 100644 --- a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/NewCustomerPasswordComplexityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/NewCustomerPasswordComplexityTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Security\Test\TestCase\NewCustomerPasswordComplexityTest" summary="New customer password complexity" ticketId="MAGETWO-49044"> <variation name="PasswordLengthTest" summary="Customer password length is below 8 characters"> - <data name="tag" xsi:type="string">severity:S1</data> + <data name="tag" xsi:type="string">severity:S1,mftf_migrated:yes</data> <data name="customer/data/firstname" xsi:type="string">john</data> <data name="customer/data/lastname" xsi:type="string">doe</data> <data name="customer/data/email" xsi:type="string">johndoe%isolation%@example.com</data> @@ -16,10 +16,9 @@ <data name="customer/data/password" xsi:type="string">123123</data> <data name="customer/data/password_confirmation" xsi:type="string">123123</data> <constraint name="Magento\Security\Test\Constraint\AssertPasswordLengthErrorMessage" /> - <data name="tag" xsi:type="string">mftf_migrated:yes</data> </variation> <variation name="PasswordComplexityTest" summary="Customer password is not secure enough"> - <data name="tag" xsi:type="string">severity:S1</data> + <data name="tag" xsi:type="string">severity:S1,mftf_migrated:yes</data> <data name="customer/data/firstname" xsi:type="string">john</data> <data name="customer/data/lastname" xsi:type="string">doe</data> <data name="customer/data/email" xsi:type="string">johndoe%isolation%@example.com</data> @@ -27,7 +26,6 @@ <data name="customer/data/password" xsi:type="string">123123qa</data> <data name="customer/data/password_confirmation" xsi:type="string">123123qa</data> <constraint name="Magento\Security\Test\Constraint\AssertPasswordIsNotSecureEnoughMessage" /> - <data name="tag" xsi:type="string">mftf_migrated:yes</data> </variation> </testCase> </config> From 0dd0db5943415f8892d5ee1e3b2811caaf679351 Mon Sep 17 00:00:00 2001 From: Tom Reece <treece@adobe.com> Date: Wed, 11 Dec 2019 10:47:23 -0600 Subject: [PATCH 277/586] MQE-1921: [MTF-To-MFTF] Process PR 711 - Add annotations to new action groups --- .../Mftf/ActionGroup/StorefrontClickHeaderLinkActionGroup.xml | 4 ++++ .../Mftf/ActionGroup/StorefrontSeeHeaderLinksActionGroup.xml | 3 +++ ...sageCustomerCreateAccountPasswordComplexityActionGroup.xml | 3 +++ 3 files changed, 10 insertions(+) diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontClickHeaderLinkActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontClickHeaderLinkActionGroup.xml index 052a5ac6a14e6..48e7ec81ae1c1 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontClickHeaderLinkActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontClickHeaderLinkActionGroup.xml @@ -8,9 +8,13 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="StorefrontClickHeaderLinkActionGroup"> + <annotations> + <description>Clicks a link in the storefront header.</description> + </annotations> <arguments> <argument name="linkName" type="string" defaultValue="Create an Account"/> </arguments> + <click stepKey="clickTheLink" selector="{{StorefrontHeaderSection.headerLinkByText(linkName)}}"/> <waitForPageLoad stepKey="wait"/> </actionGroup> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontSeeHeaderLinksActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontSeeHeaderLinksActionGroup.xml index f4498e3b6cdd7..ec5c388ee1c6b 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontSeeHeaderLinksActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontSeeHeaderLinksActionGroup.xml @@ -8,6 +8,9 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="StorefrontSeeHeaderLinksActionGroup"> + <annotations> + <description>See a link by name in the storefront header.</description> + </annotations> <arguments> <argument name="linkName" type="string" defaultValue="Create an Account"/> </arguments> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertMessageCustomerCreateAccountPasswordComplexityActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertMessageCustomerCreateAccountPasswordComplexityActionGroup.xml index 95a03042bec3b..b62f5435275a3 100644 --- a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertMessageCustomerCreateAccountPasswordComplexityActionGroup.xml +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertMessageCustomerCreateAccountPasswordComplexityActionGroup.xml @@ -9,6 +9,9 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AssertMessageCustomerCreateAccountPasswordComplexityActionGroup"> + <annotations> + <description>Assert is shown an error about their password during new user form filling.</description> + </annotations> <arguments> <argument name="message" type="string"/> </arguments> From 0b7b23616d1a391125cd7cb3230f09ac28572441 Mon Sep 17 00:00:00 2001 From: Tom Reece <treece@adobe.com> Date: Wed, 11 Dec 2019 11:04:02 -0600 Subject: [PATCH 278/586] MQE-1857: [MTF-To-MFTF] Process PR 746 --- .../AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml | 9 +++++---- ...nDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml | 8 ++++---- ...nDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml | 8 ++++---- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml index 4c3bd8179578c..b6cd116956812 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml @@ -6,16 +6,16 @@ */ --> -<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest"> <annotations> <stories value="Delete CMS Page URL rewrite with No Redirects"/> <title value="Delete CMS Page URL rewrite with No Redirects"/> <description value="Log in to admin and delete CMS Page URL rewrite with No Redirects"/> - <group value="cMSContent"/> + <testCaseId value="MC-14648"/> <group value="mtf_migrated"/> </annotations> - <before> <createData entity="simpleCmsPage" stepKey="createCMSPage"/> <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> @@ -46,14 +46,15 @@ <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage"> <argument name="message" value="You deleted the URL rewrite."/> </actionGroup> + <!--Search and verify AssertUrlRewriteNotInGrid--> <actionGroup ref="AdminSearchDeletedUrlRewrite" stepKey="searchDeletedUrlRewriteInGrid"> <argument name="requestPath" value="newrequestpath"/> </actionGroup> + <!--Verify AssertPageByUrlRewriteIsNotFound--> <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="assertPageByUrlRewriteIsNotFound"> <argument name="requestPath" value="newrequestpath"/> </actionGroup> - </test> </tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml index 89f663b54e017..1f76493bac89c 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml @@ -6,16 +6,16 @@ */ --> -<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest"> <annotations> <stories value="Delete CMS Page URL rewrite with Permanent Redirect"/> <title value="Delete CMS Page URL rewrite with Permanent Redirect"/> <description value="Log in to admin and delete CMS Page URL rewrite with Permanent Redirect"/> - <group value="cMSContent"/> + <testCaseId value="MC-14649"/> <group value="mtf_migrated"/> </annotations> - <before> <createData entity="simpleCmsPage" stepKey="createCMSPage"/> <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> @@ -46,10 +46,10 @@ <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage"> <argument name="message" value="You deleted the URL rewrite."/> </actionGroup> + <!-- Verify AssertPageByUrlRewriteIsNotFound --> <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="assertPageByUrlRewriteIsNotFound"> <argument name="requestPath" value="permanentrequestpath.html"/> </actionGroup> - </test> </tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml index ad7aec335b7a3..c62f0ece7e780 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml @@ -6,16 +6,16 @@ */ --> -<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest"> <annotations> <stories value="Delete CMS Page URL rewrite with Temporary Redirect"/> <title value="Delete CMS Page URL rewrite with Temporary Redirect"/> <description value="Log in to admin and delete CMS Page URL rewrite with Temporary Redirect"/> - <group value="cMSContent"/> + <testCaseId value="MC-14650"/> <group value="mtf_migrated"/> </annotations> - <before> <createData entity="simpleCmsPage" stepKey="createCMSPage"/> <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> @@ -46,10 +46,10 @@ <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage"> <argument name="message" value="You deleted the URL rewrite."/> </actionGroup> + <!--Verify AssertPageByUrlRewriteIsNotFound--> <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="assertPageByUrlRewriteIsNotFound"> <argument name="requestPath" value="temporaryrequestpath.html"/> </actionGroup> - </test> </tests> From 26e5774754cd2ce52707bd1327345c6a89f12d19 Mon Sep 17 00:00:00 2001 From: Dmytro Cheshun <d.cheshun@atwix.com> Date: Wed, 11 Dec 2019 21:06:27 +0200 Subject: [PATCH 279/586] Minor code style fixes --- .../js/jasmine/tests/lib/mage/browser.test.js | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/dev/tests/js/jasmine/tests/lib/mage/browser.test.js b/dev/tests/js/jasmine/tests/lib/mage/browser.test.js index ce76f5ec02b64..06f355908daca 100644 --- a/dev/tests/js/jasmine/tests/lib/mage/browser.test.js +++ b/dev/tests/js/jasmine/tests/lib/mage/browser.test.js @@ -12,7 +12,6 @@ define([ var obj; beforeEach(function () { - /** * Dummy constructor to use for instantiation * @constructor @@ -27,14 +26,14 @@ define([ describe('"openDialog" method', function () { it('Opens dialog with provided targetElementId', function () { var options = { - 'targetElementId': 1 - }; + 'targetElementId': 1 + }; spyOn($, 'ajax').and.callFake( - function () { + function () { return { /** - * Succes result of ajax request + * Success result of ajax request */ done: function () { obj.targetElementId = 1; @@ -44,22 +43,21 @@ define([ obj.openDialog('instance/url', 100, 100, 'title', options); obj.openDialog('instance/url', 100, 100, 'title', options); expect($.ajax.calls.count()).toBe(1); - }); it('Opens dialog with provided url param', function () { spyOn($, 'ajax').and.callFake( - function () { - return { - /** - * Succes result of ajax request - */ - done: function () { - obj.targetElementId = 'instance/url'; - obj.modalLoaded = true; - } - }; - }); + function () { + return { + /** + * Success result of ajax request + */ + done: function () { + obj.targetElementId = 'instance/url'; + obj.modalLoaded = true; + } + }; + }); obj.openDialog('instance/url', 100, 100, 'title', undefined); obj.openDialog('instance/url', 100, 100, 'title', undefined); expect($.ajax.calls.count()).toBe(1); From 0934026841b91b302dab5a06c5e2118cb1d2ac59 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Wed, 11 Dec 2019 13:38:10 -0600 Subject: [PATCH 280/586] Change action groups name according to CE branch changes --- .../AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml index 1c1f7af5a5cd5..4b9f37f628f34 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml @@ -38,7 +38,7 @@ </actionGroup> <!--Delete the Category Url Rewrite--> - <actionGroup ref="AssertPageByUrlRewriteIsNotFoundActionGroup" stepKey="deleteCustomUrlRewrite"> + <actionGroup ref="AdminDeleteUrlRewriteActionGroup" stepKey="deleteCustomUrlRewrite"> <argument name="requestPath" value="-"/> </actionGroup> <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage"> From 16ab63b347dd4628ed1cc1947929ff44b6bad90c Mon Sep 17 00:00:00 2001 From: Lukasz Lewandowski <luklewluk@gmail.com> Date: Wed, 11 Dec 2019 15:25:39 -0600 Subject: [PATCH 281/586] Fix caching Product Metadata getVersion --- lib/internal/Magento/Framework/App/ProductMetadata.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/App/ProductMetadata.php b/lib/internal/Magento/Framework/App/ProductMetadata.php index 052119713294b..8f989351743d2 100644 --- a/lib/internal/Magento/Framework/App/ProductMetadata.php +++ b/lib/internal/Magento/Framework/App/ProductMetadata.php @@ -85,8 +85,8 @@ public function getVersion() } else { $this->version = 'UNKNOWN'; } - $this->cache->save($this->version, self::VERSION_CACHE_KEY, [Config::CACHE_TAG]); } + $this->cache->save($this->version, self::VERSION_CACHE_KEY, [Config::CACHE_TAG]); } return $this->version; } From 09136b5ff8f0b4f1f78163ce4ab142b33a99f60d Mon Sep 17 00:00:00 2001 From: Tom Reece <treece@adobe.com> Date: Wed, 11 Dec 2019 15:55:27 -0600 Subject: [PATCH 282/586] MQE-1857: [MTF-To-MFTF] Process PR 746 - Try to fix some flakiness --- .../Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml | 2 ++ .../Test/Mftf/Test/AdminCreateCreditMemoPartialRefundTest.xml | 1 + 2 files changed, 3 insertions(+) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml index 94d488f216b49..eb4f2b5c25281 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml @@ -31,6 +31,8 @@ <argument name="category" value="$$createPreReqCategory$$"/> <argument name="simpleProduct" value="ProductWithUnicode"/> </actionGroup> + <magentoCLI command="indexer:reindex" stepKey="reindex"/> + <magentoCLI command="cache:flush" stepKey="flushCache"/> <actionGroup ref="AssertProductInStorefrontCategoryPage" stepKey="assertProductInStorefront1"> <argument name="category" value="$$createPreReqCategory$$"/> <argument name="product" value="ProductWithUnicode"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoPartialRefundTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoPartialRefundTest.xml index 418c0e72dc1fc..4b618495f19d5 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoPartialRefundTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoPartialRefundTest.xml @@ -80,6 +80,7 @@ <waitForPageLoad stepKey="waitForResultPage"/> <!-- Perform all assertions: assert refund success create message --> + <waitForElementVisible selector="{{AdminIndexManagementSection.successMessage}}" stepKey="waitForSuccessMessage"/> <see selector="{{AdminIndexManagementSection.successMessage}}" userInput="You created the credit memo." stepKey="assertRefundSuccessCreateMessage"/> <!-- Assert Credit Memo button --> From 264e6e6e86f4b0c7e17436ad72e331599a72c4ec Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Wed, 11 Dec 2019 21:27:49 -0600 Subject: [PATCH 283/586] Fix static --- .../Sales/view/adminhtml/templates/order/address/form.phtml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/view/adminhtml/templates/order/address/form.phtml b/app/code/Magento/Sales/view/adminhtml/templates/order/address/form.phtml index b794c418de8d9..0cc23056b3c2f 100644 --- a/app/code/Magento/Sales/view/adminhtml/templates/order/address/form.phtml +++ b/app/code/Magento/Sales/view/adminhtml/templates/order/address/form.phtml @@ -7,7 +7,11 @@ <div class="messages"> <div class="message message-notice"> <div class="message-inner"> - <div class="message-content"><?= $block->escapeHtml(__('Changing address information will not recalculate shipping, tax or other order amount.')) ?></div> + <div class="message-content"> + <?= $block->escapeHtml( + __('Changing address information will not recalculate shipping, tax or other order amount.') + ) ?> + </div> </div> </div> </div> From 4ce1365d58117883c7267be7abd5569c4dc99f45 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Thu, 12 Dec 2019 11:33:41 +0700 Subject: [PATCH 284/586] [Backend] Cover action admin/dashboard/ajaxBlock by Integration Test --- .../Adminhtml/Dashboard/AjaxBlockTest.php | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/Dashboard/AjaxBlockTest.php diff --git a/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/Dashboard/AjaxBlockTest.php b/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/Dashboard/AjaxBlockTest.php new file mode 100644 index 0000000000000..3deb225cead18 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/Dashboard/AjaxBlockTest.php @@ -0,0 +1,69 @@ +<?php +/** + * + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Backend\Controller\Adminhtml\Dashboard; + +use Magento\TestFramework\TestCase\AbstractBackendController; +use Magento\Framework\App\Request\Http as HttpRequest; + +/** + * @magentoAppArea adminhtml + */ +class AjaxBlockTest extends AbstractBackendController +{ + /** + * Test execute to check render block + * + * @dataProvider ajaxBlockDataProvider + */ + public function testExecute($block, $expectedResult) + { + $this->getRequest()->setMethod(HttpRequest::METHOD_POST); + $this->getRequest()->setParam('block', $block); + + $this->dispatch('backend/admin/dashboard/ajaxBlock/'); + + $this->assertEquals(200, $this->getResponse()->getHttpResponseCode()); + + $actual = $this->getResponse()->getBody(); + + $this->assertContains($expectedResult, $actual); + } + + /** + * Provides POST data and Expected Result + * + * @return array + */ + public function ajaxBlockDataProvider() + { + return [ + [ + 'tab_orders', + 'order_orders_period' + ], + [ + 'tab_amounts', + 'order_amounts_period' + ], + [ + 'totals', + 'dashboard_diagram_totals' + ], + [ + '', + '' + ], + [ + 'test_block', + '' + ] + ]; + } +} From 43e41fac06019d12e955d521cd9034b5954cb0d9 Mon Sep 17 00:00:00 2001 From: "rostyslav.hymon" <rostyslav.hymon@transoftgroup.com> Date: Thu, 12 Dec 2019 09:12:06 +0200 Subject: [PATCH 285/586] MC-29426: Orders in Payment System but not in Magento --- .../GuestPaymentInformationManagement.php | 50 ++++-------- .../Model/PaymentInformationManagement.php | 5 +- .../GuestPaymentInformationManagementTest.php | 77 +------------------ .../PaymentInformationManagementTest.php | 1 - .../Model/Coupon/UpdateCouponUsages.php | 12 +-- .../Plugin/CouponUsagesDecrement.php | 32 +++++--- .../Plugin/CouponUsagesIncrement.php | 15 ++-- app/code/Magento/SalesRule/etc/di.xml | 4 +- ...CouponDataAfterOrderCustomerAssignTest.php | 12 ++- .../SalesRule/Plugin/CouponUsagesTest.php | 32 +++++--- 10 files changed, 87 insertions(+), 153 deletions(-) diff --git a/app/code/Magento/Checkout/Model/GuestPaymentInformationManagement.php b/app/code/Magento/Checkout/Model/GuestPaymentInformationManagement.php index cae78389d4120..1d15a5dd7f176 100644 --- a/app/code/Magento/Checkout/Model/GuestPaymentInformationManagement.php +++ b/app/code/Magento/Checkout/Model/GuestPaymentInformationManagement.php @@ -56,11 +56,6 @@ class GuestPaymentInformationManagement implements \Magento\Checkout\Api\GuestPa */ private $logger; - /** - * @var ResourceConnection - */ - private $connectionPool; - /** * @param \Magento\Quote\Api\GuestBillingAddressManagementInterface $billingAddressManagement * @param \Magento\Quote\Api\GuestPaymentMethodManagementInterface $paymentMethodManagement @@ -68,7 +63,6 @@ class GuestPaymentInformationManagement implements \Magento\Checkout\Api\GuestPa * @param \Magento\Checkout\Api\PaymentInformationManagementInterface $paymentInformationManagement * @param \Magento\Quote\Model\QuoteIdMaskFactory $quoteIdMaskFactory * @param CartRepositoryInterface $cartRepository - * @param ResourceConnection $connectionPool * @codeCoverageIgnore */ public function __construct( @@ -77,8 +71,7 @@ public function __construct( \Magento\Quote\Api\GuestCartManagementInterface $cartManagement, \Magento\Checkout\Api\PaymentInformationManagementInterface $paymentInformationManagement, \Magento\Quote\Model\QuoteIdMaskFactory $quoteIdMaskFactory, - CartRepositoryInterface $cartRepository, - ResourceConnection $connectionPool = null + CartRepositoryInterface $cartRepository ) { $this->billingAddressManagement = $billingAddressManagement; $this->paymentMethodManagement = $paymentMethodManagement; @@ -86,7 +79,6 @@ public function __construct( $this->paymentInformationManagement = $paymentInformationManagement; $this->quoteIdMaskFactory = $quoteIdMaskFactory; $this->cartRepository = $cartRepository; - $this->connectionPool = $connectionPool ?: ObjectManager::getInstance()->get(ResourceConnection::class); } /** @@ -98,33 +90,23 @@ public function savePaymentInformationAndPlaceOrder( \Magento\Quote\Api\Data\PaymentInterface $paymentMethod, \Magento\Quote\Api\Data\AddressInterface $billingAddress = null ) { - $salesConnection = $this->connectionPool->getConnection('sales'); - $checkoutConnection = $this->connectionPool->getConnection('checkout'); - $salesConnection->beginTransaction(); - $checkoutConnection->beginTransaction(); - + $this->savePaymentInformation($cartId, $email, $paymentMethod, $billingAddress); try { - $this->savePaymentInformation($cartId, $email, $paymentMethod, $billingAddress); - try { - $orderId = $this->cartManagement->placeOrder($cartId); - } catch (\Magento\Framework\Exception\LocalizedException $e) { - throw new CouldNotSaveException( - __($e->getMessage()), - $e - ); - } catch (\Exception $e) { - $this->getLogger()->critical($e); - throw new CouldNotSaveException( - __('An error occurred on the server. Please try to place the order again.'), - $e - ); - } - $salesConnection->commit(); - $checkoutConnection->commit(); + $orderId = $this->cartManagement->placeOrder($cartId); + } catch (\Magento\Framework\Exception\LocalizedException $e) { + $this->getLogger()->critical( + 'Placing an order with quote_id ' . $cartId . ' is failed: ' . $e->getMessage() + ); + throw new CouldNotSaveException( + __($e->getMessage()), + $e + ); } catch (\Exception $e) { - $salesConnection->rollBack(); - $checkoutConnection->rollBack(); - throw $e; + $this->getLogger()->critical($e); + throw new CouldNotSaveException( + __('An error occurred on the server. Please try to place the order again.'), + $e + ); } return $orderId; diff --git a/app/code/Magento/Checkout/Model/PaymentInformationManagement.php b/app/code/Magento/Checkout/Model/PaymentInformationManagement.php index 2f1a36318ebc8..1f7931d7d3e6a 100644 --- a/app/code/Magento/Checkout/Model/PaymentInformationManagement.php +++ b/app/code/Magento/Checkout/Model/PaymentInformationManagement.php @@ -9,7 +9,7 @@ use Magento\Framework\Exception\CouldNotSaveException; /** - * Payment information management + * Payment information management service. * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ @@ -85,6 +85,9 @@ public function savePaymentInformationAndPlaceOrder( try { $orderId = $this->cartManagement->placeOrder($cartId); } catch (\Magento\Framework\Exception\LocalizedException $e) { + $this->getLogger()->critical( + 'Placing an order with quote_id ' . $cartId . ' is failed: ' . $e->getMessage() + ); throw new CouldNotSaveException( __($e->getMessage()), $e diff --git a/app/code/Magento/Checkout/Test/Unit/Model/GuestPaymentInformationManagementTest.php b/app/code/Magento/Checkout/Test/Unit/Model/GuestPaymentInformationManagementTest.php index 1de0ebce10f51..e3843991a181f 100644 --- a/app/code/Magento/Checkout/Test/Unit/Model/GuestPaymentInformationManagementTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Model/GuestPaymentInformationManagementTest.php @@ -7,8 +7,6 @@ namespace Magento\Checkout\Test\Unit\Model; -use Magento\Framework\App\ResourceConnection; -use Magento\Framework\DB\Adapter\AdapterInterface; use Magento\Quote\Model\Quote; use Magento\Quote\Model\Quote\Address; use Magento\Quote\Model\QuoteIdMask; @@ -53,11 +51,6 @@ class GuestPaymentInformationManagementTest extends \PHPUnit\Framework\TestCase */ private $loggerMock; - /** - * @var ResourceConnection|\PHPUnit_Framework_MockObject_MockObject - */ - private $resourceConnectionMock; - protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); @@ -75,10 +68,6 @@ protected function setUp() ['create'] ); $this->loggerMock = $this->createMock(\Psr\Log\LoggerInterface::class); - $this->resourceConnectionMock = $this->getMockBuilder(ResourceConnection::class) - ->disableOriginalConstructor() - ->getMock(); - $this->model = $objectManager->getObject( \Magento\Checkout\Model\GuestPaymentInformationManagement::class, [ @@ -86,8 +75,7 @@ protected function setUp() 'paymentMethodManagement' => $this->paymentMethodManagementMock, 'cartManagement' => $this->cartManagementMock, 'cartRepository' => $this->cartRepositoryMock, - 'quoteIdMaskFactory' => $this->quoteIdMaskFactoryMock, - 'connectionPool' => $this->resourceConnectionMock, + 'quoteIdMaskFactory' => $this->quoteIdMaskFactoryMock ] ); $objectManager->setBackwardCompatibleProperty($this->model, 'logger', $this->loggerMock); @@ -104,26 +92,6 @@ public function testSavePaymentInformationAndPlaceOrder() $billingAddressMock->expects($this->once())->method('setEmail')->with($email)->willReturnSelf(); - $adapterMockForSales = $this->getMockBuilder(AdapterInterface::class) - ->disableOriginalConstructor() - ->getMockForAbstractClass(); - $adapterMockForCheckout = $this->getMockBuilder(AdapterInterface::class) - ->disableOriginalConstructor() - ->getMockForAbstractClass(); - - $this->resourceConnectionMock->expects($this->at(0)) - ->method('getConnection') - ->with('sales') - ->willReturn($adapterMockForSales); - $adapterMockForSales->expects($this->once())->method('beginTransaction'); - $adapterMockForSales->expects($this->once())->method('commit'); - - $this->resourceConnectionMock->expects($this->at(1)) - ->method('getConnection') - ->with('checkout') - ->willReturn($adapterMockForCheckout); - $adapterMockForCheckout->expects($this->once())->method('beginTransaction'); - $adapterMockForCheckout->expects($this->once())->method('commit'); $this->paymentMethodManagementMock->expects($this->once())->method('set')->with($cartId, $paymentMock); $this->cartManagementMock->expects($this->once())->method('placeOrder')->with($cartId)->willReturn($orderId); @@ -146,27 +114,6 @@ public function testSavePaymentInformationAndPlaceOrderException() $this->getMockForAssignBillingAddress($cartId, $billingAddressMock); $billingAddressMock->expects($this->once())->method('setEmail')->with($email)->willReturnSelf(); - $adapterMockForSales = $this->getMockBuilder(AdapterInterface::class) - ->disableOriginalConstructor() - ->getMockForAbstractClass(); - $adapterMockForCheckout = $this->getMockBuilder(AdapterInterface::class) - ->disableOriginalConstructor() - ->getMockForAbstractClass(); - - $this->resourceConnectionMock->expects($this->at(0)) - ->method('getConnection') - ->with('sales') - ->willReturn($adapterMockForSales); - $adapterMockForSales->expects($this->once())->method('beginTransaction'); - $adapterMockForSales->expects($this->once())->method('rollback'); - - $this->resourceConnectionMock->expects($this->at(1)) - ->method('getConnection') - ->with('checkout') - ->willReturn($adapterMockForCheckout); - $adapterMockForCheckout->expects($this->once())->method('beginTransaction'); - $adapterMockForCheckout->expects($this->once())->method('rollback'); - $this->paymentMethodManagementMock->expects($this->once())->method('set')->with($cartId, $paymentMock); $exception = new \Magento\Framework\Exception\CouldNotSaveException(__('DB exception')); $this->cartManagementMock->expects($this->once())->method('placeOrder')->willThrowException($exception); @@ -236,31 +183,9 @@ public function testSavePaymentInformationAndPlaceOrderWithLocalizedException() $billingAddressMock->expects($this->once())->method('setEmail')->with($email)->willReturnSelf(); - $adapterMockForSales = $this->getMockBuilder(AdapterInterface::class) - ->disableOriginalConstructor() - ->getMockForAbstractClass(); - $adapterMockForCheckout = $this->getMockBuilder(AdapterInterface::class) - ->disableOriginalConstructor() - ->getMockForAbstractClass(); - - $this->resourceConnectionMock->expects($this->at(0)) - ->method('getConnection') - ->with('sales') - ->willReturn($adapterMockForSales); - $adapterMockForSales->expects($this->once())->method('beginTransaction'); - $adapterMockForSales->expects($this->once())->method('rollback'); - - $this->resourceConnectionMock->expects($this->at(1)) - ->method('getConnection') - ->with('checkout') - ->willReturn($adapterMockForCheckout); - $adapterMockForCheckout->expects($this->once())->method('beginTransaction'); - $adapterMockForCheckout->expects($this->once())->method('rollback'); - $this->paymentMethodManagementMock->expects($this->once())->method('set')->with($cartId, $paymentMock); $phrase = new \Magento\Framework\Phrase(__('DB exception')); $exception = new \Magento\Framework\Exception\LocalizedException($phrase); - $this->loggerMock->expects($this->never())->method('critical'); $this->cartManagementMock->expects($this->once())->method('placeOrder')->willThrowException($exception); $this->model->savePaymentInformationAndPlaceOrder($cartId, $email, $paymentMock, $billingAddressMock); diff --git a/app/code/Magento/Checkout/Test/Unit/Model/PaymentInformationManagementTest.php b/app/code/Magento/Checkout/Test/Unit/Model/PaymentInformationManagementTest.php index df5c255398ebd..ece395e3131f9 100644 --- a/app/code/Magento/Checkout/Test/Unit/Model/PaymentInformationManagementTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Model/PaymentInformationManagementTest.php @@ -157,7 +157,6 @@ public function testSavePaymentInformationAndPlaceOrderWithLocolizedException() $this->paymentMethodManagementMock->expects($this->once())->method('set')->with($cartId, $paymentMock); $phrase = new \Magento\Framework\Phrase(__('DB exception')); $exception = new \Magento\Framework\Exception\LocalizedException($phrase); - $this->loggerMock->expects($this->never())->method('critical'); $this->cartManagementMock->expects($this->once())->method('placeOrder')->willThrowException($exception); $this->model->savePaymentInformationAndPlaceOrder($cartId, $paymentMock, $billingAddressMock); diff --git a/app/code/Magento/SalesRule/Model/Coupon/UpdateCouponUsages.php b/app/code/Magento/SalesRule/Model/Coupon/UpdateCouponUsages.php index c4f7652e1a334..3236c80e1b7ed 100644 --- a/app/code/Magento/SalesRule/Model/Coupon/UpdateCouponUsages.php +++ b/app/code/Magento/SalesRule/Model/Coupon/UpdateCouponUsages.php @@ -7,7 +7,7 @@ namespace Magento\SalesRule\Model\Coupon; -use Magento\Sales\Model\Order; +use Magento\Sales\Api\Data\OrderInterface; use Magento\SalesRule\Model\Coupon; use Magento\SalesRule\Model\ResourceModel\Coupon\Usage; use Magento\SalesRule\Model\Rule\CustomerFactory; @@ -59,11 +59,11 @@ public function __construct( /** * Executes the current command. * - * @param Order $subject + * @param OrderInterface $subject * @param bool $increment - * @return Order + * @return OrderInterface */ - public function execute(Order $subject, bool $increment): Order + public function execute(OrderInterface $subject, bool $increment): OrderInterface { if (!$subject || !$subject->getAppliedRuleIds()) { return $subject; @@ -133,11 +133,11 @@ private function updateCustomerRuleUsages(bool $increment, int $ruleId, int $cus /** * Update the number of coupon usages. * - * @param Order $subject + * @param OrderInterface $subject * @param bool $increment * @param int $customerId */ - private function updateCouponUsages(Order $subject, bool $increment, int $customerId): void + private function updateCouponUsages(OrderInterface $subject, bool $increment, int $customerId): void { $this->coupon->load($subject->getCouponCode(), 'code'); if ($this->coupon->getId()) { diff --git a/app/code/Magento/SalesRule/Plugin/CouponUsagesDecrement.php b/app/code/Magento/SalesRule/Plugin/CouponUsagesDecrement.php index 5f28632a54cea..87a7c2ed1bd38 100644 --- a/app/code/Magento/SalesRule/Plugin/CouponUsagesDecrement.php +++ b/app/code/Magento/SalesRule/Plugin/CouponUsagesDecrement.php @@ -7,7 +7,8 @@ namespace Magento\SalesRule\Plugin; -use Magento\Sales\Model\Order; +use Magento\Sales\Model\OrderRepository; +use Magento\Sales\Model\Service\OrderService; use Magento\SalesRule\Model\Coupon\UpdateCouponUsages; /** @@ -20,30 +21,39 @@ class CouponUsagesDecrement */ private $updateCouponUsages; + /** + * @var OrderRepository + */ + private $orderRepository; + /** * @param UpdateCouponUsages $updateCouponUsages + * @param OrderRepository $orderRepository */ public function __construct( - UpdateCouponUsages $updateCouponUsages + UpdateCouponUsages $updateCouponUsages, + OrderRepository $orderRepository ) { $this->updateCouponUsages = $updateCouponUsages; + $this->orderRepository = $orderRepository; } /** * Decrements number of coupon usages after cancelling order. * - * @param Order $subject - * @param callable $proceed - * @return Order + * @param OrderService $subject + * @param bool $result + * @param int $orderId + * @return bool + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function aroundCancel(Order $subject, callable $proceed): Order + public function afterCancel(OrderService $subject, bool $result, $orderId): bool { - $canCancel = $subject->canCancel(); - $returnValue = $proceed(); - if ($canCancel) { - $returnValue = $this->updateCouponUsages->execute($returnValue, false); + $order = $this->orderRepository->get($orderId); + if ($result) { + $this->updateCouponUsages->execute($order, false); } - return $returnValue; + return $result; } } diff --git a/app/code/Magento/SalesRule/Plugin/CouponUsagesIncrement.php b/app/code/Magento/SalesRule/Plugin/CouponUsagesIncrement.php index 473a368afb25a..14bbb5fce02a5 100644 --- a/app/code/Magento/SalesRule/Plugin/CouponUsagesIncrement.php +++ b/app/code/Magento/SalesRule/Plugin/CouponUsagesIncrement.php @@ -7,7 +7,8 @@ namespace Magento\SalesRule\Plugin; -use Magento\Sales\Model\Order; +use Magento\Sales\Api\Data\OrderInterface; +use Magento\Sales\Model\Service\OrderService; use Magento\SalesRule\Model\Coupon\UpdateCouponUsages; /** @@ -32,15 +33,15 @@ public function __construct( /** * Increments number of coupon usages after placing order. * - * @param Order $subject - * @param Order $result - * @return Order + * @param OrderService $subject + * @param OrderInterface $result + * @return OrderInterface * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function afterPlace(Order $subject, Order $result): Order + public function afterPlace(OrderService $subject, OrderInterface $result): OrderInterface { - $this->updateCouponUsages->execute($subject, true); + $this->updateCouponUsages->execute($result, true); - return $subject; + return $result; } } diff --git a/app/code/Magento/SalesRule/etc/di.xml b/app/code/Magento/SalesRule/etc/di.xml index abb581175e36a..4ba67e2fa5871 100644 --- a/app/code/Magento/SalesRule/etc/di.xml +++ b/app/code/Magento/SalesRule/etc/di.xml @@ -185,9 +185,9 @@ <type name="Magento\Quote\Model\Cart\CartTotalRepository"> <plugin name="coupon_label_plugin" type="Magento\SalesRule\Plugin\CartTotalRepository" /> </type> - <type name="Magento\Sales\Model\Order"> - <plugin name="coupon_uses_increment_plugin" type="Magento\SalesRule\Plugin\CouponUsagesIncrement" sortOrder="20"/> + <type name="Magento\Sales\Model\Service\OrderService"> <plugin name="coupon_uses_decrement_plugin" type="Magento\SalesRule\Plugin\CouponUsagesDecrement" /> + <plugin name="coupon_uses_increment_plugin" type="Magento\SalesRule\Plugin\CouponUsagesIncrement" sortOrder="20"/> </type> <preference for="Magento\SalesRule\Model\Spi\CodeLimitManagerInterface" diff --git a/dev/tests/integration/testsuite/Magento/SalesRule/Model/Observer/AssignCouponDataAfterOrderCustomerAssignTest.php b/dev/tests/integration/testsuite/Magento/SalesRule/Model/Observer/AssignCouponDataAfterOrderCustomerAssignTest.php index 9eaca30e4bd5d..71d07342c108f 100644 --- a/dev/tests/integration/testsuite/Magento/SalesRule/Model/Observer/AssignCouponDataAfterOrderCustomerAssignTest.php +++ b/dev/tests/integration/testsuite/Magento/SalesRule/Model/Observer/AssignCouponDataAfterOrderCustomerAssignTest.php @@ -8,8 +8,8 @@ use Magento\Customer\Model\Data\Customer; use Magento\Customer\Model\GroupManagement; -use Magento\Framework\Controller\Result\Redirect; use Magento\Sales\Model\Order; +use Magento\Sales\Model\Service\OrderService; use Magento\SalesRule\Api\CouponRepositoryInterface; use Magento\SalesRule\Model\Coupon; use Magento\SalesRule\Model\Rule; @@ -17,8 +17,6 @@ use Magento\TestFramework\Helper\Bootstrap; /** - * Class AssignCouponDataAfterOrderCustomerAssignTest - * * @magentoAppIsolation enabled * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) @@ -80,6 +78,11 @@ class AssignCouponDataAfterOrderCustomerAssignTest extends \PHPUnit\Framework\Te */ private $customer; + /** + * @var OrderService + */ + private $orderService; + /** * @inheritdoc */ @@ -94,6 +97,7 @@ protected function setUp() $this->assignCouponToCustomerObserver = $this->objectManager->get( \Magento\SalesRule\Observer\AssignCouponDataAfterOrderCustomerAssignObserver::class ); + $this->orderService = $this->objectManager->get(OrderService::class); $this->salesRule = $this->prepareSalesRule(); $this->coupon = $this->attachSalesruleCoupon($this->salesRule); @@ -142,7 +146,7 @@ public function testOrderCancelingDecreasesCouponUsages() $this->processOrder($this->order); // Should not throw exception as bux is fixed now - $this->order->cancel(); + $this->orderService->cancel($this->order->getId()); $ruleCustomer = $this->getSalesruleCustomerUsage($this->customer, $this->salesRule); // Assert, that rule customer model has been created for specific customer diff --git a/dev/tests/integration/testsuite/Magento/SalesRule/Plugin/CouponUsagesTest.php b/dev/tests/integration/testsuite/Magento/SalesRule/Plugin/CouponUsagesTest.php index e0477993eea52..23c4dbad12f62 100644 --- a/dev/tests/integration/testsuite/Magento/SalesRule/Plugin/CouponUsagesTest.php +++ b/dev/tests/integration/testsuite/Magento/SalesRule/Plugin/CouponUsagesTest.php @@ -9,6 +9,7 @@ use Magento\Framework\DataObject; use Magento\Framework\ObjectManagerInterface; use Magento\Sales\Model\Order; +use Magento\Sales\Model\Service\OrderService; use Magento\SalesRule\Model\Coupon; use Magento\SalesRule\Model\ResourceModel\Coupon\Usage; use Magento\TestFramework\Helper\Bootstrap; @@ -46,6 +47,24 @@ class CouponUsagesTest extends \PHPUnit\Framework\TestCase */ private $order; + /** + * @var OrderService + */ + private $orderService; + + /** + * @inheritdoc + */ + protected function setUp() + { + $this->objectManager = Bootstrap::getObjectManager(); + $this->coupon = $this->objectManager->get(Coupon::class); + $this->usage = $this->objectManager->get(Usage::class); + $this->couponUsage = $this->objectManager->get(DataObject::class); + $this->order = $this->objectManager->get(Order::class); + $this->orderService = $this->objectManager->get(OrderService::class); + } + /** * Test increasing coupon usages after after order placing and decreasing after order cancellation. * @@ -62,7 +81,7 @@ public function testOrderCancellation() $this->order->loadByIncrementId($orderId); // Make sure coupon usages value is incremented then order is placed. - $this->order->place(); + $this->orderService->place($this->order); $this->usage->loadByCustomerCoupon($this->couponUsage, $customerId, $this->coupon->getId()); $this->coupon->loadByCode($couponCode); @@ -76,7 +95,7 @@ public function testOrderCancellation() ); // Make sure order coupon usages value is decremented then order is cancelled. - $this->order->cancel(); + $this->orderService->cancel($this->order->getId()); $this->usage->loadByCustomerCoupon($this->couponUsage, $customerId, $this->coupon->getId()); $this->coupon->loadByCode($couponCode); @@ -89,13 +108,4 @@ public function testOrderCancellation() $this->couponUsage->getTimesUsed() ); } - - protected function setUp() - { - $this->objectManager = Bootstrap::getObjectManager(); - $this->coupon = $this->objectManager->get(Coupon::class); - $this->usage = $this->objectManager->get(Usage::class); - $this->couponUsage = $this->objectManager->get(DataObject::class); - $this->order = $this->objectManager->get(Order::class); - } } From 32fb4d3b02ebc1529b29a2158e7ccf59cd4384f8 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Thu, 12 Dec 2019 09:38:43 +0200 Subject: [PATCH 286/586] MC-5233: DateTime product attributes support --- .../CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml index 3b60e4b09de28..1cec03a4c765e 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml @@ -308,6 +308,10 @@ <createData entity="_defaultProduct" stepKey="createSimpleProduct"> <requiredEntity createDataKey="createCategory"/> </createData> + + <!-- Perform reindex and flush cache --> + <magentoCLI command="indexer:reindex" stepKey="reindex"/> + <magentoCLI command="cache:flush" stepKey="flushCache"/> </before> <after> <deleteData stepKey="deleteProduct" createDataKey="createSimpleProduct"/> From e7cc91e90b847405e5d41516b18bc3fea646a65c Mon Sep 17 00:00:00 2001 From: Serhiy Yelahin <serhiy.yelahin@transoftgroup.com> Date: Thu, 12 Dec 2019 11:48:39 +0200 Subject: [PATCH 287/586] MC-25109: B2B changing company admin carries over the addresses --- ...ustomerEditPageAddressesTabActionGroup.xml | 19 ++++++++++++ ...tAssertCustomerAddressItemsActionGroup.xml | 29 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminNavigateCustomerEditPageAddressesTabActionGroup.xml create mode 100644 app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontAssertCustomerAddressItemsActionGroup.xml diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminNavigateCustomerEditPageAddressesTabActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminNavigateCustomerEditPageAddressesTabActionGroup.xml new file mode 100644 index 0000000000000..790a99c9092bc --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminNavigateCustomerEditPageAddressesTabActionGroup.xml @@ -0,0 +1,19 @@ +<?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="AdminNavigateCustomerEditPageAddressesTabActionGroup" extends="AdminOpenCustomerEditPageActionGroup"> + <annotations> + <description>EXTENDS: AdminOpenCustomerEditPageActionGroup. Navigates to Addresses Tab in Admin Customer Edit page for the provided Customer ID #.</description> + </annotations> + + <click selector="{{AdminEditCustomerInformationSection.addresses}}" after="waitForPageLoad" stepKey="navigateToAddressesTab"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontAssertCustomerAddressItemsActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontAssertCustomerAddressItemsActionGroup.xml new file mode 100644 index 0000000000000..e8dceb8f65926 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontAssertCustomerAddressItemsActionGroup.xml @@ -0,0 +1,29 @@ +<?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="StorefrontAssertCustomerAddressItemsActionGroup"> + <annotations> + <description>Validate that the Storefront Customer Address contains correct items.</description> + </annotations> + <arguments> + <argument name="address" type="entity"/> + </arguments> + + <seeInField selector="{{StorefrontCustomerAddressFormSection.firstName}}" userInput="{{address.firstName}}" stepKey="seeFirstName"/> + <seeInField selector="{{StorefrontCustomerAddressFormSection.lastName}}" userInput="{{address.lastName}}" stepKey="seeLastName"/> + <seeInField selector="{{StorefrontCustomerAddressFormSection.company}}" userInput="{{address.company}}" stepKey="seeCompany"/> + <seeInField selector="{{StorefrontCustomerAddressFormSection.phoneNumber}}" userInput="{{address.telephone}}" stepKey="seePhoneNumber"/> + <seeInField selector="{{StorefrontCustomerAddressFormSection.streetAddress}}" userInput="{{address.street[0]}}" stepKey="seeStreet"/> + <seeInField selector="{{StorefrontCustomerAddressFormSection.city}}" userInput="{{address.city}}" stepKey="seeCity"/> + <seeInField selector="{{StorefrontCustomerAddressFormSection.state}}" userInput="{{address.state}}" stepKey="seeState"/> + <seeInField selector="{{StorefrontCustomerAddressFormSection.zip}}" userInput="{{address.postcode}}" stepKey="seePostcode"/> + <seeInField selector="{{StorefrontCustomerAddressFormSection.country}}" userInput="{{address.country}}" stepKey="seeCountry"/> + </actionGroup> +</actionGroups> From 67c368b08dd667f1b5946c026bdd812ad6bf629b Mon Sep 17 00:00:00 2001 From: Viktor Petryk <victor.petryk@transoftgroup.com> Date: Thu, 12 Dec 2019 11:53:09 +0200 Subject: [PATCH 288/586] MC-29444: Extra Values of UPS and USPS are in dropdown list Cart Price Rule - Condition - Shipping Method --- app/code/Magento/Ups/Model/Carrier.php | 11 +++++++++-- .../Ups/Test/Unit/Model/CarrierTest.php | 18 ++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Ups/Model/Carrier.php b/app/code/Magento/Ups/Model/Carrier.php index e752b0005dbee..28e194e65bd60 100644 --- a/app/code/Magento/Ups/Model/Carrier.php +++ b/app/code/Magento/Ups/Model/Carrier.php @@ -1312,13 +1312,20 @@ public function getResponse() */ public function getAllowedMethods() { + $allowedMethods = explode(',', (string)$this->getConfigData('allowed_methods')); $isUpsXml = $this->getConfigData('type') === 'UPS_XML'; $origin = $this->getConfigData('origin_shipment'); - $allowedMethods = $isUpsXml + + $availableByTypeMethods = $isUpsXml ? $this->configHelper->getCode('originShipment', $origin) : $this->configHelper->getCode('method'); + + $filteredMethods = array_filter($availableByTypeMethods, function ($methodCode) use ($allowedMethods) { + return in_array($methodCode, $allowedMethods); + }, ARRAY_FILTER_USE_KEY); + $methods = []; - foreach ($allowedMethods as $methodCode => $methodData) { + foreach ($filteredMethods as $methodCode => $methodData) { $methods[$methodCode] = $methodData->getText(); } diff --git a/app/code/Magento/Ups/Test/Unit/Model/CarrierTest.php b/app/code/Magento/Ups/Test/Unit/Model/CarrierTest.php index 7af86c30cb5b3..7e587f249e67a 100644 --- a/app/code/Magento/Ups/Test/Unit/Model/CarrierTest.php +++ b/app/code/Magento/Ups/Test/Unit/Model/CarrierTest.php @@ -404,6 +404,7 @@ public function countryDataProvider() * @param string $methodType * @param string $methodCode * @param string $methodTitle + * @param string $allowedMethods * @param array $expectedMethods * @return void */ @@ -412,11 +413,18 @@ public function testGetAllowedMethods( string $methodType, string $methodCode, string $methodTitle, + string $allowedMethods, array $expectedMethods ): void { $this->scope->method('getValue') ->willReturnMap( [ + [ + 'carriers/ups/allowed_methods', + ScopeInterface::SCOPE_STORE, + null, + $allowedMethods + ], [ 'carriers/ups/type', ScopeInterface::SCOPE_STORE, @@ -449,6 +457,15 @@ public function allowedMethodsDataProvider(): array 'method', '1DM', 'Next Day Air Early AM', + '', + [], + ], + [ + 'UPS', + 'method', + '1DM', + 'Next Day Air Early AM', + '1DM,1DML,1DA', ['1DM' => 'Next Day Air Early AM'], ], [ @@ -456,6 +473,7 @@ public function allowedMethodsDataProvider(): array 'originShipment', '01', 'UPS Next Day Air', + '01,02,03', ['01' => 'UPS Next Day Air'], ], ]; From ae8cb2cc39828276cb60e602a0dd878774beff7b Mon Sep 17 00:00:00 2001 From: Mastiuhin Olexandr <mastiuhin.olexandr@transoftgroup.com> Date: Thu, 12 Dec 2019 13:15:12 +0200 Subject: [PATCH 289/586] MC-25098: Product is not deleted from minicart if not included in shared catalog --- .../testsuite/Magento/Checkout/Model/SessionTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/integration/testsuite/Magento/Checkout/Model/SessionTest.php b/dev/tests/integration/testsuite/Magento/Checkout/Model/SessionTest.php index c7802f73a9a47..e0e390e89c97c 100644 --- a/dev/tests/integration/testsuite/Magento/Checkout/Model/SessionTest.php +++ b/dev/tests/integration/testsuite/Magento/Checkout/Model/SessionTest.php @@ -18,7 +18,7 @@ use Magento\TestFramework\Helper\Bootstrap; /** - * Class SessionTest + * Checkout Session model test. * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ From 70b199cd3660b9e581c618f27ac7adc7db3c4114 Mon Sep 17 00:00:00 2001 From: divyajyothi5321 <54176640+divyajyothi5321@users.noreply.github.com> Date: Thu, 12 Dec 2019 17:22:03 +0530 Subject: [PATCH 290/586] Fixed the issue 25930 --- .../Magento/backend/web/css/source/components/_messages.less | 1 + 1 file changed, 1 insertion(+) diff --git a/app/design/adminhtml/Magento/backend/web/css/source/components/_messages.less b/app/design/adminhtml/Magento/backend/web/css/source/components/_messages.less index 15cd295885892..6660f780afdaf 100644 --- a/app/design/adminhtml/Magento/backend/web/css/source/components/_messages.less +++ b/app/design/adminhtml/Magento/backend/web/css/source/components/_messages.less @@ -44,6 +44,7 @@ .messages { .message { + .lib-wrap-words(); &:last-child { margin: 0 0 2rem; } From b67ab4377e58cb977e1ec95c86607943bad1144e Mon Sep 17 00:00:00 2001 From: Mastiuhin Olexandr <mastiuhin.olexandr@transoftgroup.com> Date: Thu, 12 Dec 2019 14:03:00 +0200 Subject: [PATCH 291/586] MC-29578: A lot of identical reviews are created after many times clicking on Submit Review button --- .../Review/view/frontend/templates/form.phtml | 14 ++++++++------ .../view/frontend/web/js/submit-review.js | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 app/code/Magento/Review/view/frontend/web/js/submit-review.js diff --git a/app/code/Magento/Review/view/frontend/templates/form.phtml b/app/code/Magento/Review/view/frontend/templates/form.phtml index f1340945043e9..6b00bf681c1e3 100644 --- a/app/code/Magento/Review/view/frontend/templates/form.phtml +++ b/app/code/Magento/Review/view/frontend/templates/form.phtml @@ -5,28 +5,29 @@ */ /** @var \Magento\Review\Block\Form $block */ +//phpcs:disable Generic.Files.LineLength ?> <div class="block review-add"> <div class="block-title"><strong><?= $block->escapeHtml(__('Write Your Own Review')) ?></strong></div> <div class="block-content"> -<?php if ($block->getAllowWriteReviewFlag()) : ?> +<?php if ($block->getAllowWriteReviewFlag()):?> <form action="<?= $block->escapeUrl($block->getAction()) ?>" class="review-form" method="post" id="review-form" data-role="product-review-form" data-bind="scope: 'review-form'"> <?= $block->getBlockHtml('formkey') ?> <?= $block->getChildHtml('form_fields_before') ?> <fieldset class="fieldset review-fieldset" data-hasrequired="<?= $block->escapeHtmlAttr(__('* Required Fields')) ?>"> <legend class="legend review-legend"><span><?= $block->escapeHtml(__("You're reviewing:")) ?></span><strong><?= $block->escapeHtml($block->getProductInfo()->getName()) ?></strong></legend><br /> - <?php if ($block->getRatings() && $block->getRatings()->getSize()) : ?> + <?php if ($block->getRatings() && $block->getRatings()->getSize()): ?> <span id="input-message-box"></span> <fieldset class="field required review-field-ratings"> <legend class="label"><span><?= $block->escapeHtml(__('Your Rating')) ?></span></legend><br/> <div class="control"> <div class="nested" id="product-review-table"> - <?php foreach ($block->getRatings() as $_rating) : ?> + <?php foreach ($block->getRatings() as $_rating): ?> <div class="field choice review-field-rating"> <label class="label" id="<?= $block->escapeHtml($_rating->getRatingCode()) ?>_rating_label"><span><?= $block->escapeHtml($_rating->getRatingCode()) ?></span></label> <div class="control review-control-vote"> <?php $options = $_rating->getOptions();?> - <?php $iterator = 1; foreach ($options as $_option) : ?> + <?php $iterator = 1; foreach ($options as $_option): ?> <input type="radio" name="ratings[<?= $block->escapeHtmlAttr($_rating->getId()) ?>]" @@ -84,11 +85,12 @@ }, "#review-form": { "Magento_Review/js/error-placement": {}, - "Magento_Review/js/validate-review": {} + "Magento_Review/js/validate-review": {}, + "Magento_Review/js/submit-review": {} } } </script> -<?php else : ?> +<?php else: ?> <div class="message info notlogged" id="review-form"> <div> <?= $block->escapeHtml(__('Only registered users can write reviews. Please <a href="%1">Sign in</a> or <a href="%2">create an account</a>', $block->getLoginLink(), $block->getRegisterUrl()), ['a']) ?> diff --git a/app/code/Magento/Review/view/frontend/web/js/submit-review.js b/app/code/Magento/Review/view/frontend/web/js/submit-review.js new file mode 100644 index 0000000000000..6399ce22ffe88 --- /dev/null +++ b/app/code/Magento/Review/view/frontend/web/js/submit-review.js @@ -0,0 +1,18 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +define([ + 'jquery' +], function ($) { + 'use strict'; + + return function (config, element) { + $(element).on('submit', function () { + if ($(this).valid()) { + $(this).find('.submit').attr('disabled', true); + } + }); + }; +}); From 3096b56dcebdd96d864ea09059997e4021333403 Mon Sep 17 00:00:00 2001 From: Nikita Shcherbatykh <nikita.shcherbatykh@transoftgroup.com> Date: Thu, 12 Dec 2019 15:12:50 +0200 Subject: [PATCH 292/586] MC-25257: Special from / to date wrong on administrator Dutch locale --- .../Product/Initialization/Helper.php | 55 +++-------- .../Catalog/Model/Product/Filter/DateTime.php | 67 ++++++++++++++ .../Product/Initialization/HelperTest.php | 78 ++++++++++------ .../Model/Product/Filter/DateTimeTest.php | 91 +++++++++++++++++++ 4 files changed, 219 insertions(+), 72 deletions(-) create mode 100644 app/code/Magento/Catalog/Model/Product/Filter/DateTime.php create mode 100644 app/code/Magento/Catalog/Test/Unit/Model/Product/Filter/DateTimeTest.php diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper.php index 62bcb1c8cd6d7..2ae97223d6359 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper.php @@ -6,7 +6,6 @@ namespace Magento\Catalog\Controller\Adminhtml\Product\Initialization; -use DateTime; use Magento\Backend\Helper\Js; use Magento\Catalog\Api\Data\ProductCustomOptionInterfaceFactory as CustomOptionFactory; use Magento\Catalog\Api\Data\ProductLinkInterfaceFactory as ProductLinkFactory; @@ -15,6 +14,8 @@ use Magento\Catalog\Api\ProductRepositoryInterface\Proxy as ProductRepository; use Magento\Catalog\Controller\Adminhtml\Product\Initialization\Helper\AttributeFilter; use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\Product\Authorization as ProductAuthorization; +use Magento\Catalog\Model\Product\Filter\DateTime as DateTimeFilter; use Magento\Catalog\Model\Product\Initialization\Helper\ProductLinks; use Magento\Catalog\Model\Product\Link\Resolver as LinkResolver; use Magento\Catalog\Model\Product\LinkTypeProvider; @@ -24,13 +25,13 @@ use Magento\Framework\Stdlib\DateTime\Filter\Date; use Magento\Store\Model\StoreManagerInterface; use Zend_Filter_Input; -use Magento\Catalog\Model\Product\Authorization as ProductAuthorization; /** * Product helper * * @api * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * @SuppressWarnings(PHPMD.TooManyFields) * @since 100.0.2 */ class Helper @@ -89,11 +90,6 @@ class Helper */ private $linkResolver; - /** - * @var \Magento\Framework\Stdlib\DateTime\Filter\DateTime - */ - private $dateTimeFilter; - /** * @var LinkTypeProvider */ @@ -114,6 +110,11 @@ class Helper */ private $localeFormat; + /** + * @var DateTimeFilter + */ + private $dateTimeFilter; + /** * Constructor * @@ -130,6 +131,7 @@ class Helper * @param AttributeFilter|null $attributeFilter * @param FormatInterface|null $localeFormat * @param ProductAuthorization|null $productAuthorization + * @param DateTimeFilter|null $dateTimeFilter * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -145,7 +147,8 @@ public function __construct( LinkTypeProvider $linkTypeProvider = null, AttributeFilter $attributeFilter = null, FormatInterface $localeFormat = null, - ?ProductAuthorization $productAuthorization = null + ?ProductAuthorization $productAuthorization = null, + ?DateTimeFilter $dateTimeFilter = null ) { $this->request = $request; $this->storeManager = $storeManager; @@ -162,6 +165,7 @@ public function __construct( $this->attributeFilter = $attributeFilter ?: $objectManager->get(AttributeFilter::class); $this->localeFormat = $localeFormat ?: $objectManager->get(FormatInterface::class); $this->productAuthorization = $productAuthorization ?? $objectManager->get(ProductAuthorization::class); + $this->dateTimeFilter = $dateTimeFilter ?? $objectManager->get(DateTimeFilter::class); } /** @@ -185,7 +189,6 @@ public function initializeFromData(Product $product, array $productData) } $productData = $this->normalize($productData); - $productData = $this->convertSpecialFromDateStringToObject($productData); if (!empty($productData['is_downloadable'])) { $productData['product_has_weight'] = 0; @@ -209,7 +212,7 @@ public function initializeFromData(Product $product, array $productData) foreach ($attributes as $attrKey => $attribute) { if ($attribute->getBackend()->getType() == 'datetime') { if (array_key_exists($attrKey, $productData) && $productData[$attrKey] != '') { - $dateFieldFilters[$attrKey] = $this->getDateTimeFilter(); + $dateFieldFilters[$attrKey] = $this->dateTimeFilter; } } } @@ -408,22 +411,6 @@ private function getLinkResolver() return $this->linkResolver; } - /** - * Get DateTimeFilter instance - * - * @return \Magento\Framework\Stdlib\DateTime\Filter\DateTime - * @deprecated 101.0.0 - */ - private function getDateTimeFilter() - { - if ($this->dateTimeFilter === null) { - $this->dateTimeFilter = ObjectManager::getInstance() - ->get(\Magento\Framework\Stdlib\DateTime\Filter\DateTime::class); - } - - return $this->dateTimeFilter; - } - /** * Remove ids of non selected websites from $websiteIds array and return filtered data * @@ -497,20 +484,4 @@ function ($valueData) { return $product->setOptions($customOptions); } - - /** - * Convert string date presentation into object - * - * @param array $productData - * @return array - */ - private function convertSpecialFromDateStringToObject($productData) - { - if (isset($productData['special_from_date']) && $productData['special_from_date'] != '') { - $productData['special_from_date'] = $this->getDateTimeFilter()->filter($productData['special_from_date']); - $productData['special_from_date'] = new DateTime($productData['special_from_date']); - } - - return $productData; - } } diff --git a/app/code/Magento/Catalog/Model/Product/Filter/DateTime.php b/app/code/Magento/Catalog/Model/Product/Filter/DateTime.php new file mode 100644 index 0000000000000..93b7d55458a9f --- /dev/null +++ b/app/code/Magento/Catalog/Model/Product/Filter/DateTime.php @@ -0,0 +1,67 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Model\Product\Filter; + +use Magento\Framework\Stdlib\DateTime as StdlibDateTime; +use Magento\Framework\Stdlib\DateTime\Filter\DateTime as StdlibDateTimeFilter; + +/** + * Product datetime fields values filter + */ +class DateTime implements \Zend_Filter_Interface +{ + /** + * @var StdlibDateTimeFilter + */ + private $stdlibDateTimeFilter; + + /** + * Initializes dependencies. + * + * @param StdlibDateTimeFilter $stdlibDateTimeFilter + */ + public function __construct(StdlibDateTimeFilter $stdlibDateTimeFilter) + { + $this->stdlibDateTimeFilter = $stdlibDateTimeFilter; + } + + /** + * Convert datetime from locale format to internal format; + * + * Make an additional check for MySql date format which is wrongly parsed by IntlDateFormatter + * + * @param mixed $value + * @return mixed|string + * @throws \Exception + */ + public function filter($value) + { + if (is_string($value)) { + $value = $this->createDateFromMySqlFormat($value) ?? $value; + } + return $this->stdlibDateTimeFilter->filter($value); + } + + /** + * Parse a string in MySql date format into a new DateTime object + * + * @param string $value + * @return \DateTime|null + */ + private function createDateFromMySqlFormat(string $value): ?\DateTime + { + $datetime = date_create_from_format(StdlibDateTime::DATETIME_PHP_FORMAT, $value); + if ($datetime === false) { + $datetime = date_create_from_format(StdlibDateTime::DATE_PHP_FORMAT, $value); + if ($datetime !== false) { + $datetime->setTime(0, 0, 0, 0); + } + } + return $datetime instanceof \DateTime ? $datetime : null; + } +} diff --git a/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Initialization/HelperTest.php b/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Initialization/HelperTest.php index 134c6f9edeaf7..2aea34244437d 100644 --- a/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Initialization/HelperTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Initialization/HelperTest.php @@ -165,6 +165,8 @@ protected function setUp() ->disableOriginalConstructor() ->getMock(); + $this->dateTimeFilterMock = $this->createMock(\Magento\Catalog\Model\Product\Filter\DateTime::class); + $this->helper = $this->objectManager->getObject( Helper::class, [ @@ -178,6 +180,7 @@ protected function setUp() 'linkTypeProvider' => $this->linkTypeProviderMock, 'attributeFilter' => $this->attributeFilterMock, 'localeFormat' => $this->localeFormatMock, + 'dateTimeFilter' => $this->dateTimeFilterMock ] ); @@ -188,11 +191,6 @@ protected function setUp() $resolverProperty = $helperReflection->getProperty('linkResolver'); $resolverProperty->setAccessible(true); $resolverProperty->setValue($this->helper, $this->linkResolverMock); - - $this->dateTimeFilterMock = $this->createMock(\Magento\Framework\Stdlib\DateTime\Filter\DateTime::class); - $dateTimeFilterProperty = $helperReflection->getProperty('dateTimeFilter'); - $dateTimeFilterProperty->setAccessible(true); - $dateTimeFilterProperty->setValue($this->helper, $this->dateTimeFilterMock); } /** @@ -226,6 +224,7 @@ public function testInitialize( ]; $specialFromDate = '2018-03-03 19:30:00'; $productData = [ + 'name' => 'Simple Product', 'stock_data' => ['stock_data'], 'options' => $optionsData, 'website_ids' => $websiteIds, @@ -235,30 +234,23 @@ public function testInitialize( $productData = array_merge($productData, ['tier_price' => $tierPrice]); } - $this->dateTimeFilterMock->expects($this->once()) + $this->dateTimeFilterMock + ->expects($this->once()) ->method('filter') - ->with($specialFromDate) - ->willReturn($specialFromDate); - - $attributeNonDate = $this->getMockBuilder(\Magento\Catalog\Model\ResourceModel\Eav\Attribute::class) - ->disableOriginalConstructor() - ->getMock(); - $attributeDate = $this->getMockBuilder(\Magento\Catalog\Model\ResourceModel\Eav\Attribute::class) - ->disableOriginalConstructor() - ->getMock(); - - $attributeNonDateBackEnd = - $this->getMockBuilder(\Magento\Eav\Model\Entity\Attribute\Backend\DefaultBackend::class) - ->disableOriginalConstructor() - ->getMock(); - $attributeDateBackEnd = $this->getMockBuilder(\Magento\Eav\Model\Entity\Attribute\Backend\Datetime::class) - ->disableOriginalConstructor() - ->getMock(); + ->willReturnArgument(0); - $attributeNonDate->expects($this->any())->method('getBackend')->willReturn($attributeNonDateBackEnd); - $attributeDate->expects($this->any())->method('getBackend')->willReturn($attributeDateBackEnd); - $attributeNonDateBackEnd->expects($this->any())->method('getType')->willReturn('non-datetime'); - $attributeDateBackEnd->expects($this->any())->method('getType')->willReturn('datetime'); + $this->setProductAttributes( + [ + [ + 'code' => 'name', + 'backend_type' => 'varchar', + ], + [ + 'code' => 'special_from_date', + 'backend_type' => 'datetime', + ] + ] + ); $useDefaults = ['attributeCode1', 'attributeCode2']; @@ -274,8 +266,6 @@ public function testInitialize( $this->productMock->expects($this->once())->method('isLockedAttribute')->with('media')->willReturn(true); $this->productMock->expects($this->once())->method('unlockAttribute')->with('media'); $this->productMock->expects($this->once())->method('lockAttribute')->with('media'); - $this->productMock->expects($this->once())->method('getAttributes') - ->willReturn([$attributeNonDate, $attributeDate]); $this->productMock->expects($this->any())->method('getSku')->willReturn('sku'); $this->productMock->expects($this->any())->method('getOptionsReadOnly')->willReturn(false); @@ -348,7 +338,35 @@ function () { } $this->assertEquals($expectedLinks, $resultLinks); - $this->assertEquals($specialFromDate, $productData['special_from_date']); + $this->assertEquals($specialFromDate, $this->productMock->getSpecialFromDate()); + } + + /** + * Mock product attributes + * + * @param array $attributes + */ + private function setProductAttributes(array $attributes): void + { + $attributesModels = []; + foreach ($attributes as $attribute) { + $attributeModel = $this->createMock(\Magento\Catalog\Model\ResourceModel\Eav\Attribute::class); + $backendModel = $attribute['backend_model'] + ?? $this->createMock(\Magento\Eav\Model\Entity\Attribute\Backend\DefaultBackend::class); + $attributeModel->expects($this->any()) + ->method('getBackend') + ->willReturn($backendModel); + $attributeModel->expects($this->any()) + ->method('getAttributeCode') + ->willReturn($attribute['code']); + $backendModel->expects($this->any()) + ->method('getType') + ->willReturn($attribute['backend_type']); + $attributesModels[$attribute['code']] = $attributeModel; + } + $this->productMock->expects($this->once()) + ->method('getAttributes') + ->willReturn($attributesModels); } /** diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/Filter/DateTimeTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/Filter/DateTimeTest.php new file mode 100644 index 0000000000000..aefa0b1cf106d --- /dev/null +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/Filter/DateTimeTest.php @@ -0,0 +1,91 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Test\Unit\Model\Product\Filter; + +use Magento\Framework\Locale\Resolver; +use Magento\Framework\Locale\ResolverInterface; +use Magento\Framework\Stdlib\DateTime\Timezone; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use PHPUnit\Framework\TestCase; + +/** + * Test datetime filter + */ +class DateTimeTest extends TestCase +{ + /** + * @var string + */ + private $locale; + /** + * @var \Magento\Catalog\Model\Product\Filter\DateTime + */ + private $model; + + /** + * @inheritDoc + */ + protected function setUp() + { + parent::setUp(); + $objectManager = new ObjectManager($this); + $this->locale = Resolver::DEFAULT_LOCALE; + $localeResolver = $this->getMockForAbstractClass(ResolverInterface::class); + $localeResolver->expects($this->any()) + ->method('getLocale') + ->willReturnCallback( + function () { + return $this->locale; + } + ); + $timezone = $objectManager->getObject( + Timezone::class, + ['localeResolver' => $localeResolver] + ); + $stdlibDateTimeFilter = $objectManager->getObject( + \Magento\Framework\Stdlib\DateTime\Filter\DateTime::class, + ['localeDate' => $timezone] + ); + $this->model = $objectManager->getObject( + \Magento\Catalog\Model\Product\Filter\DateTime::class, + [ + 'stdlibDateTimeFilter' => $stdlibDateTimeFilter + ] + ); + } + + /** + * Test filter with different dates formats and locales + * + * @dataProvider provideFilter + */ + public function testFilter(string $date, string $expectedDate, string $locale = Resolver::DEFAULT_LOCALE) + { + $this->locale = $locale; + $this->assertEquals($expectedDate, $this->model->filter($date)); + } + + /** + * Provide date formats and locales + * + * @return array + */ + public function provideFilter(): array + { + return [ + ['1999-12-31', '1999-12-31 00:00:00', 'en_US'], + ['12-31-1999', '1999-12-31 00:00:00', 'en_US'], + ['12/31/1999', '1999-12-31 00:00:00', 'en_US'], + ['December 31, 1999', '1999-12-31 00:00:00', 'en_US'], + ['1999-12-31', '1999-12-31 00:00:00', 'fr_FR'], + ['31-12-1999', '1999-12-31 00:00:00', 'fr_FR'], + ['31/12/1999', '1999-12-31 00:00:00', 'fr_FR'], + ['31 Décembre 1999', '1999-12-31 00:00:00', 'fr_FR'], + ]; + } +} From edfc05b0634f253c2cf12687d288ae8b1e62190c Mon Sep 17 00:00:00 2001 From: Nikita Shcherbatykh <nikita.shcherbatykh@transoftgroup.com> Date: Thu, 12 Dec 2019 15:22:36 +0200 Subject: [PATCH 293/586] MC-29449: Catalog Price Rule Not Applying on Admin Manage Shopping Cart --- .../ProcessAdminFinalPriceObserver.php | 20 +- .../ProcessAdminFinalPriceObserverTest.php | 191 ++++++++++++++++++ .../Model/Indexer/Product/PriceTest.php | 47 ++++- .../_files/catalog_rule_50_percent_off.php | 36 ++++ .../catalog_rule_50_percent_off_rollback.php | 28 +++ .../CatalogRule/_files/simple_products.php | 68 +++++-- .../_files/simple_products_rollback.php | 2 +- 7 files changed, 373 insertions(+), 19 deletions(-) create mode 100644 app/code/Magento/CatalogRule/Test/Unit/Observer/ProcessAdminFinalPriceObserverTest.php create mode 100644 dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_50_percent_off.php create mode 100644 dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_50_percent_off_rollback.php diff --git a/app/code/Magento/CatalogRule/Observer/ProcessAdminFinalPriceObserver.php b/app/code/Magento/CatalogRule/Observer/ProcessAdminFinalPriceObserver.php index 89ed519cfb8c8..0add936467471 100644 --- a/app/code/Magento/CatalogRule/Observer/ProcessAdminFinalPriceObserver.php +++ b/app/code/Magento/CatalogRule/Observer/ProcessAdminFinalPriceObserver.php @@ -7,9 +7,10 @@ namespace Magento\CatalogRule\Observer; -use Magento\Framework\Stdlib\DateTime\TimezoneInterface; -use Magento\Framework\Registry; use Magento\Framework\Event\ObserverInterface; +use Magento\Framework\Registry; +use Magento\Framework\Stdlib\DateTime\TimezoneInterface; +use Magento\Store\Model\StoreManagerInterface; /** * Observer for applying catalog rules on product for admin area @@ -23,6 +24,11 @@ class ProcessAdminFinalPriceObserver implements ObserverInterface */ protected $coreRegistry; + /** + * @var StoreManagerInterface + */ + protected $storeManager; + /** * @var \Magento\Framework\Stdlib\DateTime\TimezoneInterface */ @@ -41,17 +47,20 @@ class ProcessAdminFinalPriceObserver implements ObserverInterface /** * @param RulePricesStorage $rulePricesStorage * @param Registry $coreRegistry + * @param StoreManagerInterface $storeManager * @param \Magento\CatalogRule\Model\ResourceModel\RuleFactory $resourceRuleFactory * @param TimezoneInterface $localeDate */ public function __construct( RulePricesStorage $rulePricesStorage, Registry $coreRegistry, + StoreManagerInterface $storeManager, \Magento\CatalogRule\Model\ResourceModel\RuleFactory $resourceRuleFactory, TimezoneInterface $localeDate ) { $this->rulePricesStorage = $rulePricesStorage; $this->coreRegistry = $coreRegistry; + $this->storeManager = $storeManager; $this->resourceRuleFactory = $resourceRuleFactory; $this->localeDate = $localeDate; } @@ -61,6 +70,7 @@ public function __construct( * * @param \Magento\Framework\Event\Observer $observer * @return $this + * @throws \Magento\Framework\Exception\NoSuchEntityException */ public function execute(\Magento\Framework\Event\Observer $observer) { @@ -74,13 +84,17 @@ public function execute(\Magento\Framework\Event\Observer $observer) $wId = $ruleData->getWebsiteId(); $gId = $ruleData->getCustomerGroupId(); $pId = $product->getId(); - $key = "{$date->format('Y-m-d H:i:s')}|{$wId}|{$gId}|{$pId}"; } elseif ($product->getWebsiteId() !== null && $product->getCustomerGroupId() !== null) { $wId = $product->getWebsiteId(); $gId = $product->getCustomerGroupId(); $pId = $product->getId(); $key = "{$date->format('Y-m-d H:i:s')}|{$wId}|{$gId}|{$pId}"; + } elseif ($product->getWebsiteId() === null && $product->getCustomerGroupId() !== null) { + $wId = $this->storeManager->getStore($storeId)->getWebsiteId(); + $gId = $product->getCustomerGroupId(); + $pId = $product->getId(); + $key = "{$date->format('Y-m-d H:i:s')}|{$wId}|{$gId}|{$pId}"; } if ($key) { diff --git a/app/code/Magento/CatalogRule/Test/Unit/Observer/ProcessAdminFinalPriceObserverTest.php b/app/code/Magento/CatalogRule/Test/Unit/Observer/ProcessAdminFinalPriceObserverTest.php new file mode 100644 index 0000000000000..558fef8660606 --- /dev/null +++ b/app/code/Magento/CatalogRule/Test/Unit/Observer/ProcessAdminFinalPriceObserverTest.php @@ -0,0 +1,191 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\CatalogRule\Test\Unit\Observer; + +use Magento\Catalog\Model\Product; +use Magento\CatalogRule\Model\ResourceModel\RuleFactory; +use Magento\CatalogRule\Observer\ProcessAdminFinalPriceObserver; +use Magento\CatalogRule\Observer\RulePricesStorage; +use Magento\Framework\Event; +use Magento\Framework\Event\Observer; +use Magento\Framework\Stdlib\DateTime\TimezoneInterface; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Store\Model\Store; +use Magento\Store\Model\StoreManagerInterface; +use Magento\Ui\Component\Form\Element\DataType\Date; +use PHPUnit\Framework\TestCase; + +/** + * Class ProcessAdminFinalPriceObserverTest + * + * Test class for Observer for applying catalog rules on product for admin area + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ +class ProcessAdminFinalPriceObserverTest extends TestCase +{ + /** + * @var ProcessAdminFinalPriceObserver + */ + private $observer; + + /** + * Store Manager mock + * + * @var StoreManagerInterface + */ + private $storeManagerMock; + + /** + * Locale Date mock + * + * @var TimezoneInterface + */ + private $localeDateMock; + + /** + * Resource Rule Factory mock + * + * @var RuleFactory + */ + private $resourceRuleFactoryMock; + + /** + * Rule Prices Storage mock + * + * @var RulePricesStorage + */ + private $rulePricesStorageMock; + + /** + * @var Event|\PHPUnit_Framework_MockObject_MockObject + */ + private $eventMock; + + /** + * @var Observer|\PHPUnit\Framework\MockObject\MockObject + */ + private $observerMock; + + protected function setUp() + { + $this->observerMock = $this + ->getMockBuilder(Observer::class) + ->disableOriginalConstructor() + ->getMock(); + $this->eventMock = $this + ->getMockBuilder(Event::class) + ->setMethods(['getProduct']) + ->disableOriginalConstructor() + ->getMock(); + $this->rulePricesStorageMock = $this->getMockBuilder(RulePricesStorage::class) + ->setMethods(['getWebsiteId', 'getRulePrice', 'getCustomerGroupId', 'setRulePrice']) + ->disableOriginalConstructor() + ->getMock(); + $this->storeManagerMock = $this->getMockBuilder(StoreManagerInterface::class) + ->setMethods(['getStore']) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $this->resourceRuleFactoryMock = $this->getMockBuilder(RuleFactory::class) + ->setMethods(['create']) + ->disableOriginalConstructor() + ->getMock(); + $this->localeDateMock = $this->getMockBuilder(TimezoneInterface::class) + ->setMethods(['scopeDate']) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $objectManagerHelper = new ObjectManager($this); + $this->observer = $objectManagerHelper->getObject( + ProcessAdminFinalPriceObserver::class, + [ + 'rulePricesStorage' => $this->rulePricesStorageMock, + 'storeManager' => $this->storeManagerMock, + 'resourceRuleFactory' => $this->resourceRuleFactoryMock, + 'localeDate' => $this->localeDateMock + ] + ); + } + + public function testExecute() + { + $finalPrice = 20.00; + $rulePrice = 10.00; + $storeId = 2; + $wId = 1; + $gId = 4; + $pId = 20; + $localeDateFormat = 'Y-m-d H:i:s'; + $date = '2019-12-02 08:00:00'; + $storeMock = $this->createMock(Store::class); + $this->observerMock + ->expects($this->atLeastOnce()) + ->method('getEvent') + ->willReturn($this->eventMock); + + $productMock = $this->getMockBuilder(Product::class) + ->setMethods( + [ + 'getStoreId', + 'getWebsiteId', + 'getId', + 'getData', + 'getCustomerGroupId', + 'setFinalPrice' + ] + ) + ->disableOriginalConstructor() + ->getMock(); + $dateMock = $this->getMockBuilder(Date::class) + ->setMethods(['format']) + ->disableOriginalConstructor() + ->getMock(); + + $this->localeDateMock->expects($this->once()) + ->method('scopeDate') + ->with($storeId) + ->willReturn($dateMock); + $dateMock->expects($this->once()) + ->method('format') + ->with($localeDateFormat) + ->willReturn($date); + $storeMock->expects($this->once()) + ->method('getWebsiteId') + ->willReturn($wId); + $this->storeManagerMock->expects($this->once()) + ->method('getStore') + ->with($storeId) + ->willReturn($storeMock); + $productMock->expects($this->once()) + ->method('getStoreId') + ->willReturn($storeId); + $productMock->expects($this->any()) + ->method('getCustomerGroupId') + ->willReturn($gId); + $productMock->expects($this->once()) + ->method('getId') + ->willReturn($pId); + $productMock->expects($this->once()) + ->method('getData') + ->with('final_price') + ->willReturn($finalPrice); + $this->rulePricesStorageMock->expects($this->any()) + ->method('getCustomerGroupId') + ->willReturn($gId); + $this->resourceRuleFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($this->rulePricesStorageMock); + $this->rulePricesStorageMock->expects($this->any()) + ->method('getRulePrice') + ->willReturn($rulePrice); + $this->rulePricesStorageMock->expects($this->once()) + ->method('setRulePrice') + ->willReturnSelf(); + $this->eventMock + ->expects($this->atLeastOnce()) + ->method('getProduct') + ->willReturn($productMock); + $this->assertEquals($this->observer, $this->observer->execute($this->observerMock)); + } +} diff --git a/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/Product/PriceTest.php b/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/Product/PriceTest.php index 495d19a2745e5..ce182f56898ef 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/Product/PriceTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/Product/PriceTest.php @@ -5,12 +5,13 @@ */ namespace Magento\CatalogRule\Model\Indexer\Product; -use Magento\TestFramework\Helper\Bootstrap; -use Magento\CatalogRule\Model\ResourceModel\Rule; -use Magento\Catalog\Model\ResourceModel\Product\Collection; use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\ProductRepository; +use Magento\Catalog\Model\ResourceModel\Product\Collection; +use Magento\CatalogRule\Model\ResourceModel\Rule; use Magento\Framework\Api\SearchCriteriaInterface; use Magento\Framework\Api\SortOrder; +use Magento\TestFramework\Helper\Bootstrap; class PriceTest extends \PHPUnit\Framework\TestCase { @@ -56,6 +57,46 @@ public function testPriceApplying() $this->assertEquals($simpleProduct->getFinalPrice(), $confProduct->getMinimalPrice()); } + /** + * @magentoDataFixtureBeforeTransaction Magento/CatalogRule/_files/simple_products.php + * @magentoDataFixtureBeforeTransaction Magento/CatalogRule/_files/catalog_rule_50_percent_off.php + * @magentoDbIsolation enabled + * @magentoAppIsolation enabled + */ + public function testPriceForSecondStore() + { + $customerGroupId = 1; + $websiteId = 2; + /** @var ProductRepository $productRepository */ + $productRepository = Bootstrap::getObjectManager()->create( + ProductRepository::class + ); + $simpleProduct = $productRepository->get('simple3'); + $simpleProduct->setPriceCalculation(true); + $this->assertEquals('simple3', $simpleProduct->getSku()); + $this->assertFalse( + $this->resourceRule->getRulePrice( + new \DateTime(), + $websiteId, + $customerGroupId, + $simpleProduct->getId() + ) + ); + $indexerBuilder = Bootstrap::getObjectManager()->get( + \Magento\CatalogRule\Model\Indexer\IndexBuilder::class + ); + $indexerBuilder->reindexById($simpleProduct->getId()); + $this->assertEquals( + $this->resourceRule->getRulePrice( + new \DateTime(), + $websiteId, + $customerGroupId, + $simpleProduct->getId() + ), + 25 + ); + } + /** * @magentoDataFixtureBeforeTransaction Magento/CatalogRule/_files/simple_products.php * @magentoDataFixtureBeforeTransaction Magento/CatalogRule/_files/rule_by_attribute.php diff --git a/dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_50_percent_off.php b/dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_50_percent_off.php new file mode 100644 index 0000000000000..ca5c8ecbbd59f --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_50_percent_off.php @@ -0,0 +1,36 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +use Magento\TestFramework\Helper\Bootstrap; + +/** + * Creates simple Catalog Rule with the following data: + * active, applied to all products, without time limits, with 50% off for all customers + */ +/** @var \Magento\CatalogRule\Model\Rule $rule */ +$catalogRule = Bootstrap::getObjectManager()->get(\Magento\CatalogRule\Model\RuleFactory::class)->create(); +$catalogRule->loadPost( + [ + 'name' => 'Test Catalog Rule 50% off', + 'is_active' => '1', + 'stop_rules_processing' => 0, + 'website_ids' => [2], + 'customer_group_ids' => [0, 1], + 'discount_amount' => 50, + 'simple_action' => 'by_percent', + 'from_date' => '', + 'to_date' => '', + 'sort_order' => 0, + 'sub_is_enable' => 0, + 'sub_discount_amount' => 0, + 'conditions' => [], + ] +); +$catalogRule->save(); +/** @var \Magento\CatalogRule\Model\Indexer\IndexBuilder $indexBuilder */ +$indexBuilder = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->get(\Magento\CatalogRule\Model\Indexer\IndexBuilder::class); +$indexBuilder->reindexFull(); diff --git a/dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_50_percent_off_rollback.php b/dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_50_percent_off_rollback.php new file mode 100644 index 0000000000000..404bfd021492d --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_50_percent_off_rollback.php @@ -0,0 +1,28 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + +/** @var \Magento\CatalogRule\Model\ResourceModel\Rule $catalogRuleResource */ +$catalogRuleResource = $objectManager->create(\Magento\CatalogRule\Model\ResourceModel\Rule::class); + +//Retrieve second rule by name +$select = $catalogRuleResource->getConnection()->select(); +$select->from($catalogRuleResource->getMainTable(), 'rule_id'); +$select->where('name = ?', 'Test Catalog Rule 50% off'); +$ruleId = $catalogRuleResource->getConnection()->fetchOne($select); + +try { + /** @var \Magento\CatalogRule\Api\CatalogRuleRepositoryInterface $ruleRepository */ + $ruleRepository = $objectManager->create(\Magento\CatalogRule\Api\CatalogRuleRepositoryInterface::class); + $ruleRepository->deleteById($ruleId); +} catch (\Exception $ex) { + //Nothing to remove +} + +/** @var \Magento\CatalogRule\Model\Indexer\IndexBuilder $indexBuilder */ +$indexBuilder = $objectManager->get(\Magento\CatalogRule\Model\Indexer\IndexBuilder::class); +$indexBuilder->reindexFull(); diff --git a/dev/tests/integration/testsuite/Magento/CatalogRule/_files/simple_products.php b/dev/tests/integration/testsuite/Magento/CatalogRule/_files/simple_products.php index 84ce4e1bca87c..c40b641e58b1d 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogRule/_files/simple_products.php +++ b/dev/tests/integration/testsuite/Magento/CatalogRule/_files/simple_products.php @@ -26,12 +26,14 @@ ->setPrice(10) ->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH) ->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED) - ->setStockData([ - 'use_config_manage_stock' => 1, - 'qty' => 100, - 'is_qty_decimal' => 0, - 'is_in_stock' => 1, - ]); + ->setStockData( + [ + 'use_config_manage_stock' => 1, + 'qty' => 100, + 'is_qty_decimal' => 0, + 'is_in_stock' => 1, + ] + ); $productRepository->save($product); $productAction = $objectManager->get(\Magento\Catalog\Model\Product\Action::class); $productAction->updateAttributes([$product->getId()], ['test_attribute' => 'test_attribute_value'], $store->getId()); @@ -46,10 +48,52 @@ ->setPrice(9.9) ->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH) ->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED) - ->setStockData([ - 'use_config_manage_stock' => 1, - 'qty' => 100, - 'is_qty_decimal' => 0, - 'is_in_stock' => 1, - ]); + ->setStockData( + [ + 'use_config_manage_stock' => 1, + 'qty' => 100, + 'is_qty_decimal' => 0, + 'is_in_stock' => 1, + ] + ); $productRepository->save($product); +$store = $objectManager->create(\Magento\Store\Model\Store::class); +$store->load('second_store_view', 'code'); +/** + * @var Website $website + */ +$website2 = $objectManager->get(\Magento\Store\Model\Website::class); +$website2->load('second_website', 'code'); +if (!$website2->getId()) { + /** @var \Magento\Store\Model\Website $website */ + $website2->setData( + [ + 'code' => 'second_website', + 'name' => 'Second Website', + + ] + ); + + $website2->save(); +} +$product = $objectManager->create(\Magento\Catalog\Model\Product::class) + ->setTypeId('simple') + ->setId(3) + ->setAttributeSetId($attributeSetId) + ->setWebsiteIds([$website2->getId()]) + ->setName('Simple Product 3') + ->setSku('simple3') + ->setPrice(50) + ->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH) + ->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED) + ->setStockData( + [ + 'use_config_manage_stock' => 1, + 'qty' => 100, + 'is_qty_decimal' => 0, + 'is_in_stock' => 1, + ] + ); +$productRepository->save($product); +$productAction = $objectManager->get(\Magento\Catalog\Model\Product\Action::class); +$productAction->updateAttributes([$product->getId()], ['test_attribute' => 'test_attribute_value'], $store->getId()); diff --git a/dev/tests/integration/testsuite/Magento/CatalogRule/_files/simple_products_rollback.php b/dev/tests/integration/testsuite/Magento/CatalogRule/_files/simple_products_rollback.php index 6625b1926fc10..e641f9f32df40 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogRule/_files/simple_products_rollback.php +++ b/dev/tests/integration/testsuite/Magento/CatalogRule/_files/simple_products_rollback.php @@ -18,7 +18,7 @@ /** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */ $productRepository = $objectManager->get(\Magento\Catalog\Api\ProductRepositoryInterface::class); -foreach (['simple1', 'simple2'] as $sku) { +foreach (['simple1', 'simple2','simple3'] as $sku) { try { $product = $productRepository->get($sku, false, null, true); $productRepository->delete($product); From 97d2358bb6b2f9f85dcd1656aca7510d1455ecd0 Mon Sep 17 00:00:00 2001 From: Tom Reece <treece@adobe.com> Date: Thu, 12 Dec 2019 09:22:57 -0600 Subject: [PATCH 294/586] MQE-1857: [MTF-To-MFTF] Process PR 746 - Remove unnecessary hardcoded ID reference --- .../AdminFilteringCategoryProductsUsingScopeSelectorTest.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminFilteringCategoryProductsUsingScopeSelectorTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminFilteringCategoryProductsUsingScopeSelectorTest.xml index 41b446b474078..501a5bd2282be 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminFilteringCategoryProductsUsingScopeSelectorTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminFilteringCategoryProductsUsingScopeSelectorTest.xml @@ -131,7 +131,6 @@ userInput="$$createProduct1.name$$" stepKey="seeProductName4"/> <see selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct12.name$$)}}" userInput="$$createProduct12.name$$" stepKey="seeProductName5"/> - <waitForText userInput="$$createCategory.name$$ (ID: 6) (2)" stepKey="seeCorrectProductCount"/> <dontSee selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct0.name$$)}}" userInput="$$createProduct0.name$$" stepKey="dontSeeProductName"/> <dontSee selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct2.name$$)}}" @@ -151,7 +150,6 @@ userInput="$$createProduct2.name$$" stepKey="seeProductName6"/> <see selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct12.name$$)}}" userInput="$$createProduct12.name$$" stepKey="seeProductName7"/> - <waitForText userInput="$$createCategory.name$$ (ID: 6) (2)" stepKey="seeCorrectProductCount2"/> <dontSee selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct0.name$$)}}" userInput="$$createProduct0.name$$" stepKey="dontSeeProductName2"/> <dontSee selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct2.name$$)}}" From efa362f0b2d4abf6d2f17f64e5e55f6e45288821 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Thu, 12 Dec 2019 23:06:28 +0700 Subject: [PATCH 295/586] [DownloadableImportExport] Cover Helper Data by Unit Test --- .../Test/Unit/Helper/DataTest.php | 278 ++++++++++++++++++ 1 file changed, 278 insertions(+) create mode 100644 app/code/Magento/DownloadableImportExport/Test/Unit/Helper/DataTest.php diff --git a/app/code/Magento/DownloadableImportExport/Test/Unit/Helper/DataTest.php b/app/code/Magento/DownloadableImportExport/Test/Unit/Helper/DataTest.php new file mode 100644 index 0000000000000..56dc11733cec4 --- /dev/null +++ b/app/code/Magento/DownloadableImportExport/Test/Unit/Helper/DataTest.php @@ -0,0 +1,278 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\DownloadableImportExport\Test\Unit\Helper; + +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use Magento\DownloadableImportExport\Helper\Data as HelperData; +use PHPUnit\Framework\TestCase; + +class DataTest extends TestCase +{ + /** + * @var HelperData + */ + private $helper; + + /** + * Setup environment for test + */ + protected function setUp() + { + $objectManagerHelper = new ObjectManagerHelper($this); + $this->helper = $objectManagerHelper->getObject(HelperData::class); + } + + /** + * Test isRowDownloadableEmptyOptions with dataProvider + * + * @param array $rowData + * @param bool $expected + * @dataProvider isRowDownloadableEmptyOptionsDataProvider + */ + public function testIsRowDownloadableEmptyOptions($rowData, $expected) + { + $this->assertEquals($expected, $this->helper->isRowDownloadableEmptyOptions($rowData)); + } + + /** + * Data Provider to test isRowDownloadableEmptyOptions + * + * @return array + */ + public function isRowDownloadableEmptyOptionsDataProvider() + { + return [ + 'Data set include downloadable link and sample' => [ + [ + 'downloadable_links' => 'https://magento2.com/download_link', + 'downloadable_samples' => 'https://magento2.com/sample_link' + ], + false + ], + 'Data set with empty' => [ + [ + 'downloadable_links' => '', + 'downloadable_samples' => '' + ], + true + ] + ]; + } + + /** + * Test isRowDownloadableNoValid with dataProvider + * + * @param array $rowData + * @param bool $expected + * @dataProvider isRowDownloadableNoValidDataProvider + */ + public function isRowDownloadableNoValid($rowData, $expected) + { + $this->assertEquals($expected, $this->helper->isRowDownloadableNoValid($rowData)); + } + + /** + * Data Provider to test isRowDownloadableEmptyOptions + * + * @return array + */ + public function isRowDownloadableNoValidDataProvider() + { + return [ + 'Data set include downloadable link and sample' => [ + [ + 'downloadable_links' => 'https://magento2.com/download_link', + 'downloadable_samples' => 'https://magento2.com/sample_link' + ], + true + ], + 'Data set with empty' => [ + [ + 'downloadable_links' => '', + 'downloadable_samples' => '' + ], + false + ] + ]; + } + + /** + * Test fillExistOptions with dataProvider + * + * @param array $base + * @param array $option + * @param array $existingOptions + * @param array $expected + * @dataProvider fillExistOptionsDataProvider + */ + public function testFillExistOptions($base, $option, $existingOptions, $expected) + { + $this->assertEquals($expected, $this->helper->fillExistOptions($base, $option, $existingOptions)); + } + + /** + * Data Provider to test fillExistOptions + * + * @return array + */ + public function fillExistOptionsDataProvider() + { + return [ + 'Data set 1' => [ + [], + [ + 'product_id' => 1, + 'sample_type' => 'sample_type1', + 'sample_url' => 'sample_url1', + 'sample_file' => 'sample_file1', + 'link_file' => 'link_file1', + 'link_type' => 'link_type1', + 'link_url' => 'link_url1' + ], + [ + [ + 'product_id' => 1, + 'sample_type' => 'sample_type1', + 'sample_url' => 'sample_url1', + 'sample_file' => 'sample_file1', + 'link_file' => 'link_file1', + 'link_type' => 'link_type1', + 'link_url' => 'link_url1' + ], + [ + 'product_id' => 2, + 'sample_type' => 'sample_type2', + 'sample_url' => 'sample_url2', + 'sample_file' => 'sample_file2', + 'link_file' => 'link_file2', + 'link_type' => 'link_type2', + 'link_url' => 'link_url2' + ] + ], + [ + 'product_id' => 1, + 'sample_type' => 'sample_type1', + 'sample_url' => 'sample_url1', + 'sample_file' => 'sample_file1', + 'link_file' => 'link_file1', + 'link_type' => 'link_type1', + 'link_url' => 'link_url1' + ] + ], + 'Data set 2' => [ + [], + [ + 'product_id' => 1, + 'sample_type' => 'sample_type1', + 'sample_url' => 'sample_url1', + 'sample_file' => 'sample_file1', + 'link_file' => 'link_file1', + 'link_type' => 'link_type1', + 'link_url' => 'link_url1' + ], + [], + [] + ] + ]; + } + + /** + * Test prepareDataForSave with dataProvider + * + * @param array $base + * @param array $replacement + * @param array $expected + * @dataProvider prepareDataForSaveDataProvider + */ + public function testPrepareDataForSave($base, $replacement, $expected) + { + $this->assertEquals($expected, $this->helper->prepareDataForSave($base, $replacement)); + } + + /** + * Data Provider to test prepareDataForSave + * + * @return array + */ + public function prepareDataForSaveDataProvider() + { + return [ + 'Data set 1' => [ + [], + [], + [] + ], + + 'Data set 2' => [ + [ + 'product_id' => 1, + 'sample_type' => 'sample_type1', + 'sample_url' => 'sample_url1', + 'sample_file' => 'sample_file1', + 'link_file' => 'link_file1', + 'link_type' => 'link_type1', + 'link_url' => 'link_url1' + ], + [ + [ + 'product_id' => 2, + 'sample_type' => 'sample_type2', + 'sample_url' => 'sample_url2', + 'sample_file' => 'sample_file2', + 'link_file' => 'link_file2', + 'link_type' => 'link_type2', + 'link_url' => 'link_url2' + ] + ], + [ + [ + 'product_id' => 2, + 'sample_type' => 'sample_type2', + 'sample_url' => 'sample_url2', + 'sample_file' => 'sample_file2', + 'link_file' => 'link_file2', + 'link_type' => 'link_type2', + 'link_url' => 'link_url2' + ] + ] + ] + ]; + } + + /** + * Test getTypeByValue with dataProvider + * + * @param string $option + * @param string $expected + * @dataProvider getTypeByValueDataProvider + */ + public function testGetTypeByValue($option, $expected) + { + $this->assertEquals($expected, $this->helper->getTypeByValue($option)); + } + + /** + * Data Provider for getTypeByValue + * + * @return array + */ + public function getTypeByValueDataProvider() + { + return [ + 'Case File Option Value' => [ + 'file1', + 'file' + ], + 'Case url Option Value' => [ + 'https://example.com', + 'url' + ] + ]; + } +} From 32d40dec5cbb5817e6a04daf999a9e024aacd2cf Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Thu, 12 Dec 2019 23:09:32 +0700 Subject: [PATCH 296/586] [DownloadableImportExport] Cover Helper Data by Unit Test --- .../Test/Unit/Helper/DataTest.php | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/app/code/Magento/DownloadableImportExport/Test/Unit/Helper/DataTest.php b/app/code/Magento/DownloadableImportExport/Test/Unit/Helper/DataTest.php index 56dc11733cec4..ce42514e52263 100644 --- a/app/code/Magento/DownloadableImportExport/Test/Unit/Helper/DataTest.php +++ b/app/code/Magento/DownloadableImportExport/Test/Unit/Helper/DataTest.php @@ -10,6 +10,7 @@ use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; use Magento\DownloadableImportExport\Helper\Data as HelperData; +use Magento\DownloadableImportExport\Model\Import\Product\Type\Downloadable; use PHPUnit\Framework\TestCase; class DataTest extends TestCase @@ -50,15 +51,15 @@ public function isRowDownloadableEmptyOptionsDataProvider() return [ 'Data set include downloadable link and sample' => [ [ - 'downloadable_links' => 'https://magento2.com/download_link', - 'downloadable_samples' => 'https://magento2.com/sample_link' + Downloadable::COL_DOWNLOADABLE_LINKS => 'https://magento2.com/download_link', + Downloadable::COL_DOWNLOADABLE_SAMPLES => 'https://magento2.com/sample_link' ], false ], 'Data set with empty' => [ [ - 'downloadable_links' => '', - 'downloadable_samples' => '' + Downloadable::COL_DOWNLOADABLE_LINKS => '', + Downloadable::COL_DOWNLOADABLE_SAMPLES => '' ], true ] @@ -87,15 +88,15 @@ public function isRowDownloadableNoValidDataProvider() return [ 'Data set include downloadable link and sample' => [ [ - 'downloadable_links' => 'https://magento2.com/download_link', - 'downloadable_samples' => 'https://magento2.com/sample_link' + Downloadable::COL_DOWNLOADABLE_LINKS => 'https://magento2.com/download_link', + Downloadable::COL_DOWNLOADABLE_SAMPLES => 'https://magento2.com/sample_link' ], true ], 'Data set with empty' => [ [ - 'downloadable_links' => '', - 'downloadable_samples' => '' + Downloadable::COL_DOWNLOADABLE_LINKS => '', + Downloadable::COL_DOWNLOADABLE_SAMPLES => '' ], false ] @@ -267,11 +268,11 @@ public function getTypeByValueDataProvider() return [ 'Case File Option Value' => [ 'file1', - 'file' + Downloadable::FILE_OPTION_VALUE ], 'Case url Option Value' => [ 'https://example.com', - 'url' + Downloadable::URL_OPTION_VALUE ] ]; } From bdf2c46b07930f1bb04649aafdd0d2c962ba9e7e Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Thu, 12 Dec 2019 10:32:35 -0600 Subject: [PATCH 297/586] Change action groups name according to CE branch changes --- ...uctAttributeAdvancedSectionActionGroup.xml | 20 ++++++++++++++ ...tAttributeWithDatetimeFieldActionGroup.xml | 26 +++++++++++++++++++ ...uctAttributeByAttributeCodeActionGroup.xml | 1 + ...teToCreatedProductAttributeActionGroup.xml | 1 + ...dminCreateDatetimeProductAttributeTest.xml | 8 +++--- ...SimpleProductWithDatetimeAttributeTest.xml | 2 +- 6 files changed, 53 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminNavigateToProductAttributeAdvancedSectionActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminNavigateToProductAttributeAdvancedSectionActionGroup.xml index e69de29bb2d1d..27aa0474c362d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminNavigateToProductAttributeAdvancedSectionActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminNavigateToProductAttributeAdvancedSectionActionGroup.xml @@ -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="AdminNavigateToProductAttributeAdvancedSectionActionGroup"> + <annotations> + <description>Navigate and open Advanced Attribute Properties section on product attribute page</description> + </annotations> + + <scrollTo selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}" stepKey="scrollToSection"/> + <conditionalClick selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}" dependentSelector="{{AdvancedAttributePropertiesSection.AttributeCode}}" visible="false" stepKey="openSection"/> + <waitForElementVisible selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" stepKey="waitForSlideOutSection"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeWithDatetimeFieldActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeWithDatetimeFieldActionGroup.xml index e69de29bb2d1d..545f36966feaa 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeWithDatetimeFieldActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeWithDatetimeFieldActionGroup.xml @@ -0,0 +1,26 @@ +<?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="CreateProductAttributeWithDatetimeFieldActionGroup" extends="createProductAttribute" insertAfter="checkRequired"> + <annotations> + <description>EXTENDS: createProductAttribute. Fills in the Attribute Code and Default Value (Attribute Type: Date and Time Field).</description> + </annotations> + <arguments> + <argument name="date" type="string"/> + </arguments> + + <scrollTo selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}" stepKey="scrollToAdvancedSection"/> + <conditionalClick selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}" dependentSelector="{{AdvancedAttributePropertiesSection.AttributeCode}}" visible="false" stepKey="openAdvancedSection"/> + <waitForElementVisible selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" stepKey="waitForSlideOutAdvancedSection"/> + <fillField selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" userInput="{{attribute.attribute_code}}" stepKey="fillCode"/> + <scrollTo selector="{{AdvancedAttributePropertiesSection.defaultValueDatetime}}" stepKey="scrollToDefaultField"/> + <fillField selector="{{AdvancedAttributePropertiesSection.defaultValueDatetime}}" userInput="{{date}}" stepKey="fillDefaultValue"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByAttributeCodeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByAttributeCodeActionGroup.xml index c40a0f6d31dc0..7fbf6a9b2a178 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByAttributeCodeActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByAttributeCodeActionGroup.xml @@ -25,5 +25,6 @@ <click selector="{{AttributePropertiesSection.DeleteAttribute}}" stepKey="deleteAttribute"/> <click selector="{{ModalConfirmationSection.OkButton}}" stepKey="ClickOnDeleteButton"/> <waitForPageLoad stepKey="waitForPageLoad"/> + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToCreatedProductAttributeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToCreatedProductAttributeActionGroup.xml index 850939501eb81..57ce7de7f3c0b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToCreatedProductAttributeActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToCreatedProductAttributeActionGroup.xml @@ -17,6 +17,7 @@ </arguments> <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingFilters"/> <fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="{{ProductAttribute.attribute_code}}" stepKey="setAttributeCode"/> <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/> <click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="clickOnAttributeRow"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml index e46114ff752f6..5da824d2ccdb9 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml @@ -20,7 +20,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="login"/> </before> <after> - <actionGroup ref="deleteProductAttribute" stepKey="deleteAttribute"> + <actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteAttribute"> <argument name="ProductAttribute" value="DatetimeProductAttribute"/> </actionGroup> <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="resetGridFilter"/> @@ -31,16 +31,16 @@ <!-- Create new datetime product attribute --> <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="goToProductAttributes"/> <waitForPageLoad stepKey="waitForPageLoadAttributes"/> - <actionGroup ref="CreateProductAttributeWithDatetimeField" stepKey="createAttribute"> + <actionGroup ref="CreateProductAttributeWithDatetimeFieldActionGroup" stepKey="createAttribute"> <argument name="attribute" value="DatetimeProductAttribute"/> <argument name="date" value="{$generateDefaultValue}"/> </actionGroup> <!-- Navigate to created product attribute --> - <actionGroup ref="navigateToCreatedProductAttribute" stepKey="navigateToAttribute"> + <actionGroup ref="NavigateToCreatedProductAttributeActionGroup" stepKey="navigateToAttribute"> <argument name="ProductAttribute" value="DatetimeProductAttribute"/> </actionGroup> <!-- Check the saved datetime default value --> - <actionGroup ref="AdminNavigateToProductAttributeAdvancedSection" stepKey="goToAdvancedSection"/> + <actionGroup ref="AdminNavigateToProductAttributeAdvancedSectionActionGroup" stepKey="goToAdvancedSection"/> <scrollTo selector="{{AdvancedAttributePropertiesSection.defaultValueDatetime}}" stepKey="scrollToDefaultValue"/> <seeInField userInput="{$generateDefaultValue}" selector="{{AdvancedAttributePropertiesSection.defaultValueDatetime}}" diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml index 6772e95b6ec27..41ad840930bc2 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml @@ -42,7 +42,7 @@ <actionGroup ref="AdminOpenNewProductFormPageActionGroup" stepKey="openNewProductPage"/> <actionGroup ref="fillMainProductForm" stepKey="fillDefaultProductFields"/> <!-- Add datetime attribute --> - <actionGroup ref="addProductAttributeInProductModal" stepKey="addDatetimeAttribute"> + <actionGroup ref="AddProductAttributeInProductModalActionGroup" stepKey="addDatetimeAttribute"> <argument name="attributeCode" value="$createDatetimeAttribute.attribute_code$"/> </actionGroup> <!-- Flush config cache to reset product attributes in attribute set --> From 840afc3584858dd14dfc81f3e50d3d194185698f Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Thu, 12 Dec 2019 10:50:22 -0600 Subject: [PATCH 298/586] Change action groups name according to CE branch changes --- .../CreateProductAttributeWithDatetimeFieldActionGroup.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeWithDatetimeFieldActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeWithDatetimeFieldActionGroup.xml index 545f36966feaa..a4f0d22f6edb5 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeWithDatetimeFieldActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeWithDatetimeFieldActionGroup.xml @@ -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="CreateProductAttributeWithDatetimeFieldActionGroup" extends="createProductAttribute" insertAfter="checkRequired"> + <actionGroup name="CreateProductAttributeWithDatetimeFieldActionGroup" extends="CreateProductAttributeActionGroup" insertAfter="checkRequired"> <annotations> <description>EXTENDS: createProductAttribute. Fills in the Attribute Code and Default Value (Attribute Type: Date and Time Field).</description> </annotations> From 28a41d9adb780ec751eed888563df58e0483e267 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Thu, 12 Dec 2019 11:44:57 -0600 Subject: [PATCH 299/586] Change action groups name according to CE branch changes --- .../AdminCreateSimpleProductWithDatetimeAttributeTest.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml index 41ad840930bc2..0f88fa9d6abf4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml @@ -23,10 +23,10 @@ </before> <after> <deleteData createDataKey="createDatetimeAttribute" stepKey="deleteDatetimeAttribute"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteCreatedProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteCreatedProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFiltersOnProductIndexPage"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFiltersOnProductIndexPage"/> <actionGroup ref="logout" stepKey="logout"/> </after> @@ -40,7 +40,7 @@ </createData> <!-- Open the new simple product page --> <actionGroup ref="AdminOpenNewProductFormPageActionGroup" stepKey="openNewProductPage"/> - <actionGroup ref="fillMainProductForm" stepKey="fillDefaultProductFields"/> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillDefaultProductFields"/> <!-- Add datetime attribute --> <actionGroup ref="AddProductAttributeInProductModalActionGroup" stepKey="addDatetimeAttribute"> <argument name="attributeCode" value="$createDatetimeAttribute.attribute_code$"/> @@ -48,7 +48,7 @@ <!-- Flush config cache to reset product attributes in attribute set --> <magentoCLI command="cache:flush" arguments="config" stepKey="flushConfigCache"/> <!-- Save the product --> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Check default value --> <scrollTo selector="{{AdminProductAttributesSection.sectionHeader}}" stepKey="goToAttributesSection"/> <click selector="{{AdminProductAttributesSection.sectionHeader}}" stepKey="openAttributesSection"/> From 46b676bb4ea3f19aed99566085e10db185ebb9c0 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Thu, 12 Dec 2019 13:26:52 -0600 Subject: [PATCH 300/586] Change action groups name according to CE branch changes --- .../Test/StorefrontFreeShippingDisplayWithInclTaxOptionTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/OfflineShipping/Test/Mftf/Test/StorefrontFreeShippingDisplayWithInclTaxOptionTest.xml b/app/code/Magento/OfflineShipping/Test/Mftf/Test/StorefrontFreeShippingDisplayWithInclTaxOptionTest.xml index db44a06b54a88..d2e092283e9bd 100644 --- a/app/code/Magento/OfflineShipping/Test/Mftf/Test/StorefrontFreeShippingDisplayWithInclTaxOptionTest.xml +++ b/app/code/Magento/OfflineShipping/Test/Mftf/Test/StorefrontFreeShippingDisplayWithInclTaxOptionTest.xml @@ -41,7 +41,7 @@ <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> </after> <!-- Add simple product to cart --> - <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> <!-- Assert that taxes are applied correctly for CA --> From b7640b056a7b9baa16984643f13ea0d001fd7b68 Mon Sep 17 00:00:00 2001 From: Dan Wallis <mrdanwallis@gmail.com> Date: Thu, 12 Dec 2019 23:01:33 +0000 Subject: [PATCH 301/586] Position arrow by item, not centrally in menu --- .../Magento/backend/web/css/source/_actions.less | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/design/adminhtml/Magento/backend/web/css/source/_actions.less b/app/design/adminhtml/Magento/backend/web/css/source/_actions.less index c86e9cdbf0866..852c6c1f3799e 100644 --- a/app/design/adminhtml/Magento/backend/web/css/source/_actions.less +++ b/app/design/adminhtml/Magento/backend/web/css/source/_actions.less @@ -451,11 +451,9 @@ button { border-width: .4rem 0 .4rem .5rem; content: ''; height: 0; - margin-top: -.2rem; - position: absolute; - right: 1rem; - top: 50%; - transition: all .2s linear; + position: relative; + right: 1.2rem; + top: 1.4rem; width: 0; } } From 68770d182cfa085dc3fc2361d4bcd4fd06a30dc3 Mon Sep 17 00:00:00 2001 From: "rostyslav.hymon" <rostyslav.hymon@transoftgroup.com> Date: Fri, 13 Dec 2019 09:07:58 +0200 Subject: [PATCH 302/586] MC-25187: Session lost after switching stores on different domains --- .../view/frontend/web/js/customer-data.js | 5 + .../Store/Controller/Store/Redirect.php | 33 +++- .../Store/Controller/Store/SwitchAction.php | 22 ++- .../Store/SwitchAction/CookieManager.php | 65 +++++++ .../Model/StoreSwitcher/HashGenerator.php | 69 +++---- .../Model/StoreSwitcher/HashProcessor.php | 127 ++++++++++++ app/code/Magento/Store/etc/di.xml | 2 +- .../Magento/Store/Model/HashGeneratorTest.php | 180 ------------------ .../Model/StoreSwitcher/RewriteUrlTest.php | 10 +- 9 files changed, 272 insertions(+), 241 deletions(-) create mode 100644 app/code/Magento/Store/Controller/Store/SwitchAction/CookieManager.php create mode 100644 app/code/Magento/Store/Model/StoreSwitcher/HashProcessor.php delete mode 100644 dev/tests/integration/testsuite/Magento/Store/Model/HashGeneratorTest.php diff --git a/app/code/Magento/Customer/view/frontend/web/js/customer-data.js b/app/code/Magento/Customer/view/frontend/web/js/customer-data.js index de3ff10bb057b..770ea47d754d3 100644 --- a/app/code/Magento/Customer/view/frontend/web/js/customer-data.js +++ b/app/code/Magento/Customer/view/frontend/web/js/customer-data.js @@ -214,6 +214,11 @@ define([ this.reload(storageInvalidation.keys(), false); } } + + if (!_.isEmpty($.cookieStorage.get('section_data_clean'))) { + this.reload(sectionConfig.getSectionNames(), true); + $.cookieStorage.set('section_data_clean', ''); + } }, /** diff --git a/app/code/Magento/Store/Controller/Store/Redirect.php b/app/code/Magento/Store/Controller/Store/Redirect.php index 21692e9d6dd1e..a5d0e481ba8fe 100644 --- a/app/code/Magento/Store/Controller/Store/Redirect.php +++ b/app/code/Magento/Store/Controller/Store/Redirect.php @@ -7,19 +7,25 @@ namespace Magento\Store\Controller\Store; +use Magento\Framework\App\Action\Action; use Magento\Framework\App\Action\Context; +use Magento\Framework\App\Action\HttpGetActionInterface; +use Magento\Framework\App\Action\HttpPostActionInterface; use Magento\Framework\App\ResponseInterface; +use Magento\Framework\Controller\ResultInterface; use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Session\Generic as Session; +use Magento\Framework\Session\SidResolverInterface; use Magento\Store\Api\StoreRepositoryInterface; use Magento\Store\Api\StoreResolverInterface; +use Magento\Store\Model\Store; use Magento\Store\Model\StoreResolver; -use Magento\Framework\Session\SidResolverInterface; -use Magento\Framework\Session\Generic as Session; +use Magento\Store\Model\StoreSwitcher\HashGenerator; /** * Builds correct url to target store and performs redirect. */ -class Redirect extends \Magento\Framework\App\Action\Action +class Redirect extends Action implements HttpGetActionInterface, HttpPostActionInterface { /** * @var StoreRepositoryInterface @@ -41,34 +47,44 @@ class Redirect extends \Magento\Framework\App\Action\Action */ private $session; + /** + * @var HashGenerator + */ + private $hashGenerator; + /** * @param Context $context * @param StoreRepositoryInterface $storeRepository * @param StoreResolverInterface $storeResolver * @param Session $session * @param SidResolverInterface $sidResolver + * @param HashGenerator $hashGenerator */ public function __construct( Context $context, StoreRepositoryInterface $storeRepository, StoreResolverInterface $storeResolver, Session $session, - SidResolverInterface $sidResolver + SidResolverInterface $sidResolver, + HashGenerator $hashGenerator ) { parent::__construct($context); $this->storeRepository = $storeRepository; $this->storeResolver = $storeResolver; $this->session = $session; $this->sidResolver = $sidResolver; + $this->hashGenerator = $hashGenerator; } /** - * @return ResponseInterface|\Magento\Framework\Controller\ResultInterface + * Performs store redirect + * + * @return ResponseInterface|ResultInterface * @throws NoSuchEntityException */ public function execute() { - /** @var \Magento\Store\Model\Store $currentStore */ + /** @var Store $currentStore */ $currentStore = $this->storeRepository->getById($this->storeResolver->getCurrentStoreId()); $targetStoreCode = $this->_request->getParam(StoreResolver::PARAM_NAME); $fromStoreCode = $this->_request->getParam('___from_store'); @@ -79,7 +95,7 @@ public function execute() } try { - /** @var \Magento\Store\Model\Store $targetStore */ + /** @var Store $fromStore */ $fromStore = $this->storeRepository->get($fromStoreCode); } catch (NoSuchEntityException $e) { $error = __('Requested store is not found'); @@ -103,6 +119,9 @@ public function execute() $query[$sidName] = $this->session->getSessionId(); } + $customerHash = $this->hashGenerator->generateHash($fromStore); + $query = array_merge($query, $customerHash); + $arguments = [ '_nosid' => true, '_query' => $query diff --git a/app/code/Magento/Store/Controller/Store/SwitchAction.php b/app/code/Magento/Store/Controller/Store/SwitchAction.php index d8ac1b308d7ed..41acb1605ec7c 100644 --- a/app/code/Magento/Store/Controller/Store/SwitchAction.php +++ b/app/code/Magento/Store/Controller/Store/SwitchAction.php @@ -11,7 +11,6 @@ use Magento\Framework\App\Action\Action; use Magento\Framework\App\Action\Context as ActionContext; use Magento\Framework\App\Http\Context as HttpContext; -use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\NoSuchEntityException; use Magento\Store\Api\StoreCookieManagerInterface; use Magento\Store\Api\StoreRepositoryInterface; @@ -21,6 +20,7 @@ use Magento\Store\Model\StoreSwitcherInterface; use Magento\Framework\App\Action\HttpPostActionInterface; use Magento\Framework\App\Action\HttpGetActionInterface; +use Magento\Store\Controller\Store\SwitchAction\CookieManager; /** * Handles store switching url and makes redirect. @@ -56,6 +56,11 @@ class SwitchAction extends Action implements HttpGetActionInterface, HttpPostAct */ private $storeSwitcher; + /** + * @var CookieManager + */ + private $cookieManager; + /** * Initialize dependencies. * @@ -65,6 +70,7 @@ class SwitchAction extends Action implements HttpGetActionInterface, HttpPostAct * @param StoreRepositoryInterface $storeRepository * @param StoreManagerInterface $storeManager * @param StoreSwitcherInterface $storeSwitcher + * @param CookieManager $cookieManager */ public function __construct( ActionContext $context, @@ -72,7 +78,8 @@ public function __construct( HttpContext $httpContext, StoreRepositoryInterface $storeRepository, StoreManagerInterface $storeManager, - StoreSwitcherInterface $storeSwitcher = null + StoreSwitcherInterface $storeSwitcher, + CookieManager $cookieManager ) { parent::__construct($context); $this->storeCookieManager = $storeCookieManager; @@ -80,7 +87,8 @@ public function __construct( $this->storeRepository = $storeRepository; $this->storeManager = $storeManager; $this->messageManager = $context->getMessageManager(); - $this->storeSwitcher = $storeSwitcher ?: ObjectManager::getInstance()->get(StoreSwitcherInterface::class); + $this->storeSwitcher = $storeSwitcher; + $this->cookieManager = $cookieManager; } /** @@ -88,12 +96,13 @@ public function __construct( * * @return void * @throws StoreSwitcher\CannotSwitchStoreException + * @throws \Magento\Framework\Exception\InputException + * @throws \Magento\Framework\Stdlib\Cookie\CookieSizeLimitReachedException + * @throws \Magento\Framework\Stdlib\Cookie\FailureToSendException */ public function execute() { - $targetStoreCode = $this->_request->getParam( - \Magento\Store\Model\StoreManagerInterface::PARAM_NAME - ); + $targetStoreCode = $this->_request->getParam(StoreManagerInterface::PARAM_NAME); $fromStoreCode = $this->_request->getParam( '___from_store', $this->storeCookieManager->getStoreCodeFromCookie() @@ -115,6 +124,7 @@ public function execute() $this->messageManager->addErrorMessage($error); } else { $redirectUrl = $this->storeSwitcher->switch($fromStore, $targetStore, $requestedUrlToRedirect); + $this->cookieManager->setCookieForStore($targetStore); } $this->getResponse()->setRedirect($redirectUrl); diff --git a/app/code/Magento/Store/Controller/Store/SwitchAction/CookieManager.php b/app/code/Magento/Store/Controller/Store/SwitchAction/CookieManager.php new file mode 100644 index 0000000000000..182ae35b0ff61 --- /dev/null +++ b/app/code/Magento/Store/Controller/Store/SwitchAction/CookieManager.php @@ -0,0 +1,65 @@ +<?php +/** + * + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Store\Controller\Store\SwitchAction; + +use Magento\Framework\Stdlib\Cookie\CookieMetadataFactory; +use Magento\Framework\Stdlib\CookieManagerInterface; +use Magento\Store\Api\Data\StoreInterface; + +/** + * Handles store switching cookie for the frontend storage clean + * + * @SuppressWarnings(PHPMD.CookieAndSessionMisuse) + */ +class CookieManager +{ + /** + * @var string + */ + const COOKIE_NAME = 'section_data_clean'; + + /** + * @var CookieMetadataFactory + */ + private $cookieMetadataFactory; + + /** + * @var CookieManagerInterface + */ + private $cookieManager; + + /** + * @param CookieMetadataFactory $cookieMetadataFactory + * @param CookieManagerInterface $cookieManager + */ + public function __construct( + CookieMetadataFactory $cookieMetadataFactory, + CookieManagerInterface $cookieManager + ) { + $this->cookieMetadataFactory = $cookieMetadataFactory; + $this->cookieManager = $cookieManager; + } + + /** + * Set cookie for store + * + * @param StoreInterface $targetStore + * @throws \Magento\Framework\Exception\InputException + * @throws \Magento\Framework\Stdlib\Cookie\CookieSizeLimitReachedException + * @throws \Magento\Framework\Stdlib\Cookie\FailureToSendException + */ + public function setCookieForStore(StoreInterface $targetStore) + { + $cookieMetadata = $this->cookieMetadataFactory->createPublicCookieMetadata() + ->setHttpOnly(false) + ->setDuration(15) + ->setPath($targetStore->getStorePath()); + $this->cookieManager->setPublicCookie(self::COOKIE_NAME, $targetStore->getCode(), $cookieMetadata); + } +} diff --git a/app/code/Magento/Store/Model/StoreSwitcher/HashGenerator.php b/app/code/Magento/Store/Model/StoreSwitcher/HashGenerator.php index 456941bd41c25..d1858939434b7 100644 --- a/app/code/Magento/Store/Model/StoreSwitcher/HashGenerator.php +++ b/app/code/Magento/Store/Model/StoreSwitcher/HashGenerator.php @@ -7,19 +7,18 @@ namespace Magento\Store\Model\StoreSwitcher; +use Magento\Authorization\Model\UserContextInterface; +use Magento\Framework\App\ActionInterface; +use Magento\Framework\App\DeploymentConfig as DeploymentConfig; +use Magento\Framework\Config\ConfigOptionsListConstants; +use Magento\Framework\Url\Helper\Data as UrlHelper; use Magento\Store\Api\Data\StoreInterface; use Magento\Store\Model\StoreSwitcher\HashGenerator\HashData; -use Magento\Store\Model\StoreSwitcherInterface; -use \Magento\Framework\App\DeploymentConfig as DeploymentConfig; -use Magento\Framework\Url\Helper\Data as UrlHelper; -use Magento\Framework\Config\ConfigOptionsListConstants; -use Magento\Authorization\Model\UserContextInterface; -use \Magento\Framework\App\ActionInterface; /** * Generate one time token and build redirect url */ -class HashGenerator implements StoreSwitcherInterface +class HashGenerator { /** * @var \Magento\Framework\App\DeploymentConfig @@ -52,48 +51,40 @@ public function __construct( } /** - * Builds redirect url with token + * Generate hash data for customer * - * @param StoreInterface $fromStore store where we came from - * @param StoreInterface $targetStore store where to go to - * @param string $redirectUrl original url requested for redirect after switching - * @return string redirect url - * @SuppressWarnings(PHPMD.UnusedFormalParameter) + * @param StoreInterface $fromStore + * @return array */ - public function switch(StoreInterface $fromStore, StoreInterface $targetStore, string $redirectUrl): string + public function generateHash(StoreInterface $fromStore): array { - $targetUrl = $redirectUrl; + $key = (string)$this->deploymentConfig->get(ConfigOptionsListConstants::CONFIG_PATH_CRYPT_KEY); + $timeStamp = time(); + $customerId = null; - $encodedUrl = $this->urlHelper->getEncodedUrl($redirectUrl); + $result = []; if ($this->currentUser->getUserType() == UserContextInterface::USER_TYPE_CUSTOMER) { $customerId = $this->currentUser->getUserId(); - } - if ($customerId) { - // phpcs:ignore - $urlParts = parse_url($targetUrl); - $host = $urlParts['host']; - $scheme = $urlParts['scheme']; - $key = (string)$this->deploymentConfig->get(ConfigOptionsListConstants::CONFIG_PATH_CRYPT_KEY); - $timeStamp = time(); - $fromStoreCode = $fromStore->getCode(); - $data = implode(',', [$customerId, $timeStamp, $fromStoreCode]); - $signature = hash_hmac('sha256', $data, $key); - $targetUrl = $scheme . "://" . $host . '/stores/store/switchrequest'; - $targetUrl = $this->urlHelper->addRequestParam( - $targetUrl, - ['customer_id' => $customerId] - ); - $targetUrl = $this->urlHelper->addRequestParam($targetUrl, ['time_stamp' => $timeStamp]); - $targetUrl = $this->urlHelper->addRequestParam($targetUrl, ['signature' => $signature]); - $targetUrl = $this->urlHelper->addRequestParam($targetUrl, ['___from_store' => $fromStoreCode]); - $targetUrl = $this->urlHelper->addRequestParam( - $targetUrl, - [ActionInterface::PARAM_NAME_URL_ENCODED => $encodedUrl] + $data = implode( + ',', + [ + $customerId, + $timeStamp, + $fromStore->getCode() + ] ); + $signature = hash_hmac('sha256', $data, $key); + + $result = [ + 'customer_id' => $customerId, + 'time_stamp' => $timeStamp, + 'signature' => $signature + ]; } - return $targetUrl; + + return $result; } /** diff --git a/app/code/Magento/Store/Model/StoreSwitcher/HashProcessor.php b/app/code/Magento/Store/Model/StoreSwitcher/HashProcessor.php new file mode 100644 index 0000000000000..909fe9f6683f8 --- /dev/null +++ b/app/code/Magento/Store/Model/StoreSwitcher/HashProcessor.php @@ -0,0 +1,127 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Store\Model\StoreSwitcher; + +use Magento\Authorization\Model\UserContextInterface; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Model\ResourceModel\CustomerRepository; +use Magento\Customer\Model\Session as CustomerSession; +use Magento\Framework\App\DeploymentConfig as DeploymentConfig; +use Magento\Framework\App\RequestInterface; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Message\ManagerInterface; +use Magento\Framework\Url\Helper\Data as UrlHelper; +use Magento\Store\Api\Data\StoreInterface; +use Magento\Store\Model\StoreSwitcher\HashGenerator\HashData; +use Magento\Store\Model\StoreSwitcherInterface; + +/** + * Process one time token and build redirect url + * + * @SuppressWarnings(PHPMD.CookieAndSessionMisuse) + */ +class HashProcessor implements StoreSwitcherInterface +{ + /** + * @var HashGenerator + */ + private $hashGenerator; + + /** + * @var RequestInterface + */ + private $request; + + /** + * @var ManagerInterface + */ + private $messageManager; + + /** + * @var customerSession + */ + private $customerSession; + + /** + * @var CustomerRepositoryInterface + */ + private $customerRepository; + + /** + * @param HashGenerator $hashGenerator + * @param RequestInterface $request + * @param ManagerInterface $messageManager + * @param CustomerRepository $customerRepository + * @param CustomerSession $customerSession + */ + public function __construct( + HashGenerator $hashGenerator, + RequestInterface $request, + ManagerInterface $messageManager, + CustomerRepository $customerRepository, + CustomerSession $customerSession + ) { + $this->hashGenerator = $hashGenerator; + $this->request = $request; + $this->messageManager = $messageManager; + $this->customerSession = $customerSession; + $this->customerRepository = $customerRepository; + } + + /** + * Builds redirect url with token + * + * @param StoreInterface $fromStore store where we came from + * @param StoreInterface $targetStore store where to go to + * @param string $redirectUrl original url requested for redirect after switching + * @return string redirect url + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function switch(StoreInterface $fromStore, StoreInterface $targetStore, string $redirectUrl): string + { + $customerId = $this->request->getParam('customer_id'); + + if ($customerId) { + $fromStoreCode = (string)$this->request->getParam('___from_store'); + $timeStamp = (string)$this->request->getParam('time_stamp'); + $signature = (string)$this->request->getParam('signature'); + + $error = null; + + $data = new HashData( + [ + "customer_id" => $customerId, + "time_stamp" => $timeStamp, + "___from_store" => $fromStoreCode + ] + ); + + if ($redirectUrl && $this->hashGenerator->validateHash($signature, $data)) { + try { + $customer = $this->customerRepository->getById($customerId); + if (!$this->customerSession->isLoggedIn()) { + $this->customerSession->setCustomerDataAsLoggedIn($customer); + } + } catch (NoSuchEntityException $e) { + $error = __('The requested customer does not exist.'); + } catch (LocalizedException $e) { + $error = __('There was an error retrieving the customer record.'); + } + } else { + $error = __('The requested store cannot be found. Please check the request and try again.'); + } + + if ($error !== null) { + $this->messageManager->addErrorMessage($error); + } + } + + return $redirectUrl; + } +} diff --git a/app/code/Magento/Store/etc/di.xml b/app/code/Magento/Store/etc/di.xml index 3fa9c8314fdd1..8f4151b8fc966 100644 --- a/app/code/Magento/Store/etc/di.xml +++ b/app/code/Magento/Store/etc/di.xml @@ -436,7 +436,7 @@ <item name="cleanTargetUrl" xsi:type="object">Magento\Store\Model\StoreSwitcher\CleanTargetUrl</item> <item name="manageStoreCookie" xsi:type="object">Magento\Store\Model\StoreSwitcher\ManageStoreCookie</item> <item name="managePrivateContent" xsi:type="object">Magento\Store\Model\StoreSwitcher\ManagePrivateContent</item> - <item name="hashGenerator" xsi:type="object" sortOrder="1000">Magento\Store\Model\StoreSwitcher\HashGenerator</item> + <item name="hashProcessor" xsi:type="object" sortOrder="1000">Magento\Store\Model\StoreSwitcher\HashProcessor</item> </argument> </arguments> </type> diff --git a/dev/tests/integration/testsuite/Magento/Store/Model/HashGeneratorTest.php b/dev/tests/integration/testsuite/Magento/Store/Model/HashGeneratorTest.php deleted file mode 100644 index 1bacd79b74f49..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Store/Model/HashGeneratorTest.php +++ /dev/null @@ -1,180 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -namespace Magento\Store\Model; - -use Magento\Framework\ObjectManagerInterface as ObjectManager; -use Magento\TestFramework\Helper\Bootstrap; -use Magento\Store\Model\StoreSwitcher\HashGenerator; -use Magento\Customer\Api\AccountManagementInterface; -use Magento\Customer\Model\Session as CustomerSession; -use \Magento\Framework\App\DeploymentConfig as DeploymentConfig; -use Magento\Framework\Config\ConfigOptionsListConstants; -use Magento\Framework\Url\Helper\Data as UrlHelper; -use Magento\Store\Model\StoreSwitcher\HashGenerator\HashData; - -/** - * Test class for \Magento\Store\Model\StoreSwitcher\HashGenerator - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) - */ -class HashGeneratorTest extends \PHPUnit\Framework\TestCase -{ - /** - * @var HashGenerator - */ - private $hashGenerator; - - /** - * @var ObjectManager - */ - private $objectManager; - - /** - * @var int - */ - private $customerId; - - /** @var AccountManagementInterface */ - private $accountManagement; - - /** - * @var \Magento\Customer\Model\Authorization\CustomerSessionUserContext - */ - private $customerSessionUserContext; - - /** - * @var \Magento\Framework\App\DeploymentConfig - */ - private $deploymentConfig; - - /** - * @var string - */ - private $key; - - /** - * @var UrlHelper - */ - private $urlHelper; - - /** - * @var HashData - */ - private $hashData; - - /** - * @var CustomerSession - */ - private $customerSession; - - /** - * Class dependencies initialization - * @return void - * @throws \Magento\Framework\Exception\LocalizedException - */ - protected function setUp() - { - $this->objectManager = Bootstrap::getObjectManager(); - $this->customerSession = $this->objectManager->create( - CustomerSession::class - ); - $this->accountManagement = $this->objectManager->create(AccountManagementInterface::class); - $customer = $this->accountManagement->authenticate('customer@example.com', 'password'); - $this->customerSession->setCustomerDataAsLoggedIn($customer); - $this->customerSessionUserContext = $this->objectManager->create( - \Magento\Customer\Model\Authorization\CustomerSessionUserContext::class, - ['customerSession' => $this->customerSession] - ); - $this->hashGenerator = $this->objectManager->create( - StoreSwitcher\HashGenerator::class, - ['currentUser' => $this->customerSessionUserContext] - ); - $this->customerId = $customer->getId(); - $this->deploymentConfig = $this->objectManager->get(DeploymentConfig::class); - $this->key = (string)$this->deploymentConfig->get(ConfigOptionsListConstants::CONFIG_PATH_CRYPT_KEY); - $this->urlHelper=$this->objectManager->create(UrlHelper::class); - $this->hashData=$this->objectManager->create(HashData::class); - } - - /** - * @inheritdoc - */ - protected function tearDown() - { - $this->customerSession->logout(); - parent::tearDown(); - } - - /** - * @magentoAppIsolation enabled - * @magentoDataFixture Magento/Customer/_files/customer.php - * @return void - */ - public function testSwitch(): void - { - $redirectUrl = "http://domain.com/"; - $fromStoreCode = 'test'; - $fromStore = $this->createPartialMock(Store::class, ['getCode']); - $toStore = $this->createPartialMock(Store::class, ['getCode']); - $fromStore->expects($this->once())->method('getCode')->willReturn($fromStoreCode); - $targetUrl=$this->hashGenerator->switch($fromStore, $toStore, $redirectUrl); - // phpcs:ignore - $urlParts=parse_url($targetUrl, PHP_URL_QUERY); - $signature=''; - // phpcs:ignore - parse_str($urlParts, $params); - - if (isset($params['signature'])) { - $signature=$params['signature']; - } - $this->assertEquals($params['customer_id'], $this->customerId); - $this->assertEquals($params['___from_store'], $fromStoreCode); - - $data = new HashData( - [ - "customer_id" => $this->customerId, - "time_stamp" => $params['time_stamp'], - "___from_store" => $fromStoreCode - ] - ); - $this->assertTrue($this->hashGenerator->validateHash($signature, $data)); - } - - /** - * @magentoAppIsolation enabled - * @magentoDataFixture Magento/Customer/_files/customer.php - * @return void - */ - public function testValidateHashWithInCorrectData(): void - { - $timeStamp = 0; - $customerId = 8; - $fromStoreCode = 'store1'; - $data = new HashData( - [ - "customer_id" => $customerId, - "time_stamp" => $timeStamp, - "___from_store" => $fromStoreCode - ] - ); - $redirectUrl = "http://domain.com/"; - $fromStore = $this->createPartialMock(Store::class, ['getCode']); - $toStore = $this->createPartialMock(Store::class, ['getCode']); - $fromStore->expects($this->once())->method('getCode')->willReturn($fromStoreCode); - $targetUrl = $this->hashGenerator->switch($fromStore, $toStore, $redirectUrl); - // phpcs:ignore - $urlParts = parse_url($targetUrl,PHP_URL_QUERY); - $signature = ''; - // phpcs:ignore - parse_str($urlParts, $params); - - if (isset($params['signature'])) { - $signature = $params['signature']; - } - $this->assertFalse($this->hashGenerator->validateHash($signature, $data)); - } -} diff --git a/dev/tests/integration/testsuite/Magento/UrlRewrite/Model/StoreSwitcher/RewriteUrlTest.php b/dev/tests/integration/testsuite/Magento/UrlRewrite/Model/StoreSwitcher/RewriteUrlTest.php index 317d26abd3370..7e10eb8766aa1 100644 --- a/dev/tests/integration/testsuite/Magento/UrlRewrite/Model/StoreSwitcher/RewriteUrlTest.php +++ b/dev/tests/integration/testsuite/Magento/UrlRewrite/Model/StoreSwitcher/RewriteUrlTest.php @@ -11,12 +11,10 @@ use Magento\Customer\Api\CustomerRepositoryInterface; use Magento\Customer\Api\Data\CustomerInterface; use Magento\Customer\Model\Session; -use Magento\Framework\App\ActionInterface; use Magento\Framework\App\Config\ReinitableConfigInterface; use Magento\Framework\App\Config\Value; use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\ObjectManagerInterface as ObjectManager; -use Magento\Framework\Url\DecoderInterface; use Magento\Store\Api\Data\StoreInterface; use Magento\Store\Api\StoreRepositoryInterface; use Magento\Store\Model\ScopeInterface; @@ -146,13 +144,9 @@ public function testSwitchCmsPageToAnotherStoreAsCustomer(): void $redirectUrl = "http://localhost/index.php/page-c/"; $expectedUrl = "http://localhost/index.php/page-c-on-2nd-store"; - /** @var DecoderInterface $decoder */ - $decoder = $this->objectManager->create(DecoderInterface::class); + $secureRedirectUrl = $this->storeSwitcher->switch($fromStore, $toStore, $redirectUrl); - parse_str(parse_url($secureRedirectUrl, PHP_URL_QUERY), $secureRedirectUrlQueryParams); - $encodedActualUrl = $secureRedirectUrlQueryParams[ActionInterface::PARAM_NAME_URL_ENCODED]; - $actualUrl = $decoder->decode($encodedActualUrl); - $this->assertEquals($expectedUrl, $actualUrl); + $this->assertEquals($expectedUrl, $secureRedirectUrl); } /** From 5819ded0ed228e0de105000d92da26531c07785a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Fri, 19 Jul 2019 11:33:26 +0200 Subject: [PATCH 303/586] Add Cron Jobs names to New Relic transactions --- .../Observer/ProcessCronQueueObserver.php | 54 ++++++--- .../Model/NewRelicWrapper.php | 19 +++- .../Plugin/CommandPlugin.php | 30 ++++- .../NewRelicReporting/Plugin/StatPlugin.php | 105 ++++++++++++++++++ .../Test/Unit/Plugin/CommandPluginTest.php | 105 ++++++++++++++++++ .../Test/Unit/Plugin/StatPluginTest.php | 97 ++++++++++++++++ app/code/Magento/NewRelicReporting/etc/di.xml | 12 +- 7 files changed, 400 insertions(+), 22 deletions(-) create mode 100644 app/code/Magento/NewRelicReporting/Plugin/StatPlugin.php create mode 100644 app/code/Magento/NewRelicReporting/Test/Unit/Plugin/CommandPluginTest.php create mode 100644 app/code/Magento/NewRelicReporting/Test/Unit/Plugin/StatPluginTest.php diff --git a/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php b/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php index 5c8aa1dc78abd..053ba43c1c20e 100644 --- a/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php +++ b/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php @@ -3,9 +3,11 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + /** * Handling cron jobs */ + namespace Magento\Cron\Observer; use Magento\Cron\Model\Schedule; @@ -69,6 +71,11 @@ class ProcessCronQueueObserver implements ObserverInterface */ const LOCK_PREFIX = 'CRON_GROUP_'; + /** + * Cron Job name pattern for Profiling + */ + const CRON_TIMERID = 'job %s'; + /** * @var \Magento\Cron\Model\ResourceModel\Schedule\Collection */ @@ -311,7 +318,7 @@ protected function _runJob($scheduledTime, $currentTime, $jobConfig, $schedule, $schedule->setExecutedAt(strftime('%Y-%m-%d %H:%M:%S', $this->dateTime->gmtTimestamp()))->save(); - $this->startProfiling(); + $this->startProfiling($jobCode); try { $this->logger->info(sprintf('Cron Job %s is run', $jobCode)); //phpcs:ignore Magento2.Functions.DiscouragedFunction @@ -323,7 +330,7 @@ protected function _runJob($scheduledTime, $currentTime, $jobConfig, $schedule, 'Cron Job %s has an error: %s. Statistics: %s', $jobCode, $e->getMessage(), - $this->getProfilingStat() + $this->getProfilingStat($jobCode) ) ); if (!$e instanceof \Exception) { @@ -335,7 +342,7 @@ protected function _runJob($scheduledTime, $currentTime, $jobConfig, $schedule, } throw $e; } finally { - $this->stopProfiling(); + $this->stopProfiling($jobCode); } $schedule->setStatus( @@ -351,7 +358,7 @@ protected function _runJob($scheduledTime, $currentTime, $jobConfig, $schedule, sprintf( 'Cron Job %s is successfully finished. Statistics: %s', $jobCode, - $this->getProfilingStat() + $this->getProfilingStat($jobCode) ) ); } @@ -359,32 +366,47 @@ protected function _runJob($scheduledTime, $currentTime, $jobConfig, $schedule, /** * Starts profiling * + * @param string $jobName * @return void */ - private function startProfiling() + private function startProfiling(string $jobName = '') { $this->statProfiler->clear(); - $this->statProfiler->start('job', microtime(true), memory_get_usage(true), memory_get_usage()); + $this->statProfiler->start( + sprintf(self::CRON_TIMERID, $jobName), + microtime(true), + memory_get_usage(true), + memory_get_usage() + ); } /** * Stops profiling * + * @param string $jobName * @return void */ - private function stopProfiling() + private function stopProfiling(string $jobName = '') { - $this->statProfiler->stop('job', microtime(true), memory_get_usage(true), memory_get_usage()); + $this->statProfiler->stop( + sprintf(self::CRON_TIMERID, $jobName), + microtime(true), + memory_get_usage(true), + memory_get_usage() + ); } /** * Retrieves statistics in the JSON format * + * @param string $jobName * @return string */ - private function getProfilingStat() + private function getProfilingStat(string $jobName): string { - $stat = $this->statProfiler->get('job'); + $stat = $this->statProfiler->get( + sprintf(self::CRON_TIMERID, $jobName) + ); unset($stat[Stat::START]); return json_encode($stat); } @@ -418,7 +440,9 @@ private function getNonExitedSchedules($groupId) 'status', [ 'in' => [ - Schedule::STATUS_PENDING, Schedule::STATUS_RUNNING, Schedule::STATUS_SUCCESS + Schedule::STATUS_PENDING, + Schedule::STATUS_RUNNING, + Schedule::STATUS_SUCCESS ] ] ); @@ -478,10 +502,10 @@ private function generateSchedules($groupId) /** * Generate jobs for config information * - * @param array $jobs - * @param array $exists - * @param string $groupId - * @return void + * @param array $jobs + * @param array $exists + * @param string $groupId + * @return void */ protected function _generateJobs($jobs, $exists, $groupId) { diff --git a/app/code/Magento/NewRelicReporting/Model/NewRelicWrapper.php b/app/code/Magento/NewRelicReporting/Model/NewRelicWrapper.php index bce42b4e90074..fa7f2f1090629 100644 --- a/app/code/Magento/NewRelicReporting/Model/NewRelicWrapper.php +++ b/app/code/Magento/NewRelicReporting/Model/NewRelicWrapper.php @@ -5,6 +5,8 @@ */ namespace Magento\NewRelicReporting\Model; +use Exception; + /** * Wrapper for New Relic functions * @@ -31,10 +33,10 @@ public function addCustomParameter($param, $value) /** * Wrapper for 'newrelic_notice_error' function * - * @param \Exception $exception + * @param Exception $exception * @return void */ - public function reportError($exception) + public function reportError(Exception $exception) { if ($this->isExtensionInstalled()) { newrelic_notice_error($exception->getMessage(), $exception); @@ -67,6 +69,19 @@ public function setTransactionName(string $transactionName): void } } + /** + * Wrapper for 'newrelic_end_transaction' + * + * @param bool $ignore + * @return void + */ + public function endTransaction($ignore = false) + { + if ($this->isExtensionInstalled()) { + newrelic_end_transaction($ignore); + } + } + /** * Checks whether newrelic-php5 agent is installed * diff --git a/app/code/Magento/NewRelicReporting/Plugin/CommandPlugin.php b/app/code/Magento/NewRelicReporting/Plugin/CommandPlugin.php index 04ad3d0504d34..d21f972da57c6 100644 --- a/app/code/Magento/NewRelicReporting/Plugin/CommandPlugin.php +++ b/app/code/Magento/NewRelicReporting/Plugin/CommandPlugin.php @@ -25,16 +25,24 @@ class CommandPlugin */ private $newRelicWrapper; + /** + * @var string[] + */ + private $skipCommands; + /** * @param Config $config * @param NewRelicWrapper $newRelicWrapper + * @param array $skipCommands */ public function __construct( Config $config, - NewRelicWrapper $newRelicWrapper + NewRelicWrapper $newRelicWrapper, + array $skipCommands = [] ) { $this->config = $config; $this->newRelicWrapper = $newRelicWrapper; + $this->skipCommands = $skipCommands; } /** @@ -46,10 +54,24 @@ public function __construct( */ public function beforeRun(Command $command, ...$args) { - $this->newRelicWrapper->setTransactionName( - sprintf('CLI %s', $command->getName()) - ); + if (!$this->isCommandSkipped($command)) { + $this->newRelicWrapper->setTransactionName( + sprintf('CLI %s', $command->getName()) + ); + } return $args; } + + /** + * Determines whether the Command is declared to be skipped + * + * @param Command $command + * @return bool + */ + private function isCommandSkipped(Command $command): bool + { + $commandName = $command->getName(); + return isset($this->skipCommands[$commandName]) && $this->skipCommands[$commandName] === true; + } } diff --git a/app/code/Magento/NewRelicReporting/Plugin/StatPlugin.php b/app/code/Magento/NewRelicReporting/Plugin/StatPlugin.php new file mode 100644 index 0000000000000..30dddfe11910a --- /dev/null +++ b/app/code/Magento/NewRelicReporting/Plugin/StatPlugin.php @@ -0,0 +1,105 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\NewRelicReporting\Plugin; + +use Magento\Framework\Profiler\Driver\Standard\Stat; +use Magento\NewRelicReporting\Model\Config; +use Magento\NewRelicReporting\Model\NewRelicWrapper; +use Psr\Log\LoggerInterface; + +/** + * Class StatPlugin handles single Cron Jobs transaction names + */ +class StatPlugin +{ + public const TIMER_NAME_CRON_PREFIX = 'job'; + + /** + * @var Config + */ + private $config; + + /** + * @var NewRelicWrapper + */ + private $newRelicWrapper; + + /** + * @var LoggerInterface + */ + private $logger; + + /** + * @param Config $config + * @param NewRelicWrapper $newRelicWrapper + * @param LoggerInterface $logger + */ + public function __construct( + Config $config, + NewRelicWrapper $newRelicWrapper, + LoggerInterface $logger + ) { + $this->config = $config; + $this->newRelicWrapper = $newRelicWrapper; + $this->logger = $logger; + } + + /** + * Before running original profiler, register NewRelic transaction + * + * @param Stat $schedule + * @param array $args + * @return array + * @see \Magento\Cron\Observer\ProcessCronQueueObserver::startProfiling + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function beforeStart(Stat $schedule, ...$args): array + { + $timerName = current($args); + + if ($this->isCronJob($timerName)) { + $this->newRelicWrapper->setTransactionName( + sprintf('Cron %s', $timerName) + ); + } + + return $args; + } + + /** + * Before stopping original profiler, close NewRelic transaction + * + * @param Stat $schedule + * @param array $args + * @return array + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function beforeStop(Stat $schedule, ...$args): array + { + $timerName = current($args); + + if ($this->isCronJob($timerName)) { + $this->newRelicWrapper->endTransaction(); + } + + return $args; + } + + /** + * Determines whether provided name is Cron Job + * + * @param string $timerName + * @return bool + */ + private function isCronJob(string $timerName): bool + { + return 0 === strpos($timerName, static::TIMER_NAME_CRON_PREFIX); + } +} diff --git a/app/code/Magento/NewRelicReporting/Test/Unit/Plugin/CommandPluginTest.php b/app/code/Magento/NewRelicReporting/Test/Unit/Plugin/CommandPluginTest.php new file mode 100644 index 0000000000000..f75997a6302bb --- /dev/null +++ b/app/code/Magento/NewRelicReporting/Test/Unit/Plugin/CommandPluginTest.php @@ -0,0 +1,105 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\NewRelicReporting\Test\Unit\Plugin; + +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\NewRelicReporting\Model\NewRelicWrapper; +use Magento\NewRelicReporting\Plugin\CommandPlugin; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; +use Symfony\Component\Console\Command\Command; + +class CommandPluginTest extends TestCase +{ + private const STUB_SKIPPED_COMMAND_NAME = 'skippedCommand'; + private const STUB_NON_SKIPPED_COMMAND_NAME = 'nonSkippedCommand'; + + /** + * @var ObjectManager + */ + private $objectManager; + + /** + * @var MockObject|NewRelicWrapper + */ + private $newRelicWrapperMock; + + /** + * ObjectManager and mocks necessary to run the tests + */ + protected function setUp() + { + $this->newRelicWrapperMock = $this->getMockBuilder(NewRelicWrapper::class) + ->disableOriginalConstructor() + ->setMethods(['setTransactionName']) + ->getMock(); + + $this->objectManager = new ObjectManager($this); + } + + /** + * When Command name is not in the list of skipped, handle New Relic transaction + */ + public function testNewRelicTransactionSetForNonSkippedCommand() + { + $nonSkippedCommand = $this->getCommandMock(self::STUB_NON_SKIPPED_COMMAND_NAME); + + $this->newRelicWrapperMock->expects($this->once()) + ->method('setTransactionName') + ->with(sprintf('CLI %s', self::STUB_NON_SKIPPED_COMMAND_NAME)); + + $commandPlugin = $this->getCommandPlugin([self::STUB_SKIPPED_COMMAND_NAME => true]); + $commandPlugin->beforeRun($nonSkippedCommand); + } + + /** + * When Command name is set to be skipped, do not let run New Relic transaction + */ + public function testNewRelicTransactionOmmitForSkippedCommand() + { + $skippedCommand = $this->getCommandMock(self::STUB_SKIPPED_COMMAND_NAME); + + $this->newRelicWrapperMock->expects($this->never()) + ->method('setTransactionName'); + + $commandPlugin = $this->getCommandPlugin([self::STUB_SKIPPED_COMMAND_NAME => true]); + $commandPlugin->beforeRun($skippedCommand); + } + + /** + * @param string $commandName + * @return Command|MockObject + */ + private function getCommandMock(string $commandName): Command + { + $commandMock = $this->getMockBuilder(Command::class) + ->disableOriginalConstructor() + ->setMethods(['getName']) + ->getMock(); + + $commandMock->method('getName') + ->willReturn($commandName); + + return $commandMock; + } + + /** + * @param string[] $skippedCommands + * @return CommandPlugin + */ + private function getCommandPlugin(array $skippedCommands): CommandPlugin + { + /** @var CommandPlugin $commandPlugin */ + $commandPlugin = $this->objectManager->getObject(CommandPlugin::class, [ + 'skipCommands' => $skippedCommands, + 'newRelicWrapper' => $this->newRelicWrapperMock + ]); + + return $commandPlugin; + } +} diff --git a/app/code/Magento/NewRelicReporting/Test/Unit/Plugin/StatPluginTest.php b/app/code/Magento/NewRelicReporting/Test/Unit/Plugin/StatPluginTest.php new file mode 100644 index 0000000000000..163f9a69992ed --- /dev/null +++ b/app/code/Magento/NewRelicReporting/Test/Unit/Plugin/StatPluginTest.php @@ -0,0 +1,97 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\NewRelicReporting\Test\Unit\Plugin; + +use Magento\Framework\Profiler\Driver\Standard\Stat; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\NewRelicReporting\Model\NewRelicWrapper; +use Magento\NewRelicReporting\Plugin\StatPlugin; +use PHPUnit\Framework\TestCase; +use PHPUnit_Framework_MockObject_MockObject as MockObject; + +class StatPluginTest extends TestCase +{ + private const STAT_NAME_NOT_CRON_JOB = 'NotCronJob'; + private const STAT_NAME_CRON_JOB = StatPlugin::TIMER_NAME_CRON_PREFIX . 'Name'; + + /** + * @var StatPlugin + */ + private $statPlugin; + + /** + * @var MockObject|NewRelicWrapper + */ + private $newRelicWrapperMock; + + /** + * @var MockObject|Stat + */ + private $statMock; + + /** + * Build class for testing + */ + public function setUp() + { + $objectManager = new ObjectManager($this); + + $this->statPlugin = $objectManager->getObject(StatPlugin::class, [ + 'newRelicWrapper' => $this->getNewRelicWrapperMock() + ]); + + $this->statMock = $this->getMockBuilder(Stat::class)->disableOriginalConstructor()->getMock(); + } + + /** + * Expects that NewRelic wrapper will never be called + */ + public function testNewRelicTransactionNameIsNotSetIfNotCronjobPattern() + { + $this->newRelicWrapperMock + ->expects($this->never()) + ->method('setTransactionName'); + $this->newRelicWrapperMock + ->expects($this->never()) + ->method('endTransaction'); + + $this->statPlugin->beforeStart($this->statMock, self::STAT_NAME_NOT_CRON_JOB); + $this->statPlugin->beforeStop($this->statMock, self::STAT_NAME_NOT_CRON_JOB); + } + + /** + * NewRelic Wrapper is called when Task name fits Cron Job pattern + */ + public function testNewRelicTransactionNameIsSetForCronjobNamePattern() + { + $this->newRelicWrapperMock + ->expects($this->once()) + ->method('setTransactionName'); + $this->newRelicWrapperMock + ->expects($this->once()) + ->method('endTransaction'); + + $this->statPlugin->beforeStart($this->statMock, self::STAT_NAME_CRON_JOB); + $this->statPlugin->beforeStop($this->statMock, self::STAT_NAME_CRON_JOB); + } + + /** + * @return NewRelicWrapper + */ + private function getNewRelicWrapperMock(): NewRelicWrapper + { + if (null === $this->newRelicWrapperMock) { + $this->newRelicWrapperMock = $this->getMockBuilder(NewRelicWrapper::class) + ->disableOriginalConstructor() + ->setMethods(['setTransactionName', 'endTransaction']) + ->getMock(); + } + + return $this->newRelicWrapperMock; + } +} diff --git a/app/code/Magento/NewRelicReporting/etc/di.xml b/app/code/Magento/NewRelicReporting/etc/di.xml index 15516f6df89be..cd8b0f46087a4 100644 --- a/app/code/Magento/NewRelicReporting/etc/di.xml +++ b/app/code/Magento/NewRelicReporting/etc/di.xml @@ -41,6 +41,16 @@ </arguments> </type> <type name="Symfony\Component\Console\Command\Command"> - <plugin name="newrelic-describe-commands" type="Magento\NewRelicReporting\Plugin\CommandPlugin"/> + <plugin name="newrelic-describe-commands" type="Magento\NewRelicReporting\Plugin\CommandPlugin"/> + </type> + <type name="Magento\Framework\Profiler\Driver\Standard\Stat"> + <plugin name="newrelic-describe-cronjobs" type="Magento\NewRelicReporting\Plugin\StatPlugin"/> + </type> + <type name="Magento\NewRelicReporting\Plugin\CommandPlugin"> + <arguments> + <argument name="skipCommands" xsi:type="array"> + <item xsi:type="boolean" name="cron:run">true</item> + </argument> + </arguments> </type> </config> From 647880beb9e4080b0c2149a6ecc82437fed08ed0 Mon Sep 17 00:00:00 2001 From: Myroslav Dobra <dmaraptor@gmail.com> Date: Fri, 13 Dec 2019 13:19:13 +0200 Subject: [PATCH 304/586] MC-25176: Storefront quick search leads to exception --- .../Product/FieldProvider/StaticField.php | 13 +- .../Product/FieldProvider/StaticFieldTest.php | 215 ++++++++++-------- app/code/Magento/Elasticsearch/etc/di.xml | 7 + .../Controller/QuickSearchTest.php | 62 +++++ 4 files changed, 199 insertions(+), 98 deletions(-) create mode 100644 dev/tests/integration/testsuite/Magento/Elasticsearch6/Controller/QuickSearchTest.php diff --git a/app/code/Magento/Elasticsearch/Model/Adapter/FieldMapper/Product/FieldProvider/StaticField.php b/app/code/Magento/Elasticsearch/Model/Adapter/FieldMapper/Product/FieldProvider/StaticField.php index 348a1c708a78c..7a5d6fcdcc1b1 100644 --- a/app/code/Magento/Elasticsearch/Model/Adapter/FieldMapper/Product/FieldProvider/StaticField.php +++ b/app/code/Magento/Elasticsearch/Model/Adapter/FieldMapper/Product/FieldProvider/StaticField.php @@ -62,6 +62,11 @@ class StaticField implements FieldProviderInterface */ private $fieldNameResolver; + /** + * @var array + */ + private $excludedAttributes; + /** * @param Config $eavConfig * @param FieldTypeConverterInterface $fieldTypeConverter @@ -70,6 +75,7 @@ class StaticField implements FieldProviderInterface * @param FieldIndexResolver $fieldIndexResolver * @param AttributeProvider $attributeAdapterProvider * @param FieldName\ResolverInterface|null $fieldNameResolver + * @param array $excludedAttributes */ public function __construct( Config $eavConfig, @@ -78,7 +84,8 @@ public function __construct( FieldTypeResolver $fieldTypeResolver, FieldIndexResolver $fieldIndexResolver, AttributeProvider $attributeAdapterProvider, - FieldName\ResolverInterface $fieldNameResolver = null + FieldName\ResolverInterface $fieldNameResolver = null, + array $excludedAttributes = [] ) { $this->eavConfig = $eavConfig; $this->fieldTypeConverter = $fieldTypeConverter; @@ -88,6 +95,7 @@ public function __construct( $this->attributeAdapterProvider = $attributeAdapterProvider; $this->fieldNameResolver = $fieldNameResolver ?: ObjectManager::getInstance() ->get(FieldName\ResolverInterface::class); + $this->excludedAttributes = $excludedAttributes; } /** @@ -103,6 +111,9 @@ public function getFields(array $context = []): array $allAttributes = []; foreach ($attributes as $attribute) { + if (in_array($attribute->getAttributeCode(), $this->excludedAttributes, true)) { + continue; + } $attributeAdapter = $this->attributeAdapterProvider->getByAttributeCode($attribute->getAttributeCode()); $fieldName = $this->fieldNameResolver->getFieldName($attributeAdapter); diff --git a/app/code/Magento/Elasticsearch/Test/Unit/Model/Adapter/FieldMapper/Product/FieldProvider/StaticFieldTest.php b/app/code/Magento/Elasticsearch/Test/Unit/Model/Adapter/FieldMapper/Product/FieldProvider/StaticFieldTest.php index c08a4298b42d2..a603d6ab47824 100644 --- a/app/code/Magento/Elasticsearch/Test/Unit/Model/Adapter/FieldMapper/Product/FieldProvider/StaticFieldTest.php +++ b/app/code/Magento/Elasticsearch/Test/Unit/Model/Adapter/FieldMapper/Product/FieldProvider/StaticFieldTest.php @@ -8,6 +8,7 @@ namespace Magento\Elasticsearch\Test\Unit\Model\Adapter\FieldMapper\Product\FieldProvider; use Magento\Eav\Model\Entity\Attribute\AbstractAttribute; +use Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\StaticField; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; use Magento\Eav\Model\Config; use Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\AttributeProvider; @@ -22,56 +23,56 @@ as FieldIndexResolver; use Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\ResolverInterface as FieldNameResolver; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; /** - * @SuppressWarnings(PHPMD) + * Unit tests for \Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\StaticField class. */ -class StaticFieldTest extends \PHPUnit\Framework\TestCase +class StaticFieldTest extends TestCase { /** - * @var \Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\StaticField + * @var StaticField */ private $provider; /** - * @var \Magento\Eav\Model\Config|\PHPUnit_Framework_MockObject_MockObject + * @var Config|MockObject */ private $eavConfig; /** - * @var FieldTypeConverterInterface + * @var FieldTypeConverterInterface|MockObject */ private $fieldTypeConverter; /** - * @var IndexTypeConverterInterface + * @var IndexTypeConverterInterface|MockObject */ private $indexTypeConverter; /** - * @var AttributeProvider + * @var AttributeProvider|MockObject */ private $attributeAdapterProvider; /** - * @var FieldIndexResolver + * @var FieldIndexResolver|MockObject */ private $fieldIndexResolver; /** - * @var FieldTypeResolver + * @var FieldTypeResolver|MockObject */ private $fieldTypeResolver; /** - * @var FieldNameResolver + * @var FieldNameResolver|MockObject */ private $fieldNameResolver; /** - * Set up test environment - * - * @return void + * @inheritdoc */ protected function setUp() { @@ -105,7 +106,7 @@ protected function setUp() $objectManager = new ObjectManagerHelper($this); $this->provider = $objectManager->getObject( - \Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\StaticField::class, + StaticField::class, [ 'eavConfig' => $this->eavConfig, 'fieldTypeConverter' => $this->fieldTypeConverter, @@ -114,37 +115,42 @@ protected function setUp() 'fieldIndexResolver' => $this->fieldIndexResolver, 'fieldTypeResolver' => $this->fieldTypeResolver, 'fieldNameResolver' => $this->fieldNameResolver, + 'excludedAttributes' => ['price'], ] ); } /** - * @dataProvider attributeProvider * @param string $attributeCode * @param string $inputType - * @param $indexType - * @param $isComplexType - * @param $complexType - * @param $isSortable - * @param $fieldName - * @param $compositeFieldName - * @param $sortFieldName + * @param string|bool $indexType + * @param bool $isComplexType + * @param string $complexType + * @param bool $isSortable + * @param bool $isTextType + * @param string $fieldName + * @param string $compositeFieldName + * @param string $sortFieldName * @param array $expected * @return void + * @dataProvider attributeProvider + * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function testGetAllAttributesTypes( - $attributeCode, - $inputType, + string $attributeCode, + string $inputType, $indexType, - $isComplexType, - $complexType, - $isSortable, - $isTextType, - $fieldName, - $compositeFieldName, - $sortFieldName, - $expected - ) { + bool $isComplexType, + string $complexType, + bool $isSortable, + bool $isTextType, + string $fieldName, + string $compositeFieldName, + string $sortFieldName, + array $expected + ): void { $this->fieldTypeResolver->expects($this->any()) ->method('getFieldType') ->willReturn($inputType); @@ -154,32 +160,28 @@ public function testGetAllAttributesTypes( $this->indexTypeConverter->expects($this->any()) ->method('convert') ->with($this->anything()) - ->will( - $this->returnCallback( - function ($type) { - if ($type === 'no_index') { - return 'no'; - } elseif ($type === 'no_analyze') { - return 'not_analyzed'; - } + ->willReturnCallback( + function ($type) { + if ($type === 'no_index') { + return 'no'; + } elseif ($type === 'no_analyze') { + return 'not_analyzed'; } - ) + } ); $this->fieldNameResolver->expects($this->any()) ->method('getFieldName') ->with($this->anything()) - ->will( - $this->returnCallback( - function ($attributeMock, $context) use ($fieldName, $compositeFieldName, $sortFieldName) { - if (empty($context)) { - return $fieldName; - } elseif ($context['type'] === 'sort') { - return $sortFieldName; - } elseif ($context['type'] === 'text') { - return $compositeFieldName; - } + ->willReturnCallback( + function ($attributeMock, $context) use ($fieldName, $compositeFieldName, $sortFieldName) { + if (empty($context)) { + return $fieldName; + } elseif ($context['type'] === 'sort') { + return $sortFieldName; + } elseif ($context['type'] === 'text') { + return $compositeFieldName; } - ) + } ); $productAttributeMock = $this->getMockBuilder(AbstractAttribute::class) @@ -215,23 +217,21 @@ function ($attributeMock, $context) use ($fieldName, $compositeFieldName, $sortF $this->fieldTypeConverter->expects($this->any()) ->method('convert') ->with($this->anything()) - ->will( - $this->returnCallback( - function ($type) use ($complexType) { - static $callCount = []; - $callCount[$type] = !isset($callCount[$type]) ? 1 : ++$callCount[$type]; + ->willReturnCallback( + function ($type) use ($complexType) { + static $callCount = []; + $callCount[$type] = !isset($callCount[$type]) ? 1 : ++$callCount[$type]; - if ($type === 'string') { - return 'string'; - } elseif ($type === 'float') { - return 'float'; - } elseif ($type === 'keyword') { - return 'string'; - } else { - return $complexType; - } + if ($type === 'string') { + return 'string'; + } elseif ($type === 'float') { + return 'float'; + } elseif ($type === 'keyword') { + return 'string'; + } else { + return $complexType; } - ) + } ); $this->assertEquals( @@ -242,8 +242,9 @@ function ($type) use ($complexType) { /** * @return array + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ - public function attributeProvider() + public function attributeProvider(): array { return [ [ @@ -264,25 +265,25 @@ public function attributeProvider() 'fields' => [ 'keyword' => [ 'type' => 'string', - 'index' => 'not_analyzed' - ] - ] + 'index' => 'not_analyzed', + ], + ], ], 'category_ids_value' => [ - 'type' => 'string' + 'type' => 'string', ], 'store_id' => [ 'type' => 'string', - 'index' => 'no' - ] - ] + 'index' => 'no', + ], + ], ], [ 'attr_code', 'text', 'no', false, - null, + 'text', false, true, 'attr_code', @@ -295,22 +296,22 @@ public function attributeProvider() 'fields' => [ 'keyword' => [ 'type' => 'string', - 'index' => 'not_analyzed' - ] - ] + 'index' => 'not_analyzed', + ], + ], ], 'store_id' => [ 'type' => 'string', - 'index' => 'no' - ] + 'index' => 'no', + ], ], ], [ 'attr_code', 'text', - null, false, - null, + false, + 'text', false, false, 'attr_code', @@ -318,20 +319,21 @@ public function attributeProvider() '', [ 'attr_code' => [ - 'type' => 'text' + 'type' => 'text', + 'index' => false, ], 'store_id' => [ 'type' => 'string', - 'index' => 'no' - ] - ] + 'index' => 'no', + ], + ], ], [ 'attr_code', 'text', - null, false, - null, + false, + 'text', true, false, 'attr_code', @@ -340,19 +342,38 @@ public function attributeProvider() [ 'attr_code' => [ 'type' => 'text', + 'index' => false, 'fields' => [ 'sort_attr_code' => [ 'type' => 'string', - 'index' => 'not_analyzed' - ] - ] + 'index' => 'not_analyzed', + ], + ], ], 'store_id' => [ 'type' => 'string', - 'index' => 'no' - ] - ] - ] + 'index' => 'no', + ], + ], + ], + [ + 'price', + 'text', + false, + false, + 'text', + false, + false, + 'price', + '', + '', + [ + 'store_id' => [ + 'type' => 'string', + 'index' => 'no', + ], + ], + ], ]; } } diff --git a/app/code/Magento/Elasticsearch/etc/di.xml b/app/code/Magento/Elasticsearch/etc/di.xml index f42d957276d76..87cb04632ed6f 100644 --- a/app/code/Magento/Elasticsearch/etc/di.xml +++ b/app/code/Magento/Elasticsearch/etc/di.xml @@ -558,4 +558,11 @@ </argument> </arguments> </type> + <type name="Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\StaticField"> + <arguments> + <argument name="excludedAttributes" xsi:type="array"> + <item name="price" xsi:type="string">price</item> + </argument> + </arguments> + </type> </config> diff --git a/dev/tests/integration/testsuite/Magento/Elasticsearch6/Controller/QuickSearchTest.php b/dev/tests/integration/testsuite/Magento/Elasticsearch6/Controller/QuickSearchTest.php new file mode 100644 index 0000000000000..637d3d1a9d252 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Elasticsearch6/Controller/QuickSearchTest.php @@ -0,0 +1,62 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Elasticsearch6\Controller; + +use Magento\Store\Model\StoreManagerInterface; +use Magento\TestFramework\TestCase\AbstractController; + +/** + * Tests quick search on Storefront. + */ +class QuickSearchTest extends AbstractController +{ + /** + * @var StoreManagerInterface + */ + private $storeManager; + + /** + * @inheritdoc + */ + protected function setUp() + { + parent::setUp(); + $this->storeManager = $this->_objectManager->get(StoreManagerInterface::class); + } + + /** + * Tests quick search with "Price Navigation Step Calculation" sets to "Automatic (equalize product counts)". + * + * @magentoAppArea frontend + * @magentoDbIsolation disabled + * @magentoConfigFixture fixturestore_store catalog/layered_navigation/price_range_calculation improved + * @magentoConfigFixture fixturestore_store catalog/layered_navigation/one_price_interval 1 + * @magentoConfigFixture fixturestore_store catalog/layered_navigation/interval_division_limit 1 + * @magentoConfigFixture default/catalog/search/engine elasticsearch6 + * @magentoConfigFixture default_store catalog/search/elasticsearch6_index_prefix storefront_quick_search + * @magentoConfigFixture fixturestore_store catalog/search/elasticsearch6_index_prefix storefront_quick_search + * @magentoDataFixture Magento/Catalog/_files/products_for_search.php + * @magentoDataFixture Magento/Store/_files/core_fixturestore.php + * @magentoDataFixture Magento/CatalogSearch/_files/full_reindex.php + */ + public function testQuickSearchWithImprovedPriceRangeCalculation() + { + $secondStore = $this->storeManager->getStore('fixturestore'); + $this->storeManager->setCurrentStore($secondStore); + + try { + $this->dispatch('/catalogsearch/result/?q=search+product'); + $responseBody = $this->getResponse()->getBody(); + } finally { + $defaultStore = $this->storeManager->getStore('default'); + $this->storeManager->setCurrentStore($defaultStore); + } + + $this->assertContains('search product 1', $responseBody); + } +} From 50ff99cf2095a5048bafdbb151c01e3a56fb6c30 Mon Sep 17 00:00:00 2001 From: Andrii Beziazychnyi <a.beziazychnyi@atwix.com> Date: Fri, 13 Dec 2019 14:35:21 +0200 Subject: [PATCH 305/586] Refactor: Remove deprecated methods - removed deprecated method "loadConfigFile" from "Magento\Framework\App\DeploymentConfig\Reader" --- .../Framework/App/DeploymentConfig/Reader.php | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/lib/internal/Magento/Framework/App/DeploymentConfig/Reader.php b/lib/internal/Magento/Framework/App/DeploymentConfig/Reader.php index a53ea9423d449..df9dee7459464 100644 --- a/lib/internal/Magento/Framework/App/DeploymentConfig/Reader.php +++ b/lib/internal/Magento/Framework/App/DeploymentConfig/Reader.php @@ -124,21 +124,4 @@ public function load($fileKey = null) } return $result ?: []; } - - /** - * Loads the configuration file. - * - * @param string $fileKey The file key - * @param string $pathConfig The path config - * @param bool $ignoreInitialConfigFiles Whether ignore custom pools - * @return array - * @throws FileSystemException - * @throws RuntimeException - * @deprecated 100.2.0 Magento does not support custom config file pools since 2.2.0 version - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function loadConfigFile($fileKey, $pathConfig, $ignoreInitialConfigFiles = false) - { - return $this->load($fileKey); - } } From ed5dc878f6f16f05f3b3001c6fa8d10360d6f842 Mon Sep 17 00:00:00 2001 From: Yaroslav Rogoza <enarc@atwix.com> Date: Fri, 13 Dec 2019 15:42:17 +0100 Subject: [PATCH 306/586] Fixed keyboard arrow keys behavior for number fields in AdobeStock grid --- lib/web/jquery/jstree/jquery.hotkeys.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/web/jquery/jstree/jquery.hotkeys.js b/lib/web/jquery/jstree/jquery.hotkeys.js index 207c65bb06df6..c36582a503f43 100644 --- a/lib/web/jquery/jstree/jquery.hotkeys.js +++ b/lib/web/jquery/jstree/jquery.hotkeys.js @@ -53,7 +53,8 @@ * longer maintained by its author however we require content editable to behave as expected. */ if ( this !== event.target && (/textarea|select/i.test( event.target.nodeName ) || - event.target.type === "text" || jQuery(event.target).attr('contenteditable')) ) { + event.target.type === "text" || event.target.type === "number" || + jQuery(event.target).attr('contenteditable')) ) { return; } From ab6cabd682ae18a48aaf1429232047d90e4e881c Mon Sep 17 00:00:00 2001 From: Lukasz Lewandowski <llewandowski@gpmd.co.uk> Date: Fri, 13 Dec 2019 08:44:14 -0600 Subject: [PATCH 307/586] Add tests for cached getVersion and update class description --- .../Magento/Framework/App/ProductMetadata.php | 4 +--- .../App/Test/Unit/ProductMetadataTest.php | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/lib/internal/Magento/Framework/App/ProductMetadata.php b/lib/internal/Magento/Framework/App/ProductMetadata.php index 8f989351743d2..55e98bb085d41 100644 --- a/lib/internal/Magento/Framework/App/ProductMetadata.php +++ b/lib/internal/Magento/Framework/App/ProductMetadata.php @@ -13,9 +13,7 @@ use Magento\Framework\Composer\ComposerInformation; /** - * Class ProductMetadata - * - * @package Magento\Framework\App + * Magento application product metadata */ class ProductMetadata implements ProductMetadataInterface { diff --git a/lib/internal/Magento/Framework/App/Test/Unit/ProductMetadataTest.php b/lib/internal/Magento/Framework/App/Test/Unit/ProductMetadataTest.php index 8e1acc89437e2..bc1abb169b4f8 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/ProductMetadataTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/ProductMetadataTest.php @@ -5,6 +5,7 @@ */ namespace Magento\Framework\App\Test\Unit; +use Magento\Framework\App\CacheInterface; use Magento\Framework\App\ProductMetadata; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; @@ -20,16 +21,27 @@ class ProductMetadataTest extends \PHPUnit\Framework\TestCase */ private $composerInformationMock; + /** + * @var CacheInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $cacheMock; + protected function setUp() { $this->composerInformationMock = $this->getMockBuilder(\Magento\Framework\Composer\ComposerInformation::class) ->disableOriginalConstructor()->getMock(); + $this->cacheMock = $this->getMockBuilder(CacheInterface::class)->getMock(); + $objectManager = new ObjectManager($this); $this->productMetadata = $objectManager->getObject(ProductMetadata::class); $reflectionProperty = new \ReflectionProperty($this->productMetadata, 'composerInformation'); $reflectionProperty->setAccessible(true); $reflectionProperty->setValue($this->productMetadata, $this->composerInformationMock); + + $reflectionProperty = new \ReflectionProperty($this->productMetadata, 'cache'); + $reflectionProperty->setAccessible(true); + $reflectionProperty->setValue($this->productMetadata, $this->cacheMock); } /** @@ -40,11 +52,21 @@ protected function setUp() public function testGetVersion($packageList, $expectedVersion) { $this->composerInformationMock->expects($this->any())->method('getSystemPackages')->willReturn($packageList); + $this->cacheMock->expects($this->once())->method('save')->with($expectedVersion); $productVersion = $this->productMetadata->getVersion(); $this->assertNotEmpty($productVersion, 'Empty product version'); $this->assertEquals($expectedVersion, $productVersion); } + public function testGetVersionCached() + { + $expectedVersion = '1.2.3'; + $this->composerInformationMock->expects($this->never())->method('getSystemPackages'); + $this->cacheMock->expects($this->once())->method('load')->willReturn($expectedVersion); + $productVersion = $this->productMetadata->getVersion(); + $this->assertEquals($expectedVersion, $productVersion); + } + /** * @return array */ From 16d0cfc692b497e397df08ebe0ce0487827e46ea Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Fri, 13 Dec 2019 17:14:17 +0200 Subject: [PATCH 308/586] MC-4242: Newsletter subscriptions per website --- app/code/Magento/Newsletter/Model/Subscriber.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Newsletter/Model/Subscriber.php b/app/code/Magento/Newsletter/Model/Subscriber.php index f33b9929435c3..5c573f47aa0bf 100644 --- a/app/code/Magento/Newsletter/Model/Subscriber.php +++ b/app/code/Magento/Newsletter/Model/Subscriber.php @@ -628,7 +628,7 @@ public function loadByCustomerId($customerId) $customer = $this->customerRepository->getById($customerId); $websiteId = (int)$this->_storeManager->getStore()->getWebsiteId(); $this->loadByCustomer((int)$customerId, $websiteId); - if ($customer->getId() && !$this->getCustomerId()) { + if ($this->getId() && $customer->getId() && !$this->getCustomerId()) { $this->setCustomerId($customer->getId()); $this->setSubscriberConfirmCode($this->randomSequence()); $this->save(); From f1f7dadd2100a8d6d676510742a38f3672be6363 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Fri, 13 Dec 2019 17:23:40 +0200 Subject: [PATCH 309/586] MC-4242: Newsletter subscriptions per website --- .../CustomerGraphQl/Model/Resolver/IsSubscribed.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/CustomerGraphQl/Model/Resolver/IsSubscribed.php b/app/code/Magento/CustomerGraphQl/Model/Resolver/IsSubscribed.php index 4e49891b5870a..3e69723d4e771 100644 --- a/app/code/Magento/CustomerGraphQl/Model/Resolver/IsSubscribed.php +++ b/app/code/Magento/CustomerGraphQl/Model/Resolver/IsSubscribed.php @@ -7,6 +7,7 @@ namespace Magento\CustomerGraphQl\Model\Resolver; +use Magento\Customer\Api\Data\CustomerInterface; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; use Magento\Framework\GraphQl\Config\Element\Field; @@ -45,10 +46,12 @@ public function resolve( if (!isset($value['model'])) { throw new LocalizedException(__('"model" value should be specified')); } - /** @var Customer $customer */ + /** @var CustomerInterface $customer */ $customer = $value['model']; + $customerId = (int)$customer->getId(); + $websiteId = (int)$customer->getWebsiteId(); + $status = $this->subscriberFactory->create()->loadByCustomer($customerId, $websiteId)->isSubscribed(); - $status = $this->subscriberFactory->create()->loadByCustomerId((int)$customer->getId())->isSubscribed(); return (bool)$status; } } From 0b7c34ef79307da52e088b6d3652663e9cd2c3a1 Mon Sep 17 00:00:00 2001 From: Lukasz Lewandowski <llewandowski@gpmd.co.uk> Date: Fri, 13 Dec 2019 09:26:43 -0600 Subject: [PATCH 310/586] Update tests --- .../Framework/App/Test/Unit/ProductMetadataTest.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/internal/Magento/Framework/App/Test/Unit/ProductMetadataTest.php b/lib/internal/Magento/Framework/App/Test/Unit/ProductMetadataTest.php index bc1abb169b4f8..c504c5f480669 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/ProductMetadataTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/ProductMetadataTest.php @@ -34,14 +34,10 @@ protected function setUp() $this->cacheMock = $this->getMockBuilder(CacheInterface::class)->getMock(); $objectManager = new ObjectManager($this); - $this->productMetadata = $objectManager->getObject(ProductMetadata::class); + $this->productMetadata = $objectManager->getObject(ProductMetadata::class, ['cache' => $this->cacheMock]); $reflectionProperty = new \ReflectionProperty($this->productMetadata, 'composerInformation'); $reflectionProperty->setAccessible(true); $reflectionProperty->setValue($this->productMetadata, $this->composerInformationMock); - - $reflectionProperty = new \ReflectionProperty($this->productMetadata, 'cache'); - $reflectionProperty->setAccessible(true); - $reflectionProperty->setValue($this->productMetadata, $this->cacheMock); } /** @@ -63,6 +59,7 @@ public function testGetVersionCached() $expectedVersion = '1.2.3'; $this->composerInformationMock->expects($this->never())->method('getSystemPackages'); $this->cacheMock->expects($this->once())->method('load')->willReturn($expectedVersion); + $this->cacheMock->expects($this->never())->method('save'); $productVersion = $this->productMetadata->getVersion(); $this->assertEquals($expectedVersion, $productVersion); } From 284e3edc3b97fb05c9f01b3e9932a542551fec87 Mon Sep 17 00:00:00 2001 From: Grzegorz Bogusz <grzegorz.bogusz@creativestyle.pl> Date: Fri, 13 Dec 2019 19:23:18 +0100 Subject: [PATCH 311/586] [issue-25974] Fix for "Amount of characters on a 'Area' Customizable Option counted differently on backend/frontend" --- .../Model/Product/Option/Type/Text.php | 12 ++ .../Model/Product/Option/Type/TextTest.php | 104 ++++++++++++++++++ 2 files changed, 116 insertions(+) create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/TextTest.php diff --git a/app/code/Magento/Catalog/Model/Product/Option/Type/Text.php b/app/code/Magento/Catalog/Model/Product/Option/Type/Text.php index 9ffe75e513bce..0585e77734e3e 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/Type/Text.php +++ b/app/code/Magento/Catalog/Model/Product/Option/Type/Text.php @@ -68,6 +68,7 @@ public function validateUserValue($values) // Check maximal length limit $maxCharacters = $option->getMaxCharacters(); + $value = $this->normalizeNewLineSymbols($value); if ($maxCharacters > 0 && $this->string->strlen($value) > $maxCharacters) { $this->setIsValid(false); throw new LocalizedException(__('The text is too long. Shorten the text and try again.')); @@ -101,4 +102,15 @@ public function getFormattedOptionValue($value) { return $this->_escaper->escapeHtml($value); } + + /** + * Normalize newline symbols + * + * @param string $value + * @return string + */ + private function normalizeNewLineSymbols($value) + { + return str_replace(["\r\n", "\n\r", "\r"], ["\n", "\n", "\n"], $value); + } } diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/TextTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/TextTest.php new file mode 100644 index 0000000000000..29e7f327eeb9e --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/TextTest.php @@ -0,0 +1,104 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Catalog\Model\Product\Option\Type; + +use Magento\Catalog\Model\Product\Option; + +/** + * Test for customizable product option with "Text" type + */ +class TextTest extends \PHPUnit\Framework\TestCase +{ + /** + * @var Text + */ + protected $model; + + /** + * @var \Magento\Framework\ObjectManagerInterface + */ + private $objectManager; + + /** + * {@inheritDoc} + */ + protected function setUp() + { + $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $this->model = $this->objectManager->create( + Text::class + ); + } + + /** + * Check if newline symbols are normalized in option value + * + * @dataProvider optionValueDataProvider + * @param array $productOptionData + * @param string $optionValue + * @param string $expectedOptionValue + */ + public function testNormalizeNewlineSymbols( + array $productOptionData, + string $optionValue, + string $expectedOptionValue + ) { + $productOption = $this->objectManager->create( + Option::class, + ['data' => $productOptionData] + ); + + $this->model->setOption($productOption); + $this->model->setUserValue($optionValue); + $this->model->validateUserValue([]); + + $this->assertSame($expectedOptionValue, $this->model->getUserValue()); + } + + /** + * Data provider for testNormalizeNewlineSymbols + * + * @return array + */ + public function optionValueDataProvider() + { + return [ + [ + // $productOptionData + ['id' => 11, 'type' => 'area'], + // $optionValue + 'string string', + // $expectedOptionValue + 'string string' + ], + [ + // $productOptionData + ['id' => 11, 'type' => 'area'], + // $optionValue + "string \r\n string", + // $expectedOptionValue + "string \n string" + ], + [ + // $productOptionData + ['id' => 11, 'type' => 'area'], + // $optionValue + "string \n\r string", + // $expectedOptionValue + "string \n string" + ], + [ + // $productOptionData + ['id' => 11, 'type' => 'area'], + // $optionValue + "string \r string", + // $expectedOptionValue + "string \n string" + ] + ]; + } +} From f59c1ca61e034a7973e0ac08ab765cbe4060ed84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Tylek?= <pawel.tylek@creativestyle.pl> Date: Fri, 13 Dec 2019 19:24:10 +0100 Subject: [PATCH 312/586] MAGETWO-95866 Add horizontal scroll if elements extend menu's width --- .../Magento_Backend/web/css/source/module/_menu.less | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/_menu.less b/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/_menu.less index d0b17b3439d66..4332ac93ffcd2 100644 --- a/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/_menu.less +++ b/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/_menu.less @@ -17,7 +17,7 @@ @menu-logo__padding-bottom: 1.7rem; @menu-logo__outer-size: @menu-logo__padding-top + @menu-logo-img__height + @menu-logo__padding-bottom; -@menu-logo__padding-top: 1.7rem; +@menu-logo__padding-top: 1.7rem; @menu-logo-img__height: 4.1rem; @menu-logo-img__width: 3.5rem; @@ -37,6 +37,7 @@ @submenu__padding-horizontal: 1.5rem; @submenu__padding-vertical: 2rem; @submenu__z-index: @menu__z-index - 2; +@submenu__height: 720px; @submenu-column__width: 23.8rem; @submenu-column__width__l: 19.8rem; @submenu-title__color: @color-white; @@ -252,7 +253,6 @@ background-color: @submenu__background-color; box-shadow: 0 0 3px @color-black; left: 100%; // align all submenus with one Y axis line - min-height: ~'calc(@{menu-logo__outer-size} + 2rem + 100%)'; padding: @submenu__padding-vertical 0 0; position: absolute; top: 0; @@ -266,6 +266,13 @@ .ie11 & { height: 100%; } + + > ul[role="menu"] { + max-width: ~'calc(100vw - @{menu__width})'; + min-height: @submenu__height; + overflow-y: hidden; + overflow-x: auto; + } } &._show { From 7a2bc8fe52e570cfec0201fa36c7118eaf26f6a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Tylek?= <pawel.tylek@creativestyle.pl> Date: Fri, 13 Dec 2019 20:19:48 +0100 Subject: [PATCH 313/586] MAGETWO-95866 Fix tests --- .../Magento_Backend/web/css/source/module/_menu.less | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/_menu.less b/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/_menu.less index 4332ac93ffcd2..c84a54efd5028 100644 --- a/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/_menu.less +++ b/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/_menu.less @@ -267,11 +267,11 @@ height: 100%; } - > ul[role="menu"] { - max-width: ~'calc(100vw - @{menu__width})'; - min-height: @submenu__height; - overflow-y: hidden; + > ul[role='menu'] { overflow-x: auto; + overflow-y: hidden; + max-width: ~'calc(100vw - @{menu__width})'; + min-height: @submenu__height; } } From 3c0b60a33e1bda64eb694ac278f11d2f750a4eb0 Mon Sep 17 00:00:00 2001 From: Krzysztof Daniel <krzysztof.daniel@creativestyle.pl> Date: Fri, 13 Dec 2019 23:26:51 +0100 Subject: [PATCH 314/586] Fixes phpcs errors and warnings for Magento\Framework\View\Element I was working with those classes and spotted a few warnings and errors that prevent from smooth pull requests. Here are most fixes. --- .../Framework/View/Element/ExceptionHandlerBlockFactory.php | 1 + lib/internal/Magento/Framework/View/Element/FormKey.php | 2 ++ lib/internal/Magento/Framework/View/Element/Js/Components.php | 2 ++ lib/internal/Magento/Framework/View/Element/Js/Cookie.php | 4 ++++ lib/internal/Magento/Framework/View/Element/RendererList.php | 2 ++ lib/internal/Magento/Framework/View/Element/Template.php | 2 ++ .../Magento/Framework/View/Element/Template/File/Resolver.php | 1 + .../Magento/Framework/View/Element/UiComponentInterface.php | 2 ++ 8 files changed, 16 insertions(+) diff --git a/lib/internal/Magento/Framework/View/Element/ExceptionHandlerBlockFactory.php b/lib/internal/Magento/Framework/View/Element/ExceptionHandlerBlockFactory.php index 83f7dda94328f..b1c74777fb102 100644 --- a/lib/internal/Magento/Framework/View/Element/ExceptionHandlerBlockFactory.php +++ b/lib/internal/Magento/Framework/View/Element/ExceptionHandlerBlockFactory.php @@ -7,6 +7,7 @@ /** * Class ExceptionHandlerBlockFactory + * * @package Magento\Framework\View\Element */ class ExceptionHandlerBlockFactory diff --git a/lib/internal/Magento/Framework/View/Element/FormKey.php b/lib/internal/Magento/Framework/View/Element/FormKey.php index 072ba42b34f1d..e6ecd20435ce8 100644 --- a/lib/internal/Magento/Framework/View/Element/FormKey.php +++ b/lib/internal/Magento/Framework/View/Element/FormKey.php @@ -10,6 +10,8 @@ namespace Magento\Framework\View\Element; /** + * Element with FormKey + * * @api */ class FormKey extends \Magento\Framework\View\Element\AbstractBlock diff --git a/lib/internal/Magento/Framework/View/Element/Js/Components.php b/lib/internal/Magento/Framework/View/Element/Js/Components.php index 3f9be417d62be..8e33ca5581960 100644 --- a/lib/internal/Magento/Framework/View/Element/Js/Components.php +++ b/lib/internal/Magento/Framework/View/Element/Js/Components.php @@ -9,6 +9,8 @@ use Magento\Framework\View\Element\Template; /** + * Block for Components + * * @api */ class Components extends Template diff --git a/lib/internal/Magento/Framework/View/Element/Js/Cookie.php b/lib/internal/Magento/Framework/View/Element/Js/Cookie.php index c44bad026ecac..b37a9387c07f6 100644 --- a/lib/internal/Magento/Framework/View/Element/Js/Cookie.php +++ b/lib/internal/Magento/Framework/View/Element/Js/Cookie.php @@ -10,6 +10,8 @@ use Magento\Framework\View\Element\Template\Context; /** + * Block passes configuration for cookies set by JS + * * @api */ class Cookie extends Template @@ -75,6 +77,8 @@ public function getPath() } /** + * Get configured cookie lifetime + * * @return int */ public function getLifetime() diff --git a/lib/internal/Magento/Framework/View/Element/RendererList.php b/lib/internal/Magento/Framework/View/Element/RendererList.php index 30bc38aed28f3..96707c74dd253 100644 --- a/lib/internal/Magento/Framework/View/Element/RendererList.php +++ b/lib/internal/Magento/Framework/View/Element/RendererList.php @@ -6,6 +6,8 @@ namespace Magento\Framework\View\Element; /** + * Renderer List + * * @api */ class RendererList extends AbstractBlock diff --git a/lib/internal/Magento/Framework/View/Element/Template.php b/lib/internal/Magento/Framework/View/Element/Template.php index a1aa599156d2a..99c876b440665 100644 --- a/lib/internal/Magento/Framework/View/Element/Template.php +++ b/lib/internal/Magento/Framework/View/Element/Template.php @@ -10,6 +10,7 @@ /** * Standard Magento block. + * * Should be used when you declare a block in frontend area layout handle. * * Avoid extending this class. @@ -166,6 +167,7 @@ public function setTemplateContext($templateContext) /** * Internal constructor, that is called from real constructor + * * @return void */ protected function _construct() diff --git a/lib/internal/Magento/Framework/View/Element/Template/File/Resolver.php b/lib/internal/Magento/Framework/View/Element/Template/File/Resolver.php index abad0eee856c3..b13caa55d3174 100644 --- a/lib/internal/Magento/Framework/View/Element/Template/File/Resolver.php +++ b/lib/internal/Magento/Framework/View/Element/Template/File/Resolver.php @@ -10,6 +10,7 @@ /** * Class Resolver + * * @package Magento\Framework\View\Element\Template\File */ class Resolver diff --git a/lib/internal/Magento/Framework/View/Element/UiComponentInterface.php b/lib/internal/Magento/Framework/View/Element/UiComponentInterface.php index b5c3546084fcb..3ae2627881101 100644 --- a/lib/internal/Magento/Framework/View/Element/UiComponentInterface.php +++ b/lib/internal/Magento/Framework/View/Element/UiComponentInterface.php @@ -52,6 +52,8 @@ public function render(); public function addComponent($name, UiComponentInterface $component); /** + * Get component + * * @param string $name * @return UiComponentInterface */ From 75532257cf22ede587602be75e70f5c0c8a9d490 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Sat, 14 Dec 2019 19:05:16 +0700 Subject: [PATCH 315/586] [Catalog] Cover Component/FilterFactory by Unit Test --- .../Unit/Ui/Component/FilterFactoryTest.php | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 app/code/Magento/Catalog/Test/Unit/Ui/Component/FilterFactoryTest.php diff --git a/app/code/Magento/Catalog/Test/Unit/Ui/Component/FilterFactoryTest.php b/app/code/Magento/Catalog/Test/Unit/Ui/Component/FilterFactoryTest.php new file mode 100644 index 0000000000000..545b9e7326ff1 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Unit/Ui/Component/FilterFactoryTest.php @@ -0,0 +1,100 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Test\Unit\Ui\Component; + +use PHPUnit\Framework\TestCase; +use Magento\Catalog\Ui\Component\FilterFactory; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use Magento\Framework\View\Element\UiComponentFactory; +use Magento\Catalog\Api\Data\ProductAttributeInterface; +use Magento\Eav\Model\Entity\Attribute\Source\SourceInterface; +use Magento\Framework\View\Element\UiComponent\ContextInterface; + +class FilterFactoryTest extends TestCase +{ + /** + * @var FilterFactory + */ + private $filterFactory; + + /** + * @var UiComponentFactory|\PHPUnit_Framework_MockObject_MockObject + */ + private $componentFactoryMock; + + /** + * Setup environment for test + */ + protected function setUp() + { + $objectManager = new ObjectManagerHelper($this); + + $this->componentFactoryMock = $this->createMock(UiComponentFactory::class); + + $this->filterFactory = $objectManager->getObject( + FilterFactory::class, + [ + 'componentFactory' => $this->componentFactoryMock + ] + ); + } + + /** + * Test create() with use source attribute + */ + public function testCreateWithUseSourceAttribute() + { + $contextMock = $this->createMock(ContextInterface::class); + $attributeMock = $this->getMockBuilder(ProductAttributeInterface::class) + ->setMethods(['usesSource', 'getSource']) + ->getMockForAbstractClass(); + $attributeMock->method('getAttributeCode')->willReturn('color'); + $attributeMock->method('getDefaultFrontendLabel')->willReturn('Color'); + $attributeMock->method('usesSource')->willReturn(true); + $attributeMock->method('getSourceModel')->willReturn('getSourceModel value'); + $attributeMock->method('getFrontendInput')->willReturn('select'); + $sourceMock = $this->createMock(SourceInterface::class); + $attributeMock->method('getSource')->willReturn($sourceMock); + $sourceMock->method('getAllOptions')->willReturn( + [ + [ + 'value' => 1, + 'label' => 'Black', + ], + [ + 'value' => 2, + 'label' => 'White', + ] + ] + ); + $this->componentFactoryMock->expects($this->once()) + ->method('create') + ->with('color', 'filterSelect', [ + 'data' => [ + 'config' => [ + 'options' => [ + [ + 'value' => 1, + 'label' => 'Black', + ], + [ + 'value' => 2, + 'label' => 'White', + ] + ], + 'caption' => (string)__('Select...'), + 'dataScope' => 'color', + 'label' => (string)__('Color'), + ] + ], + 'context' => $contextMock + ]); + + $this->filterFactory->create($attributeMock, $contextMock); + } +} From ad48079535d018ddab62d7f1313d93a4268f859f Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Sat, 14 Dec 2019 20:11:23 +0700 Subject: [PATCH 316/586] [Persistent] Cover CustomerData by Unit Test --- .../Test/Unit/CustomerData/PersistentTest.php | 109 ++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php diff --git a/app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php b/app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php new file mode 100644 index 0000000000000..381555ed0fe79 --- /dev/null +++ b/app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php @@ -0,0 +1,109 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Persistent\Test\Unit\CustomerData; + +use PHPUnit\Framework\TestCase; +use Magento\Persistent\CustomerData\Persistent; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Helper\View; +use Magento\Persistent\Helper\Session; +use Magento\Persistent\Model\Session as PersistentSession; +use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; + +class PersistentTest extends TestCase +{ + /** + * @var Persistent + */ + private $customerData; + + /** + * @var Session + */ + private $persistentSessionHelperMock; + + /** + * @var View + */ + private $customerViewHelperMock; + + /** + * @var CustomerRepositoryInterface + */ + private $customerRepositoryMock; + + /** + * Setup environment for test + */ + protected function setUp() + { + $this->persistentSessionHelperMock = $this->createMock(Session::class); + $this->customerViewHelperMock = $this->createMock(View::class); + $this->customerRepositoryMock = $this->createMock(CustomerRepositoryInterface::class); + + $objectManager = new ObjectManagerHelper($this); + + $this->customerData = $objectManager->getObject( + Persistent::class, + [ + 'persistentSession' => $this->persistentSessionHelperMock, + 'customerViewHelper' => $this->customerViewHelperMock, + 'customerRepository' => $this->customerRepositoryMock + ] + ); + } + + /** + * Test getSectionData() when disable persistent + */ + public function testGetSectionDataWhenDisablePersistent() + { + $this->persistentSessionHelperMock->method('isPersistent')->willReturn(false); + + $this->assertEquals([], $this->customerData->getSectionData()); + } + + /** + * Test getSectionData() when customer doesn't login + */ + public function testGetSectionDataWithNotLogin() + { + $this->persistentSessionHelperMock->method('isPersistent')->willReturn(true); + + $persistentSessionMock = $this->createPartialMock(PersistentSession::class, ['getCustomerId']); + $persistentSessionMock->method('getCustomerId')->willReturn(null); + $this->persistentSessionHelperMock->method('getSession')->willReturn($persistentSessionMock); + + $this->assertEquals([], $this->customerData->getSectionData()); + } + + /** + * Test getSectionData() when customer login and enable persistent + */ + public function testGetSectionDataCustomerLoginAndEnablePersistent() + { + $this->persistentSessionHelperMock->method('isPersistent')->willReturn(true); + + $persistentSessionMock = $this->createPartialMock(PersistentSession::class, ['getCustomerId']); + $persistentSessionMock->method('getCustomerId')->willReturn(1); + $this->persistentSessionHelperMock->method('getSession')->willReturn($persistentSessionMock); + + $customerMock = $this->createMock(CustomerInterface::class); + $this->customerRepositoryMock->method('getById')->with(1)->willReturn($customerMock); + $this->customerViewHelperMock->method('getCustomerName')->with($customerMock)->willReturn('Adam John'); + + $this->assertEquals( + [ + 'fullname' => 'Adam John' + ], + $this->customerData->getSectionData() + ); + } +} From 1c699b25db84b0690888ee85f145bd336607d672 Mon Sep 17 00:00:00 2001 From: Eden Duong <quocviet312@gmail.com> Date: Sat, 14 Dec 2019 20:25:24 +0700 Subject: [PATCH 317/586] Update phpdocs --- .../Persistent/Test/Unit/CustomerData/PersistentTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php b/app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php index 381555ed0fe79..16df8181a0e61 100644 --- a/app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php +++ b/app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php @@ -25,17 +25,17 @@ class PersistentTest extends TestCase private $customerData; /** - * @var Session + * @var Session|\PHPUnit_Framework_MockObject_MockObject */ private $persistentSessionHelperMock; /** - * @var View + * @var View|\PHPUnit_Framework_MockObject_MockObject */ private $customerViewHelperMock; /** - * @var CustomerRepositoryInterface + * @var CustomerRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject */ private $customerRepositoryMock; From fc04d190a098796680070a338d2b8124e117feb9 Mon Sep 17 00:00:00 2001 From: Giancarlo Peris <gperis93@gmail.com> Date: Sat, 14 Dec 2019 13:53:57 +0000 Subject: [PATCH 318/586] Initialise value as empty when color picker input is reset so the preview gets updated --- .../view/base/web/js/lib/knockout/bindings/color-picker.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/color-picker.js b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/color-picker.js index c678b85276093..1e8e89894d22f 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/color-picker.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/color-picker.js @@ -71,6 +71,11 @@ define([ update: function (element, valueAccessor, allBindings, viewModel) { var config = valueAccessor(); + /** Initialise value as empty if it is undefined when color picker input is reset **/ + if (config.value() === undefined) { + config.value(''); + } + if (tinycolor(config.value()).isValid() || config.value() === '') { $(element).spectrum('set', config.value()); From e704d62ef2af5b2bcbb31574c9b8bee8874c90e1 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Sat, 14 Dec 2019 21:06:18 +0700 Subject: [PATCH 319/586] [Downloadable] Cover Helper Data by Unit Test --- .../Test/Unit/Helper/DataTest.php | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 app/code/Magento/Downloadable/Test/Unit/Helper/DataTest.php diff --git a/app/code/Magento/Downloadable/Test/Unit/Helper/DataTest.php b/app/code/Magento/Downloadable/Test/Unit/Helper/DataTest.php new file mode 100644 index 0000000000000..7c59ef7d7ec64 --- /dev/null +++ b/app/code/Magento/Downloadable/Test/Unit/Helper/DataTest.php @@ -0,0 +1,86 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Downloadable\Test\Unit\Helper; + +use Magento\Downloadable\Model\Link; +use Magento\Store\Model\ScopeInterface; +use PHPUnit\Framework\TestCase; +use Magento\Downloadable\Helper\Data; +use Magento\Framework\App\Helper\Context; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; + +class DataTest extends TestCase +{ + /** + * @var Data + */ + private $helper; + + /** + * @var ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $scopeConfigMock; + + /** + * @var Context|\PHPUnit_Framework_MockObject_MockObject + */ + private $contextMock; + + /** + * Setup environment for test + */ + protected function setUp() + { + $this->scopeConfigMock = $this->createMock(ScopeConfigInterface::class); + $this->contextMock = $this->createMock(Context::class); + $this->contextMock->method('getScopeConfig')->willReturn($this->scopeConfigMock); + + $objectManager = new ObjectManagerHelper($this); + $this->helper = $objectManager->getObject( + Data::class, + ['context' => $this->contextMock] + ); + } + + /** + * Test getIsShareable() with data provider + * + * @param int $linkShareable + * @param bool $config + * @param bool $expectedResult + * @dataProvider getIsShareableDataProvider + */ + public function testGetIsShareable($linkShareable, $config, $expectedResult) + { + $this->scopeConfigMock->method('isSetFlag') + ->with(Link::XML_PATH_CONFIG_IS_SHAREABLE, ScopeInterface::SCOPE_STORE) + ->willReturn($config); + + $linkMock = $this->createMock(Link::class); + $linkMock->method('getIsShareable')->willReturn($linkShareable); + + $this->assertEquals($expectedResult, $this->helper->getIsShareable($linkMock)); + } + + /** + * Data provider for getIsShareable() + * + * @return array + */ + public function getIsShareableDataProvider() + { + return [ + 'link shareable yes' => [Link::LINK_SHAREABLE_YES, true, true], + 'link shareable no' => [Link::LINK_SHAREABLE_NO, true, false], + 'link shareable config true' => [Link::LINK_SHAREABLE_CONFIG, true, true], + 'link shareable config false' => [Link::LINK_SHAREABLE_CONFIG, false, false], + ]; + } +} From 179b85415038d327b29e6e2f390d7e35820ed5d8 Mon Sep 17 00:00:00 2001 From: pawankparmar <comp1@comp1-All-Series> Date: Sat, 14 Dec 2019 22:31:04 +0530 Subject: [PATCH 320/586] spelling fix and put space --- .../Api/Data/ProductRender/FormattedPriceInfoInterface.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Api/Data/ProductRender/FormattedPriceInfoInterface.php b/app/code/Magento/Catalog/Api/Data/ProductRender/FormattedPriceInfoInterface.php index 43e0de4f20176..65ff84ef719f0 100644 --- a/app/code/Magento/Catalog/Api/Data/ProductRender/FormattedPriceInfoInterface.php +++ b/app/code/Magento/Catalog/Api/Data/ProductRender/FormattedPriceInfoInterface.php @@ -66,7 +66,7 @@ public function getMinimalPrice(); /** * Set max regular price - * Max regular price is the same, as maximum price, except of excluding calculating special price and catalogules + * Max regular price is the same, as maximum price, except of excluding calculating special price and catalog rules * in it * * @param string $maxRegularPrice From f075d4e4120dc833867a3ddc047804b8e1ea9070 Mon Sep 17 00:00:00 2001 From: Sathish <srsathish92@gmail.com> Date: Sun, 15 Dec 2019 01:23:06 +0530 Subject: [PATCH 321/586] [Catalog] cover ViewModel AddToCompareAvailability by Unit Test --- .../Checker/AddToCompareAvailabilityTest.php | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php diff --git a/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php b/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php new file mode 100644 index 0000000000000..4295b11a58077 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php @@ -0,0 +1,118 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Catalog\Test\Unit\ViewModel\Product\Checker; + +use Magento\Catalog\ViewModel\Product\Checker\AddToCompareAvailability; +use Magento\CatalogInventory\Api\StockConfigurationInterface; +use Magento\Catalog\Model\Product; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use PHPUnit\Framework\MockObject\MockObject; + +/** + * Unit test for Magento\Catalog\ViewModel\Product\Checker\AddToCompareAvailability. + */ +class AddToCompareAvailabilityTest extends \PHPUnit\Framework\TestCase +{ + + /** + * @var AddToCompareAvailability + */ + private $viewModel; + + /** + * @var StockConfigurationInterface|MockObject + */ + protected $stockConfiguration; + + /** + * @var ObjectManager + */ + private $objectManager; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + + $this->stockConfiguration = + $this->getMockBuilder(StockConfigurationInterface::class) + ->getMock(); + + $this->viewModel = $this->getObjectManager()->getObject( + AddToCompareAvailability::class, + [ + 'stockConfiguration' => $this->stockConfiguration + ] + ); + } + + /** + * Test IsAvailableForCompare() with data provider + * + * @param bool $status + * @param bool $isSalable + * @param array $isInStock + * @param bool $isShowOutOfStock + * @return boolean + * @dataProvider isAvailableForCompareDataProvider + */ + public function testIsAvailableForCompare($status, $isSalable, $isInStock, $isShowOutOfStock): bool + { + $productMock = $this->getMockBuilder(Product::class) + ->disableOriginalConstructor() + ->getMock(); + + $productMock->expects($this->once()) + ->method('getStatus') + ->willReturn($status); + + $productMock->expects($this->any()) + ->method('isSalable') + ->willReturn($isSalable); + + $productMock->expects($this->any()) + ->method('getQuantityAndStockStatus') + ->willReturn($isInStock); + + $this->stockConfiguration->expects($this->any()) + ->method('isShowOutOfStock') + ->willReturn($isShowOutOfStock); + + return $this->viewModel->isAvailableForCompare($productMock); + } + + /** + * Data provider for isAvailableForCompare() + * + * @return array + */ + public function isAvailableForCompareDataProvider(): array + { + return [ + [1, true, ['is_in_stock' => true], false], + [1, true, ['is_in_stock' => false], true], + [1, true, [], false], + [1, false, [], false], + [2, true, ['is_in_stock' => true], false] + ]; + } + + /** + * @return ObjectManager + */ + private function getObjectManager(): ObjectManager + { + if (null === $this->objectManager) { + $this->objectManager = new ObjectManager($this); + } + + return $this->objectManager; + } +} From 0b806f9cf6d4f1cf89a294d18c552cc3eaa9c2ad Mon Sep 17 00:00:00 2001 From: Sathish <srsathish92@gmail.com> Date: Sun, 15 Dec 2019 02:19:06 +0530 Subject: [PATCH 322/586] Fixed the static tests & feedbacks --- .../Checker/AddToCompareAvailabilityTest.php | 33 +++++-------------- 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php b/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php index 4295b11a58077..88dba7ebee1c6 100644 --- a/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php +++ b/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php @@ -26,14 +26,9 @@ class AddToCompareAvailabilityTest extends \PHPUnit\Framework\TestCase private $viewModel; /** - * @var StockConfigurationInterface|MockObject + * @var StockConfigurationInterface|MockObject */ - protected $stockConfiguration; - - /** - * @var ObjectManager - */ - private $objectManager; + protected $stockConfigurationMock; /** * @inheritdoc @@ -41,14 +36,16 @@ class AddToCompareAvailabilityTest extends \PHPUnit\Framework\TestCase protected function setUp(): void { - $this->stockConfiguration = + $objectManager = new ObjectManager($this); + + $this->stockConfigurationMock = $this->getMockBuilder(StockConfigurationInterface::class) ->getMock(); - $this->viewModel = $this->getObjectManager()->getObject( + $this->viewModel = $objectManager->getObject( AddToCompareAvailability::class, [ - 'stockConfiguration' => $this->stockConfiguration + 'stockConfiguration' => $this->stockConfigurationMock ] ); } @@ -81,7 +78,7 @@ public function testIsAvailableForCompare($status, $isSalable, $isInStock, $isSh ->method('getQuantityAndStockStatus') ->willReturn($isInStock); - $this->stockConfiguration->expects($this->any()) + $this->stockConfigurationMock->expects($this->any()) ->method('isShowOutOfStock') ->willReturn($isShowOutOfStock); @@ -90,7 +87,7 @@ public function testIsAvailableForCompare($status, $isSalable, $isInStock, $isSh /** * Data provider for isAvailableForCompare() - * + * * @return array */ public function isAvailableForCompareDataProvider(): array @@ -103,16 +100,4 @@ public function isAvailableForCompareDataProvider(): array [2, true, ['is_in_stock' => true], false] ]; } - - /** - * @return ObjectManager - */ - private function getObjectManager(): ObjectManager - { - if (null === $this->objectManager) { - $this->objectManager = new ObjectManager($this); - } - - return $this->objectManager; - } } From 97fe3ffe0b0e891284301f7ef749ee96391ea013 Mon Sep 17 00:00:00 2001 From: Sathish <srsathish92@gmail.com> Date: Sun, 15 Dec 2019 03:08:39 +0530 Subject: [PATCH 323/586] Assert added with expected results --- .../Checker/AddToCompareAvailabilityTest.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php b/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php index 88dba7ebee1c6..1b743d26a4297 100644 --- a/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php +++ b/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php @@ -57,10 +57,11 @@ protected function setUp(): void * @param bool $isSalable * @param array $isInStock * @param bool $isShowOutOfStock - * @return boolean + * @param bool $expectedBool + * @return void * @dataProvider isAvailableForCompareDataProvider */ - public function testIsAvailableForCompare($status, $isSalable, $isInStock, $isShowOutOfStock): bool + public function testIsAvailableForCompare($status, $isSalable, $isInStock, $isShowOutOfStock, $expectedBool): void { $productMock = $this->getMockBuilder(Product::class) ->disableOriginalConstructor() @@ -82,7 +83,7 @@ public function testIsAvailableForCompare($status, $isSalable, $isInStock, $isSh ->method('isShowOutOfStock') ->willReturn($isShowOutOfStock); - return $this->viewModel->isAvailableForCompare($productMock); + $this->assertEquals($expectedBool, $this->viewModel->isAvailableForCompare($productMock)); } /** @@ -93,11 +94,11 @@ public function testIsAvailableForCompare($status, $isSalable, $isInStock, $isSh public function isAvailableForCompareDataProvider(): array { return [ - [1, true, ['is_in_stock' => true], false], - [1, true, ['is_in_stock' => false], true], - [1, true, [], false], - [1, false, [], false], - [2, true, ['is_in_stock' => true], false] + [1, true, ['is_in_stock' => true], false, true], + [1, true, ['is_in_stock' => false], true, true], + [1, true, [], false, true], + [1, false, [], false, false], + [2, true, ['is_in_stock' => true], false, false] ]; } } From 5cedaf8e26fe72b7335058be87ab2b1a39977382 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Sun, 15 Dec 2019 05:44:47 +0700 Subject: [PATCH 324/586] Refactor code --- .../Test/Unit/CustomerData/PersistentTest.php | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php b/app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php index 381555ed0fe79..15889a74439d7 100644 --- a/app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php +++ b/app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php @@ -16,26 +16,37 @@ use Magento\Persistent\Model\Session as PersistentSession; use Magento\Customer\Api\Data\CustomerInterface; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use PHPUnit\Framework\MockObject\MockObject; class PersistentTest extends TestCase { + /** + * Stub customer id + */ + private const STUB_CUSTOMER_ID = 1; + + /** + * Stub customer name + */ + private const STUB_CUSTOMER_NAME = 'Adam John'; + /** * @var Persistent */ private $customerData; /** - * @var Session + * @var Session|MockObject */ private $persistentSessionHelperMock; /** - * @var View + * @var View|MockObject */ private $customerViewHelperMock; /** - * @var CustomerRepositoryInterface + * @var CustomerRepositoryInterface|MockObject */ private $customerRepositoryMock; @@ -73,7 +84,7 @@ public function testGetSectionDataWhenDisablePersistent() /** * Test getSectionData() when customer doesn't login */ - public function testGetSectionDataWithNotLogin() + public function testGetSectionDataWhenCustomerNotLoggedInReturnsEmptyArray() { $this->persistentSessionHelperMock->method('isPersistent')->willReturn(true); @@ -92,16 +103,17 @@ public function testGetSectionDataCustomerLoginAndEnablePersistent() $this->persistentSessionHelperMock->method('isPersistent')->willReturn(true); $persistentSessionMock = $this->createPartialMock(PersistentSession::class, ['getCustomerId']); - $persistentSessionMock->method('getCustomerId')->willReturn(1); + $persistentSessionMock->method('getCustomerId')->willReturn(self::STUB_CUSTOMER_ID); $this->persistentSessionHelperMock->method('getSession')->willReturn($persistentSessionMock); $customerMock = $this->createMock(CustomerInterface::class); $this->customerRepositoryMock->method('getById')->with(1)->willReturn($customerMock); - $this->customerViewHelperMock->method('getCustomerName')->with($customerMock)->willReturn('Adam John'); + $this->customerViewHelperMock->method('getCustomerName')->with($customerMock) + ->willReturn(self::STUB_CUSTOMER_NAME); $this->assertEquals( [ - 'fullname' => 'Adam John' + 'fullname' => self::STUB_CUSTOMER_NAME ], $this->customerData->getSectionData() ); From bbfdb089bb5cbd7b61882896984ad87bea62deee Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Sun, 15 Dec 2019 06:02:50 +0700 Subject: [PATCH 325/586] Refactor code --- .../Unit/Ui/Component/FilterFactoryTest.php | 73 ++++++++++--------- 1 file changed, 38 insertions(+), 35 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Unit/Ui/Component/FilterFactoryTest.php b/app/code/Magento/Catalog/Test/Unit/Ui/Component/FilterFactoryTest.php index 545b9e7326ff1..4b43a41c42fad 100644 --- a/app/code/Magento/Catalog/Test/Unit/Ui/Component/FilterFactoryTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Ui/Component/FilterFactoryTest.php @@ -7,23 +7,45 @@ namespace Magento\Catalog\Test\Unit\Ui\Component; -use PHPUnit\Framework\TestCase; -use Magento\Catalog\Ui\Component\FilterFactory; -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; -use Magento\Framework\View\Element\UiComponentFactory; use Magento\Catalog\Api\Data\ProductAttributeInterface; +use Magento\Catalog\Ui\Component\FilterFactory; use Magento\Eav\Model\Entity\Attribute\Source\SourceInterface; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use Magento\Framework\View\Element\UiComponent\ContextInterface; +use Magento\Framework\View\Element\UiComponentFactory; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; class FilterFactoryTest extends TestCase { + /** + * Stub attribute + */ + private const STUB_ATTRIBUTE = [ + 'attribute_code' => 'color', + 'default_frontend_label' => 'Color', + 'uses_source' => 'Color', + 'source_model' => 'getSourceModel value', + 'frontend_input' => 'select', + 'all_options' => [ + [ + 'value' => 1, + 'label' => 'Black', + ], + [ + 'value' => 2, + 'label' => 'White', + ] + ] + ]; + /** * @var FilterFactory */ private $filterFactory; /** - * @var UiComponentFactory|\PHPUnit_Framework_MockObject_MockObject + * @var UiComponentFactory|MockObject */ private $componentFactoryMock; @@ -32,7 +54,7 @@ class FilterFactoryTest extends TestCase */ protected function setUp() { - $objectManager = new ObjectManagerHelper($this); + $objectManager = new ObjectManager($this); $this->componentFactoryMock = $this->createMock(UiComponentFactory::class); @@ -53,43 +75,24 @@ public function testCreateWithUseSourceAttribute() $attributeMock = $this->getMockBuilder(ProductAttributeInterface::class) ->setMethods(['usesSource', 'getSource']) ->getMockForAbstractClass(); - $attributeMock->method('getAttributeCode')->willReturn('color'); - $attributeMock->method('getDefaultFrontendLabel')->willReturn('Color'); - $attributeMock->method('usesSource')->willReturn(true); - $attributeMock->method('getSourceModel')->willReturn('getSourceModel value'); - $attributeMock->method('getFrontendInput')->willReturn('select'); + $attributeMock->method('getAttributeCode')->willReturn(self::STUB_ATTRIBUTE['attribute_code']); + $attributeMock->method('getDefaultFrontendLabel') + ->willReturn(self::STUB_ATTRIBUTE['default_frontend_label']); + $attributeMock->method('usesSource')->willReturn(self::STUB_ATTRIBUTE['uses_source']); + $attributeMock->method('getSourceModel')->willReturn(self::STUB_ATTRIBUTE['source_model']); + $attributeMock->method('getFrontendInput')->willReturn(self::STUB_ATTRIBUTE['frontend_input']); $sourceMock = $this->createMock(SourceInterface::class); $attributeMock->method('getSource')->willReturn($sourceMock); - $sourceMock->method('getAllOptions')->willReturn( - [ - [ - 'value' => 1, - 'label' => 'Black', - ], - [ - 'value' => 2, - 'label' => 'White', - ] - ] - ); + $sourceMock->method('getAllOptions')->willReturn(self::STUB_ATTRIBUTE['all_options']); $this->componentFactoryMock->expects($this->once()) ->method('create') ->with('color', 'filterSelect', [ 'data' => [ 'config' => [ - 'options' => [ - [ - 'value' => 1, - 'label' => 'Black', - ], - [ - 'value' => 2, - 'label' => 'White', - ] - ], + 'options' => self::STUB_ATTRIBUTE['all_options'], 'caption' => (string)__('Select...'), - 'dataScope' => 'color', - 'label' => (string)__('Color'), + 'dataScope' => self::STUB_ATTRIBUTE['attribute_code'], + 'label' => (string)__(self::STUB_ATTRIBUTE['default_frontend_label']), ] ], 'context' => $contextMock From 78ba90500058250770676f3c60c826a23f1de366 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Sun, 15 Dec 2019 06:03:36 +0700 Subject: [PATCH 326/586] optimize import --- .../Persistent/Test/Unit/CustomerData/PersistentTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php b/app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php index 15889a74439d7..7120474ba0eee 100644 --- a/app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php +++ b/app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php @@ -8,15 +8,15 @@ namespace Magento\Persistent\Test\Unit\CustomerData; -use PHPUnit\Framework\TestCase; -use Magento\Persistent\CustomerData\Persistent; use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\CustomerInterface; use Magento\Customer\Helper\View; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use Magento\Persistent\CustomerData\Persistent; use Magento\Persistent\Helper\Session; use Magento\Persistent\Model\Session as PersistentSession; -use Magento\Customer\Api\Data\CustomerInterface; -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; class PersistentTest extends TestCase { From 50b006e1cfbb59d84914e8b7dd9d81afaf22cf01 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Sun, 15 Dec 2019 06:35:16 +0700 Subject: [PATCH 327/586] refactor code --- .../Persistent/Test/Unit/CustomerData/PersistentTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php b/app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php index 7120474ba0eee..a95f5530bb800 100644 --- a/app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php +++ b/app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php @@ -107,7 +107,7 @@ public function testGetSectionDataCustomerLoginAndEnablePersistent() $this->persistentSessionHelperMock->method('getSession')->willReturn($persistentSessionMock); $customerMock = $this->createMock(CustomerInterface::class); - $this->customerRepositoryMock->method('getById')->with(1)->willReturn($customerMock); + $this->customerRepositoryMock->method('getById')->with(self::STUB_CUSTOMER_ID)->willReturn($customerMock); $this->customerViewHelperMock->method('getCustomerName')->with($customerMock) ->willReturn(self::STUB_CUSTOMER_NAME); From 888ad592a5995e189783a20bf855d8b979338324 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Sun, 15 Dec 2019 07:12:55 +0700 Subject: [PATCH 328/586] refactor code --- .../Catalog/Test/Unit/Ui/Component/FilterFactoryTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Unit/Ui/Component/FilterFactoryTest.php b/app/code/Magento/Catalog/Test/Unit/Ui/Component/FilterFactoryTest.php index 4b43a41c42fad..e19284447c07d 100644 --- a/app/code/Magento/Catalog/Test/Unit/Ui/Component/FilterFactoryTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Ui/Component/FilterFactoryTest.php @@ -92,7 +92,7 @@ public function testCreateWithUseSourceAttribute() 'options' => self::STUB_ATTRIBUTE['all_options'], 'caption' => (string)__('Select...'), 'dataScope' => self::STUB_ATTRIBUTE['attribute_code'], - 'label' => (string)__(self::STUB_ATTRIBUTE['default_frontend_label']), + 'label' => self::STUB_ATTRIBUTE['default_frontend_label'], ] ], 'context' => $contextMock From 9e042b677e1d6e7af4efa2958697a4088b63400e Mon Sep 17 00:00:00 2001 From: Sathish <srsathish92@gmail.com> Date: Sun, 15 Dec 2019 06:37:41 +0530 Subject: [PATCH 329/586] Magic numbers replaced with class --- .../Product/Checker/AddToCompareAvailabilityTest.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php b/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php index 1b743d26a4297..682f652339820 100644 --- a/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php +++ b/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php @@ -11,6 +11,7 @@ use Magento\Catalog\ViewModel\Product\Checker\AddToCompareAvailability; use Magento\CatalogInventory\Api\StockConfigurationInterface; use Magento\Catalog\Model\Product; +use \Magento\Catalog\Model\Product\Attribute\Source\Status; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use PHPUnit\Framework\MockObject\MockObject; @@ -94,11 +95,11 @@ public function testIsAvailableForCompare($status, $isSalable, $isInStock, $isSh public function isAvailableForCompareDataProvider(): array { return [ - [1, true, ['is_in_stock' => true], false, true], - [1, true, ['is_in_stock' => false], true, true], - [1, true, [], false, true], - [1, false, [], false, false], - [2, true, ['is_in_stock' => true], false, false] + [Status::STATUS_ENABLED, true, ['is_in_stock' => true], false, true], + [Status::STATUS_ENABLED, true, ['is_in_stock' => false], true, true], + [Status::STATUS_ENABLED, true, [], false, true], + [Status::STATUS_ENABLED, false, [], false, false], + [Status::STATUS_DISABLED, true, ['is_in_stock' => true], false, false] ]; } } From a308d4add176b1250d19f8dec6abad9b655333e1 Mon Sep 17 00:00:00 2001 From: Sathish <srsathish92@gmail.com> Date: Sun, 15 Dec 2019 06:40:07 +0530 Subject: [PATCH 330/586] Magic numbers replaced with class --- .../ViewModel/Product/Checker/AddToCompareAvailabilityTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php b/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php index 682f652339820..55bfbe8b4ec71 100644 --- a/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php +++ b/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php @@ -11,7 +11,7 @@ use Magento\Catalog\ViewModel\Product\Checker\AddToCompareAvailability; use Magento\CatalogInventory\Api\StockConfigurationInterface; use Magento\Catalog\Model\Product; -use \Magento\Catalog\Model\Product\Attribute\Source\Status; +use Magento\Catalog\Model\Product\Attribute\Source\Status; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use PHPUnit\Framework\MockObject\MockObject; From 0a1ae3b37f3c1b937a2000f6f7f45205a3d32145 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Sun, 15 Dec 2019 11:30:51 +0700 Subject: [PATCH 331/586] Refactor filter factory test --- .../Catalog/Test/Unit/Ui/Component/FilterFactoryTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Unit/Ui/Component/FilterFactoryTest.php b/app/code/Magento/Catalog/Test/Unit/Ui/Component/FilterFactoryTest.php index e19284447c07d..1e72b7ba35864 100644 --- a/app/code/Magento/Catalog/Test/Unit/Ui/Component/FilterFactoryTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Ui/Component/FilterFactoryTest.php @@ -86,7 +86,7 @@ public function testCreateWithUseSourceAttribute() $sourceMock->method('getAllOptions')->willReturn(self::STUB_ATTRIBUTE['all_options']); $this->componentFactoryMock->expects($this->once()) ->method('create') - ->with('color', 'filterSelect', [ + ->with(self::STUB_ATTRIBUTE['attribute_code'], 'filterSelect', [ 'data' => [ 'config' => [ 'options' => self::STUB_ATTRIBUTE['all_options'], From 56bf55ed2975af90f2daf646eee540f043831a99 Mon Sep 17 00:00:00 2001 From: Sathish <srsathish92@gmail.com> Date: Mon, 16 Dec 2019 01:16:57 +0530 Subject: [PATCH 332/586] [Contact] covered Model Config by Unit Test --- .../Contact/Test/Unit/Model/ConfigTest.php | 127 ++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 app/code/Magento/Contact/Test/Unit/Model/ConfigTest.php diff --git a/app/code/Magento/Contact/Test/Unit/Model/ConfigTest.php b/app/code/Magento/Contact/Test/Unit/Model/ConfigTest.php new file mode 100644 index 0000000000000..56351bae87698 --- /dev/null +++ b/app/code/Magento/Contact/Test/Unit/Model/ConfigTest.php @@ -0,0 +1,127 @@ +<?php + +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Contact\Test\Unit\Model; + +use Magento\Contact\Model\Config; +use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\MockObject\MockObject; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Store\Model\ScopeInterface; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; + +/** + * Unit test for Magento\Contact\Model\Config + */ +class ConfigTest extends TestCase +{ + /** + * @var Config + */ + private $model; + + /** + * @var ScopeConfigInterface|MockObject + */ + private $scopeConfigMock; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + $this->scopeConfigMock = $this->getMockBuilder(ScopeConfigInterface::class) + ->setMethods(['getValue', 'isSetFlag']) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $objectManager = new ObjectManagerHelper($this); + $this->model = $objectManager->getObject( + Config::class, + [ + 'scopeConfig' => $this->scopeConfigMock + ] + ); + } + + /** + * Test isEnabled() + * + * @return void + */ + public function testIsEnabled(): void + { + $this->scopeConfigMock->expects($this->once()) + ->method('isSetFlag') + ->with(config::XML_PATH_ENABLED, ScopeInterface::SCOPE_STORE) + ->willReturn(true); + + $this->assertTrue(true, $this->model->isEnabled()); + } + + /** + * Test isNotEnabled() + * + * @return void + */ + public function testIsNotEnabled(): void + { + $this->scopeConfigMock->expects($this->once()) + ->method('isSetFlag') + ->with(config::XML_PATH_ENABLED, ScopeInterface::SCOPE_STORE) + ->willReturn(false); + + $this->assertFalse(false, $this->model->isEnabled()); + } + + /** + * Test emailTemplate() + * + * @return void + */ + public function testEmailTemplate(): void + { + $this->scopeConfigMock->expects($this->once()) + ->method('getValue') + ->with(config::XML_PATH_EMAIL_TEMPLATE, ScopeInterface::SCOPE_STORE) + ->willReturn('contact_email_email_template'); + + $this->assertEquals('contact_email_email_template', $this->model->emailTemplate()); + } + + /** + * Test emailSender() + * + * @return void + */ + public function testEmailSender(): void + { + $this->scopeConfigMock->expects($this->once()) + ->method('getValue') + ->with(config::XML_PATH_EMAIL_SENDER, ScopeInterface::SCOPE_STORE) + ->willReturn('custom2'); + + $this->assertEquals('custom2', $this->model->emailSender()); + } + + /** + * Test emailRecipient() + * + * @return void + */ + public function testEmailRecipient(): void + { + $this->scopeConfigMock->expects($this->once()) + ->method('getValue') + ->with(config::XML_PATH_EMAIL_RECIPIENT, ScopeInterface::SCOPE_STORE) + ->willReturn('hello@example.com'); + + $this->assertEquals('hello@example.com', $this->model->emailRecipient()); + } +} From 929a2c4edcf79242ca4cbdebe8bdaa019f4d8257 Mon Sep 17 00:00:00 2001 From: Matheus Gontijo <matheus@matheusgontijo.com> Date: Sun, 15 Dec 2019 17:24:11 -0300 Subject: [PATCH 333/586] fixed typo: "reviwGrid" to "reviewGrid" --- app/code/Magento/Review/Block/Adminhtml/Grid.php | 2 +- .../Review/Test/Mftf/Section/AdminReviewGridSection.xml | 8 ++++---- .../Test/Block/Adminhtml/Customer/Edit/Tab/Reviews.php | 2 +- .../app/Magento/Review/Test/Block/Adminhtml/Grid.php | 2 +- .../Magento/Review/Test/Page/Adminhtml/ReviewIndex.xml | 2 +- .../Magento/Customer/Controller/Adminhtml/IndexTest.php | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/Review/Block/Adminhtml/Grid.php b/app/code/Magento/Review/Block/Adminhtml/Grid.php index 02477bb89610f..e20cb7554e094 100644 --- a/app/code/Magento/Review/Block/Adminhtml/Grid.php +++ b/app/code/Magento/Review/Block/Adminhtml/Grid.php @@ -90,7 +90,7 @@ public function __construct( protected function _construct() { parent::_construct(); - $this->setId('reviwGrid'); + $this->setId('reviewGrid'); $this->setDefaultSort('created_at'); } diff --git a/app/code/Magento/Review/Test/Mftf/Section/AdminReviewGridSection.xml b/app/code/Magento/Review/Test/Mftf/Section/AdminReviewGridSection.xml index 2c5588cf2645b..981de91f357cb 100644 --- a/app/code/Magento/Review/Test/Mftf/Section/AdminReviewGridSection.xml +++ b/app/code/Magento/Review/Test/Mftf/Section/AdminReviewGridSection.xml @@ -9,11 +9,11 @@ <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminReviewGridSection"> - <element name="nickname" type="input" selector="#reviwGrid_filter_nickname"/> - <element name="status" type="select" selector="#reviwGrid_filter_status"/> + <element name="nickname" type="input" selector="#reviewGrid_filter_nickname"/> + <element name="status" type="select" selector="#reviewGrid_filter_status"/> <element name="firstRow" type="block" selector=".data-grid tbody tr:nth-of-type(1)"/> - <element name="massActions" type="button" selector="#reviwGrid_massaction-mass-select"/> - <element name="massActionsSelect" type="button" selector="#reviwGrid_massaction-select"/> + <element name="massActions" type="button" selector="#reviewGrid_massaction-mass-select"/> + <element name="massActionsSelect" type="button" selector="#reviewGrid_massaction-select"/> <element name="submit" type="button" selector=".admin__grid-massaction-form .action-default.scalable"/> <element name="acceptModal" type="button" selector=".modal-popup.confirm button.action-accept"/> </section> diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Customer/Edit/Tab/Reviews.php b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Customer/Edit/Tab/Reviews.php index cd46dc24ee3e9..5000fb838ec73 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Customer/Edit/Tab/Reviews.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Customer/Edit/Tab/Reviews.php @@ -18,7 +18,7 @@ class Reviews extends Tab * * @var string */ - protected $reviews = '#reviwGrid'; + protected $reviews = '#reviewGrid'; /** * Returns product reviews grid. diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Grid.php b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Grid.php index 7614cd332bd04..23f877b96f3a2 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Grid.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Grid.php @@ -27,7 +27,7 @@ class Grid extends GridAbstract 'selector' => 'input[name="title"]', ], 'status' => [ - 'selector' => '#reviwGrid_filter_status', + 'selector' => '#reviewGrid_filter_status', 'input' => 'select', ], 'nickname' => [ diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Page/Adminhtml/ReviewIndex.xml b/dev/tests/functional/tests/app/Magento/Review/Test/Page/Adminhtml/ReviewIndex.xml index fa77210b11875..c533067e9516e 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Page/Adminhtml/ReviewIndex.xml +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Page/Adminhtml/ReviewIndex.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd"> <page name="ReviewIndex" area="Adminhtml" mca="review/product/index" module="Magento_Review"> <block name="messagesBlock" class="Magento\Backend\Test\Block\Messages" locator="#messages" strategy="css selector" /> - <block name="reviewGrid" class="Magento\Review\Test\Block\Adminhtml\Grid" locator="#reviwGrid" strategy="css selector" /> + <block name="reviewGrid" class="Magento\Review\Test\Block\Adminhtml\Grid" locator="#reviewGrid" strategy="css selector" /> <block name="reviewActions" class="Magento\Backend\Test\Block\GridPageActions" locator=".page-main-actions" strategy="css selector" /> </page> </config> diff --git a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/IndexTest.php b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/IndexTest.php index 1b7f2c1f7efdd..b3826cd8daa8d 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/IndexTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/IndexTest.php @@ -444,7 +444,7 @@ public function testProductReviewsAction() $this->getRequest()->setParam('id', 1); $this->dispatch('backend/customer/index/productReviews'); $body = $this->getResponse()->getBody(); - $this->assertContains('<div id="reviwGrid"', $body); + $this->assertContains('<div id="reviewGrid"', $body); } /** From 9b1883458be9e7c2481df3b08ca1865798921b1d Mon Sep 17 00:00:00 2001 From: Sathish <srsathish92@gmail.com> Date: Mon, 16 Dec 2019 02:18:28 +0530 Subject: [PATCH 334/586] Assert updated --- app/code/Magento/Contact/Test/Unit/Model/ConfigTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Contact/Test/Unit/Model/ConfigTest.php b/app/code/Magento/Contact/Test/Unit/Model/ConfigTest.php index 56351bae87698..a665b6b71c8c9 100644 --- a/app/code/Magento/Contact/Test/Unit/Model/ConfigTest.php +++ b/app/code/Magento/Contact/Test/Unit/Model/ConfigTest.php @@ -62,7 +62,7 @@ public function testIsEnabled(): void ->with(config::XML_PATH_ENABLED, ScopeInterface::SCOPE_STORE) ->willReturn(true); - $this->assertTrue(true, $this->model->isEnabled()); + $this->assertTrue($this->model->isEnabled()); } /** @@ -77,7 +77,7 @@ public function testIsNotEnabled(): void ->with(config::XML_PATH_ENABLED, ScopeInterface::SCOPE_STORE) ->willReturn(false); - $this->assertFalse(false, $this->model->isEnabled()); + $this->assertFalse($this->model->isEnabled()); } /** From 3fdf545e50e97eead23b184574beccb34ccbc49a Mon Sep 17 00:00:00 2001 From: pawankparmar <comp1@comp1-All-Series> Date: Mon, 16 Dec 2019 09:39:13 +0530 Subject: [PATCH 335/586] fix static test change --- .../Api/Data/ProductRender/FormattedPriceInfoInterface.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Api/Data/ProductRender/FormattedPriceInfoInterface.php b/app/code/Magento/Catalog/Api/Data/ProductRender/FormattedPriceInfoInterface.php index 65ff84ef719f0..a79033035ca22 100644 --- a/app/code/Magento/Catalog/Api/Data/ProductRender/FormattedPriceInfoInterface.php +++ b/app/code/Magento/Catalog/Api/Data/ProductRender/FormattedPriceInfoInterface.php @@ -164,4 +164,4 @@ public function getExtensionAttributes(); public function setExtensionAttributes( \Magento\Catalog\Api\Data\ProductRender\FormattedPriceInfoExtensionInterface $extensionAttributes ); -} +} \ No newline at end of file From 1d63932dadfaa6c604b599f28fbc3a4278fb9443 Mon Sep 17 00:00:00 2001 From: pawankparmar <comp1@comp1-All-Series> Date: Mon, 16 Dec 2019 10:13:18 +0530 Subject: [PATCH 336/586] fix static test change with phpcbf --- .../FormattedPriceInfoInterface.php | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/app/code/Magento/Catalog/Api/Data/ProductRender/FormattedPriceInfoInterface.php b/app/code/Magento/Catalog/Api/Data/ProductRender/FormattedPriceInfoInterface.php index a79033035ca22..5f192dcd98a17 100644 --- a/app/code/Magento/Catalog/Api/Data/ProductRender/FormattedPriceInfoInterface.php +++ b/app/code/Magento/Catalog/Api/Data/ProductRender/FormattedPriceInfoInterface.php @@ -23,7 +23,7 @@ interface FormattedPriceInfoInterface extends \Magento\Framework\Api\ExtensibleD * Retrieve html with final price * * @return string - * @since 101.1.0 + * @since 101.1.0 */ public function getFinalPrice(); @@ -31,9 +31,9 @@ public function getFinalPrice(); * Set the final price: usually it calculated as minimal price of the product * Can be different depends on type of product * - * @param string $finalPrice + * @param string $finalPrice * @return void - * @since 101.1.0 + * @since 101.1.0 */ public function setFinalPrice($finalPrice); @@ -42,16 +42,16 @@ public function setFinalPrice($finalPrice); * E.g. for product with custom options is price with the most expensive custom option * * @return string - * @since 101.1.0 + * @since 101.1.0 */ public function getMaxPrice(); /** * Set the max price of the product * - * @param string $maxPrice + * @param string $maxPrice * @return void - * @since 101.1.0 + * @since 101.1.0 */ public function setMaxPrice($maxPrice); @@ -60,7 +60,7 @@ public function setMaxPrice($maxPrice); * The minimal price is for example, the lowest price of all variations for complex product * * @return string - * @since 101.1.0 + * @since 101.1.0 */ public function getMinimalPrice(); @@ -69,9 +69,9 @@ public function getMinimalPrice(); * Max regular price is the same, as maximum price, except of excluding calculating special price and catalog rules * in it * - * @param string $maxRegularPrice + * @param string $maxRegularPrice * @return void - * @since 101.1.0 + * @since 101.1.0 */ public function setMaxRegularPrice($maxRegularPrice); @@ -79,16 +79,16 @@ public function setMaxRegularPrice($maxRegularPrice); * Retrieve max regular price * * @return string - * @since 101.1.0 + * @since 101.1.0 */ public function getMaxRegularPrice(); /** * The minimal regular price has the same behavior of calculation as max regular price, but is opposite price * - * @param string $minRegularPrice + * @param string $minRegularPrice * @return void - * @since 101.1.0 + * @since 101.1.0 */ public function setMinimalRegularPrice($minRegularPrice); @@ -96,7 +96,7 @@ public function setMinimalRegularPrice($minRegularPrice); * Retrieve minimal regular price * * @return string - * @since 101.1.0 + * @since 101.1.0 */ public function getMinimalRegularPrice(); @@ -105,9 +105,9 @@ public function getMinimalRegularPrice(); * * Special price - is temporary price, that can be set to specific product * - * @param string $specialPrice + * @param string $specialPrice * @return void - * @since 101.1.0 + * @since 101.1.0 */ public function setSpecialPrice($specialPrice); @@ -115,16 +115,16 @@ public function setSpecialPrice($specialPrice); * Retrieve special price * * @return string - * @since 101.1.0 + * @since 101.1.0 */ public function getSpecialPrice(); /** * Set minimal price * - * @param string $minimalPrice + * @param string $minimalPrice * @return void - * @since 101.1.0 + * @since 101.1.0 */ public function setMinimalPrice($minimalPrice); @@ -133,16 +133,16 @@ public function setMinimalPrice($minimalPrice); * Usually this price is corresponding to price in admin panel of product * * @return string - * @since 101.1.0 + * @since 101.1.0 */ public function getRegularPrice(); /** * Set regular price * - * @param string $regularPrice + * @param string $regularPrice * @return void - * @since 101.1.0 + * @since 101.1.0 */ public function setRegularPrice($regularPrice); @@ -150,16 +150,16 @@ public function setRegularPrice($regularPrice); * Retrieve existing extension attributes object or create a new one. * * @return \Magento\Catalog\Api\Data\ProductRender\FormattedPriceInfoExtensionInterface|null - * @since 101.1.0 + * @since 101.1.0 */ public function getExtensionAttributes(); /** * Set an extension attributes object. * - * @param \Magento\Catalog\Api\Data\ProductRender\FormattedPriceInfoExtensionInterface $extensionAttributes + * @param \Magento\Catalog\Api\Data\ProductRender\FormattedPriceInfoExtensionInterface $extensionAttributes * @return $this - * @since 101.1.0 + * @since 101.1.0 */ public function setExtensionAttributes( \Magento\Catalog\Api\Data\ProductRender\FormattedPriceInfoExtensionInterface $extensionAttributes From 4b0178429b1c75e456d7d433caa37148ea3657fb Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Sun, 15 Dec 2019 22:45:20 -0600 Subject: [PATCH 337/586] Change action groups name according to CE branch changes --- .../Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml | 2 +- .../AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml | 2 +- .../AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml index b6cd116956812..82dc8d9ef7377 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml @@ -40,7 +40,7 @@ </actionGroup> <!--Delete the URL Rewrite for CMS Page with No redirects--> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite"> + <actionGroup ref="AdminDeleteUrlRewriteActionGroup" stepKey="deleteCustomUrlRewrite"> <argument name="requestPath" value="newrequestpath"/> </actionGroup> <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage"> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml index 1f76493bac89c..53be81c19f4f1 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml @@ -40,7 +40,7 @@ </actionGroup> <!-- Delete the URL Rewrite for CMS Page with permanent redirect--> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deletePermanentUrlRewrite"> + <actionGroup ref="AdminDeleteUrlRewriteActionGroup" stepKey="deletePermanentUrlRewrite"> <argument name="requestPath" value="permanentrequestpath.html"/> </actionGroup> <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage"> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml index c62f0ece7e780..a5a0be6df767f 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml @@ -40,7 +40,7 @@ </actionGroup> <!-- Delete the URL Rewrite for CMS Page with with temporary redirect--> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteTemporaryUrlRewrite"> + <actionGroup ref="AdminDeleteUrlRewriteActionGroup" stepKey="deleteTemporaryUrlRewrite"> <argument name="requestPath" value="temporaryrequestpath.html"/> </actionGroup> <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage"> From 454330355f7a166d53a4e7bc6bed68973b6be445 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Sun, 15 Dec 2019 23:04:20 -0600 Subject: [PATCH 338/586] Change action groups name according to CE branch changes --- .../Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml index 82dc8d9ef7377..94065ec059840 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml @@ -48,7 +48,7 @@ </actionGroup> <!--Search and verify AssertUrlRewriteNotInGrid--> - <actionGroup ref="AdminSearchDeletedUrlRewrite" stepKey="searchDeletedUrlRewriteInGrid"> + <actionGroup ref="AdminSearchDeletedUrlRewriteActionGroup" stepKey="searchDeletedUrlRewriteInGrid"> <argument name="requestPath" value="newrequestpath"/> </actionGroup> From 804e2f857ec9ad192781c292a5ee3295de10d457 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Mon, 16 Dec 2019 12:08:41 +0700 Subject: [PATCH 339/586] [Downloadable] Cover the Observer SetHasDownloadableProductsObserver by Unit Test --- ...SetHasDownloadableProductsObserverTest.php | 185 ++++++++++++++++++ 1 file changed, 185 insertions(+) create mode 100644 app/code/Magento/Downloadable/Test/Unit/Observer/SetHasDownloadableProductsObserverTest.php diff --git a/app/code/Magento/Downloadable/Test/Unit/Observer/SetHasDownloadableProductsObserverTest.php b/app/code/Magento/Downloadable/Test/Unit/Observer/SetHasDownloadableProductsObserverTest.php new file mode 100644 index 0000000000000..cd79049465d06 --- /dev/null +++ b/app/code/Magento/Downloadable/Test/Unit/Observer/SetHasDownloadableProductsObserverTest.php @@ -0,0 +1,185 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Downloadable\Test\Unit\Observer; + +use Magento\Catalog\Model\Product\Type as ProductType; +use Magento\Checkout\Model\Session as CheckoutSession; +use Magento\Downloadable\Model\Product\Type as DownloadableProductType; +use Magento\Downloadable\Observer\SetHasDownloadableProductsObserver; +use Magento\Framework\DataObject; +use Magento\Framework\Event\Observer; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Sales\Model\Order; +use Magento\Sales\Model\Order\Item; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +class SetHasDownloadableProductsObserverTest extends TestCase +{ + /** + * @var ObjectManager + */ + private $objectManager; + + /** + * @var CheckoutSession|MockObject + */ + private $checkoutSessionMock; + + /** + * @var SetHasDownloadableProductsObserver + */ + private $setHasDownloadableProductsObserver; + + /** + * @var Order|MockObject + */ + private $orderMock; + + /** + * Setup environment for test + */ + protected function setUp() + { + $this->objectManager = new ObjectManager($this); + + $this->orderMock = $this->createPartialMock(Order::class, ['getAllItems']); + + $this->checkoutSessionMock = $this->createPartialMock( + CheckoutSession::class, + [ + 'getHasDownloadableProducts', + 'setHasDownloadableProducts' + ] + ); + + + $this->setHasDownloadableProductsObserver = $this->objectManager->getObject( + SetHasDownloadableProductsObserver::class, + [ + 'checkoutSession' => $this->checkoutSessionMock + ] + ); + } + + /** + * Test execute with session has downloadable products + */ + public function testExecuteWithSessionHasDownloadableProducts() + { + $event = new DataObject(['item' => $this->orderMock]); + $observer = new Observer(['event' => $event]); + + $this->checkoutSessionMock->method('getHasDownloadableProducts')->willReturn(true); + $this->orderMock->method('getAllItems')->willReturn([]); + + $this->checkoutSessionMock->expects($this->never()) + ->method('setHasDownloadableProducts')->with(true); + + $this->setHasDownloadableProductsObserver->execute($observer); + } + + /** + * Test execute with session has no downloadable products with the data provider + * + * @dataProvider executeWithSessionNoDownloadableProductsDataProvider + */ + public function testExecuteWithSessionNoDownloadableProducts($allItems, $expectedCall) + { + $event = new DataObject(['order' => $this->orderMock]); + $observer = new Observer(['event' => $event]); + + $allOrderItemsMock = []; + foreach ($allItems as $item) { + $allOrderItemsMock[] = $this->createOrderItem(...$item); + } + + $this->checkoutSessionMock->method('getHasDownloadableProducts')->willReturn(false); + + $this->orderMock->method('getAllItems')->willReturn($allOrderItemsMock); + + $this->checkoutSessionMock->expects($expectedCall) + ->method('setHasDownloadableProducts')->with(true); + + $this->setHasDownloadableProductsObserver->execute($observer); + } + + /** + * Create Order Item Mock + * + * @param string $productType + * @param string $realProductType + * @param string $isDownloadable + * @return Item|MockObject + */ + private function createOrderItem( + $productType = DownloadableProductType::TYPE_DOWNLOADABLE, + $realProductType = DownloadableProductType::TYPE_DOWNLOADABLE, + $isDownloadable = '1' + ) { + $item = $this->createPartialMock( + Item::class, + ['getProductType', 'getRealProductType', 'getProductOptionByCode'] + ); + + $item->expects($this->any()) + ->method('getProductType') + ->willReturn($productType); + $item->expects($this->any()) + ->method('getRealProductType') + ->willReturn($realProductType); + $item->expects($this->any()) + ->method('getProductOptionByCode') + ->with('is_downloadable') + ->willReturn($isDownloadable); + + return $item; + } + + /** + * Data Provider for test execute with session has no downloadable product + * + * @return array + */ + public function executeWithSessionNoDownloadableProductsDataProvider() + { + return [ + 'Order has once item is downloadable product' => [ + [ + [ + DownloadableProductType::TYPE_DOWNLOADABLE, + DownloadableProductType::TYPE_DOWNLOADABLE, + '1' + ], + [ + ProductType::TYPE_SIMPLE, + ProductType::TYPE_SIMPLE, + '1' + ] + ], + $this->once() + ], + 'Order has all items are simple product' => [ + [ + [ + ProductType::TYPE_SIMPLE, + ProductType::TYPE_SIMPLE, + '0' + ], + [ + ProductType::TYPE_SIMPLE, + ProductType::TYPE_SIMPLE, + '0' + ] + ], + $this->never() + ], + ]; + } +} From aa09a07e4c62245e0d32268acdcc270f5460ed88 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Sun, 15 Dec 2019 23:23:50 -0600 Subject: [PATCH 340/586] Change action groups name according to CE branch changes --- .../Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml | 2 +- .../AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml | 2 +- .../AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml index 94065ec059840..c40dd3256114e 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml @@ -53,7 +53,7 @@ </actionGroup> <!--Verify AssertPageByUrlRewriteIsNotFound--> - <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="assertPageByUrlRewriteIsNotFound"> + <actionGroup ref="AssertPageByUrlRewriteIsNotFoundActionGroup" stepKey="assertPageByUrlRewriteIsNotFound"> <argument name="requestPath" value="newrequestpath"/> </actionGroup> </test> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml index 53be81c19f4f1..741be6985d517 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml @@ -48,7 +48,7 @@ </actionGroup> <!-- Verify AssertPageByUrlRewriteIsNotFound --> - <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="assertPageByUrlRewriteIsNotFound"> + <actionGroup ref="AssertPageByUrlRewriteIsNotFoundActionGroup" stepKey="assertPageByUrlRewriteIsNotFound"> <argument name="requestPath" value="permanentrequestpath.html"/> </actionGroup> </test> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml index a5a0be6df767f..43de4123f35a8 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml @@ -48,7 +48,7 @@ </actionGroup> <!--Verify AssertPageByUrlRewriteIsNotFound--> - <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="assertPageByUrlRewriteIsNotFound"> + <actionGroup ref="AssertPageByUrlRewriteIsNotFoundActionGroup" stepKey="assertPageByUrlRewriteIsNotFound"> <argument name="requestPath" value="temporaryrequestpath.html"/> </actionGroup> </test> From 4002829574a00a8bad40acca3cb2af116cceb17c Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Mon, 16 Dec 2019 13:00:02 +0700 Subject: [PATCH 341/586] Fix static test --- .../Unit/Observer/SetHasDownloadableProductsObserverTest.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/code/Magento/Downloadable/Test/Unit/Observer/SetHasDownloadableProductsObserverTest.php b/app/code/Magento/Downloadable/Test/Unit/Observer/SetHasDownloadableProductsObserverTest.php index cd79049465d06..53d9878f46ea2 100644 --- a/app/code/Magento/Downloadable/Test/Unit/Observer/SetHasDownloadableProductsObserverTest.php +++ b/app/code/Magento/Downloadable/Test/Unit/Observer/SetHasDownloadableProductsObserverTest.php @@ -59,7 +59,6 @@ protected function setUp() ] ); - $this->setHasDownloadableProductsObserver = $this->objectManager->getObject( SetHasDownloadableProductsObserver::class, [ @@ -150,7 +149,7 @@ private function createOrderItem( public function executeWithSessionNoDownloadableProductsDataProvider() { return [ - 'Order has once item is downloadable product' => [ + 'Order has one item is downloadable product' => [ [ [ DownloadableProductType::TYPE_DOWNLOADABLE, From 78cdd70586a7babfd78a571ac2b2454b017fbd73 Mon Sep 17 00:00:00 2001 From: Ashna-Jahan <32352950+Ashna-Jahan@users.noreply.github.com> Date: Mon, 16 Dec 2019 12:31:11 +0530 Subject: [PATCH 342/586] Fix the issue. --- .../backend/web/css/source/forms/fields/_control-table.less | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less b/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less index 22957cb86cb55..fce92e873e5bb 100644 --- a/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less +++ b/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less @@ -244,11 +244,10 @@ .product_form_product_form_advanced_pricing_modal .admin__control-table td, .product_form_product_form_advanced_pricing_modal .admin__control-table th { - padding: 1.3rem 0.7rem 1.3rem 0.3; overflow-y: visible; } .product_form_product_form_advanced_pricing_modal .admin__fieldset { - margin: -40px; + margin-left: -30px; } .product_form_product_form_advanced_pricing_modal .admin__control-table-wrapper { From 2ae68386fc04fda7bb6ca9748277e81983732610 Mon Sep 17 00:00:00 2001 From: Grzegorz Bogusz <grzegorz.bogusz@creativestyle.pl> Date: Mon, 16 Dec 2019 08:20:47 +0100 Subject: [PATCH 343/586] Adjusted code after MR --- .../Model/Product/Option/Type/Text.php | 4 +- .../Model/Product/Option/Type/TextTest.php | 62 ++++++------------- 2 files changed, 21 insertions(+), 45 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Product/Option/Type/Text.php b/app/code/Magento/Catalog/Model/Product/Option/Type/Text.php index 0585e77734e3e..10584026b3218 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/Type/Text.php +++ b/app/code/Magento/Catalog/Model/Product/Option/Type/Text.php @@ -109,8 +109,8 @@ public function getFormattedOptionValue($value) * @param string $value * @return string */ - private function normalizeNewLineSymbols($value) + private function normalizeNewLineSymbols(string $value) { - return str_replace(["\r\n", "\n\r", "\r"], ["\n", "\n", "\n"], $value); + return str_replace(["\r\n", "\n\r", "\r"], "\n", $value); } } diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/TextTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/TextTest.php index 29e7f327eeb9e..194c0eb85a59e 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/TextTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/TextTest.php @@ -7,19 +7,25 @@ namespace Magento\Catalog\Model\Product\Option\Type; use Magento\Catalog\Model\Product\Option; +use Magento\Tests\NamingConvention\true\mixed; +use PHPUnit\Framework\TestCase; +use Magento\Framework\ObjectManagerInterface; +use Magento\TestFramework\Helper\Bootstrap; /** * Test for customizable product option with "Text" type */ -class TextTest extends \PHPUnit\Framework\TestCase +class TextTest extends TestCase { + const STUB_OPTION_DATA = ['id' => 11, 'type' => 'area']; + /** * @var Text */ - protected $model; + protected $optionText; /** - * @var \Magento\Framework\ObjectManagerInterface + * @var ObjectManagerInterface */ private $objectManager; @@ -28,10 +34,8 @@ class TextTest extends \PHPUnit\Framework\TestCase */ protected function setUp() { - $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $this->model = $this->objectManager->create( - Text::class - ); + $this->objectManager = Bootstrap::getObjectManager(); + $this->optionText = $this->objectManager->create(Text::class); } /** @@ -52,11 +56,11 @@ public function testNormalizeNewlineSymbols( ['data' => $productOptionData] ); - $this->model->setOption($productOption); - $this->model->setUserValue($optionValue); - $this->model->validateUserValue([]); + $this->optionText->setOption($productOption); + $this->optionText->setUserValue($optionValue); + $this->optionText->validateUserValue([]); - $this->assertSame($expectedOptionValue, $this->model->getUserValue()); + $this->assertSame($expectedOptionValue, $this->optionText->getUserValue()); } /** @@ -67,38 +71,10 @@ public function testNormalizeNewlineSymbols( public function optionValueDataProvider() { return [ - [ - // $productOptionData - ['id' => 11, 'type' => 'area'], - // $optionValue - 'string string', - // $expectedOptionValue - 'string string' - ], - [ - // $productOptionData - ['id' => 11, 'type' => 'area'], - // $optionValue - "string \r\n string", - // $expectedOptionValue - "string \n string" - ], - [ - // $productOptionData - ['id' => 11, 'type' => 'area'], - // $optionValue - "string \n\r string", - // $expectedOptionValue - "string \n string" - ], - [ - // $productOptionData - ['id' => 11, 'type' => 'area'], - // $optionValue - "string \r string", - // $expectedOptionValue - "string \n string" - ] + [self::STUB_OPTION_DATA, 'string string', 'string string'], + [self::STUB_OPTION_DATA, "string \r\n string", "string \n string"], + [self::STUB_OPTION_DATA, "string \n\r string", "string \n string"], + [self::STUB_OPTION_DATA, "string \r string", "string \n string"] ]; } } From 7ae9ab1fcd8eb6380b484e033cb847ecbb407643 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Mon, 16 Dec 2019 15:46:03 +0700 Subject: [PATCH 344/586] [Backend] Cover Dashboard Helper Data by Unit Test --- .../Test/Unit/Helper/Dashboard/DataTest.php | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 app/code/Magento/Backend/Test/Unit/Helper/Dashboard/DataTest.php diff --git a/app/code/Magento/Backend/Test/Unit/Helper/Dashboard/DataTest.php b/app/code/Magento/Backend/Test/Unit/Helper/Dashboard/DataTest.php new file mode 100644 index 0000000000000..21c72cb6b4477 --- /dev/null +++ b/app/code/Magento/Backend/Test/Unit/Helper/Dashboard/DataTest.php @@ -0,0 +1,111 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Backend\Test\Unit\Helper\Dashboard; + +use Magento\Backend\Helper\Dashboard\Data as HelperData; +use Magento\Framework\App\DeploymentConfig; +use Magento\Framework\Config\ConfigOptionsListConstants; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Store\Model\ResourceModel\Store\Collection as StoreCollection; +use Magento\Store\Model\Store; +use Magento\Store\Model\StoreManagerInterface; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +class DataTest extends TestCase +{ + /** + * Stub path install + */ + private const STUB_PATH_INSTALL = 'Sat, 6 Sep 2014 16:46:11 UTC'; + + /** + * Stub chart data hash + */ + private const STUB_CHART_DATA_HASH = '52870842b23068a78220e01eb9d4404d'; + + /** + * @var \Magento\Backend\Helper\Dashboard\Data + */ + private $helper; + + /** + * @var StoreManagerInterface|MockObject + */ + private $storeManagerMock; + + /** + * @var DeploymentConfig|MockObject + */ + private $deploymentConfigMock; + + /** + * Prepare environment for test + */ + protected function setUp() + { + $this->storeManagerMock = $this->createMock(StoreManagerInterface::class); + $this->deploymentConfigMock = $this->createMock(DeploymentConfig::class); + $this->deploymentConfigMock->expects($this->once())->method('get') + ->with(ConfigOptionsListConstants::CONFIG_PATH_INSTALL_DATE) + ->will($this->returnValue(self::STUB_PATH_INSTALL)); + + $objectManager = new ObjectManager($this); + $this->helper = $objectManager->getObject( + HelperData::class, + [ + 'storeManager' => $this->storeManagerMock, + 'deploymentConfig' => $this->deploymentConfigMock + ] + ); + } + + /** + * Test getStores() when $_stores attribute is null + */ + public function testGetStoresWhenStoreAttributeIsNull() + { + $storeMock = $this->createPartialMock(Store::class, ['getResourceCollection']); + $storeCollectionMock = $this->createMock(StoreCollection::class); + + $storeCollectionMock->expects($this->once())->method('load')->willReturnSelf(); + $storeMock->expects($this->once())->method('getResourceCollection')->willReturn($storeCollectionMock); + $this->storeManagerMock->expects($this->once())->method('getStore')->willReturn($storeMock); + + $this->assertEquals($storeCollectionMock, $this->helper->getStores()); + } + + /** + * Test getDatePeriods() method + */ + public function testGetDatePeriods() + { + $this->assertEquals( + [ + '24h' => (string)__('Last 24 Hours'), + '7d' => (string)__('Last 7 Days'), + '1m' => (string)__('Current Month'), + '1y' => (string)__('YTD'), + '2y' => (string)__('2YTD') + ], + $this->helper->getDatePeriods() + ); + } + + /** + * Test getChartDataHash() method + */ + public function testGetChartDataHash() + { + $this->assertEquals( + self::STUB_CHART_DATA_HASH, + $this->helper->getChartDataHash(self::STUB_PATH_INSTALL) + ); + } +} From ccc399a6920c4f1c9def5536f70094a87bdf1577 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Mon, 16 Dec 2019 10:47:25 +0200 Subject: [PATCH 345/586] MC-4242: Newsletter subscriptions per website --- ...esAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml index 52dce4d67f698..716bb60ce68bd 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml @@ -29,6 +29,10 @@ <requiredEntity createDataKey="createSecondCategory"/> </createData> + <!-- Reindex and flush the cache --> + <magentoCLI command="indexer:reindex" stepKey="runReindex"/> + <magentoCLI command="cache:flush" stepKey="cleanCache"/> + <!-- Log in to backend --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> From 6bf903f0521c7ef1f2561af6db71e391ecdc39ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Tylek?= <pawel.tylek@creativestyle.pl> Date: Mon, 16 Dec 2019 10:24:30 +0100 Subject: [PATCH 346/586] MAGETWO-95866 Fix tests --- .../backend/Magento_Backend/web/css/source/module/_menu.less | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/_menu.less b/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/_menu.less index c84a54efd5028..29a7499ec72f4 100644 --- a/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/_menu.less +++ b/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/_menu.less @@ -268,10 +268,10 @@ } > ul[role='menu'] { - overflow-x: auto; - overflow-y: hidden; max-width: ~'calc(100vw - @{menu__width})'; min-height: @submenu__height; + overflow-x: auto; + overflow-y: hidden; } } From b394255d6d5c1df661c2c6cd5f6507f603b2d1f9 Mon Sep 17 00:00:00 2001 From: Sathish <srsathish92@gmail.com> Date: Mon, 16 Dec 2019 15:40:13 +0530 Subject: [PATCH 347/586] Removed duplicated logic with data provider --- .../Contact/Test/Unit/Model/ConfigTest.php | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/app/code/Magento/Contact/Test/Unit/Model/ConfigTest.php b/app/code/Magento/Contact/Test/Unit/Model/ConfigTest.php index a665b6b71c8c9..9456ea4b48105 100644 --- a/app/code/Magento/Contact/Test/Unit/Model/ConfigTest.php +++ b/app/code/Magento/Contact/Test/Unit/Model/ConfigTest.php @@ -54,30 +54,29 @@ protected function setUp(): void * Test isEnabled() * * @return void + * @dataProvider isEnabledDataProvider */ - public function testIsEnabled(): void + public function testIsEnabled($isSetFlag, $result): void { $this->scopeConfigMock->expects($this->once()) ->method('isSetFlag') ->with(config::XML_PATH_ENABLED, ScopeInterface::SCOPE_STORE) - ->willReturn(true); + ->willReturn($isSetFlag); - $this->assertTrue($this->model->isEnabled()); + $this->assertEquals($result, $this->model->isEnabled()); } /** - * Test isNotEnabled() + * Data provider for isEnabled() * - * @return void + * @return array */ - public function testIsNotEnabled(): void + public function isEnabledDataProvider(): array { - $this->scopeConfigMock->expects($this->once()) - ->method('isSetFlag') - ->with(config::XML_PATH_ENABLED, ScopeInterface::SCOPE_STORE) - ->willReturn(false); - - $this->assertFalse($this->model->isEnabled()); + return [ + [true, true], + [false, false] + ]; } /** From b8d5c105115e4ed143fe29d99f5f5e0e89ef8521 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Mon, 16 Dec 2019 12:21:37 +0200 Subject: [PATCH 348/586] MC-4242: Newsletter subscriptions per website --- ...terChangingUrlKeyForStoreViewAndMovingCategoryTest.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml index 716bb60ce68bd..0986443fd5893 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml @@ -29,15 +29,15 @@ <requiredEntity createDataKey="createSecondCategory"/> </createData> - <!-- Reindex and flush the cache --> - <magentoCLI command="indexer:reindex" stepKey="runReindex"/> - <magentoCLI command="cache:flush" stepKey="cleanCache"/> - <!-- Log in to backend --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!--Create additional Store View in Main Website Store --> <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView"/> + + <!-- Reindex and flush the cache --> + <magentoCLI command="indexer:reindex" stepKey="runReindex"/> + <magentoCLI command="cache:flush" stepKey="cleanCache"/> </before> <after> <deleteData createDataKey="createFirstCategory" stepKey="deleteFirstCategory"/> From 56d198d03f6fcc9f56da78cdad53023750a1a188 Mon Sep 17 00:00:00 2001 From: Ashna-Jahan <32352950+Ashna-Jahan@users.noreply.github.com> Date: Mon, 16 Dec 2019 16:17:14 +0530 Subject: [PATCH 349/586] fix Allure Report issue --- .../backend/web/css/source/forms/fields/_control-table.less | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less b/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less index fce92e873e5bb..0a81223525fbd 100644 --- a/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less +++ b/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less @@ -238,7 +238,8 @@ } } -.product_form_product_form_advanced_pricing_modal .admin__fieldset > .admin__field > .admin__field-label, .product_form_product_form_advanced_pricing_modal [class*='admin__control-grouped'] > .admin__field:first-child > .admin__field-label { +.product_form_product_form_advanced_pricing_modal .admin__fieldset > .admin__field > .admin__field-label, +.product_form_product_form_advanced_pricing_modal [class*='admin__control-grouped'] > .admin__field:first-child > .admin__field-label { margin-left: 0; } @@ -246,6 +247,7 @@ .product_form_product_form_advanced_pricing_modal .admin__control-table th { overflow-y: visible; } + .product_form_product_form_advanced_pricing_modal .admin__fieldset { margin-left: -30px; } From 18500e1410a96b06a7e59ac19733e84784b14cfc Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Mon, 16 Dec 2019 14:41:16 +0200 Subject: [PATCH 350/586] MC-4242: Newsletter subscriptions per website --- ...iesAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml index 0986443fd5893..7b901658faa4a 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml @@ -80,7 +80,6 @@ <!-- Assert category url with custom store view --> <amOnPage url="{{StorefrontHomePage.url}}$$createSecondCategory.name$$/{{SimpleRootSubCategory.url_key}}.html" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> - <dontSee userInput="$$createSecondSimpleProduct.name$$" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="dontSeeProductInCategory"/> - <see selector="{{StorefrontCategoryMainSection.emptyProductMessage}}" userInput="We can't find products matching the selection." stepKey="seeEmptyProductMessage"/> + <see userInput="$$createFirstSimpleProduct.name$$" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="seeProductInCategory"/> </test> </tests> From 218c3ff32418c9dacb4da0ed812b226f81e8400a Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Mon, 16 Dec 2019 16:15:39 +0200 Subject: [PATCH 351/586] Reverting container class --- .../Theme/view/adminhtml/page_layout/admin-2columns-left.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Theme/view/adminhtml/page_layout/admin-2columns-left.xml b/app/code/Magento/Theme/view/adminhtml/page_layout/admin-2columns-left.xml index cee241233a199..9cb89746ad85d 100644 --- a/app/code/Magento/Theme/view/adminhtml/page_layout/admin-2columns-left.xml +++ b/app/code/Magento/Theme/view/adminhtml/page_layout/admin-2columns-left.xml @@ -31,7 +31,7 @@ </container> <container name="page.main.container" as="page_main_container" htmlId="page:main-container" htmlTag="div" htmlClass="page-columns"> <container name="main.col" as="main-col" htmlId="container" htmlTag="div" htmlClass="main-col"> - <container name="admin.scope.col.wrap" as="admin-scope-col-wrap" htmlTag="div" htmlClass="form-inline"> <!-- ToDo UI: remove this wrapper remove with old styles removal --> + <container name="admin.scope.col.wrap" as="admin-scope-col-wrap" htmlTag="div" htmlClass="admin__scope-old"> <!-- ToDo UI: remove this wrapper remove with old styles removal --> <container name="content" as="content"/> </container> </container> From b41122340955c4cac549e848fbdc241adab1680e Mon Sep 17 00:00:00 2001 From: "ivan.pletnyov" <ivan.pletnyov@transoftgroup.com> Date: Mon, 16 Dec 2019 16:29:44 +0200 Subject: [PATCH 352/586] MC-25069: Quick/Advanced Search on storefront by product attributes --- .../Controller/Advanced/ResultTest.php | 174 +++++++++++ .../Controller/Result/IndexTest.php | 55 ++++ .../Fulltext/Action/DataProviderTest.php | 95 +++--- .../Search/AttributeSearchWeightTest.php | 282 +++++++++++------- .../_files/product_for_search.php | 55 +++- .../_files/product_for_search_rollback.php | 36 ++- .../products_for_sku_search_weight_score.php | 68 ++++- ...s_for_sku_search_weight_score_rollback.php | 41 +++ .../_files/searchable_attribute.php | 77 +++-- .../Controller/Advanced/ResultTest.php | 37 +++ .../Controller/Result/IndexTest.php | 37 +++ .../fulltext/Action/DataProviderTest.php | 32 ++ .../Search/AttributeSearchWeightTest.php | 107 +++++++ 13 files changed, 888 insertions(+), 208 deletions(-) create mode 100644 dev/tests/integration/testsuite/Magento/CatalogSearch/Controller/Advanced/ResultTest.php create mode 100644 dev/tests/integration/testsuite/Magento/CatalogSearch/Controller/Result/IndexTest.php create mode 100644 dev/tests/integration/testsuite/Magento/CatalogSearch/_files/products_for_sku_search_weight_score_rollback.php create mode 100644 dev/tests/integration/testsuite/Magento/Elasticsearch6/CatalogSearch/Controller/Advanced/ResultTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Elasticsearch6/CatalogSearch/Controller/Result/IndexTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Elasticsearch6/CatalogSearch/Model/Indexer/fulltext/Action/DataProviderTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Elasticsearch6/CatalogSearch/Model/Search/AttributeSearchWeightTest.php diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Controller/Advanced/ResultTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Controller/Advanced/ResultTest.php new file mode 100644 index 0000000000000..32b7df03f922d --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Controller/Advanced/ResultTest.php @@ -0,0 +1,174 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogSearch\Controller\Advanced; + +use Magento\Catalog\Api\ProductAttributeRepositoryInterface; +use Magento\Catalog\Model\ResourceModel\Eav\Attribute; +use Magento\TestFramework\TestCase\AbstractController; +use Zend\Stdlib\Parameters; + +/** + * Test cases for catalog advanced search using mysql search engine. + * + * @magentoDbIsolation disabled + * @magentoAppIsolation enabled + */ +class ResultTest extends AbstractController +{ + /** + * @var ProductAttributeRepositoryInterface + */ + private $productAttributeRepository; + + /** + * @inheritdoc + */ + protected function setUp() + { + parent::setUp(); + $this->productAttributeRepository = $this->_objectManager->create(ProductAttributeRepositoryInterface::class); + } + + /** + * Advanced search test by difference product attributes. + * + * @magentoConfigFixture default/catalog/search/engine mysql + * @magentoAppArea frontend + * @magentoDataFixture Magento/CatalogSearch/_files/product_for_search.php + * @magentoDataFixture Magento/CatalogSearch/_files/full_reindex.php + * @dataProvider searchStringDataProvider + * + * @param array $searchParams + * @return void + */ + public function testExecute(array $searchParams): void + { + if ('' !== $searchParams['test_searchable_attribute']) { + $searchParams['test_searchable_attribute'] = $this->getAttributeOptionValueByOptionLabel( + 'test_searchable_attribute', + $searchParams['test_searchable_attribute'] + ); + } + + $this->getRequest()->setQuery( + $this->_objectManager->create( + Parameters::class, + [ + 'values' => $searchParams + ] + ) + ); + $this->dispatch('catalogsearch/advanced/result'); + $responseBody = $this->getResponse()->getBody(); + $this->assertContains('Simple product name', $responseBody); + } + + /** + * Data provider with strings for quick search. + * + * @return array + */ + public function searchStringDataProvider(): array + { + return [ + 'search_product_by_name' => [ + [ + 'name' => 'Simple product name', + 'sku' => '', + 'description' => '', + 'short_description' => '', + 'price' => [ + 'from' => '', + 'to' => '', + ], + 'test_searchable_attribute' => '', + ], + ], + 'search_product_by_sku' => [ + [ + 'name' => '', + 'sku' => 'simple_for_search', + 'description' => '', + 'short_description' => '', + 'price' => [ + 'from' => '', + 'to' => '', + ], + 'test_searchable_attribute' => '', + ], + ], + 'search_product_by_description' => [ + [ + 'name' => '', + 'sku' => '', + 'description' => 'Product description', + 'short_description' => '', + 'price' => [ + 'from' => '', + 'to' => '', + ], + 'test_searchable_attribute' => '', + ], + ], + 'search_product_by_short_description' => [ + [ + 'name' => '', + 'sku' => '', + 'description' => '', + 'short_description' => 'Product short description', + 'price' => [ + 'from' => '', + 'to' => '', + ], + 'test_searchable_attribute' => '', + ], + ], + 'search_product_by_price_range' => [ + [ + 'name' => '', + 'sku' => '', + 'description' => '', + 'short_description' => '', + 'price' => [ + 'from' => '50', + 'to' => '150', + ], + 'test_searchable_attribute' => '', + ], + ], + 'search_product_by_custom_attribute' => [ + [ + 'name' => '', + 'sku' => '', + 'description' => '', + 'short_description' => '', + 'price' => [ + 'from' => '', + 'to' => '', + ], + 'test_searchable_attribute' => 'Option 1', + ], + ], + ]; + } + + /** + * Return attribute option value by option label. + * + * @param string $attributeCode + * @param string $optionLabel + * @return null|string + */ + private function getAttributeOptionValueByOptionLabel(string $attributeCode, string $optionLabel): ?string + { + /** @var Attribute $attribute */ + $attribute = $this->productAttributeRepository->get($attributeCode); + + return $attribute->getSource()->getOptionId($optionLabel); + } +} diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Controller/Result/IndexTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Controller/Result/IndexTest.php new file mode 100644 index 0000000000000..0068d6cbaa015 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Controller/Result/IndexTest.php @@ -0,0 +1,55 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogSearch\Controller\Result; + +use Magento\TestFramework\TestCase\AbstractController; + +/** + * Test cases for catalog quick search using mysql search engine. + * + * @magentoDbIsolation disabled + * @magentoAppIsolation enabled + */ +class IndexTest extends AbstractController +{ + /** + * Quick search test by difference product attributes. + * + * @magentoConfigFixture default/catalog/search/engine mysql + * @magentoAppArea frontend + * @magentoDataFixture Magento/CatalogSearch/_files/product_for_search.php + * @magentoDataFixture Magento/CatalogSearch/_files/full_reindex.php + * @dataProvider searchStringDataProvider + * + * @param string $searchString + * @return void + */ + public function testExecute(string $searchString): void + { + $this->getRequest()->setParam('q', $searchString); + $this->dispatch('catalogsearch/result'); + $responseBody = $this->getResponse()->getBody(); + $this->assertContains('Simple product name', $responseBody); + } + + /** + * Data provider with strings for quick search. + * + * @return array + */ + public function searchStringDataProvider(): array + { + return [ + 'search_product_by_name' => ['Simple product name'], + 'search_product_by_sku' => ['simple_for_search'], + 'search_product_by_description' => ['Product description'], + 'search_product_by_short_description' => ['Product short description'], + 'search_product_by_custom_attribute' => ['Option 1'], + ]; + } +} diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/DataProviderTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/DataProviderTest.php index d503c9678dfd6..c090f4ea0183c 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/DataProviderTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/DataProviderTest.php @@ -7,71 +7,84 @@ namespace Magento\CatalogSearch\Model\Indexer\Fulltext\Action; -use Magento\Catalog\Model\Product; -use Magento\Catalog\Model\ProductRepository as ProductRepository; -use Magento\CatalogSearch\Model\Indexer\Fulltext; +use Magento\Catalog\Api\ProductRepositoryInterface; use Magento\Framework\Api\Search\Document as SearchDocument; -use Magento\Framework\Indexer\IndexerRegistry; -use Magento\Framework\Search\AdapterInterface as AdapterInterface; use Magento\Framework\Search\Request\Builder as SearchRequestBuilder; use Magento\Framework\Search\Request\Config as SearchRequestConfig; use Magento\Search\Model\AdapterFactory as AdapterFactory; use Magento\TestFramework\Helper\Bootstrap; use Magento\TestFramework\ObjectManager; +use PHPUnit\Framework\TestCase; -class DataProviderTest extends \PHPUnit\Framework\TestCase +/** + * Search products by attribute value using mysql search engine. + */ +class DataProviderTest extends TestCase { + /** + * @var ObjectManager + */ + private $objectManager; + + /** + * @var SearchRequestConfig + */ + private $searchRequestConfig; + + /** + * @var SearchRequestBuilder + */ + private $requestBuilder; + + /** + * @var AdapterFactory + */ + private $adapterFactory; + + /** + * @var ProductRepositoryInterface + */ + private $productRepository; + /** * @inheritdoc */ - public static function setUpBeforeClass() + protected function setUp() { - /* - * Due to insufficient search engine isolation for Elasticsearch, this class must explicitly perform - * a fulltext reindex prior to running its tests. - * - * This should be removed upon completing MC-19455. - */ - $indexRegistry = Bootstrap::getObjectManager()->get(IndexerRegistry::class); - $fulltextIndexer = $indexRegistry->get(Fulltext::INDEXER_ID); - $fulltextIndexer->reindexAll(); + $this->objectManager = Bootstrap::getObjectManager(); + $this->searchRequestConfig = $this->objectManager->create(SearchRequestConfig::class); + $this->requestBuilder = $this->objectManager->create( + SearchRequestBuilder::class, + ['config' => $this->searchRequestConfig] + ); + $this->adapterFactory = $this->objectManager->get(AdapterFactory::class); + $this->productRepository = $this->objectManager->get(ProductRepositoryInterface::class); + parent::setUp(); } /** + * Search product by custom attribute value. + * + * @magentoConfigFixture default/catalog/search/engine mysql * @magentoDataFixture Magento/CatalogSearch/_files/product_for_search.php + * @magentoDataFixture Magento/CatalogSearch/_files/full_reindex.php * @magentoDbIsolation disabled + * + * @return void */ - public function testSearchProductByAttribute() + public function testSearchProductByAttribute(): void { - /** @var ObjectManager $objectManager */ - $objectManager = Bootstrap::getObjectManager(); - - /** @var SearchRequestConfig $config */ - $config = $objectManager->create(SearchRequestConfig::class); - - /** @var SearchRequestBuilder $requestBuilder */ - $requestBuilder = $objectManager->create( - SearchRequestBuilder::class, - ['config' => $config] - ); - - $requestBuilder->bind('search_term', 'VALUE1'); - $requestBuilder->setRequestName('quick_search_container'); - $queryRequest = $requestBuilder->create(); - - /** @var AdapterInterface $adapter */ - $adapterFactory = $objectManager->create(AdapterFactory::class); - $adapter = $adapterFactory->create(); + $this->requestBuilder->bind('search_term', 'Option 1'); + $this->requestBuilder->setRequestName('quick_search_container'); + $queryRequest = $this->requestBuilder->create(); + $adapter = $this->adapterFactory->create(); $queryResponse = $adapter->query($queryRequest); $actualIds = []; - + /** @var SearchDocument $document */ foreach ($queryResponse as $document) { - /** @var SearchDocument $document */ $actualIds[] = $document->getId(); } - - /** @var Product $product */ - $product = $objectManager->create(ProductRepository::class)->get('simple'); + $product = $this->productRepository->get('simple_for_search'); $this->assertContains($product->getId(), $actualIds, 'Product not found by searchable attribute.'); } } diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/AttributeSearchWeightTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/AttributeSearchWeightTest.php index 775210669abd8..4ca8e0b0726d4 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/AttributeSearchWeightTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/AttributeSearchWeightTest.php @@ -8,172 +8,232 @@ namespace Magento\CatalogSearch\Model\Search; -use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Api\ProductAttributeRepositoryInterface; +use Magento\Catalog\Model\Layer\Search as CatalogLayerSearch; use Magento\Catalog\Model\Product; -use Magento\Catalog\Model\ResourceModel\Eav\Attribute; -use Magento\Eav\Api\AttributeRepositoryInterface; -use Magento\Elasticsearch\SearchAdapter\ConnectionManager; -use Magento\Elasticsearch6\Model\Client\Elasticsearch as ElasticsearchClient; -use Magento\Framework\Exception\NoSuchEntityException; -use Magento\Framework\Exception\StateException; +use Magento\CatalogSearch\Model\ResourceModel\Fulltext\CollectionFactory; use Magento\Framework\Search\Request\Builder; use Magento\Framework\Search\Request\Config as RequestConfig; -use Magento\Framework\Search\Response\QueryResponse; -use Magento\Framework\Search\SearchEngineInterface; -use Magento\Indexer\Model\Indexer; +use Magento\Search\Model\Search; use Magento\TestFramework\Helper\Bootstrap; -use Magento\TestFramework\Helper\CacheCleaner; use Magento\TestFramework\ObjectManager; use PHPUnit\Framework\TestCase; /** - * Test for name over sku search weight of product attributes + * Test founded products order after quick search with changed attribute search weight using mysql search engine. * - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @magentoAppIsolation enabled - * @magentoDbIsolation enabled */ class AttributeSearchWeightTest extends TestCase { - - /** @var $objectManager ObjectManager */ + /** + * @var $objectManager ObjectManager + */ private $objectManager; /** - * @var ConnectionManager + * @var ProductAttributeRepositoryInterface */ - private $connectionManager; + private $productAttributeRepository; /** - * @var ElasticsearchClient + * @var array */ - private $client; + private $collectedAttributesWeight = []; /** - * @var ProductRepositoryInterface + * @var CatalogLayerSearch */ - private $productRepository; + private $catalogLayerSearch; + /** + * @inheritdoc + */ protected function setUp() { $this->objectManager = Bootstrap::getObjectManager(); - $this->connectionManager = $this->objectManager->create(ConnectionManager::class); - $this->client = $this->connectionManager->getConnection(); - $this->productRepository = $this->objectManager->create(ProductRepositoryInterface::class); + $this->productAttributeRepository = $this->objectManager->get(ProductAttributeRepositoryInterface::class); + $this->catalogLayerSearch = $this->objectManager->get(CatalogLayerSearch::class); + $this->collectCurrentProductAttributesWeights(); } /** - * @param string $attributeName - * @param int $searchWeight - * @throws NoSuchEntityException - * @throws StateException + * @inheritdoc */ - private function setAttributeSearchWeight(string $attributeName, int $searchWeight) + protected function tearDown() { - /** @var AttributeRepositoryInterface $attributeRepository */ - $attributeRepository = $this->objectManager->create(AttributeRepositoryInterface::class); + $this->updateAttributesWeight($this->collectedAttributesWeight); + } - /** @var Attribute $attribute */ - $attribute = $attributeRepository->get('catalog_product', $attributeName); + /** + * Perform search by word and check founded product order in different cases. + * + * @magentoConfigFixture default/catalog/search/engine mysql + * @magentoDataFixture Magento/CatalogSearch/_files/products_for_sku_search_weight_score.php + * @magentoDataFixture Magento/CatalogSearch/_files/full_reindex.php + * @dataProvider attributeSearchWeightDataProvider + * @magentoDbIsolation disabled + * + * @param string $searchQuery + * @param array $attributeWeights + * @param array $expectedProductNames + * @return void + */ + public function testAttributeSearchWeight( + string $searchQuery, + array $attributeWeights, + array $expectedProductNames + ): void { + $this->updateAttributesWeight($attributeWeights); + $this->removeInstancesCache(); + $products = $this->findProducts($searchQuery); + $actualProductNames = $this->collectProductsName($products); + $this->assertEquals($expectedProductNames, $actualProductNames, 'Products order is not as expected.'); + } - if ($attribute) { - $attribute->setSearchWeight($searchWeight); - $attributeRepository->save($attribute); - } + /** + * Data provider with word for quick search, attributes weight and expected products name order. + * + * @return array + */ + public function attributeSearchWeightDataProvider(): array + { + return [ + 'sku_order_more_than_name' => [ + '1234-1234-1234-1234', + [ + 'sku' => 6, + 'name' => 5, + ], + [ + 'Simple', + '1234-1234-1234-1234', + ], + ], + 'name_order_more_than_sku' => [ + '1234-1234-1234-1234', + [ + 'name' => 6, + 'sku' => 5, + ], + [ + '1234-1234-1234-1234', + 'Simple', + ], + ], + 'search_by_word_from_description' => [ + 'Simple', + [ + 'test_searchable_attribute' => 8, + 'sku' => 6, + 'name' => 5, + 'description' => 1, + ], + [ + 'Product with attribute', + '1234-1234-1234-1234', + 'Simple', + 'Product with description', + ], + ], + 'search_by_attribute_option' => [ + 'Simple', + [ + 'description' => 10, + 'test_searchable_attribute' => 8, + 'sku' => 6, + 'name' => 1, + ], + [ + 'Product with description', + 'Product with attribute', + '1234-1234-1234-1234', + 'Simple', + ], + ], + ]; } /** - * @throws \Throwable + * Update attributes weight. + * + * @param array $attributeWeights + * @return void */ - private function reindex() + protected function updateAttributesWeight(array $attributeWeights): void { - CacheCleaner::cleanAll(); + foreach ($attributeWeights as $attributeCode => $weight) { + $attribute = $this->productAttributeRepository->get($attributeCode); - /** @var Indexer $indexer */ - $indexer = $this->objectManager->create(Indexer::class); - $indexer->load('catalogsearch_fulltext'); - $indexer->reindexAll(); + if ($attribute) { + $attribute->setSearchWeight($weight); + $this->productAttributeRepository->save($attribute); + } + } } /** - * @param string $query + * Get all names from founded products. + * + * @param Product[] $products * @return array - * @throws NoSuchEntityException */ - private function findProducts(string $query): array + protected function collectProductsName(array $products): array { - $config = $this->objectManager->create(RequestConfig::class); - - /** @var Builder $requestBuilder */ - $requestBuilder = $this->objectManager->create( - Builder::class, - ['config' => $config] - ); - $requestBuilder->bind('search_term', $query); - $requestBuilder->setRequestName('quick_search_container'); - - /** @var QueryResponse $searchResult */ - $searchResults = $this->objectManager->create(SearchEngineInterface::class) - ->search($requestBuilder->create()); - - $products = []; - foreach ($searchResults as $searchResult) { - $products [] = $this->productRepository->getById($searchResult->getId()); + $result = []; + foreach ($products as $product) { + $result[] = $product->getName(); } - return $products; + return $result; } /** - * @dataProvider skuOverNameAttributeSearchWeightDataProvider - * @magentoConfigFixture default/catalog/search/engine elasticsearch6 - * @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix composite_product_search - * @magentoDataFixture Magento/CatalogSearch/_files/products_for_sku_search_weight_score.php - * @param string $searchQuery - * @param int $skuSearchWeight - * @param int $nameSearchWeight - * @param string $firstMatchProductName - * @param string $secondMatchProductName - * @throws NoSuchEntityException - * @throws \Throwable + * Reindex catalogsearch fulltext index. + * + * @return void */ - public function testSkuOverNameAttributeSearchWeight( - string $searchQuery, - int $skuSearchWeight, - int $nameSearchWeight, - string $firstMatchProductName, - string $secondMatchProductName - ) { - $this->setAttributeSearchWeight('sku', $skuSearchWeight); - $this->setAttributeSearchWeight('name', $nameSearchWeight); - $this->reindex(); - - /** @var Product $products [] */ - $products = $this->findProducts($searchQuery); + protected function removeInstancesCache(): void + { + $this->objectManager->removeSharedInstance(RequestConfig::class); + $this->objectManager->removeSharedInstance(Builder::class); + $this->objectManager->removeSharedInstance(Search::class); + $this->objectManager->removeSharedInstance(CatalogLayerSearch::class); + } - $this->assertCount( - 2, - $products, - 'Expected to find 2 products, found ' . count($products) . '.' - ); - - $this->assertEquals( - $firstMatchProductName, - $products[0]->getData('name'), - 'Products order is not as expected.' - ); - $this->assertEquals( - $secondMatchProductName, - $products[1]->getData('name'), - 'Products order is not as expected.' - ); + /** + * Find products by search query. + * + * @param string $query + * @return Product[] + */ + protected function findProducts(string $query): array + { + $testProductCollection = $this->catalogLayerSearch->getProductCollection(); + $testProductCollection->addSearchFilter($query); + $testProductCollection->setOrder('relevance', 'desc'); + + return $testProductCollection->getItems(); } - public function skuOverNameAttributeSearchWeightDataProvider(): array + /** + * Collect weight of attributes which use in test. + * + * @return void + */ + private function collectCurrentProductAttributesWeights(): void { - return [ - ['1-2-3-4', 10, 5, 'test', '1-2-3-4'], - ['1-2-3-4', 5, 10, '1-2-3-4', 'test'], - ]; + if (empty($this->collectedAttributesWeight)) { + $attributeCodes = [ + 'sku', + 'name', + 'description', + 'test_searchable_attribute' + ]; + foreach ($attributeCodes as $attributeCode) { + $attribute = $this->productAttributeRepository->get($attributeCode); + $this->collectedAttributesWeight[$attribute->getAttributeCode()] = $attribute->getSearchWeight(); + } + } } } diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/product_for_search.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/product_for_search.php index afeb250a5921a..75654f8d7d272 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/product_for_search.php +++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/product_for_search.php @@ -3,22 +3,49 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + declare(strict_types=1); require 'searchable_attribute.php'; -require __DIR__ . '/../../../Magento/Catalog/_files/product_simple.php'; - -/** @var $objectManager \Magento\TestFramework\ObjectManager */ -$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); -/** @var \Magento\Store\Model\StoreManager $storeManager */ -$storeManager = $objectManager->get(\Magento\Store\Model\StoreManager::class); -$storeManager->setIsSingleStoreModeAllowed(false); -/** @var \Magento\Store\Model\Store $store */ -$store = $storeManager->getStore('default'); +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Product\Attribute\Source\Status; +use Magento\Catalog\Model\Product\Type; +use Magento\Catalog\Model\Product\Visibility; +use Magento\Catalog\Model\ProductFactory; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\ObjectManager; -/** @var \Magento\Catalog\Model\Product $product */ -$product = $objectManager->create(\Magento\Catalog\Model\ProductRepository::class)->get('simple'); -/** @var \Magento\Catalog\Model\Product\Action $productAction */ -$productAction = $objectManager->create(\Magento\Catalog\Model\Product\Action::class); -$productAction->updateAttributes([$product->getId()], ['test_searchable_attribute' => 'VALUE1'], $store->getId()); +/** @var ObjectManager $objectManager */ +$objectManager = Bootstrap::getObjectManager(); +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->get(ProductRepositoryInterface::class); +/** @var ProductFactory $productFactory */ +$productFactory = $objectManager->get(ProductFactory::class); +$product = $productFactory->create(); +$product->isObjectNew(true); +$product->setTypeId(Type::TYPE_SIMPLE) + ->setAttributeSetId($product->getDefaultAttributeSetId()) + ->setWebsiteIds([1]) + ->setName('Simple product name') + ->setSku('simple_for_search') + ->setPrice(100) + ->setWeight(1) + ->setShortDescription('Product short description') + ->setTaxClassId(0) + ->setDescription('Product description') + ->setMetaTitle('meta title') + ->setMetaKeyword('meta keyword') + ->setMetaDescription('meta description') + ->setVisibility(Visibility::VISIBILITY_BOTH) + ->setStatus(Status::STATUS_ENABLED) + ->setTestSearchableAttribute($attribute->getSource()->getOptionId('Option 1')) + ->setStockData( + [ + 'use_config_manage_stock' => 1, + 'qty' => 100, + 'is_qty_decimal' => 0, + 'is_in_stock' => 1, + ] + ); +$productRepository->save($product); diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/product_for_search_rollback.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/product_for_search_rollback.php index 00e2096ca734a..84f2e12e03b2d 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/product_for_search_rollback.php +++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/product_for_search_rollback.php @@ -3,25 +3,37 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + declare(strict_types=1); -/** @var $objectManager \Magento\TestFramework\ObjectManager */ -$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); -$registry = $objectManager->get(\Magento\Framework\Registry::class); +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Product; +use Magento\Eav\Setup\EavSetup; +use Magento\Eav\Setup\EavSetupFactory; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Registry; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\ObjectManager; +/** @var ObjectManager $objectManager */ +$objectManager = Bootstrap::getObjectManager(); +/** @var EavSetupFactory $eavSetupFactory */ +$eavSetupFactory = $objectManager->create(EavSetupFactory::class); +/** @var Registry $registry */ +$registry = $objectManager->get(Registry::class); +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->create(ProductRepositoryInterface::class); $registry->unregister('isSecureArea'); $registry->register('isSecureArea', true); -/** @var \Magento\Catalog\Model\Product $product */ -$product = $objectManager->create(\Magento\Catalog\Model\ProductRepository::class)->get('simple'); -/** @var \Magento\Catalog\Model\ResourceModel\Product $productResource */ -$productResource = $objectManager->create(\Magento\Catalog\Model\ResourceModel\Product::class); -$productResource->delete($product); - -$eavSetupFactory = $objectManager->create(\Magento\Eav\Setup\EavSetupFactory::class); -/** @var \Magento\Eav\Setup\EavSetup $eavSetup */ +try { + $productRepository->deleteById('simple_for_search'); +} catch (NoSuchEntityException $e) { + //Product already deleted. +} +/** @var EavSetup $eavSetup */ $eavSetup = $eavSetupFactory->create(); -$eavSetup->removeAttribute(\Magento\Catalog\Model\Product::ENTITY, 'test_searchable_attribute'); +$eavSetup->removeAttribute(Product::ENTITY, 'test_searchable_attribute'); $registry->unregister('isSecureArea'); $registry->register('isSecureArea', false); diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/products_for_sku_search_weight_score.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/products_for_sku_search_weight_score.php index 96d5c256dc727..cb7aaa9f16a19 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/products_for_sku_search_weight_score.php +++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/products_for_sku_search_weight_score.php @@ -3,22 +3,69 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + +require 'searchable_attribute.php'; use Magento\Catalog\Api\ProductRepositoryInterface; -use Magento\Catalog\Model\Product; use Magento\Catalog\Model\Product\Attribute\Source\Status; use Magento\Catalog\Model\Product\Type; use Magento\Catalog\Model\Product\Visibility; +use Magento\Catalog\Model\ProductFactory; use Magento\TestFramework\Helper\Bootstrap; +$objectManager = Bootstrap::getObjectManager(); /** @var ProductRepositoryInterface $productRepository */ -$productRepository = Bootstrap::getObjectManager()->create(ProductRepositoryInterface::class); -$product = Bootstrap::getObjectManager()->create(Product::class); +$productRepository = $objectManager->create(ProductRepositoryInterface::class); +/** @var ProductFactory $productFactory */ +$productFactory = $objectManager->get(ProductFactory::class); +$product = $productFactory->create(); +$product->setTypeId(Type::TYPE_SIMPLE) + ->setAttributeSetId($product->getDefaultAttributeSetId()) + ->setWebsiteIds([1]) + ->setName('Simple') + ->setSku('1234-1234-1234-1234') + ->setPrice(10) + ->setTaxClassId(0) + ->setVisibility(Visibility::VISIBILITY_BOTH) + ->setStatus(Status::STATUS_ENABLED) + ->setStockData( + [ + 'use_config_manage_stock' => 1, + 'qty' => 100, + 'is_qty_decimal' => 0, + 'is_in_stock' => 1, + ] + ); +$productRepository->save($product); + +$product = $productFactory->create(); +$product->setTypeId(Type::TYPE_SIMPLE) + ->setAttributeSetId($product->getDefaultAttributeSetId()) + ->setWebsiteIds([1]) + ->setName('1234-1234-1234-1234') + ->setSku('Simple') + ->setPrice(10) + ->setTaxClassId(0) + ->setVisibility(Visibility::VISIBILITY_BOTH) + ->setStatus(Status::STATUS_ENABLED) + ->setStockData( + [ + 'use_config_manage_stock' => 1, + 'qty' => 100, + 'is_qty_decimal' => 0, + 'is_in_stock' => 1, + ] + ); +$productRepository->save($product); + +$product = $productFactory->create(); $product->setTypeId(Type::TYPE_SIMPLE) - ->setAttributeSetId(4) + ->setAttributeSetId($product->getDefaultAttributeSetId()) ->setWebsiteIds([1]) - ->setName('1-2-3-4') - ->setSku('testsku') + ->setName('Product with description') + ->setSku('product_with_description') + ->setDescription('Simple') ->setPrice(10) ->setTaxClassId(0) ->setVisibility(Visibility::VISIBILITY_BOTH) @@ -33,16 +80,17 @@ ); $productRepository->save($product); -$product = Bootstrap::getObjectManager()->create(Product::class); +$product = $productFactory->create(); $product->setTypeId(Type::TYPE_SIMPLE) - ->setAttributeSetId(4) + ->setAttributeSetId($product->getDefaultAttributeSetId()) ->setWebsiteIds([1]) - ->setName('test') - ->setSku('1-2-3-4') + ->setName('Product with attribute') + ->setSku('product_with_attribute') ->setPrice(10) ->setTaxClassId(0) ->setVisibility(Visibility::VISIBILITY_BOTH) ->setStatus(Status::STATUS_ENABLED) + ->setTestSearchableAttribute($attribute->getSource()->getOptionId('Simple')) ->setStockData( [ 'use_config_manage_stock' => 1, diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/products_for_sku_search_weight_score_rollback.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/products_for_sku_search_weight_score_rollback.php new file mode 100644 index 0000000000000..775d405654fdf --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/products_for_sku_search_weight_score_rollback.php @@ -0,0 +1,41 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\ProductAttributeRepositoryInterface; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Registry; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); +/** @var ProductAttributeRepositoryInterface $productAttributeRepository */ +$productAttributeRepository = $objectManager->get(ProductAttributeRepositoryInterface::class); +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->create(ProductRepositoryInterface::class); +/** @var Registry $registry */ +$registry = $objectManager->get(Registry::class); +$productSkus = ['1234-1234-1234-1234', 'Simple', 'product_with_description', 'product_with_attribute']; + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); + +foreach ($productSkus as $productSku) { + try { + $productRepository->deleteById($productSku); + } catch (NoSuchEntityException $e) { + //Product already deleted. + } +} + +try { + $productAttributeRepository->deleteById('test_searchable_attribute'); +} catch (NoSuchEntityException $e) { + //attribute already deleted. +} + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/searchable_attribute.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/searchable_attribute.php index b25d39b1d40b8..0d20dcb24dfbf 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/searchable_attribute.php +++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/searchable_attribute.php @@ -3,25 +3,62 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + declare(strict_types=1); -$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); -$eavSetupFactory = $objectManager->create(\Magento\Eav\Setup\EavSetupFactory::class); -/** @var \Magento\Eav\Setup\EavSetup $eavSetup */ -$eavSetup = $eavSetupFactory->create(); -$eavSetup->addAttribute( - \Magento\Catalog\Model\Product::ENTITY, - 'test_searchable_attribute', - [ - 'label' => 'Test-attribute', - 'global' => \Magento\Catalog\Model\ResourceModel\Eav\Attribute::SCOPE_STORE, - 'required' => 0, - 'user_defined' => 1, - 'searchable' => 1, - 'visible_on_front' => 1, - 'filterable_in_search' => 1, - 'used_in_product_listing' => 1, - 'is_used_in_grid' => 1, - 'is_filterable_in_grid' => 1, - ] -); +use Magento\Catalog\Api\ProductAttributeRepositoryInterface; +use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\ResourceModel\Eav\AttributeFactory; +use Magento\Eav\Setup\EavSetup; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); +/** @var AttributeFactory $attributeFactory */ +$attributeFactory = $objectManager->get(AttributeFactory::class); +/** @var ProductAttributeRepositoryInterface $productAttributeRepository */ +$productAttributeRepository = $objectManager->get(ProductAttributeRepositoryInterface::class); +$attribute = $attributeFactory->create()->loadByCode(Product::ENTITY, 'test_searchable_attribute'); +if (!$attribute->getId()) { + /** @var EavSetup $installer */ + $installer = $objectManager->create(EavSetup::class); + $attribute->setData( + [ + 'attribute_code' => 'test_searchable_attribute', + 'is_global' => 0, + 'is_user_defined' => 1, + 'frontend_input' => 'select', + 'is_unique' => 0, + 'is_required' => 0, + 'is_searchable' => 1, + 'is_visible_in_advanced_search' => 1, + 'is_comparable' => 0, + 'is_filterable' => 1, + 'is_filterable_in_search' => 1, + 'is_used_for_promo_rules' => 0, + 'is_html_allowed_on_front' => 1, + 'is_visible_on_front' => 0, + 'used_in_product_listing' => 0, + 'used_for_sort_by' => 0, + 'frontend_label' => ['Test Drop-Down Attribute'], + 'backend_type' => 'int', + 'option' => [ + 'value' => [ + 'option_1' => ['Option 1'], + 'option_2' => ['Option 2'], + 'option_3' => ['Option 3'], + 'option_4' => ['Simple'] + ], + 'order' => [ + 'option_1' => 1, + 'option_2' => 2, + 'option_3' => 3, + 'option_4' => 4, + ], + ], + ] + ); + $productAttributeRepository->save($attribute); + $attribute = $productAttributeRepository->get('test_searchable_attribute'); + /* Assign attribute to attribute set */ + $installer->addAttributeToGroup(Product::ENTITY, 'Default', 'Attributes', $attribute->getId()); +} diff --git a/dev/tests/integration/testsuite/Magento/Elasticsearch6/CatalogSearch/Controller/Advanced/ResultTest.php b/dev/tests/integration/testsuite/Magento/Elasticsearch6/CatalogSearch/Controller/Advanced/ResultTest.php new file mode 100644 index 0000000000000..5f20c1bf82062 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Elasticsearch6/CatalogSearch/Controller/Advanced/ResultTest.php @@ -0,0 +1,37 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Elasticsearch6\CatalogSearch\Controller\Advanced; + +use Magento\CatalogSearch\Controller\Advanced\ResultTest as CatalogSearchResultTest; + +/** + * Test cases for catalog advanced search using Elasticsearch 6.0+ search engine. + * + * @magentoDbIsolation disabled + * @magentoAppIsolation enabled + */ +class ResultTest extends CatalogSearchResultTest +{ + /** + * Advanced search test by difference product attributes. + * + * @magentoAppArea frontend + * @magentoConfigFixture default/catalog/search/engine elasticsearch6 + * @magentoDataFixture Magento/CatalogSearch/_files/product_for_search.php + * @magentoDataFixture Magento/CatalogSearch/_files/full_reindex.php + * @dataProvider searchStringDataProvider + * phpcs:disable Generic.CodeAnalysis.UselessOverridingMethod + * + * @param array $searchParams + * @return void + */ + public function testExecute(array $searchParams): void + { + parent::testExecute($searchParams); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Elasticsearch6/CatalogSearch/Controller/Result/IndexTest.php b/dev/tests/integration/testsuite/Magento/Elasticsearch6/CatalogSearch/Controller/Result/IndexTest.php new file mode 100644 index 0000000000000..492983eb8726d --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Elasticsearch6/CatalogSearch/Controller/Result/IndexTest.php @@ -0,0 +1,37 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Elasticsearch6\CatalogSearch\Controller\Result; + +use Magento\CatalogSearch\Controller\Result\IndexTest as CatalogSearchIndexTest; + +/** + * Test cases for catalog quick search using Elasticsearch 6.0+ search engine. + * + * @magentoDbIsolation disabled + * @magentoAppIsolation enabled + */ +class IndexTest extends CatalogSearchIndexTest +{ + /** + * Quick search test by difference product attributes. + * + * @magentoAppArea frontend + * @magentoConfigFixture default/catalog/search/engine elasticsearch6 + * @magentoDataFixture Magento/CatalogSearch/_files/product_for_search.php + * @magentoDataFixture Magento/CatalogSearch/_files/full_reindex.php + * @dataProvider searchStringDataProvider + * phpcs:disable Generic.CodeAnalysis.UselessOverridingMethod + * + * @param string $searchString + * @return void + */ + public function testExecute(string $searchString): void + { + parent::testExecute($searchString); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Elasticsearch6/CatalogSearch/Model/Indexer/fulltext/Action/DataProviderTest.php b/dev/tests/integration/testsuite/Magento/Elasticsearch6/CatalogSearch/Model/Indexer/fulltext/Action/DataProviderTest.php new file mode 100644 index 0000000000000..b50d9034c0f88 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Elasticsearch6/CatalogSearch/Model/Indexer/fulltext/Action/DataProviderTest.php @@ -0,0 +1,32 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Elasticsearch6\CatalogSearch\Model\Indexer\fulltext\Action; + +use Magento\CatalogSearch\Model\Indexer\Fulltext\Action\DataProviderTest as CatalogSearchDataProviderTest; + +/** + * Search products by attribute value using Elasticsearch 6.0+ search engine. + */ +class DataProviderTest extends CatalogSearchDataProviderTest +{ + /** + * Search product by custom attribute value. + * + * @magentoConfigFixture default/catalog/search/engine elasticsearch6 + * @magentoDataFixture Magento/CatalogSearch/_files/product_for_search.php + * @magentoDataFixture Magento/CatalogSearch/_files/full_reindex.php + * @magentoDbIsolation disabled + * phpcs:disable Generic.CodeAnalysis.UselessOverridingMethod + * + * @return void + */ + public function testSearchProductByAttribute(): void + { + parent::testSearchProductByAttribute(); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Elasticsearch6/CatalogSearch/Model/Search/AttributeSearchWeightTest.php b/dev/tests/integration/testsuite/Magento/Elasticsearch6/CatalogSearch/Model/Search/AttributeSearchWeightTest.php new file mode 100644 index 0000000000000..71dfebe5a4e84 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Elasticsearch6/CatalogSearch/Model/Search/AttributeSearchWeightTest.php @@ -0,0 +1,107 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Elasticsearch6\CatalogSearch\Model\Search; + +use Magento\CatalogSearch\Model\Search\AttributeSearchWeightTest as CatalogSearchAttributeSearchWeightTest; + +/** + * Test founded products order after quick search with changed attribute search weight + * using Elasticsearch 6.0+ search engine. + * + * @magentoAppIsolation enabled + */ +class AttributeSearchWeightTest extends CatalogSearchAttributeSearchWeightTest +{ + /** + * Perform search by word and check founded product order in different cases. + * + * @magentoConfigFixture default/catalog/search/engine elasticsearch6 + * @magentoDataFixture Magento/CatalogSearch/_files/products_for_sku_search_weight_score.php + * @magentoDataFixture Magento/CatalogSearch/_files/full_reindex.php + * @dataProvider attributeSearchWeightDataProvider + * @magentoDbIsolation enabled + * + * @param string $searchQuery + * @param array $attributeWeights + * @param array $expectedProductNames + * phpcs:disable Generic.CodeAnalysis.UselessOverridingMethod + * + * @return void + */ + public function testAttributeSearchWeight( + string $searchQuery, + array $attributeWeights, + array $expectedProductNames + ): void { + $this->markTestSkipped('This test need stabilization. MC-29260'); + parent::testAttributeSearchWeight($searchQuery, $attributeWeights, $expectedProductNames); + } + + /** + * Data provider with word for quick search, attributes weight and expected products name order. + * + * @return array + */ + public function attributeSearchWeightDataProvider(): array + { + return [ + 'sku_order_more_than_name' => [ + '1234-1234-1234-1234', + [ + 'sku' => 6, + 'name' => 5, + ], + [ + '1234-1234-1234-1234', + 'Simple', + ], + ], + 'name_order_more_than_sku' => [ + '1234-1234-1234-1234', + [ + 'name' => 6, + 'sku' => 5, + ], + [ + '1234-1234-1234-1234', + 'Simple', + ], + ], + 'search_by_word_from_description' => [ + 'Simple', + [ + 'name' => 10, + 'test_searchable_attribute' => 9, + 'sku' => 2, + 'description' => 1, + ], + [ + 'Simple', + 'Product with attribute', + '1234-1234-1234-1234', + 'Product with description', + ], + ], + 'search_by_attribute_option' => [ + 'Simple', + [ + 'name' => 10, + 'description' => 9, + 'test_searchable_attribute' => 7, + 'sku' => 2, + ], + [ + 'Simple', + 'Product with description', + 'Product with attribute', + '1234-1234-1234-1234', + ], + ], + ]; + } +} From 1a52c071f91bef9b89fa61d369d6d530a20974fb Mon Sep 17 00:00:00 2001 From: Mykhailo Matiola <mykhailo.matiola@transoftgroup.com> Date: Mon, 16 Dec 2019 16:54:51 +0200 Subject: [PATCH 353/586] MC-25146: Layered Navigation with different product attributes on Catalog Search Results page --- .../Block/Navigation/AbstractCategoryTest.php | 101 ------- .../Block/Navigation/AbstractFiltersTest.php | 278 ++++++++++++++++++ .../Category/AbstractFiltersTest.php | 161 ---------- .../Navigation/Category/BooleanFilterTest.php | 30 +- .../Navigation/Category/DecimalFilterTest.php | 28 +- .../Category/MultiselectFilterTest.php | 30 +- .../Navigation/Category/SelectFilterTest.php | 30 +- .../Block/Navigation/CategoryTest.php | 81 ++++- .../Navigation/Search/BooleanFilterTest.php | 81 +++++ .../Navigation/Search/DecimalFilterTest.php | 72 +++++ .../Search/MultiselectFilterTest.php | 84 ++++++ .../Navigation/Search/SelectFilterTest.php | 82 ++++++ .../Category/SwatchTextFilterTest.php | 31 +- .../Category/SwatchVisualFilterTest.php | 31 +- .../Search/SwatchTextFilterTest.php | 82 ++++++ .../Search/SwatchVisualFilterTest.php | 82 ++++++ 16 files changed, 983 insertions(+), 301 deletions(-) delete mode 100644 dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/AbstractCategoryTest.php create mode 100644 dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/AbstractFiltersTest.php delete mode 100644 dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Category/AbstractFiltersTest.php create mode 100644 dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Search/BooleanFilterTest.php create mode 100644 dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Search/DecimalFilterTest.php create mode 100644 dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Search/MultiselectFilterTest.php create mode 100644 dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Search/SelectFilterTest.php create mode 100644 dev/tests/integration/testsuite/Magento/SwatchesLayeredNavigation/Block/Navigation/Search/SwatchTextFilterTest.php create mode 100644 dev/tests/integration/testsuite/Magento/SwatchesLayeredNavigation/Block/Navigation/Search/SwatchVisualFilterTest.php diff --git a/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/AbstractCategoryTest.php b/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/AbstractCategoryTest.php deleted file mode 100644 index aad0fcd08656f..0000000000000 --- a/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/AbstractCategoryTest.php +++ /dev/null @@ -1,101 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -namespace Magento\LayeredNavigation\Block\Navigation; - -use Magento\Catalog\Api\Data\CategoryInterface; -use Magento\Catalog\Model\ResourceModel\Category as CategoryResource; -use Magento\Catalog\Model\ResourceModel\Category\Collection; -use Magento\Catalog\Model\ResourceModel\Category\CollectionFactory; -use Magento\Framework\ObjectManagerInterface; -use Magento\Framework\View\LayoutInterface; -use Magento\LayeredNavigation\Block\Navigation; -use Magento\Store\Model\Store; -use Magento\TestFramework\Helper\Bootstrap; -use PHPUnit\Framework\TestCase; - -/** - * Base class for filters block tests on category page. - */ -abstract class AbstractCategoryTest extends TestCase -{ - /** - * @var ObjectManagerInterface - */ - protected $objectManager; - - /** - * @var CollectionFactory - */ - protected $categoryCollectionFactory; - - /** - * @var CategoryResource - */ - protected $categoryResource; - - /** - * @var Navigation - */ - protected $navigationBlock; - - /** - * @var LayoutInterface - */ - protected $layout; - - /** - * @inheritdoc - */ - protected function setUp() - { - $this->objectManager = Bootstrap::getObjectManager(); - $this->categoryCollectionFactory = $this->objectManager->create(CollectionFactory::class); - $this->categoryResource = $this->objectManager->get(CategoryResource::class); - $this->layout = $this->objectManager->get(LayoutInterface::class); - $this->navigationBlock = $this->objectManager->create(Category::class); - parent::setUp(); - } - - /** - * Inits navigation block. - * - * @param string $categoryName - * @param int $storeId - * @return void - */ - protected function prepareNavigationBlock( - string $categoryName, - int $storeId = Store::DEFAULT_STORE_ID - ): void { - $category = $this->loadCategory($categoryName, $storeId); - $this->navigationBlock->getLayer()->setCurrentCategory($category); - $this->navigationBlock->setLayout($this->layout); - } - - /** - * Loads category by id. - * - * @param string $categoryName - * @param int $storeId - * @return CategoryInterface - */ - protected function loadCategory(string $categoryName, int $storeId): CategoryInterface - { - /** @var Collection $categoryCollection */ - $categoryCollection = $this->categoryCollectionFactory->create(); - /** @var CategoryInterface $category */ - $category = $categoryCollection->setStoreId($storeId) - ->addAttributeToSelect('display_mode', 'left') - ->addAttributeToFilter(CategoryInterface::KEY_NAME, $categoryName) - ->setPageSize(1) - ->getFirstItem(); - $category->setStoreId($storeId); - - return $category; - } -} diff --git a/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/AbstractFiltersTest.php b/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/AbstractFiltersTest.php new file mode 100644 index 0000000000000..472eac444b9d4 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/AbstractFiltersTest.php @@ -0,0 +1,278 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\LayeredNavigation\Block\Navigation; + +use Magento\Catalog\Api\Data\CategoryInterface; +use Magento\Catalog\Api\ProductAttributeRepositoryInterface; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Layer\Filter\AbstractFilter; +use Magento\Catalog\Model\Layer\Filter\Item; +use Magento\Catalog\Model\Layer\Resolver; +use Magento\Catalog\Model\ResourceModel\Category\Collection; +use Magento\Catalog\Model\ResourceModel\Category\CollectionFactory; +use Magento\CatalogSearch\Model\Indexer\Fulltext\Processor; +use Magento\Framework\ObjectManagerInterface; +use Magento\Framework\Search\Request\Builder; +use Magento\Framework\Search\Request\Config; +use Magento\Framework\View\LayoutInterface; +use Magento\LayeredNavigation\Block\Navigation; +use Magento\LayeredNavigation\Block\Navigation\Search as SearchNavigationBlock; +use Magento\LayeredNavigation\Block\Navigation\Category as CategoryNavigationBlock; +use Magento\Search\Model\Search; +use Magento\Store\Model\Store; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; + +/** + * Base class for custom filters in navigation block on category page. + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ +abstract class AbstractFiltersTest extends TestCase +{ + /** + * @var ObjectManagerInterface + */ + protected $objectManager; + + /** + * @var CollectionFactory + */ + protected $categoryCollectionFactory; + + /** + * @var Navigation + */ + protected $navigationBlock; + + /** + * @var LayoutInterface + */ + protected $layout; + + /** + * @var ProductAttributeRepositoryInterface + */ + protected $attributeRepository; + + /** + * @var ProductRepositoryInterface + */ + protected $productRepository; + + /** + * @inheritdoc + */ + protected function setUp() + { + parent::setUp(); + $this->objectManager = Bootstrap::getObjectManager(); + $this->categoryCollectionFactory = $this->objectManager->create(CollectionFactory::class); + $this->layout = $this->objectManager->get(LayoutInterface::class); + $layerResolver = $this->objectManager->create(Resolver::class); + + if ($this->getLayerType() === Resolver::CATALOG_LAYER_SEARCH) { + $layerResolver->create(Resolver::CATALOG_LAYER_SEARCH); + $this->navigationBlock = $this->objectManager->create( + SearchNavigationBlock::class, + [ + 'layerResolver' => $layerResolver, + ] + ); + } else { + $this->navigationBlock = $this->objectManager->create(CategoryNavigationBlock::class); + } + + $this->attributeRepository = $this->objectManager->create(ProductAttributeRepositoryInterface::class); + $this->productRepository = $this->objectManager->create(ProductRepositoryInterface::class); + } + + /** + * Returns layer type for navigation block. + * + * @return string + */ + abstract protected function getLayerType(): string; + + /** + * Returns attribute code. + * + * @return string + */ + abstract protected function getAttributeCode(): string; + + /** + * Tests getFilters method from navigation block on category page. + * + * @param array $products + * @param array $attributeData + * @param array $expectation + * @param string $categoryName + * @return void + */ + protected function getCategoryFiltersAndAssert( + array $products, + array $attributeData, + array $expectation, + string $categoryName + ): void { + $this->updateAttribute($this->getAttributeCode(), $attributeData); + $this->updateProducts($products, $this->getAttributeCode()); + $this->clearInstanceAndReindexSearch(); + $category = $this->loadCategory($categoryName, Store::DEFAULT_STORE_ID); + $this->navigationBlock->getLayer()->setCurrentCategory($category); + $this->navigationBlock->setLayout($this->layout); + $filter = $this->getFilterByCode($this->navigationBlock->getFilters(), $this->getAttributeCode()); + + if ($attributeData['is_filterable']) { + $this->assertNotNull($filter); + $this->assertEquals($expectation, $this->prepareFilterItems($filter)); + } else { + $this->assertNull($filter); + } + } + + /** + * Tests getFilters method from navigation block on search page. + * + * @param array $products + * @param array $attributeData + * @param array $expectation + * @return void + */ + protected function getSearchFiltersAndAssert( + array $products, + array $attributeData, + array $expectation + ): void { + $this->updateAttribute($this->getAttributeCode(), $attributeData); + $this->updateProducts($products, $this->getAttributeCode()); + $this->clearInstanceAndReindexSearch(); + $this->navigationBlock->getRequest()->setParams(['q' => 'Simple Product']); + $this->navigationBlock->setLayout($this->layout); + $filter = $this->getFilterByCode($this->navigationBlock->getFilters(), $this->getAttributeCode()); + + if ($attributeData['is_filterable_in_search']) { + $this->assertNotNull($filter); + $this->assertEquals($expectation, $this->prepareFilterItems($filter)); + } else { + $this->assertNull($filter); + } + } + + /** + * Returns filter with specified attribute. + * + * @param AbstractFilter[] $filters + * @param string $code + * @return AbstractFilter|null + */ + protected function getFilterByCode(array $filters, string $code): ?AbstractFilter + { + $filter = array_filter( + $filters, + function (AbstractFilter $filter) use ($code) { + return $filter->getData('attribute_model') + && $filter->getData('attribute_model')->getAttributeCode() === $code; + } + ); + + return array_shift($filter); + } + + /** + * Updates attribute data. + * + * @param string $attributeCode + * @param array $data + * @return void + */ + protected function updateAttribute( + string $attributeCode, + array $data + ): void { + $attribute = $this->attributeRepository->get($attributeCode); + $attribute->addData($data); + $this->attributeRepository->save($attribute); + } + + /** + * Returns filter items as array. + * + * @param AbstractFilter $filter + * @return array + */ + protected function prepareFilterItems(AbstractFilter $filter): array + { + $items = []; + /** @var Item $item */ + foreach ($filter->getItems() as $item) { + $items[] = [ + 'label' => $item->getData('label'), + 'count' => $item->getData('count'), + ]; + } + + return $items; + } + + /** + * Update products data by attribute. + * + * @param array $products + * @param string $attributeCode + * @return void + */ + protected function updateProducts(array $products, string $attributeCode): void + { + $attribute = $this->attributeRepository->get($attributeCode); + + foreach ($products as $productSku => $stringValue) { + $product = $this->productRepository->get($productSku, false, Store::DEFAULT_STORE_ID, true); + $product->addData( + [$attribute->getAttributeCode() => $attribute->getSource()->getOptionId($stringValue)] + ); + $this->productRepository->save($product); + } + } + + /** + * Clears instances and rebuilds seqrch index. + * + * @return void + */ + protected function clearInstanceAndReindexSearch(): void + { + $this->objectManager->removeSharedInstance(Config::class); + $this->objectManager->removeSharedInstance(Builder::class); + $this->objectManager->removeSharedInstance(Search::class); + $this->objectManager->create(Processor::class)->reindexAll(); + } + + /** + * Loads category by id. + * + * @param string $categoryName + * @param int $storeId + * @return CategoryInterface + */ + protected function loadCategory(string $categoryName, int $storeId): CategoryInterface + { + /** @var Collection $categoryCollection */ + $categoryCollection = $this->categoryCollectionFactory->create(); + /** @var CategoryInterface $category */ + $category = $categoryCollection->setStoreId($storeId) + ->addAttributeToSelect('display_mode', 'left') + ->addAttributeToFilter(CategoryInterface::KEY_NAME, $categoryName) + ->setPageSize(1) + ->getFirstItem(); + $category->setStoreId($storeId); + + return $category; + } +} diff --git a/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Category/AbstractFiltersTest.php b/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Category/AbstractFiltersTest.php deleted file mode 100644 index 00c14b6a72d04..0000000000000 --- a/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Category/AbstractFiltersTest.php +++ /dev/null @@ -1,161 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -namespace Magento\LayeredNavigation\Block\Navigation\Category; - -use Magento\Catalog\Api\ProductAttributeRepositoryInterface; -use Magento\Catalog\Api\ProductRepositoryInterface; -use Magento\Catalog\Model\Layer\Filter\AbstractFilter; -use Magento\Catalog\Model\Layer\Filter\Item; -use Magento\CatalogSearch\Model\Indexer\Fulltext\Processor; -use Magento\Framework\Search\Request\Builder; -use Magento\Framework\Search\Request\Config; -use Magento\LayeredNavigation\Block\Navigation\AbstractCategoryTest; -use Magento\Search\Model\Search; -use Magento\Store\Model\Store; - -/** - * Base class for custom filters in navigation block on category page. - */ -abstract class AbstractFiltersTest extends AbstractCategoryTest -{ - /** - * @var ProductAttributeRepositoryInterface - */ - protected $attributeRepository; - - /** - * @var ProductRepositoryInterface - */ - protected $productRepository; - - /** - * @inheritdoc - */ - protected function setUp() - { - parent::setUp(); - $this->attributeRepository = $this->objectManager->create(ProductAttributeRepositoryInterface::class); - $this->productRepository = $this->objectManager->create(ProductRepositoryInterface::class); - } - - /** - * Tests getFilters method from navigation block. - * - * @param array $products - * @param int $filterable - * @param array $expectation - * @param string $attributeCode - * @return void - */ - protected function getFiltersAndAssert( - array $products, - int $filterable, - array $expectation, - string $attributeCode - ): void { - $this->updateAttribute($attributeCode, $filterable); - $this->updateProducts($products, $attributeCode); - $this->prepareNavigationBlock('Category 999'); - $filter = $this->getFilterByCode($this->navigationBlock->getFilters(), $attributeCode); - - if ($filterable) { - $this->assertNotNull($filter); - $this->assertEquals($expectation, $this->prepareFilterItems($filter)); - } else { - $this->assertNull($filter); - } - } - - /** - * @inheritdoc - */ - protected function prepareNavigationBlock(string $categoryName, int $storeId = Store::DEFAULT_STORE_ID): void - { - $this->objectManager->removeSharedInstance(Config::class); - $this->objectManager->removeSharedInstance(Builder::class); - $this->objectManager->removeSharedInstance(Search::class); - $this->objectManager->create(Processor::class)->reindexAll(); - parent::prepareNavigationBlock($categoryName, $storeId); - } - - /** - * Returns filter with specified attribute. - * - * @param AbstractFilter[] $filters - * @param string $code - * @return AbstractFilter|null - */ - protected function getFilterByCode(array $filters, string $code): ?AbstractFilter - { - $filter = array_filter( - $filters, - function (AbstractFilter $filter) use ($code) { - return $filter->getData('attribute_model') - && $filter->getData('attribute_model')->getAttributeCode() === $code; - } - ); - - return array_shift($filter); - } - - /** - * Updates attribute data. - * - * @param string $attributeCode - * @param int $filterable - * @return void - */ - protected function updateAttribute( - string $attributeCode, - int $filterable - ): void { - $attribute = $this->attributeRepository->get($attributeCode); - $attribute->setData('is_filterable', $filterable); - $this->attributeRepository->save($attribute); - } - - /** - * Returns filter items as array. - * - * @param AbstractFilter $filter - * @return array - */ - protected function prepareFilterItems(AbstractFilter $filter): array - { - $items = []; - /** @var Item $item */ - foreach ($filter->getItems() as $item) { - $items[] = [ - 'label' => $item->getData('label'), - 'count' => $item->getData('count'), - ]; - } - - return $items; - } - - /** - * Update products data by attribute. - * - * @param array $products - * @param string $attributeCode - * @return void - */ - protected function updateProducts(array $products, string $attributeCode): void - { - $attribute = $this->attributeRepository->get($attributeCode); - - foreach ($products as $productSku => $stringValue) { - $product = $this->productRepository->get($productSku, false, Store::DEFAULT_STORE_ID, true); - $product->addData( - [$attribute->getAttributeCode() => $attribute->getSource()->getOptionId($stringValue)] - ); - $this->productRepository->save($product); - } - } -} diff --git a/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Category/BooleanFilterTest.php b/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Category/BooleanFilterTest.php index 83636ff55dce8..24787bc3c4ca8 100644 --- a/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Category/BooleanFilterTest.php +++ b/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Category/BooleanFilterTest.php @@ -8,6 +8,8 @@ namespace Magento\LayeredNavigation\Block\Navigation\Category; use Magento\Catalog\Model\Layer\Filter\AbstractFilter; +use Magento\Catalog\Model\Layer\Resolver; +use Magento\LayeredNavigation\Block\Navigation\AbstractFiltersTest; /** * Provides tests for custom boolean filter in navigation block on category page. @@ -23,13 +25,13 @@ class BooleanFilterTest extends AbstractFiltersTest * @magentoDataFixture Magento/Catalog/_files/category_with_different_price_products.php * @dataProvider getFiltersWithCustomAttributeDataProvider * @param array $products - * @param int $filterable + * @param array $attributeData * @param array $expectation * @return void */ - public function testGetFiltersWithCustomAttribute(array $products, int $filterable, array $expectation): void + public function testGetFiltersWithCustomAttribute(array $products, array $attributeData, array $expectation): void { - $this->getFiltersAndAssert($products, $filterable, $expectation, 'boolean_attribute'); + $this->getCategoryFiltersAndAssert($products, $attributeData, $expectation, 'Category 999'); } /** @@ -40,7 +42,7 @@ public function getFiltersWithCustomAttributeDataProvider(): array return [ 'not_used_in_navigation' => [ 'products_data' => [], - 'filterable' => 0, + 'attribute_data' => ['is_filterable' => 0], 'expectation' => [], ], 'used_in_navigation_with_results' => [ @@ -48,7 +50,7 @@ public function getFiltersWithCustomAttributeDataProvider(): array 'simple1000' => 'Yes', 'simple1001' => 'Yes', ], - 'filterable' => AbstractFilter::ATTRIBUTE_OPTIONS_ONLY_WITH_RESULTS, + 'attribute_data' => ['is_filterable' => AbstractFilter::ATTRIBUTE_OPTIONS_ONLY_WITH_RESULTS], 'expectation' => [ ['label' => 'Yes', 'count' => 2], ], @@ -58,7 +60,7 @@ public function getFiltersWithCustomAttributeDataProvider(): array 'simple1000' => 'Yes', 'simple1001' => 'Yes', ], - 'filterable' => 2, + 'attribute_data' => ['is_filterable' => 2], 'expectation' => [ ['label' => 'Yes', 'count' => 2], ['label' => 'No', 'count' => 0], @@ -66,4 +68,20 @@ public function getFiltersWithCustomAttributeDataProvider(): array ], ]; } + + /** + * @inheritdoc + */ + protected function getLayerType(): string + { + return Resolver::CATALOG_LAYER_CATEGORY; + } + + /** + * @inheritdoc + */ + protected function getAttributeCode(): string + { + return 'boolean_attribute'; + } } diff --git a/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Category/DecimalFilterTest.php b/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Category/DecimalFilterTest.php index e79b521f7f13c..c8cb6397b12fd 100644 --- a/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Category/DecimalFilterTest.php +++ b/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Category/DecimalFilterTest.php @@ -7,6 +7,8 @@ namespace Magento\LayeredNavigation\Block\Navigation\Category; +use Magento\Catalog\Model\Layer\Resolver; +use Magento\LayeredNavigation\Block\Navigation\AbstractFiltersTest; use Magento\Catalog\Model\Layer\Filter\AbstractFilter; use Magento\Catalog\Model\Layer\Filter\Item; use Magento\Store\Model\Store; @@ -25,13 +27,29 @@ class DecimalFilterTest extends AbstractFiltersTest * @magentoDataFixture Magento/Catalog/_files/category_with_different_price_products.php * @dataProvider getFiltersWithCustomAttributeDataProvider * @param array $products - * @param int $filterable + * @param array $attributeData * @param array $expectation * @return void */ - public function testGetFiltersWithCustomAttribute(array $products, int $filterable, array $expectation): void + public function testGetFiltersWithCustomAttribute(array $products, array $attributeData, array $expectation): void { - $this->getFiltersAndAssert($products, $filterable, $expectation, 'decimal_attribute'); + $this->getCategoryFiltersAndAssert($products, $attributeData, $expectation, 'Category 999'); + } + + /** + * @inheritdoc + */ + protected function getLayerType(): string + { + return Resolver::CATALOG_LAYER_CATEGORY; + } + + /** + * @inheritdoc + */ + protected function getAttributeCode(): string + { + return 'decimal_attribute'; } /** @@ -77,7 +95,7 @@ public function getFiltersWithCustomAttributeDataProvider(): array return [ 'not_used_in_navigation' => [ 'products_data' => [], - 'filterable' => 0, + 'attribute_data' => ['is_filterable' => 0], 'expectation' => [], ], 'used_in_navigation_with_results' => [ @@ -85,7 +103,7 @@ public function getFiltersWithCustomAttributeDataProvider(): array 'simple1000' => 10.00, 'simple1001' => 20.00, ], - 'filterable' => AbstractFilter::ATTRIBUTE_OPTIONS_ONLY_WITH_RESULTS, + 'attribute_data' => ['is_filterable' => AbstractFilter::ATTRIBUTE_OPTIONS_ONLY_WITH_RESULTS], 'expectation' => [ [ 'label' => '<span class="price">$10.00</span> - <span class="price">$19.99</span>', diff --git a/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Category/MultiselectFilterTest.php b/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Category/MultiselectFilterTest.php index 14d121eb15b79..f8391c60a30cf 100644 --- a/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Category/MultiselectFilterTest.php +++ b/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Category/MultiselectFilterTest.php @@ -7,6 +7,8 @@ namespace Magento\LayeredNavigation\Block\Navigation\Category; +use Magento\Catalog\Model\Layer\Resolver; +use Magento\LayeredNavigation\Block\Navigation\AbstractFiltersTest; use Magento\Catalog\Model\Layer\Filter\AbstractFilter; /** @@ -23,13 +25,13 @@ class MultiselectFilterTest extends AbstractFiltersTest * @magentoDataFixture Magento/Catalog/_files/category_with_different_price_products.php * @dataProvider getFiltersWithCustomAttributeDataProvider * @param array $products - * @param int $filterable + * @param array $attributeData * @param array $expectation * @return void */ - public function testGetFiltersWithCustomAttribute(array $products, int $filterable, array $expectation): void + public function testGetFiltersWithCustomAttribute(array $products, array $attributeData, array $expectation): void { - $this->getFiltersAndAssert($products, $filterable, $expectation, 'multiselect_attribute'); + $this->getCategoryFiltersAndAssert($products, $attributeData, $expectation, 'Category 999'); } /** @@ -40,7 +42,7 @@ public function getFiltersWithCustomAttributeDataProvider(): array return [ 'not_used_in_navigation' => [ 'products_data' => [], - 'filterable' => 0, + 'attribute_data' => ['is_filterable' => 0], 'expectation' => [], ], 'used_in_navigation_with_results' => [ @@ -48,7 +50,7 @@ public function getFiltersWithCustomAttributeDataProvider(): array 'simple1000' => 'Option 1', 'simple1001' => 'Option 2', ], - 'filterable' => AbstractFilter::ATTRIBUTE_OPTIONS_ONLY_WITH_RESULTS, + 'attribute_data' => ['is_filterable' => AbstractFilter::ATTRIBUTE_OPTIONS_ONLY_WITH_RESULTS], 'expectation' => [ ['label' => 'Option 1', 'count' => 1], ['label' => 'Option 2', 'count' => 1], @@ -59,7 +61,7 @@ public function getFiltersWithCustomAttributeDataProvider(): array 'simple1000' => 'Option 1', 'simple1001' => 'Option 2', ], - 'filterable' => 2, + 'attribute_data' => ['is_filterable' => 2], 'expectation' => [ ['label' => 'Option 1', 'count' => 1], ['label' => 'Option 2', 'count' => 1], @@ -69,4 +71,20 @@ public function getFiltersWithCustomAttributeDataProvider(): array ], ]; } + + /** + * @inheritdoc + */ + protected function getLayerType(): string + { + return Resolver::CATALOG_LAYER_CATEGORY; + } + + /** + * @inheritdoc + */ + protected function getAttributeCode(): string + { + return 'multiselect_attribute'; + } } diff --git a/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Category/SelectFilterTest.php b/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Category/SelectFilterTest.php index 76217e9683993..e2278239be242 100644 --- a/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Category/SelectFilterTest.php +++ b/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Category/SelectFilterTest.php @@ -7,6 +7,8 @@ namespace Magento\LayeredNavigation\Block\Navigation\Category; +use Magento\Catalog\Model\Layer\Resolver; +use Magento\LayeredNavigation\Block\Navigation\AbstractFiltersTest; use Magento\Catalog\Model\Layer\Filter\AbstractFilter; /** @@ -23,13 +25,13 @@ class SelectFilterTest extends AbstractFiltersTest * @magentoDataFixture Magento/Catalog/_files/category_with_different_price_products.php * @dataProvider getFiltersWithCustomAttributeDataProvider * @param array $products - * @param int $filterable + * @param array $attributeData * @param array $expectation * @return void */ - public function testGetFiltersWithCustomAttribute(array $products, int $filterable, array $expectation): void + public function testGetFiltersWithCustomAttribute(array $products, array $attributeData, array $expectation): void { - $this->getFiltersAndAssert($products, $filterable, $expectation, 'dropdown_attribute'); + $this->getCategoryFiltersAndAssert($products, $attributeData, $expectation, 'Category 999'); } /** @@ -40,7 +42,7 @@ public function getFiltersWithCustomAttributeDataProvider(): array return [ 'not_used_in_navigation' => [ 'products_data' => [], - 'filterable' => 0, + 'attribute_data' => ['is_filterable' => 0], 'expectation' => [], ], 'used_in_navigation_with_results' => [ @@ -48,7 +50,7 @@ public function getFiltersWithCustomAttributeDataProvider(): array 'simple1000' => 'Option 1', 'simple1001' => 'Option 2', ], - 'filterable' => AbstractFilter::ATTRIBUTE_OPTIONS_ONLY_WITH_RESULTS, + 'attribute_data' => ['is_filterable' => AbstractFilter::ATTRIBUTE_OPTIONS_ONLY_WITH_RESULTS], 'expectation' => [ ['label' => 'Option 1', 'count' => 1], ['label' => 'Option 2', 'count' => 1], @@ -59,7 +61,7 @@ public function getFiltersWithCustomAttributeDataProvider(): array 'simple1000' => 'Option 1', 'simple1001' => 'Option 2', ], - 'filterable' => 2, + 'attribute_data' => ['is_filterable' => 2], 'expectation' => [ ['label' => 'Option 1', 'count' => 1], ['label' => 'Option 2', 'count' => 1], @@ -68,4 +70,20 @@ public function getFiltersWithCustomAttributeDataProvider(): array ], ]; } + + /** + * @inheritdoc + */ + protected function getLayerType(): string + { + return Resolver::CATALOG_LAYER_CATEGORY; + } + + /** + * @inheritdoc + */ + protected function getAttributeCode(): string + { + return 'dropdown_attribute'; + } } diff --git a/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/CategoryTest.php b/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/CategoryTest.php index 3a2de697bd5ef..0efbd426e8375 100644 --- a/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/CategoryTest.php +++ b/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/CategoryTest.php @@ -7,10 +7,19 @@ namespace Magento\LayeredNavigation\Block\Navigation; +use Magento\Catalog\Api\Data\CategoryInterface; use Magento\Catalog\Api\Data\CategoryInterfaceFactory; use Magento\Catalog\Model\Category as CategoryModel; +use Magento\Catalog\Model\ResourceModel\Category as CategoryResource; +use Magento\Catalog\Model\ResourceModel\Category\Collection; +use Magento\Catalog\Model\ResourceModel\Category\CollectionFactory; +use Magento\Framework\ObjectManagerInterface; +use Magento\Framework\View\LayoutInterface; +use Magento\LayeredNavigation\Block\Navigation; use Magento\Store\Model\Store; use Magento\Store\Model\StoreManagerInterface; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; /** * Provides tests for filters block on category page. @@ -19,8 +28,33 @@ * @magentoAppIsolation enabled * @magentoDbIsolation disabled */ -class CategoryTest extends AbstractCategoryTest +class CategoryTest extends TestCase { + /** + * @var ObjectManagerInterface + */ + protected $objectManager; + + /** + * @var CollectionFactory + */ + protected $categoryCollectionFactory; + + /** + * @var CategoryResource + */ + protected $categoryResource; + + /** + * @var Navigation + */ + protected $navigationBlock; + + /** + * @var LayoutInterface + */ + protected $layout; + /** * @var StoreManagerInterface */ @@ -31,8 +65,13 @@ class CategoryTest extends AbstractCategoryTest */ protected function setUp() { - parent::setUp(); + $this->objectManager = Bootstrap::getObjectManager(); + $this->categoryCollectionFactory = $this->objectManager->create(CollectionFactory::class); + $this->categoryResource = $this->objectManager->get(CategoryResource::class); + $this->layout = $this->objectManager->get(LayoutInterface::class); + $this->navigationBlock = $this->objectManager->create(Category::class); $this->storeManager = $this->objectManager->get(StoreManagerInterface::class); + parent::setUp(); } /** @@ -128,6 +167,44 @@ public function canShowBlockWithDisplayModeDataProviderOnStoreView(): array ]; } + /** + * Inits navigation block. + * + * @param string $categoryName + * @param int $storeId + * @return void + */ + private function prepareNavigationBlock( + string $categoryName, + int $storeId = Store::DEFAULT_STORE_ID + ): void { + $category = $this->loadCategory($categoryName, $storeId); + $this->navigationBlock->getLayer()->setCurrentCategory($category); + $this->navigationBlock->setLayout($this->layout); + } + + /** + * Loads category by id. + * + * @param string $categoryName + * @param int $storeId + * @return CategoryInterface + */ + private function loadCategory(string $categoryName, int $storeId): CategoryInterface + { + /** @var Collection $categoryCollection */ + $categoryCollection = $this->categoryCollectionFactory->create(); + /** @var CategoryInterface $category */ + $category = $categoryCollection->setStoreId($storeId) + ->addAttributeToSelect('display_mode', 'left') + ->addAttributeToFilter(CategoryInterface::KEY_NAME, $categoryName) + ->setPageSize(1) + ->getFirstItem(); + $category->setStoreId($storeId); + + return $category; + } + /** * Updates category display mode. * diff --git a/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Search/BooleanFilterTest.php b/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Search/BooleanFilterTest.php new file mode 100644 index 0000000000000..8f03ae3eed229 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Search/BooleanFilterTest.php @@ -0,0 +1,81 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\LayeredNavigation\Block\Navigation\Search; + +use Magento\Catalog\Model\Layer\Filter\AbstractFilter; +use Magento\Catalog\Model\Layer\Resolver; +use Magento\LayeredNavigation\Block\Navigation\Category\BooleanFilterTest as CategoryBooleanFilterTest; + +/** + * Provides tests for custom boolean filter in navigation block on search page. + * + * @magentoAppArea frontend + * @magentoAppIsolation enabled + * @magentoDbIsolation disabled + */ +class BooleanFilterTest extends CategoryBooleanFilterTest +{ + /** + * @magentoDataFixture Magento/Catalog/_files/product_boolean_attribute.php + * @magentoDataFixture Magento/Catalog/_files/category_with_different_price_products.php + * @dataProvider getFiltersWithCustomAttributeDataProvider + * @param array $products + * @param array $attributeData + * @param array $expectation + * @return void + */ + public function testGetFiltersWithCustomAttribute( + array $products, + array $attributeData, + array $expectation + ): void { + $this->getSearchFiltersAndAssert($products, $attributeData, $expectation); + } + + /** + * @return array + */ + public function getFiltersWithCustomAttributeDataProvider(): array + { + $dataProvider = parent::getFiltersWithCustomAttributeDataProvider(); + + $dataProvider = array_replace_recursive( + $dataProvider, + [ + 'not_used_in_navigation' => [ + 'attribute_data' => [ + 'is_filterable_in_search' => 0, + ], + ], + 'used_in_navigation_with_results' => [ + 'attribute_data' => [ + 'is_filterable_in_search' => 1, + ], + ], + 'used_in_navigation_without_results' => [ + 'attribute_data' => [ + 'is_filterable' => 0, + 'is_filterable_in_search' => 1, + ], + ], + ] + ); + //TODO uncomment after fix MC-29227 + //unset($dataProvider['used_in_navigation_without_results']['expectation'][1]); + + return $dataProvider; + } + + /** + * @inheritdoc + */ + protected function getLayerType(): string + { + return Resolver::CATALOG_LAYER_SEARCH; + } +} diff --git a/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Search/DecimalFilterTest.php b/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Search/DecimalFilterTest.php new file mode 100644 index 0000000000000..a4d8a64add4b7 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Search/DecimalFilterTest.php @@ -0,0 +1,72 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\LayeredNavigation\Block\Navigation\Search; + +use Magento\Catalog\Model\Layer\Filter\AbstractFilter; +use Magento\Catalog\Model\Layer\Resolver; +use Magento\LayeredNavigation\Block\Navigation\Category\DecimalFilterTest as CategoryDecimalFilterTest; + +/** + * Provides tests for custom price filter in navigation block on search page. + * + * @magentoAppArea frontend + * @magentoAppIsolation enabled + * @magentoDbIsolation disabled + */ +class DecimalFilterTest extends CategoryDecimalFilterTest +{ + /** + * @magentoDataFixture Magento/Catalog/_files/product_decimal_attribute.php + * @magentoDataFixture Magento/Catalog/_files/category_with_different_price_products.php + * @dataProvider getFiltersWithCustomAttributeDataProvider + * @param array $products + * @param array $attributeData + * @param array $expectation + * @return void + */ + public function testGetFiltersWithCustomAttribute( + array $products, + array $attributeData, + array $expectation + ): void { + $this->getSearchFiltersAndAssert($products, $attributeData, $expectation); + } + + /** + * @return array + */ + public function getFiltersWithCustomAttributeDataProvider(): array + { + $dataProvider = parent::getFiltersWithCustomAttributeDataProvider(); + + $dataProvider = array_replace_recursive( + $dataProvider, + [ + 'not_used_in_navigation' => [ + 'attribute_data' => ['is_filterable' => 0, 'is_filterable_in_search' => 0], + ], + 'used_in_navigation_with_results' => [ + 'attribute_data' => [ + 'is_filterable' => AbstractFilter::ATTRIBUTE_OPTIONS_ONLY_WITH_RESULTS, + 'is_filterable_in_search' => 1, + ], + ], + ] + ); + + return $dataProvider; + } + + /** + * @inheritdoc + */ + protected function getLayerType(): string + { + return Resolver::CATALOG_LAYER_SEARCH; + } +} diff --git a/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Search/MultiselectFilterTest.php b/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Search/MultiselectFilterTest.php new file mode 100644 index 0000000000000..9220a81f507ee --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Search/MultiselectFilterTest.php @@ -0,0 +1,84 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\LayeredNavigation\Block\Navigation\Search; + +use Magento\Catalog\Model\Layer\Filter\AbstractFilter; +use Magento\Catalog\Model\Layer\Resolver; +use Magento\LayeredNavigation\Block\Navigation\Category\MultiselectFilterTest as CategoryMultiselectFilterTest; + +/** + * Provides tests for custom multiselect filter in navigation block on search page. + * + * @magentoAppArea frontend + * @magentoAppIsolation enabled + * @magentoDbIsolation disabled + */ +class MultiselectFilterTest extends CategoryMultiselectFilterTest +{ + /** + * @magentoDataFixture Magento/Catalog/_files/multiselect_attribute.php + * @magentoDataFixture Magento/Catalog/_files/category_with_different_price_products.php + * @dataProvider getFiltersWithCustomAttributeDataProvider + * @param array $products + * @param array $attributeData + * @param array $expectation + * @return void + */ + public function testGetFiltersWithCustomAttribute( + array $products, + array $attributeData, + array $expectation + ): void { + $this->getSearchFiltersAndAssert($products, $attributeData, $expectation); + } + + /** + * @return array + */ + public function getFiltersWithCustomAttributeDataProvider(): array + { + $dataProvider = parent::getFiltersWithCustomAttributeDataProvider(); + + $dataProvider = array_replace_recursive( + $dataProvider, + [ + 'not_used_in_navigation' => [ + 'attribute_data' => [ + 'is_filterable_in_search' => 0, + ], + ], + 'used_in_navigation_with_results' => [ + 'attribute_data' => [ + 'is_filterable' => AbstractFilter::ATTRIBUTE_OPTIONS_ONLY_WITH_RESULTS, + 'is_filterable_in_search' => 1, + ], + ], + 'used_in_navigation_without_results' => [ + 'attribute_data' => [ + 'is_filterable' => 0, + 'is_filterable_in_search' => 1, + ], + ], + ] + ); + //TODO uncomment after fix MC-29227 + //unset($dataProvider['used_in_navigation_without_results']['expectation'][1]); + //unset($dataProvider['used_in_navigation_without_results']['expectation'][2]); + //unset($dataProvider['used_in_navigation_without_results']['expectation'][3]); + + return $dataProvider; + } + + /** + * @inheritdoc + */ + protected function getLayerType(): string + { + return Resolver::CATALOG_LAYER_SEARCH; + } +} diff --git a/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Search/SelectFilterTest.php b/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Search/SelectFilterTest.php new file mode 100644 index 0000000000000..d44994de7e31c --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Search/SelectFilterTest.php @@ -0,0 +1,82 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\LayeredNavigation\Block\Navigation\Search; + +use Magento\Catalog\Model\Layer\Filter\AbstractFilter; +use Magento\Catalog\Model\Layer\Resolver; +use Magento\LayeredNavigation\Block\Navigation\Category\SelectFilterTest as CategorySelectFilterTest; + +/** + * Provides tests for custom select filter in navigation block on search page. + * + * @magentoAppArea frontend + * @magentoAppIsolation enabled + * @magentoDbIsolation disabled + */ +class SelectFilterTest extends CategorySelectFilterTest +{ + /** + * @magentoDataFixture Magento/Catalog/_files/product_dropdown_attribute.php + * @magentoDataFixture Magento/Catalog/_files/category_with_different_price_products.php + * @dataProvider getFiltersWithCustomAttributeDataProvider + * @param array $products + * @param array $attributeData + * @param array $expectation + * @return void + */ + public function testGetFiltersWithCustomAttribute( + array $products, + array $attributeData, + array $expectation + ): void { + $this->getSearchFiltersAndAssert($products, $attributeData, $expectation); + } + + /** + * @return array + */ + public function getFiltersWithCustomAttributeDataProvider(): array + { + $dataProvider = parent::getFiltersWithCustomAttributeDataProvider(); + + $dataProvider = array_replace_recursive( + $dataProvider, + [ + 'not_used_in_navigation' => [ + 'attribute_data' => [ + 'is_filterable_in_search' => 0, + ], + ], + 'used_in_navigation_with_results' => [ + 'attribute_data' => [ + 'is_filterable' => AbstractFilter::ATTRIBUTE_OPTIONS_ONLY_WITH_RESULTS, + 'is_filterable_in_search' => 1, + ], + ], + 'used_in_navigation_without_results' => [ + 'attribute_data' => [ + 'is_filterable' => 0, + 'is_filterable_in_search' => 1, + ], + ], + ] + ); + //TODO uncomment after fix MC-29227 + //unset($dataProvider['used_in_navigation_without_results']['expectation'][2]); + + return $dataProvider; + } + + /** + * @inheritdoc + */ + protected function getLayerType(): string + { + return Resolver::CATALOG_LAYER_SEARCH; + } +} diff --git a/dev/tests/integration/testsuite/Magento/SwatchesLayeredNavigation/Block/Navigation/Category/SwatchTextFilterTest.php b/dev/tests/integration/testsuite/Magento/SwatchesLayeredNavigation/Block/Navigation/Category/SwatchTextFilterTest.php index 345d11e9948d2..a56c13ca92f2f 100644 --- a/dev/tests/integration/testsuite/Magento/SwatchesLayeredNavigation/Block/Navigation/Category/SwatchTextFilterTest.php +++ b/dev/tests/integration/testsuite/Magento/SwatchesLayeredNavigation/Block/Navigation/Category/SwatchTextFilterTest.php @@ -8,7 +8,8 @@ namespace Magento\SwatchesLayeredNavigation\Block\Navigation\Category; use Magento\Catalog\Model\Layer\Filter\AbstractFilter; -use Magento\LayeredNavigation\Block\Navigation\Category\AbstractFiltersTest; +use Magento\Catalog\Model\Layer\Resolver; +use Magento\LayeredNavigation\Block\Navigation\AbstractFiltersTest; /** * Provides tests for custom text swatch filter in navigation block on category page. @@ -24,13 +25,13 @@ class SwatchTextFilterTest extends AbstractFiltersTest * @magentoDataFixture Magento/Catalog/_files/category_with_different_price_products.php * @dataProvider getFiltersWithCustomAttributeDataProvider * @param array $products - * @param int $filterable + * @param array $attributeData * @param array $expectation * @return void */ - public function testGetFiltersWithCustomAttribute(array $products, int $filterable, array $expectation): void + public function testGetFiltersWithCustomAttribute(array $products, array $attributeData, array $expectation): void { - $this->getFiltersAndAssert($products, $filterable, $expectation, 'text_swatch_attribute'); + $this->getCategoryFiltersAndAssert($products, $attributeData, $expectation, 'Category 999'); } /** @@ -41,7 +42,7 @@ public function getFiltersWithCustomAttributeDataProvider(): array return [ 'not_used_in_navigation' => [ 'products_data' => [], - 'filterable' => 0, + 'attribute_data' => ['is_filterable' => 0], 'expectation' => [], ], 'used_in_navigation_with_results' => [ @@ -49,7 +50,7 @@ public function getFiltersWithCustomAttributeDataProvider(): array 'simple1000' => 'Option 1', 'simple1001' => 'Option 2', ], - 'filterable' => AbstractFilter::ATTRIBUTE_OPTIONS_ONLY_WITH_RESULTS, + 'attribute_data' => ['is_filterable' => AbstractFilter::ATTRIBUTE_OPTIONS_ONLY_WITH_RESULTS], 'expectation' => [ ['label' => 'Option 1', 'count' => 1], ['label' => 'Option 2', 'count' => 1], @@ -60,7 +61,7 @@ public function getFiltersWithCustomAttributeDataProvider(): array 'simple1000' => 'Option 1', 'simple1001' => 'Option 2', ], - 'filterable' => 2, + 'attribute_data' => ['is_filterable' => 2], 'expectation' => [ ['label' => 'Option 3', 'count' => 0], ['label' => 'Option 1', 'count' => 1], @@ -69,4 +70,20 @@ public function getFiltersWithCustomAttributeDataProvider(): array ], ]; } + + /** + * @inheritdoc + */ + protected function getLayerType(): string + { + return Resolver::CATALOG_LAYER_CATEGORY; + } + + /** + * @inheritdoc + */ + protected function getAttributeCode(): string + { + return 'text_swatch_attribute'; + } } diff --git a/dev/tests/integration/testsuite/Magento/SwatchesLayeredNavigation/Block/Navigation/Category/SwatchVisualFilterTest.php b/dev/tests/integration/testsuite/Magento/SwatchesLayeredNavigation/Block/Navigation/Category/SwatchVisualFilterTest.php index 6f34a7bad9ebc..9860e5a78c436 100644 --- a/dev/tests/integration/testsuite/Magento/SwatchesLayeredNavigation/Block/Navigation/Category/SwatchVisualFilterTest.php +++ b/dev/tests/integration/testsuite/Magento/SwatchesLayeredNavigation/Block/Navigation/Category/SwatchVisualFilterTest.php @@ -8,7 +8,8 @@ namespace Magento\SwatchesLayeredNavigation\Block\Navigation\Category; use Magento\Catalog\Model\Layer\Filter\AbstractFilter; -use Magento\LayeredNavigation\Block\Navigation\Category\AbstractFiltersTest; +use Magento\Catalog\Model\Layer\Resolver; +use Magento\LayeredNavigation\Block\Navigation\AbstractFiltersTest; /** * Provides tests for custom text swatch filter in navigation block on category page. @@ -24,13 +25,13 @@ class SwatchVisualFilterTest extends AbstractFiltersTest * @magentoDataFixture Magento/Catalog/_files/category_with_different_price_products.php * @dataProvider getFiltersWithCustomAttributeDataProvider * @param array $products - * @param int $filterable + * @param array $attributeData * @param array $expectation * @return void */ - public function testGetFiltersWithCustomAttribute(array $products, int $filterable, array $expectation): void + public function testGetFiltersWithCustomAttribute(array $products, array $attributeData, array $expectation): void { - $this->getFiltersAndAssert($products, $filterable, $expectation, 'visual_swatch_attribute'); + $this->getCategoryFiltersAndAssert($products, $attributeData, $expectation, 'Category 999'); } /** @@ -41,7 +42,7 @@ public function getFiltersWithCustomAttributeDataProvider(): array return [ 'not_used_in_navigation' => [ 'products_data' => [], - 'filterable' => 0, + 'attribute_data' => ['is_filterable' => 0], 'expectation' => [], ], 'used_in_navigation_with_results' => [ @@ -49,7 +50,7 @@ public function getFiltersWithCustomAttributeDataProvider(): array 'simple1000' => 'option 1', 'simple1001' => 'option 2', ], - 'filterable' => AbstractFilter::ATTRIBUTE_OPTIONS_ONLY_WITH_RESULTS, + 'attribute_data' => ['is_filterable' => AbstractFilter::ATTRIBUTE_OPTIONS_ONLY_WITH_RESULTS], 'expectation' => [ ['label' => 'option 1', 'count' => 1], ['label' => 'option 2', 'count' => 1], @@ -60,7 +61,7 @@ public function getFiltersWithCustomAttributeDataProvider(): array 'simple1000' => 'option 1', 'simple1001' => 'option 2', ], - 'filterable' => 2, + 'attribute_data' => ['is_filterable' => 2], 'expectation' => [ ['label' => 'option 1', 'count' => 1], ['label' => 'option 2', 'count' => 1], @@ -69,4 +70,20 @@ public function getFiltersWithCustomAttributeDataProvider(): array ], ]; } + + /** + * @inheritdoc + */ + protected function getLayerType(): string + { + return Resolver::CATALOG_LAYER_CATEGORY; + } + + /** + * @inheritdoc + */ + protected function getAttributeCode(): string + { + return 'visual_swatch_attribute'; + } } diff --git a/dev/tests/integration/testsuite/Magento/SwatchesLayeredNavigation/Block/Navigation/Search/SwatchTextFilterTest.php b/dev/tests/integration/testsuite/Magento/SwatchesLayeredNavigation/Block/Navigation/Search/SwatchTextFilterTest.php new file mode 100644 index 0000000000000..83867453a98ea --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/SwatchesLayeredNavigation/Block/Navigation/Search/SwatchTextFilterTest.php @@ -0,0 +1,82 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\SwatchesLayeredNavigation\Block\Navigation\Search; + +use Magento\Catalog\Model\Layer\Filter\AbstractFilter; +use Magento\Catalog\Model\Layer\Resolver; +use Magento\SwatchesLayeredNavigation\Block\Navigation\Category\SwatchTextFilterTest as CategorySwatchTextFilterTest; + +/** + * Provides tests for custom swatch text filter in navigation block on search page. + * + * @magentoAppArea frontend + * @magentoAppIsolation enabled + * @magentoDbIsolation disabled + */ +class SwatchTextFilterTest extends CategorySwatchTextFilterTest +{ + /** + * @magentoDataFixture Magento/Swatches/_files/product_text_swatch_attribute.php + * @magentoDataFixture Magento/Catalog/_files/category_with_different_price_products.php + * @dataProvider getFiltersWithCustomAttributeDataProvider + * @param array $products + * @param array $attributeData + * @param array $expectation + * @return void + */ + public function testGetFiltersWithCustomAttribute( + array $products, + array $attributeData, + array $expectation + ): void { + $this->getSearchFiltersAndAssert($products, $attributeData, $expectation); + } + + /** + * @return array + */ + public function getFiltersWithCustomAttributeDataProvider(): array + { + $dataProvider = parent::getFiltersWithCustomAttributeDataProvider(); + + $dataProvider = array_replace_recursive( + $dataProvider, + [ + 'not_used_in_navigation' => [ + 'attribute_data' => [ + 'is_filterable_in_search' => 0, + ], + ], + 'used_in_navigation_with_results' => [ + 'attribute_data' => [ + 'is_filterable' => AbstractFilter::ATTRIBUTE_OPTIONS_ONLY_WITH_RESULTS, + 'is_filterable_in_search' => 1, + ], + ], + 'used_in_navigation_without_results' => [ + 'attribute_data' => [ + 'is_filterable' => 0, + 'is_filterable_in_search' => 1, + ], + ], + ] + ); + //TODO uncomment after fix MC-29227 + //unset($dataProvider['used_in_navigation_without_results']['expectation'][0]); + + return $dataProvider; + } + + /** + * @inheritdoc + */ + protected function getLayerType(): string + { + return Resolver::CATALOG_LAYER_SEARCH; + } +} diff --git a/dev/tests/integration/testsuite/Magento/SwatchesLayeredNavigation/Block/Navigation/Search/SwatchVisualFilterTest.php b/dev/tests/integration/testsuite/Magento/SwatchesLayeredNavigation/Block/Navigation/Search/SwatchVisualFilterTest.php new file mode 100644 index 0000000000000..47c7b09f2eb85 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/SwatchesLayeredNavigation/Block/Navigation/Search/SwatchVisualFilterTest.php @@ -0,0 +1,82 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\SwatchesLayeredNavigation\Block\Navigation\Search; + +use Magento\Catalog\Model\Layer\Filter\AbstractFilter; +use Magento\Catalog\Model\Layer\Resolver; +use Magento\SwatchesLayeredNavigation\Block\Navigation\Category\SwatchVisualFilterTest as CategorySwatchVisualTest; + +/** + * Provides tests for custom visual swatch filter in navigation block on search page. + * + * @magentoAppArea frontend + * @magentoAppIsolation enabled + * @magentoDbIsolation disabled + */ +class SwatchVisualFilterTest extends CategorySwatchVisualTest +{ + /** + * @magentoDataFixture Magento/Swatches/_files/product_visual_swatch_attribute.php + * @magentoDataFixture Magento/Catalog/_files/category_with_different_price_products.php + * @dataProvider getFiltersWithCustomAttributeDataProvider + * @param array $products + * @param array $attributeData + * @param array $expectation + * @return void + */ + public function testGetFiltersWithCustomAttribute( + array $products, + array $attributeData, + array $expectation + ): void { + $this->getSearchFiltersAndAssert($products, $attributeData, $expectation); + } + + /** + * @return array + */ + public function getFiltersWithCustomAttributeDataProvider(): array + { + $dataProvider = parent::getFiltersWithCustomAttributeDataProvider(); + + $dataProvider = array_replace_recursive( + $dataProvider, + [ + 'not_used_in_navigation' => [ + 'attribute_data' => [ + 'is_filterable_in_search' => 0, + ], + ], + 'used_in_navigation_with_results' => [ + 'attribute_data' => [ + 'is_filterable' => AbstractFilter::ATTRIBUTE_OPTIONS_ONLY_WITH_RESULTS, + 'is_filterable_in_search' => 1, + ], + ], + 'used_in_navigation_without_results' => [ + 'attribute_data' => [ + 'is_filterable' => 0, + 'is_filterable_in_search' => 1, + ], + ], + ] + ); + //TODO uncomment after fix MC-29227 + //unset($dataProvider['used_in_navigation_without_results']['expectation'][2]); + + return $dataProvider; + } + + /** + * @inheritdoc + */ + protected function getLayerType(): string + { + return Resolver::CATALOG_LAYER_SEARCH; + } +} From a882be9e27c602755fd79c2cc79b217b358a9f38 Mon Sep 17 00:00:00 2001 From: divyajyothi5321 <54176640+divyajyothi5321@users.noreply.github.com> Date: Mon, 16 Dec 2019 20:45:15 +0530 Subject: [PATCH 354/586] 26064 issuefix --- app/code/Magento/Wishlist/Controller/Index/Send.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Wishlist/Controller/Index/Send.php b/app/code/Magento/Wishlist/Controller/Index/Send.php index 54aa53d829db5..1ff4e3a653a2d 100644 --- a/app/code/Magento/Wishlist/Controller/Index/Send.php +++ b/app/code/Magento/Wishlist/Controller/Index/Send.php @@ -204,7 +204,7 @@ public function execute() $error = __('Please enter an email address.'); } else { if (count($emails) > $emailsLeft) { - $error = __('This wish list can be shared %1 more times.', $emailsLeft); + $error = __('Maximum of %1 Emails can be Sent.', $emailsLeft); } else { foreach ($emails as $index => $email) { $email = trim($email); From 6ac10980c6322e949b13af43dfea320113586c2f Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Mon, 16 Dec 2019 23:13:53 +0700 Subject: [PATCH 355/586] [Msrp] Cover MsrpPriceCalculator by Unit Test --- .../Unit/Pricing/MsrpPriceCalculatorTest.php | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 app/code/Magento/Msrp/Test/Unit/Pricing/MsrpPriceCalculatorTest.php diff --git a/app/code/Magento/Msrp/Test/Unit/Pricing/MsrpPriceCalculatorTest.php b/app/code/Magento/Msrp/Test/Unit/Pricing/MsrpPriceCalculatorTest.php new file mode 100644 index 0000000000000..613547943c9a4 --- /dev/null +++ b/app/code/Magento/Msrp/Test/Unit/Pricing/MsrpPriceCalculatorTest.php @@ -0,0 +1,103 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Msrp\Test\Unit\Pricing; + +use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\Product\Type as Type; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\GroupedProduct\Model\Product\Type\Grouped as GroupedType; +use Magento\Msrp\Pricing\MsrpPriceCalculator; +use Magento\MsrpGroupedProduct\Pricing\MsrpPriceCalculator as MsrpGroupedCalculator; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +class MsrpPriceCalculatorTest extends TestCase +{ + /** + * Test getMrspPriceValue() with the data provider below + * + * @param array $msrpPriceCalculators + * @param Product $productMock + * @param float $expected + * @dataProvider getMsrpPriceValueDataProvider + */ + public function testGetMsrpPriceValue($msrpPriceCalculators, $productMock, $expected) + { + $objectManager = new ObjectManager($this); + $pricing = $objectManager->getObject(MsrpPriceCalculator::class, + [ + 'msrpPriceCalculators' => $msrpPriceCalculators + ] + ); + + $this->assertEquals($expected, $pricing->getMsrpPriceValue($productMock)); + } + + /** + * Data Provider for test getMrspPriceValue() + * + * @return array + */ + public function getMsrpPriceValueDataProvider() + { + return [ + 'Get Mrsp Price with grouped product and price calculator is also grouped product type' => [ + [ + [ + 'productType' => GroupedType::TYPE_CODE, + 'priceCalculator' => $this->createPriceCalculatorMock( + MsrpGroupedCalculator::class, 23.50) + ] + ], + $this->createProductMock(GroupedType::TYPE_CODE, 0), + 23.50 + ], + 'Get Mrsp Price with simple product and price calculator is grouped product type' => [ + [ + [ + 'productType' => GroupedType::TYPE_CODE, + 'priceCalculator' => $this->createPriceCalculatorMock( + MsrpGroupedCalculator::class, 0) + ] + ], + $this->createProductMock(Type::TYPE_SIMPLE, 24.88), + 24.88 + ] + ]; + } + + /** + * Create Price Calculator Mock + * + * @param string $class + * @param float $msrpPriceValue + * @return MockObject + */ + private function createPriceCalculatorMock($class, $msrpPriceValue) + { + $priceCalculatorMock = $this->createMock($class); + $priceCalculatorMock->expects($this->any())->method('getMsrpPriceValue')->willReturn($msrpPriceValue); + return $priceCalculatorMock; + } + + /** + * Create Product Mock + * + * @param string $typeId + * @param float $msrp + * @return MockObject + */ + private function createProductMock($typeId, $msrp) + { + $productMock = $this->createPartialMock(Product::class, ['getTypeId', 'getMsrp']); + $productMock->expects($this->any())->method('getTypeId')->willReturn($typeId); + $productMock->expects($this->any())->method('getMsrp')->willReturn($msrp); + return $productMock; + } +} From fb7aa9c9c41ec300d697eb2fbb5b3398fbbd7a00 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Mon, 16 Dec 2019 23:37:11 +0700 Subject: [PATCH 356/586] fix static test --- .../Test/Unit/Pricing/MsrpPriceCalculatorTest.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Msrp/Test/Unit/Pricing/MsrpPriceCalculatorTest.php b/app/code/Magento/Msrp/Test/Unit/Pricing/MsrpPriceCalculatorTest.php index 613547943c9a4..aac6852b7000c 100644 --- a/app/code/Magento/Msrp/Test/Unit/Pricing/MsrpPriceCalculatorTest.php +++ b/app/code/Magento/Msrp/Test/Unit/Pricing/MsrpPriceCalculatorTest.php @@ -30,7 +30,8 @@ class MsrpPriceCalculatorTest extends TestCase public function testGetMsrpPriceValue($msrpPriceCalculators, $productMock, $expected) { $objectManager = new ObjectManager($this); - $pricing = $objectManager->getObject(MsrpPriceCalculator::class, + $pricing = $objectManager->getObject( + MsrpPriceCalculator::class, [ 'msrpPriceCalculators' => $msrpPriceCalculators ] @@ -52,7 +53,9 @@ public function getMsrpPriceValueDataProvider() [ 'productType' => GroupedType::TYPE_CODE, 'priceCalculator' => $this->createPriceCalculatorMock( - MsrpGroupedCalculator::class, 23.50) + MsrpGroupedCalculator::class, + 23.50 + ) ] ], $this->createProductMock(GroupedType::TYPE_CODE, 0), @@ -63,7 +66,9 @@ public function getMsrpPriceValueDataProvider() [ 'productType' => GroupedType::TYPE_CODE, 'priceCalculator' => $this->createPriceCalculatorMock( - MsrpGroupedCalculator::class, 0) + MsrpGroupedCalculator::class, + 0 + ) ] ], $this->createProductMock(Type::TYPE_SIMPLE, 24.88), From be81804df70a98ab61e7b79d383da8112e61de08 Mon Sep 17 00:00:00 2001 From: Sathish <srsathish92@gmail.com> Date: Mon, 16 Dec 2019 22:22:20 +0530 Subject: [PATCH 357/586] [GoogleAnalytics] covered Helper Data by Unit Test --- .../Test/Unit/Helper/DataTest.php | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 app/code/Magento/GoogleAnalytics/Test/Unit/Helper/DataTest.php diff --git a/app/code/Magento/GoogleAnalytics/Test/Unit/Helper/DataTest.php b/app/code/Magento/GoogleAnalytics/Test/Unit/Helper/DataTest.php new file mode 100644 index 0000000000000..ea1df498499de --- /dev/null +++ b/app/code/Magento/GoogleAnalytics/Test/Unit/Helper/DataTest.php @@ -0,0 +1,115 @@ +<?php + +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\GoogleAnalytics\Test\Unit\Helper; + +use Magento\GoogleAnalytics\Helper\Data as HelperData; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Store\Model\ScopeInterface; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\MockObject\MockObject; + +/** + * Unit test for Magento\GoogleAnalytics\Helper\Data + */ +class DataTest extends TestCase +{ + /** + * @var HelperData + */ + private $helper; + + /** + * @var ScopeConfigInterface|MockObject + */ + private $scopeConfigMock; + + /** + * @inheritDoc + */ + protected function setUp(): void + { + $this->scopeConfigMock = $this->getMockBuilder(ScopeConfigInterface::class) + ->setMethods(['getValue', 'isSetFlag']) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $objectManager = new ObjectManager($this); + $this->helper = $objectManager->getObject( + HelperData::class, + [ + 'scopeConfig' => $this->scopeConfigMock + ] + ); + } + + /** + * Test for isGoogleAnalyticsAvailable() + * + * @return void + * @dataProvider gaDataProvider + */ + public function testIsGoogleAnalyticsAvailable($value, $flag): void + { + $this->scopeConfigMock->expects($this->once()) + ->method('getValue') + ->with(HelperData::XML_PATH_ACCOUNT, ScopeInterface::SCOPE_STORE) + ->willReturn($value); + + $this->scopeConfigMock->expects($this->any()) + ->method('isSetFlag') + ->with(HelperData::XML_PATH_ACTIVE, ScopeInterface::SCOPE_STORE) + ->willReturn($flag); + + $this->assertEquals(($value && $flag), $this->helper->isGoogleAnalyticsAvailable()); + } + + /** + * Data provider for isGoogleAnalyticsAvailable() + * + * @return array + */ + public function gaDataProvider(): array + { + return [ + ['GA-XXXX', true], + ['GA-XXXX', false], + ['', true] + ]; + } + + /** + * Test for isAnonymizedIpActive() + * + * @return void + * @dataProvider yesNoDataProvider + */ + public function testIsAnonymizedIpActive($value): void + { + $this->scopeConfigMock->expects($this->once()) + ->method('getValue') + ->with(HelperData::XML_PATH_ANONYMIZE, ScopeInterface::SCOPE_STORE) + ->willReturn($value); + $this->assertEquals((bool) $value, $this->helper->isAnonymizedIpActive()); + } + + /** + * Data provider for isAnonymizedIpActive() + * + * @return array + */ + public function yesNoDataProvider(): array + { + return [ + ['Yes' => '1'], + ['No' => '0'] + ]; + } +} From cf0725a78721e28a60cf68af5c30844424c89d1f Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Mon, 16 Dec 2019 19:52:01 +0200 Subject: [PATCH 358/586] Covering the UrlBuilder ViewModel by Unit Test --- .../ViewModel/Page/Grid/UrlBuilderTest.php | 191 ++++++++++++++++++ 1 file changed, 191 insertions(+) create mode 100644 app/code/Magento/Cms/Test/Unit/ViewModel/Page/Grid/UrlBuilderTest.php diff --git a/app/code/Magento/Cms/Test/Unit/ViewModel/Page/Grid/UrlBuilderTest.php b/app/code/Magento/Cms/Test/Unit/ViewModel/Page/Grid/UrlBuilderTest.php new file mode 100644 index 0000000000000..c75f86b7e5ffb --- /dev/null +++ b/app/code/Magento/Cms/Test/Unit/ViewModel/Page/Grid/UrlBuilderTest.php @@ -0,0 +1,191 @@ +<?php +/*** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Cms\Test\Unit\ViewModel\Page\Grid; + +use Magento\Cms\ViewModel\Page\Grid\UrlBuilder; +use Magento\Framework\Url\EncoderInterface; +use Magento\Framework\UrlInterface; +use Magento\Store\Api\Data\StoreInterface; +use Magento\Store\Model\StoreManagerInterface; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Class UrlBuilderTest + */ +class UrlBuilderTest extends TestCase +{ + /** + * @var UrlBuilder + */ + private $viewModel; + + /** + * @var UrlInterface|MockObject + */ + private $frontendUrlBuilderMock; + + /** + * @var EncoderInterface|MockObject + */ + private $urlEncoderMock; + + /** + * @var StoreManagerInterface|MockObject + */ + private $storeManagerMock; + + /** + * Set Up + */ + public function setUp() + { + $this->frontendUrlBuilderMock = $this->getMockBuilder(UrlInterface::class) + ->setMethods(['getUrl', 'setScope']) + ->getMockForAbstractClass(); + $this->urlEncoderMock = $this->createMock(EncoderInterface::class); + $this->storeManagerMock = $this->getMockBuilder(StoreManagerInterface::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->viewModel = new UrlBuilder( + $this->frontendUrlBuilderMock, + $this->urlEncoderMock, + $this->storeManagerMock + ); + } + + /** + * Testing url builder with no scope provided + * + * @dataProvider nonScopedUrlsDataProvider + * + * @param array $url + * @param string $expected + * @param string $store + * @param null $scope + */ + public function testUrlBuilderWithNoScope(array $url, string $expected, string $store, $scope = null) + { + $this->frontendUrlBuilderMock->expects($this->any()) + ->method('getUrl') + ->with($url['path'], $url['params']) + ->willReturn($expected); + + $result = $this->viewModel->getUrl($url['path'], $scope, $store); + + $this->assertSame($expected, $result); + } + + /** + * Providing a non scoped urls + * + * @return array + */ + public function nonScopedUrlsDataProvider(): array + { + return [ + [ + [ + 'path' => 'test/view', + 'params' => [ + '_current' => false, + '_nosid' => true + ] + ], + 'http://domain.com/test/view/', + 'en' + ] + ]; + } + + /** + * Testing url builder with a scope provided + * + * @dataProvider scopedUrlsDataProvider + * + * @param string $storeCode + * @param string $defaultStoreCode + * @param array $urlParams + * @param string $scope + */ + public function testScopedUrlBuilder( + string $storeCode, + string $defaultStoreCode, + array $urlParams, + string $scope = 'store' + ) { + /** @var StoreInterface|MockObject $storeMock */ + $storeMock = $this->createMock(StoreInterface::class); + $storeMock->expects($this->any()) + ->method('getCode') + ->willReturn($defaultStoreCode); + $this->storeManagerMock->expects($this->once()) + ->method('getDefaultStoreView') + ->willReturn($storeMock); + + $this->frontendUrlBuilderMock->expects($this->any()) + ->method('getUrl') + ->withConsecutive( + [ + 'test/index', + [ + '_current' => false, + '_nosid' => true, + '_query' => [ + StoreManagerInterface::PARAM_NAME => $storeCode + ] + ] + ], [ + 'stores/store/switch', + $urlParams + ] + ) + ->willReturnOnConsecutiveCalls( + 'http://domain.com/test', + 'http://domain.com/test/index' + ); + + $result = $this->viewModel->getUrl('test/index', $scope, $storeCode); + + $this->assertSame('http://domain.com/test/index', $result); + } + + /** + * Providing a scoped urls + * + * @return array + */ + public function scopedUrlsDataProvider(): array + { + $enStoreCode = 'en'; + $frStoreCode = 'fr'; + $scopedDefaultUrlParams = $defaultUrlParams = [ + '_current' => false, + '_nosid' => true, + '_query' => [ + '___store' => $enStoreCode, + 'uenc' => null, + ] + ]; + $scopedDefaultUrlParams['_query']['___from_store'] = $frStoreCode; + + return [ + [ + $enStoreCode, + $enStoreCode, + $defaultUrlParams, + ], + [ + $enStoreCode, + $frStoreCode, + $scopedDefaultUrlParams + ] + ]; + } +} From 59d6c757bf6a010ebb7fdd12af9650ea937be417 Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Mon, 16 Dec 2019 20:36:41 +0200 Subject: [PATCH 359/586] Small adjustments --- .../Cms/Test/Unit/ViewModel/Page/Grid/UrlBuilderTest.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Cms/Test/Unit/ViewModel/Page/Grid/UrlBuilderTest.php b/app/code/Magento/Cms/Test/Unit/ViewModel/Page/Grid/UrlBuilderTest.php index c75f86b7e5ffb..fbb2fb1eb65c5 100644 --- a/app/code/Magento/Cms/Test/Unit/ViewModel/Page/Grid/UrlBuilderTest.php +++ b/app/code/Magento/Cms/Test/Unit/ViewModel/Page/Grid/UrlBuilderTest.php @@ -17,6 +17,8 @@ /** * Class UrlBuilderTest + * + * Testing the UrlBuilder */ class UrlBuilderTest extends TestCase { @@ -141,7 +143,8 @@ public function testScopedUrlBuilder( StoreManagerInterface::PARAM_NAME => $storeCode ] ] - ], [ + ], + [ 'stores/store/switch', $urlParams ] From 193bce2eeacbb6b93be55007a8880c53accd94ae Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Mon, 16 Dec 2019 15:22:34 -0600 Subject: [PATCH 360/586] Change action groups name according to CE branch changes --- .../Test/Mftf/ActionGroup/AdminCreateStoreViewActionGroup.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateStoreViewActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateStoreViewActionGroup.xml index 7df225368779b..108b8014bf127 100644 --- a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateStoreViewActionGroup.xml +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateStoreViewActionGroup.xml @@ -30,7 +30,6 @@ <waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitForModal"/> <see selector="{{AdminConfirmationModalSection.title}}" userInput="Warning message" stepKey="seeWarningAboutTakingALongTimeToComplete"/> <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmModal"/> - <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForPageReload"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You saved the store view." stepKey="seeSavedMessage"/> + <waitForText selector="{{AdminMessagesSection.success}}" userInput="You saved the store view." stepKey="seeSavedMessage"/> </actionGroup> </actionGroups> From 8258a162a4629d0ae00ed8c36adff846cb99fd89 Mon Sep 17 00:00:00 2001 From: Oleksandr Miroshnichenko <omiroshnichenko@magento.com> Date: Mon, 16 Dec 2019 15:25:24 -0600 Subject: [PATCH 361/586] add missed dependency on jquery ui core module --- app/code/Magento/Ui/view/base/web/js/modal/modal.js | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Ui/view/base/web/js/modal/modal.js b/app/code/Magento/Ui/view/base/web/js/modal/modal.js index cefe79b42e503..bcbb2f3c31dbd 100644 --- a/app/code/Magento/Ui/view/base/web/js/modal/modal.js +++ b/app/code/Magento/Ui/view/base/web/js/modal/modal.js @@ -15,6 +15,7 @@ define([ 'text!ui/template/modal/modal-custom.html', 'Magento_Ui/js/lib/key-codes', 'jquery-ui-modules/widget', + 'jquery-ui-modules/core', 'mage/translate' ], function ($, _, template, popupTpl, slideTpl, customTpl, keyCodes) { 'use strict'; From b6819dc9a5440e9f75dc980bf9bc1645a10ca3ed Mon Sep 17 00:00:00 2001 From: Viktor Tymchynskyi <vtymchynskyi@magento.com> Date: Mon, 16 Dec 2019 15:28:21 -0600 Subject: [PATCH 362/586] MC-25203: Introduce PHPStan code analysis tool to the static build --- composer.json | 4 +- composer.lock | 554 +++++++++++------- .../Design/Theme/Edit/Tab/GeneralTest.php | 2 +- .../Formatters/FilteredErrorFormatter.php | 142 +++++ .../framework/Magento/PhpStan/autoload.php | 34 ++ .../CodingStandard/Tool/PhpStan.php | 108 ++++ dev/tests/static/framework/bootstrap.php | 4 +- .../Formatters/FilteredErrorFormatterTest.php | 143 +++++ .../Fixtures/ClassWithIgnoreAnnotation.php | 44 ++ .../Fixtures/ClassWithoutIgnoreAnnotation.php | 33 ++ .../ClassAnnotationStructureSniffTest.php | 9 +- .../MethodAnnotationStructureSniffTest.php | 6 +- .../Magento/Test/Php/LiveCodeTest.php | 36 ++ .../Php/_files/phpstan/blacklist/common.txt | 14 + .../Test/Php/_files/phpstan/phpstan.neon | 38 ++ .../Framework/EntityManager/TypeResolver.php | 6 +- .../Test/Unit/Config/ConfigTest.php | 90 +-- .../Unit/Autoloader/FactoryGenerator.php | 3 + 18 files changed, 988 insertions(+), 282 deletions(-) create mode 100644 dev/tests/static/framework/Magento/PhpStan/Formatters/FilteredErrorFormatter.php create mode 100644 dev/tests/static/framework/Magento/PhpStan/autoload.php create mode 100644 dev/tests/static/framework/Magento/TestFramework/CodingStandard/Tool/PhpStan.php create mode 100644 dev/tests/static/framework/tests/unit/testsuite/Magento/PhpStan/Formatters/FilteredErrorFormatterTest.php create mode 100644 dev/tests/static/framework/tests/unit/testsuite/Magento/PhpStan/Formatters/Fixtures/ClassWithIgnoreAnnotation.php create mode 100644 dev/tests/static/framework/tests/unit/testsuite/Magento/PhpStan/Formatters/Fixtures/ClassWithoutIgnoreAnnotation.php create mode 100644 dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/blacklist/common.txt create mode 100644 dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/phpstan.neon diff --git a/composer.json b/composer.json index 4e78f54942576..59737c298b720 100644 --- a/composer.json +++ b/composer.json @@ -92,6 +92,7 @@ "pdepend/pdepend": "2.5.2", "phpcompatibility/php-compatibility": "^9.3", "phpmd/phpmd": "@stable", + "phpstan/phpstan": "^0.12.2", "phpunit/phpunit": "~6.5.0", "sebastian/phpcpd": "~3.0.0", "squizlabs/php_codesniffer": "~3.4.0" @@ -341,7 +342,8 @@ "Magento\\Tools\\": "dev/tools/Magento/Tools/", "Magento\\Tools\\Sanity\\": "dev/build/publication/sanity/Magento/Tools/Sanity/", "Magento\\TestFramework\\Inspection\\": "dev/tests/static/framework/Magento/TestFramework/Inspection/", - "Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/" + "Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/", + "Magento\\PhpStan\\": "dev/tests/static/framework/Magento/PhpStan/" } }, "prefer-stable": true diff --git a/composer.lock b/composer.lock index ba126b3eabefc..8391dd2f48518 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e3ad90186a7742707e4c12cda2580b35", + "content-hash": "7effdb746287f89357497d7bc2ed1bf4", "packages": [ { "name": "braintree/braintree_php", @@ -201,16 +201,16 @@ }, { "name": "composer/ca-bundle", - "version": "1.2.4", + "version": "1.2.5", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "10bb96592168a0f8e8f6dcde3532d9fa50b0b527" + "reference": "62e8fc2dc550e5d6d8c9360c7721662670f58149" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/10bb96592168a0f8e8f6dcde3532d9fa50b0b527", - "reference": "10bb96592168a0f8e8f6dcde3532d9fa50b0b527", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/62e8fc2dc550e5d6d8c9360c7721662670f58149", + "reference": "62e8fc2dc550e5d6d8c9360c7721662670f58149", "shasum": "" }, "require": { @@ -221,7 +221,7 @@ "require-dev": { "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8", "psr/log": "^1.0", - "symfony/process": "^2.5 || ^3.0 || ^4.0" + "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0" }, "type": "library", "extra": { @@ -253,7 +253,7 @@ "ssl", "tls" ], - "time": "2019-08-30T08:44:50+00:00" + "time": "2019-12-11T14:44:42+00:00" }, { "name": "composer/composer", @@ -595,16 +595,16 @@ }, { "name": "guzzlehttp/guzzle", - "version": "6.4.1", + "version": "6.5.0", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "0895c932405407fd3a7368b6910c09a24d26db11" + "reference": "dbc2bc3a293ed6b1ae08a3651e2bfd213d19b6a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/0895c932405407fd3a7368b6910c09a24d26db11", - "reference": "0895c932405407fd3a7368b6910c09a24d26db11", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/dbc2bc3a293ed6b1ae08a3651e2bfd213d19b6a5", + "reference": "dbc2bc3a293ed6b1ae08a3651e2bfd213d19b6a5", "shasum": "" }, "require": { @@ -619,12 +619,13 @@ "psr/log": "^1.1" }, "suggest": { + "ext-intl": "Required for Internationalized Domain Name (IDN) support", "psr/log": "Required for using the Log middleware" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "6.3-dev" + "dev-master": "6.5-dev" } }, "autoload": { @@ -657,7 +658,7 @@ "rest", "web service" ], - "time": "2019-10-23T15:58:00+00:00" + "time": "2019-12-07T18:20:45+00:00" }, { "name": "guzzlehttp/promises", @@ -1065,16 +1066,16 @@ }, { "name": "magento/zendframework1", - "version": "1.14.2", + "version": "1.14.3", "source": { "type": "git", "url": "https://github.com/magento/zf1.git", - "reference": "8221062d42a198e431d183bbe672e5e1a2f98c5f" + "reference": "726855dfb080089dc7bc7b016624129f8e7bc4e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/magento/zf1/zipball/8221062d42a198e431d183bbe672e5e1a2f98c5f", - "reference": "8221062d42a198e431d183bbe672e5e1a2f98c5f", + "url": "https://api.github.com/repos/magento/zf1/zipball/726855dfb080089dc7bc7b016624129f8e7bc4e5", + "reference": "726855dfb080089dc7bc7b016624129f8e7bc4e5", "shasum": "" }, "require": { @@ -1108,7 +1109,7 @@ "ZF1", "framework" ], - "time": "2019-07-26T16:43:11+00:00" + "time": "2019-11-26T15:09:40+00:00" }, { "name": "monolog/monolog", @@ -2083,16 +2084,16 @@ }, { "name": "symfony/css-selector", - "version": "v4.3.8", + "version": "v4.4.1", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "f4b3ff6a549d9ed28b2b0ecd1781bf67cf220ee9" + "reference": "64acec7e0d67125e9f4656c68d4a38a42ab5a0b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/f4b3ff6a549d9ed28b2b0ecd1781bf67cf220ee9", - "reference": "f4b3ff6a549d9ed28b2b0ecd1781bf67cf220ee9", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/64acec7e0d67125e9f4656c68d4a38a42ab5a0b7", + "reference": "64acec7e0d67125e9f4656c68d4a38a42ab5a0b7", "shasum": "" }, "require": { @@ -2101,7 +2102,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -2132,20 +2133,20 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2019-10-02T08:36:26+00:00" + "time": "2019-10-12T00:35:04+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v4.3.8", + "version": "v4.3.9", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "0df002fd4f500392eabd243c2947061a50937287" + "reference": "87a1ae7480f2020818013605a65776b9033bcc4f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/0df002fd4f500392eabd243c2947061a50937287", - "reference": "0df002fd4f500392eabd243c2947061a50937287", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/87a1ae7480f2020818013605a65776b9033bcc4f", + "reference": "87a1ae7480f2020818013605a65776b9033bcc4f", "shasum": "" }, "require": { @@ -2202,7 +2203,7 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2019-11-03T09:04:05+00:00" + "time": "2019-11-28T13:25:45+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -2264,16 +2265,16 @@ }, { "name": "symfony/filesystem", - "version": "v4.3.8", + "version": "v4.4.1", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "9abbb7ef96a51f4d7e69627bc6f63307994e4263" + "reference": "40c2606131d56eff6f193b6e2ceb92414653b591" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/9abbb7ef96a51f4d7e69627bc6f63307994e4263", - "reference": "9abbb7ef96a51f4d7e69627bc6f63307994e4263", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/40c2606131d56eff6f193b6e2ceb92414653b591", + "reference": "40c2606131d56eff6f193b6e2ceb92414653b591", "shasum": "" }, "require": { @@ -2283,7 +2284,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -2310,20 +2311,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2019-08-20T14:07:54+00:00" + "time": "2019-11-26T23:16:41+00:00" }, { "name": "symfony/finder", - "version": "v4.3.8", + "version": "v4.4.1", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "72a068f77e317ae77c0a0495236ad292cfb5ce6f" + "reference": "ce8743441da64c41e2a667b8eb66070444ed911e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/72a068f77e317ae77c0a0495236ad292cfb5ce6f", - "reference": "72a068f77e317ae77c0a0495236ad292cfb5ce6f", + "url": "https://api.github.com/repos/symfony/finder/zipball/ce8743441da64c41e2a667b8eb66070444ed911e", + "reference": "ce8743441da64c41e2a667b8eb66070444ed911e", "shasum": "" }, "require": { @@ -2332,7 +2333,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -2359,20 +2360,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2019-10-30T12:53:54+00:00" + "time": "2019-11-17T21:56:56+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.12.0", + "version": "v1.13.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4" + "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", + "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", "shasum": "" }, "require": { @@ -2384,7 +2385,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.13-dev" } }, "autoload": { @@ -2417,20 +2418,20 @@ "polyfill", "portable" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2019-11-27T13:56:44+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.12.0", + "version": "v1.13.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17" + "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/b42a2f66e8f1b15ccf25652c3424265923eb4f17", - "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7b4aab9743c30be783b73de055d24a39cf4b954f", + "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f", "shasum": "" }, "require": { @@ -2442,7 +2443,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.13-dev" } }, "autoload": { @@ -2476,20 +2477,20 @@ "portable", "shim" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2019-11-27T14:18:11+00:00" }, { "name": "symfony/process", - "version": "v4.3.8", + "version": "v4.3.9", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "3b2e0cb029afbb0395034509291f21191d1a4db0" + "reference": "207dab1f17d34ad71ea72e9741ab8049a9d8251b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/3b2e0cb029afbb0395034509291f21191d1a4db0", - "reference": "3b2e0cb029afbb0395034509291f21191d1a4db0", + "url": "https://api.github.com/repos/symfony/process/zipball/207dab1f17d34ad71ea72e9741ab8049a9d8251b", + "reference": "207dab1f17d34ad71ea72e9741ab8049a9d8251b", "shasum": "" }, "require": { @@ -2525,7 +2526,7 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2019-10-28T17:07:32+00:00" + "time": "2019-11-28T10:05:26+00:00" }, { "name": "tedivm/jshrink", @@ -3529,16 +3530,16 @@ }, { "name": "zendframework/zend-http", - "version": "2.10.0", + "version": "2.11.1", "source": { "type": "git", "url": "https://github.com/zendframework/zend-http.git", - "reference": "4b4983178693a8fdda53b0bbee58552e2d2b1ac0" + "reference": "76000da8490b8685d63ff6f6ff8eefa459f6e9e7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-http/zipball/4b4983178693a8fdda53b0bbee58552e2d2b1ac0", - "reference": "4b4983178693a8fdda53b0bbee58552e2d2b1ac0", + "url": "https://api.github.com/repos/zendframework/zend-http/zipball/76000da8490b8685d63ff6f6ff8eefa459f6e9e7", + "reference": "76000da8490b8685d63ff6f6ff8eefa459f6e9e7", "shasum": "" }, "require": { @@ -3559,8 +3560,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.10.x-dev", - "dev-develop": "2.11.x-dev" + "dev-master": "2.11.x-dev", + "dev-develop": "2.12.x-dev" } }, "autoload": { @@ -3580,7 +3581,7 @@ "zend", "zf" ], - "time": "2019-02-19T18:58:14+00:00" + "time": "2019-12-04T23:02:34+00:00" }, { "name": "zendframework/zend-hydrator", @@ -3644,22 +3645,26 @@ }, { "name": "zendframework/zend-i18n", - "version": "2.9.2", + "version": "2.10.1", "source": { "type": "git", "url": "https://github.com/zendframework/zend-i18n.git", - "reference": "e17a54b3aee333ab156958f570cde630acee8b07" + "reference": "84038e6a1838b611dcc491b1c40321fa4c3a123c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-i18n/zipball/e17a54b3aee333ab156958f570cde630acee8b07", - "reference": "e17a54b3aee333ab156958f570cde630acee8b07", + "url": "https://api.github.com/repos/zendframework/zend-i18n/zipball/84038e6a1838b611dcc491b1c40321fa4c3a123c", + "reference": "84038e6a1838b611dcc491b1c40321fa4c3a123c", "shasum": "" }, "require": { + "ext-intl": "*", "php": "^5.6 || ^7.0", "zendframework/zend-stdlib": "^2.7 || ^3.0" }, + "conflict": { + "phpspec/prophecy": "<1.9.0" + }, "require-dev": { "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.16", "zendframework/zend-cache": "^2.6.1", @@ -3672,7 +3677,6 @@ "zendframework/zend-view": "^2.6.3" }, "suggest": { - "ext-intl": "Required for most features of Zend\\I18n; included in default builds of PHP", "zendframework/zend-cache": "Zend\\Cache component", "zendframework/zend-config": "Zend\\Config component", "zendframework/zend-eventmanager": "You should install this package to use the events in the translator", @@ -3685,8 +3689,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.9.x-dev", - "dev-develop": "2.10.x-dev" + "dev-master": "2.10.x-dev", + "dev-develop": "2.11.x-dev" }, "zf": { "component": "Zend\\I18n", @@ -3708,7 +3712,7 @@ "i18n", "zf" ], - "time": "2019-09-30T12:04:37+00:00" + "time": "2019-12-12T14:08:22+00:00" }, { "name": "zendframework/zend-inputfilter", @@ -4794,16 +4798,16 @@ }, { "name": "zendframework/zend-view", - "version": "2.11.3", + "version": "2.11.4", "source": { "type": "git", "url": "https://github.com/zendframework/zend-view.git", - "reference": "e766457bd6ce13c5354e443bb949511b6904d7f5" + "reference": "a8b1b2d9b52e191539be861a6529f8c8a0c06b9d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-view/zipball/e766457bd6ce13c5354e443bb949511b6904d7f5", - "reference": "e766457bd6ce13c5354e443bb949511b6904d7f5", + "url": "https://api.github.com/repos/zendframework/zend-view/zipball/a8b1b2d9b52e191539be861a6529f8c8a0c06b9d", + "reference": "a8b1b2d9b52e191539be861a6529f8c8a0c06b9d", "shasum": "" }, "require": { @@ -4877,7 +4881,7 @@ "view", "zf" ], - "time": "2019-10-11T21:10:04+00:00" + "time": "2019-12-04T08:40:50+00:00" } ], "packages-dev": [ @@ -5280,16 +5284,16 @@ }, { "name": "codeception/phpunit-wrapper", - "version": "6.7.0", + "version": "6.7.1", "source": { "type": "git", "url": "https://github.com/Codeception/phpunit-wrapper.git", - "reference": "93f59e028826464eac086052fa226e58967f6907" + "reference": "d3b611635b47a583dfaa1a9e98b98fa476d14025" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/phpunit-wrapper/zipball/93f59e028826464eac086052fa226e58967f6907", - "reference": "93f59e028826464eac086052fa226e58967f6907", + "url": "https://api.github.com/repos/Codeception/phpunit-wrapper/zipball/d3b611635b47a583dfaa1a9e98b98fa476d14025", + "reference": "d3b611635b47a583dfaa1a9e98b98fa476d14025", "shasum": "" }, "require": { @@ -5322,7 +5326,7 @@ } ], "description": "PHPUnit classes used by Codeception", - "time": "2019-08-18T15:43:35+00:00" + "time": "2019-11-23T18:22:38+00:00" }, { "name": "codeception/stub", @@ -6162,16 +6166,16 @@ }, { "name": "doctrine/cache", - "version": "1.9.1", + "version": "1.10.0", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "89a5c76c39c292f7798f964ab3c836c3f8192a55" + "reference": "382e7f4db9a12dc6c19431743a2b096041bcdd62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/89a5c76c39c292f7798f964ab3c836c3f8192a55", - "reference": "89a5c76c39c292f7798f964ab3c836c3f8192a55", + "url": "https://api.github.com/repos/doctrine/cache/zipball/382e7f4db9a12dc6c19431743a2b096041bcdd62", + "reference": "382e7f4db9a12dc6c19431743a2b096041bcdd62", "shasum": "" }, "require": { @@ -6238,10 +6242,9 @@ "memcached", "php", "redis", - "riak", "xcache" ], - "time": "2019-11-15T14:31:57+00:00" + "time": "2019-11-29T15:36:20+00:00" }, { "name": "doctrine/inflector", @@ -6620,16 +6623,16 @@ }, { "name": "fzaninotto/faker", - "version": "v1.9.0", + "version": "v1.9.1", "source": { "type": "git", "url": "https://github.com/fzaninotto/Faker.git", - "reference": "27a216cbe72327b2d6369fab721a5843be71e57d" + "reference": "fc10d778e4b84d5bd315dad194661e091d307c6f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/27a216cbe72327b2d6369fab721a5843be71e57d", - "reference": "27a216cbe72327b2d6369fab721a5843be71e57d", + "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/fc10d778e4b84d5bd315dad194661e091d307c6f", + "reference": "fc10d778e4b84d5bd315dad194661e091d307c6f", "shasum": "" }, "require": { @@ -6642,7 +6645,9 @@ }, "type": "library", "extra": { - "branch-alias": [] + "branch-alias": { + "dev-master": "1.9-dev" + } }, "autoload": { "psr-4": { @@ -6664,7 +6669,7 @@ "faker", "fixtures" ], - "time": "2019-11-14T13:13:06+00:00" + "time": "2019-12-12T13:22:17+00:00" }, { "name": "grasmash/expander", @@ -7030,16 +7035,16 @@ }, { "name": "league/flysystem", - "version": "1.0.57", + "version": "1.0.61", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "0e9db7f0b96b9f12dcf6f65bc34b72b1a30ea55a" + "reference": "4fb13c01784a6c9f165a351e996871488ca2d8c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/0e9db7f0b96b9f12dcf6f65bc34b72b1a30ea55a", - "reference": "0e9db7f0b96b9f12dcf6f65bc34b72b1a30ea55a", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/4fb13c01784a6c9f165a351e996871488ca2d8c9", + "reference": "4fb13c01784a6c9f165a351e996871488ca2d8c9", "shasum": "" }, "require": { @@ -7110,7 +7115,7 @@ "sftp", "storage" ], - "time": "2019-10-16T21:01:05+00:00" + "time": "2019-12-08T21:46:50+00:00" }, { "name": "lusitanian/oauth", @@ -7344,16 +7349,16 @@ }, { "name": "mustache/mustache", - "version": "v2.12.0", + "version": "v2.13.0", "source": { "type": "git", "url": "https://github.com/bobthecow/mustache.php.git", - "reference": "fe8fe72e9d580591854de404cc59a1b83ca4d19e" + "reference": "e95c5a008c23d3151d59ea72484d4f72049ab7f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/mustache.php/zipball/fe8fe72e9d580591854de404cc59a1b83ca4d19e", - "reference": "fe8fe72e9d580591854de404cc59a1b83ca4d19e", + "url": "https://api.github.com/repos/bobthecow/mustache.php/zipball/e95c5a008c23d3151d59ea72484d4f72049ab7f4", + "reference": "e95c5a008c23d3151d59ea72484d4f72049ab7f4", "shasum": "" }, "require": { @@ -7386,20 +7391,20 @@ "mustache", "templating" ], - "time": "2017-07-11T12:54:05+00:00" + "time": "2019-11-23T21:40:31+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.9.3", + "version": "1.9.4", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea" + "reference": "579bb7356d91f9456ccd505f24ca8b667966a0a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/007c053ae6f31bba39dfa19a7726f56e9763bbea", - "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/579bb7356d91f9456ccd505f24ca8b667966a0a7", + "reference": "579bb7356d91f9456ccd505f24ca8b667966a0a7", "shasum": "" }, "require": { @@ -7434,7 +7439,59 @@ "object", "object graph" ], - "time": "2019-08-09T12:45:53+00:00" + "time": "2019-12-15T19:12:40+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v4.3.0", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "9a9981c347c5c49d6dfe5cf826bb882b824080dc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/9a9981c347c5c49d6dfe5cf826bb882b824080dc", + "reference": "9a9981c347c5c49d6dfe5cf826bb882b824080dc", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.0" + }, + "require-dev": { + "ircmaxell/php-yacc": "0.0.5", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.3-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "time": "2019-11-08T13:50:10+00:00" }, { "name": "pdepend/pdepend", @@ -7926,20 +7983,20 @@ "authors": [ { "name": "Manuel Pichler", - "role": "Project Founder", "email": "github@manuel-pichler.de", - "homepage": "https://github.com/manuelpichler" + "homepage": "https://github.com/manuelpichler", + "role": "Project Founder" }, { "name": "Marc Würth", - "role": "Project Maintainer", "email": "ravage@bluewin.ch", - "homepage": "https://github.com/ravage84" + "homepage": "https://github.com/ravage84", + "role": "Project Maintainer" }, { "name": "Other contributors", - "role": "Contributors", - "homepage": "https://github.com/phpmd/phpmd/graphs/contributors" + "homepage": "https://github.com/phpmd/phpmd/graphs/contributors", + "role": "Contributors" } ], "description": "PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD.", @@ -7955,33 +8012,34 @@ }, { "name": "phpoption/phpoption", - "version": "1.5.2", + "version": "1.7.2", "source": { "type": "git", "url": "https://github.com/schmittjoh/php-option.git", - "reference": "2ba2586380f8d2b44ad1b9feb61c371020b27793" + "reference": "77f7c4d2e65413aff5b5a8cc8b3caf7a28d81959" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/2ba2586380f8d2b44ad1b9feb61c371020b27793", - "reference": "2ba2586380f8d2b44ad1b9feb61c371020b27793", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/77f7c4d2e65413aff5b5a8cc8b3caf7a28d81959", + "reference": "77f7c4d2e65413aff5b5a8cc8b3caf7a28d81959", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": "^5.5.9 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.7|^5.0" + "bamarni/composer-bin-plugin": "^1.3", + "phpunit/phpunit": "^4.8.35 || ^5.0 || ^6.0 || ^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.5-dev" + "dev-master": "1.7-dev" } }, "autoload": { - "psr-0": { - "PhpOption\\": "src/" + "psr-4": { + "PhpOption\\": "src/PhpOption/" } }, "notification-url": "https://packagist.org/downloads/", @@ -7992,6 +8050,10 @@ { "name": "Johannes M. Schmitt", "email": "schmittjoh@gmail.com" + }, + { + "name": "Graham Campbell", + "email": "graham@alt-three.com" } ], "description": "Option Type for PHP", @@ -8001,7 +8063,7 @@ "php", "type" ], - "time": "2019-11-06T22:27:00+00:00" + "time": "2019-12-15T19:35:24+00:00" }, { "name": "phpspec/prophecy", @@ -8066,6 +8128,46 @@ ], "time": "2019-10-03T11:07:50+00:00" }, + { + "name": "phpstan/phpstan", + "version": "0.12.3", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "c15a6ea55da71d8133399306f560cfe4d30301b7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/c15a6ea55da71d8133399306f560cfe4d30301b7", + "reference": "c15a6ea55da71d8133399306f560cfe4d30301b7", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.3.0", + "php": "^7.1" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.12-dev" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "time": "2019-12-14T13:41:17+00:00" + }, { "name": "phpunit/php-code-coverage", "version": "5.3.2", @@ -9254,27 +9356,27 @@ }, { "name": "symfony/browser-kit", - "version": "v4.3.8", + "version": "v4.4.1", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "b14fa08508afd152257d5dcc7adb5f278654d972" + "reference": "e19e465c055137938afd40cfddd687e7511bbbf0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/b14fa08508afd152257d5dcc7adb5f278654d972", - "reference": "b14fa08508afd152257d5dcc7adb5f278654d972", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/e19e465c055137938afd40cfddd687e7511bbbf0", + "reference": "e19e465c055137938afd40cfddd687e7511bbbf0", "shasum": "" }, "require": { "php": "^7.1.3", - "symfony/dom-crawler": "~3.4|~4.0" + "symfony/dom-crawler": "^3.4|^4.0|^5.0" }, "require-dev": { - "symfony/css-selector": "~3.4|~4.0", - "symfony/http-client": "^4.3", - "symfony/mime": "^4.3", - "symfony/process": "~3.4|~4.0" + "symfony/css-selector": "^3.4|^4.0|^5.0", + "symfony/http-client": "^4.3|^5.0", + "symfony/mime": "^4.3|^5.0", + "symfony/process": "^3.4|^4.0|^5.0" }, "suggest": { "symfony/process": "" @@ -9282,7 +9384,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -9309,36 +9411,36 @@ ], "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "time": "2019-10-28T17:07:32+00:00" + "time": "2019-10-28T20:30:34+00:00" }, { "name": "symfony/config", - "version": "v4.3.8", + "version": "v4.4.1", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "8267214841c44d315a55242ea867684eb43c42ce" + "reference": "7aa5817f1b7a8ed377752b90fcc47dfb3c67b40c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/8267214841c44d315a55242ea867684eb43c42ce", - "reference": "8267214841c44d315a55242ea867684eb43c42ce", + "url": "https://api.github.com/repos/symfony/config/zipball/7aa5817f1b7a8ed377752b90fcc47dfb3c67b40c", + "reference": "7aa5817f1b7a8ed377752b90fcc47dfb3c67b40c", "shasum": "" }, "require": { "php": "^7.1.3", - "symfony/filesystem": "~3.4|~4.0", + "symfony/filesystem": "^3.4|^4.0|^5.0", "symfony/polyfill-ctype": "~1.8" }, "conflict": { "symfony/finder": "<3.4" }, "require-dev": { - "symfony/dependency-injection": "~3.4|~4.0", - "symfony/event-dispatcher": "~3.4|~4.0", - "symfony/finder": "~3.4|~4.0", - "symfony/messenger": "~4.1", - "symfony/yaml": "~3.4|~4.0" + "symfony/event-dispatcher": "^3.4|^4.0|^5.0", + "symfony/finder": "^3.4|^4.0|^5.0", + "symfony/messenger": "^4.1|^5.0", + "symfony/service-contracts": "^1.1|^2", + "symfony/yaml": "^3.4|^4.0|^5.0" }, "suggest": { "symfony/yaml": "To use the yaml reference dumper" @@ -9346,7 +9448,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -9373,29 +9475,29 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2019-11-08T08:31:27+00:00" + "time": "2019-12-01T10:50:45+00:00" }, { "name": "symfony/dependency-injection", - "version": "v4.3.8", + "version": "v4.4.1", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "80c6d9e19467dfbba14f830ed478eb592ce51b64" + "reference": "ad46a4def1325befab696b49c839dffea3fc92bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/80c6d9e19467dfbba14f830ed478eb592ce51b64", - "reference": "80c6d9e19467dfbba14f830ed478eb592ce51b64", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/ad46a4def1325befab696b49c839dffea3fc92bd", + "reference": "ad46a4def1325befab696b49c839dffea3fc92bd", "shasum": "" }, "require": { "php": "^7.1.3", "psr/container": "^1.0", - "symfony/service-contracts": "^1.1.6" + "symfony/service-contracts": "^1.1.6|^2" }, "conflict": { - "symfony/config": "<4.3", + "symfony/config": "<4.3|>=5.0", "symfony/finder": "<3.4", "symfony/proxy-manager-bridge": "<3.4", "symfony/yaml": "<3.4" @@ -9406,8 +9508,8 @@ }, "require-dev": { "symfony/config": "^4.3", - "symfony/expression-language": "~3.4|~4.0", - "symfony/yaml": "~3.4|~4.0" + "symfony/expression-language": "^3.4|^4.0|^5.0", + "symfony/yaml": "^3.4|^4.0|^5.0" }, "suggest": { "symfony/config": "", @@ -9419,7 +9521,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -9446,20 +9548,20 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2019-11-08T16:22:27+00:00" + "time": "2019-12-01T10:19:36+00:00" }, { "name": "symfony/dom-crawler", - "version": "v4.3.8", + "version": "v4.4.1", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "4b9efd5708c3a38593e19b6a33e40867f4f89d72" + "reference": "36bbcab9369fc2f583220890efd43bf262d563fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/4b9efd5708c3a38593e19b6a33e40867f4f89d72", - "reference": "4b9efd5708c3a38593e19b6a33e40867f4f89d72", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/36bbcab9369fc2f583220890efd43bf262d563fd", + "reference": "36bbcab9369fc2f583220890efd43bf262d563fd", "shasum": "" }, "require": { @@ -9472,7 +9574,7 @@ }, "require-dev": { "masterminds/html5": "^2.6", - "symfony/css-selector": "~3.4|~4.0" + "symfony/css-selector": "^3.4|^4.0|^5.0" }, "suggest": { "symfony/css-selector": "" @@ -9480,7 +9582,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -9507,7 +9609,7 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2019-10-28T17:07:32+00:00" + "time": "2019-10-29T11:38:30+00:00" }, { "name": "symfony/http-foundation", @@ -9566,16 +9668,16 @@ }, { "name": "symfony/options-resolver", - "version": "v4.3.8", + "version": "v4.4.1", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "f46c7fc8e207bd8a2188f54f8738f232533765a4" + "reference": "2be23e63f33de16b49294ea6581f462932a77e2f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/f46c7fc8e207bd8a2188f54f8738f232533765a4", - "reference": "f46c7fc8e207bd8a2188f54f8738f232533765a4", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/2be23e63f33de16b49294ea6581f462932a77e2f", + "reference": "2be23e63f33de16b49294ea6581f462932a77e2f", "shasum": "" }, "require": { @@ -9584,7 +9686,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -9616,20 +9718,20 @@ "configuration", "options" ], - "time": "2019-10-28T20:59:01+00:00" + "time": "2019-10-28T21:57:16+00:00" }, { "name": "symfony/polyfill-php54", - "version": "v1.12.0", + "version": "v1.13.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php54.git", - "reference": "a043bcced870214922fbb4bf22679d431ec0296a" + "reference": "dd1618047426412036e98d159940d58a81fc392c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php54/zipball/a043bcced870214922fbb4bf22679d431ec0296a", - "reference": "a043bcced870214922fbb4bf22679d431ec0296a", + "url": "https://api.github.com/repos/symfony/polyfill-php54/zipball/dd1618047426412036e98d159940d58a81fc392c", + "reference": "dd1618047426412036e98d159940d58a81fc392c", "shasum": "" }, "require": { @@ -9638,7 +9740,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.13-dev" } }, "autoload": { @@ -9674,20 +9776,20 @@ "portable", "shim" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2019-11-27T13:56:44+00:00" }, { "name": "symfony/polyfill-php55", - "version": "v1.12.0", + "version": "v1.13.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php55.git", - "reference": "548bb39407e78e54f785b4e18c7e0d5d9e493265" + "reference": "b0d838f225725e2951af1aafc784d2e5ea7b656e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php55/zipball/548bb39407e78e54f785b4e18c7e0d5d9e493265", - "reference": "548bb39407e78e54f785b4e18c7e0d5d9e493265", + "url": "https://api.github.com/repos/symfony/polyfill-php55/zipball/b0d838f225725e2951af1aafc784d2e5ea7b656e", + "reference": "b0d838f225725e2951af1aafc784d2e5ea7b656e", "shasum": "" }, "require": { @@ -9697,7 +9799,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.13-dev" } }, "autoload": { @@ -9730,20 +9832,20 @@ "portable", "shim" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2019-11-27T13:56:44+00:00" }, { "name": "symfony/polyfill-php70", - "version": "v1.12.0", + "version": "v1.13.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "54b4c428a0054e254223797d2713c31e08610831" + "reference": "af23c7bb26a73b850840823662dda371484926c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/54b4c428a0054e254223797d2713c31e08610831", - "reference": "54b4c428a0054e254223797d2713c31e08610831", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/af23c7bb26a73b850840823662dda371484926c4", + "reference": "af23c7bb26a73b850840823662dda371484926c4", "shasum": "" }, "require": { @@ -9753,7 +9855,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.13-dev" } }, "autoload": { @@ -9789,20 +9891,20 @@ "portable", "shim" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2019-11-27T13:56:44+00:00" }, { "name": "symfony/polyfill-php72", - "version": "v1.12.0", + "version": "v1.13.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "04ce3335667451138df4307d6a9b61565560199e" + "reference": "66fea50f6cb37a35eea048d75a7d99a45b586038" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/04ce3335667451138df4307d6a9b61565560199e", - "reference": "04ce3335667451138df4307d6a9b61565560199e", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/66fea50f6cb37a35eea048d75a7d99a45b586038", + "reference": "66fea50f6cb37a35eea048d75a7d99a45b586038", "shasum": "" }, "require": { @@ -9811,7 +9913,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.13-dev" } }, "autoload": { @@ -9844,24 +9946,24 @@ "portable", "shim" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2019-11-27T13:56:44+00:00" }, { "name": "symfony/service-contracts", - "version": "v1.1.8", + "version": "v2.0.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "ffc7f5692092df31515df2a5ecf3b7302b3ddacf" + "reference": "144c5e51266b281231e947b51223ba14acf1a749" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/ffc7f5692092df31515df2a5ecf3b7302b3ddacf", - "reference": "ffc7f5692092df31515df2a5ecf3b7302b3ddacf", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/144c5e51266b281231e947b51223ba14acf1a749", + "reference": "144c5e51266b281231e947b51223ba14acf1a749", "shasum": "" }, "require": { - "php": "^7.1.3", + "php": "^7.2.5", "psr/container": "^1.0" }, "suggest": { @@ -9870,7 +9972,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -9902,30 +10004,30 @@ "interoperability", "standards" ], - "time": "2019-10-14T12:27:06+00:00" + "time": "2019-11-18T17:27:11+00:00" }, { "name": "symfony/stopwatch", - "version": "v4.3.8", + "version": "v4.4.1", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "e96c259de6abcd0cead71f0bf4d730d53ee464d0" + "reference": "5745b514fc56ae1907c6b8ed74f94f90f64694e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/e96c259de6abcd0cead71f0bf4d730d53ee464d0", - "reference": "e96c259de6abcd0cead71f0bf4d730d53ee464d0", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/5745b514fc56ae1907c6b8ed74f94f90f64694e9", + "reference": "5745b514fc56ae1907c6b8ed74f94f90f64694e9", "shasum": "" }, "require": { "php": "^7.1.3", - "symfony/service-contracts": "^1.0" + "symfony/service-contracts": "^1.0|^2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -9952,20 +10054,20 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2019-11-05T14:48:09+00:00" + "time": "2019-11-05T16:11:08+00:00" }, { "name": "symfony/yaml", - "version": "v4.3.8", + "version": "v4.4.1", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "324cf4b19c345465fad14f3602050519e09e361d" + "reference": "76de473358fe802578a415d5bb43c296cf09d211" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/324cf4b19c345465fad14f3602050519e09e361d", - "reference": "324cf4b19c345465fad14f3602050519e09e361d", + "url": "https://api.github.com/repos/symfony/yaml/zipball/76de473358fe802578a415d5bb43c296cf09d211", + "reference": "76de473358fe802578a415d5bb43c296cf09d211", "shasum": "" }, "require": { @@ -9976,7 +10078,7 @@ "symfony/console": "<3.4" }, "require-dev": { - "symfony/console": "~3.4|~4.0" + "symfony/console": "^3.4|^4.0|^5.0" }, "suggest": { "symfony/console": "For validating YAML files using the lint command" @@ -9984,7 +10086,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -10011,7 +10113,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2019-10-30T12:58:49+00:00" + "time": "2019-11-12T14:51:11+00:00" }, { "name": "theseer/fdomdocument", @@ -10146,31 +10248,29 @@ }, { "name": "webmozart/assert", - "version": "1.5.0", + "version": "1.6.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4" + "reference": "573381c0a64f155a0d9a23f4b0c797194805b925" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/88e6d84706d09a236046d686bbea96f07b3a34f4", - "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4", + "url": "https://api.github.com/repos/webmozart/assert/zipball/573381c0a64f155a0d9a23f4b0c797194805b925", + "reference": "573381c0a64f155a0d9a23f4b0c797194805b925", "shasum": "" }, "require": { "php": "^5.3.3 || ^7.0", "symfony/polyfill-ctype": "^1.8" }, + "conflict": { + "vimeo/psalm": "<3.6.0" + }, "require-dev": { "phpunit/phpunit": "^4.8.36 || ^7.5.13" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, "autoload": { "psr-4": { "Webmozart\\Assert\\": "src/" @@ -10192,7 +10292,7 @@ "check", "validate" ], - "time": "2019-08-24T08:43:50+00:00" + "time": "2019-11-24T13:36:37+00:00" }, { "name": "weew/helpers-array", diff --git a/dev/tests/integration/testsuite/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/GeneralTest.php b/dev/tests/integration/testsuite/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/GeneralTest.php index 2539011f25a36..2613b71c24202 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/GeneralTest.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/GeneralTest.php @@ -16,7 +16,7 @@ class GeneralTest extends \PHPUnit\Framework\TestCase /** @var \Magento\Framework\View\Design\ThemeInterface */ protected $_theme; - /** @var \Magento\Theme\Block\Adminhtml\System\Design\Theme\Edit\Tab_General */ + /** @var \Magento\Theme\Block\Adminhtml\System\Design\Theme\Edit\Tab\General */ protected $_block; protected function setUp() diff --git a/dev/tests/static/framework/Magento/PhpStan/Formatters/FilteredErrorFormatter.php b/dev/tests/static/framework/Magento/PhpStan/Formatters/FilteredErrorFormatter.php new file mode 100644 index 0000000000000..b3a4bd9ae0791 --- /dev/null +++ b/dev/tests/static/framework/Magento/PhpStan/Formatters/FilteredErrorFormatter.php @@ -0,0 +1,142 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\PhpStan\Formatters; + +use PHPStan\Command\AnalysisResult; +use PHPStan\Command\ErrorFormatter\TableErrorFormatter; +use PHPStan\Command\Output; + +/** + * To mute the PHPStan error message add a comment above the reported error line. + * + * Example of usage: + * + * // phpstan:ignore "Method Magento\TestModule\TestClass::testMethod() invoked with 1 parameter, 0 required." + * $this->testMethod(1); + * + * or replace some part of error message with * + * + * // phpstan:ignore "Method * invoked with 1 parameter, 0 required." + * $this->testMethod(1); + * + * or just + * + * // phpstan:ignore + * $this->testMethod(1); + * + * or + * + * $this->testMethod(1); // phpstan:ignore + * + * The error message will be suppressed. + * + * @see \Magento\PhpStan\Formatters\Fixtures\ClassWithIgnoreAnnotation + */ +class FilteredErrorFormatter extends TableErrorFormatter +{ + private const MUTE_ERROR_ANNOTATION = 'phpstan:ignore'; + + private const NO_ERRORS = 0; + + /** + * @inheritdoc + */ + public function formatErrors(AnalysisResult $analysisResult, Output $output): int + { + if (!$analysisResult->hasErrors()) { + $style = $output->getStyle(); + $style->success('No errors'); + return self::NO_ERRORS; + } + + $fileSpecificErrorsWithoutIgnoredErrors = $this->clearIgnoredErrors( + $analysisResult->getFileSpecificErrors() + ); + + $clearedAnalysisResult = new AnalysisResult( + $fileSpecificErrorsWithoutIgnoredErrors, + $analysisResult->getNotFileSpecificErrors(), + $analysisResult->isDefaultLevelUsed(), + $analysisResult->hasInferrablePropertyTypesFromConstructor(), + $analysisResult->getProjectConfigFile() + ); + + return parent::formatErrors($clearedAnalysisResult, $output); + } + + /** + * Filters error list. + * + * @param array $fileSpecificErrors + * @return array + */ + private function clearIgnoredErrors(array $fileSpecificErrors): array + { + foreach ($fileSpecificErrors as $index => $error) { + $fileName = $error->getFile(); + // phpcs:ignore Magento2.Functions.DiscouragedFunction + if (!file_exists($fileName)) { + continue; + } + + $line = $error->getLine() ? $this->getLineWithMuteErrorAnnotation($error->getLine(), $fileName) : null; + if ($line === null) { + continue; + } + + $extractErrorPattern = '@' . self::MUTE_ERROR_ANNOTATION . '\s+"(.*?)"@'; + $errorPattern = preg_match($extractErrorPattern, $line, $result) ? $this->preparePattern($result[1]) : ''; + if ($errorPattern && !preg_match('@' . $errorPattern . '@i', $error->getMessage())) { + continue; + } + + unset($fileSpecificErrors[$index]); + } + + return $fileSpecificErrors; + } + + /** + * Returns context of the line with mute error annotation. + * + * @param int $errorLine + * @param string $fileName + * @return string|null + */ + private function getLineWithMuteErrorAnnotation(int $errorLine, string $fileName): ?string + { + $file = new \SplFileObject($fileName); + $lineNumbersToCheck = [ + $errorLine - 2, // the line above to the line that caused the error + $errorLine - 1, // the line that caused the error + $errorLine - 3, // the line two lines above to the line that caused the error + ]; + + foreach ($lineNumbersToCheck as $lineNumber) { + $file->seek($lineNumber > 0 ? $lineNumber : 0); + $line = $file->current(); + if (strpos($line, self::MUTE_ERROR_ANNOTATION) !== false) { + return $line; + } + } + + return null; + } + + /** + * Prepares error pattern. + * + * @param string $errorDescription + * @return string + */ + private function preparePattern(string $errorDescription) + { + // phpcs:ignore Magento2.Functions.DiscouragedFunction + return str_replace('*', '(?:.*?)', addcslashes(trim($errorDescription), '\()[]')); + } +} diff --git a/dev/tests/static/framework/Magento/PhpStan/autoload.php b/dev/tests/static/framework/Magento/PhpStan/autoload.php new file mode 100644 index 0000000000000..baf44b2381759 --- /dev/null +++ b/dev/tests/static/framework/Magento/PhpStan/autoload.php @@ -0,0 +1,34 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +// phpcs:disable + +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Code\Generator\Io; +use Magento\Framework\Filesystem\Driver\File; +use Magento\Framework\TestFramework\Unit\Autoloader\ExtensionAttributesGenerator; +use Magento\Framework\TestFramework\Unit\Autoloader\ExtensionAttributesInterfaceGenerator; +use Magento\Framework\TestFramework\Unit\Autoloader\FactoryGenerator; +use Magento\Framework\TestFramework\Unit\Autoloader\GeneratedClassesAutoloader; + +if (!defined('TESTS_TEMP_DIR')) { + //phpcs:ignore Magento2.Functions.DiscouragedFunction + define('TESTS_TEMP_DIR', dirname(__DIR__) . '/../../tmp'); +} + +$generatorIo = new Io( + new File(), + TESTS_TEMP_DIR . '/' . DirectoryList::getDefaultConfig()[DirectoryList::GENERATED_CODE][DirectoryList::PATH] +); +$generatedCodeAutoloader = new GeneratedClassesAutoloader( + [ + new ExtensionAttributesGenerator(), + new ExtensionAttributesInterfaceGenerator(), + new FactoryGenerator(), + ], + $generatorIo +); +spl_autoload_register([$generatedCodeAutoloader, 'load']); diff --git a/dev/tests/static/framework/Magento/TestFramework/CodingStandard/Tool/PhpStan.php b/dev/tests/static/framework/Magento/TestFramework/CodingStandard/Tool/PhpStan.php new file mode 100644 index 0000000000000..9048262722d48 --- /dev/null +++ b/dev/tests/static/framework/Magento/TestFramework/CodingStandard/Tool/PhpStan.php @@ -0,0 +1,108 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\TestFramework\CodingStandard\Tool; + +use Magento\TestFramework\CodingStandard\ToolInterface; + +/** + * PhpStan tool wrapper. + */ +class PhpStan implements ToolInterface +{ + /** + * Rule level to be used. + * + * @see https://github.com/phpstan/phpstan#rule-levels + */ + private const RULE_LEVEL = 0; + + /** + * Memory limit required by PHPStan for full Magento project scan. + */ + private const MEMORY_LIMIT = '4G'; + + /** + * Error formatter to be used. + * + * @see https://github.com/phpstan/phpstan#existing-error-formatters-to-be-used + */ + private const ERROR_FORMAT = 'filtered'; + + /** + * Report file. + * + * @var string + */ + private $reportFile; + + /** + * PHPStan configuration file in neon format. + * + * @var string + */ + private $confFile; + + /** + * @param string $confFile + * @param string $reportFile + */ + public function __construct(string $confFile, string $reportFile) + { + $this->reportFile = $reportFile; + $this->confFile = $confFile; + } + + /** + * @inheritdoc + * @SuppressWarnings(PHPMD.UnusedLocalVariable) + */ + public function canRun(): bool + { + // phpcs:disable Magento2.Security.InsecureFunction + exec($this->getCommand() . ' --version', $output, $exitCode); + return $exitCode === 0; + } + + /** + * @inheritdoc + * @SuppressWarnings(PHPMD.UnusedLocalVariable) + */ + public function run(array $whiteList): int + { + if (empty($whiteList)) { + return 0; + } + + $command = $this->getCommand() . ' analyse' . + ' --level ' . self::RULE_LEVEL . + ' --no-progress' . + ' --error-format=' . self::ERROR_FORMAT . + ' --memory-limit=' . self::MEMORY_LIMIT . + // phpcs:ignore Magento2.Functions.DiscouragedFunction + ' --configuration ' . escapeshellarg($this->confFile) . + ' ' . implode(' ', $whiteList) . + ' > ' . $this->reportFile; + + // phpcs:disable Magento2.Security.InsecureFunction + exec($command, $output, $exitCode); + + return $exitCode; + } + + /** + * Get PHPStan CLI command + * + * @return string + */ + private function getCommand(): string + { + // phpcs:ignore Magento2.Security.IncludeFile + $vendorDir = require BP . '/app/etc/vendor_path.php'; + return 'php ' . BP . '/' . $vendorDir . '/bin/phpstan'; + } +} diff --git a/dev/tests/static/framework/bootstrap.php b/dev/tests/static/framework/bootstrap.php index 5e3336ebc28de..e43337cf06026 100644 --- a/dev/tests/static/framework/bootstrap.php +++ b/dev/tests/static/framework/bootstrap.php @@ -4,6 +4,8 @@ * See COPYING.txt for license details. */ +// phpcs:disable + use Magento\Framework\App\Utility\Files; use Magento\Framework\Component\ComponentRegistrar; use Magento\Framework\Component\DirSearch; @@ -15,7 +17,7 @@ require __DIR__ . '/autoload.php'; if (!defined('TESTS_TEMP_DIR')) { - define('TESTS_TEMP_DIR', __DIR__ . DIRECTORY_SEPARATOR . 'tmp'); + define('TESTS_TEMP_DIR', dirname(__DIR__) . '/tmp'); } setCustomErrorHandler(); diff --git a/dev/tests/static/framework/tests/unit/testsuite/Magento/PhpStan/Formatters/FilteredErrorFormatterTest.php b/dev/tests/static/framework/tests/unit/testsuite/Magento/PhpStan/Formatters/FilteredErrorFormatterTest.php new file mode 100644 index 0000000000000..dfedd625fdb0e --- /dev/null +++ b/dev/tests/static/framework/tests/unit/testsuite/Magento/PhpStan/Formatters/FilteredErrorFormatterTest.php @@ -0,0 +1,143 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types = 1); + +namespace Magento\PhpStan\Formatters; + +use PHPStan\Analyser\Error; +use PHPStan\Command\AnalysisResult; +use PHPStan\File\FuzzyRelativePathHelper; +use PHPStan\ShouldNotHappenException; +use PHPStan\Testing\ErrorFormatterTestCase; + +/** + * Tests filter error formatter. + */ +class FilteredErrorFormatterTest extends ErrorFormatterTestCase +{ + protected const DIRECTORY_PATH = __DIR__ . '/Fixtures'; + + /** + * Tests errors filtering. + * + * @param string $message + * @param int $exitCode + * @param array $fileErrors + * @param string $expected + * @throws ShouldNotHappenException + * + * @dataProvider dataFormatterOutputProvider + */ + public function testFormatErrors( + string $message, + int $exitCode + array $fileErrors, + string $expected + ): void { + $formatter = new FilteredErrorFormatter( + new FuzzyRelativePathHelper(self::DIRECTORY_PATH, '/', []), + false, + false, + false, + true + ); + + $analysisResult = new AnalysisResult( + $fileErrors, + [], + false, + false, + null + ); + + $this->assertSame( + $exitCode, + $formatter->formatErrors( + $analysisResult, + $this->getOutput() + ), + sprintf('%s: response code do not match', $message) + ); + $this->assertEquals( + $expected, + $this->getOutputContent(), + sprintf('%s: output do not match', $message) + ); + } + + /** + * @return array + */ + public function dataFormatterOutputProvider(): array + { + // phpcs:disable Generic.Files.LineLength.TooLong + $errorMessage = 'Method Magento\PhpStan\Formatters\Fixtures\ClassWithIgnoreAnnotation::testMethod() invoked with 2 parameters, 1 required.'; + // phpcs:enable Generic.Files.LineLength.TooLong + + return [ + [ + 'No errors', + 0, + [], + "\n [OK] No errors\n\n", + ], + [ + 'All errors are suppressed by ignore annotations', + 0, + [ + new Error( + 'Method level error', + self::DIRECTORY_PATH . '/ClassWithIgnoreAnnotation.php', + 22 + ), + new Error( + $errorMessage, + self::DIRECTORY_PATH . '/ClassWithIgnoreAnnotation.php', + 25 + ), + new Error( + $errorMessage, + self::DIRECTORY_PATH . '/ClassWithIgnoreAnnotation.php', + 28 + ), + new Error( + $errorMessage, + self::DIRECTORY_PATH . '/ClassWithIgnoreAnnotation.php', + 31 + ), + new Error( + $errorMessage, + self::DIRECTORY_PATH . '/ClassWithIgnoreAnnotation.php', + 33 + ), + ], + "\n [OK] No errors\n\n", + ], + [ + 'Errors aren\'t suppressed by ignore annotations', + 1, + [ + new Error( + $errorMessage, + self::DIRECTORY_PATH . '/ClassWithoutIgnoreAnnotation.php', + 21 + ), + ], + // phpcs:disable Generic.Files.LineLength.TooLong + ' ------ --------------------------------------------------------------------------------------------------------------------------- + Line ClassWithoutIgnoreAnnotation.php + ------ --------------------------------------------------------------------------------------------------------------------------- + 21 Method Magento\PhpStan\Formatters\Fixtures\ClassWithIgnoreAnnotation::testMethod() invoked with 2 parameters, 1 required. + ------ --------------------------------------------------------------------------------------------------------------------------- + + [ERROR] Found 1 error + +', + // phpcs:enable Generic.Files.LineLength.TooLong + ] + ]; + } +} diff --git a/dev/tests/static/framework/tests/unit/testsuite/Magento/PhpStan/Formatters/Fixtures/ClassWithIgnoreAnnotation.php b/dev/tests/static/framework/tests/unit/testsuite/Magento/PhpStan/Formatters/Fixtures/ClassWithIgnoreAnnotation.php new file mode 100644 index 0000000000000..dc0637704ec82 --- /dev/null +++ b/dev/tests/static/framework/tests/unit/testsuite/Magento/PhpStan/Formatters/Fixtures/ClassWithIgnoreAnnotation.php @@ -0,0 +1,44 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\PhpStan\Formatters\Fixtures; + +/** + * Class ClassWithIgnoreAnnotation + * + * phpcs:ignoreFile + */ +class ClassWithIgnoreAnnotation +{ + /** + * Test method. + * phpstan:ignore "Method level error" + */ + public function getProductList() + { + // phpstan:ignore "Method Magento\PhpStan\Formatters\Fixtures\ClassWithIgnoreAnnotation::testMethod() invoked with 2 parameters, 1 required." + $this->testMethod('test1', 'test2'); + + // phpstan:ignore "Method * invoked with 2 parameters, 1 required." + $this->testMethod('test1', 'test2'); + + // phpstan:ignore + $this->testMethod('test1', 'test2'); + + $this->testMethod('test1', 'test2'); // phpstan:ignore + } + + /** + * @param string $arg1 + * @return string + */ + private function testMethod(string $arg1) + { + return $arg1; + } +} diff --git a/dev/tests/static/framework/tests/unit/testsuite/Magento/PhpStan/Formatters/Fixtures/ClassWithoutIgnoreAnnotation.php b/dev/tests/static/framework/tests/unit/testsuite/Magento/PhpStan/Formatters/Fixtures/ClassWithoutIgnoreAnnotation.php new file mode 100644 index 0000000000000..d46ba7c63d86a --- /dev/null +++ b/dev/tests/static/framework/tests/unit/testsuite/Magento/PhpStan/Formatters/Fixtures/ClassWithoutIgnoreAnnotation.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\PhpStan\Formatters\Fixtures; + +/** + * Class ClassWithoutIgnoreAnnotation + * phpcs:ignoreFile + */ +class ClassWithoutIgnoreAnnotation +{ + /** + * Test method. + */ + public function getProductList() + { + $this->testMethod('test1', 'test2'); + } + + /** + * @param string $arg1 + * @return string + */ + private function testMethod(string $arg1) + { + return $arg1; + } +} diff --git a/dev/tests/static/framework/tests/unit/testsuite/Magento/Sniffs/Annotation/ClassAnnotationStructureSniffTest.php b/dev/tests/static/framework/tests/unit/testsuite/Magento/Sniffs/Annotation/ClassAnnotationStructureSniffTest.php index b12cb1fbfcbd3..afe559fdd6759 100644 --- a/dev/tests/static/framework/tests/unit/testsuite/Magento/Sniffs/Annotation/ClassAnnotationStructureSniffTest.php +++ b/dev/tests/static/framework/tests/unit/testsuite/Magento/Sniffs/Annotation/ClassAnnotationStructureSniffTest.php @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ declare(strict_types=1); + namespace Magento\Sniffs\Annotation; class ClassAnnotationStructureSniffTest extends \PHPUnit\Framework\TestCase @@ -63,8 +64,8 @@ public function testProcess($fileUnderTest, $expectedReportFile) { $reportFile = __DIR__ . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'phpcs_report.txt'; $this->copyFile( - __DIR__ . DIRECTORY_SEPARATOR . '_files'. DIRECTORY_SEPARATOR, - TESTS_TEMP_DIR + __DIR__ . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR, + TESTS_TEMP_DIR . DIRECTORY_SEPARATOR ); $codeSniffer = new \Magento\TestFramework\CodingStandard\Tool\CodeSniffer( 'Magento', @@ -72,11 +73,11 @@ public function testProcess($fileUnderTest, $expectedReportFile) new \Magento\TestFramework\CodingStandard\Tool\CodeSniffer\Wrapper() ); $result = $codeSniffer->run( - [TESTS_TEMP_DIR . $fileUnderTest] + [TESTS_TEMP_DIR . DIRECTORY_SEPARATOR . $fileUnderTest] ); $actual = file_get_contents($reportFile); $expected = file_get_contents( - TESTS_TEMP_DIR . $expectedReportFile + TESTS_TEMP_DIR . DIRECTORY_SEPARATOR . $expectedReportFile ); unlink($reportFile); $this->assertEquals(2, $result); diff --git a/dev/tests/static/framework/tests/unit/testsuite/Magento/Sniffs/Annotation/MethodAnnotationStructureSniffTest.php b/dev/tests/static/framework/tests/unit/testsuite/Magento/Sniffs/Annotation/MethodAnnotationStructureSniffTest.php index b56239f4df8a5..d471597565077 100644 --- a/dev/tests/static/framework/tests/unit/testsuite/Magento/Sniffs/Annotation/MethodAnnotationStructureSniffTest.php +++ b/dev/tests/static/framework/tests/unit/testsuite/Magento/Sniffs/Annotation/MethodAnnotationStructureSniffTest.php @@ -54,7 +54,7 @@ public function testProcess($fileUnderTest, $expectedReportFile) $reportFile = __DIR__ . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'phpcs_report.txt'; $this->copyFile( __DIR__ . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR, - TESTS_TEMP_DIR + TESTS_TEMP_DIR . DIRECTORY_SEPARATOR ); $codeSniffer = new \Magento\TestFramework\CodingStandard\Tool\CodeSniffer( 'Magento', @@ -62,11 +62,11 @@ public function testProcess($fileUnderTest, $expectedReportFile) new \Magento\TestFramework\CodingStandard\Tool\CodeSniffer\Wrapper() ); $result = $codeSniffer->run( - [TESTS_TEMP_DIR . $fileUnderTest] + [TESTS_TEMP_DIR . DIRECTORY_SEPARATOR . $fileUnderTest] ); $actual = file_get_contents($reportFile); $expected = file_get_contents( - TESTS_TEMP_DIR . $expectedReportFile + TESTS_TEMP_DIR . DIRECTORY_SEPARATOR . $expectedReportFile ); unlink($reportFile); $this->assertEquals(2, $result); diff --git a/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php b/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php index a00c09ceadcef..8ccda77a25191 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php @@ -13,6 +13,7 @@ use Magento\TestFramework\CodingStandard\Tool\CodeSniffer\Wrapper; use Magento\TestFramework\CodingStandard\Tool\CopyPasteDetector; use Magento\TestFramework\CodingStandard\Tool\PhpCompatibility; +use Magento\TestFramework\CodingStandard\Tool\PhpStan; use PHPMD\TextUI\Command; /** @@ -465,4 +466,39 @@ public function testPhpCompatibility() 'PHP Compatibility detected violation(s):' . PHP_EOL . $report ); } + + /** + * Test code quality using PHPStan + * + * @throws \Exception + */ + public function testPhpStan() + { + $reportFile = self::$reportDir . '/phpstan_report.txt'; + $confFile = __DIR__ . '/_files/phpstan/phpstan.neon'; + + if (!file_exists($reportFile)) { + touch($reportFile); + } + + $fileList = self::getWhitelist(['php']); + $blackList = Files::init()->readLists(__DIR__ . '/_files/phpstan/blacklist/*.txt'); + if ($blackList) { + $blackListPattern = sprintf('#(%s)#i', implode('|', $blackList)); + $fileList = array_filter( + $fileList, + function ($path) use ($blackListPattern) { + return !preg_match($blackListPattern, $path); + } + ); + } + + $phpStan = new PhpStan($confFile, $reportFile); + $exitCode = $phpStan->run($fileList); + $report = file_get_contents($reportFile); + + $errorMessage = empty($report) ? + 'PHPStan command run failed.' : 'PHPStan detected violation(s):' . PHP_EOL . $report; + $this->assertEquals(0, $exitCode, $errorMessage); + } } diff --git a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/blacklist/common.txt b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/blacklist/common.txt new file mode 100644 index 0000000000000..34965bda0dba6 --- /dev/null +++ b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/blacklist/common.txt @@ -0,0 +1,14 @@ +# Format: path to directory or path to file +# +# Example: +# app/code/Magento/Catalog +# dev/tests/static/framework/bootstrap.php +lib/internal/Magento/Framework/Interception/Test/Unit/Config/ConfigTest.php +lib/internal/Magento/Framework/Cache/Backend/Eaccelerator.php +dev/tests/integration/framework/deployTestModules.php +dev/tests/integration/testsuite/Magento/Framework/Session/ConfigTest.php +dev/tests/integration/testsuite/Magento/Framework/Session/SessionManagerTest.php +dev/tests/api-functional/testsuite/Magento/Customer/Api/AddressRepositoryTest.php +dev/tests/api-functional/testsuite/Magento/Framework/Model/Entity/HydratorTest.php +dev/tests/api-functional/testsuite/Magento/Integration/Model/AdminTokenServiceTest.php +dev/tests/api-functional/testsuite/Magento/Integration/Model/CustomerTokenServiceTest.php diff --git a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/phpstan.neon b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/phpstan.neon new file mode 100644 index 0000000000000..f4f6ff87f8175 --- /dev/null +++ b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/phpstan.neon @@ -0,0 +1,38 @@ +parameters: + checkExplicitMixedMissingReturn: true + checkPhpDocMissingReturn: true + reportUnmatchedIgnoredErrors: false + excludes_analyse: + - %rootDir%/../../../lib/internal/Magento/Framework/ObjectManager/Test/Unit/* + - %rootDir%/../../../*/_files/* + - %rootDir%/../../../dev/tests/functional/* + - %rootDir%/../../../dev/tests/*/Fixtures/* + - %rootDir%/../../../dev/tests/*/tmp/* + - %rootDir%/../../../dev/tests/*/_generated/* + - %rootDir%/../../../pub/* + autoload_directories: + - %rootDir%/../../../dev/tests/static/framework/tests/unit/testsuite/Magento + - %rootDir%/../../../dev/tests/integration/framework/tests/unit/testsuite/Magento + - %rootDir%/../../../dev/tests/api-functional/_files/Magento + autoload_files: + - %rootDir%/../../../dev/tests/static/framework/autoload.php + - %rootDir%/../../../dev/tests/integration/framework/autoload.php + - %rootDir%/../../../dev/tests/api-functional/framework/autoload.php + - %rootDir%/../../../dev/tests/setup-integration/framework/autoload.php + - %rootDir%/../../../dev/tests/static/framework/Magento/PhpStan/autoload.php + ignoreErrors: + # Ignore PHPStan\Rules\Classes\UnusedConstructorParametersRule + - '#Constructor of class [a-zA-Z0-9\\_]+ has an unused parameter#' + # Ignore setCustomErrorHandler function not found in bootstrap files + - '#Function setCustomErrorHandler not found#' + # Ignore 'return statement is missing' error when 'void' is present in return type list + - '#Method (?:.*?) should return (?:.*?)void(?:.*?) but return statement is missing.#' + +services: + errorFormatter.filtered: + class: Magento\PhpStan\Formatters\FilteredErrorFormatter + arguments: + showTipsOfTheDay: false + checkThisOnly: false + inferPrivatePropertyTypeFromConstructor: true + checkMissingTypehints: %checkMissingTypehints% diff --git a/lib/internal/Magento/Framework/EntityManager/TypeResolver.php b/lib/internal/Magento/Framework/EntityManager/TypeResolver.php index 79cdbae126d7a..1f559c01f11b6 100644 --- a/lib/internal/Magento/Framework/EntityManager/TypeResolver.php +++ b/lib/internal/Magento/Framework/EntityManager/TypeResolver.php @@ -6,7 +6,7 @@ namespace Magento\Framework\EntityManager; /** - * Class TypeResolver + * Resolves types. */ class TypeResolver { @@ -20,7 +20,9 @@ class TypeResolver */ private $typeMapping = [ \Magento\SalesRule\Model\Rule::class => \Magento\SalesRule\Api\Data\RuleInterface::class, + // phpstan:ignore "Class Magento\SalesRule\Model\Rule\Interceptor not found." \Magento\SalesRule\Model\Rule\Interceptor::class => \Magento\SalesRule\Api\Data\RuleInterface::class, + // phpstan:ignore "Class Magento\SalesRule\Model\Rule\Proxy not found." \Magento\SalesRule\Model\Rule\Proxy::class => \Magento\SalesRule\Api\Data\RuleInterface::class ]; @@ -34,6 +36,8 @@ public function __construct(MetadataPool $metadataPool) } /** + * Resolves type. + * * @param object $type * @return string * @throws \Exception diff --git a/lib/internal/Magento/Framework/Interception/Test/Unit/Config/ConfigTest.php b/lib/internal/Magento/Framework/Interception/Test/Unit/Config/ConfigTest.php index 61eb2e62091ea..98bac47e8e1b0 100644 --- a/lib/internal/Magento/Framework/Interception/Test/Unit/Config/ConfigTest.php +++ b/lib/internal/Magento/Framework/Interception/Test/Unit/Config/ConfigTest.php @@ -6,8 +6,6 @@ namespace Magento\Framework\Interception\Test\Unit\Config; -use Magento\Framework\Serialize\SerializerInterface; - require_once __DIR__ . '/../Custom/Module/Model/Item.php'; require_once __DIR__ . '/../Custom/Module/Model/Item/Enhanced.php'; require_once __DIR__ . '/../Custom/Module/Model/ItemContainer.php'; @@ -89,48 +87,52 @@ public function testHasPluginsWhenDataIsNotCached($expectedResult, $type, $entit ->will($this->returnValue(null)); $this->omConfigMock->expects($this->any()) ->method('getOriginalInstanceType') - ->will($this->returnValueMap( - [ - [ - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemContainer::class, - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemContainer::class, - ], - [ - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\Item::class, - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\Item::class, - ], - [ - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\Item\Enhanced::class, - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\Item\Enhanced::class, - ], - [ - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemContainer\Enhanced::class, - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemContainer\Enhanced::class, - ], - [ - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemContainer\Proxy::class, - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemContainer\Proxy::class, - ], + ->will( + $this->returnValueMap( [ - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemProxy::class, - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemProxy::class, - ], - [ - \Magento\Framework\Interception\Custom\Module\Model\Backslash\ItemProxy::class, - \Magento\Framework\Interception\Custom\Module\Model\Backslash\ItemProxy::class - ], - [ - 'virtual_custom_item', - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\Item::class - ], + [ + \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemContainer::class, + \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemContainer::class, + ], + [ + \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\Item::class, + \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\Item::class, + ], + [ + \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\Item\Enhanced::class, + \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\Item\Enhanced::class, + ], + [ + \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemContainer\Enhanced::class, + \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemContainer\Enhanced::class, + ], + [ + \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemContainer\Proxy::class, + \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemContainer\Proxy::class, + ], + [ + \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\Item\Proxy::class, + \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\Item\Proxy::class, + ], + [ + \Magento\Framework\Interception\Custom\Module\Model\Backslash\Item\Proxy::class, + \Magento\Framework\Interception\Custom\Module\Model\Backslash\Item\Proxy::class + ], + [ + 'virtual_custom_item', + \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\Item::class + ], + ] + ) + ); + $this->definitionMock->expects($this->any())->method('getClasses')->will( + $this->returnValue( + [ + \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\Item\Proxy::class, + \Magento\Framework\Interception\Custom\Module\Model\Backslash\Item\Proxy::class ] - )); - $this->definitionMock->expects($this->any())->method('getClasses')->will($this->returnValue( - [ - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemProxy::class, - \Magento\Framework\Interception\Custom\Module\Model\Backslash\ItemProxy::class - ] - )); + ) + ); $this->relationsMock->expects($this->any())->method('has')->will($this->returnValue($expectedResult)); $this->relationsMock->expects($this->any())->method('getParents')->will($this->returnValue($entityParents)); @@ -163,7 +165,7 @@ public function testHasPluginsWhenDataIsCached($expectedResult, $type) \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\Item\Enhanced::class => true, \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemContainer\Enhanced::class => true, \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemContainer\Proxy::class => true, - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemProxy::class => false, + \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\Item\Proxy::class => false, 'virtual_custom_item' => true ]; $this->readerMock->expects($this->never())->method('read'); @@ -221,7 +223,7 @@ public function hasPluginsDataProvider() [\Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemContainer::class] ], [ - false, \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemProxy::class, + false, \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\Item\Proxy::class, [] ], [ diff --git a/lib/internal/Magento/Framework/TestFramework/Unit/Autoloader/FactoryGenerator.php b/lib/internal/Magento/Framework/TestFramework/Unit/Autoloader/FactoryGenerator.php index df5b0b0e0ad0c..1a669ace443ec 100644 --- a/lib/internal/Magento/Framework/TestFramework/Unit/Autoloader/FactoryGenerator.php +++ b/lib/internal/Magento/Framework/TestFramework/Unit/Autoloader/FactoryGenerator.php @@ -43,6 +43,9 @@ public function generate($className) */ private function isFactory($className) { + if (!preg_match('/[\\\A-Z]/', substr(ltrim($className), 0, 1))) { + return false; + } $sourceName = rtrim(substr($className, 0, -strlen('Factory')), '\\'); return $sourceName . 'Factory' == $className; } From 40f35ee7ad5b5c3390e9cb297a7871019269c807 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Mon, 16 Dec 2019 16:11:43 -0600 Subject: [PATCH 363/586] Fix static --- .../view/frontend/templates/form.phtml | 36 ++++++++++++++++--- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Contact/view/frontend/templates/form.phtml b/app/code/Magento/Contact/view/frontend/templates/form.phtml index 053cf419e4225..2982a0a99f74c 100644 --- a/app/code/Magento/Contact/view/frontend/templates/form.phtml +++ b/app/code/Magento/Contact/view/frontend/templates/form.phtml @@ -17,29 +17,55 @@ $viewModel = $block->getViewModel(); data-mage-init='{"validation":{}}'> <fieldset class="fieldset"> <legend class="legend"><span><?= $block->escapeHtml(__('Write Us')) ?></span></legend><br /> - <div class="field note no-label"><?= $block->escapeHtml(__('Jot us a note and we’ll get back to you as quickly as possible.')) ?></div> + <div class="field note no-label"> + <?= $block->escapeHtml(__('Jot us a note and we’ll get back to you as quickly as possible.')) ?> + </div> <div class="field name required"> <label class="label" for="name"><span><?= $block->escapeHtml(__('Name')) ?></span></label> <div class="control"> - <input name="name" id="name" title="<?= $block->escapeHtmlAttr(__('Name')) ?>" value="<?= $block->escapeHtmlAttr($viewModel->getUserName()) ?>" class="input-text" type="text" data-validate="{required:true}"/> + <input name="name" + id="name" + title="<?= $block->escapeHtmlAttr(__('Name')) ?>" + value="<?= $block->escapeHtmlAttr($viewModel->getUserName()) ?>" + class="input-text" + type="text" + data-validate="{required:true}"/> </div> </div> <div class="field email required"> <label class="label" for="email"><span><?= $block->escapeHtml(__('Email')) ?></span></label> <div class="control"> - <input name="email" id="email" title="<?= $block->escapeHtmlAttr(__('Email')) ?>" value="<?= $block->escapeHtmlAttr($viewModel->getUserEmail()) ?>" class="input-text" type="email" data-validate="{required:true, 'validate-email':true}"/> + <input name="email" + id="email" + title="<?= $block->escapeHtmlAttr(__('Email')) ?>" + value="<?= $block->escapeHtmlAttr($viewModel->getUserEmail()) ?>" + class="input-text" + type="email" + data-validate="{required:true, 'validate-email':true}"/> </div> </div> <div class="field telephone"> <label class="label" for="telephone"><span><?= $block->escapeHtml(__('Phone Number')) ?></span></label> <div class="control"> - <input name="telephone" id="telephone" title="<?= $block->escapeHtmlAttr(__('Phone Number')) ?>" value="<?= $block->escapeHtmlAttr($viewModel->getUserTelephone()) ?>" class="input-text" type="text" /> + <input name="telephone" + id="telephone" + title="<?= $block->escapeHtmlAttr(__('Phone Number')) ?>" + value="<?= $block->escapeHtmlAttr($viewModel->getUserTelephone()) ?>" + class="input-text" + type="text" /> </div> </div> <div class="field comment required"> <label class="label" for="comment"><span><?= $block->escapeHtml(__('What’s on your mind?')) ?></span></label> <div class="control"> - <textarea name="comment" id="comment" title="<?= $block->escapeHtmlAttr(__('What’s on your mind?')) ?>" class="input-text" cols="5" rows="3" data-validate="{required:true}"><?= $block->escapeHtml($viewModel->getUserComment()) ?></textarea> + <textarea name="comment" + id="comment" + title="<?= $block->escapeHtmlAttr(__('What’s on your mind?')) ?>" + class="input-text" + cols="5" + rows="3" + data-validate="{required:true}"><?= $block->escapeHtml($viewModel->getUserComment()) ?> + </textarea> </div> </div> <?= $block->getChildHtml('form.additional.info') ?> From a4984838127857816256e4d0a0a4ed82f1d43ccb Mon Sep 17 00:00:00 2001 From: Viktor Tymchynskyi <vtymchynskyi@magento.com> Date: Mon, 16 Dec 2019 16:31:33 -0600 Subject: [PATCH 364/586] MC-25203: Introduce PHPStan code analysis tool to the static build - Fix test --- .../Magento/PhpStan/Formatters/FilteredErrorFormatterTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/static/framework/tests/unit/testsuite/Magento/PhpStan/Formatters/FilteredErrorFormatterTest.php b/dev/tests/static/framework/tests/unit/testsuite/Magento/PhpStan/Formatters/FilteredErrorFormatterTest.php index dfedd625fdb0e..8512f311f15a2 100644 --- a/dev/tests/static/framework/tests/unit/testsuite/Magento/PhpStan/Formatters/FilteredErrorFormatterTest.php +++ b/dev/tests/static/framework/tests/unit/testsuite/Magento/PhpStan/Formatters/FilteredErrorFormatterTest.php @@ -33,7 +33,7 @@ class FilteredErrorFormatterTest extends ErrorFormatterTestCase */ public function testFormatErrors( string $message, - int $exitCode + int $exitCode, array $fileErrors, string $expected ): void { From aa419de0b281718352112a7e6540388efccd395f Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Mon, 16 Dec 2019 16:44:36 -0600 Subject: [PATCH 365/586] Fix codestyle --- app/code/Magento/Contact/view/frontend/templates/form.phtml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Contact/view/frontend/templates/form.phtml b/app/code/Magento/Contact/view/frontend/templates/form.phtml index 2982a0a99f74c..3a7c4c8b6d865 100644 --- a/app/code/Magento/Contact/view/frontend/templates/form.phtml +++ b/app/code/Magento/Contact/view/frontend/templates/form.phtml @@ -56,7 +56,9 @@ $viewModel = $block->getViewModel(); </div> </div> <div class="field comment required"> - <label class="label" for="comment"><span><?= $block->escapeHtml(__('What’s on your mind?')) ?></span></label> + <label class="label" for="comment"> + <span><?= $block->escapeHtml(__('What’s on your mind?')) ?></span> + </label> <div class="control"> <textarea name="comment" id="comment" From 9c51c71ad2f686a51026a014a984c2e22a481cf5 Mon Sep 17 00:00:00 2001 From: Viktor Tymchynskyi <vtymchynskyi@magento.com> Date: Mon, 16 Dec 2019 16:53:54 -0600 Subject: [PATCH 366/586] MC-25203: Introduce PHPStan code analysis tool to the static build - update composer --- composer.json | 2 +- composer.lock | 450 +++++++++++++++++++++++++------------------------- 2 files changed, 222 insertions(+), 230 deletions(-) diff --git a/composer.json b/composer.json index 59737c298b720..7e01980e32f58 100644 --- a/composer.json +++ b/composer.json @@ -92,7 +92,7 @@ "pdepend/pdepend": "2.5.2", "phpcompatibility/php-compatibility": "^9.3", "phpmd/phpmd": "@stable", - "phpstan/phpstan": "^0.12.2", + "phpstan/phpstan": "^0.12.3", "phpunit/phpunit": "~6.5.0", "sebastian/phpcpd": "~3.0.0", "squizlabs/php_codesniffer": "~3.4.0" diff --git a/composer.lock b/composer.lock index 8391dd2f48518..a63cdcdf4a1e1 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7effdb746287f89357497d7bc2ed1bf4", + "content-hash": "38446350ff1ac4609f77d5d74213880d", "packages": [ { "name": "braintree/braintree_php", @@ -201,16 +201,16 @@ }, { "name": "composer/ca-bundle", - "version": "1.2.5", + "version": "1.2.4", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "62e8fc2dc550e5d6d8c9360c7721662670f58149" + "reference": "10bb96592168a0f8e8f6dcde3532d9fa50b0b527" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/62e8fc2dc550e5d6d8c9360c7721662670f58149", - "reference": "62e8fc2dc550e5d6d8c9360c7721662670f58149", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/10bb96592168a0f8e8f6dcde3532d9fa50b0b527", + "reference": "10bb96592168a0f8e8f6dcde3532d9fa50b0b527", "shasum": "" }, "require": { @@ -221,7 +221,7 @@ "require-dev": { "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8", "psr/log": "^1.0", - "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0" + "symfony/process": "^2.5 || ^3.0 || ^4.0" }, "type": "library", "extra": { @@ -253,7 +253,7 @@ "ssl", "tls" ], - "time": "2019-12-11T14:44:42+00:00" + "time": "2019-08-30T08:44:50+00:00" }, { "name": "composer/composer", @@ -595,16 +595,16 @@ }, { "name": "guzzlehttp/guzzle", - "version": "6.5.0", + "version": "6.4.1", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "dbc2bc3a293ed6b1ae08a3651e2bfd213d19b6a5" + "reference": "0895c932405407fd3a7368b6910c09a24d26db11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/dbc2bc3a293ed6b1ae08a3651e2bfd213d19b6a5", - "reference": "dbc2bc3a293ed6b1ae08a3651e2bfd213d19b6a5", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/0895c932405407fd3a7368b6910c09a24d26db11", + "reference": "0895c932405407fd3a7368b6910c09a24d26db11", "shasum": "" }, "require": { @@ -619,13 +619,12 @@ "psr/log": "^1.1" }, "suggest": { - "ext-intl": "Required for Internationalized Domain Name (IDN) support", "psr/log": "Required for using the Log middleware" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "6.5-dev" + "dev-master": "6.3-dev" } }, "autoload": { @@ -658,7 +657,7 @@ "rest", "web service" ], - "time": "2019-12-07T18:20:45+00:00" + "time": "2019-10-23T15:58:00+00:00" }, { "name": "guzzlehttp/promises", @@ -1066,16 +1065,16 @@ }, { "name": "magento/zendframework1", - "version": "1.14.3", + "version": "1.14.2", "source": { "type": "git", "url": "https://github.com/magento/zf1.git", - "reference": "726855dfb080089dc7bc7b016624129f8e7bc4e5" + "reference": "8221062d42a198e431d183bbe672e5e1a2f98c5f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/magento/zf1/zipball/726855dfb080089dc7bc7b016624129f8e7bc4e5", - "reference": "726855dfb080089dc7bc7b016624129f8e7bc4e5", + "url": "https://api.github.com/repos/magento/zf1/zipball/8221062d42a198e431d183bbe672e5e1a2f98c5f", + "reference": "8221062d42a198e431d183bbe672e5e1a2f98c5f", "shasum": "" }, "require": { @@ -1109,7 +1108,7 @@ "ZF1", "framework" ], - "time": "2019-11-26T15:09:40+00:00" + "time": "2019-07-26T16:43:11+00:00" }, { "name": "monolog/monolog", @@ -2084,16 +2083,16 @@ }, { "name": "symfony/css-selector", - "version": "v4.4.1", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "64acec7e0d67125e9f4656c68d4a38a42ab5a0b7" + "reference": "f4b3ff6a549d9ed28b2b0ecd1781bf67cf220ee9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/64acec7e0d67125e9f4656c68d4a38a42ab5a0b7", - "reference": "64acec7e0d67125e9f4656c68d4a38a42ab5a0b7", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/f4b3ff6a549d9ed28b2b0ecd1781bf67cf220ee9", + "reference": "f4b3ff6a549d9ed28b2b0ecd1781bf67cf220ee9", "shasum": "" }, "require": { @@ -2102,7 +2101,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.4-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -2133,20 +2132,20 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2019-10-12T00:35:04+00:00" + "time": "2019-10-02T08:36:26+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v4.3.9", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "87a1ae7480f2020818013605a65776b9033bcc4f" + "reference": "0df002fd4f500392eabd243c2947061a50937287" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/87a1ae7480f2020818013605a65776b9033bcc4f", - "reference": "87a1ae7480f2020818013605a65776b9033bcc4f", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/0df002fd4f500392eabd243c2947061a50937287", + "reference": "0df002fd4f500392eabd243c2947061a50937287", "shasum": "" }, "require": { @@ -2203,7 +2202,7 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2019-11-28T13:25:45+00:00" + "time": "2019-11-03T09:04:05+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -2265,16 +2264,16 @@ }, { "name": "symfony/filesystem", - "version": "v4.4.1", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "40c2606131d56eff6f193b6e2ceb92414653b591" + "reference": "9abbb7ef96a51f4d7e69627bc6f63307994e4263" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/40c2606131d56eff6f193b6e2ceb92414653b591", - "reference": "40c2606131d56eff6f193b6e2ceb92414653b591", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/9abbb7ef96a51f4d7e69627bc6f63307994e4263", + "reference": "9abbb7ef96a51f4d7e69627bc6f63307994e4263", "shasum": "" }, "require": { @@ -2284,7 +2283,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.4-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -2311,20 +2310,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2019-11-26T23:16:41+00:00" + "time": "2019-08-20T14:07:54+00:00" }, { "name": "symfony/finder", - "version": "v4.4.1", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "ce8743441da64c41e2a667b8eb66070444ed911e" + "reference": "72a068f77e317ae77c0a0495236ad292cfb5ce6f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/ce8743441da64c41e2a667b8eb66070444ed911e", - "reference": "ce8743441da64c41e2a667b8eb66070444ed911e", + "url": "https://api.github.com/repos/symfony/finder/zipball/72a068f77e317ae77c0a0495236ad292cfb5ce6f", + "reference": "72a068f77e317ae77c0a0495236ad292cfb5ce6f", "shasum": "" }, "require": { @@ -2333,7 +2332,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.4-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -2360,20 +2359,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2019-11-17T21:56:56+00:00" + "time": "2019-10-30T12:53:54+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.13.1", + "version": "v1.12.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3" + "reference": "550ebaac289296ce228a706d0867afc34687e3f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", - "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4", + "reference": "550ebaac289296ce228a706d0867afc34687e3f4", "shasum": "" }, "require": { @@ -2385,7 +2384,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.13-dev" + "dev-master": "1.12-dev" } }, "autoload": { @@ -2418,20 +2417,20 @@ "polyfill", "portable" ], - "time": "2019-11-27T13:56:44+00:00" + "time": "2019-08-06T08:03:45+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.13.1", + "version": "v1.12.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f" + "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7b4aab9743c30be783b73de055d24a39cf4b954f", - "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/b42a2f66e8f1b15ccf25652c3424265923eb4f17", + "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17", "shasum": "" }, "require": { @@ -2443,7 +2442,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.13-dev" + "dev-master": "1.12-dev" } }, "autoload": { @@ -2477,20 +2476,20 @@ "portable", "shim" ], - "time": "2019-11-27T14:18:11+00:00" + "time": "2019-08-06T08:03:45+00:00" }, { "name": "symfony/process", - "version": "v4.3.9", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "207dab1f17d34ad71ea72e9741ab8049a9d8251b" + "reference": "3b2e0cb029afbb0395034509291f21191d1a4db0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/207dab1f17d34ad71ea72e9741ab8049a9d8251b", - "reference": "207dab1f17d34ad71ea72e9741ab8049a9d8251b", + "url": "https://api.github.com/repos/symfony/process/zipball/3b2e0cb029afbb0395034509291f21191d1a4db0", + "reference": "3b2e0cb029afbb0395034509291f21191d1a4db0", "shasum": "" }, "require": { @@ -2526,7 +2525,7 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2019-11-28T10:05:26+00:00" + "time": "2019-10-28T17:07:32+00:00" }, { "name": "tedivm/jshrink", @@ -3530,16 +3529,16 @@ }, { "name": "zendframework/zend-http", - "version": "2.11.1", + "version": "2.10.0", "source": { "type": "git", "url": "https://github.com/zendframework/zend-http.git", - "reference": "76000da8490b8685d63ff6f6ff8eefa459f6e9e7" + "reference": "4b4983178693a8fdda53b0bbee58552e2d2b1ac0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-http/zipball/76000da8490b8685d63ff6f6ff8eefa459f6e9e7", - "reference": "76000da8490b8685d63ff6f6ff8eefa459f6e9e7", + "url": "https://api.github.com/repos/zendframework/zend-http/zipball/4b4983178693a8fdda53b0bbee58552e2d2b1ac0", + "reference": "4b4983178693a8fdda53b0bbee58552e2d2b1ac0", "shasum": "" }, "require": { @@ -3560,8 +3559,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.11.x-dev", - "dev-develop": "2.12.x-dev" + "dev-master": "2.10.x-dev", + "dev-develop": "2.11.x-dev" } }, "autoload": { @@ -3581,7 +3580,7 @@ "zend", "zf" ], - "time": "2019-12-04T23:02:34+00:00" + "time": "2019-02-19T18:58:14+00:00" }, { "name": "zendframework/zend-hydrator", @@ -3645,26 +3644,22 @@ }, { "name": "zendframework/zend-i18n", - "version": "2.10.1", + "version": "2.9.2", "source": { "type": "git", "url": "https://github.com/zendframework/zend-i18n.git", - "reference": "84038e6a1838b611dcc491b1c40321fa4c3a123c" + "reference": "e17a54b3aee333ab156958f570cde630acee8b07" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-i18n/zipball/84038e6a1838b611dcc491b1c40321fa4c3a123c", - "reference": "84038e6a1838b611dcc491b1c40321fa4c3a123c", + "url": "https://api.github.com/repos/zendframework/zend-i18n/zipball/e17a54b3aee333ab156958f570cde630acee8b07", + "reference": "e17a54b3aee333ab156958f570cde630acee8b07", "shasum": "" }, "require": { - "ext-intl": "*", "php": "^5.6 || ^7.0", "zendframework/zend-stdlib": "^2.7 || ^3.0" }, - "conflict": { - "phpspec/prophecy": "<1.9.0" - }, "require-dev": { "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.16", "zendframework/zend-cache": "^2.6.1", @@ -3677,6 +3672,7 @@ "zendframework/zend-view": "^2.6.3" }, "suggest": { + "ext-intl": "Required for most features of Zend\\I18n; included in default builds of PHP", "zendframework/zend-cache": "Zend\\Cache component", "zendframework/zend-config": "Zend\\Config component", "zendframework/zend-eventmanager": "You should install this package to use the events in the translator", @@ -3689,8 +3685,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.10.x-dev", - "dev-develop": "2.11.x-dev" + "dev-master": "2.9.x-dev", + "dev-develop": "2.10.x-dev" }, "zf": { "component": "Zend\\I18n", @@ -3712,7 +3708,7 @@ "i18n", "zf" ], - "time": "2019-12-12T14:08:22+00:00" + "time": "2019-09-30T12:04:37+00:00" }, { "name": "zendframework/zend-inputfilter", @@ -4798,16 +4794,16 @@ }, { "name": "zendframework/zend-view", - "version": "2.11.4", + "version": "2.11.3", "source": { "type": "git", "url": "https://github.com/zendframework/zend-view.git", - "reference": "a8b1b2d9b52e191539be861a6529f8c8a0c06b9d" + "reference": "e766457bd6ce13c5354e443bb949511b6904d7f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-view/zipball/a8b1b2d9b52e191539be861a6529f8c8a0c06b9d", - "reference": "a8b1b2d9b52e191539be861a6529f8c8a0c06b9d", + "url": "https://api.github.com/repos/zendframework/zend-view/zipball/e766457bd6ce13c5354e443bb949511b6904d7f5", + "reference": "e766457bd6ce13c5354e443bb949511b6904d7f5", "shasum": "" }, "require": { @@ -4881,7 +4877,7 @@ "view", "zf" ], - "time": "2019-12-04T08:40:50+00:00" + "time": "2019-10-11T21:10:04+00:00" } ], "packages-dev": [ @@ -5284,16 +5280,16 @@ }, { "name": "codeception/phpunit-wrapper", - "version": "6.7.1", + "version": "6.7.0", "source": { "type": "git", "url": "https://github.com/Codeception/phpunit-wrapper.git", - "reference": "d3b611635b47a583dfaa1a9e98b98fa476d14025" + "reference": "93f59e028826464eac086052fa226e58967f6907" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/phpunit-wrapper/zipball/d3b611635b47a583dfaa1a9e98b98fa476d14025", - "reference": "d3b611635b47a583dfaa1a9e98b98fa476d14025", + "url": "https://api.github.com/repos/Codeception/phpunit-wrapper/zipball/93f59e028826464eac086052fa226e58967f6907", + "reference": "93f59e028826464eac086052fa226e58967f6907", "shasum": "" }, "require": { @@ -5326,7 +5322,7 @@ } ], "description": "PHPUnit classes used by Codeception", - "time": "2019-11-23T18:22:38+00:00" + "time": "2019-08-18T15:43:35+00:00" }, { "name": "codeception/stub", @@ -6166,16 +6162,16 @@ }, { "name": "doctrine/cache", - "version": "1.10.0", + "version": "1.9.1", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "382e7f4db9a12dc6c19431743a2b096041bcdd62" + "reference": "89a5c76c39c292f7798f964ab3c836c3f8192a55" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/382e7f4db9a12dc6c19431743a2b096041bcdd62", - "reference": "382e7f4db9a12dc6c19431743a2b096041bcdd62", + "url": "https://api.github.com/repos/doctrine/cache/zipball/89a5c76c39c292f7798f964ab3c836c3f8192a55", + "reference": "89a5c76c39c292f7798f964ab3c836c3f8192a55", "shasum": "" }, "require": { @@ -6242,9 +6238,10 @@ "memcached", "php", "redis", + "riak", "xcache" ], - "time": "2019-11-29T15:36:20+00:00" + "time": "2019-11-15T14:31:57+00:00" }, { "name": "doctrine/inflector", @@ -6623,16 +6620,16 @@ }, { "name": "fzaninotto/faker", - "version": "v1.9.1", + "version": "v1.9.0", "source": { "type": "git", "url": "https://github.com/fzaninotto/Faker.git", - "reference": "fc10d778e4b84d5bd315dad194661e091d307c6f" + "reference": "27a216cbe72327b2d6369fab721a5843be71e57d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/fc10d778e4b84d5bd315dad194661e091d307c6f", - "reference": "fc10d778e4b84d5bd315dad194661e091d307c6f", + "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/27a216cbe72327b2d6369fab721a5843be71e57d", + "reference": "27a216cbe72327b2d6369fab721a5843be71e57d", "shasum": "" }, "require": { @@ -6645,9 +6642,7 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "1.9-dev" - } + "branch-alias": [] }, "autoload": { "psr-4": { @@ -6669,7 +6664,7 @@ "faker", "fixtures" ], - "time": "2019-12-12T13:22:17+00:00" + "time": "2019-11-14T13:13:06+00:00" }, { "name": "grasmash/expander", @@ -7035,16 +7030,16 @@ }, { "name": "league/flysystem", - "version": "1.0.61", + "version": "1.0.57", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "4fb13c01784a6c9f165a351e996871488ca2d8c9" + "reference": "0e9db7f0b96b9f12dcf6f65bc34b72b1a30ea55a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/4fb13c01784a6c9f165a351e996871488ca2d8c9", - "reference": "4fb13c01784a6c9f165a351e996871488ca2d8c9", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/0e9db7f0b96b9f12dcf6f65bc34b72b1a30ea55a", + "reference": "0e9db7f0b96b9f12dcf6f65bc34b72b1a30ea55a", "shasum": "" }, "require": { @@ -7115,7 +7110,7 @@ "sftp", "storage" ], - "time": "2019-12-08T21:46:50+00:00" + "time": "2019-10-16T21:01:05+00:00" }, { "name": "lusitanian/oauth", @@ -7349,16 +7344,16 @@ }, { "name": "mustache/mustache", - "version": "v2.13.0", + "version": "v2.12.0", "source": { "type": "git", "url": "https://github.com/bobthecow/mustache.php.git", - "reference": "e95c5a008c23d3151d59ea72484d4f72049ab7f4" + "reference": "fe8fe72e9d580591854de404cc59a1b83ca4d19e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/mustache.php/zipball/e95c5a008c23d3151d59ea72484d4f72049ab7f4", - "reference": "e95c5a008c23d3151d59ea72484d4f72049ab7f4", + "url": "https://api.github.com/repos/bobthecow/mustache.php/zipball/fe8fe72e9d580591854de404cc59a1b83ca4d19e", + "reference": "fe8fe72e9d580591854de404cc59a1b83ca4d19e", "shasum": "" }, "require": { @@ -7391,20 +7386,20 @@ "mustache", "templating" ], - "time": "2019-11-23T21:40:31+00:00" + "time": "2017-07-11T12:54:05+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.9.4", + "version": "1.9.3", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "579bb7356d91f9456ccd505f24ca8b667966a0a7" + "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/579bb7356d91f9456ccd505f24ca8b667966a0a7", - "reference": "579bb7356d91f9456ccd505f24ca8b667966a0a7", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/007c053ae6f31bba39dfa19a7726f56e9763bbea", + "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea", "shasum": "" }, "require": { @@ -7439,7 +7434,7 @@ "object", "object graph" ], - "time": "2019-12-15T19:12:40+00:00" + "time": "2019-08-09T12:45:53+00:00" }, { "name": "nikic/php-parser", @@ -8012,34 +8007,33 @@ }, { "name": "phpoption/phpoption", - "version": "1.7.2", + "version": "1.5.2", "source": { "type": "git", "url": "https://github.com/schmittjoh/php-option.git", - "reference": "77f7c4d2e65413aff5b5a8cc8b3caf7a28d81959" + "reference": "2ba2586380f8d2b44ad1b9feb61c371020b27793" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/77f7c4d2e65413aff5b5a8cc8b3caf7a28d81959", - "reference": "77f7c4d2e65413aff5b5a8cc8b3caf7a28d81959", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/2ba2586380f8d2b44ad1b9feb61c371020b27793", + "reference": "2ba2586380f8d2b44ad1b9feb61c371020b27793", "shasum": "" }, "require": { - "php": "^5.5.9 || ^7.0" + "php": ">=5.3.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.3", - "phpunit/phpunit": "^4.8.35 || ^5.0 || ^6.0 || ^7.0" + "phpunit/phpunit": "^4.7|^5.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7-dev" + "dev-master": "1.5-dev" } }, "autoload": { - "psr-4": { - "PhpOption\\": "src/PhpOption/" + "psr-0": { + "PhpOption\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -8050,10 +8044,6 @@ { "name": "Johannes M. Schmitt", "email": "schmittjoh@gmail.com" - }, - { - "name": "Graham Campbell", - "email": "graham@alt-three.com" } ], "description": "Option Type for PHP", @@ -8063,7 +8053,7 @@ "php", "type" ], - "time": "2019-12-15T19:35:24+00:00" + "time": "2019-11-06T22:27:00+00:00" }, { "name": "phpspec/prophecy", @@ -9356,27 +9346,27 @@ }, { "name": "symfony/browser-kit", - "version": "v4.4.1", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "e19e465c055137938afd40cfddd687e7511bbbf0" + "reference": "b14fa08508afd152257d5dcc7adb5f278654d972" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/e19e465c055137938afd40cfddd687e7511bbbf0", - "reference": "e19e465c055137938afd40cfddd687e7511bbbf0", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/b14fa08508afd152257d5dcc7adb5f278654d972", + "reference": "b14fa08508afd152257d5dcc7adb5f278654d972", "shasum": "" }, "require": { "php": "^7.1.3", - "symfony/dom-crawler": "^3.4|^4.0|^5.0" + "symfony/dom-crawler": "~3.4|~4.0" }, "require-dev": { - "symfony/css-selector": "^3.4|^4.0|^5.0", - "symfony/http-client": "^4.3|^5.0", - "symfony/mime": "^4.3|^5.0", - "symfony/process": "^3.4|^4.0|^5.0" + "symfony/css-selector": "~3.4|~4.0", + "symfony/http-client": "^4.3", + "symfony/mime": "^4.3", + "symfony/process": "~3.4|~4.0" }, "suggest": { "symfony/process": "" @@ -9384,7 +9374,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.4-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -9411,36 +9401,36 @@ ], "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "time": "2019-10-28T20:30:34+00:00" + "time": "2019-10-28T17:07:32+00:00" }, { "name": "symfony/config", - "version": "v4.4.1", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "7aa5817f1b7a8ed377752b90fcc47dfb3c67b40c" + "reference": "8267214841c44d315a55242ea867684eb43c42ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/7aa5817f1b7a8ed377752b90fcc47dfb3c67b40c", - "reference": "7aa5817f1b7a8ed377752b90fcc47dfb3c67b40c", + "url": "https://api.github.com/repos/symfony/config/zipball/8267214841c44d315a55242ea867684eb43c42ce", + "reference": "8267214841c44d315a55242ea867684eb43c42ce", "shasum": "" }, "require": { "php": "^7.1.3", - "symfony/filesystem": "^3.4|^4.0|^5.0", + "symfony/filesystem": "~3.4|~4.0", "symfony/polyfill-ctype": "~1.8" }, "conflict": { "symfony/finder": "<3.4" }, "require-dev": { - "symfony/event-dispatcher": "^3.4|^4.0|^5.0", - "symfony/finder": "^3.4|^4.0|^5.0", - "symfony/messenger": "^4.1|^5.0", - "symfony/service-contracts": "^1.1|^2", - "symfony/yaml": "^3.4|^4.0|^5.0" + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~3.4|~4.0", + "symfony/finder": "~3.4|~4.0", + "symfony/messenger": "~4.1", + "symfony/yaml": "~3.4|~4.0" }, "suggest": { "symfony/yaml": "To use the yaml reference dumper" @@ -9448,7 +9438,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.4-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -9475,29 +9465,29 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2019-12-01T10:50:45+00:00" + "time": "2019-11-08T08:31:27+00:00" }, { "name": "symfony/dependency-injection", - "version": "v4.4.1", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "ad46a4def1325befab696b49c839dffea3fc92bd" + "reference": "80c6d9e19467dfbba14f830ed478eb592ce51b64" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/ad46a4def1325befab696b49c839dffea3fc92bd", - "reference": "ad46a4def1325befab696b49c839dffea3fc92bd", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/80c6d9e19467dfbba14f830ed478eb592ce51b64", + "reference": "80c6d9e19467dfbba14f830ed478eb592ce51b64", "shasum": "" }, "require": { "php": "^7.1.3", "psr/container": "^1.0", - "symfony/service-contracts": "^1.1.6|^2" + "symfony/service-contracts": "^1.1.6" }, "conflict": { - "symfony/config": "<4.3|>=5.0", + "symfony/config": "<4.3", "symfony/finder": "<3.4", "symfony/proxy-manager-bridge": "<3.4", "symfony/yaml": "<3.4" @@ -9508,8 +9498,8 @@ }, "require-dev": { "symfony/config": "^4.3", - "symfony/expression-language": "^3.4|^4.0|^5.0", - "symfony/yaml": "^3.4|^4.0|^5.0" + "symfony/expression-language": "~3.4|~4.0", + "symfony/yaml": "~3.4|~4.0" }, "suggest": { "symfony/config": "", @@ -9521,7 +9511,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.4-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -9548,20 +9538,20 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2019-12-01T10:19:36+00:00" + "time": "2019-11-08T16:22:27+00:00" }, { "name": "symfony/dom-crawler", - "version": "v4.4.1", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "36bbcab9369fc2f583220890efd43bf262d563fd" + "reference": "4b9efd5708c3a38593e19b6a33e40867f4f89d72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/36bbcab9369fc2f583220890efd43bf262d563fd", - "reference": "36bbcab9369fc2f583220890efd43bf262d563fd", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/4b9efd5708c3a38593e19b6a33e40867f4f89d72", + "reference": "4b9efd5708c3a38593e19b6a33e40867f4f89d72", "shasum": "" }, "require": { @@ -9574,7 +9564,7 @@ }, "require-dev": { "masterminds/html5": "^2.6", - "symfony/css-selector": "^3.4|^4.0|^5.0" + "symfony/css-selector": "~3.4|~4.0" }, "suggest": { "symfony/css-selector": "" @@ -9582,7 +9572,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.4-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -9609,7 +9599,7 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2019-10-29T11:38:30+00:00" + "time": "2019-10-28T17:07:32+00:00" }, { "name": "symfony/http-foundation", @@ -9668,16 +9658,16 @@ }, { "name": "symfony/options-resolver", - "version": "v4.4.1", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "2be23e63f33de16b49294ea6581f462932a77e2f" + "reference": "f46c7fc8e207bd8a2188f54f8738f232533765a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/2be23e63f33de16b49294ea6581f462932a77e2f", - "reference": "2be23e63f33de16b49294ea6581f462932a77e2f", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/f46c7fc8e207bd8a2188f54f8738f232533765a4", + "reference": "f46c7fc8e207bd8a2188f54f8738f232533765a4", "shasum": "" }, "require": { @@ -9686,7 +9676,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.4-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -9718,20 +9708,20 @@ "configuration", "options" ], - "time": "2019-10-28T21:57:16+00:00" + "time": "2019-10-28T20:59:01+00:00" }, { "name": "symfony/polyfill-php54", - "version": "v1.13.1", + "version": "v1.12.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php54.git", - "reference": "dd1618047426412036e98d159940d58a81fc392c" + "reference": "a043bcced870214922fbb4bf22679d431ec0296a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php54/zipball/dd1618047426412036e98d159940d58a81fc392c", - "reference": "dd1618047426412036e98d159940d58a81fc392c", + "url": "https://api.github.com/repos/symfony/polyfill-php54/zipball/a043bcced870214922fbb4bf22679d431ec0296a", + "reference": "a043bcced870214922fbb4bf22679d431ec0296a", "shasum": "" }, "require": { @@ -9740,7 +9730,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.13-dev" + "dev-master": "1.12-dev" } }, "autoload": { @@ -9776,20 +9766,20 @@ "portable", "shim" ], - "time": "2019-11-27T13:56:44+00:00" + "time": "2019-08-06T08:03:45+00:00" }, { "name": "symfony/polyfill-php55", - "version": "v1.13.1", + "version": "v1.12.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php55.git", - "reference": "b0d838f225725e2951af1aafc784d2e5ea7b656e" + "reference": "548bb39407e78e54f785b4e18c7e0d5d9e493265" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php55/zipball/b0d838f225725e2951af1aafc784d2e5ea7b656e", - "reference": "b0d838f225725e2951af1aafc784d2e5ea7b656e", + "url": "https://api.github.com/repos/symfony/polyfill-php55/zipball/548bb39407e78e54f785b4e18c7e0d5d9e493265", + "reference": "548bb39407e78e54f785b4e18c7e0d5d9e493265", "shasum": "" }, "require": { @@ -9799,7 +9789,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.13-dev" + "dev-master": "1.12-dev" } }, "autoload": { @@ -9832,20 +9822,20 @@ "portable", "shim" ], - "time": "2019-11-27T13:56:44+00:00" + "time": "2019-08-06T08:03:45+00:00" }, { "name": "symfony/polyfill-php70", - "version": "v1.13.1", + "version": "v1.12.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "af23c7bb26a73b850840823662dda371484926c4" + "reference": "54b4c428a0054e254223797d2713c31e08610831" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/af23c7bb26a73b850840823662dda371484926c4", - "reference": "af23c7bb26a73b850840823662dda371484926c4", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/54b4c428a0054e254223797d2713c31e08610831", + "reference": "54b4c428a0054e254223797d2713c31e08610831", "shasum": "" }, "require": { @@ -9855,7 +9845,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.13-dev" + "dev-master": "1.12-dev" } }, "autoload": { @@ -9891,20 +9881,20 @@ "portable", "shim" ], - "time": "2019-11-27T13:56:44+00:00" + "time": "2019-08-06T08:03:45+00:00" }, { "name": "symfony/polyfill-php72", - "version": "v1.13.1", + "version": "v1.12.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "66fea50f6cb37a35eea048d75a7d99a45b586038" + "reference": "04ce3335667451138df4307d6a9b61565560199e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/66fea50f6cb37a35eea048d75a7d99a45b586038", - "reference": "66fea50f6cb37a35eea048d75a7d99a45b586038", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/04ce3335667451138df4307d6a9b61565560199e", + "reference": "04ce3335667451138df4307d6a9b61565560199e", "shasum": "" }, "require": { @@ -9913,7 +9903,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.13-dev" + "dev-master": "1.12-dev" } }, "autoload": { @@ -9946,24 +9936,24 @@ "portable", "shim" ], - "time": "2019-11-27T13:56:44+00:00" + "time": "2019-08-06T08:03:45+00:00" }, { "name": "symfony/service-contracts", - "version": "v2.0.1", + "version": "v1.1.8", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "144c5e51266b281231e947b51223ba14acf1a749" + "reference": "ffc7f5692092df31515df2a5ecf3b7302b3ddacf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/144c5e51266b281231e947b51223ba14acf1a749", - "reference": "144c5e51266b281231e947b51223ba14acf1a749", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/ffc7f5692092df31515df2a5ecf3b7302b3ddacf", + "reference": "ffc7f5692092df31515df2a5ecf3b7302b3ddacf", "shasum": "" }, "require": { - "php": "^7.2.5", + "php": "^7.1.3", "psr/container": "^1.0" }, "suggest": { @@ -9972,7 +9962,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "1.1-dev" } }, "autoload": { @@ -10004,30 +9994,30 @@ "interoperability", "standards" ], - "time": "2019-11-18T17:27:11+00:00" + "time": "2019-10-14T12:27:06+00:00" }, { "name": "symfony/stopwatch", - "version": "v4.4.1", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "5745b514fc56ae1907c6b8ed74f94f90f64694e9" + "reference": "e96c259de6abcd0cead71f0bf4d730d53ee464d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/5745b514fc56ae1907c6b8ed74f94f90f64694e9", - "reference": "5745b514fc56ae1907c6b8ed74f94f90f64694e9", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/e96c259de6abcd0cead71f0bf4d730d53ee464d0", + "reference": "e96c259de6abcd0cead71f0bf4d730d53ee464d0", "shasum": "" }, "require": { "php": "^7.1.3", - "symfony/service-contracts": "^1.0|^2" + "symfony/service-contracts": "^1.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.4-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -10054,20 +10044,20 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2019-11-05T16:11:08+00:00" + "time": "2019-11-05T14:48:09+00:00" }, { "name": "symfony/yaml", - "version": "v4.4.1", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "76de473358fe802578a415d5bb43c296cf09d211" + "reference": "324cf4b19c345465fad14f3602050519e09e361d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/76de473358fe802578a415d5bb43c296cf09d211", - "reference": "76de473358fe802578a415d5bb43c296cf09d211", + "url": "https://api.github.com/repos/symfony/yaml/zipball/324cf4b19c345465fad14f3602050519e09e361d", + "reference": "324cf4b19c345465fad14f3602050519e09e361d", "shasum": "" }, "require": { @@ -10078,7 +10068,7 @@ "symfony/console": "<3.4" }, "require-dev": { - "symfony/console": "^3.4|^4.0|^5.0" + "symfony/console": "~3.4|~4.0" }, "suggest": { "symfony/console": "For validating YAML files using the lint command" @@ -10086,7 +10076,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.4-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -10113,7 +10103,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2019-11-12T14:51:11+00:00" + "time": "2019-10-30T12:58:49+00:00" }, { "name": "theseer/fdomdocument", @@ -10248,29 +10238,31 @@ }, { "name": "webmozart/assert", - "version": "1.6.0", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "573381c0a64f155a0d9a23f4b0c797194805b925" + "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/573381c0a64f155a0d9a23f4b0c797194805b925", - "reference": "573381c0a64f155a0d9a23f4b0c797194805b925", + "url": "https://api.github.com/repos/webmozart/assert/zipball/88e6d84706d09a236046d686bbea96f07b3a34f4", + "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4", "shasum": "" }, "require": { "php": "^5.3.3 || ^7.0", "symfony/polyfill-ctype": "^1.8" }, - "conflict": { - "vimeo/psalm": "<3.6.0" - }, "require-dev": { "phpunit/phpunit": "^4.8.36 || ^7.5.13" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, "autoload": { "psr-4": { "Webmozart\\Assert\\": "src/" @@ -10292,7 +10284,7 @@ "check", "validate" ], - "time": "2019-11-24T13:36:37+00:00" + "time": "2019-08-24T08:43:50+00:00" }, { "name": "weew/helpers-array", From 2be8374fe0262eccb232ff9614211c126d496a4b Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Tue, 17 Dec 2019 07:42:22 +0700 Subject: [PATCH 367/586] Refactor code --- .../Unit/Pricing/MsrpPriceCalculatorTest.php | 85 +++++++++---------- 1 file changed, 40 insertions(+), 45 deletions(-) diff --git a/app/code/Magento/Msrp/Test/Unit/Pricing/MsrpPriceCalculatorTest.php b/app/code/Magento/Msrp/Test/Unit/Pricing/MsrpPriceCalculatorTest.php index aac6852b7000c..24e10207ff14c 100644 --- a/app/code/Magento/Msrp/Test/Unit/Pricing/MsrpPriceCalculatorTest.php +++ b/app/code/Magento/Msrp/Test/Unit/Pricing/MsrpPriceCalculatorTest.php @@ -9,7 +9,7 @@ namespace Magento\Msrp\Test\Unit\Pricing; use Magento\Catalog\Model\Product; -use Magento\Catalog\Model\Product\Type as Type; +use Magento\Catalog\Model\Product\Type as ProductType; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use Magento\GroupedProduct\Model\Product\Type\Grouped as GroupedType; use Magento\Msrp\Pricing\MsrpPriceCalculator; @@ -19,6 +19,36 @@ class MsrpPriceCalculatorTest extends TestCase { + /** + * @var MsrpPriceCalculator + */ + private $pricing; + + /** + * @var MsrpGroupedCalculator|MockObject + */ + private $msrpGroupedCalculatorMock; + + /** + * Prepare environment to test + */ + protected function setUp() + { + $objectManager = new ObjectManager($this); + $this->msrpGroupedCalculatorMock = $this->createMock(MsrpGroupedCalculator::class); + $this->pricing = $objectManager->getObject( + MsrpPriceCalculator::class, + [ + 'msrpPriceCalculators' => [ + [ + 'productType' => GroupedType::TYPE_CODE, + 'priceCalculator' => $this->msrpGroupedCalculatorMock + ] + ] + ] + ); + } + /** * Test getMrspPriceValue() with the data provider below * @@ -27,17 +57,12 @@ class MsrpPriceCalculatorTest extends TestCase * @param float $expected * @dataProvider getMsrpPriceValueDataProvider */ - public function testGetMsrpPriceValue($msrpPriceCalculators, $productMock, $expected) + public function testGetMsrpPriceValue($msrpPriceCalculatorPrice, $productMock, $expected) { - $objectManager = new ObjectManager($this); - $pricing = $objectManager->getObject( - MsrpPriceCalculator::class, - [ - 'msrpPriceCalculators' => $msrpPriceCalculators - ] - ); + $this->msrpGroupedCalculatorMock->expects($this->any()) + ->method('getMsrpPriceValue')->willReturn($msrpPriceCalculatorPrice); - $this->assertEquals($expected, $pricing->getMsrpPriceValue($productMock)); + $this->assertEquals($expected, $this->pricing->getMsrpPriceValue($productMock)); } /** @@ -48,49 +73,19 @@ public function testGetMsrpPriceValue($msrpPriceCalculators, $productMock, $expe public function getMsrpPriceValueDataProvider() { return [ - 'Get Mrsp Price with grouped product and price calculator is also grouped product type' => [ - [ - [ - 'productType' => GroupedType::TYPE_CODE, - 'priceCalculator' => $this->createPriceCalculatorMock( - MsrpGroupedCalculator::class, - 23.50 - ) - ] - ], + 'Get Mrsp Price with product and msrp calculator and the same product type' => [ + 23.50, $this->createProductMock(GroupedType::TYPE_CODE, 0), 23.50 ], - 'Get Mrsp Price with simple product and price calculator is grouped product type' => [ - [ - [ - 'productType' => GroupedType::TYPE_CODE, - 'priceCalculator' => $this->createPriceCalculatorMock( - MsrpGroupedCalculator::class, - 0 - ) - ] - ], - $this->createProductMock(Type::TYPE_SIMPLE, 24.88), + 'Get Mrsp Price with product and msrp calculator and the different product type' => [ + 24.88, + $this->createProductMock(ProductType::TYPE_SIMPLE, 24.88), 24.88 ] ]; } - /** - * Create Price Calculator Mock - * - * @param string $class - * @param float $msrpPriceValue - * @return MockObject - */ - private function createPriceCalculatorMock($class, $msrpPriceValue) - { - $priceCalculatorMock = $this->createMock($class); - $priceCalculatorMock->expects($this->any())->method('getMsrpPriceValue')->willReturn($msrpPriceValue); - return $priceCalculatorMock; - } - /** * Create Product Mock * From 9b6d9d0436d5dd03960e08de1748eec76dfe07c8 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Tue, 17 Dec 2019 10:14:33 +0700 Subject: [PATCH 368/586] [Directory] Cover action directory/json/countryRegion by Integration Test --- .../Adminhtml/Json/CountryRegionTest.php | 50 +++++++++++++++++++ .../_files/example_region_in_country.php | 37 ++++++++++++++ .../example_region_in_country_rollback.php | 26 ++++++++++ 3 files changed, 113 insertions(+) create mode 100644 dev/tests/integration/testsuite/Magento/Directory/Controller/Adminhtml/Json/CountryRegionTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Directory/_files/example_region_in_country.php create mode 100644 dev/tests/integration/testsuite/Magento/Directory/_files/example_region_in_country_rollback.php diff --git a/dev/tests/integration/testsuite/Magento/Directory/Controller/Adminhtml/Json/CountryRegionTest.php b/dev/tests/integration/testsuite/Magento/Directory/Controller/Adminhtml/Json/CountryRegionTest.php new file mode 100644 index 0000000000000..8d3b12aa34f1e --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Directory/Controller/Adminhtml/Json/CountryRegionTest.php @@ -0,0 +1,50 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Directory\Controller\Adminhtml\Json; + +use Magento\Framework\App\Request\Http as HttpRequest; +use Magento\TestFramework\TestCase\AbstractBackendController; + +/** + * @magentoAppArea adminhtml + */ +class CountryRegionTest extends AbstractBackendController +{ + /** + * Test Execute without param + */ + public function testExecuteWithNoCountryParam() + { + $this->getRequest()->setMethod(HttpRequest::METHOD_POST); + $this->getRequest()->setPostValue([]); + $this->dispatch('backend/directory/json/countryRegion'); + + $actual = $this->getResponse()->getBody(); + + $this->assertEquals('[]', $actual); + } + + /** + * Test Execute with region in the fixture + * + * @magentoDataFixture Magento/Directory/_files/example_region_in_country.php + */ + public function testExecute() + { + $this->getRequest()->setMethod(HttpRequest::METHOD_POST); + $this->getRequest()->setPostValue([ + 'parent' => 'WW' + ]); + $this->dispatch('backend/directory/json/countryRegion'); + + $actual = $this->getResponse()->getBody(); + + $this->assertContains('Example Region 1', $actual); + $this->assertContains('Example Region 2', $actual); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Directory/_files/example_region_in_country.php b/dev/tests/integration/testsuite/Magento/Directory/_files/example_region_in_country.php new file mode 100644 index 0000000000000..680c0079a795c --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Directory/_files/example_region_in_country.php @@ -0,0 +1,37 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +use Magento\TestFramework\Helper\Bootstrap; +use Magento\Directory\Model\Region as RegionModel; +use Magento\Directory\Model\ResourceModel\Region as RegionResource; + +$objectManager = Bootstrap::getObjectManager(); + +$regionData = [ + [ + 'country_id' => 'WW', + 'code' => 'ER1', + 'default_name' => 'Example Region 1' + ], + [ + 'country_id' => 'WW', + 'code' => 'ER2', + 'default_name' => 'Example Region 2' + ] +]; + +/** @var RegionModel $region */ +$region = $objectManager->create(RegionModel::class); +/** @var RegionResource $regionResource */ +$regionResource = $objectManager->get(RegionResource::class); + +foreach ($regionData as $data) { + /** @var RegionModel $region */ + $region = $objectManager->create(RegionModel::class); + $regionResource->save($region); +} diff --git a/dev/tests/integration/testsuite/Magento/Directory/_files/example_region_in_country_rollback.php b/dev/tests/integration/testsuite/Magento/Directory/_files/example_region_in_country_rollback.php new file mode 100644 index 0000000000000..4f78873aa380f --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Directory/_files/example_region_in_country_rollback.php @@ -0,0 +1,26 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +use Magento\TestFramework\Helper\Bootstrap; +use Magento\Directory\Model\Region as RegionModel; +use Magento\Directory\Model\ResourceModel\Region as RegionResource; +use Magento\Directory\Model\ResourceModel\Region\Collection as RegionResourceCollection; + +$objectManager = Bootstrap::getObjectManager(); +$regionCode = ['ER1', 'ER2']; + +/** @var RegionResource $regionResource */ +$regionResource = $objectManager->get(RegionResource::class); + +$regionCollection = $objectManager->create(RegionResourceCollection::class) + ->addFieldToFilter('code', ['in' => $regionCode]); + +/** @var RegionModel $region */ +foreach ($regionCollection as $region) { + $regionResource->delete($region); +} From e3ce8c9f5bf263b12614af349a38be5e7168020b Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Tue, 17 Dec 2019 11:20:18 +0700 Subject: [PATCH 369/586] [Directory] Cover action directory/json/countryRegion by Integration Test --- .../Magento/Directory/_files/example_region_in_country.php | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/tests/integration/testsuite/Magento/Directory/_files/example_region_in_country.php b/dev/tests/integration/testsuite/Magento/Directory/_files/example_region_in_country.php index 680c0079a795c..ba33b09a1f948 100644 --- a/dev/tests/integration/testsuite/Magento/Directory/_files/example_region_in_country.php +++ b/dev/tests/integration/testsuite/Magento/Directory/_files/example_region_in_country.php @@ -33,5 +33,6 @@ foreach ($regionData as $data) { /** @var RegionModel $region */ $region = $objectManager->create(RegionModel::class); + $region->setData($data); $regionResource->save($region); } From cab418bb0c0fa69c1872dcd98a24278c0ce5bd3b Mon Sep 17 00:00:00 2001 From: Viktor Petryk <victor.petryk@transoftgroup.com> Date: Tue, 17 Dec 2019 10:17:48 +0200 Subject: [PATCH 370/586] MC-29444: Extra Values of UPS and USPS are in dropdown list Cart Price Rule - Condition - Shipping Method --- app/code/Magento/Ups/Model/Carrier.php | 2 +- app/code/Magento/Ups/Test/Unit/Model/CarrierTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Ups/Model/Carrier.php b/app/code/Magento/Ups/Model/Carrier.php index 28e194e65bd60..05f12f8999212 100644 --- a/app/code/Magento/Ups/Model/Carrier.php +++ b/app/code/Magento/Ups/Model/Carrier.php @@ -1901,7 +1901,7 @@ public function getContainerTypes(\Magento\Framework\DataObject $params = null) return ['00' => __('Customer Packaging')] + $containerTypes; } elseif ($countryShipper == self::USA_COUNTRY_ID && $countryRecipient == self::PUERTORICO_COUNTRY_ID - && ($method == '03' || $method == '02' || $method == '01') + && in_array($method, ['01', '02', '03']) ) { // Container types should be the same as for domestic $params->setCountryRecipient(self::USA_COUNTRY_ID); diff --git a/app/code/Magento/Ups/Test/Unit/Model/CarrierTest.php b/app/code/Magento/Ups/Test/Unit/Model/CarrierTest.php index 7e587f249e67a..34dd4f0fe142b 100644 --- a/app/code/Magento/Ups/Test/Unit/Model/CarrierTest.php +++ b/app/code/Magento/Ups/Test/Unit/Model/CarrierTest.php @@ -423,13 +423,13 @@ public function testGetAllowedMethods( 'carriers/ups/allowed_methods', ScopeInterface::SCOPE_STORE, null, - $allowedMethods + $allowedMethods, ], [ 'carriers/ups/type', ScopeInterface::SCOPE_STORE, null, - $carrierType + $carrierType, ], [ 'carriers/ups/origin_shipment', From 8451e0f6d4754d29c9458ab21ec60aafa674f8b9 Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <51681547+engcom-Golf@users.noreply.github.com> Date: Tue, 17 Dec 2019 10:33:14 +0200 Subject: [PATCH 371/586] Fix static test --- .../Magento/Framework/View/Element/Template/File/Resolver.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/internal/Magento/Framework/View/Element/Template/File/Resolver.php b/lib/internal/Magento/Framework/View/Element/Template/File/Resolver.php index b13caa55d3174..cd7ba1dfaecda 100644 --- a/lib/internal/Magento/Framework/View/Element/Template/File/Resolver.php +++ b/lib/internal/Magento/Framework/View/Element/Template/File/Resolver.php @@ -9,9 +9,7 @@ use Magento\Framework\Serialize\Serializer\Json; /** - * Class Resolver - * - * @package Magento\Framework\View\Element\Template\File + * Resolver, returns template file name by template. */ class Resolver { From 2e7f74bc940752ff4faa682300cdac667b872695 Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <51681547+engcom-Golf@users.noreply.github.com> Date: Tue, 17 Dec 2019 10:34:01 +0200 Subject: [PATCH 372/586] fix static test --- lib/internal/Magento/Framework/View/Element/RendererList.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/View/Element/RendererList.php b/lib/internal/Magento/Framework/View/Element/RendererList.php index 96707c74dd253..eba78867d7725 100644 --- a/lib/internal/Magento/Framework/View/Element/RendererList.php +++ b/lib/internal/Magento/Framework/View/Element/RendererList.php @@ -6,7 +6,7 @@ namespace Magento\Framework\View\Element; /** - * Renderer List + * Get renderer by code * * @api */ From 78dc52b87d6a4517799bc0f359b8016e0d40b21a Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <51681547+engcom-Golf@users.noreply.github.com> Date: Tue, 17 Dec 2019 10:34:58 +0200 Subject: [PATCH 373/586] fix static test fix --- .../Framework/View/Element/ExceptionHandlerBlockFactory.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/internal/Magento/Framework/View/Element/ExceptionHandlerBlockFactory.php b/lib/internal/Magento/Framework/View/Element/ExceptionHandlerBlockFactory.php index b1c74777fb102..b13ac2531ebc8 100644 --- a/lib/internal/Magento/Framework/View/Element/ExceptionHandlerBlockFactory.php +++ b/lib/internal/Magento/Framework/View/Element/ExceptionHandlerBlockFactory.php @@ -6,9 +6,7 @@ namespace Magento\Framework\View\Element; /** - * Class ExceptionHandlerBlockFactory - * - * @package Magento\Framework\View\Element + * Factory for BlockInterface */ class ExceptionHandlerBlockFactory { From 62a7ba8afa52c5457651fa02fe3f02c0b163768b Mon Sep 17 00:00:00 2001 From: Roman Zhupanyn <roma.dj.elf@gmail.com> Date: Tue, 17 Dec 2019 10:48:00 +0200 Subject: [PATCH 374/586] MC-24902: Storefront: Verify Category structure on storefront --- .../Magento/Catalog/Block/BreadcrumbsTest.php | 72 +++ .../Catalog/Block/Category/TopMenuTest.php | 429 +++++++++++++++++- .../categories_no_products_with_two_tree.php | 63 +++ ...ies_no_products_with_two_tree_rollback.php | 8 + .../category_in_second_root_category.php | 21 + ...egory_in_second_root_category_rollback.php | 8 + .../store_with_second_root_category.php | 72 +++ ...ore_with_second_root_category_rollback.php | 39 ++ 8 files changed, 710 insertions(+), 2 deletions(-) create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/Block/BreadcrumbsTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/categories_no_products_with_two_tree.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/categories_no_products_with_two_tree_rollback.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/category_in_second_root_category.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/category_in_second_root_category_rollback.php create mode 100644 dev/tests/integration/testsuite/Magento/Store/_files/store_with_second_root_category.php create mode 100644 dev/tests/integration/testsuite/Magento/Store/_files/store_with_second_root_category_rollback.php diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/BreadcrumbsTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/BreadcrumbsTest.php new file mode 100644 index 0000000000000..050ac6d0f55f9 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/BreadcrumbsTest.php @@ -0,0 +1,72 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Block; + +use Magento\Catalog\Api\CategoryRepositoryInterface; +use Magento\Framework\ObjectManagerInterface; +use Magento\Framework\Registry; +use Magento\Framework\View\LayoutInterface; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\Theme\Block\Html\Breadcrumbs as ThemeBreadcrumbs; +use PHPUnit\Framework\TestCase; + +/** + * Checks the behavior of breadcrumbs on the category view page. + * + * @magentoAppArea frontend + */ +class BreadcrumbsTest extends TestCase +{ + /** @var ObjectManagerInterface */ + private $objectManager; + + /** @var LayoutInterface */ + private $layout; + + /** @var CategoryRepositoryInterface */ + private $categoryRepository; + + /** @var Registry */ + private $registry; + + /** + * @inheritdoc + */ + protected function setUp() + { + parent::setUp(); + + $this->objectManager = Bootstrap::getObjectManager(); + $this->categoryRepository = $this->objectManager->create(CategoryRepositoryInterface::class); + $this->registry = $this->objectManager->get(Registry::class); + $this->layout = $this->objectManager->get(LayoutInterface::class); + } + + /** + * Checks the order of categories in breadcrumbs. + * + * @magentoDataFixture Magento/Catalog/_files/category_tree.php + * @return void + */ + public function testCategoriesSequence(): void + { + $category = $this->categoryRepository->get(402); + $this->registry->register('current_category', $category); + $themeBreadcrumbs = $this->layout->createBlock(ThemeBreadcrumbs::class, 'breadcrumbs'); + $this->layout->createBlock(Breadcrumbs::class); + $html = $themeBreadcrumbs->toHtml(); + + $actualCategories = preg_replace('/\s+/', '', strip_tags($html)); + $expectedCategories = __('Home') . 'Category1' . 'Category1.1' . 'Category1.1.1'; + self::assertEquals( + $expectedCategories, + $actualCategories, + 'The order of categories in breadcrumbs is not correct!' + ); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Category/TopMenuTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Category/TopMenuTest.php index 0dc8016c3ef8b..00ac61272bddc 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Block/Category/TopMenuTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Category/TopMenuTest.php @@ -8,9 +8,15 @@ namespace Magento\Catalog\Block\Category; use Magento\Catalog\Api\CategoryRepositoryInterface; +use Magento\Catalog\Api\Data\CategoryInterface; +use Magento\Catalog\Model\Category; use Magento\Catalog\Model\CategoryFactory; +use Magento\Catalog\Model\ResourceModel\Category\Collection; +use Magento\Catalog\Model\ResourceModel\Category\CollectionFactory; +use Magento\Framework\Data\Tree\Node; use Magento\Framework\ObjectManagerInterface; use Magento\Framework\View\LayoutInterface; +use Magento\Store\Model\StoreManagerInterface; use Magento\TestFramework\Helper\Bootstrap; use Magento\Theme\Block\Html\Topmenu; use PHPUnit\Framework\TestCase; @@ -26,6 +32,9 @@ class TopMenuTest extends TestCase /** @var ObjectManagerInterface */ private $objectManager; + /** @var LayoutInterface */ + private $layout; + /** @var Topmenu */ private $block; @@ -35,6 +44,9 @@ class TopMenuTest extends TestCase /** @var CategoryRepositoryInterface */ private $categoryRepository; + /** @var StoreManagerInterface */ + private $storeManager; + /** * @inheritdoc */ @@ -43,9 +55,11 @@ protected function setUp() parent::setUp(); $this->objectManager = Bootstrap::getObjectManager(); - $this->categoryFactory = $this->objectManager->create(CategoryFactory::class); + $this->categoryFactory = $this->objectManager->get(CategoryFactory::class); $this->categoryRepository = $this->objectManager->create(CategoryRepositoryInterface::class); - $this->block = $this->objectManager->get(LayoutInterface::class)->createBlock(Topmenu::class); + $this->layout = $this->objectManager->get(LayoutInterface::class); + $this->block = $this->layout->createBlock(Topmenu::class); + $this->storeManager = $this->objectManager->get(StoreManagerInterface::class); } /** @@ -100,4 +114,415 @@ public function invisibilityDataProvider(): array ], ]; } + + /** + * Check category visibility in the category tree in the menu + * + * @dataProvider categoriesVisibleInTreeProvider + * @magentoDataFixture Magento/Catalog/_files/category_tree.php + * @magentoAppIsolation enabled + * @param array $categories + * @param array $expectedCategories + * @return void + */ + public function testCategoriesInTreeVisible(array $categories, array $expectedCategories): void + { + $this->updateCategories($categories); + $output = $this->block->getHtml('level-top', 'submenu', 0); + foreach ($expectedCategories as $data) { + $this->assertContains( + $data['name'], + $output, + 'Category ' . $data['name'] . ' should appear in the menu!' + ); + } + } + + /** + * @return array + */ + public function categoriesVisibleInTreeProvider(): array + { + return [ + 'add_in_tree_visible' => [ + 'categories' => [ + [ + 'is_new_category' => true, + 'parent_name' => 'Category 1.1.1', + Category::KEY_NAME => 'Sub Category 1', + Category::KEY_IS_ACTIVE => true, + ], + ], + 'expectedCategories' => [ + [ + 'name' => 'Sub Category 1', + ], + ], + ], + 'child_visible_in_tree' => [ + 'categories' => [ + [ + 'is_new_category' => true, + 'parent_name' => 'Category 1.1', + Category::KEY_NAME => 'Sub Category 1', + Category::KEY_IS_ACTIVE => true, + ], + [ + 'is_new_category' => false, + 'category_name' => 'Category 1.1', + Category::KEY_IS_ACTIVE => false, + ], + ], + 'expectedCategories' => [ + [ + 'name' => 'Sub Category 1', + ], + [ + 'name' => 'Category 1.1.1', + ], + ], + ], + ]; + } + + /** + * Check invisibility of a category in the category tree in the menu + * + * @dataProvider categoriesInTreeInvisibleProvider + * @magentoDataFixture Magento/Catalog/_files/category_tree.php + * @magentoAppIsolation enabled + * @param array $categories + * @param array $expectedCategories + * @return void + */ + public function testCategoriesInTreeInvisible(array $categories, array $expectedCategories): void + { + $this->updateCategories($categories); + $output = $this->block->getHtml('level-top', 'submenu', 0); + foreach ($expectedCategories as $data) { + $this->assertNotContains( + $data['name'], + $output, + 'Category ' . $data['name'] . ' should not appear in the menu!' + ); + } + } + + /** + * @return array + */ + public function categoriesInTreeInvisibleProvider(): array + { + return [ + 'add_in_tree_category_disable' => [ + 'categories' => [ + [ + 'is_new_category' => true, + 'parent_name' => 'Category 1.1.1', + Category::KEY_NAME => 'Sub Category 1', + Category::KEY_IS_ACTIVE => false, + Category::KEY_INCLUDE_IN_MENU => true, + ], + ], + 'expectedCategories' => [ + [ + 'name' => 'Sub Category 1', + ], + ], + ], + 'add_in_tree_include_in_menu_disable' => [ + 'categories' => [ + [ + 'is_new_category' => true, + 'parent_name' => 'Category 1.1.1', + Category::KEY_NAME => 'Sub Category 1', + Category::KEY_IS_ACTIVE => true, + Category::KEY_INCLUDE_IN_MENU => false, + ], + ], + 'expectedCategories' => [ + [ + 'name' => 'Sub Category 1', + ], + ], + ], + 'child_invisible_in_tree' => [ + 'categories' => [ + [ + 'is_new_category' => true, + 'parent_name' => 'Default Category', + Category::KEY_NAME => 'Sub Category 1', + Category::KEY_IS_ACTIVE => true, + ], + [ + 'is_new_category' => false, + 'category_name' => 'Category 1', + Category::KEY_IS_ACTIVE => false, + ], + ], + 'expectedCategories' => [ + [ + 'name' => 'Category 1.1', + ], + [ + 'name' => 'Category 1.1.1', + ], + ], + ], + ]; + } + + /** + * Check menu structure after moving category or changing position + * + * @dataProvider menuStructureProvider + * @magentoDataFixture Magento/Catalog/_files/categories_no_products_with_two_tree.php + * @magentoAppIsolation enabled + * @param array $moveCategory + * @param array $expectedMenuTree + * @return void + */ + public function testMenuStructure(array $moveCategory, array $expectedMenuTree): void + { + /** @var Category $category */ + $category = $this->categoryRepository->get($this->getCategoryIdByName($moveCategory['name'])); + $category->move( + $this->getCategoryIdByName($moveCategory['parent_name']), + $this->getCategoryIdByName($moveCategory['after_category_name']) + ); + + $this->block->getHtml('level-top', 'submenu', 0); + + $menuTree = $this->getMenuTree($this->block->getMenu()); + $topLevelKeys = array_flip(array_keys($expectedMenuTree)); + $actualMenuTree = array_intersect_key($menuTree, $topLevelKeys); + $this->assertEquals( + $expectedMenuTree, + $actualMenuTree, + 'Error in displaying the menu tree after moving a category!' + ); + } + + /** + * @return array + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + */ + public function menuStructureProvider(): array + { + return [ + 'move_to_default' => [ + 'moveCategory' => [ + 'name' => 'Category 1.1.1', + 'parent_name' => 'Default Category', + 'after_category_name' => '', + ], + 'expectedMenuTree' => [ + 'Category 1.1.1' => ['position' => '1'], + 'Category 1' => [ + 'position' => '2', + 'Category 1.1' => ['position' => '2-1'], + ], + ], + ], + 'move_to_not_default' => [ + 'moveCategory' => [ + 'name' => 'Movable Position 3', + 'parent_name' => 'Movable Position 2', + 'after_category_name' => '', + ], + 'expectedMenuTree' => [ + 'Movable Position 2' => [ + 'position' => '5', + 'Movable Position 3' => ['position' => '5-1'], + ], + 'Category 12' => ['position' => '6'], + ], + ], + 'move_tree_to_default' => [ + 'moveCategory' => [ + 'name' => 'Category 1.1', + 'parent_name' => 'Default Category', + 'after_category_name' => '', + ], + 'expectedMenuTree' => [ + 'Category 1.1' => [ + 'position' => '1', + 'Category 1.1.1' => ['position' => '1-1'], + ], + 'Category 1' => ['position' => '2'], + ], + ], + 'move_tree_to_other_tree' => [ + 'moveCategory' => [ + 'name' => 'Category 2.2', + 'parent_name' => 'Category 1.1', + 'after_category_name' => 'Category 1.1.1', + ], + 'expectedMenuTree' => [ + 'Category 1' => [ + 'position' => '1', + 'Category 1.1' => [ + 'position' => '1-1', + 'Category 1.1.1' => ['position' => '1-1-1'], + 'Category 2.2' => [ + 'position' => '1-1-2', + 'Category 2.2.1' => ['position' => '1-1-2-1'], + ], + ], + ], + 'Category 2' => [ + 'position' => '2', + 'Category 2.1' => ['position' => '2-1'], + ], + ], + ], + 'position_of_categories_in_default' => [ + 'moveCategory' => [ + 'name' => 'Category 12', + 'parent_name' => 'Default Category', + 'after_category_name' => 'Movable', + ], + 'expectedMenuTree' => [ + 'Movable' => ['position' => '3'], + 'Category 12' => ['position' => '4'], + 'Movable Position 1' => ['position' => '5'], + 'Movable Position 2' => ['position' => '6'], + 'Movable Position 3' => ['position' => '7'], + ], + ], + 'position_of_categories_in_tree' => [ + 'moveCategory' => [ + 'name' => 'Movable', + 'parent_name' => 'Category 2', + 'after_category_name' => 'Category 2.1', + ], + 'expectedMenuTree' => [ + 'Category 2' => [ + 'position' => '2', + 'Category 2.1' => ['position' => '2-1'], + 'Movable' => ['position' => '2-2'], + 'Category 2.2' => [ + 'position' => '2-3', + 'Category 2.2.1' => ['position' => '2-3-1'], + ], + ], + 'Movable Position 1' => ['position' => '3'], + ], + ], + ]; + } + + /** + * Test the display of category in menu on different websites + * + * @dataProvider multipleWebsitesCategoryDisplayProvider + * @magentoDataFixture Magento/Catalog/_files/category.php + * @magentoDataFixture Magento/Catalog/_files/category_in_second_root_category.php + * @param string $storeCode + * @param string $expectedCategory + * @param string $notExpectedCategory + * @return void + */ + public function testMultipleWebsitesCategoryDisplay( + string $storeCode, + string $expectedCategory, + string $notExpectedCategory + ): void { + $this->storeManager->setCurrentStore($storeCode); + $output = $this->block->getHtml('level-top', 'submenu', 0); + $this->assertContains( + $expectedCategory, + $output, + 'Category "' . $expectedCategory . '" should appear in the menu!' + ); + $this->assertNotContains( + $notExpectedCategory, + $output, + 'Category "' . $notExpectedCategory . '" should not appear in the menu!' + ); + } + + /** + * Provide test data to verify the display of category in menu on different websites. + * + * @return array + */ + public function multipleWebsitesCategoryDisplayProvider(): array + { + return [ + 'first_website' => [ + 'storeCode' => 'default', + 'expectedCategory' => '>Category 1<', + 'notExpectedCategory' => '>Root2 Category 1<', + ], + 'second_website' => [ + 'storeCode' => 'test_store_1', + 'expectedCategory' => '>Root2 Category 1<', + 'notExpectedCategory' => '>Category 1<', + ], + ]; + } + + /** + * Update existing categories or create new ones + * + * @param array $categories + * @return void + */ + private function updateCategories(array $categories): void + { + foreach ($categories as $categoryData) { + if (!$categoryData['is_new_category']) { + $category = $this->categoryRepository->get($this->getCategoryIdByName($categoryData['category_name'])); + unset($categoryData['category_name']); + } else { + $categoryData[Category::KEY_PARENT_ID] = $this->getCategoryIdByName($categoryData['parent_name']); + unset($categoryData['parent_name']); + $category = $this->categoryFactory->create(); + } + unset($categoryData['is_new_category']); + $category->addData($categoryData); + $this->categoryRepository->save($category); + } + } + + /** + * Get an array from the menu tree with category identifiers and their position + * + * @param Node $node + * @return array + */ + private function getMenuTree(Node $node): array + { + $nodes = []; + if (!is_null($node->getId())) { + $nodes['position'] = str_replace('nav-', '', $node->getData('position_class')); + } + $childrenNodes = $node->getChildren()->getNodes(); + /** @var Node $childNode */ + foreach ($childrenNodes as $childNode) { + $name = $childNode->getName(); + $nodes[$name] = $this->getMenuTree($childNode); + } + + return $nodes; + } + + /** + * @param string $name + * @return string|null + */ + private function getCategoryIdByName(string $name): ?string + { + $categoryCollectionFactory = $this->objectManager->get(CollectionFactory::class); + /** @var Collection $categoryCollection */ + $categoryCollection = $categoryCollectionFactory->create(); + /** @var $category Category */ + $category = $categoryCollection + ->addAttributeToFilter(CategoryInterface::KEY_NAME, $name) + ->setPageSize(1) + ->getFirstItem(); + + return $category->getId(); + } } diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/categories_no_products_with_two_tree.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/categories_no_products_with_two_tree.php new file mode 100644 index 0000000000000..3f9191244e78f --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/categories_no_products_with_two_tree.php @@ -0,0 +1,63 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\Data\CategoryInterface; +use Magento\Catalog\Model\Category; +use Magento\Catalog\Model\CategoryFactory; +use Magento\Catalog\Model\ResourceModel\Category as CategoryResource; +use Magento\Catalog\Model\ResourceModel\Category\Collection; +use Magento\Catalog\Model\ResourceModel\Category\CollectionFactory; + +require __DIR__ . '/categories_no_products.php'; + +$categoryFactory = $objectManager->get(CategoryFactory::class); +$categoryResource = $objectManager->create(CategoryResource::class); +$categoryCollectionFactory = $objectManager->get(CollectionFactory::class); +/** @var Collection $categoryCollection */ +$categoryCollection = $categoryCollectionFactory->create(); + +/** @var $category2 Category */ +$category2 = $categoryCollection + ->addAttributeToFilter(CategoryInterface::KEY_NAME, 'Category 2') + ->setPageSize(1) + ->getFirstItem(); + +/** @var $category21 Category */ +$category21 = $categoryFactory->create(); +$category21->isObjectNew(true); +$category21->setName('Category 2.1') + ->setParentId($category2->getId()) + ->setPath($category2->getPath()) + ->setAvailableSortBy('name') + ->setDefaultSortBy('name') + ->setIsActive(true) + ->setPosition(1); +$categoryResource->save($category21); + +/** @var $category22 Category */ +$category22 = $categoryFactory->create(); +$category22->isObjectNew(true); +$category22->setName('Category 2.2') + ->setParentId($category2->getId()) + ->setPath($category2->getPath()) + ->setAvailableSortBy('name') + ->setDefaultSortBy('name') + ->setIsActive(true) + ->setPosition(2); +$categoryResource->save($category22); + +/** @var $category221 Category */ +$category221 = $categoryFactory->create(); +$category221->isObjectNew(true); +$category221->setName('Category 2.2.1') + ->setParentId($category22->getId()) + ->setPath($category22->getPath()) + ->setAvailableSortBy('name') + ->setDefaultSortBy('name') + ->setIsActive(true) + ->setPosition(1); +$categoryResource->save($category221); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/categories_no_products_with_two_tree_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/categories_no_products_with_two_tree_rollback.php new file mode 100644 index 0000000000000..f7fcb3a5b4928 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/categories_no_products_with_two_tree_rollback.php @@ -0,0 +1,8 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +require __DIR__ . '/categories_no_products_rollback.php'; diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/category_in_second_root_category.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/category_in_second_root_category.php new file mode 100644 index 0000000000000..aa9c970b7b426 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/category_in_second_root_category.php @@ -0,0 +1,21 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Model\Category; + +require __DIR__ . '/../../Store/_files/store_with_second_root_category.php'; + +/** @var Category $category */ +$category = $categoryFactory->create(); +$category->isObjectNew(true); +$category->setName('Root2 Category 1') + ->setParentId($rootCategory->getId()) + ->setAvailableSortBy(['position', 'name']) + ->setDefaultSortBy('name') + ->setIsActive(true) + ->setPosition(1); +$categoryRepository->save($category); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/category_in_second_root_category_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/category_in_second_root_category_rollback.php new file mode 100644 index 0000000000000..9c74b2fad7edd --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/category_in_second_root_category_rollback.php @@ -0,0 +1,8 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +require __DIR__ . '/../../Store/_files/store_with_second_root_category_rollback.php'; diff --git a/dev/tests/integration/testsuite/Magento/Store/_files/store_with_second_root_category.php b/dev/tests/integration/testsuite/Magento/Store/_files/store_with_second_root_category.php new file mode 100644 index 0000000000000..e43346ece194b --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Store/_files/store_with_second_root_category.php @@ -0,0 +1,72 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +require __DIR__ . '/website.php'; + +use Magento\Catalog\Api\CategoryRepositoryInterface; +use Magento\Catalog\Api\Data\CategoryInterface; +use Magento\Catalog\Model\Category; +use Magento\Catalog\Model\CategoryFactory; +use Magento\Catalog\Model\ResourceModel\Category\Collection; +use Magento\Catalog\Model\ResourceModel\Category\CollectionFactory; +use Magento\Store\Model\Group; +use Magento\Store\Model\GroupFactory; +use Magento\Store\Model\ResourceModel\Group as GroupResource; +use Magento\Store\Model\ResourceModel\Store as StoreResource; +use Magento\Store\Model\Store; +use Magento\Store\Model\StoreFactory; +use Magento\Store\Model\StoreManagerInterface; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); +$categoryCollectionFactory = $objectManager->get(CollectionFactory::class); + +/** @var Collection $categoryCollection */ +$categoryCollection = $categoryCollectionFactory->create(); +$rootCategory = $categoryCollection + ->addAttributeToFilter(CategoryInterface::KEY_NAME, 'Second Root Category') + ->setPageSize(1) + ->getFirstItem(); + +$categoryFactory = $objectManager->get(CategoryFactory::class); +$categoryRepository = $objectManager->create(CategoryRepositoryInterface::class); + +/** @var Category $rootCategory */ +$rootCategory = $categoryFactory->create(); +$rootCategory->isObjectNew(true); +$rootCategory->setName('Second Root Category') + ->setParentId(Category::TREE_ROOT_ID) + ->setIsActive(true) + ->setPosition(2); +$rootCategory = $categoryRepository->save($rootCategory); + +$groupFactory = $objectManager->get(GroupFactory::class); +/** @var GroupResource $groupResource */ +$groupResource = $objectManager->create(GroupResource::class); +/** @var Group $storeGroup */ +$storeGroup = $groupFactory->create(); +$storeGroup->setCode('test_store_group_1') + ->setName('Test Store Group 1') + ->setRootCategoryId($rootCategory->getId()) + ->setWebsite($website); +$groupResource->save($storeGroup); + +$storeFactory = $objectManager->get(StoreFactory::class); +/** @var StoreResource $storeResource */ +$storeResource = $objectManager->create(StoreResource::class); +/** @var Store $store */ +$store = $storeFactory->create(); +$store->setCode('test_store_1') + ->setName('Test Store 1') + ->setWebsiteId($website->getId()) + ->setGroup($storeGroup) + ->setSortOrder(10) + ->setIsActive(1); +$storeResource->save($store); + +/* Refresh stores memory cache */ +$objectManager->get(StoreManagerInterface::class)->reinitStores(); diff --git a/dev/tests/integration/testsuite/Magento/Store/_files/store_with_second_root_category_rollback.php b/dev/tests/integration/testsuite/Magento/Store/_files/store_with_second_root_category_rollback.php new file mode 100644 index 0000000000000..eae8b8f64d3e9 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Store/_files/store_with_second_root_category_rollback.php @@ -0,0 +1,39 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +require __DIR__ . '/website_rollback.php'; + +use Magento\Catalog\Api\CategoryRepositoryInterface; +use Magento\Catalog\Api\Data\CategoryInterface; +use Magento\Catalog\Model\CategoryRepository; +use Magento\Catalog\Model\ResourceModel\Category\Collection; +use Magento\Catalog\Model\ResourceModel\Category\CollectionFactory; +use Magento\Framework\Registry; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); +/** @var CategoryRepository $categoryRepository */ +$categoryRepository = $objectManager->create(CategoryRepositoryInterface::class); +$categoryCollectionFactory = $objectManager->get(CollectionFactory::class); + +/** @var Registry $registry */ +$registry = $objectManager->get(Registry::class); +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); + +/** @var Collection $categoryCollection */ +$categoryCollection = $categoryCollectionFactory->create(); +$category = $categoryCollection + ->addAttributeToFilter(CategoryInterface::KEY_NAME, 'Second Root Category') + ->setPageSize(1) + ->getFirstItem(); +if ($category->getId()) { + $categoryRepository->delete($category); +} + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); From dd7479d20dd1afbfaa470c9012c0dea61be00fff Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Tue, 17 Dec 2019 17:11:21 +0700 Subject: [PATCH 375/586] [Search] Cover SynonymActions Column by Unit Test --- .../Listing/Column/SynonymActionsTest.php | 122 ++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 app/code/Magento/Search/Test/Unit/Ui/Component/Listing/Column/SynonymActionsTest.php diff --git a/app/code/Magento/Search/Test/Unit/Ui/Component/Listing/Column/SynonymActionsTest.php b/app/code/Magento/Search/Test/Unit/Ui/Component/Listing/Column/SynonymActionsTest.php new file mode 100644 index 0000000000000..7ba1eab0437f0 --- /dev/null +++ b/app/code/Magento/Search/Test/Unit/Ui/Component/Listing/Column/SynonymActionsTest.php @@ -0,0 +1,122 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Search\Test\Unit\Ui\Component\Listing\Column; + +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Framework\UrlInterface; +use Magento\Search\Ui\Component\Listing\Column\SynonymActions; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +class SynonymActionsTest extends TestCase +{ + /** + * @var SynonymActions + */ + private $synonymActions; + + /** + * @var UrlInterface|MockObject + */ + private $urlBuilderMock; + + /** + * Setup environment to test + */ + protected function setup() + { + $this->urlBuilderMock = $this->createMock(UrlInterface::class); + + $objectManager = new ObjectManager($this); + + $this->synonymActions = $objectManager->getObject( + SynonymActions::class, + [ + 'urlBuilder' => $this->urlBuilderMock, + 'data' => [ + 'name' => 'actions' + ] + ] + ); + } + + /** + * Test prepareDataSource() with data source has no item + */ + public function testPrepareDataSourceWithNoItem() + { + $dataSource = [ + 'data' => [] + ]; + $expected = [ + 'data' => [] + ]; + /** + * Assert Result + */ + $this->assertEquals($expected, $this->synonymActions->prepareDataSource($dataSource)); + } + + /** + * Test prepareDataSource() with data source has items + */ + public function testPrepareDataSourceWithItems() + { + $dataSource = [ + 'data' => [ + 'items' => [ + [ + 'group_id' => 1 + ] + ] + ] + ]; + $expected = [ + 'data' => [ + 'items' => [ + [ + 'group_id' => 1, + 'actions' => [ + 'delete' => [ + 'href' => 'http://localhost/magento2/admin/search/synonyms/delete/group_id/1', + 'label' => (string)__('Delete'), + 'confirm' => [ + 'title' => (string)__('Delete'), + 'message' => (string)__( + 'Are you sure you want to delete synonym group with id: %1?', + 1 + ) + ], + '__disableTmpl' => true + ], + 'edit' => [ + 'href' => 'http://localhost/magento2/admin/search/synonyms/edit/group_id/1', + 'label' => (string)__('View/Edit'), + '__disableTmpl' => true + ] + ] + ] + ] + ] + ]; + + $this->urlBuilderMock->expects($this->at(0))->method('getUrl') + ->with(SynonymActions::SYNONYM_URL_PATH_DELETE, ['group_id' => 1]) + ->willReturn('http://localhost/magento2/admin/search/synonyms/delete/group_id/1'); + + $this->urlBuilderMock->expects($this->at(1))->method('getUrl') + ->with(SynonymActions::SYNONYM_URL_PATH_EDIT, ['group_id' => 1]) + ->willReturn('http://localhost/magento2/admin/search/synonyms/edit/group_id/1'); + + /** + * Assert Result + */ + $this->assertEquals($expected, $this->synonymActions->prepareDataSource($dataSource)); + } +} From b0d2f6535389c43e17d71380febd55bd12567887 Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <nazarn96@gmail.com> Date: Tue, 17 Dec 2019 14:33:41 +0200 Subject: [PATCH 376/586] Cover changes with jasmine test --- .../base/js/lib/ko/bind/color-picker.test.js | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/lib/ko/bind/color-picker.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/lib/ko/bind/color-picker.test.js index 9b756a2f2a49a..afbd7e8e94c2d 100644 --- a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/lib/ko/bind/color-picker.test.js +++ b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/lib/ko/bind/color-picker.test.js @@ -85,5 +85,28 @@ define([ expect($.fn.init).toHaveBeenCalledWith($input, undefined); }); + + it('Verify config value is empty when reset colorpicker intput', function () { + var value = { + configStuffInHere: true, + value: jasmine.createSpy().and.returnValue(undefined) + }, + valueAccessor = jasmine.createSpy().and.returnValue(value), + viewModel = { + disabled: jasmine.createSpy().and.returnValue(false) + }; + + $.fn.spectrum = jasmine.createSpy(); + $input = jasmine.createSpy(); + + ko.bindingHandlers.colorPicker.update($input, valueAccessor, null, viewModel); + expect($.fn.spectrum).toHaveBeenCalledTimes(1); + expect(valueAccessor().value).toHaveBeenCalledTimes(4); + + value.value = jasmine.createSpy().and.returnValue(''); + ko.bindingHandlers.colorPicker.update($input, valueAccessor, null, viewModel); + expect($.fn.spectrum).toHaveBeenCalledTimes(3); + expect(valueAccessor().value).toHaveBeenCalledTimes(5); + }); }); }); From 1c3ee947270eb0465aef2710f3c216795747bbaf Mon Sep 17 00:00:00 2001 From: Mastiuhin Olexandr <mastiuhin.olexandr@transoftgroup.com> Date: Tue, 17 Dec 2019 14:44:30 +0200 Subject: [PATCH 377/586] MC-29523: Category image saves to pub/media/catalog/tmp/category --- .../Category/Attribute/Backend/Image.php | 68 +++++----- .../Magento/Catalog/Model/ImageUploader.php | 6 +- .../Category/Attribute/Backend/ImageTest.php | 120 +++++++++++++++--- app/code/Magento/Catalog/etc/di.xml | 5 + 4 files changed, 142 insertions(+), 57 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Image.php b/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Image.php index 4880214e5c6a6..865160da14a6f 100644 --- a/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Image.php +++ b/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Image.php @@ -5,8 +5,12 @@ */ namespace Magento\Catalog\Model\Category\Attribute\Backend; +use Magento\Catalog\Model\ImageUploader; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\App\ObjectManager; use Magento\Framework\File\Uploader; +use Magento\Store\Api\Data\StoreInterface; +use Magento\Store\Model\StoreManagerInterface; /** * Catalog category image attribute backend model @@ -45,7 +49,7 @@ class Image extends \Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend protected $_logger; /** - * @var \Magento\Catalog\Model\ImageUploader + * @var ImageUploader */ private $imageUploader; @@ -54,19 +58,32 @@ class Image extends \Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend */ private $additionalData = '_additional_data_'; + /** + * @var StoreManagerInterface + */ + private $storeManager; + /** * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Filesystem $filesystem * @param \Magento\MediaStorage\Model\File\UploaderFactory $fileUploaderFactory + * @param StoreManagerInterface $storeManager + * @param ImageUploader $imageUploader */ public function __construct( \Psr\Log\LoggerInterface $logger, \Magento\Framework\Filesystem $filesystem, - \Magento\MediaStorage\Model\File\UploaderFactory $fileUploaderFactory + \Magento\MediaStorage\Model\File\UploaderFactory $fileUploaderFactory, + StoreManagerInterface $storeManager = null, + ImageUploader $imageUploader = null ) { $this->_filesystem = $filesystem; $this->_fileUploaderFactory = $fileUploaderFactory; $this->_logger = $logger; + $this->storeManager = $storeManager ?? + ObjectManager::getInstance()->get(StoreManagerInterface::class); + $this->imageUploader = $imageUploader ?? + ObjectManager::getInstance()->get(ImageUploader::class); } /** @@ -94,13 +111,13 @@ private function getUploadedImageName($value) */ private function checkUniqueImageName(string $imageName): string { - $imageUploader = $this->getImageUploader(); $mediaDirectory = $this->_filesystem->getDirectoryWrite(DirectoryList::MEDIA); $imageAbsolutePath = $mediaDirectory->getAbsolutePath( - $imageUploader->getBasePath() . DIRECTORY_SEPARATOR . $imageName + $this->imageUploader->getBasePath() . DIRECTORY_SEPARATOR . $imageName ); - $imageName = Uploader::getNewFilename($imageAbsolutePath); + // phpcs:ignore Magento2.Functions.DiscouragedFunction + $imageName = call_user_func([Uploader::class, 'getNewFilename'], $imageAbsolutePath); return $imageName; } @@ -119,7 +136,18 @@ public function beforeSave($object) $attributeName = $this->getAttribute()->getName(); $value = $object->getData($attributeName); - if ($this->fileResidesOutsideCategoryDir($value)) { + if ($this->isTmpFileAvailable($value) && $imageName = $this->getUploadedImageName($value)) { + try { + /** @var StoreInterface $store */ + $store = $this->storeManager->getStore(); + $baseMediaDir = $store->getBaseMediaDir(); + $newImgRelativePath = $this->imageUploader->moveFileFromTmp($imageName, true); + $value[0]['url'] = '/' . $baseMediaDir . '/' . $newImgRelativePath; + $value[0]['name'] = $value[0]['url']; + } catch (\Exception $e) { + $this->_logger->critical($e); + } + } elseif ($this->fileResidesOutsideCategoryDir($value)) { // use relative path for image attribute so we know it's outside of category dir when we fetch it // phpcs:ignore Magento2.Functions.DiscouragedFunction $value[0]['url'] = parse_url($value[0]['url'], PHP_URL_PATH); @@ -139,23 +167,6 @@ public function beforeSave($object) return parent::beforeSave($object); } - /** - * Get Instance of Category Image Uploader. - * - * @return \Magento\Catalog\Model\ImageUploader - * - * @deprecated 101.0.0 - */ - private function getImageUploader() - { - if ($this->imageUploader === null) { - $this->imageUploader = \Magento\Framework\App\ObjectManager::getInstance() - ->get(\Magento\Catalog\CategoryImageUpload::class); - } - - return $this->imageUploader; - } - /** * Check if temporary file is available for new image upload. * @@ -194,19 +205,10 @@ private function fileResidesOutsideCategoryDir($value) * * @param \Magento\Framework\DataObject $object * @return \Magento\Catalog\Model\Category\Attribute\Backend\Image + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function afterSave($object) { - $value = $object->getData($this->additionalData . $this->getAttribute()->getName()); - - if ($this->isTmpFileAvailable($value) && $imageName = $this->getUploadedImageName($value)) { - try { - $this->getImageUploader()->moveFileFromTmp($imageName); - } catch (\Exception $e) { - $this->_logger->critical($e); - } - } - return $this; } } diff --git a/app/code/Magento/Catalog/Model/ImageUploader.php b/app/code/Magento/Catalog/Model/ImageUploader.php index 825823276261f..0c3e008fa8bb5 100644 --- a/app/code/Magento/Catalog/Model/ImageUploader.php +++ b/app/code/Magento/Catalog/Model/ImageUploader.php @@ -191,12 +191,12 @@ public function getFilePath($path, $imageName) * Checking file for moving and move it * * @param string $imageName - * + * @param bool $returnRelativePath * @return string * * @throws \Magento\Framework\Exception\LocalizedException */ - public function moveFileFromTmp($imageName) + public function moveFileFromTmp($imageName, $returnRelativePath = false) { $baseTmpPath = $this->getBaseTmpPath(); $basePath = $this->getBasePath(); @@ -226,7 +226,7 @@ public function moveFileFromTmp($imageName) ); } - return $imageName; + return $returnRelativePath ? $baseImagePath : $imageName; } /** diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Category/Attribute/Backend/ImageTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Category/Attribute/Backend/ImageTest.php index a76ae5244076f..f8a89f9d9fd90 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Category/Attribute/Backend/ImageTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Category/Attribute/Backend/ImageTest.php @@ -3,10 +3,14 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + namespace Magento\Catalog\Test\Unit\Model\Category\Attribute\Backend; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Exception\FileSystemException; use Magento\Framework\Filesystem\Directory\WriteInterface; +use Magento\Store\Model\Store; +use Magento\Store\Model\StoreManagerInterface; /** * Test for Magento\Catalog\Model\Category\Attribute\Backend\Image class. @@ -39,6 +43,16 @@ class ImageTest extends \PHPUnit\Framework\TestCase */ private $filesystem; + /** + * @var StoreManagerInterface|\PHPUnit_Framework_MockObject_MockObject; + */ + private $storeManagerInterfaceMock; + + /** + * @var Store|\PHPUnit_Framework_MockObject_MockObject + */ + private $storeMock; + /** * @inheritdoc */ @@ -56,10 +70,6 @@ protected function setUp() ['getName'] ); - $this->attribute->expects($this->once()) - ->method('getName') - ->will($this->returnValue('test_attribute')); - $this->logger = $this->getMockForAbstractClass( \Psr\Log\LoggerInterface::class, [], @@ -75,6 +85,14 @@ protected function setUp() ['moveFileFromTmp', 'getBasePath'] ); + $this->storeManagerInterfaceMock = $this->getMockBuilder( + StoreManagerInterface::class + )->disableOriginalConstructor()->getMock(); + + $this->storeMock = $this->getMockBuilder( + Store::class + )->disableOriginalConstructor()->getMock(); + $this->filesystem = $this->getMockBuilder(\Magento\Framework\Filesystem::class)->disableOriginalConstructor() ->getMock(); } @@ -97,6 +115,10 @@ public function deletedValueDataProvider() */ public function testBeforeSaveValueDeletion($value) { + $this->attribute->expects($this->once()) + ->method('getName') + ->will($this->returnValue('test_attribute')); + $model = $this->objectManager->getObject(\Magento\Catalog\Model\Category\Attribute\Backend\Image::class); $model->setAttribute($this->attribute); @@ -132,6 +154,10 @@ public function invalidValueDataProvider() */ public function testBeforeSaveValueInvalid($value) { + $this->attribute->expects($this->once()) + ->method('getName') + ->will($this->returnValue('test_attribute')); + $model = $this->objectManager->getObject(\Magento\Catalog\Model\Category\Attribute\Backend\Image::class); $model->setAttribute($this->attribute); @@ -147,7 +173,11 @@ public function testBeforeSaveValueInvalid($value) */ public function testBeforeSaveAttributeFileName() { - $model = $this->setUpModelForAfterSave(); + $this->attribute->expects($this->once()) + ->method('getName') + ->will($this->returnValue('test_attribute')); + + $model = $this->setUpModelForTests(); $mediaDirectoryMock = $this->createMock(WriteInterface::class); $this->filesystem->expects($this->once()) ->method('getDirectoryWrite') @@ -177,7 +207,11 @@ public function testBeforeSaveAttributeFileName() */ public function testBeforeSaveAttributeFileNameOutsideOfCategoryDir() { - $model = $this->setUpModelForAfterSave(); + $this->attribute->expects($this->once()) + ->method('getName') + ->will($this->returnValue('test_attribute')); + + $model = $this->setUpModelForTests(); $model->setAttribute($this->attribute); $imagePath = '/pub/media/wysiwyg/test123.jpg'; $this->filesystem @@ -211,7 +245,19 @@ public function testBeforeSaveAttributeFileNameOutsideOfCategoryDir() */ public function testBeforeSaveTemporaryAttribute() { - $model = $this->setUpModelForAfterSave(); + $this->attribute->expects($this->once()) + ->method('getName') + ->will($this->returnValue('test_attribute')); + + $this->storeManagerInterfaceMock->expects($this->once()) + ->method('getStore') + ->willReturn($this->storeMock); + + $this->storeMock->expects($this->once()) + ->method('getBaseMediaDir') + ->willReturn('pub/media'); + + $model = $this->setUpModelForTests(); $model->setAttribute($this->attribute); $mediaDirectoryMock = $this->createMock(WriteInterface::class); @@ -220,10 +266,16 @@ public function testBeforeSaveTemporaryAttribute() ->with(DirectoryList::MEDIA) ->willReturn($mediaDirectoryMock); + $this->imageUploader->expects($this->any())->method('moveFileFromTmp')->willReturn('test123.jpg'); + $object = new \Magento\Framework\DataObject( [ 'test_attribute' => [ - ['name' => 'test123.jpg', 'tmp_name' => 'abc123', 'url' => 'http://www.example.com/test123.jpg'], + [ + 'name' => 'test123.jpg', + 'tmp_name' => 'abc123', + 'url' => 'http://www.example.com/pub/media/temp/test123.jpg' + ], ], ] ); @@ -232,7 +284,7 @@ public function testBeforeSaveTemporaryAttribute() $this->assertEquals( [ - ['name' => 'test123.jpg', 'tmp_name' => 'abc123', 'url' => 'http://www.example.com/test123.jpg'], + ['name' => '/pub/media/test123.jpg', 'tmp_name' => 'abc123', 'url' => '/pub/media/test123.jpg'], ], $object->getData('_additional_data_test_attribute') ); @@ -257,7 +309,7 @@ public function testBeforeSaveAttributeStringValue() /** * @return \Magento\Catalog\Model\Category\Attribute\Backend\Image */ - private function setUpModelForAfterSave() + private function setUpModelForTests() { $objectManagerMock = $this->createPartialMock(\Magento\Framework\App\ObjectManager::class, ['get']); @@ -268,7 +320,7 @@ private function setUpModelForAfterSave() ->will( $this->returnCallback( function ($class, $params = []) use ($imageUploaderMock) { - if ($class == \Magento\Catalog\CategoryImageUpload::class) { + if ($class == "\Magento\Catalog\CategoryImageUpload") { return $imageUploaderMock; } @@ -283,6 +335,7 @@ function ($class, $params = []) use ($imageUploaderMock) { 'objectManager' => $objectManagerMock, 'logger' => $this->logger, 'filesystem' => $this->filesystem, + 'storeManager' => $this->storeManagerInterfaceMock ] ); $this->objectManager->setBackwardCompatibleProperty($model, 'imageUploader', $this->imageUploader); @@ -307,12 +360,13 @@ public function attributeValueDataProvider() * @dataProvider attributeValueDataProvider * * @param array $value + * @throws FileSystemException */ - public function testAfterSaveWithAdditionalData($value) + public function testBeforeSaveWithAdditionalData($value) { - $model = $this->setUpModelForAfterSave(); + $model = $this->setUpModelForTests(); - $this->imageUploader->expects($this->once()) + $this->imageUploader->expects($this->never()) ->method('moveFileFromTmp') ->with($this->equalTo('test1234.jpg')); @@ -323,17 +377,18 @@ public function testAfterSaveWithAdditionalData($value) ] ); - $model->afterSave($object); + $model->beforeSave($object); } /** * @dataProvider attributeValueDataProvider * * @param array $value + * @throws FileSystemException */ - public function testAfterSaveWithoutAdditionalData($value) + public function testBeforeSaveWithoutAdditionalData($value) { - $model = $this->setUpModelForAfterSave(); + $model = $this->setUpModelForTests(); $this->imageUploader->expects($this->never()) ->method('moveFileFromTmp'); @@ -344,15 +399,38 @@ public function testAfterSaveWithoutAdditionalData($value) ] ); - $model->afterSave($object); + $model->beforeSave($object); } /** * Test afterSaveWithExceptions. */ - public function testAfterSaveWithExceptions() + public function testBeforeSaveWithExceptions() { - $model = $this->setUpModelForAfterSave(); + $model = $this->setUpModelForTests(); + + $this->storeManagerInterfaceMock->expects($this->once()) + ->method('getStore') + ->willReturn($this->storeMock); + + $this->storeMock->expects($this->once()) + ->method('getBaseMediaDir') + ->willReturn('pub/media'); + + $this->attribute->expects($this->once()) + ->method('getName') + ->will($this->returnValue('_additional_data_test_attribute')); + + $mediaDirectoryMock = $this->createMock(WriteInterface::class); + $this->filesystem->expects($this->any()) + ->method('getDirectoryWrite') + ->with(DirectoryList::MEDIA) + ->willReturn($mediaDirectoryMock); + $this->imageUploader->expects($this->any())->method('getBasePath')->willReturn('base/path'); + $mediaDirectoryMock->expects($this->any()) + ->method('getAbsolutePath') + ->with('base/path/test1234.jpg') + ->willReturn('absolute/path/base/path/test1234.jpg'); $exception = new \Exception(); @@ -370,6 +448,6 @@ public function testAfterSaveWithExceptions() ] ); - $model->afterSave($object); + $model->beforeSave($object); } } diff --git a/app/code/Magento/Catalog/etc/di.xml b/app/code/Magento/Catalog/etc/di.xml index af7b9af2d8b7e..eda6dbd2d9d6f 100644 --- a/app/code/Magento/Catalog/etc/di.xml +++ b/app/code/Magento/Catalog/etc/di.xml @@ -238,6 +238,11 @@ <argument name="imageUploader" xsi:type="object">Magento\Catalog\CategoryImageUpload</argument> </arguments> </type> + <type name="Magento\Catalog\Model\Category\Attribute\Backend\Image"> + <arguments> + <argument name="imageUploader" xsi:type="object">Magento\Catalog\CategoryImageUpload</argument> + </arguments> + </type> <type name="Magento\Catalog\Model\Session"> <arguments> <argument name="storage" xsi:type="object">Magento\Catalog\Model\Session\Storage</argument> From d6ffc1ee760748a926c521b177668ff5d36dc9f6 Mon Sep 17 00:00:00 2001 From: Yurii Sapiha <yurasapiga93@gmail.com> Date: Tue, 17 Dec 2019 15:17:32 +0200 Subject: [PATCH 378/586] MC-25243: Storefront: Simple product with custom attribute per multiple websites/storeviews, countries/states --- .../View/Attribute/AbstractAttributeTest.php | 233 ++++++++++++++++ .../View/Attribute/DateAttributeTest.php | 64 +++++ .../View/Attribute/DropdownAttributeTest.php | 95 +++++++ .../Attribute/MultiSelectAttributeTest.php | 103 +++++++ .../View/Attribute/PriceAttributeTest.php | 74 +++++ .../View/Attribute/TextAreaAttributeTest.php | 60 +++++ .../View/Attribute/TextAttributeTest.php | 95 +++++++ .../View/Attribute/YesNoAttributeTest.php | 50 ++++ .../_files/dropdown_attribute_with_html.php | 69 +++++ .../dropdown_attribute_with_html_rollback.php | 27 ++ .../multiselect_attribute_with_html.php | 68 +++++ ...ltiselect_attribute_with_html_rollback.php | 27 ++ .../Attribute/TextSwatchAttributeTest.php | 63 +++++ .../Attribute/VisualSwatchAttributeTest.php | 63 +++++ .../FixedProductTaxAttributeTest.php | 252 ++++++++++++++++++ .../Form/Modifier/Eav/FixedAttributeTest.php | 2 +- .../Weee/_files/fixed_product_attribute.php | 2 + 17 files changed, 1346 insertions(+), 1 deletion(-) create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/AbstractAttributeTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/DateAttributeTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/DropdownAttributeTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/MultiSelectAttributeTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/PriceAttributeTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/TextAreaAttributeTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/TextAttributeTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/YesNoAttributeTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/dropdown_attribute_with_html.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/dropdown_attribute_with_html_rollback.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/multiselect_attribute_with_html.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/multiselect_attribute_with_html_rollback.php create mode 100644 dev/tests/integration/testsuite/Magento/Swatches/Block/Product/View/Attribute/TextSwatchAttributeTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Swatches/Block/Product/View/Attribute/VisualSwatchAttributeTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Weee/Block/Product/View/Attribute/FixedProductTaxAttributeTest.php diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/AbstractAttributeTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/AbstractAttributeTest.php new file mode 100644 index 0000000000000..399abea6a0760 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/AbstractAttributeTest.php @@ -0,0 +1,233 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Block\Product\View\Attribute; + +use Magento\Catalog\Api\Data\ProductAttributeInterface; +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Catalog\Api\ProductAttributeRepositoryInterface; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Block\Product\View\Attributes; +use Magento\Catalog\Helper\Output; +use Magento\Framework\ObjectManagerInterface; +use Magento\Framework\Registry; +use Magento\Framework\View\LayoutInterface; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; + +/** + * Class consist of base logic for custom attributes view tests + */ +abstract class AbstractAttributeTest extends TestCase +{ + /** @var ObjectManagerInterface */ + protected $objectManager; + + /** @var LayoutInterface */ + private $layout; + + /** @var ProductRepositoryInterface */ + private $productRepository; + + /** @var ProductAttributeRepositoryInterface */ + private $attributeRepository; + + /** @var Registry */ + private $registry; + + /** @var Attributes */ + private $block; + + /** @var ProductAttributeInterface */ + private $attribute; + + /** @var Output */ + private $outputHelper; + + /** + * @inheritdoc + */ + protected function setUp() + { + parent::setUp(); + + $this->objectManager = Bootstrap::getObjectManager(); + $this->layout = $this->objectManager->get(LayoutInterface::class); + $this->productRepository = $this->objectManager->create(ProductRepositoryInterface::class); + $this->attributeRepository = $this->objectManager->create(ProductAttributeRepositoryInterface::class); + $this->registry = $this->objectManager->get(Registry::class); + $this->block = $this->layout->createBlock(Attributes::class); + $this->outputHelper = $this->objectManager->create(Output::class); + } + + /** + * Process custom attribute view + * + * @param string $sku + * @param string $attributeValue + * @param string $expectedAttributeValue + * @return void + */ + protected function processAttributeView( + string $sku, + string $attributeValue, + string $expectedAttributeValue + ): void { + $this->updateAttribute(['is_visible_on_front' => true]); + $product = $this->updateProduct($sku, $attributeValue); + $this->registerProduct($product); + $data = $this->block->getAdditionalData(); + $this->assertEquals($this->prepareExpectedData($expectedAttributeValue), $data); + } + + /** + * Process custom attribute with default value view when new value set + * + * @param string $sku + * @param string $attributeValue + * @param string $expectedAttributeValue + * @return void + */ + protected function processNonDefaultAttributeValueView( + string $sku, + string $attributeValue, + string $expectedAttributeValue + ): void { + $this->updateAttribute(['is_visible_on_front' => true, 'default_value' => $this->getDefaultAttributeValue()]); + $product = $this->updateProduct($sku, $attributeValue); + $this->registerProduct($product); + $data = $this->block->getAdditionalData(); + $this->assertEquals($this->prepareExpectedData($expectedAttributeValue), $data); + } + + /** + * Procces custom attribute view with default value + * + * @param string $sku + * @param string $expectedAttributeValue + * @return void + */ + protected function processDefaultValueAttributeView(string $sku, string $expectedAttributeValue): void + { + $this->updateAttribute(['is_visible_on_front' => true, 'default_value' => $this->getDefaultAttributeValue()]); + $product = $this->productRepository->save($this->productRepository->get($sku)); + $this->registerProduct($product); + $data = $this->block->getAdditionalData(); + $this->assertEquals($this->prepareExpectedData($expectedAttributeValue), $data); + } + + /** + * Procces attribute value view with html tags + * + * @param string $sku + * @param bool $allowHtmlTags + * @param string $attributeValue + * @param string $expectedAttributeValue + * @return void + */ + protected function processAttributeHtmlOutput( + string $sku, + bool $allowHtmlTags, + string $attributeValue, + string $expectedAttributeValue + ): void { + $this->updateAttribute(['is_visible_on_front' => true, 'is_html_allowed_on_front' => $allowHtmlTags]); + $product = $this->updateProduct($sku, $attributeValue); + $this->registerProduct($product); + $data = $this->block->getAdditionalData(); + $dataItem = $data[$this->getAttributeCode()] ?? null; + $this->assertNotNull($dataItem); + $output = $this->outputHelper->productAttribute($product, $dataItem['value'], $dataItem['code']); + $this->assertEquals($expectedAttributeValue, $output); + } + + /** + * Get attribute + * + * @return ProductAttributeInterface + */ + protected function getAttribute(): ProductAttributeInterface + { + if ($this->attribute === null) { + $this->attribute = $this->attributeRepository->get($this->getAttributeCode()); + } + + return $this->attribute; + } + + /** + * Prepare expected data + * + * @param string $expectedValue + * @return array + */ + private function prepareExpectedData(string $expectedValue): array + { + return [ + $this->getAttributeCode() => [ + 'label' => $this->getAttribute()->getStoreLabel(), + 'value' => $expectedValue, + 'code' => $this->getAttributeCode(), + ], + ]; + } + + /** + * Update product + * + * @param string $productSku + * @param string $attributeValue + * @return ProductInterface + */ + private function updateProduct(string $productSku, string $attributeValue): ProductInterface + { + $product = $this->productRepository->get($productSku); + $product->addData([$this->getAttributeCode() => $attributeValue]); + + return $this->productRepository->save($product); + } + + /** + * Register product + * + * @param ProductInterface $product + * @return void + */ + private function registerProduct(ProductInterface $product): void + { + $this->registry->unregister('product'); + $this->registry->register('product', $product); + } + + /** + * Update attribute + * + * @param array $data + * @return void + */ + private function updateAttribute(array $data): void + { + $attribute = $this->getAttribute(); + $attribute->addData($data); + + $this->attributeRepository->save($attribute); + } + + /** + * Get attribute code for current test + * + * @return string + */ + abstract protected function getAttributeCode(): string; + + /** + * Get default value for current attribute + * + * @return string + */ + abstract protected function getDefaultAttributeValue(): string; +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/DateAttributeTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/DateAttributeTest.php new file mode 100644 index 0000000000000..ec63fdc4806cf --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/DateAttributeTest.php @@ -0,0 +1,64 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Block\Product\View\Attribute; + +/** + * Class checks date attribute displaying on frontend + * + * @magentoDbIsolation disabled + * @magentoDataFixture Magento/Catalog/_files/product_date_attribute.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + */ +class DateAttributeTest extends AbstractAttributeTest +{ + /** + * @magentoConfigFixture default_store general/locale/timezone UTC + * @return void + */ + public function testAttributeView(): void + { + $attributeValue = $this->getAttribute()->getBackend()->formatDate('12/20/19'); + $this->processAttributeView('simple2', $attributeValue, 'Dec 20, 2019'); + } + + /** + * @magentoConfigFixture default_store general/locale/timezone UTC + * @return void + */ + public function testAttributeWithNonDefaultValueView(): void + { + $attributeValue = $this->getAttribute()->getBackend()->formatDate('12/20/19'); + $this->processNonDefaultAttributeValueView('simple2', $attributeValue, 'Dec 20, 2019'); + } + + /** + * @magentoConfigFixture default_store general/locale/timezone UTC + * @return void + */ + public function testAttributeWithDefaultValueView(): void + { + $this->markTestSkipped('Test is blocked by issue MC-28950'); + $this->processDefaultValueAttributeView('simple2', $this->getDefaultAttributeValue()); + } + + /** + * @inheritdoc + */ + protected function getAttributeCode(): string + { + return 'date_attribute'; + } + + /** + * @inheritdoc + */ + protected function getDefaultAttributeValue(): string + { + return $this->getAttribute()->getBackend()->formatDate('11/20/19'); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/DropdownAttributeTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/DropdownAttributeTest.php new file mode 100644 index 0000000000000..98799822dcfb0 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/DropdownAttributeTest.php @@ -0,0 +1,95 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Block\Product\View\Attribute; + +/** + * Class checks dropdown attribute displaying on frontend + * + * @magentoDbIsolation enabled + * @magentoAppIsolation enabled + * @magentoDataFixture Magento/Catalog/_files/dropdown_attribute.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + */ +class DropdownAttributeTest extends AbstractAttributeTest +{ + /** @var string */ + private $attributeCode; + + /** + * @return void + */ + public function testAttributeView(): void + { + $attributeValue = $this->getAttribute()->getSource()->getOptionId('Option 2'); + $this->processAttributeView('simple2', $attributeValue, 'Option 2'); + } + + /** + * @return void + */ + public function testAttributeWithNonDefaultValueView(): void + { + $attributeValue = $this->getAttribute()->getSource()->getOptionId('Option 2'); + $this->processNonDefaultAttributeValueView('simple2', $attributeValue, 'Option 2'); + } + + /** + * @dataProvider attributeWithTagsProvider + * @magentoAppArea frontend + * @magentoDataFixture Magento/Catalog/_files/dropdown_attribute_with_html.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + * @param bool $allowHtmlTags + * @param string $attributeValue + * @param string $expectedAttributeValue + * @return void + */ + public function testAttributeWithHtmlTags( + bool $allowHtmlTags, + string $attributeValue, + string $expectedAttributeValue + ): void { + $this->attributeCode = 'dropdown_attribute_with_html'; + $attributeValue = $this->getAttribute()->getSource()->getOptionId($attributeValue); + $this->processAttributeHtmlOutput('simple2', $allowHtmlTags, $attributeValue, $expectedAttributeValue); + } + + /** + * @return array + */ + public function attributeWithTagsProvider(): array + { + return [ + 'allow_html_tags' => [ + 'allow_html_tags' => true, + 'attribute_value' => '<h2>Option 2</h2>', + 'expected_attribute_value' => '<h2>Option 2</h2>', + ], + 'disallow_html_tags' => [ + 'allow_html_tags' => false, + 'attribute_value' => '<h2>Option 2</h2>', + 'expected_attribute_value' => '<h2>Option 2</h2>', + ], + ]; + } + + /** + * @inheritdoc + */ + protected function getAttributeCode(): string + { + return $this->attributeCode ?? 'dropdown_attribute'; + } + + /** + * @inheritdoc + */ + protected function getDefaultAttributeValue(): string + { + return $this->getAttribute()->getSource()->getOptionId('Option 1'); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/MultiSelectAttributeTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/MultiSelectAttributeTest.php new file mode 100644 index 0000000000000..758de8f53ba93 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/MultiSelectAttributeTest.php @@ -0,0 +1,103 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Block\Product\View\Attribute; + +/** + * Class checks multi select attribute displaying on frontend + * + * @magentoDbIsolation disabled + * @magentoDataFixture Magento/Catalog/_files/multiselect_attribute.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + */ +class MultiSelectAttributeTest extends AbstractAttributeTest +{ + /** @var string */ + private $attributeCode; + + /** + * @return void + */ + public function testAttributeView(): void + { + $attributeValue = $this->getAttribute()->getSource()->getOptionId('Option 2'); + $this->processAttributeView('simple2', $attributeValue, 'Option 2'); + } + + /** + * @return void + */ + public function testAttributeWithNonDefaultValueView(): void + { + $attributeValue = $this->getAttribute()->getSource()->getOptionId('Option 2'); + $this->processNonDefaultAttributeValueView('simple2', $attributeValue, 'Option 2'); + } + + /** + * @return void + */ + public function testAttributeWithDefaultValueView(): void + { + $this->markTestSkipped('Test is blocked by issue MC-29019'); + $this->processDefaultValueAttributeView('simple2', 'Option 1'); + } + + /** + * @dataProvider attributeWithTagsProvider + * @magentoAppArea frontend + * @magentoDataFixture Magento/Catalog/_files/multiselect_attribute_with_html.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + * @param bool $allowHtmlTags + * @param string $attributeValue + * @param string $expectedAttributeValue + * @return void + */ + public function testAttributeWithHtmlTags( + bool $allowHtmlTags, + string $attributeValue, + string $expectedAttributeValue + ): void { + $this->attributeCode = 'multiselect_attribute_with_html'; + $attributeValue = $this->getAttribute()->getSource()->getOptionId($attributeValue); + $this->processAttributeHtmlOutput('simple2', $allowHtmlTags, $attributeValue, $expectedAttributeValue); + } + + /** + * @return array + */ + public function attributeWithTagsProvider(): array + { + return [ + 'allow_html_tags' => [ + 'allow_html_tags' => true, + 'attribute_value' => '<h2>Option 2</h2>', + 'expected_attribute_value' => '<h2>Option 2</h2>', + ], + 'disallow_html_tags' => [ + 'allow_html_tags' => false, + 'attribute_value' => '<h2>Option 2</h2>', + 'expected_attribute_value' => '<h2>Option 2</h2>', + ], + ]; + } + + /** + * @inheritdoc + */ + protected function getAttributeCode(): string + { + return $this->attributeCode ?? 'multiselect_attribute'; + } + + /** + * @inheritdoc + */ + protected function getDefaultAttributeValue(): string + { + return $this->getAttribute()->getSource()->getOptionId('Option 1'); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/PriceAttributeTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/PriceAttributeTest.php new file mode 100644 index 0000000000000..ae3c145294b56 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/PriceAttributeTest.php @@ -0,0 +1,74 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Block\Product\View\Attribute; + +use Magento\Directory\Model\PriceCurrency; + +/** + * Class checks price attribute displaying on frontend + * + * @magentoDbIsolation enabled + * @magentoDataFixture Magento/Catalog/_files/product_decimal_attribute.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + */ +class PriceAttributeTest extends AbstractAttributeTest +{ + /** @var PriceCurrency */ + private $priceCurrency; + + /** + * @inheritdoc + */ + protected function setUp() + { + parent::setUp(); + + $this->priceCurrency = $this->objectManager->create(PriceCurrency::class); + } + + /** + * @dataProvider pricesDataProvider + * @param string $price + * @return void + */ + public function testAttributeView(string $price): void + { + $this->processAttributeView('simple2', $price, $this->priceCurrency->convertAndFormat($price)); + } + + /** + * @return array + */ + public function pricesDataProvider(): array + { + return [ + 'zero_price' => [ + 'price' => '0', + ], + 'positive_price' => [ + 'price' => '150', + ], + ]; + } + + /** + * @inheritdoc + */ + protected function getAttributeCode(): string + { + return 'decimal_attribute'; + } + + /** + * @inheritdoc + */ + protected function getDefaultAttributeValue(): string + { + return ''; + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/TextAreaAttributeTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/TextAreaAttributeTest.php new file mode 100644 index 0000000000000..45414c8788922 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/TextAreaAttributeTest.php @@ -0,0 +1,60 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Block\Product\View\Attribute; + +/** + * Class checks textarea attribute displaying on frontend + * + * @magentoDbIsolation enabled + * @magentoDataFixture Magento/Catalog/_files/product_text_attribute.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + */ +class TextAreaAttributeTest extends AbstractAttributeTest +{ + /** + * @return void + */ + public function testAttributeView(): void + { + $attributeValue = 'Value for text area attribute'; + $this->processAttributeView('simple2', $attributeValue, $attributeValue); + } + + /** + * @return void + */ + public function testAttributeWithNonDefaultValueView(): void + { + $attributeValue = 'Text area attribute value'; + $this->processNonDefaultAttributeValueView('simple2', $attributeValue, $attributeValue); + } + + /** + * @return void + */ + public function testAttributeWithDefaultValueView(): void + { + $this->processDefaultValueAttributeView('simple2', $this->getDefaultAttributeValue()); + } + + /** + * @inheritdic + */ + protected function getAttributeCode(): string + { + return 'text_attribute'; + } + + /** + * @inheritdic + */ + protected function getDefaultAttributeValue(): string + { + return 'Default value for text area attribute'; + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/TextAttributeTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/TextAttributeTest.php new file mode 100644 index 0000000000000..b61c5fd22d5b0 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/TextAttributeTest.php @@ -0,0 +1,95 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Block\Product\View\Attribute; + +/** + * Class checks text attribute displaying on frontend + * + * @magentoDbIsolation enabled + * @magentoDataFixture Magento/Catalog/_files/product_varchar_attribute.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + */ +class TextAttributeTest extends AbstractAttributeTest +{ + /** + * @return void + */ + public function testAttributeView(): void + { + $attributeValue = 'Text attribute value'; + $this->processAttributeView('simple2', $attributeValue, $attributeValue); + } + + /** + * @return void + */ + public function testAttributeWithNonDefaultValueView(): void + { + $attributeValue = 'Non default text attribute value'; + $this->processNonDefaultAttributeValueView('simple2', $attributeValue, $attributeValue); + } + + /** + * @return void + */ + public function testAttributeWithDefaultValueView(): void + { + $this->processDefaultValueAttributeView('simple2', $this->getDefaultAttributeValue()); + } + + /** + * @dataProvider attributeWithTagsProvider + * @magentoAppArea frontend + * @param bool $allowHtmlTags + * @param string $attributeValue + * @param string $expectedAttributeValue + * @return void + */ + public function testAttributeWithHtmlTags( + bool $allowHtmlTags, + string $attributeValue, + string $expectedAttributeValue + ): void { + $this->processAttributeHtmlOutput('simple2', $allowHtmlTags, $attributeValue, $expectedAttributeValue); + } + + /** + * @return array + */ + public function attributeWithTagsProvider(): array + { + return [ + 'allow_html_tags' => [ + 'allow_html_tags' => true, + 'attribute_value' => '<h2>Text with <p>html inside</p></h2>', + 'expected_attribute_value' => '<h2>Text with <p>html inside</p></h2>', + ], + 'disallow_html_tags' => [ + 'allow_html_tags' => false, + 'attribute_value' => '<h2>Text with <p>html inside</p></h2>', + 'expected_attribute_value' => '<h2>Text with <p>html inside</p></h2>', + ], + ]; + } + + /** + * @inheritdoc + */ + protected function getAttributeCode(): string + { + return 'varchar_attribute'; + } + + /** + * @inheritdoc + */ + protected function getDefaultAttributeValue(): string + { + return 'Default value for text attribute'; + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/YesNoAttributeTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/YesNoAttributeTest.php new file mode 100644 index 0000000000000..8d95b8d02e2fc --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/YesNoAttributeTest.php @@ -0,0 +1,50 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Block\Product\View\Attribute; + +/** + * Class checks boolean attribute displaying on frontend + * + * @magentoDbIsolation enabled + * @magentoDataFixture Magento/Catalog/_files/product_boolean_attribute.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + */ +class YesNoAttributeTest extends AbstractAttributeTest +{ + /** + * @return void + */ + public function testAttributeWithNonDefaultValueView(): void + { + $this->processNonDefaultAttributeValueView('simple2', '0', 'No'); + } + + /** + * @return void + */ + public function testAttributeWithDefaultValueView(): void + { + $this->processDefaultValueAttributeView('simple2', 'Yes'); + } + + /** + * @inheritdoc + */ + protected function getAttributeCode(): string + { + return 'boolean_attribute'; + } + + /** + * @inheritdoc + */ + protected function getDefaultAttributeValue(): string + { + return '1'; + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/dropdown_attribute_with_html.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/dropdown_attribute_with_html.php new file mode 100644 index 0000000000000..76ab08720f18c --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/dropdown_attribute_with_html.php @@ -0,0 +1,69 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\Data\ProductAttributeInterface; +use Magento\Catalog\Model\ResourceModel\Eav\Attribute; +use Magento\Catalog\Model\ResourceModel\Eav\AttributeFactory; +use Magento\Catalog\Setup\CategorySetup; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); +/** @var $installer CategorySetup */ +$installer = $objectManager->create(CategorySetup::class); +/** @var AttributeFactory $attributeFactory */ +$attributeFactory = $objectManager->get(AttributeFactory::class); +/** @var Attribute $attribute */ +$attribute = $attributeFactory->create(); +$entityTypeId = $installer->getEntityTypeId(ProductAttributeInterface::ENTITY_TYPE_CODE); + +if (!$attribute->loadByCode($entityTypeId, 'dropdown_attribute_with_html')->getId()) { + /** @var $installer CategorySetup */ + $installer = $objectManager->create(CategorySetup::class); + $attribute->setData( + [ + 'attribute_code' => 'dropdown_attribute_with_html', + 'entity_type_id' => $entityTypeId, + 'is_global' => 0, + 'is_user_defined' => 1, + 'frontend_input' => 'select', + 'is_unique' => 0, + 'is_required' => 0, + 'is_searchable' => 0, + 'is_visible_in_advanced_search' => 0, + 'is_comparable' => 0, + 'is_filterable' => 0, + 'is_filterable_in_search' => 0, + 'is_used_for_promo_rules' => 0, + 'is_html_allowed_on_front' => 1, + 'is_visible_on_front' => 1, + 'used_in_product_listing' => 1, + 'used_for_sort_by' => 0, + 'frontend_label' => ['Drop-Down Attribute'], + 'backend_type' => 'int', + 'option' => [ + 'value' => [ + 'option_1' => ['<h2>Option 1</h2>'], + 'option_2' => ['<h2>Option 2</h2>'], + 'option_3' => ['<h2>Option 3</h2>'], + ], + 'order' => [ + 'option_1' => 1, + 'option_2' => 2, + 'option_3' => 3, + ], + ], + ] + ); + $attribute->save(); + /* Assign attribute to attribute set */ + $installer->addAttributeToGroup( + $entityTypeId, + 'Default', + 'Attributes', + $attribute->getId() + ); +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/dropdown_attribute_with_html_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/dropdown_attribute_with_html_rollback.php new file mode 100644 index 0000000000000..e6357b6967112 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/dropdown_attribute_with_html_rollback.php @@ -0,0 +1,27 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\Framework\Registry; +use Magento\Catalog\Api\ProductAttributeRepositoryInterface; + +$objectManager = Bootstrap::getObjectManager(); +$registry = $objectManager->get(Registry::class); +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); +/** @var ProductAttributeRepositoryInterface $attributeRepository */ +$attributeRepository = $objectManager->create(ProductAttributeRepositoryInterface::class); + +try { + $attributeRepository->deleteById('dropdown_attribute_with_html'); +} catch (NoSuchEntityException $e) { + //already deleted +} + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/multiselect_attribute_with_html.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/multiselect_attribute_with_html.php new file mode 100644 index 0000000000000..bb2bb5016b426 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/multiselect_attribute_with_html.php @@ -0,0 +1,68 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\Data\ProductAttributeInterface; +use Magento\Catalog\Model\ResourceModel\Eav\Attribute; +use Magento\Catalog\Model\ResourceModel\Eav\AttributeFactory; +use Magento\Catalog\Setup\CategorySetup; +use Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); +/** @var $installer CategorySetup */ +$installer = $objectManager->create(CategorySetup::class); +/** @var $attributeFactory AttributeFactory */ +$attributeFactory = $objectManager->get(AttributeFactory::class); +/** @var $attribute Attribute */ +$attribute = $attributeFactory->create(); +$entityTypeId = $installer->getEntityTypeId(ProductAttributeInterface::ENTITY_TYPE_CODE); +if (!$attribute->loadByCode($entityTypeId, 'multiselect_attribute_with_html')->getAttributeId()) { + $attribute->setData( + [ + 'attribute_code' => 'multiselect_attribute_with_html', + 'entity_type_id' => $entityTypeId, + 'is_global' => 1, + 'is_user_defined' => 1, + 'frontend_input' => 'multiselect', + 'is_unique' => 0, + 'is_required' => 0, + 'is_searchable' => 0, + 'is_visible_in_advanced_search' => 0, + 'is_comparable' => 0, + 'is_filterable' => 1, + 'is_filterable_in_search' => 0, + 'is_used_for_promo_rules' => 0, + 'is_html_allowed_on_front' => 1, + 'is_visible_on_front' => 0, + 'used_in_product_listing' => 0, + 'used_for_sort_by' => 0, + 'frontend_label' => ['Multiselect Attribute'], + 'backend_type' => 'varchar', + 'backend_model' => ArrayBackend::class, + 'option' => [ + 'value' => [ + 'option_1' => ['<h2>Option 1</h2>'], + 'option_2' => ['<h2>Option 2</h2>'], + 'option_3' => ['<h2>Option 3</h2>'], + ], + 'order' => [ + 'option_1' => 1, + 'option_2' => 2, + 'option_3' => 3, + ], + ], + ] + ); + $attribute->save(); + /* Assign attribute to attribute set */ + $installer->addAttributeToGroup( + $entityTypeId, + 'Default', + 'General', + $attribute->getId() + ); +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/multiselect_attribute_with_html_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/multiselect_attribute_with_html_rollback.php new file mode 100644 index 0000000000000..898c9bec0d635 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/multiselect_attribute_with_html_rollback.php @@ -0,0 +1,27 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\Framework\Registry; +use Magento\Catalog\Api\ProductAttributeRepositoryInterface; + +$objectManager = Bootstrap::getObjectManager(); +$registry = $objectManager->get(Registry::class); +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); +/** @var ProductAttributeRepositoryInterface $attributeRepository */ +$attributeRepository = $objectManager->create(ProductAttributeRepositoryInterface::class); + +try { + $attributeRepository->deleteById('multiselect_attribute_with_html'); +} catch (NoSuchEntityException $e) { + //already deleted +} + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); diff --git a/dev/tests/integration/testsuite/Magento/Swatches/Block/Product/View/Attribute/TextSwatchAttributeTest.php b/dev/tests/integration/testsuite/Magento/Swatches/Block/Product/View/Attribute/TextSwatchAttributeTest.php new file mode 100644 index 0000000000000..20f4cf50803b8 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Swatches/Block/Product/View/Attribute/TextSwatchAttributeTest.php @@ -0,0 +1,63 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Swatches\Block\Product\View\Attribute; + +use Magento\Catalog\Block\Product\View\Attribute\AbstractAttributeTest; + +/** + * Class checks text attribute displaying on frontend + * + * @magentoDbIsolation enabled + * @magentoAppIsolation enabled + * @magentoDataFixture Magento/Swatches/_files/product_text_swatch_attribute.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + */ +class TextSwatchAttributeTest extends AbstractAttributeTest +{ + /** + * @return void + */ + public function testAttributeView(): void + { + $attributeValue = $this->getAttribute()->getSource()->getOptionId('Option 2'); + $this->processAttributeView('simple2', $attributeValue, 'Option 2'); + } + + /** + * @return void + */ + public function testAttributeWithNonDefaultValueView(): void + { + $attributeValue = $this->getAttribute()->getSource()->getOptionId('Option 2'); + $this->processNonDefaultAttributeValueView('simple2', $attributeValue, 'Option 2'); + } + + /** + * @return void + */ + public function tesAttributeWithDefaultValueView(): void + { + $this->processDefaultValueAttributeView('simple2', 'Option 1'); + } + + /** + * @inheritdoc + */ + protected function getAttributeCode(): string + { + return 'text_swatch_attribute'; + } + + /** + * @inheritdoc + */ + protected function getDefaultAttributeValue(): string + { + return $this->getAttribute()->getSource()->getOptionId('Option 1'); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Swatches/Block/Product/View/Attribute/VisualSwatchAttributeTest.php b/dev/tests/integration/testsuite/Magento/Swatches/Block/Product/View/Attribute/VisualSwatchAttributeTest.php new file mode 100644 index 0000000000000..0108a99543def --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Swatches/Block/Product/View/Attribute/VisualSwatchAttributeTest.php @@ -0,0 +1,63 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Swatches\Block\Product\View\Attribute; + +use Magento\Catalog\Block\Product\View\Attribute\AbstractAttributeTest; + +/** + * Class checks visual swatch attribute displaying on frontend + * + * @magentoDbIsolation enabled + * @magentoAppIsolation enabled + * @magentoDataFixture Magento/Swatches/_files/product_visual_swatch_attribute.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + */ +class VisualSwatchAttributeTest extends AbstractAttributeTest +{ + /** + * @return void + */ + public function testAttributeView(): void + { + $attributeValue = $this->getAttribute()->getSource()->getOptionId('option 2'); + $this->processAttributeView('simple2', $attributeValue, 'option 2'); + } + + /** + * @return void + */ + public function testAttributeWithNonDefaultValueView(): void + { + $attributeValue = $this->getAttribute()->getSource()->getOptionId('option 2'); + $this->processNonDefaultAttributeValueView('simple2', $attributeValue, 'option 2'); + } + + /** + * @return void + */ + public function tesAttributeWithDefaultValueView(): void + { + $this->processDefaultValueAttributeView('simple2', 'option 1'); + } + + /** + * @inheritdoc + */ + protected function getAttributeCode(): string + { + return 'visual_swatch_attribute'; + } + + /** + * @inheritdoc + */ + protected function getDefaultAttributeValue(): string + { + return $this->getAttribute()->getSource()->getOptionId('option 1'); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Weee/Block/Product/View/Attribute/FixedProductTaxAttributeTest.php b/dev/tests/integration/testsuite/Magento/Weee/Block/Product/View/Attribute/FixedProductTaxAttributeTest.php new file mode 100644 index 0000000000000..6cb7d6dc0346d --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Weee/Block/Product/View/Attribute/FixedProductTaxAttributeTest.php @@ -0,0 +1,252 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Weee\Block\Product\View\Attribute; + +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Block\Product\ListProduct; +use Magento\Catalog\Pricing\Render as CatalogPricingRender; +use Magento\Framework\ObjectManagerInterface; +use Magento\Framework\Pricing\Render; +use Magento\Framework\Pricing\Render\RendererPool; +use Magento\Framework\Registry; +use Magento\Framework\View\LayoutInterface; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; + +/** + * Class checks FPT attribute displaying on frontend + * + * @magentoDbIsolation enabled + * @magentoAppIsolation enabled + * @magentoAppArea frontend + * @magentoDataFixture Magento/Weee/_files/fixed_product_attribute.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + */ +class FixedProductTaxAttributeTest extends TestCase +{ + /** @var array */ + private const TEST_TAX_DATA = [ + [ + 'region_id' => '1', + 'country' => 'US', + 'val' => '', + 'value' => '5', + 'website_id' => '1', + 'state' => '', + ] + ]; + + /** @var ObjectManagerInterface */ + private $objectManager; + + /** @var ProductRepositoryInterface */ + private $productRepository; + + /** @var string */ + private $attributeCode; + + /** @var LayoutInterface */ + private $layout; + + /** @var ListProduct */ + private $productListBlock; + + /** @var Registry */ + private $registry; + + /** + * @inheritdoc + */ + protected function setUp() + { + parent::setUp(); + + $this->objectManager = Bootstrap::getObjectManager(); + $this->productRepository = $this->objectManager->create(ProductRepositoryInterface::class); + $this->layout = $this->objectManager->get(LayoutInterface::class); + $this->productListBlock = $this->layout->createBlock(ListProduct::class); + $this->attributeCode = 'fixed_product_attribute'; + $this->registry = $this->objectManager->get(Registry::class); + } + + /** + * @inheritdoc + */ + protected function tearDown() + { + $this->registry->unregister('product'); + + parent::tearDown(); + } + + /** + * @magentoConfigFixture default_store tax/weee/enable 1 + * @magentoConfigFixture default_store tax/weee/display_list 0 + */ + public function testFPTCategoryPageIncludingFPTOnly(): void + { + $this->prepareLayoutCategoryPage(); + $product = $this->updateProduct('simple2', self::TEST_TAX_DATA); + $productPrice = $this->productListBlock->getProductPrice($product); + $this->assertEquals('$15.00', preg_replace('/\s+/', '', strip_tags($productPrice))); + } + + /** + * @magentoConfigFixture default_store tax/weee/enable 1 + * @magentoConfigFixture default_store tax/weee/display_list 1 + */ + public function testFPTCategoryPageIncludingFPTAndDescription(): void + { + $this->prepareLayoutCategoryPage(); + $product = $this->updateProduct('simple2', self::TEST_TAX_DATA); + $productPrice = $this->productListBlock->getProductPrice($product); + $this->assertContains('data-label="fixed product tax"', $productPrice); + $this->assertEquals('$15.00$5.00', preg_replace('/\s+/', '', strip_tags($productPrice))); + } + + /** + * @magentoConfigFixture default_store tax/weee/enable 1 + * @magentoConfigFixture default_store tax/weee/display_list 2 + */ + public function testFPTCategoryPageExcludingFPTIncludingDescriptionAndPrice(): void + { + $this->prepareLayoutCategoryPage(); + $product = $this->updateProduct('simple2', self::TEST_TAX_DATA); + $productPrice = $this->productListBlock->getProductPrice($product); + $this->assertContains('data-label="fixed product tax"', $productPrice); + $this->assertEquals('$10.00$5.00$15.00', preg_replace('/\s+/', '', strip_tags($productPrice))); + } + + /** + * @magentoConfigFixture default_store tax/weee/enable 1 + * @magentoConfigFixture default_store tax/weee/display_list 3 + */ + public function testFPTCategoryPageExcludingFPT(): void + { + $this->prepareLayoutCategoryPage(); + $product = $this->updateProduct('simple2', self::TEST_TAX_DATA); + $productPrice = $this->productListBlock->getProductPrice($product); + $this->assertEquals('$10.00', preg_replace('/\s+/', '', strip_tags($productPrice))); + } + + /** + * @magentoConfigFixture default_store tax/weee/enable 1 + * @magentoConfigFixture default_store tax/weee/display_list 0 + */ + public function testFPTProductPageIncludingFPTOnly(): void + { + $product = $this->updateProduct('simple2', self::TEST_TAX_DATA); + $this->registerProduct($product); + $block = $this->prepareLayoutProductPage(); + $productPrice = $block->toHtml(); + $this->assertEquals('$15.00', preg_replace('/\s+/', '', strip_tags($productPrice))); + } + + /** + * @magentoConfigFixture default_store tax/weee/enable 1 + * @magentoConfigFixture default_store tax/weee/display_list 1 + */ + public function testFPTProductPageIncludingFPTAndDescription(): void + { + $product = $this->updateProduct('simple2', self::TEST_TAX_DATA); + $this->registerProduct($product); + $block = $this->prepareLayoutProductPage(); + $productPrice = $block->toHtml(); + $this->assertContains('data-label="fixed product tax"', $productPrice); + $this->assertEquals('$15.00$5.00', preg_replace('/\s+/', '', strip_tags($productPrice))); + } + + /** + * @magentoConfigFixture default_store tax/weee/enable 1 + * @magentoConfigFixture default_store tax/weee/display_list 2 + */ + public function testFPTProductPageExcludingFPTIncludingDescriptionAndPrice(): void + { + $product = $this->updateProduct('simple2', self::TEST_TAX_DATA); + $this->registerProduct($product); + $block = $this->prepareLayoutProductPage(); + $productPrice = $block->toHtml(); + $this->assertContains('data-label="fixed product tax"', $productPrice); + $this->assertEquals('$10.00$5.00$15.00', preg_replace('/\s+/', '', strip_tags($productPrice))); + } + + /** + * @magentoConfigFixture default_store tax/weee/enable 1 + * @magentoConfigFixture default_store tax/weee/display_list 3 + */ + public function testFPTProductPageExcludingFPT(): void + { + $product = $this->updateProduct('simple2', self::TEST_TAX_DATA); + $this->registerProduct($product); + $block = $this->prepareLayoutProductPage(); + $productPrice = $block->toHtml(); + $this->assertEquals('$10.00', preg_replace('/\s+/', '', strip_tags($productPrice))); + } + + /** + * Update product + * + * @param string $productSku + * @param array $data + * @return ProductInterface + */ + private function updateProduct(string $productSku, array $data): ProductInterface + { + $product = $this->productRepository->get($productSku); + $product->addData([$this->attributeCode => $data]); + + return $this->productRepository->save($product); + } + + /** + * Prepare layout for category page view + * + * @return void + */ + private function prepareLayoutCategoryPage(): void + { + $this->layout->createBlock(RendererPool::class, 'render.product.prices'); + $block = $this->objectManager->create(Render::class); + $block->setPriceRenderHandle('catalog_product_prices'); + $block->setLayout($this->layout); + $this->layout->addBlock($block, 'product.price.render.default'); + } + + /** + * Prepare layout for product page + * + * @return CatalogPricingRender + */ + private function prepareLayoutProductPage(): CatalogPricingRender + { + $render = $this->objectManager->create(Render::class); + $render->setPriceRenderHandle('catalog_product_prices'); + $this->layout->addBlock($render, 'product.price.render.default'); + $block = $this->objectManager->create(CatalogPricingRender::class); + $block->setPriceRender('product.price.render.default'); + $block->setPriceTypeCode('final_price'); + $this->layout->addBlock($block, 'render.product.prices'); + $block->setLayout($this->layout); + $render->setLayout($this->layout); + + return $block; + } + + /** + * Register the product + * + * @param ProductInterface $product + * @return void + */ + private function registerProduct(ProductInterface $product): void + { + $this->registry->unregister('product'); + $this->registry->register('product', $product); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Weee/Ui/DataProvider/Product/Form/Modifier/Eav/FixedAttributeTest.php b/dev/tests/integration/testsuite/Magento/Weee/Ui/DataProvider/Product/Form/Modifier/Eav/FixedAttributeTest.php index 0987d8fbe57dd..c082d8184c72d 100644 --- a/dev/tests/integration/testsuite/Magento/Weee/Ui/DataProvider/Product/Form/Modifier/Eav/FixedAttributeTest.php +++ b/dev/tests/integration/testsuite/Magento/Weee/Ui/DataProvider/Product/Form/Modifier/Eav/FixedAttributeTest.php @@ -65,7 +65,7 @@ private function getAttributeMeta(): array return [ 'visible' => '1', 'required' => '0', - 'label' => '', + 'label' => 'fixed product tax', 'code' => 'fixed_product_attribute', 'source' => 'product-details', 'scopeLabel' => '[GLOBAL]', diff --git a/dev/tests/integration/testsuite/Magento/Weee/_files/fixed_product_attribute.php b/dev/tests/integration/testsuite/Magento/Weee/_files/fixed_product_attribute.php index a20d1cac94228..a74305d7db424 100644 --- a/dev/tests/integration/testsuite/Magento/Weee/_files/fixed_product_attribute.php +++ b/dev/tests/integration/testsuite/Magento/Weee/_files/fixed_product_attribute.php @@ -25,6 +25,8 @@ 'is_static' => 1, 'attribute_set_id' => $defaultSetId, 'attribute_group_id' => $attributeGroupId, + 'frontend_input' => 'weee', + 'frontend_label' => 'fixed product tax', ]; /** @var \Magento\Catalog\Model\Entity\Attribute $attribute */ From 41a583abd83a20c21bbc80c044ad9f6f0ebcc63b Mon Sep 17 00:00:00 2001 From: Sathish <srsathish92@gmail.com> Date: Tue, 17 Dec 2019 18:58:35 +0530 Subject: [PATCH 379/586] Expected result added with data provider --- .../Test/Unit/Helper/DataTest.php | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/GoogleAnalytics/Test/Unit/Helper/DataTest.php b/app/code/Magento/GoogleAnalytics/Test/Unit/Helper/DataTest.php index ea1df498499de..4da5b70e10b91 100644 --- a/app/code/Magento/GoogleAnalytics/Test/Unit/Helper/DataTest.php +++ b/app/code/Magento/GoogleAnalytics/Test/Unit/Helper/DataTest.php @@ -53,10 +53,13 @@ protected function setUp(): void /** * Test for isGoogleAnalyticsAvailable() * + * @param string $value + * @param bool $flag + * @param bool $result * @return void * @dataProvider gaDataProvider */ - public function testIsGoogleAnalyticsAvailable($value, $flag): void + public function testIsGoogleAnalyticsAvailable($value, $flag, $result): void { $this->scopeConfigMock->expects($this->once()) ->method('getValue') @@ -68,7 +71,7 @@ public function testIsGoogleAnalyticsAvailable($value, $flag): void ->with(HelperData::XML_PATH_ACTIVE, ScopeInterface::SCOPE_STORE) ->willReturn($flag); - $this->assertEquals(($value && $flag), $this->helper->isGoogleAnalyticsAvailable()); + $this->assertEquals($result, $this->helper->isGoogleAnalyticsAvailable()); } /** @@ -79,25 +82,27 @@ public function testIsGoogleAnalyticsAvailable($value, $flag): void public function gaDataProvider(): array { return [ - ['GA-XXXX', true], - ['GA-XXXX', false], - ['', true] + ['GA-XXXX', true, true], + ['GA-XXXX', false, false], + ['', true, false] ]; } /** * Test for isAnonymizedIpActive() * + * @param string $value + * @param bool $result * @return void * @dataProvider yesNoDataProvider */ - public function testIsAnonymizedIpActive($value): void + public function testIsAnonymizedIpActive($value, $result): void { $this->scopeConfigMock->expects($this->once()) ->method('getValue') ->with(HelperData::XML_PATH_ANONYMIZE, ScopeInterface::SCOPE_STORE) ->willReturn($value); - $this->assertEquals((bool) $value, $this->helper->isAnonymizedIpActive()); + $this->assertEquals($result, $this->helper->isAnonymizedIpActive()); } /** @@ -108,8 +113,8 @@ public function testIsAnonymizedIpActive($value): void public function yesNoDataProvider(): array { return [ - ['Yes' => '1'], - ['No' => '0'] + ['Yes' => '1', 'result' => true], + ['No' => '0', 'result' => false] ]; } } From edbd6b5668307a1a4343f8772ed5869985c4fe1e Mon Sep 17 00:00:00 2001 From: Mastiuhin Olexandr <mastiuhin.olexandr@transoftgroup.com> Date: Tue, 17 Dec 2019 15:28:45 +0200 Subject: [PATCH 380/586] MC-29545: [Magento Cloud] - ElasticSearch Not Working Correctly (Alphabetical sorting) --- .../BatchDataMapper/ProductDataMapper.php | 22 +++++- .../Model/Indexer/ReindexAllTest.php | 68 +++++++++++++++++++ 2 files changed, 89 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Elasticsearch/Model/Adapter/BatchDataMapper/ProductDataMapper.php b/app/code/Magento/Elasticsearch/Model/Adapter/BatchDataMapper/ProductDataMapper.php index 270ca37e2d42c..16c4b3eb953f6 100644 --- a/app/code/Magento/Elasticsearch/Model/Adapter/BatchDataMapper/ProductDataMapper.php +++ b/app/code/Magento/Elasticsearch/Model/Adapter/BatchDataMapper/ProductDataMapper.php @@ -77,6 +77,13 @@ class ProductDataMapper implements BatchDataMapperInterface 'tax_class_id' ]; + /** + * @var string[] + */ + private $sortableAttributesValuesToImplode = [ + 'name', + ]; + /** * Construction for DocumentDataMapper * @@ -86,6 +93,7 @@ class ProductDataMapper implements BatchDataMapperInterface * @param AdditionalFieldsProviderInterface $additionalFieldsProvider * @param DataProvider $dataProvider * @param array $excludedAttributes + * @param array $sortableAttributesValuesToImplode */ public function __construct( Builder $builder, @@ -93,12 +101,17 @@ public function __construct( DateFieldType $dateFieldType, AdditionalFieldsProviderInterface $additionalFieldsProvider, DataProvider $dataProvider, - array $excludedAttributes = [] + array $excludedAttributes = [], + array $sortableAttributesValuesToImplode = [] ) { $this->builder = $builder; $this->fieldMapper = $fieldMapper; $this->dateFieldType = $dateFieldType; $this->excludedAttributes = array_merge($this->defaultExcludedAttributes, $excludedAttributes); + $this->sortableAttributesValuesToImplode = array_merge( + $this->sortableAttributesValuesToImplode, + $sortableAttributesValuesToImplode + ); $this->additionalFieldsProvider = $additionalFieldsProvider; $this->dataProvider = $dataProvider; $this->attributeOptionsCache = []; @@ -241,6 +254,13 @@ private function prepareAttributeValues( } } + if ($attribute->getUsedForSortBy() + && in_array($attribute->getAttributeCode(), $this->sortableAttributesValuesToImplode) + && count($attributeValues) > 1 + ) { + $attributeValues = [$productId => implode(' ', $attributeValues)]; + } + return $attributeValues; } diff --git a/dev/tests/integration/testsuite/Magento/Elasticsearch/Model/Indexer/ReindexAllTest.php b/dev/tests/integration/testsuite/Magento/Elasticsearch/Model/Indexer/ReindexAllTest.php index 7d4aa8e005e4e..031e0d6ad6fd1 100644 --- a/dev/tests/integration/testsuite/Magento/Elasticsearch/Model/Indexer/ReindexAllTest.php +++ b/dev/tests/integration/testsuite/Magento/Elasticsearch/Model/Indexer/ReindexAllTest.php @@ -79,6 +79,42 @@ public function testSearchAll() self::assertGreaterThanOrEqual(2, $result); } + /** + * Test sorting of all products after full reindex + * + * @magentoDbIsolation enabled + * @magentoConfigFixture default/catalog/search/engine elasticsearch6 + * @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix indexerhandlertest_configurable + * @magentoDataFixture Magento/ConfigurableProduct/_files/configurable_products.php + */ + public function testSort() + { + /** @var $productFifth \Magento\Catalog\Model\Product */ + $productSimple = Bootstrap::getObjectManager()->create(\Magento\Catalog\Model\Product::class); + $productSimple->setTypeId('simple') + ->setAttributeSetId(4) + ->setWebsiteIds([1]) + ->setName('ABC') + ->setSku('abc-first-in-sort') + ->setPrice(20) + ->setMetaTitle('meta title') + ->setMetaKeyword('meta keyword') + ->setMetaDescription('meta description') + ->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH) + ->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED) + ->setStockData(['use_config_manage_stock' => 0]) + ->save(); + $productConfigurableOption = $this->productRepository->get('simple_10'); + $productConfigurableOption->setName('1ABC'); + $this->productRepository->save($productConfigurableOption); + $this->reindexAll(); + $productSimple = $this->productRepository->get('abc-first-in-sort'); + $result = $this->sortByName(); + $firstInSearchResults = (int) $result[0]['_id']; + $productSimpleId = (int) $productSimple->getId(); + $this->assertEquals($productSimpleId, $firstInSearchResults); + } + /** * Test search of specific product after full reindex * @@ -125,6 +161,38 @@ private function searchByName($text) return isset($queryResult['hits']['hits']) ? $queryResult['hits']['hits'] : []; } + /** + * @return array + */ + private function sortByName() + { + $storeId = $this->storeManager->getDefaultStoreView()->getId(); + $searchQuery = [ + 'index' => $this->searchIndexNameResolver->getIndexName($storeId, 'catalogsearch_fulltext'), + 'type' => $this->clientConfig->getEntityType(), + 'body' => [ + 'sort' => [ + 'name.sort_name' => [ + 'order' => 'asc' + ], + ], + 'query' => [ + 'bool' => [ + 'must' => [ + [ + 'terms' => [ + 'visibility' => [2, 4], + ], + ], + ], + ], + ], + ], + ]; + $queryResult = $this->client->query($searchQuery); + return isset($queryResult['hits']['hits']) ? $queryResult['hits']['hits'] : []; + } + /** * Make fulltext catalog search reindex * From 6d064fd6c3db28076d5b62cd1734b8aff48f7fb1 Mon Sep 17 00:00:00 2001 From: Mastiuhin Olexandr <mastiuhin.olexandr@transoftgroup.com> Date: Tue, 17 Dec 2019 16:27:56 +0200 Subject: [PATCH 381/586] MC-29633: Bundle Product tax class can be changed from dashboard in store view --- .../Form/Modifier/AbstractModifierTest.php | 1 + .../Product/Form/Modifier/BundlePriceTest.php | 173 ++++++++++++++++++ .../Product/Form/Modifier/BundlePrice.php | 20 +- 3 files changed, 192 insertions(+), 2 deletions(-) create mode 100644 app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/Form/Modifier/BundlePriceTest.php diff --git a/app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/Form/Modifier/AbstractModifierTest.php b/app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/Form/Modifier/AbstractModifierTest.php index ccb6226ccd833..bfe0f04d59cb2 100644 --- a/app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/Form/Modifier/AbstractModifierTest.php +++ b/app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/Form/Modifier/AbstractModifierTest.php @@ -45,6 +45,7 @@ protected function setUp() $this->locatorMock = $this->getMockBuilder(LocatorInterface::class) ->getMockForAbstractClass(); $this->productMock = $this->getMockBuilder(ProductInterface::class) + ->setMethods(['getPriceType']) ->getMockForAbstractClass(); $this->locatorMock->expects($this->any()) diff --git a/app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/Form/Modifier/BundlePriceTest.php b/app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/Form/Modifier/BundlePriceTest.php new file mode 100644 index 0000000000000..b0519f1ebddba --- /dev/null +++ b/app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/Form/Modifier/BundlePriceTest.php @@ -0,0 +1,173 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Bundle\Test\Unit\Ui\DataProvider\Product\Form\Modifier; + +use Magento\Bundle\Ui\DataProvider\Product\Form\Modifier\BundlePrice; +use Magento\Catalog\Api\Data\ProductAttributeInterface; +use Magento\Framework\Stdlib\ArrayManager; + +class BundlePriceTest extends AbstractModifierTest +{ + /** + * @return BundlePrice + */ + protected function createModel() + { + return $this->objectManager->getObject( + BundlePrice::class, + [ + 'locator' => $this->locatorMock, + 'arrayManager' => $this->arrayManagerMock + ] + ); + } + + /** + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + */ + public function testModifyMeta() + { + $this->productMock->expects($this->any()) + ->method('getId') + ->willReturn(true); + $this->productMock->expects($this->any()) + ->method('getPriceType') + ->willReturn(0); + $priceTypePath = 'bundle-items/children/' . BundlePrice::CODE_PRICE_TYPE; + $priceTypeConfigPath = $priceTypePath . BundlePrice::META_CONFIG_PATH; + $pricePath = 'product-details/children/' . ProductAttributeInterface::CODE_PRICE; + $priceConfigPath = $pricePath . BundlePrice::META_CONFIG_PATH; + $sourceMeta = [ + 'bundle-items' => [ + 'children' => [ + BundlePrice::CODE_PRICE_TYPE => [] + ] + ] + ]; + $priceTypeParams = [ + 'disabled' => true, + 'valueMap' => [ + 'false' => '1', + 'true' => '0' + ], + 'validation' => [ + 'required-entry' => false + ] + ]; + $priceTypeMeta = [ + 'bundle-items' => [ + 'children' => [ + BundlePrice::CODE_PRICE_TYPE => $priceTypeParams + ] + ] + ]; + $priceParams = [ + 'imports' => [ + 'disabled' => 'ns = ${ $.ns }, index = ' . BundlePrice::CODE_PRICE_TYPE . ':checked' + ] + ]; + $priceMeta = [ + 'product-details' => [ + 'children' => [ + BundlePrice::CODE_PRICE_TYPE => [] + ] + ], + 'bundle-items' => [ + 'children' => [ + ProductAttributeInterface::CODE_PRICE => $priceParams + ] + ] + ]; + $taxParams = [ + 'service' => [ + 'template' => '' + ] + ]; + + $this->arrayManagerMock->expects($this->any()) + ->method('findPath') + ->willReturnMap( + [ + [ + BundlePrice::CODE_PRICE_TYPE, + $sourceMeta, + null, + 'children', + ArrayManager::DEFAULT_PATH_DELIMITER, + $priceTypePath + ], + [ + ProductAttributeInterface::CODE_PRICE, + $priceTypeMeta, + BundlePrice::DEFAULT_GENERAL_PANEL . '/children', + 'children', + ArrayManager::DEFAULT_PATH_DELIMITER, + $pricePath + ], + [ + BundlePrice::CODE_TAX_CLASS_ID, + $priceMeta, + null, + 'children', + ArrayManager::DEFAULT_PATH_DELIMITER, + $pricePath + ], + [ + BundlePrice::CODE_TAX_CLASS_ID, + $priceMeta, + null, + 'children', + ArrayManager::DEFAULT_PATH_DELIMITER, + $pricePath + ] + ] + ); + $this->arrayManagerMock->expects($this->exactly(4)) + ->method('merge') + ->willReturnMap( + [ + [ + $priceTypeConfigPath, + $sourceMeta, + $priceTypeParams, + ArrayManager::DEFAULT_PATH_DELIMITER, + $priceTypeMeta + ], + [ + $priceConfigPath, + $priceTypeMeta, + $priceParams, + ArrayManager::DEFAULT_PATH_DELIMITER, + $priceMeta + ], + [ + $priceConfigPath, + $priceMeta, + $priceParams, + ArrayManager::DEFAULT_PATH_DELIMITER, + $priceMeta + ], + [ + $priceConfigPath, + $priceMeta, + $taxParams, + ArrayManager::DEFAULT_PATH_DELIMITER, + $priceMeta + ] + ] + ); + + $this->assertSame($priceMeta, $this->getModel()->modifyMeta($sourceMeta)); + } + + public function testModifyData() + { + $expectedData = []; + $this->assertEquals($expectedData, $this->getModel()->modifyData($expectedData)); + } +} diff --git a/app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundlePrice.php b/app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundlePrice.php index 92326bb1521b4..d7da7513c3aac 100644 --- a/app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundlePrice.php +++ b/app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundlePrice.php @@ -5,6 +5,7 @@ */ namespace Magento\Bundle\Ui\DataProvider\Product\Form\Modifier; +use Magento\Bundle\Model\Product\Price; use Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\AbstractModifier; use Magento\Catalog\Api\Data\ProductAttributeInterface; use Magento\Framework\Stdlib\ArrayManager; @@ -39,7 +40,7 @@ public function __construct( $this->locator = $locator; $this->arrayManager = $arrayManager; } - + /** * @inheritdoc */ @@ -89,7 +90,22 @@ public function modifyMeta(array $meta) ] ] ); - + if ($this->locator->getProduct()->getPriceType() == Price::PRICE_TYPE_DYNAMIC) { + $meta = $this->arrayManager->merge( + $this->arrayManager->findPath( + static::CODE_TAX_CLASS_ID, + $meta, + null, + 'children' + ) . static::META_CONFIG_PATH, + $meta, + [ + 'service' => [ + 'template' => '' + ] + ] + ); + } return $meta; } From 8201ea2a15fafa5a50560b3c9890092b059bb619 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Tue, 17 Dec 2019 22:14:55 +0700 Subject: [PATCH 382/586] [GiftMessage] Cover Observer SalesEventOrderItemToQuoteItemObserver by Unit Test --- ...sEventOrderItemToQuoteItemObserverTest.php | 196 ++++++++++++++++++ 1 file changed, 196 insertions(+) create mode 100644 app/code/Magento/GiftMessage/Test/Unit/Observer/SalesEventOrderItemToQuoteItemObserverTest.php diff --git a/app/code/Magento/GiftMessage/Test/Unit/Observer/SalesEventOrderItemToQuoteItemObserverTest.php b/app/code/Magento/GiftMessage/Test/Unit/Observer/SalesEventOrderItemToQuoteItemObserverTest.php new file mode 100644 index 0000000000000..1df1c1101ccd1 --- /dev/null +++ b/app/code/Magento/GiftMessage/Test/Unit/Observer/SalesEventOrderItemToQuoteItemObserverTest.php @@ -0,0 +1,196 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\GiftMessage\Test\Unit\Observer; + +use Magento\Framework\Event; +use Magento\Framework\Event\Observer; +use Magento\Framework\Message\MessageInterface; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\GiftMessage\Helper\Message as MessageHelper; +use Magento\GiftMessage\Model\Message as MessageModel; +use Magento\GiftMessage\Model\MessageFactory; +use Magento\GiftMessage\Observer\SalesEventOrderItemToQuoteItemObserver; +use Magento\Quote\Model\Quote\Item as QuoteItem; +use Magento\Sales\Model\Order; +use Magento\Sales\Model\Order\Item as OrderItem; +use Magento\Store\Model\Store; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ +class SalesEventOrderItemToQuoteItemObserverTest extends TestCase +{ + /** + * Stub message id + */ + private const STUB_MESSAGE_ID = 1; + + /** + * Stub new message id + */ + private const STUB_NEW_MESSAGE_ID = 2; + + /** + * @var SalesEventOrderItemToQuoteItemObserver + */ + private $observer; + + /** + * @var MessageFactory|MockObject + */ + private $messageFactoryMock; + + /** + * @var MessageHelper|MockObject + */ + private $giftMessageHelperMock; + + /** + * @var Observer|MockObject + */ + private $observerMock; + + /** + * @var Event|MockObject + */ + private $eventMock; + + /** + * @var Order|MockObject + */ + private $orderMock; + + /** + * @var OrderItem|MockObject + */ + private $orderItemMock; + + /** + * @var Store|MockObject + */ + private $storeMock; + + /** + * @var MessageInterface|MockObject + */ + private $messageMock; + + /** + * @var QuoteItem|MockObject + */ + private $quoteItemMock; + + /** + * Prepare environment for test + */ + public function setUp(): void + { + $this->messageFactoryMock = $this->createMock(MessageFactory::class); + $this->giftMessageHelperMock = $this->createMock(MessageHelper::class); + $this->observerMock = $this->createMock(Observer::class); + $this->eventMock = $this->createPartialMock(Event::class, ['getOrderItem', 'getQuoteItem']); + $this->orderItemMock = $this->createPartialMock( + OrderItem::class, + ['getOrder', 'getStoreId', 'getGiftMessageId'] + ); + $this->quoteItemMock = $this->createPartialMock(QuoteItem::class, ['setGiftMessageId']); + $this->orderMock = $this->createPartialMock(Order::class, ['getReordered']); + $this->storeMock = $this->createMock(Store::class); + $this->messageMock = $this->createMock(MessageModel::class); + + $objectManager = new ObjectManager($this); + + $this->observer = $objectManager->getObject( + SalesEventOrderItemToQuoteItemObserver::class, + [ + 'messageFactory' => $this->messageFactoryMock, + 'giftMessageMessage' => $this->giftMessageHelperMock + ] + ); + } + + /** + * Tests duplicating gift message from order item to quote item + * + * @param bool $orderIsReordered + * @param bool $isMessagesAllowed + * @dataProvider giftMessageDataProvider + */ + public function testExecute($orderIsReordered, $isMessagesAllowed) + { + $this->eventMock->expects($this->atLeastOnce()) + ->method('getOrderItem') + ->willReturn($this->orderItemMock); + + $this->orderItemMock->expects($this->atLeastOnce()) + ->method('getOrder') + ->willReturn($this->orderMock); + + $this->observerMock->expects($this->atLeastOnce()) + ->method('getEvent') + ->willReturn($this->eventMock); + + if (!$orderIsReordered && $isMessagesAllowed) { + $this->eventMock + ->expects($this->atLeastOnce()) + ->method('getQuoteItem') + ->willReturn($this->quoteItemMock); + $this->orderMock->expects($this->once()) + ->method('getReordered') + ->willReturn($orderIsReordered); + $this->orderItemMock->expects($this->once()) + ->method('getGiftMessageId') + ->willReturn(self::STUB_MESSAGE_ID); + $this->giftMessageHelperMock->expects($this->once()) + ->method('isMessagesAllowed') + ->willReturn($isMessagesAllowed); + $this->messageFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($this->messageMock); + $this->messageMock->expects($this->once()) + ->method('load') + ->with(self::STUB_MESSAGE_ID) + ->willReturnSelf(); + $this->messageMock->expects($this->once()) + ->method('setId') + ->with(null) + ->willReturnSelf(); + $this->messageMock->expects($this->once()) + ->method('save') + ->willReturnSelf(); + $this->messageMock->expects($this->once()) + ->method('getId') + ->willReturn(self::STUB_NEW_MESSAGE_ID); + $this->quoteItemMock->expects($this->once()) + ->method('setGiftMessageId') + ->with(self::STUB_NEW_MESSAGE_ID) + ->willReturnSelf(); + } + + /** Run observer */ + $this->observer->execute($this->observerMock); + } + + /** + * Providing gift message data for test + * + * @return array + */ + public function giftMessageDataProvider() + { + return [ + 'order is not reordered, messages is allowed' => [false, true], + 'order is reordered, messages is allowed' => [true, true], + 'order is reordered, messages is not allowed' => [true, false], + 'order is not reordered, messages is not allowed' => [false, false] + ]; + } +} From 97b128635b82ce74c9ee1e92e1792a0a40fb089a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 12 Dec 2019 11:20:35 +0100 Subject: [PATCH 383/586] Add information about the path that is not allowed --- app/code/Magento/MediaStorage/App/Media.php | 49 +++-- .../MediaStorage/Test/Unit/App/MediaTest.php | 184 +++++++++++------- 2 files changed, 146 insertions(+), 87 deletions(-) diff --git a/app/code/Magento/MediaStorage/App/Media.php b/app/code/Magento/MediaStorage/App/Media.php index e1644ebaf5a48..15bf7bb62e970 100644 --- a/app/code/Magento/MediaStorage/App/Media.php +++ b/app/code/Magento/MediaStorage/App/Media.php @@ -5,22 +5,31 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + namespace Magento\MediaStorage\App; +use Closure; +use Exception; +use LogicException; use Magento\Catalog\Model\View\Asset\PlaceholderFactory; +use Magento\Framework\App; +use Magento\Framework\App\Area; +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\App\ResponseInterface; use Magento\Framework\App\State; +use Magento\Framework\AppInterface; use Magento\Framework\Filesystem; +use Magento\Framework\Filesystem\Directory\WriteInterface; +use Magento\MediaStorage\Model\File\Storage\Config; use Magento\MediaStorage\Model\File\Storage\ConfigFactory; use Magento\MediaStorage\Model\File\Storage\Response; -use Magento\Framework\App; -use Magento\Framework\App\Filesystem\DirectoryList; -use Magento\Framework\AppInterface; +use Magento\MediaStorage\Model\File\Storage\Synchronization; use Magento\MediaStorage\Model\File\Storage\SynchronizationFactory; -use Magento\Framework\App\Area; -use Magento\MediaStorage\Model\File\Storage\Config; use Magento\MediaStorage\Service\ImageResize; /** + * Media Storage + * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class Media implements AppInterface @@ -28,7 +37,7 @@ class Media implements AppInterface /** * Authorization function * - * @var \Closure + * @var Closure */ private $isAllowed; @@ -59,7 +68,7 @@ class Media implements AppInterface private $response; /** - * @var \Magento\Framework\Filesystem\Directory\WriteInterface + * @var WriteInterface */ private $directory; @@ -92,7 +101,7 @@ class Media implements AppInterface * @param ConfigFactory $configFactory * @param SynchronizationFactory $syncFactory * @param Response $response - * @param \Closure $isAllowed + * @param Closure $isAllowed * @param string $mediaDirectory * @param string $configCacheFile * @param string $relativeFileName @@ -106,7 +115,7 @@ public function __construct( ConfigFactory $configFactory, SynchronizationFactory $syncFactory, Response $response, - \Closure $isAllowed, + Closure $isAllowed, $mediaDirectory, $configCacheFile, $relativeFileName, @@ -120,6 +129,7 @@ public function __construct( $this->directory = $filesystem->getDirectoryWrite(DirectoryList::PUB); $mediaDirectory = trim($mediaDirectory); if (!empty($mediaDirectory)) { + // phpcs:ignore Magento2.Functions.DiscouragedFunction $this->mediaDirectoryPath = str_replace('\\', '/', realpath($mediaDirectory)); } $this->configCacheFile = $configCacheFile; @@ -135,9 +145,9 @@ public function __construct( * Run application * * @return Response - * @throws \LogicException + * @throws LogicException */ - public function launch() + public function launch(): ResponseInterface { $this->appState->setAreaCode(Area::AREA_GLOBAL); @@ -150,12 +160,12 @@ public function launch() $allowedResources = $config->getAllowedResources(); $isAllowed = $this->isAllowed; if (!$isAllowed($this->relativeFileName, $allowedResources)) { - throw new \LogicException('The specified path is not allowed.'); + throw new LogicException('The path is not allowed: ' . $this->relativeFileName); } } try { - /** @var \Magento\MediaStorage\Model\File\Storage\Synchronization $sync */ + /** @var Synchronization $sync */ $sync = $this->syncFactory->create(['directory' => $this->directory]); $sync->synchronize($this->relativeFileName); $this->imageResize->resizeFromImageName($this->getOriginalImage($this->relativeFileName)); @@ -164,14 +174,19 @@ public function launch() } else { $this->setPlaceholderImage(); } - } catch (\Exception $e) { + } catch (Exception $e) { $this->setPlaceholderImage(); } return $this->response; } - private function setPlaceholderImage() + /** + * Set Placeholder as a response + * + * @return void + */ + private function setPlaceholderImage(): void { $placeholder = $this->placeholderFactory->create(['type' => 'image']); $this->response->setFilePath($placeholder->getPath()); @@ -189,9 +204,9 @@ private function getOriginalImage(string $resizedImagePath): string } /** - * {@inheritdoc} + * @inheritdoc */ - public function catchException(App\Bootstrap $bootstrap, \Exception $exception) + public function catchException(App\Bootstrap $bootstrap, Exception $exception) { $this->response->setHttpResponseCode(404); if ($bootstrap->isDeveloperMode()) { diff --git a/app/code/Magento/MediaStorage/Test/Unit/App/MediaTest.php b/app/code/Magento/MediaStorage/Test/Unit/App/MediaTest.php index 90075d11c6af3..e6f43dd435869 100644 --- a/app/code/Magento/MediaStorage/Test/Unit/App/MediaTest.php +++ b/app/code/Magento/MediaStorage/Test/Unit/App/MediaTest.php @@ -3,145 +3,118 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + namespace Magento\MediaStorage\Test\Unit\App; +use Exception; +use LogicException; use Magento\Catalog\Model\View\Asset\Placeholder; use Magento\Catalog\Model\View\Asset\PlaceholderFactory; +use Magento\Framework\App\Bootstrap; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Filesystem; +use Magento\Framework\Filesystem\Directory\Read; +use Magento\Framework\Filesystem\Directory\WriteInterface; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\MediaStorage\App\Media; +use Magento\MediaStorage\Model\File\Storage\Config; +use Magento\MediaStorage\Model\File\Storage\ConfigFactory; +use Magento\MediaStorage\Model\File\Storage\Response; +use Magento\MediaStorage\Model\File\Storage\Synchronization; +use Magento\MediaStorage\Model\File\Storage\SynchronizationFactory; +use PHPUnit\Framework\TestCase; +use PHPUnit_Framework_MockObject_MockObject as MockObject; /** - * Class MediaTest + * Verification for Media class + * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class MediaTest extends \PHPUnit\Framework\TestCase +class MediaTest extends TestCase { const MEDIA_DIRECTORY = 'mediaDirectory'; const RELATIVE_FILE_PATH = 'test/file.png'; const CACHE_FILE_PATH = 'var'; /** - * @var \Magento\MediaStorage\App\Media + * @var Media */ - private $model; + private $mediaModel; /** - * @var \Magento\MediaStorage\Model\File\Storage\ConfigFactory|\PHPUnit_Framework_MockObject_MockObject + * @var ConfigFactory|MockObject */ private $configFactoryMock; /** - * @var \Magento\MediaStorage\Model\File\Storage\SynchronizationFactory|\PHPUnit_Framework_MockObject_MockObject + * @var SynchronizationFactory|MockObject */ private $syncFactoryMock; /** - * @var callable - */ - private $closure; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var Config|MockObject */ private $configMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var Synchronization|MockObject */ private $sync; /** - * @var \Magento\MediaStorage\Model\File\Storage\Response|\PHPUnit_Framework_MockObject_MockObject + * @var Response|MockObject */ private $responseMock; /** - * @var \Magento\Framework\Filesystem|\PHPUnit_Framework_MockObject_MockObject + * @var Filesystem|MockObject */ private $filesystemMock; /** - * @var \Magento\Framework\Filesystem\Directory\Read|\PHPUnit_Framework_MockObject_MockObject + * @var Read|MockObject */ private $directoryMock; protected function setUp() { - $this->closure = function () { - return true; - }; - $this->configMock = $this->createMock(\Magento\MediaStorage\Model\File\Storage\Config::class); - $this->sync = $this->createMock(\Magento\MediaStorage\Model\File\Storage\Synchronization::class); + $this->configMock = $this->createMock(Config::class); + $this->sync = $this->createMock(Synchronization::class); $this->configFactoryMock = $this->createPartialMock( - \Magento\MediaStorage\Model\File\Storage\ConfigFactory::class, + ConfigFactory::class, ['create'] ); $this->configFactoryMock->expects($this->any()) ->method('create') ->will($this->returnValue($this->configMock)); $this->syncFactoryMock = $this->createPartialMock( - \Magento\MediaStorage\Model\File\Storage\SynchronizationFactory::class, + SynchronizationFactory::class, ['create'] ); $this->syncFactoryMock->expects($this->any()) ->method('create') ->will($this->returnValue($this->sync)); - $this->filesystemMock = $this->createMock(\Magento\Framework\Filesystem::class); - $this->directoryMock = $this->getMockForAbstractClass( - \Magento\Framework\Filesystem\Directory\WriteInterface::class - ); + $this->filesystemMock = $this->createMock(Filesystem::class); + $this->directoryMock = $this->getMockForAbstractClass(WriteInterface::class); $this->filesystemMock->expects($this->any()) ->method('getDirectoryWrite') ->with(DirectoryList::PUB) ->will($this->returnValue($this->directoryMock)); - $this->responseMock = $this->createMock(\Magento\MediaStorage\Model\File\Storage\Response::class); - - $objectManager = new ObjectManager($this); - $this->model = $objectManager->getObject( - \Magento\MediaStorage\App\Media::class, - [ - 'configFactory' => $this->configFactoryMock, - 'syncFactory' => $this->syncFactoryMock, - 'response' => $this->responseMock, - 'isAllowed' => $this->closure, - 'mediaDirectory' => false, - 'configCacheFile' => self::CACHE_FILE_PATH, - 'relativeFileName' => self::RELATIVE_FILE_PATH, - 'filesystem' => $this->filesystemMock, - 'placeholderFactory' => $this->createConfiguredMock( - PlaceholderFactory::class, - [ - 'create' => $this->createMock(Placeholder::class) - ] - ), - ] - ); + $this->responseMock = $this->createMock(Response::class); } protected function tearDown() { - unset($this->model); + unset($this->mediaModel); } public function testProcessRequestCreatesConfigFileMediaDirectoryIsNotProvided() { - $objectManager = new ObjectManager($this); - $this->model = $objectManager->getObject( - \Magento\MediaStorage\App\Media::class, - [ - 'configFactory' => $this->configFactoryMock, - 'syncFactory' => $this->syncFactoryMock, - 'response' => $this->responseMock, - 'isAllowed' => $this->closure, - 'mediaDirectory' => false, - 'configCacheFile' => self::CACHE_FILE_PATH, - 'relativeFileName' => self::RELATIVE_FILE_PATH, - 'filesystem' => $this->filesystemMock - ] - ); + $this->mediaModel = $this->getMediaModel(); + $filePath = '/absolute/path/to/test/file.png'; $this->directoryMock->expects($this->any()) ->method('getAbsolutePath') @@ -158,11 +131,13 @@ public function testProcessRequestCreatesConfigFileMediaDirectoryIsNotProvided() ->with(self::RELATIVE_FILE_PATH) ->will($this->returnValue(true)); $this->responseMock->expects($this->once())->method('setFilePath')->with($filePath); - $this->model->launch(); + $this->mediaModel->launch(); } public function testProcessRequestReturnsFileIfItsProperlySynchronized() { + $this->mediaModel = $this->getMediaModel(); + $filePath = '/absolute/path/to/test/file.png'; $this->sync->expects($this->once())->method('synchronize')->with(self::RELATIVE_FILE_PATH); $this->directoryMock->expects($this->once()) @@ -178,11 +153,13 @@ public function testProcessRequestReturnsFileIfItsProperlySynchronized() ] )); $this->responseMock->expects($this->once())->method('setFilePath')->with($filePath); - $this->assertSame($this->responseMock, $this->model->launch()); + $this->assertSame($this->responseMock, $this->mediaModel->launch()); } public function testProcessRequestReturnsNotFoundIfFileIsNotSynchronized() { + $this->mediaModel = $this->getMediaModel(); + $this->sync->expects($this->once())->method('synchronize')->with(self::RELATIVE_FILE_PATH); $this->directoryMock->expects($this->once()) ->method('getAbsolutePath') @@ -192,7 +169,7 @@ public function testProcessRequestReturnsNotFoundIfFileIsNotSynchronized() ->method('isReadable') ->with(self::RELATIVE_FILE_PATH) ->will($this->returnValue(false)); - $this->assertSame($this->responseMock, $this->model->launch()); + $this->assertSame($this->responseMock, $this->mediaModel->launch()); } /** @@ -203,8 +180,12 @@ public function testProcessRequestReturnsNotFoundIfFileIsNotSynchronized() */ public function testCatchException($isDeveloper, $setBodyCalls) { - $bootstrap = $this->createMock(\Magento\Framework\App\Bootstrap::class); - $exception = $this->createMock(\Exception::class); + /** @var Bootstrap|MockObject $bootstrap */ + $bootstrap = $this->createMock(Bootstrap::class); + + /** @var Exception|MockObject $exception */ + $exception = $this->createMock(Exception::class); + $this->responseMock->expects($this->once()) ->method('setHttpResponseCode') ->with(404); @@ -215,7 +196,32 @@ public function testCatchException($isDeveloper, $setBodyCalls) ->method('setBody'); $this->responseMock->expects($this->once()) ->method('sendResponse'); - $this->model->catchException($bootstrap, $exception); + + $this->isAllowed = true; + $this->mediaModel = $this->getMediaModel(); + + $this->mediaModel->catchException($bootstrap, $exception); + } + + public function testExceptionWhenIsAllowedReturnsFalse() + { + $this->mediaModel = $this->getMediaModel(false); + + $filePath = '/absolute/path/to/test/file.png'; + $this->directoryMock->expects($this->any()) + ->method('getAbsolutePath') + ->will($this->returnValueMap( + [ + [null, self::MEDIA_DIRECTORY], + [self::RELATIVE_FILE_PATH, $filePath], + ] + )); + $this->configMock->expects($this->once())->method('save'); + + $this->expectException(LogicException::class); + $this->expectExceptionMessage('The path is not allowed: ' . self::RELATIVE_FILE_PATH); + + $this->mediaModel->launch(); } /** @@ -228,4 +234,42 @@ public function catchExceptionDataProvider() 'developer mode' => [true, 1], ]; } + + /** + * Generates Media class instance for test + * + * @param bool $isAllowed + * @return Media + */ + protected function getMediaModel(bool $isAllowed = true): Media + { + $objectManager = new ObjectManager($this); + + $isAllowedCallback = function () use ($isAllowed) { + return $isAllowed; + }; + + /** @var Media $mediaClass */ + $mediaClass = $objectManager->getObject( + Media::class, + [ + 'configFactory' => $this->configFactoryMock, + 'syncFactory' => $this->syncFactoryMock, + 'response' => $this->responseMock, + 'isAllowed' => $isAllowedCallback, + 'mediaDirectory' => false, + 'configCacheFile' => self::CACHE_FILE_PATH, + 'relativeFileName' => self::RELATIVE_FILE_PATH, + 'filesystem' => $this->filesystemMock, + 'placeholderFactory' => $this->createConfiguredMock( + PlaceholderFactory::class, + [ + 'create' => $this->createMock(Placeholder::class) + ] + ), + ] + ); + + return $mediaClass; + } } From 13f34cd6e15c0e1ce1b1183761d3ca4bfc318c22 Mon Sep 17 00:00:00 2001 From: Marco Oliveira <marcoaacoliveira@gmail.com> Date: Tue, 17 Dec 2019 15:14:50 -0300 Subject: [PATCH 384/586] Fixing #26083 --- app/code/Magento/Payment/Model/Info.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Payment/Model/Info.php b/app/code/Magento/Payment/Model/Info.php index 3b7f93be776ee..39a5a4cdc70a3 100644 --- a/app/code/Magento/Payment/Model/Info.php +++ b/app/code/Magento/Payment/Model/Info.php @@ -188,6 +188,7 @@ public function getAdditionalInformation($key = null) */ public function unsAdditionalInformation($key = null) { + $this->_initAdditionalInformation(); if ($key && isset($this->_additionalInformation[$key])) { unset($this->_additionalInformation[$key]); return $this->setData('additional_information', $this->_additionalInformation); From 8b7458e01f8c07a6f8de3718df318eb236366469 Mon Sep 17 00:00:00 2001 From: Denis Kopylov <dkopylov@magenius.team> Date: Tue, 17 Dec 2019 22:21:06 +0300 Subject: [PATCH 385/586] Resolve merge conflict for bug/wrong-behavior-of-grid-row-click --- .../Magento/Sales/view/adminhtml/web/order/create/scripts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js b/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js index a2be5fc735581..e138112ac3f5a 100644 --- a/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js +++ b/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js @@ -169,7 +169,7 @@ define([ }, selectAddress: function (el, container) { - id = el.value; + var id = el.value; if (id.length == 0) { id = '0'; } From 32227d2773836da0574db70fac8aad46ac0dad83 Mon Sep 17 00:00:00 2001 From: Marco Oliveira <marcoaacoliveira@gmail.com> Date: Tue, 17 Dec 2019 16:37:50 -0300 Subject: [PATCH 386/586] Removing an unnecessary , --- app/code/Magento/Payment/Model/Info.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Payment/Model/Info.php b/app/code/Magento/Payment/Model/Info.php index 39a5a4cdc70a3..3ca9b072e8321 100644 --- a/app/code/Magento/Payment/Model/Info.php +++ b/app/code/Magento/Payment/Model/Info.php @@ -38,7 +38,7 @@ class Info extends AbstractExtensibleModel implements InfoInterface * @param \Magento\Framework\Model\Context $context * @param \Magento\Framework\Registry $registry * @param \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory - * @param \Magento\Framework\Api\AttributeValueFactory $customAttributeFactory, + * @param \Magento\Framework\Api\AttributeValueFactory $customAttributeFactory * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Framework\Encryption\EncryptorInterface $encryptor * @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource From f6df6cd490cedf6f75d9800bd33ad357516091b5 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Tue, 17 Dec 2019 16:07:03 -0600 Subject: [PATCH 387/586] Change action groups name according to CE branch changes --- ...roductAttributeByAttributeCodeActionGroup.xml | 16 +++++----------- ...pdownProductAttributeFromAttributeSetTest.xml | 7 +++++-- .../Test/AdminDeleteProductAttributeTest.xml | 7 +++++-- ...FieldProductAttributeFromAttributeSetTest.xml | 7 +++++-- ...eteUsedInConfigurableProductAttributeTest.xml | 2 +- ...minCheckResultsOfColorAndOtherFiltersTest.xml | 4 ++-- ...frontElasticsearch6SearchInvalidValueTest.xml | 7 +++++-- ...AdminCartRulesAppliedForProductInCartTest.xml | 1 + ...roductWithAttributesImagesAndSwatchesTest.xml | 7 +++++-- 9 files changed, 34 insertions(+), 24 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByAttributeCodeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByAttributeCodeActionGroup.xml index 7fbf6a9b2a178..ddba6649161ef 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByAttributeCodeActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByAttributeCodeActionGroup.xml @@ -10,21 +10,15 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="DeleteProductAttributeByAttributeCodeActionGroup"> <annotations> - <description>Goes to the Admin Product Attributes grid page. Filters the grid for the provided Product Attribute Code. Deletes the Product Attribute from the grid. Validates that the Success Message is present.</description> + <description>Delete a Product Attribute from the Product Attribute creation/edit page.</description> </annotations> <arguments> - <argument name="ProductAttributeCode" type="string"/> + <argument name="productAttributeCode" type="string"/> </arguments> - <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> - <waitForPageLoad stepKey="waitForAttributeGridPageLoad"/> - <fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="{{ProductAttributeCode}}" stepKey="setAttributeCode"/> - <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/> - <click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="clickOnAttributeRow"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> + <waitForPageLoad stepKey="waitForViewAdminProductAttributeLoad" time="30"/> <click selector="{{AttributePropertiesSection.DeleteAttribute}}" stepKey="deleteAttribute"/> - <click selector="{{ModalConfirmationSection.OkButton}}" stepKey="ClickOnDeleteButton"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/> + <click selector="{{ModalConfirmationSection.OkButton}}" stepKey="clickOnConfirmOk"/> + <waitForPageLoad stepKey="waitForViewProductAttributePageLoad"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteDropdownProductAttributeFromAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteDropdownProductAttributeFromAttributeSetTest.xml index bded224a86563..3abe68a503b57 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteDropdownProductAttributeFromAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteDropdownProductAttributeFromAttributeSetTest.xml @@ -49,8 +49,11 @@ <waitForPageLoad stepKey="waitForPageToSave"/> <see userInput="You saved the attribute set" selector="{{AdminMessagesSection.success}}" stepKey="successMessage"/> <!--Delete product attribute from product attribute grid --> - <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttribute"> - <argument name="ProductAttributeCode" value="$$attribute.attribute_code$$"/> + <actionGroup ref="OpenProductAttributeFromSearchResultInGridActionGroup" stepKey="openProductAttributeFromSearchResultInGrid"> + <argument name="productAttributeCode" value="$$attribute.attribute_code$$"/> + </actionGroup> + <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttributeByAttributeCode"> + <argument name="productAttributeCode" value="$$attribute.attribute_code$$"/> </actionGroup> <actionGroup ref="AssertProductAttributeRemovedSuccessfullyActionGroup" stepKey="deleteProductAttributeSuccess"/> <!--Confirm Attribute is not present in Product Attribute Grid --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductAttributeTest.xml index f81b05c61a669..4060182a9bace 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductAttributeTest.xml @@ -24,8 +24,11 @@ <after> <actionGroup ref="logout" stepKey="logout"/> </after> - <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttribute"> - <argument name="ProductAttributeCode" value="$$createProductAttribute.attribute_code$$"/> + <actionGroup ref="OpenProductAttributeFromSearchResultInGridActionGroup" stepKey="openProductAttributeFromSearchResultInGrid"> + <argument name="productAttributeCode" value="$$createProductAttribute.attribute_code$$"/> + </actionGroup> + <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttributeByAttributeCode"> + <argument name="productAttributeCode" value="$$createProductAttribute.attribute_code$$"/> </actionGroup> <actionGroup ref="AssertProductAttributeRemovedSuccessfullyActionGroup" stepKey="deleteProductAttributeSuccess"/> <!-- Assert the product attribute is not in the grid by Attribute code --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteTextFieldProductAttributeFromAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteTextFieldProductAttributeFromAttributeSetTest.xml index f5fc104fa2b8d..4f05c364fda0e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteTextFieldProductAttributeFromAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteTextFieldProductAttributeFromAttributeSetTest.xml @@ -55,8 +55,11 @@ <waitForPageLoad stepKey="waitForProductToLoad"/> <seeElement selector="{{AdminProductFormSection.newAddedAttribute($$attribute.attribute_code$$)}}" stepKey="seeProductAttributeIsAdded"/> <!--Delete product attribute from product attribute grid --> - <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttribute"> - <argument name="ProductAttributeCode" value="$$attribute.attribute_code$$"/> + <actionGroup ref="OpenProductAttributeFromSearchResultInGridActionGroup" stepKey="openProductAttributeFromSearchResultInGrid"> + <argument name="productAttributeCode" value="$$attribute.attribute_code$$"/> + </actionGroup> + <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttributeByAttributeCode"> + <argument name="productAttributeCode" value="$$attribute.attribute_code$$"/> </actionGroup> <actionGroup ref="AssertProductAttributeRemovedSuccessfullyActionGroup" stepKey="deleteProductAttributeSuccess"/> <!-- Confirm attribute is not present in product attribute grid --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/DeleteUsedInConfigurableProductAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/DeleteUsedInConfigurableProductAttributeTest.xml index 6706175a4da54..0daf8361ef9d1 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/DeleteUsedInConfigurableProductAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/DeleteUsedInConfigurableProductAttributeTest.xml @@ -81,7 +81,7 @@ <!-- Click Delete Attribute button --> <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttributeByAttributeCode"> - <argument name="ProductAttributeCode" value="$$productAttributeHandle.attribute_code$$"/> + <argument name="productAttributeCode" value="$$productAttributeHandle.attribute_code$$"/> </actionGroup> <!-- Should see error message: This attribute is used in configurable products. --> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml index 826718de80d5b..fabd4a2c253b6 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml @@ -95,14 +95,14 @@ <argument name="productAttributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> </actionGroup> <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttributeByAttributeCode"> - <argument name="ProductAttributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> + <argument name="productAttributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> </actionGroup> <!-- Delete Second attribute --> <actionGroup ref="OpenProductAttributeFromSearchResultInGridActionGroup" stepKey="openSecondProductAttributeFromSearchResultInGrid"> <argument name="productAttributeCode" value="$$createConfigProductAttribute2.attribute_code$$"/> </actionGroup> <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteSecondProductAttributeByAttributeCode"> - <argument name="ProductAttributeCode" value="$$createConfigProductAttribute2.attribute_code$$"/> + <argument name="productAttributeCode" value="$$createConfigProductAttribute2.attribute_code$$"/> </actionGroup> <actionGroup ref="AssertProductAttributeRemovedSuccessfullyActionGroup" stepKey="deleteProductAttributeSuccess"/> <!-- Clear filters --> diff --git a/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearch6SearchInvalidValueTest.xml b/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearch6SearchInvalidValueTest.xml index 1d171664a21f2..050ce1263d10d 100644 --- a/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearch6SearchInvalidValueTest.xml +++ b/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearch6SearchInvalidValueTest.xml @@ -34,8 +34,11 @@ <magentoCLI command="config:set {{SetMinQueryLength3Config.path}} {{SetMinQueryLength3Config.value}}" stepKey="setMinQueryLengthPreviousState"/> <!--Delete created data--> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> - <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttribute"> - <argument name="ProductAttributeCode" value="{{textProductAttribute.attribute_code}}"/> + <actionGroup ref="OpenProductAttributeFromSearchResultInGridActionGroup" stepKey="openProductAttributeFromSearchResultInGrid"> + <argument name="productAttributeCode" value="{{textProductAttribute.attribute_code}}"/> + </actionGroup> + <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttributeByAttributeCode"> + <argument name="productAttributeCode" value="{{textProductAttribute.attribute_code}}"/> </actionGroup> <actionGroup ref="AssertProductAttributeRemovedSuccessfullyActionGroup" stepKey="deleteProductAttributeSuccess"/> <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml index e493ea389f389..916416dcd9141 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml @@ -99,6 +99,7 @@ <!--Go to Storefront and add product to cart and checkout from cart--> <amOnPage url="{{StorefrontProductPage.url($$simpleProduct.custom_attributes[url_key]$$)}}" stepKey="goToProductPage"/> + <waitForPageLoad stepKey="waitForProductPage" /> <fillField selector="{{StorefrontProductActionSection.quantity}}" userInput="2" stepKey="setQuantity"/> <actionGroup ref="StorefrontAddToCartCustomOptionsProductPageActionGroup" stepKey="AddProductToCard"> <argument name="productName" value="$$simpleProduct.name$$"/> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml index a9e70193dd876..d034faeefbdc0 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml @@ -59,8 +59,11 @@ </before> <after> <!-- Delete product attribute and clear grid filter --> - <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttribute"> - <argument name="ProductAttributeCode" value="{{VisualSwatchProductAttribute.attribute_code}}"/> + <actionGroup ref="OpenProductAttributeFromSearchResultInGridActionGroup" stepKey="openProductAttributeFromSearchResultInGrid"> + <argument name="productAttributeCode" value="{{VisualSwatchProductAttribute.attribute_code}}"/> + </actionGroup> + <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttributeByAttributeCode"> + <argument name="productAttributeCode" value="{{VisualSwatchProductAttribute.attribute_code}}"/> </actionGroup> <actionGroup ref="AssertProductAttributeRemovedSuccessfullyActionGroup" stepKey="deleteProductAttributeSuccess"/> <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearAttributesGridFilter"/> From 7c6bbe36676a453c567b7928c5ad434d02ec0d98 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Tue, 17 Dec 2019 16:40:15 -0600 Subject: [PATCH 388/586] Change action groups name according to CE branch changes --- .../Test/Mftf/Test/AdminVirtualSetEditRelatedProductsTest.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualSetEditRelatedProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualSetEditRelatedProductsTest.xml index a8d8face1a1e6..f70f5757ec5c2 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualSetEditRelatedProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualSetEditRelatedProductsTest.xml @@ -17,6 +17,9 @@ <severity value="CRITICAL"/> <testCaseId value="MC-3415"/> <group value="Catalog"/> + <skip> + <issueId value="MC-194"/> + </skip> </annotations> <before></before> <after> From a77faf33bff263f273de6942f2c495676364df17 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Wed, 18 Dec 2019 07:51:37 +0700 Subject: [PATCH 389/586] Refactor code to pass review --- .../Listing/Column/SynonymActionsTest.php | 51 ++++++++++++++----- 1 file changed, 39 insertions(+), 12 deletions(-) diff --git a/app/code/Magento/Search/Test/Unit/Ui/Component/Listing/Column/SynonymActionsTest.php b/app/code/Magento/Search/Test/Unit/Ui/Component/Listing/Column/SynonymActionsTest.php index 7ba1eab0437f0..d5563ec1cb289 100644 --- a/app/code/Magento/Search/Test/Unit/Ui/Component/Listing/Column/SynonymActionsTest.php +++ b/app/code/Magento/Search/Test/Unit/Ui/Component/Listing/Column/SynonymActionsTest.php @@ -16,6 +16,21 @@ class SynonymActionsTest extends TestCase { + /** + * Stub synonym group id + */ + private const STUB_SYNONYM_GROUP_ID = 1; + + /** + * Synonym group delete url + */ + private const SYNONYM_GROUP_DELETE_URL = 'http://localhost/magento2/admin/search/synonyms/delete/group_id/%d'; + + /** + * Synonym group edit url + */ + private const SYNONYM_GROUP_EDIT_URL = 'http://localhost/magento2/admin/search/synonyms/edit/group_id/%d'; + /** * @var SynonymActions */ @@ -72,31 +87,38 @@ public function testPrepareDataSourceWithItems() 'data' => [ 'items' => [ [ - 'group_id' => 1 + 'group_id' => self::STUB_SYNONYM_GROUP_ID ] ] ] ]; + $expected = [ 'data' => [ 'items' => [ [ - 'group_id' => 1, + 'group_id' => self::STUB_SYNONYM_GROUP_ID, 'actions' => [ 'delete' => [ - 'href' => 'http://localhost/magento2/admin/search/synonyms/delete/group_id/1', + 'href' => sprintf( + self::SYNONYM_GROUP_DELETE_URL, + self::STUB_SYNONYM_GROUP_ID + ), 'label' => (string)__('Delete'), 'confirm' => [ 'title' => (string)__('Delete'), 'message' => (string)__( 'Are you sure you want to delete synonym group with id: %1?', - 1 + self::STUB_SYNONYM_GROUP_ID ) ], '__disableTmpl' => true ], 'edit' => [ - 'href' => 'http://localhost/magento2/admin/search/synonyms/edit/group_id/1', + 'href' => sprintf( + self::SYNONYM_GROUP_EDIT_URL, + self::STUB_SYNONYM_GROUP_ID + ), 'label' => (string)__('View/Edit'), '__disableTmpl' => true ] @@ -106,13 +128,18 @@ public function testPrepareDataSourceWithItems() ] ]; - $this->urlBuilderMock->expects($this->at(0))->method('getUrl') - ->with(SynonymActions::SYNONYM_URL_PATH_DELETE, ['group_id' => 1]) - ->willReturn('http://localhost/magento2/admin/search/synonyms/delete/group_id/1'); - - $this->urlBuilderMock->expects($this->at(1))->method('getUrl') - ->with(SynonymActions::SYNONYM_URL_PATH_EDIT, ['group_id' => 1]) - ->willReturn('http://localhost/magento2/admin/search/synonyms/edit/group_id/1'); + $this->urlBuilderMock->method('getUrl')->will( + $this->returnValueMap([ + [ + SynonymActions::SYNONYM_URL_PATH_DELETE, ['group_id' => self::STUB_SYNONYM_GROUP_ID], + sprintf(self::SYNONYM_GROUP_DELETE_URL, self::STUB_SYNONYM_GROUP_ID) + ], + [ + SynonymActions::SYNONYM_URL_PATH_EDIT, ['group_id' => self::STUB_SYNONYM_GROUP_ID], + sprintf(self::SYNONYM_GROUP_EDIT_URL, self::STUB_SYNONYM_GROUP_ID) + ] + ]) + ); /** * Assert Result From 85036fa5f76417765a42d66ebb50a93de00e8532 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Wed, 18 Dec 2019 09:00:55 +0700 Subject: [PATCH 390/586] Refactor code to pass review --- ...sEventOrderItemToQuoteItemObserverTest.php | 153 +++++++++++------- 1 file changed, 91 insertions(+), 62 deletions(-) diff --git a/app/code/Magento/GiftMessage/Test/Unit/Observer/SalesEventOrderItemToQuoteItemObserverTest.php b/app/code/Magento/GiftMessage/Test/Unit/Observer/SalesEventOrderItemToQuoteItemObserverTest.php index 1df1c1101ccd1..5ac75caa4b512 100644 --- a/app/code/Magento/GiftMessage/Test/Unit/Observer/SalesEventOrderItemToQuoteItemObserverTest.php +++ b/app/code/Magento/GiftMessage/Test/Unit/Observer/SalesEventOrderItemToQuoteItemObserverTest.php @@ -93,7 +93,10 @@ class SalesEventOrderItemToQuoteItemObserverTest extends TestCase */ public function setUp(): void { - $this->messageFactoryMock = $this->createMock(MessageFactory::class); + $this->messageFactoryMock = $this->getMockBuilder(MessageFactory::class) + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); $this->giftMessageHelperMock = $this->createMock(MessageHelper::class); $this->observerMock = $this->createMock(Observer::class); $this->eventMock = $this->createPartialMock(Event::class, ['getOrderItem', 'getQuoteItem']); @@ -106,6 +109,18 @@ public function setUp(): void $this->storeMock = $this->createMock(Store::class); $this->messageMock = $this->createMock(MessageModel::class); + $this->eventMock->expects($this->atLeastOnce()) + ->method('getOrderItem') + ->willReturn($this->orderItemMock); + + $this->orderItemMock->expects($this->atLeastOnce()) + ->method('getOrder') + ->willReturn($this->orderMock); + + $this->observerMock->expects($this->atLeastOnce()) + ->method('getEvent') + ->willReturn($this->eventMock); + $objectManager = new ObjectManager($this); $this->observer = $objectManager->getObject( @@ -118,79 +133,93 @@ public function setUp(): void } /** - * Tests duplicating gift message from order item to quote item - * - * @param bool $orderIsReordered - * @param bool $isMessagesAllowed - * @dataProvider giftMessageDataProvider + * Test when the order is reorder */ - public function testExecute($orderIsReordered, $isMessagesAllowed) + public function testReorder() { - $this->eventMock->expects($this->atLeastOnce()) - ->method('getOrderItem') - ->willReturn($this->orderItemMock); + $this->orderMock->expects($this->once()) + ->method('getReordered') + ->willReturn(true); - $this->orderItemMock->expects($this->atLeastOnce()) - ->method('getOrder') - ->willReturn($this->orderMock); + $this->giftMessageHelperMock->expects($this->never()) + ->method('isMessagesAllowed'); - $this->observerMock->expects($this->atLeastOnce()) - ->method('getEvent') - ->willReturn($this->eventMock); + $this->eventMock + ->expects($this->never()) + ->method('getQuoteItem') + ->willReturn($this->quoteItemMock); + + /** Run observer */ + $this->observer->execute($this->observerMock); + } - if (!$orderIsReordered && $isMessagesAllowed) { - $this->eventMock - ->expects($this->atLeastOnce()) - ->method('getQuoteItem') - ->willReturn($this->quoteItemMock); - $this->orderMock->expects($this->once()) - ->method('getReordered') - ->willReturn($orderIsReordered); - $this->orderItemMock->expects($this->once()) - ->method('getGiftMessageId') - ->willReturn(self::STUB_MESSAGE_ID); - $this->giftMessageHelperMock->expects($this->once()) - ->method('isMessagesAllowed') - ->willReturn($isMessagesAllowed); - $this->messageFactoryMock->expects($this->once()) - ->method('create') - ->willReturn($this->messageMock); - $this->messageMock->expects($this->once()) - ->method('load') - ->with(self::STUB_MESSAGE_ID) - ->willReturnSelf(); - $this->messageMock->expects($this->once()) - ->method('setId') - ->with(null) - ->willReturnSelf(); - $this->messageMock->expects($this->once()) - ->method('save') - ->willReturnSelf(); - $this->messageMock->expects($this->once()) - ->method('getId') - ->willReturn(self::STUB_NEW_MESSAGE_ID); - $this->quoteItemMock->expects($this->once()) - ->method('setGiftMessageId') - ->with(self::STUB_NEW_MESSAGE_ID) - ->willReturnSelf(); - } + /** + * Test when the order is new reorder and gift message is not allowed + */ + public function testNewOrderWhenGiftMessageIsNotAllowed() + { + $this->orderMock->expects($this->once()) + ->method('getReordered') + ->willReturn(false); + + $this->giftMessageHelperMock->expects($this->once()) + ->method('isMessagesAllowed') + ->willReturn(false); + + $this->eventMock + ->expects($this->never()) + ->method('getQuoteItem') + ->willReturn($this->quoteItemMock); /** Run observer */ $this->observer->execute($this->observerMock); } /** - * Providing gift message data for test - * - * @return array + * Test when the order is new reorder and gift message is allowed */ - public function giftMessageDataProvider() + public function testNewOrderWhenGiftMessageIsAllowed() { - return [ - 'order is not reordered, messages is allowed' => [false, true], - 'order is reordered, messages is allowed' => [true, true], - 'order is reordered, messages is not allowed' => [true, false], - 'order is not reordered, messages is not allowed' => [false, false] - ]; + $this->orderMock->expects($this->once()) + ->method('getReordered') + ->willReturn(false); + + $this->giftMessageHelperMock->expects($this->once()) + ->method('isMessagesAllowed') + ->willReturn(true); + + $this->eventMock + ->expects($this->atLeastOnce()) + ->method('getQuoteItem') + ->willReturn($this->quoteItemMock); + + $this->orderItemMock->expects($this->once()) + ->method('getGiftMessageId') + ->willReturn(self::STUB_MESSAGE_ID); + + $this->messageFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($this->messageMock); + $this->messageMock->expects($this->once()) + ->method('load') + ->with(self::STUB_MESSAGE_ID) + ->willReturnSelf(); + $this->messageMock->expects($this->once()) + ->method('setId') + ->with(null) + ->willReturnSelf(); + $this->messageMock->expects($this->once()) + ->method('save') + ->willReturnSelf(); + $this->messageMock->expects($this->once()) + ->method('getId') + ->willReturn(self::STUB_NEW_MESSAGE_ID); + $this->quoteItemMock->expects($this->once()) + ->method('setGiftMessageId') + ->with(self::STUB_NEW_MESSAGE_ID) + ->willReturnSelf(); + + /** Run observer */ + $this->observer->execute($this->observerMock); } } From b92c9aacc8d2ff658c197bbbcb924c8fb16f9fd3 Mon Sep 17 00:00:00 2001 From: pawankparmar <comp1@comp1-All-Series> Date: Wed, 18 Dec 2019 10:42:28 +0530 Subject: [PATCH 391/586] Remove extra spaces --- .../FormattedPriceInfoInterface.php | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/app/code/Magento/Catalog/Api/Data/ProductRender/FormattedPriceInfoInterface.php b/app/code/Magento/Catalog/Api/Data/ProductRender/FormattedPriceInfoInterface.php index 5f192dcd98a17..65ff84ef719f0 100644 --- a/app/code/Magento/Catalog/Api/Data/ProductRender/FormattedPriceInfoInterface.php +++ b/app/code/Magento/Catalog/Api/Data/ProductRender/FormattedPriceInfoInterface.php @@ -23,7 +23,7 @@ interface FormattedPriceInfoInterface extends \Magento\Framework\Api\ExtensibleD * Retrieve html with final price * * @return string - * @since 101.1.0 + * @since 101.1.0 */ public function getFinalPrice(); @@ -31,9 +31,9 @@ public function getFinalPrice(); * Set the final price: usually it calculated as minimal price of the product * Can be different depends on type of product * - * @param string $finalPrice + * @param string $finalPrice * @return void - * @since 101.1.0 + * @since 101.1.0 */ public function setFinalPrice($finalPrice); @@ -42,16 +42,16 @@ public function setFinalPrice($finalPrice); * E.g. for product with custom options is price with the most expensive custom option * * @return string - * @since 101.1.0 + * @since 101.1.0 */ public function getMaxPrice(); /** * Set the max price of the product * - * @param string $maxPrice + * @param string $maxPrice * @return void - * @since 101.1.0 + * @since 101.1.0 */ public function setMaxPrice($maxPrice); @@ -60,7 +60,7 @@ public function setMaxPrice($maxPrice); * The minimal price is for example, the lowest price of all variations for complex product * * @return string - * @since 101.1.0 + * @since 101.1.0 */ public function getMinimalPrice(); @@ -69,9 +69,9 @@ public function getMinimalPrice(); * Max regular price is the same, as maximum price, except of excluding calculating special price and catalog rules * in it * - * @param string $maxRegularPrice + * @param string $maxRegularPrice * @return void - * @since 101.1.0 + * @since 101.1.0 */ public function setMaxRegularPrice($maxRegularPrice); @@ -79,16 +79,16 @@ public function setMaxRegularPrice($maxRegularPrice); * Retrieve max regular price * * @return string - * @since 101.1.0 + * @since 101.1.0 */ public function getMaxRegularPrice(); /** * The minimal regular price has the same behavior of calculation as max regular price, but is opposite price * - * @param string $minRegularPrice + * @param string $minRegularPrice * @return void - * @since 101.1.0 + * @since 101.1.0 */ public function setMinimalRegularPrice($minRegularPrice); @@ -96,7 +96,7 @@ public function setMinimalRegularPrice($minRegularPrice); * Retrieve minimal regular price * * @return string - * @since 101.1.0 + * @since 101.1.0 */ public function getMinimalRegularPrice(); @@ -105,9 +105,9 @@ public function getMinimalRegularPrice(); * * Special price - is temporary price, that can be set to specific product * - * @param string $specialPrice + * @param string $specialPrice * @return void - * @since 101.1.0 + * @since 101.1.0 */ public function setSpecialPrice($specialPrice); @@ -115,16 +115,16 @@ public function setSpecialPrice($specialPrice); * Retrieve special price * * @return string - * @since 101.1.0 + * @since 101.1.0 */ public function getSpecialPrice(); /** * Set minimal price * - * @param string $minimalPrice + * @param string $minimalPrice * @return void - * @since 101.1.0 + * @since 101.1.0 */ public function setMinimalPrice($minimalPrice); @@ -133,16 +133,16 @@ public function setMinimalPrice($minimalPrice); * Usually this price is corresponding to price in admin panel of product * * @return string - * @since 101.1.0 + * @since 101.1.0 */ public function getRegularPrice(); /** * Set regular price * - * @param string $regularPrice + * @param string $regularPrice * @return void - * @since 101.1.0 + * @since 101.1.0 */ public function setRegularPrice($regularPrice); @@ -150,18 +150,18 @@ public function setRegularPrice($regularPrice); * Retrieve existing extension attributes object or create a new one. * * @return \Magento\Catalog\Api\Data\ProductRender\FormattedPriceInfoExtensionInterface|null - * @since 101.1.0 + * @since 101.1.0 */ public function getExtensionAttributes(); /** * Set an extension attributes object. * - * @param \Magento\Catalog\Api\Data\ProductRender\FormattedPriceInfoExtensionInterface $extensionAttributes + * @param \Magento\Catalog\Api\Data\ProductRender\FormattedPriceInfoExtensionInterface $extensionAttributes * @return $this - * @since 101.1.0 + * @since 101.1.0 */ public function setExtensionAttributes( \Magento\Catalog\Api\Data\ProductRender\FormattedPriceInfoExtensionInterface $extensionAttributes ); -} \ No newline at end of file +} From d2a4865fee168c7b0e143346609f729b13e1c8bc Mon Sep 17 00:00:00 2001 From: Grzegorz Bogusz <grzegorz.bogusz@creativestyle.pl> Date: Wed, 18 Dec 2019 06:58:02 +0100 Subject: [PATCH 392/586] Added @SuppressWarnings(PHPMD.CookieAndSessionMisuse) to Text class --- app/code/Magento/Catalog/Model/Product/Option/Type/Text.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/Magento/Catalog/Model/Product/Option/Type/Text.php b/app/code/Magento/Catalog/Model/Product/Option/Type/Text.php index 10584026b3218..71a6556dc8858 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/Type/Text.php +++ b/app/code/Magento/Catalog/Model/Product/Option/Type/Text.php @@ -10,6 +10,8 @@ /** * Catalog product option text type + * + * @SuppressWarnings(PHPMD.CookieAndSessionMisuse) */ class Text extends \Magento\Catalog\Model\Product\Option\Type\DefaultType { From 6e68a470c5ed94ba4f1cd9a031fc81e5b99907fd Mon Sep 17 00:00:00 2001 From: Grzegorz Bogusz <grzegorz.bogusz@creativestyle.pl> Date: Wed, 18 Dec 2019 07:03:13 +0100 Subject: [PATCH 393/586] Organized imports in test class --- .../Magento/Catalog/Model/Product/Option/Type/TextTest.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/TextTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/TextTest.php index 194c0eb85a59e..74082c339bd79 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/TextTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/TextTest.php @@ -7,10 +7,9 @@ namespace Magento\Catalog\Model\Product\Option\Type; use Magento\Catalog\Model\Product\Option; -use Magento\Tests\NamingConvention\true\mixed; -use PHPUnit\Framework\TestCase; use Magento\Framework\ObjectManagerInterface; use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; /** * Test for customizable product option with "Text" type From e830f2e93ffb37a48d149ad4f4a3a18bcbe218a4 Mon Sep 17 00:00:00 2001 From: divyajyothi5321 <54176640+divyajyothi5321@users.noreply.github.com> Date: Wed, 18 Dec 2019 12:37:36 +0530 Subject: [PATCH 394/586] Added requested Changes --- app/code/Magento/Wishlist/Controller/Index/Send.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/Wishlist/Controller/Index/Send.php b/app/code/Magento/Wishlist/Controller/Index/Send.php index 1ff4e3a653a2d..f0bd2c4b4b37c 100644 --- a/app/code/Magento/Wishlist/Controller/Index/Send.php +++ b/app/code/Magento/Wishlist/Controller/Index/Send.php @@ -27,7 +27,6 @@ /** * Class Send * - * @package Magento\Wishlist\Controller\Index * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class Send extends \Magento\Wishlist\Controller\AbstractIndex implements Action\HttpPostActionInterface From b2a3277a89d1fc1007e9afd25ebfa83e012f662a Mon Sep 17 00:00:00 2001 From: Mykhailo Matiola <mykhailo.matiola@transoftgroup.com> Date: Wed, 18 Dec 2019 09:23:11 +0200 Subject: [PATCH 395/586] MC-25192: Sorting products in category page --- .../Block/Product/ListProduct/SortingTest.php | 321 ++++++++++++++++++ ...not_empty_layered_navigation_attribute.php | 49 +++ ..._layered_navigation_attribute_rollback.php | 8 + 3 files changed, 378 insertions(+) create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/Block/Product/ListProduct/SortingTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_not_empty_layered_navigation_attribute.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_not_empty_layered_navigation_attribute_rollback.php diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/ListProduct/SortingTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/ListProduct/SortingTest.php new file mode 100644 index 0000000000000..d3c7972453a4b --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/ListProduct/SortingTest.php @@ -0,0 +1,321 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Block\Product\ListProduct; + +use Magento\Catalog\Api\CategoryRepositoryInterface; +use Magento\Catalog\Api\Data\CategoryInterface; +use Magento\Catalog\Block\Product\ListProduct; +use Magento\Catalog\Block\Product\ProductList\Toolbar; +use Magento\Catalog\Model\Config; +use Magento\Catalog\Model\ResourceModel\Category\Collection; +use Magento\Catalog\Model\ResourceModel\Category\CollectionFactory; +use Magento\Framework\App\Config\MutableScopeConfigInterface; +use Magento\Framework\ObjectManagerInterface; +use Magento\Framework\View\LayoutInterface; +use Magento\Store\Model\ScopeInterface; +use Magento\Store\Model\Store; +use Magento\Store\Model\StoreManagerInterface; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; + +/** + * Tests for products sorting on category page. + * + * @magentoDbIsolation disabled + * @magentoAppIsolation enabled + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ +class SortingTest extends TestCase +{ + /** + * @var ObjectManagerInterface + */ + private $objectManager; + + /** + * @var ListProduct + */ + private $block; + + /** + * @var CollectionFactory + */ + private $categoryCollectionFactory; + + /** + * @var CategoryRepositoryInterface + */ + private $categoryRepository; + + /** + * @var StoreManagerInterface + */ + private $storeManager; + + /** + * @var LayoutInterface + */ + private $layout; + + /** + * @var MutableScopeConfigInterface + */ + private $scopeConfig; + + /** + * @inheritdoc + */ + protected function setUp() + { + $this->objectManager = Bootstrap::getObjectManager(); + $this->storeManager = $this->objectManager->get(StoreManagerInterface::class); + $this->layout = $this->objectManager->get(LayoutInterface::class); + $this->layout->createBlock(Toolbar::class, 'product_list_toolbar'); + $this->block = $this->layout->createBlock(ListProduct::class)->setToolbarBlockName('product_list_toolbar'); + $this->categoryCollectionFactory = $this->objectManager->get(CollectionFactory::class); + $this->categoryRepository = $this->objectManager->get(CategoryRepositoryInterface::class); + $this->scopeConfig = $this->objectManager->get(MutableScopeConfigInterface::class); + parent::setUp(); + } + + /** + * @magentoDataFixture Magento/Catalog/_files/products_with_not_empty_layered_navigation_attribute.php + * @dataProvider productListSortOrderDataProvider + * @param string $sortBy + * @param string $direction + * @param array $expectation + * @return void + */ + public function testProductListSortOrder(string $sortBy, string $direction, array $expectation): void + { + $category = $this->updateCategorySortBy('Category 1', Store::DEFAULT_STORE_ID, $sortBy); + $this->renderBlock($category, $direction); + $this->assertBlockSorting($sortBy, $expectation); + } + + /** + * @magentoDataFixture Magento/Catalog/_files/products_with_not_empty_layered_navigation_attribute.php + * @dataProvider productListSortOrderDataProvider + * @param string $sortBy + * @param string $direction + * @param array $expectation + * @return void + */ + public function testProductListSortOrderWithConfig(string $sortBy, string $direction, array $expectation): void + { + $this->objectManager->removeSharedInstance(Config::class); + $this->scopeConfig->setValue( + Config::XML_PATH_LIST_DEFAULT_SORT_BY, + $sortBy, + ScopeInterface::SCOPE_STORE, + Store::DEFAULT_STORE_ID + ); + $category = $this->updateCategorySortBy('Category 1', Store::DEFAULT_STORE_ID, null); + $this->renderBlock($category, $direction); + $this->assertBlockSorting($sortBy, $expectation); + } + + /** + * @return array + */ + public function productListSortOrderDataProvider(): array + { + return [ + 'default_order_price_asc' => [ + 'sort' => 'price', + 'direction' => 'asc', + 'expectation' => ['simple1', 'simple2', 'simple3'], + ], + 'default_order_price_desc' => [ + 'sort' => 'price', + 'direction' => 'desc', + 'expectation' => ['simple3', 'simple2', 'simple1'], + ], + 'default_order_position_asc' => [ + 'sort' => 'position', + 'direction' => 'asc', + 'expectation' => ['simple1', 'simple2', 'simple3'], + ], + 'default_order_position_desc' => [ + 'sort' => 'position', + 'direction' => 'desc', + 'expectation' => ['simple3', 'simple2', 'simple1'], + ], + 'default_order_name_asc' => [ + 'sort' => 'name', + 'direction' => 'asc', + 'expectation' => ['simple1', 'simple2', 'simple3'], + ], + 'default_order_name_desc' => [ + 'sort' => 'name', + 'direction' => 'desc', + 'expectation' => ['simple3', 'simple2', 'simple1'], + ], + 'default_order_custom_attribute_asc' => [ + 'sort' => 'test_configurable', + 'direction' => 'asc', + 'expectation' => ['simple1', 'simple3', 'simple2'], + ], + 'default_order_custom_attribute_desc' => [ + 'sort' => 'test_configurable', + 'direction' => 'desc', + 'expectation' => ['simple3', 'simple2', 'simple1'], + ], + ]; + } + + /** + * @magentoDataFixture Magento/Store/_files/second_store.php + * @magentoDataFixture Magento/Catalog/_files/products_with_not_empty_layered_navigation_attribute.php + * @dataProvider productListSortOrderDataProviderOnStoreView + * @param string $sortBy + * @param string $direction + * @param array $expectation + * @param string $defaultSortBy + * @return void + */ + public function testProductListSortOrderOnStoreView( + string $sortBy, + string $direction, + array $expectation, + string $defaultSortBy + ): void { + $secondStoreId = (int)$this->storeManager->getStore('fixture_second_store')->getId(); + $this->updateCategorySortBy('Category 1', Store::DEFAULT_STORE_ID, $defaultSortBy); + $category = $this->updateCategorySortBy('Category 1', $secondStoreId, $sortBy); + $this->renderBlock($category, $direction); + $this->assertBlockSorting($sortBy, $expectation); + } + + /** + * @magentoDataFixture Magento/Store/_files/second_store.php + * @magentoDataFixture Magento/Catalog/_files/products_with_not_empty_layered_navigation_attribute.php + * @dataProvider productListSortOrderDataProviderOnStoreView + * @param string $sortBy + * @param string $direction + * @param array $expectation + * @param string $defaultSortBy + * @return void + */ + public function testProductListSortOrderWithConfigOnStoreView( + string $sortBy, + string $direction, + array $expectation, + string $defaultSortBy + ): void { + $this->objectManager->removeSharedInstance(Config::class); + $secondStoreId = (int)$this->storeManager->getStore('fixture_second_store')->getId(); + $this->scopeConfig->setValue( + Config::XML_PATH_LIST_DEFAULT_SORT_BY, + $defaultSortBy, + ScopeInterface::SCOPE_STORE, + Store::DEFAULT_STORE_ID + ); + $this->scopeConfig->setValue( + Config::XML_PATH_LIST_DEFAULT_SORT_BY, + $sortBy, + ScopeInterface::SCOPE_STORE, + 'fixture_second_store' + ); + $this->updateCategorySortBy('Category 1', Store::DEFAULT_STORE_ID, null); + $category = $this->updateCategorySortBy('Category 1', $secondStoreId, null); + $this->renderBlock($category, $direction); + $this->assertBlockSorting($sortBy, $expectation); + } + + /** + * @return array + */ + public function productListSortOrderDataProviderOnStoreView(): array + { + return array_merge_recursive( + $this->productListSortOrderDataProvider(), + [ + 'default_order_price_asc' => ['default_sort' => 'position'], + 'default_order_price_desc' => ['default_sort' => 'position'], + 'default_order_position_asc' => ['default_sort' => 'price'], + 'default_order_position_desc' => ['default_sort' => 'price'], + 'default_order_name_asc' => ['default_sort' => 'price'], + 'default_order_name_desc' => ['default_sort' => 'price'], + 'default_order_custom_attribute_asc' => ['default_sort' => 'price'], + 'default_order_custom_attribute_desc' => ['default_sort' => 'price'], + ] + ); + } + + /** + * Renders block to apply sorting. + * + * @param CategoryInterface $category + * @param string $direction + * @return void + */ + private function renderBlock(CategoryInterface $category, string $direction): void + { + $this->block->getLayer()->setCurrentCategory($category); + $this->block->setDefaultDirection($direction); + $this->block->toHtml(); + } + + /** + * Checks product list block correct sorting. + * + * @param string $sortBy + * @param array $expectation + * @return void + */ + private function assertBlockSorting(string $sortBy, array $expectation): void + { + $this->assertArrayHasKey($sortBy, $this->block->getAvailableOrders()); + $this->assertEquals($sortBy, $this->block->getSortBy()); + $this->assertEquals($expectation, $this->block->getLoadedProductCollection()->getColumnValues('sku')); + } + + /** + * Loads category by name. + * + * @param string $categoryName + * @param int $storeId + * @return CategoryInterface + */ + private function loadCategory(string $categoryName, int $storeId): CategoryInterface + { + /** @var Collection $categoryCollection */ + $categoryCollection = $this->categoryCollectionFactory->create(); + $categoryId = $categoryCollection->setStoreId($storeId) + ->addAttributeToFilter(CategoryInterface::KEY_NAME, $categoryName) + ->setPageSize(1) + ->getFirstItem() + ->getId(); + + return $this->categoryRepository->get($categoryId, $storeId); + } + + /** + * Updates category default sort by field. + * + * @param string $categoryName + * @param int $storeId + * @param string|null $sortBy + * @return CategoryInterface + */ + private function updateCategorySortBy( + string $categoryName, + int $storeId, + ?string $sortBy + ): CategoryInterface { + $oldStoreId = $this->storeManager->getStore()->getId(); + $this->storeManager->setCurrentStore($storeId); + $category = $this->loadCategory($categoryName, $storeId); + $category->addData(['default_sort_by' => $sortBy]); + $category = $this->categoryRepository->save($category); + $this->storeManager->setCurrentStore($oldStoreId); + + return $category; + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_not_empty_layered_navigation_attribute.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_not_empty_layered_navigation_attribute.php new file mode 100644 index 0000000000000..16268e5d98dc0 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_not_empty_layered_navigation_attribute.php @@ -0,0 +1,49 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\CategoryRepositoryInterface; +use Magento\Catalog\Api\ProductAttributeRepositoryInterface; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Product\Attribute\Source\Status; +use Magento\Store\Model\Store; +use Magento\Store\Model\StoreManagerInterface; +use Magento\TestFramework\Helper\Bootstrap; + +require __DIR__ . '/products_with_layered_navigation_attribute.php'; + +$objectManager = Bootstrap::getObjectManager(); +/** @var StoreManagerInterface $storeManager */ +$storeManager = $objectManager->get(StoreManagerInterface::class); +/** @var ProductAttributeRepositoryInterface $attributeRepository */ +$attributeRepository = $objectManager->create(ProductAttributeRepositoryInterface::class); +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->create(ProductRepositoryInterface::class); +/** @var CategoryRepositoryInterface $categoryRepository */ +$categoryRepository = $objectManager->create(CategoryRepositoryInterface::class); +$attribute = $attributeRepository->get('test_configurable'); + +$firstProduct = $productRepository->get('simple1'); +$firstProduct->setData('test_configurable', $attribute->getSource()->getOptionId('Option 1')); +$productRepository->save($firstProduct); + +$secondProduct = $productRepository->get('simple2'); +$secondProduct->setData('test_configurable', $attribute->getSource()->getOptionId('Option 2')); +$productRepository->save($secondProduct); + +$thirdProduct = $productRepository->get('simple3'); +$thirdProduct->setData('test_configurable', $attribute->getSource()->getOptionId('Option 2')); +$thirdProduct->setStatus(Status::STATUS_ENABLED); +$productRepository->save($thirdProduct); + +$oldStoreId = $storeManager->getStore()->getId(); +$storeManager->setCurrentStore(Store::DEFAULT_STORE_ID); +$category->addData(['available_sort_by' => 'position,name,price,test_configurable']); +try { + $categoryRepository->save($category); +} finally { + $storeManager->setCurrentStore($oldStoreId); +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_not_empty_layered_navigation_attribute_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_not_empty_layered_navigation_attribute_rollback.php new file mode 100644 index 0000000000000..ae6dae0667801 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_not_empty_layered_navigation_attribute_rollback.php @@ -0,0 +1,8 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +require __DIR__ . '/products_with_layered_navigation_attribute_rollback.php'; From 0d220177689ce7ffbfcb29ed9316e46b708a02c5 Mon Sep 17 00:00:00 2001 From: divyajyothi5321 <54176640+divyajyothi5321@users.noreply.github.com> Date: Wed, 18 Dec 2019 13:53:30 +0530 Subject: [PATCH 396/586] Changes Added --- app/code/Magento/Wishlist/Controller/Index/Send.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Wishlist/Controller/Index/Send.php b/app/code/Magento/Wishlist/Controller/Index/Send.php index f0bd2c4b4b37c..b7c93473cde94 100644 --- a/app/code/Magento/Wishlist/Controller/Index/Send.php +++ b/app/code/Magento/Wishlist/Controller/Index/Send.php @@ -25,7 +25,7 @@ use Magento\Customer\Model\Customer; /** - * Class Send + * Class Send Email Wishlist Controller * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ From 652ac7f9859068cddb5172acca5b2e195d3c1195 Mon Sep 17 00:00:00 2001 From: Mykhailo Matiola <mykhailo.matiola@transoftgroup.com> Date: Wed, 18 Dec 2019 11:57:53 +0200 Subject: [PATCH 397/586] MC-25146: Layered Navigation with different product attributes on Catalog Search Results page --- .../Magento/Test/Php/_files/phpstan/blacklist/common.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/blacklist/common.txt b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/blacklist/common.txt index 34965bda0dba6..4ac0984238828 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/blacklist/common.txt +++ b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/blacklist/common.txt @@ -8,6 +8,7 @@ lib/internal/Magento/Framework/Cache/Backend/Eaccelerator.php dev/tests/integration/framework/deployTestModules.php dev/tests/integration/testsuite/Magento/Framework/Session/ConfigTest.php dev/tests/integration/testsuite/Magento/Framework/Session/SessionManagerTest.php +dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/AbstractFiltersTest.php dev/tests/api-functional/testsuite/Magento/Customer/Api/AddressRepositoryTest.php dev/tests/api-functional/testsuite/Magento/Framework/Model/Entity/HydratorTest.php dev/tests/api-functional/testsuite/Magento/Integration/Model/AdminTokenServiceTest.php From cc38f81c655b7287cd08c111838fb52df1a7a9f3 Mon Sep 17 00:00:00 2001 From: Mykhailo Matiola <mykhailo.matiola@transoftgroup.com> Date: Wed, 18 Dec 2019 13:18:29 +0200 Subject: [PATCH 398/586] MC-25146: Layered Navigation with different product attributes on Catalog Search Results page --- .../Magento/Test/Php/_files/phpstan/blacklist/common.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/blacklist/common.txt b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/blacklist/common.txt index 4ac0984238828..f54defbd57604 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/blacklist/common.txt +++ b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/blacklist/common.txt @@ -9,6 +9,7 @@ dev/tests/integration/framework/deployTestModules.php dev/tests/integration/testsuite/Magento/Framework/Session/ConfigTest.php dev/tests/integration/testsuite/Magento/Framework/Session/SessionManagerTest.php dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/AbstractFiltersTest.php +dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/CategoryTest.php dev/tests/api-functional/testsuite/Magento/Customer/Api/AddressRepositoryTest.php dev/tests/api-functional/testsuite/Magento/Framework/Model/Entity/HydratorTest.php dev/tests/api-functional/testsuite/Magento/Integration/Model/AdminTokenServiceTest.php From f935b9a1a57060ee796388f9d5671e3162f91f38 Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Wed, 18 Dec 2019 15:00:48 +0200 Subject: [PATCH 399/586] Covering the ResetQuoteAddresses by Unit Test --- .../Unit/Plugin/ResetQuoteAddressesTest.php | 178 ++++++++++++++++++ 1 file changed, 178 insertions(+) create mode 100644 app/code/Magento/Checkout/Test/Unit/Plugin/ResetQuoteAddressesTest.php diff --git a/app/code/Magento/Checkout/Test/Unit/Plugin/ResetQuoteAddressesTest.php b/app/code/Magento/Checkout/Test/Unit/Plugin/ResetQuoteAddressesTest.php new file mode 100644 index 0000000000000..a8e0904c69780 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Unit/Plugin/ResetQuoteAddressesTest.php @@ -0,0 +1,178 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Checkout\Test\Unit\Plugin; + +use Magento\Checkout\Plugin\Model\Quote\ResetQuoteAddresses; +use Magento\Quote\Api\Data\CartExtensionInterface; +use Magento\Quote\Model\Quote; +use Magento\Quote\Model\Quote\Address; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Class ResetQuoteAddressesTest + * + * Test of clearing quote addresses after all items were removed. + */ +class ResetQuoteAddressesTest extends TestCase +{ + /** + * @var ResetQuoteAddresses + */ + private $plugin; + + /** + * @var Quote|MockObject + */ + private $quoteMock; + + /** + * @var CartExtensionInterface|MockObject + */ + private $extensionAttributesMock; + + /** + * Set Up + */ + protected function setUp() + { + $this->quoteMock = $this->createPartialMock(Quote::class, + [ + 'getAllAddresses', + 'getAllVisibleItems', + 'removeAddress', + 'getExtensionAttributes', + 'isVirtual', + ] + ); + $this->extensionAttributesMock = $this->getMockBuilder(CartExtensionInterface::class) + ->setMethods( + [ + 'getShippingAssignments', + 'setShippingAssignments' + ] + ) + ->getMockForAbstractClass(); + + $this->plugin = new ResetQuoteAddresses(); + } + + /** + * Test removing the addresses from a non empty quote + */ + public function testRemovingTheAddressesFromNonEmptyQuote() + { + $quoteVisibleItems = [1, 2]; + + $this->quoteMock->expects($this->any()) + ->method('getAllVisibleItems') + ->will($this->returnValue($quoteVisibleItems)); + $this->quoteMock->expects($this->never()) + ->method('getAllAddresses') + ->willReturnSelf(); + + $this->plugin->afterRemoveItem($this->quoteMock, $this->quoteMock, 1); + } + + /** + * Test clearing the addresses from an empty quote + * + * @dataProvider quoteDataProvider + * @param bool $isVirtualQuote + * @param bool $quoteHasAddresses + * @param $extensionAttributes + */ + public function testClearingTheAddressesFromEmptyQuote( + bool $isVirtualQuote, + bool $quoteHasAddresses, + $extensionAttributes + ) { + $quoteVisibleItems = []; + + $this->quoteMock->expects($this->any()) + ->method('getAllVisibleItems') + ->will($this->returnValue($quoteVisibleItems)); + + if ($quoteHasAddresses) { + $address = $this->createPartialMock(Address::class, + [ + 'getId' + ] + ); + + $address->expects($this->any()) + ->method('getId') + ->willReturn(1); + + $addresses = [$address]; + + $this->quoteMock->expects($this->any()) + ->method('getAllAddresses') + ->will($this->returnValue($addresses)); + + $this->quoteMock->expects($this->exactly(count($addresses))) + ->method('removeAddress') + ->willReturnSelf(); + } else { + $this->quoteMock->expects($this->any()) + ->method('getAllAddresses') + ->willReturn([]); + } + + $this->quoteMock->expects($this->once()) + ->method('getExtensionAttributes') + ->willReturn($this->extensionAttributesMock); + + $this->quoteMock->expects($this->once()) + ->method('isVirtual') + ->willReturn($isVirtualQuote); + + if ($isVirtualQuote && $extensionAttributes) { + $this->extensionAttributesMock->expects($this->any()) + ->method('getShippingAssignments') + ->willReturn([1]); + + $this->extensionAttributesMock->expects($this->once()) + ->method('setShippingAssignments') + ->willReturnSelf(); + } + + $this->plugin->afterRemoveItem($this->quoteMock, $this->quoteMock, 1); + } + + /** + * Quote information data provider + * + * @return array + */ + public function quoteDataProvider(): array + { + return [ + 'Test case with virtual quote' => [ + true, + true, + null + ], + 'Test case with virtual quote and without a quote address' => [ + true, + false, + null + ], + 'Test case with a non virtual quote without extension attributes' => [ + false, + true, + [] + ], + 'Test case with a non virtual quote with shipping assignments' => [ + false, + true, + [1] + ] + ]; + } +} From 98c915436055b02bec9d7122cf09f41169de28f6 Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Wed, 18 Dec 2019 15:28:08 +0200 Subject: [PATCH 400/586] Fixing static tests --- .../Checkout/Test/Unit/Plugin/ResetQuoteAddressesTest.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Checkout/Test/Unit/Plugin/ResetQuoteAddressesTest.php b/app/code/Magento/Checkout/Test/Unit/Plugin/ResetQuoteAddressesTest.php index a8e0904c69780..cdda9c2822762 100644 --- a/app/code/Magento/Checkout/Test/Unit/Plugin/ResetQuoteAddressesTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Plugin/ResetQuoteAddressesTest.php @@ -41,8 +41,7 @@ class ResetQuoteAddressesTest extends TestCase */ protected function setUp() { - $this->quoteMock = $this->createPartialMock(Quote::class, - [ + $this->quoteMock = $this->createPartialMock(Quote::class, [ 'getAllAddresses', 'getAllVisibleItems', 'removeAddress', @@ -99,8 +98,7 @@ public function testClearingTheAddressesFromEmptyQuote( ->will($this->returnValue($quoteVisibleItems)); if ($quoteHasAddresses) { - $address = $this->createPartialMock(Address::class, - [ + $address = $this->createPartialMock(Address::class, [ 'getId' ] ); From 1db525a9ffd8f4e68bdf6981db064f64764dee65 Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Wed, 18 Dec 2019 16:09:39 +0200 Subject: [PATCH 401/586] Fixing static tests --- .../Unit/Plugin/ResetQuoteAddressesTest.php | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/app/code/Magento/Checkout/Test/Unit/Plugin/ResetQuoteAddressesTest.php b/app/code/Magento/Checkout/Test/Unit/Plugin/ResetQuoteAddressesTest.php index cdda9c2822762..60db2a36b34dc 100644 --- a/app/code/Magento/Checkout/Test/Unit/Plugin/ResetQuoteAddressesTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Plugin/ResetQuoteAddressesTest.php @@ -42,13 +42,12 @@ class ResetQuoteAddressesTest extends TestCase protected function setUp() { $this->quoteMock = $this->createPartialMock(Quote::class, [ - 'getAllAddresses', - 'getAllVisibleItems', - 'removeAddress', - 'getExtensionAttributes', - 'isVirtual', - ] - ); + 'getAllAddresses', + 'getAllVisibleItems', + 'removeAddress', + 'getExtensionAttributes', + 'isVirtual', + ]); $this->extensionAttributesMock = $this->getMockBuilder(CartExtensionInterface::class) ->setMethods( [ @@ -98,10 +97,7 @@ public function testClearingTheAddressesFromEmptyQuote( ->will($this->returnValue($quoteVisibleItems)); if ($quoteHasAddresses) { - $address = $this->createPartialMock(Address::class, [ - 'getId' - ] - ); + $address = $this->createPartialMock(Address::class, ['getId']); $address->expects($this->any()) ->method('getId') From 27d9b2c035a8e7a405d1b47cc98b34492aaccb46 Mon Sep 17 00:00:00 2001 From: Kevin Kozan <kkozan@adobe.com> Date: Wed, 18 Dec 2019 08:55:23 -0600 Subject: [PATCH 402/586] MQE-1927: Deliver MFTF 2.5.4 to 2.4-develop - Composer version bump --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 7e01980e32f58..ab767fdac286d 100644 --- a/composer.json +++ b/composer.json @@ -88,7 +88,7 @@ "friendsofphp/php-cs-fixer": "~2.14.0", "lusitanian/oauth": "~0.8.10", "magento/magento-coding-standard": "*", - "magento/magento2-functional-testing-framework": "2.5.3", + "magento/magento2-functional-testing-framework": "2.5.4", "pdepend/pdepend": "2.5.2", "phpcompatibility/php-compatibility": "^9.3", "phpmd/phpmd": "@stable", diff --git a/composer.lock b/composer.lock index a63cdcdf4a1e1..b6d834610059a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "38446350ff1ac4609f77d5d74213880d", + "content-hash": "8d8e6b87c1f6ac98b3b7331eba9473f3", "packages": [ { "name": "braintree/braintree_php", @@ -7220,21 +7220,21 @@ }, { "name": "magento/magento2-functional-testing-framework", - "version": "2.5.3", + "version": "2.5.4", "source": { "type": "git", "url": "https://github.com/magento/magento2-functional-testing-framework.git", - "reference": "f627085a469da79e4a628d4bf0452f12aefa4389" + "reference": "4f482ce22a755a812b76f81020ae71d502f9d043" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/magento/magento2-functional-testing-framework/zipball/f627085a469da79e4a628d4bf0452f12aefa4389", - "reference": "f627085a469da79e4a628d4bf0452f12aefa4389", + "url": "https://api.github.com/repos/magento/magento2-functional-testing-framework/zipball/4f482ce22a755a812b76f81020ae71d502f9d043", + "reference": "4f482ce22a755a812b76f81020ae71d502f9d043", "shasum": "" }, "require": { "allure-framework/allure-codeception": "~1.3.0", - "codeception/codeception": "~2.3.4 || ~2.4.0 ", + "codeception/codeception": "~2.4.5", "composer/composer": "^1.4", "consolidation/robo": "^1.0.0", "csharpru/vault-php": "~3.5.3", @@ -7294,7 +7294,7 @@ "magento", "testing" ], - "time": "2019-10-31T14:52:02+00:00" + "time": "2019-12-12T20:14:00+00:00" }, { "name": "mikey179/vfsstream", From dd7403c2957aad27e23ed4a1ad378c50a5902dbc Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Wed, 18 Dec 2019 16:58:40 +0200 Subject: [PATCH 403/586] MC-25187: Session lost after switching stores on different domains --- app/code/Magento/Store/Controller/Store/Redirect.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/Magento/Store/Controller/Store/Redirect.php b/app/code/Magento/Store/Controller/Store/Redirect.php index a5d0e481ba8fe..5d61275e72a28 100644 --- a/app/code/Magento/Store/Controller/Store/Redirect.php +++ b/app/code/Magento/Store/Controller/Store/Redirect.php @@ -128,5 +128,7 @@ public function execute() ]; $this->_redirect->redirect($this->_response, 'stores/store/switch', $arguments); } + + return null; } } From 5f2f318f51b21416f0acb06860abb42401efb04c Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Wed, 18 Dec 2019 13:02:29 -0600 Subject: [PATCH 404/586] Change action groups name according to CE branch changes --- .../AdminCategoryAssignProductActionGroup.xml | 1 + ...lectNotLoggedInCustomerGroupActionGroup.xml | 18 ------------------ 2 files changed, 1 insertion(+), 18 deletions(-) delete mode 100644 app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/SelectNotLoggedInCustomerGroupActionGroup.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryAssignProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryAssignProductActionGroup.xml index 9dc661ae5ecad..454c65c8bc5c3 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryAssignProductActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryAssignProductActionGroup.xml @@ -17,6 +17,7 @@ </arguments> <conditionalClick selector="{{AdminCategoryBasicFieldSection.productsInCategory}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="false" stepKey="clickOnProductInCategory"/> + <scrollTo stepKey="scrollToProductGrid" selector="{{AdminCategoryBasicFieldSection.productsInCategory}}" x="0" y="-80" /> <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickOnResetFilter"/> <fillField selector="{{AdminCategoryContentSection.productTableColumnSku}}" userInput="{{productSku}}" stepKey="fillSkuFilter"/> <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearchButton"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/SelectNotLoggedInCustomerGroupActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/SelectNotLoggedInCustomerGroupActionGroup.xml deleted file mode 100644 index 38b64803acadd..0000000000000 --- a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/SelectNotLoggedInCustomerGroupActionGroup.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?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="SelectNotLoggedInCustomerGroupActionGroup"> - <annotations> - <description>Selects the 'NOT LOGGED IN' Customer Group for a Catalog Price Rule on the creation/edit page.</description> - </annotations> - - <selectOption selector="{{AdminNewCatalogPriceRule.customerGroups}}" userInput="NOT LOGGED IN" stepKey="selectCustomerGroup"/> - </actionGroup> -</actionGroups> From 731c456463ede2d22a408447386dd83818bb3c63 Mon Sep 17 00:00:00 2001 From: Roman Hanin <rganin@adobe.com> Date: Wed, 18 Dec 2019 13:57:11 -0600 Subject: [PATCH 405/586] B2B-272: Remove Ship To column, fix pagination selector --- app/code/Magento/Theme/view/frontend/templates/html/pager.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Theme/view/frontend/templates/html/pager.phtml b/app/code/Magento/Theme/view/frontend/templates/html/pager.phtml index bd50fa39d4099..a6cd29c3713ac 100644 --- a/app/code/Magento/Theme/view/frontend/templates/html/pager.phtml +++ b/app/code/Magento/Theme/view/frontend/templates/html/pager.phtml @@ -120,7 +120,7 @@ <strong class="limiter-label"><?= $block->escapeHtml(__('Show')) ?></strong> <select id="limiter" data-mage-init='{"redirectUrl": {"event":"change"}}' class="limiter-options"> <?php foreach ($block->getAvailableLimit() as $_key => $_limit) : ?> - <option value="<?= $block->escapeHtmlAttr($block->getLimitUrl($_key)) ?>" + <option value="<?= $block->escapeUrl($block->getLimitUrl($_key)) ?>" <?php if ($block->isLimitCurrent($_key)) : ?> selected="selected"<?php endif ?>> <?= $block->escapeHtml($_limit) ?> From 72c74a256b1b1179ee3f60aa42b46c0bcaaf67d3 Mon Sep 17 00:00:00 2001 From: Roman Hanin <rganin@adobe.com> Date: Wed, 18 Dec 2019 14:41:57 -0600 Subject: [PATCH 406/586] B2B-272: Remove Ship To column, fix pagination selector --- .../Magento/Theme/view/frontend/templates/html/pager.phtml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Theme/view/frontend/templates/html/pager.phtml b/app/code/Magento/Theme/view/frontend/templates/html/pager.phtml index a6cd29c3713ac..d225ff1377c4a 100644 --- a/app/code/Magento/Theme/view/frontend/templates/html/pager.phtml +++ b/app/code/Magento/Theme/view/frontend/templates/html/pager.phtml @@ -20,7 +20,9 @@ <p class="toolbar-amount"> <span class="toolbar-number"> <?php if ($block->getLastPageNum()>1) : ?> - <?= $block->escapeHtml(__('Items %1 to %2 of %3 total', $block->getFirstNum(), $block->getLastNum(), $block->getTotalNum())) ?> + <?= $block->escapeHtml( + __('Items %1 to %2 of %3 total', $block->getFirstNum(), $block->getLastNum(), $block->getTotalNum()) + ) ?> <?php elseif ($block->getTotalNum() == 1) : ?> <?= $block->escapeHtml(__('%1 Item', $block->getTotalNum())) ?> <?php else : ?> From ccc0c71457cea73e2c58b184ea283317f732f469 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Wed, 18 Dec 2019 14:43:36 -0600 Subject: [PATCH 407/586] Remove redundant line --- app/code/Magento/MediaStorage/Test/Unit/App/MediaTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/MediaStorage/Test/Unit/App/MediaTest.php b/app/code/Magento/MediaStorage/Test/Unit/App/MediaTest.php index e6f43dd435869..8d3211684d377 100644 --- a/app/code/Magento/MediaStorage/Test/Unit/App/MediaTest.php +++ b/app/code/Magento/MediaStorage/Test/Unit/App/MediaTest.php @@ -197,7 +197,6 @@ public function testCatchException($isDeveloper, $setBodyCalls) $this->responseMock->expects($this->once()) ->method('sendResponse'); - $this->isAllowed = true; $this->mediaModel = $this->getMediaModel(); $this->mediaModel->catchException($bootstrap, $exception); From 6bef438824fa583bd3c1b01e9f51a9b47f213c68 Mon Sep 17 00:00:00 2001 From: Roman Hanin <rganin@adobe.com> Date: Wed, 18 Dec 2019 16:31:12 -0600 Subject: [PATCH 408/586] B2B-272: Remove Ship To column, fix pagination selector --- .../view/frontend/templates/html/pager.phtml | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/app/code/Magento/Theme/view/frontend/templates/html/pager.phtml b/app/code/Magento/Theme/view/frontend/templates/html/pager.phtml index d225ff1377c4a..6b28dbd4521a0 100644 --- a/app/code/Magento/Theme/view/frontend/templates/html/pager.phtml +++ b/app/code/Magento/Theme/view/frontend/templates/html/pager.phtml @@ -10,33 +10,33 @@ * @see \Magento\Theme\Block\Html\Pager */ ?> -<?php if ($block->getCollection()->getSize()) : ?> +<?php if ($block->getCollection()->getSize()): ?> - <?php if ($block->getUseContainer()) : ?> + <?php if ($block->getUseContainer()): ?> <div class="pager"> <?php endif ?> - <?php if ($block->getShowAmounts()) : ?> + <?php if ($block->getShowAmounts()): ?> <p class="toolbar-amount"> <span class="toolbar-number"> - <?php if ($block->getLastPageNum()>1) : ?> + <?php if ($block->getLastPageNum()>1): ?> <?= $block->escapeHtml( __('Items %1 to %2 of %3 total', $block->getFirstNum(), $block->getLastNum(), $block->getTotalNum()) ) ?> - <?php elseif ($block->getTotalNum() == 1) : ?> + <?php elseif ($block->getTotalNum() == 1): ?> <?= $block->escapeHtml(__('%1 Item', $block->getTotalNum())) ?> - <?php else : ?> + <?php else: ?> <?= $block->escapeHtml(__('%1 Item(s)', $block->getTotalNum())) ?> <?php endif; ?> </span> </p> <?php endif ?> - <?php if ($block->getLastPageNum()>1) : ?> + <?php if ($block->getLastPageNum()>1): ?> <div class="pages"> <strong class="label pages-label" id="paging-label"><?= $block->escapeHtml(__('Page')) ?></strong> <ul class="items pages-items" aria-labelledby="paging-label"> - <?php if (!$block->isFirstPage()) : ?> + <?php if (!$block->isFirstPage()): ?> <li class="item pages-item-previous"> <?php $text = $block->getAnchorTextForPrevious() ? $block->getAnchorTextForPrevious() : '';?> <a class="<?= $block->escapeHtmlAttr($text ? 'link ' : 'action ') ?> previous" @@ -48,7 +48,7 @@ </li> <?php endif;?> - <?php if ($block->canShowFirst()) : ?> + <?php if ($block->canShowFirst()): ?> <li class="item"> <a class="page first" href="<?= $block->escapeUrl($block->getFirstPageUrl()) ?>"> <span class="label"><?= $block->escapeHtml(__('Page')) ?></span> @@ -57,7 +57,7 @@ </li> <?php endif;?> - <?php if ($block->canShowPreviousJump()) : ?> + <?php if ($block->canShowPreviousJump()): ?> <li class="item"> <a class="page previous jump" title="" @@ -67,15 +67,15 @@ </li> <?php endif;?> - <?php foreach ($block->getFramePages() as $_page) : ?> - <?php if ($block->isPageCurrent($_page)) : ?> + <?php foreach ($block->getFramePages() as $_page): ?> + <?php if ($block->isPageCurrent($_page)): ?> <li class="item current"> <strong class="page"> <span class="label"><?= $block->escapeHtml(__('You\'re currently reading page')) ?></span> <span><?= $block->escapeHtml($_page) ?></span> </strong> </li> - <?php else : ?> + <?php else: ?> <li class="item"> <a href="<?= $block->escapeUrl($block->getPageUrl($_page)) ?>" class="page"> <span class="label"><?= $block->escapeHtml(__('Page')) ?></span> @@ -85,7 +85,7 @@ <?php endif;?> <?php endforeach;?> - <?php if ($block->canShowNextJump()) : ?> + <?php if ($block->canShowNextJump()): ?> <li class="item"> <a class="page next jump" title="" href="<?= $block->escapeUrl($block->getNextJumpUrl()) ?>"> <span>...</span> @@ -93,7 +93,7 @@ </li> <?php endif;?> - <?php if ($block->canShowLast()) : ?> + <?php if ($block->canShowLast()): ?> <li class="item"> <a class="page last" href="<?= $block->escapeUrl($block->getLastPageUrl()) ?>"> <span class="label"><?= $block->escapeHtml(__('Page')) ?></span> @@ -102,7 +102,7 @@ </li> <?php endif;?> - <?php if (!$block->isLastPage()) : ?> + <?php if (!$block->isLastPage()): ?> <li class="item pages-item-next"> <?php $text = $block->getAnchorTextForNext() ? $block->getAnchorTextForNext() : '';?> <a class="<?= /* @noEscape */ $text ? 'link ' : 'action ' ?> next" @@ -117,13 +117,13 @@ </div> <?php endif; ?> - <?php if ($block->isShowPerPage()) : ?> + <?php if ($block->isShowPerPage()): ?> <div class="limiter"> <strong class="limiter-label"><?= $block->escapeHtml(__('Show')) ?></strong> <select id="limiter" data-mage-init='{"redirectUrl": {"event":"change"}}' class="limiter-options"> - <?php foreach ($block->getAvailableLimit() as $_key => $_limit) : ?> + <?php foreach ($block->getAvailableLimit() as $_key => $_limit): ?> <option value="<?= $block->escapeUrl($block->getLimitUrl($_key)) ?>" - <?php if ($block->isLimitCurrent($_key)) : ?> + <?php if ($block->isLimitCurrent($_key)): ?> selected="selected"<?php endif ?>> <?= $block->escapeHtml($_limit) ?> </option> @@ -133,7 +133,7 @@ </div> <?php endif ?> - <?php if ($block->getUseContainer()) : ?> + <?php if ($block->getUseContainer()): ?> </div> <?php endif ?> From 2400f8bdd2e119a39f0eb097d4ff1f07715ec5fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 19 Dec 2019 03:28:35 +0100 Subject: [PATCH 409/586] Unit Test for WishlistGraphQL --- .../Resolver/CustomerWishlistResolver.php | 11 +- .../Unit/CustomerWishlistResolverTest.php | 154 ++++++++++++++++++ 2 files changed, 162 insertions(+), 3 deletions(-) create mode 100644 app/code/Magento/WishlistGraphQl/Test/Unit/CustomerWishlistResolverTest.php diff --git a/app/code/Magento/WishlistGraphQl/Model/Resolver/CustomerWishlistResolver.php b/app/code/Magento/WishlistGraphQl/Model/Resolver/CustomerWishlistResolver.php index e866b9cead03c..a84ce0e965b6d 100644 --- a/app/code/Magento/WishlistGraphQl/Model/Resolver/CustomerWishlistResolver.php +++ b/app/code/Magento/WishlistGraphQl/Model/Resolver/CustomerWishlistResolver.php @@ -8,10 +8,11 @@ namespace Magento\WishlistGraphQl\Model\Resolver; use Magento\Framework\GraphQl\Config\Element\Field; +use Magento\Framework\GraphQl\Exception\GraphQlAuthorizationException; use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; +use Magento\Wishlist\Model\Wishlist; use Magento\Wishlist\Model\WishlistFactory; -use Magento\Framework\GraphQl\Exception\GraphQlAuthorizationException; /** * Fetches customer wishlist data @@ -44,9 +45,13 @@ public function resolve( if (false === $context->getExtensionAttributes()->getIsCustomer()) { throw new GraphQlAuthorizationException(__('The current customer isn\'t authorized.')); } - $wishlist = $this->wishlistFactory->create()->loadByCustomerId($context->getUserId(), true); + + /** @var Wishlist $wishlist */ + $wishlist = $this->wishlistFactory->create(); + $wishlist->loadByCustomerId($context->getUserId(), true); + return [ - 'id' => (string) $wishlist->getId(), + 'id' => (string)$wishlist->getId(), 'sharing_code' => $wishlist->getSharingCode(), 'updated_at' => $wishlist->getUpdatedAt(), 'items_count' => $wishlist->getItemsCount(), diff --git a/app/code/Magento/WishlistGraphQl/Test/Unit/CustomerWishlistResolverTest.php b/app/code/Magento/WishlistGraphQl/Test/Unit/CustomerWishlistResolverTest.php new file mode 100644 index 0000000000000..efb05b2314c73 --- /dev/null +++ b/app/code/Magento/WishlistGraphQl/Test/Unit/CustomerWishlistResolverTest.php @@ -0,0 +1,154 @@ +<?php +declare(strict_types=1); + +namespace Magento\WishlistGraphQl\Test\Unit; + +use Magento\Framework\GraphQl\Config\Element\Field; +use Magento\Framework\GraphQl\Exception\GraphQlAuthorizationException; +use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; +use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\GraphQl\Model\Query\ContextExtensionInterface; +use Magento\Wishlist\Model\Wishlist; +use Magento\Wishlist\Model\WishlistFactory; +use Magento\WishlistGraphQl\Model\Resolver\CustomerWishlistResolver; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +class CustomerWishlistResolverTest extends TestCase +{ + private const STUB_CUSTOMER_ID = 1; + + /** + * @var MockObject|ContextInterface + */ + private $contextMock; + + /** + * @var MockObject|ContextExtensionInterface + */ + private $extensionAttributesMock; + + /** + * @var MockObject|WishlistFactory + */ + private $wishlistFactoryMock; + + /** + * @var MockObject|Wishlist + */ + private $wishlistMock; + + /** + * @var CustomerWishlistResolver + */ + private $resolver; + + /** + * Build the Testing Environment + */ + protected function setUp() + { + $this->contextMock = $this->getMockBuilder(ContextInterface::class) + ->setMethods(['getExtensionAttributes', 'getUserId']) + ->getMock(); + + $this->extensionAttributesMock = $this->getMockBuilder(ContextExtensionInterface::class) + ->setMethods(['getIsCustomer']) + ->getMock(); + + $this->contextMock->method('getExtensionAttributes') + ->willReturn($this->extensionAttributesMock); + + $this->wishlistFactoryMock = $this->getMockBuilder(WishlistFactory::class) + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + + $this->wishlistMock = $this->getMockBuilder(Wishlist::class) + ->disableOriginalConstructor() + ->setMethods(['loadByCustomerId', 'getId', 'getSharingCode', 'getUpdatedAt', 'getItemsCount']) + ->getMock(); + + $objectManager = new ObjectManager($this); + $this->resolver = $objectManager->getObject(CustomerWishlistResolver::class, [ + 'wishlistFactory' => $this->wishlistFactoryMock + ]); + } + + public function testThrowExceptionWhenUserNotAuthorized(): void + { + // Given + $this->extensionAttributesMock->method('getIsCustomer') + ->willReturn(false); + + // Then + $this->expectException(GraphQlAuthorizationException::class); + $this->wishlistFactoryMock->expects($this->never()) + ->method('create'); + + // When + $this->resolver->resolve( + $this->getFieldStub(), + $this->contextMock, + $this->getResolveInfoStub() + ); + } + + public function testFactoryCreatesWishlistByAuthorizedCustomerId(): void + { + // Given + $this->extensionAttributesMock->method('getIsCustomer') + ->willReturn(true); + + $this->contextMock->method('getUserId') + ->willReturn(self::STUB_CUSTOMER_ID); + + // Then + $this->wishlistMock->expects($this->once()) + ->method('loadByCustomerId') + ->with(self::STUB_CUSTOMER_ID) + ->willReturnSelf(); + + $this->wishlistFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($this->wishlistMock); + + // When + $this->resolver->resolve( + $this->getFieldStub(), + $this->contextMock, + $this->getResolveInfoStub() + ); + } + + /** + * Returns stub for Field + * + * @return MockObject|Field + */ + private function getFieldStub(): Field + { + /** @var MockObject|Field $fieldMock */ + $fieldMock = $this->getMockBuilder(Field::class) + ->disableOriginalConstructor() + ->getMock(); + + return $fieldMock; + } + + /** + * Returns stub for ResolveInfo + * + * @return MockObject|ResolveInfo + */ + private function getResolveInfoStub(): ResolveInfo + { + /** @var MockObject|ResolveInfo $resolveInfoMock */ + $resolveInfoMock = $this->getMockBuilder(ResolveInfo::class) + ->disableOriginalConstructor() + ->getMock(); + + return $resolveInfoMock; + } +} From ae831af39b49b64bf420e840c6fd9b4d3eadf3c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 19 Dec 2019 03:47:23 +0100 Subject: [PATCH 410/586] Unit Test for WeeeGraphQl --- .../Test/Unit/FixedProductTaxTest.php | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 app/code/Magento/WeeeGraphQl/Test/Unit/FixedProductTaxTest.php diff --git a/app/code/Magento/WeeeGraphQl/Test/Unit/FixedProductTaxTest.php b/app/code/Magento/WeeeGraphQl/Test/Unit/FixedProductTaxTest.php new file mode 100644 index 0000000000000..427504d85d676 --- /dev/null +++ b/app/code/Magento/WeeeGraphQl/Test/Unit/FixedProductTaxTest.php @@ -0,0 +1,69 @@ +<?php +declare(strict_types=1); + +namespace Magento\WeeeGraphQl\Test\Unit; + +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\GraphQl\Config\Element\Field; +use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\WeeeGraphQl\Model\Resolver\FixedProductTax; +use PHPUnit\Framework\TestCase; +use PHPUnit_Framework_MockObject_MockObject as MockObject; + +class FixedProductTaxTest extends TestCase +{ + /** + * @var FixedProductTax + */ + private $resolver; + + /** + * Build the Testing Environment + */ + protected function setUp() + { + $objectManager = new ObjectManager($this); + $this->resolver = $objectManager->getObject(FixedProductTax::class); + } + + public function testExceptionWhenNoModelSpecified(): void + { + $this->expectException(LocalizedException::class); + $this->expectExceptionMessageRegExp('/value should be specified/'); + + $this->resolver->resolve( + $this->getFieldStub(), + null, + $this->getResolveInfoStub() + ); + } + + /** + * Returns stub for Field + * + * @return MockObject|Field + */ + private function getFieldStub(): Field + { + /** @var MockObject|Field $fieldMock */ + $fieldMock = $this->getMockBuilder(Field::class) + ->disableOriginalConstructor() + ->getMock(); + return $fieldMock; + } + + /** + * Returns stub for ResolveInfo + * + * @return MockObject|ResolveInfo + */ + private function getResolveInfoStub(): ResolveInfo + { + /** @var MockObject|ResolveInfo $resolveInfoMock */ + $resolveInfoMock = $this->getMockBuilder(ResolveInfo::class) + ->disableOriginalConstructor() + ->getMock(); + return $resolveInfoMock; + } +} From 456e6a7cddf843244d68ee0aa21111ff25f4e50e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 19 Dec 2019 03:50:34 +0100 Subject: [PATCH 411/586] Add missing Copyright block --- .../Test/Unit/CustomerWishlistResolverTest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/code/Magento/WishlistGraphQl/Test/Unit/CustomerWishlistResolverTest.php b/app/code/Magento/WishlistGraphQl/Test/Unit/CustomerWishlistResolverTest.php index efb05b2314c73..2dff9b5c0e694 100644 --- a/app/code/Magento/WishlistGraphQl/Test/Unit/CustomerWishlistResolverTest.php +++ b/app/code/Magento/WishlistGraphQl/Test/Unit/CustomerWishlistResolverTest.php @@ -1,4 +1,8 @@ <?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ declare(strict_types=1); namespace Magento\WishlistGraphQl\Test\Unit; From dff6cbfbff6329755fdd15e0f8857860de6ae513 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 19 Dec 2019 03:50:59 +0100 Subject: [PATCH 412/586] Add missing Copyright block --- .../Magento/WeeeGraphQl/Test/Unit/FixedProductTaxTest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/code/Magento/WeeeGraphQl/Test/Unit/FixedProductTaxTest.php b/app/code/Magento/WeeeGraphQl/Test/Unit/FixedProductTaxTest.php index 427504d85d676..778ff8eaef4cc 100644 --- a/app/code/Magento/WeeeGraphQl/Test/Unit/FixedProductTaxTest.php +++ b/app/code/Magento/WeeeGraphQl/Test/Unit/FixedProductTaxTest.php @@ -1,4 +1,8 @@ <?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ declare(strict_types=1); namespace Magento\WeeeGraphQl\Test\Unit; From ceb49c9a73c32f7c3f44a0057fed912be18beb70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 19 Dec 2019 04:05:22 +0100 Subject: [PATCH 413/586] Additional Unit Test for Weee --- .../Test/Unit/FixedProductTaxTest.php | 79 ++++++++++++++++++- 1 file changed, 78 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/WeeeGraphQl/Test/Unit/FixedProductTaxTest.php b/app/code/Magento/WeeeGraphQl/Test/Unit/FixedProductTaxTest.php index 778ff8eaef4cc..9e5812282545a 100644 --- a/app/code/Magento/WeeeGraphQl/Test/Unit/FixedProductTaxTest.php +++ b/app/code/Magento/WeeeGraphQl/Test/Unit/FixedProductTaxTest.php @@ -7,30 +7,81 @@ namespace Magento\WeeeGraphQl\Test\Unit; +use Magento\Framework\DataObject; use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\GraphQl\Model\Query\ContextExtensionInterface; +use Magento\Weee\Helper\Data as WeeeHelper; use Magento\WeeeGraphQl\Model\Resolver\FixedProductTax; use PHPUnit\Framework\TestCase; use PHPUnit_Framework_MockObject_MockObject as MockObject; class FixedProductTaxTest extends TestCase { + const STUB_STORE_ID = 1; + + /** + * @var MockObject|ContextInterface + */ + private $contextMock; + + /** + * @var MockObject|ContextExtensionInterface + */ + private $extensionAttributesMock; + /** * @var FixedProductTax */ private $resolver; + /** + * @var MockObject|WeeeHelper + */ + private $weeeHelperMock; + + /** + * @var MockObject|DataObject + */ + private $productMock; + /** * Build the Testing Environment */ protected function setUp() { + $this->contextMock = $this->getMockBuilder(ContextInterface::class) + ->setMethods(['getExtensionAttributes']) + ->getMock(); + + $this->extensionAttributesMock = $this->getMockBuilder(ContextExtensionInterface::class) + ->setMethods(['getStore']) + ->getMock(); + + $this->contextMock->method('getExtensionAttributes') + ->willReturn($this->extensionAttributesMock); + + $this->productMock = $this->getMockBuilder(DataObject::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->weeeHelperMock = $this->getMockBuilder(WeeeHelper::class) + ->disableOriginalConstructor() + ->setMethods(['isEnabled', 'getProductWeeeAttributesForDisplay']) + ->getMock(); + $objectManager = new ObjectManager($this); - $this->resolver = $objectManager->getObject(FixedProductTax::class); + $this->resolver = $objectManager->getObject(FixedProductTax::class, [ + 'weeeHelper' => $this->weeeHelperMock + ]); } + /** + * Verifies if the Exception is being thrown when no Product Model passed to resolver + */ public function testExceptionWhenNoModelSpecified(): void { $this->expectException(LocalizedException::class); @@ -43,6 +94,32 @@ public function testExceptionWhenNoModelSpecified(): void ); } + /** + * Verifies that Attributes for display are not being fetched if feature not enabled in store + */ + public function testNotGettingAttributesWhenWeeeDisabledForStore(): void + { + // Given + $this->extensionAttributesMock->method('getStore') + ->willreturn(self::STUB_STORE_ID); + + // When + $this->weeeHelperMock->method('isEnabled') + ->with(self::STUB_STORE_ID) + ->willReturn(false); + + // Then + $this->weeeHelperMock->expects($this->never()) + ->method('getProductWeeeAttributesForDisplay'); + + $this->resolver->resolve( + $this->getFieldStub(), + $this->contextMock, + $this->getResolveInfoStub(), + ['model' => $this->productMock] + ); + } + /** * Returns stub for Field * From 565c34f59b853e4b2b2f5eb3c0adbf39ae4d94db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 19 Dec 2019 04:07:17 +0100 Subject: [PATCH 414/586] Add missing docblocks --- .../Test/Unit/CustomerWishlistResolverTest.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/code/Magento/WishlistGraphQl/Test/Unit/CustomerWishlistResolverTest.php b/app/code/Magento/WishlistGraphQl/Test/Unit/CustomerWishlistResolverTest.php index 2dff9b5c0e694..f5baa5183e558 100644 --- a/app/code/Magento/WishlistGraphQl/Test/Unit/CustomerWishlistResolverTest.php +++ b/app/code/Magento/WishlistGraphQl/Test/Unit/CustomerWishlistResolverTest.php @@ -80,6 +80,9 @@ protected function setUp() ]); } + /** + * Verify if Authorization exception is being thrown when User not logged in + */ public function testThrowExceptionWhenUserNotAuthorized(): void { // Given @@ -99,6 +102,9 @@ public function testThrowExceptionWhenUserNotAuthorized(): void ); } + /** + * Verify if Wishlist instance is created for currently Authorized user + */ public function testFactoryCreatesWishlistByAuthorizedCustomerId(): void { // Given From dd5fb66ae37a3907375cc71e580544fc25ed6fb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 19 Dec 2019 04:24:13 +0100 Subject: [PATCH 415/586] Changes to Magento Version module and Unit Tests --- .../Version/Controller/Index/Index.php | 36 +++++++++--- .../Test/Unit/Controller/Index/IndexTest.php | 56 ++++++++++--------- 2 files changed, 59 insertions(+), 33 deletions(-) diff --git a/app/code/Magento/Version/Controller/Index/Index.php b/app/code/Magento/Version/Controller/Index/Index.php index 0db9b5f80d483..7ed039dae22b4 100644 --- a/app/code/Magento/Version/Controller/Index/Index.php +++ b/app/code/Magento/Version/Controller/Index/Index.php @@ -4,6 +4,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + namespace Magento\Version\Controller\Index; use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface; @@ -16,6 +17,8 @@ */ class Index extends Action implements HttpGetActionInterface { + const DEV_PREFIX = 'dev-'; + /** * @var ProductMetadataInterface */ @@ -41,16 +44,14 @@ public function execute() { $version = $this->productMetadata->getVersion(); $versionParts = explode('.', $version); - if ((!isset($versionParts[0]) || !isset($versionParts[1])) - || $this->isGitBasedInstallation($version) - ) { + if ($this->isGitBasedInstallation($version) || !$this->isCorrectVersion($versionParts)) { return; } - $majorMinorVersion = $versionParts[0] . '.' . $versionParts[1]; + $this->getResponse()->setBody( $this->productMetadata->getName() . '/' . - $majorMinorVersion . ' (' . - $this->productMetadata->getEdition() . ')' + $this->getMajorMinorVersion($versionParts) . + ' (' . $this->productMetadata->getEdition() . ')' ); } @@ -62,7 +63,26 @@ public function execute() */ private function isGitBasedInstallation($fullVersion) { - $versionParts = explode('-', $fullVersion); - return (isset($versionParts[0]) && $versionParts[0] == 'dev'); + return 0 === strpos($fullVersion, self::DEV_PREFIX); + } + + /** + * Verifies if the Magento version is correct + * + * @param array $versionParts + * @return bool + */ + private function isCorrectVersion(array $versionParts): bool + { + return isset($versionParts[0]) && isset($versionParts[1]); + } + + /** + * @param array $versionParts + * @return string + */ + private function getMajorMinorVersion(array $versionParts): string + { + return $versionParts[0] . '.' . $versionParts[1]; } } diff --git a/app/code/Magento/Version/Test/Unit/Controller/Index/IndexTest.php b/app/code/Magento/Version/Test/Unit/Controller/Index/IndexTest.php index 6f8daa9d8008d..f5dd438bbfa38 100644 --- a/app/code/Magento/Version/Test/Unit/Controller/Index/IndexTest.php +++ b/app/code/Magento/Version/Test/Unit/Controller/Index/IndexTest.php @@ -12,11 +12,9 @@ use Magento\Framework\App\ProductMetadataInterface; use Magento\Framework\App\ResponseInterface; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use PHPUnit\Framework\TestCase; -/** - * Class \Magento\Version\Test\Unit\Controller\Index\IndexTest - */ -class IndexTest extends \PHPUnit\Framework\TestCase +class IndexTest extends TestCase { /** * @var VersionIndex @@ -26,72 +24,80 @@ class IndexTest extends \PHPUnit\Framework\TestCase /** * @var Context */ - private $context; + private $contextMock; /** * @var ProductMetadataInterface */ - private $productMetadata; + private $productMetadataMock; /** * @var ResponseInterface */ - private $response; + private $responseMock; /** * Prepare test preconditions */ protected function setUp() { - $this->context = $this->getMockBuilder(Context::class) + $this->contextMock = $this->getMockBuilder(Context::class) ->disableOriginalConstructor() ->getMock(); - $this->productMetadata = $this->getMockBuilder(ProductMetadataInterface::class) + $this->productMetadataMock = $this->getMockBuilder(ProductMetadataInterface::class) ->disableOriginalConstructor() ->setMethods(['getName', 'getEdition', 'getVersion']) ->getMock(); - $this->response = $this->getMockBuilder(ResponseInterface::class) + $this->responseMock = $this->getMockBuilder(ResponseInterface::class) ->disableOriginalConstructor() ->setMethods(['setBody', 'sendResponse']) ->getMock(); - $this->context->expects($this->any()) + $this->contextMock->expects($this->any()) ->method('getResponse') - ->willReturn($this->response); + ->willReturn($this->responseMock); - $helper = new ObjectManager($this); + $objectManager = new ObjectManager($this); - $this->model = $helper->getObject( + $this->model = $objectManager->getObject( 'Magento\Version\Controller\Index\Index', [ - 'context' => $this->context, - 'productMetadata' => $this->productMetadata + 'context' => $this->contextMock, + 'productMetadata' => $this->productMetadataMock ] ); } /** - * Test with Git Base version + * Git Base version does not return information about version */ - public function testExecuteWithGitBase() + public function testGitBasedInstallationDoesNotReturnVersion() { - $this->productMetadata->expects($this->any())->method('getVersion')->willReturn('dev-2.3'); + $this->productMetadataMock->expects($this->any()) + ->method('getVersion') + ->willReturn('dev-2.3'); + + $this->responseMock->expects($this->never()) + ->method('setBody'); + $this->assertNull($this->model->execute()); } /** - * Test with Community Version + * Magento Community returns information about major and minor version of product */ - public function testExecuteWithCommunityVersion() + public function testCommunityVersionDisplaysMajorMinorVersionAndEditionName() { - $this->productMetadata->expects($this->any())->method('getVersion')->willReturn('2.3.3'); - $this->productMetadata->expects($this->any())->method('getEdition')->willReturn('Community'); - $this->productMetadata->expects($this->any())->method('getName')->willReturn('Magento'); - $this->response->expects($this->once())->method('setBody') + $this->productMetadataMock->expects($this->any())->method('getVersion')->willReturn('2.3.3'); + $this->productMetadataMock->expects($this->any())->method('getEdition')->willReturn('Community'); + $this->productMetadataMock->expects($this->any())->method('getName')->willReturn('Magento'); + + $this->responseMock->expects($this->once())->method('setBody') ->with('Magento/2.3 (Community)') ->will($this->returnSelf()); + $this->model->execute(); } } From 7b311ef9448dc674dd1528489bbcfc36f10a9136 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Thu, 19 Dec 2019 10:25:10 +0700 Subject: [PATCH 416/586] [Weee] Cover Weee Plugin by Unit Test --- .../Helper/ProcessTaxAttributeTest.php | 157 ++++++++++++++++++ .../Ui/DataProvider/WeeeSettingsTest.php | 74 +++++++++ 2 files changed, 231 insertions(+) create mode 100644 app/code/Magento/Weee/Test/Unit/Plugin/Catalog/Controller/Adminhtml/Product/Initialization/Helper/ProcessTaxAttributeTest.php create mode 100644 app/code/Magento/Weee/Test/Unit/Plugin/Ui/DataProvider/WeeeSettingsTest.php diff --git a/app/code/Magento/Weee/Test/Unit/Plugin/Catalog/Controller/Adminhtml/Product/Initialization/Helper/ProcessTaxAttributeTest.php b/app/code/Magento/Weee/Test/Unit/Plugin/Catalog/Controller/Adminhtml/Product/Initialization/Helper/ProcessTaxAttributeTest.php new file mode 100644 index 0000000000000..28134a4c00363 --- /dev/null +++ b/app/code/Magento/Weee/Test/Unit/Plugin/Catalog/Controller/Adminhtml/Product/Initialization/Helper/ProcessTaxAttributeTest.php @@ -0,0 +1,157 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Weee\Test\Unit\Plugin\Catalog\Controller\Adminhtml\Product\Initialization\Helper; + +use Magento\Catalog\Controller\Adminhtml\Product\Initialization\Helper; +use Magento\Catalog\Model\Product; +use Magento\Eav\Model\Entity\Attribute\AbstractAttribute; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Weee\Plugin\Catalog\Controller\Adminhtml\Product\Initialization\Helper\ProcessTaxAttribute; +use PHPUnit\Framework\MockObject\Matcher\InvokedCount as InvokedCountMatcher; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +class ProcessTaxAttributeTest extends TestCase +{ + /** + * Weee frontend input + */ + private const WEEE_FRONTEND_INPUT = 'weee'; + + /** + * Text frontend input + */ + private const TEXT_FRONTEND_INPUT = 'text'; + + /** + * Stub weee attribute code + */ + private const STUB_WEEE_ATTRIBUTE_CODE = 'weee_1'; + + /** + * Stub weee attribute value + */ + private const STUB_WEEE_ATTRIBUTE_VALUE = 1122; + + /** + * @var ProcessTaxAttribute + */ + private $plugin; + + /** + * @var Helper|MockObject + */ + private $subjectMock; + + /** + * @var Product|MockObject + */ + private $productMock; + + /** + * @var Product|MockObject + */ + private $resultMock; + + /** + * Prepare environment for test + */ + protected function setUp() + { + $this->subjectMock = $this->createMock(Helper::class); + $this->resultMock = $this->createMock(Product::class); + $this->productMock = $this->createMock(Product::class); + + $objectManager = new ObjectManager($this); + $this->plugin = $objectManager->getObject(ProcessTaxAttribute::class); + } + + /** + * Test afterInitializeFromData when attributes are empty + */ + public function testAfterInitializeFromDataWhenAttributesAreEmpty() + { + $this->resultMock->expects($this->any())->method('getAttributes') + ->willReturn([]); + + $this->resultMock->expects($this->never())->method('setData')->willReturnSelf(); + + $this->plugin->afterInitializeFromData($this->subjectMock, $this->resultMock, $this->productMock, []); + } + + /** + * Test afterInitializeFromData when attributes do not include weee frontend input + */ + public function testAfterInitializeFromDataWhenAttributesDoNotIncludeWeee() + { + /** @var AbstractAttribute|MockObject $attributeMock */ + $attributeMock = $this->createMock(AbstractAttribute::class); + + $attributeMock->expects($this->any())->method('getFrontendInput') + ->willReturn(self::TEXT_FRONTEND_INPUT); + + $this->resultMock->expects($this->any())->method('getAttributes') + ->willReturn([$attributeMock]); + + $this->resultMock->expects($this->never())->method('setData')->willReturnSelf(); + + $this->plugin->afterInitializeFromData($this->subjectMock, $this->resultMock, $this->productMock, []); + } + + /** + * Test afterInitializeFromData when attributes include weee + * + * @param array $productData + * @param InvokedCountMatcher $expected + * @dataProvider afterInitializeFromDataWhenAttributesIncludeWeeeDataProvider + */ + public function testAfterInitializeFromDataWhenAttributesIncludeWeee($productData, $expected) + { + /** @var AbstractAttribute|MockObject $attributeMock */ + $attributeMock = $this->createMock(AbstractAttribute::class); + + $attributeMock->expects($this->any())->method('getFrontendInput') + ->willReturn(self::WEEE_FRONTEND_INPUT); + $attributeMock->expects($this->any())->method('getAttributeCode') + ->willReturn(self::STUB_WEEE_ATTRIBUTE_CODE); + $this->resultMock->expects($this->any())->method('getAttributes') + ->willReturn([$attributeMock]); + + $this->resultMock->expects($expected)->method('setData') + ->with(self::STUB_WEEE_ATTRIBUTE_CODE, []) + ->willReturnSelf(); + + $this->plugin->afterInitializeFromData( + $this->subjectMock, + $this->resultMock, + $this->productMock, + $productData + ); + } + + /** + * ProductData data provider for testAfterInitializeFromDataWhenAttributesIncludeWeee + * + * @return array + */ + public function afterInitializeFromDataWhenAttributesIncludeWeeeDataProvider() + { + return [ + 'Product data includes wee' => [ + [ + self::STUB_WEEE_ATTRIBUTE_CODE => self::STUB_WEEE_ATTRIBUTE_VALUE + ], + $this->never() + ], + 'Product data does not include wee' => [ + [], + $this->once() + ] + ]; + } +} diff --git a/app/code/Magento/Weee/Test/Unit/Plugin/Ui/DataProvider/WeeeSettingsTest.php b/app/code/Magento/Weee/Test/Unit/Plugin/Ui/DataProvider/WeeeSettingsTest.php new file mode 100644 index 0000000000000..0ac9c55313538 --- /dev/null +++ b/app/code/Magento/Weee/Test/Unit/Plugin/Ui/DataProvider/WeeeSettingsTest.php @@ -0,0 +1,74 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Weee\Test\Unit\Plugin\Ui\DataProvider; + +use Magento\Catalog\Ui\DataProvider\Product\Listing\DataProvider; +use Magento\Framework\App\Config; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Weee\Model\Config as WeeeConfig; +use Magento\Weee\Plugin\Ui\DataProvider\WeeeSettings; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +class WeeeSettingsTest extends TestCase +{ + /** + * Stub settings fpt display product list + */ + private const STUB_FPT_DISPLAY_PRODUCT_LIST = '1'; + + /** + * @var WeeeSettings + */ + private $plugin; + + /** + * @var DataProvider|MockObject + */ + protected $subjectMock; + + /** + * @var Config|MockObject + */ + private $configMock; + + /** + * Prepare environment for test + */ + protected function setUp() + { + $this->configMock = $this->createMock(Config::class); + $this->subjectMock = $this->createMock(DataProvider::class); + + $objectManager = new ObjectManager($this); + $this->plugin = $objectManager->getObject( + WeeeSettings::class, + [ + 'config' => $this->configMock + ] + ); + } + + /** + * Test plugin afterGetData + */ + public function testAfterGetDataWhenConfigIsYesResultIsEmpty() + { + $this->configMock->expects($this->any())->method('getValue') + ->with(WeeeConfig::XML_PATH_FPT_DISPLAY_PRODUCT_LIST) + ->willReturn(self::STUB_FPT_DISPLAY_PRODUCT_LIST); + + $this->assertEquals( + [ + 'displayWeee' => self::STUB_FPT_DISPLAY_PRODUCT_LIST + ], + $this->plugin->afterGetData($this->subjectMock, []) + ); + } +} From 2be5545e8ab4fdb88acf3ad18ec0be56d132da74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 19 Dec 2019 04:27:23 +0100 Subject: [PATCH 417/586] Add missing description for method --- app/code/Magento/Version/Controller/Index/Index.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/Magento/Version/Controller/Index/Index.php b/app/code/Magento/Version/Controller/Index/Index.php index 7ed039dae22b4..d2ffa0fb6dd4d 100644 --- a/app/code/Magento/Version/Controller/Index/Index.php +++ b/app/code/Magento/Version/Controller/Index/Index.php @@ -78,6 +78,8 @@ private function isCorrectVersion(array $versionParts): bool } /** + * Returns string only with Major and Minor version number + * * @param array $versionParts * @return string */ From 6be7d1e0119d9d58506721dffdb6a26093ebdbbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 19 Dec 2019 04:30:17 +0100 Subject: [PATCH 418/586] Reformat XML files --- app/code/Magento/Version/etc/frontend/routes.xml | 2 +- app/code/Magento/Version/etc/module.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Version/etc/frontend/routes.xml b/app/code/Magento/Version/etc/frontend/routes.xml index a3988030478ff..3550a0c6a15f5 100644 --- a/app/code/Magento/Version/etc/frontend/routes.xml +++ b/app/code/Magento/Version/etc/frontend/routes.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="standard"> <route id="magento_version" frontName="magento_version"> - <module name="Magento_Version" /> + <module name="Magento_Version"/> </route> </router> </config> diff --git a/app/code/Magento/Version/etc/module.xml b/app/code/Magento/Version/etc/module.xml index fe8ace51ea07d..b21ef687e164d 100644 --- a/app/code/Magento/Version/etc/module.xml +++ b/app/code/Magento/Version/etc/module.xml @@ -6,6 +6,6 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> - <module name="Magento_Version" > + <module name="Magento_Version"> </module> </config> From ba51b436e7614985049b91efa9dbfaddf2bff669 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 19 Dec 2019 04:39:14 +0100 Subject: [PATCH 419/586] Introduce strict_types --- app/code/Magento/Version/Controller/Index/Index.php | 7 ++++--- .../Version/Test/Unit/Controller/Index/IndexTest.php | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Version/Controller/Index/Index.php b/app/code/Magento/Version/Controller/Index/Index.php index d2ffa0fb6dd4d..a6accaeb7d52f 100644 --- a/app/code/Magento/Version/Controller/Index/Index.php +++ b/app/code/Magento/Version/Controller/Index/Index.php @@ -4,12 +4,13 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); namespace Magento\Version\Controller\Index; -use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface; use Magento\Framework\App\Action\Action; use Magento\Framework\App\Action\Context; +use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface; use Magento\Framework\App\ProductMetadataInterface; /** @@ -40,7 +41,7 @@ public function __construct(Context $context, ProductMetadataInterface $productM * * @return void */ - public function execute() + public function execute(): void { $version = $this->productMetadata->getVersion(); $versionParts = explode('.', $version); @@ -61,7 +62,7 @@ public function execute() * @param string $fullVersion * @return bool */ - private function isGitBasedInstallation($fullVersion) + private function isGitBasedInstallation($fullVersion): bool { return 0 === strpos($fullVersion, self::DEV_PREFIX); } diff --git a/app/code/Magento/Version/Test/Unit/Controller/Index/IndexTest.php b/app/code/Magento/Version/Test/Unit/Controller/Index/IndexTest.php index f5dd438bbfa38..9a42fd81cd882 100644 --- a/app/code/Magento/Version/Test/Unit/Controller/Index/IndexTest.php +++ b/app/code/Magento/Version/Test/Unit/Controller/Index/IndexTest.php @@ -7,11 +7,11 @@ namespace Magento\Version\Test\Unit\Controller\Index; -use Magento\Version\Controller\Index\Index as VersionIndex; use Magento\Framework\App\Action\Context; use Magento\Framework\App\ProductMetadataInterface; use Magento\Framework\App\ResponseInterface; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Version\Controller\Index\Index as VersionIndex; use PHPUnit\Framework\TestCase; class IndexTest extends TestCase @@ -73,7 +73,7 @@ protected function setUp() /** * Git Base version does not return information about version */ - public function testGitBasedInstallationDoesNotReturnVersion() + public function testGitBasedInstallationDoesNotReturnVersion(): void { $this->productMetadataMock->expects($this->any()) ->method('getVersion') @@ -88,7 +88,7 @@ public function testGitBasedInstallationDoesNotReturnVersion() /** * Magento Community returns information about major and minor version of product */ - public function testCommunityVersionDisplaysMajorMinorVersionAndEditionName() + public function testCommunityVersionDisplaysMajorMinorVersionAndEditionName(): void { $this->productMetadataMock->expects($this->any())->method('getVersion')->willReturn('2.3.3'); $this->productMetadataMock->expects($this->any())->method('getEdition')->willReturn('Community'); From 2ad3c354d0b5595a604e7292b7b6d30c09bb9921 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 19 Dec 2019 04:58:29 +0100 Subject: [PATCH 420/586] Fix Static Analysis --- app/code/Magento/Version/Controller/Index/Index.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/code/Magento/Version/Controller/Index/Index.php b/app/code/Magento/Version/Controller/Index/Index.php index a6accaeb7d52f..53bcd4b4ff700 100644 --- a/app/code/Magento/Version/Controller/Index/Index.php +++ b/app/code/Magento/Version/Controller/Index/Index.php @@ -36,8 +36,7 @@ public function __construct(Context $context, ProductMetadataInterface $productM } /** - * Sets the response body to ProductName/Major.MinorVersion (Edition). E.g.: Magento/0.42 (Community). Omits patch - * version from response + * Sets the response body to ProductName/Major.MinorVersion (Edition). * * @return void */ From cfd5c22848f82f29f69cd42ffbcc8e09fa848568 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Szubert?= <bartlomiejszubert@gmail.com> Date: Thu, 19 Dec 2019 05:00:50 +0100 Subject: [PATCH 421/586] Fix #25390 - fix backward incompatible constructor in UPS carrier, cleanup of class imports --- app/code/Magento/Ups/Model/Carrier.php | 160 ++++++++++++++----------- 1 file changed, 90 insertions(+), 70 deletions(-) diff --git a/app/code/Magento/Ups/Model/Carrier.php b/app/code/Magento/Ups/Model/Carrier.php index 9e33b86ea8215..103ba9d3fb4b7 100644 --- a/app/code/Magento/Ups/Model/Carrier.php +++ b/app/code/Magento/Ups/Model/Carrier.php @@ -7,6 +7,12 @@ namespace Magento\Ups\Model; +use Magento\CatalogInventory\Api\StockRegistryInterface; +use Magento\Directory\Helper\Data; +use Magento\Directory\Model\CountryFactory; +use Magento\Directory\Model\CurrencyFactory; +use Magento\Directory\Model\RegionFactory; +use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\App\ObjectManager; use Magento\Framework\Async\CallbackDeferred; use Magento\Framework\DataObject; @@ -15,16 +21,30 @@ use Magento\Framework\HTTP\AsyncClient\Request; use Magento\Framework\HTTP\AsyncClientInterface; use Magento\Framework\HTTP\ClientFactory; +use Magento\Framework\Locale\FormatInterface; use Magento\Framework\Xml\Security; use Magento\Quote\Model\Quote\Address\RateRequest; use Magento\Quote\Model\Quote\Address\RateResult\Error; +use Magento\Quote\Model\Quote\Address\RateResult\ErrorFactory as RateErrorFactory; +use Magento\Quote\Model\Quote\Address\RateResult\MethodFactory as RateMethodFactory; +use Magento\Sales\Model\Order\Shipment as OrderShipment; use Magento\Shipping\Model\Carrier\AbstractCarrierOnline; use Magento\Shipping\Model\Carrier\CarrierInterface; use Magento\Shipping\Model\Rate\Result; use Magento\Shipping\Model\Rate\Result\ProxyDeferredFactory; +use Magento\Shipping\Model\Rate\ResultFactory as RateFactory; use Magento\Shipping\Model\Simplexml\Element; +use Magento\Shipping\Model\Simplexml\ElementFactory; +use Magento\Shipping\Model\Tracking\Result\ErrorFactory as TrackErrorFactory; +use Magento\Shipping\Model\Tracking\Result\StatusFactory as TrackStatusFactory; +use Magento\Shipping\Model\Tracking\ResultFactory as TrackFactory; +use Magento\Store\Model\ScopeInterface; use Magento\Ups\Helper\Config; use Magento\Shipping\Model\Shipment\Request as Shipment; +use Psr\Log\LoggerInterface; +use RuntimeException; +use Throwable; +use Zend_Http_Client; /** * UPS shipping implementation @@ -117,12 +137,12 @@ class Carrier extends AbstractCarrierOnline implements CarrierInterface protected $_customizableContainerTypes = ['CP', 'CSP']; /** - * @var \Magento\Framework\Locale\FormatInterface + * @var FormatInterface */ protected $_localeFormat; /** - * @var \Psr\Log\LoggerInterface + * @var LoggerInterface */ protected $_logger; @@ -149,22 +169,22 @@ class Carrier extends AbstractCarrierOnline implements CarrierInterface private $deferredProxyFactory; /** - * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\Quote\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory - * @param \Psr\Log\LoggerInterface $logger + * @param ScopeConfigInterface $scopeConfig + * @param RateErrorFactory $rateErrorFactory + * @param LoggerInterface $logger * @param Security $xmlSecurity - * @param \Magento\Shipping\Model\Simplexml\ElementFactory $xmlElFactory - * @param \Magento\Shipping\Model\Rate\ResultFactory $rateFactory - * @param \Magento\Quote\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory - * @param \Magento\Shipping\Model\Tracking\ResultFactory $trackFactory - * @param \Magento\Shipping\Model\Tracking\Result\ErrorFactory $trackErrorFactory - * @param \Magento\Shipping\Model\Tracking\Result\StatusFactory $trackStatusFactory - * @param \Magento\Directory\Model\RegionFactory $regionFactory - * @param \Magento\Directory\Model\CountryFactory $countryFactory - * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory - * @param \Magento\Directory\Helper\Data $directoryData - * @param \Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry - * @param \Magento\Framework\Locale\FormatInterface $localeFormat + * @param ElementFactory $xmlElFactory + * @param RateFactory $rateFactory + * @param RateMethodFactory $rateMethodFactory + * @param TrackFactory $trackFactory + * @param TrackErrorFactory $trackErrorFactory + * @param TrackStatusFactory $trackStatusFactory + * @param RegionFactory $regionFactory + * @param CountryFactory $countryFactory + * @param CurrencyFactory $currencyFactory + * @param Data $directoryData + * @param StockRegistryInterface $stockRegistry + * @param FormatInterface $localeFormat * @param Config $configHelper * @param ClientFactory $httpClientFactory * @param array $data @@ -175,27 +195,27 @@ class Carrier extends AbstractCarrierOnline implements CarrierInterface * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function __construct( - \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Quote\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, - \Psr\Log\LoggerInterface $logger, + ScopeConfigInterface $scopeConfig, + RateErrorFactory $rateErrorFactory, + LoggerInterface $logger, Security $xmlSecurity, - \Magento\Shipping\Model\Simplexml\ElementFactory $xmlElFactory, - \Magento\Shipping\Model\Rate\ResultFactory $rateFactory, - \Magento\Quote\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory, - \Magento\Shipping\Model\Tracking\ResultFactory $trackFactory, - \Magento\Shipping\Model\Tracking\Result\ErrorFactory $trackErrorFactory, - \Magento\Shipping\Model\Tracking\Result\StatusFactory $trackStatusFactory, - \Magento\Directory\Model\RegionFactory $regionFactory, - \Magento\Directory\Model\CountryFactory $countryFactory, - \Magento\Directory\Model\CurrencyFactory $currencyFactory, - \Magento\Directory\Helper\Data $directoryData, - \Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry, - \Magento\Framework\Locale\FormatInterface $localeFormat, + ElementFactory $xmlElFactory, + RateFactory $rateFactory, + RateMethodFactory $rateMethodFactory, + TrackFactory $trackFactory, + TrackErrorFactory $trackErrorFactory, + TrackStatusFactory $trackStatusFactory, + RegionFactory $regionFactory, + CountryFactory $countryFactory, + CurrencyFactory $currencyFactory, + Data $directoryData, + StockRegistryInterface $stockRegistry, + FormatInterface $localeFormat, Config $configHelper, ClientFactory $httpClientFactory, array $data = [], ?AsyncClientInterface $asyncHttpClient = null, - ?ProxyDeferredFactory $proxyDeferredFactory + ?ProxyDeferredFactory $proxyDeferredFactory = null ) { parent::__construct( $scopeConfig, @@ -265,7 +285,7 @@ public function setRequest(RateRequest $request) { $this->_request = $request; - $rowRequest = new \Magento\Framework\DataObject(); + $rowRequest = new DataObject(); if ($request->getLimitMethod()) { $rowRequest->setAction($this->configHelper->getCode('action', 'single')); @@ -300,8 +320,8 @@ public function setRequest(RateRequest $request) $origCountry = $request->getOrigCountry(); } else { $origCountry = $this->_scopeConfig->getValue( - \Magento\Sales\Model\Order\Shipment::XML_PATH_STORE_COUNTRY_ID, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, + OrderShipment::XML_PATH_STORE_COUNTRY_ID, + ScopeInterface::SCOPE_STORE, $request->getStoreId() ); } @@ -312,8 +332,8 @@ public function setRequest(RateRequest $request) $origRegionCode = $request->getOrigRegionCode(); } else { $origRegionCode = $this->_scopeConfig->getValue( - \Magento\Sales\Model\Order\Shipment::XML_PATH_STORE_REGION_ID, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, + OrderShipment::XML_PATH_STORE_REGION_ID, + ScopeInterface::SCOPE_STORE, $request->getStoreId() ); } @@ -327,8 +347,8 @@ public function setRequest(RateRequest $request) } else { $rowRequest->setOrigPostal( $this->_scopeConfig->getValue( - \Magento\Sales\Model\Order\Shipment::XML_PATH_STORE_ZIP, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, + OrderShipment::XML_PATH_STORE_ZIP, + ScopeInterface::SCOPE_STORE, $request->getStoreId() ) ); @@ -339,8 +359,8 @@ public function setRequest(RateRequest $request) } else { $rowRequest->setOrigCity( $this->_scopeConfig->getValue( - \Magento\Sales\Model\Order\Shipment::XML_PATH_STORE_CITY, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, + OrderShipment::XML_PATH_STORE_CITY, + ScopeInterface::SCOPE_STORE, $request->getStoreId() ) ); @@ -516,7 +536,7 @@ protected function _getCgiQuotes() if (!$url) { $url = $this->_defaultCgiGatewayUrl; } - $client = new \Zend_Http_Client(); + $client = new Zend_Http_Client(); $client->setUri($url); $client->setConfig(['maxredirects' => 0, 'timeout' => 30]); $client->setParameterGet($params); @@ -525,7 +545,7 @@ protected function _getCgiQuotes() $debugData['result'] = $responseBody; $this->_setCachedQuotes($params, $responseBody); - } catch (\Throwable $e) { + } catch (Throwable $e) { $debugData['result'] = ['error' => $e->getMessage(), 'code' => $e->getCode()]; $responseBody = ''; } @@ -727,7 +747,7 @@ protected function _getXmlQuotes() <StateProvinceCode>{$shipperStateProvince}</StateProvinceCode> </Address> </Shipper> - + <ShipTo> <Address> <PostalCode>{$params['19_destPostal']}</PostalCode> @@ -743,7 +763,7 @@ protected function _getXmlQuotes() $xmlParams .= <<<XMLRequest </Address> </ShipTo> - + <ShipFrom> <Address> <PostalCode>{$params['15_origPostal']}</PostalCode> @@ -1056,7 +1076,7 @@ protected function setXMLAccessRequest() * Get cgi tracking * * @param string[] $trackings - * @return \Magento\Shipping\Model\Tracking\ResultFactory + * @return TrackFactory */ protected function _getCgiTracking($trackings) { @@ -1321,13 +1341,13 @@ public function getAllowedMethods() /** * Form XML for shipment request * - * @param \Magento\Framework\DataObject $request + * @param DataObject $request * @return string * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ - protected function _formShipmentRequest(\Magento\Framework\DataObject $request) + protected function _formShipmentRequest(DataObject $request) { $packageParams = $request->getPackageParams(); $height = $packageParams->getHeight(); @@ -1339,7 +1359,7 @@ protected function _formShipmentRequest(\Magento\Framework\DataObject $request) $itemsDesc = []; $itemsShipment = $request->getPackageItems(); foreach ($itemsShipment as $itemShipment) { - $item = new \Magento\Framework\DataObject(); + $item = new DataObject(); $item->setData($itemShipment); $itemsDesc[] = $item->getName(); } @@ -1533,7 +1553,7 @@ protected function _formShipmentRequest(\Magento\Framework\DataObject $request) * Send and process shipment accept request * * @param Element $shipmentConfirmResponse - * @return \Magento\Framework\DataObject + * @return DataObject * @deprecated New asynchronous methods introduced. * @see requestToShipment */ @@ -1559,18 +1579,18 @@ protected function _sendShipmentAcceptRequest(Element $shipmentConfirmResponse) $xmlResponse = $deferredResponse->get()->getBody(); $debugData['result'] = $xmlResponse; $this->_setCachedQuotes($xmlRequest, $xmlResponse); - } catch (\Throwable $e) { + } catch (Throwable $e) { $debugData['result'] = ['error' => $e->getMessage(), 'code' => $e->getCode()]; $xmlResponse = ''; } try { $response = $this->_xmlElFactory->create(['data' => $xmlResponse]); - } catch (\Throwable $e) { + } catch (Throwable $e) { $debugData['result'] = ['error' => $e->getMessage(), 'code' => $e->getCode()]; } - $result = new \Magento\Framework\DataObject(); + $result = new DataObject(); if (isset($response->Error)) { $result->setErrors((string)$response->Error->ErrorDescription); } else { @@ -1609,7 +1629,7 @@ public function getShipAcceptUrl() * @param DataObject[] $packages * @return string[] Quote IDs. * @throws LocalizedException - * @throws \RuntimeException + * @throws RuntimeException */ private function requestQuotes(array $packages): array { @@ -1640,13 +1660,13 @@ private function requestQuotes(array $packages): array try { /** @var Element $response */ $response = $this->_xmlElFactory->create(['data' => $httpResponse->getBody()]); - } catch (\Throwable $e) { - throw new \RuntimeException($e->getMessage()); + } catch (Throwable $e) { + throw new RuntimeException($e->getMessage()); } if (isset($response->Response->Error) && in_array($response->Response->Error->ErrorSeverity, ['Hard', 'Transient']) ) { - throw new \RuntimeException((string)$response->Response->Error->ErrorDescription); + throw new RuntimeException((string)$response->Response->Error->ErrorDescription); } $ids[] = $response->ShipmentDigest; @@ -1661,7 +1681,7 @@ private function requestQuotes(array $packages): array * @param string[] $quoteIds * @return DataObject[] * @throws LocalizedException - * @throws \RuntimeException + * @throws RuntimeException */ private function requestShipments(array $quoteIds): array { @@ -1697,11 +1717,11 @@ private function requestShipments(array $quoteIds): array try { /** @var Element $response */ $response = $this->_xmlElFactory->create(['data' => $httpResponse->getBody()]); - } catch (\Throwable $e) { - throw new \RuntimeException($e->getMessage()); + } catch (Throwable $e) { + throw new RuntimeException($e->getMessage()); } if (isset($response->Error)) { - throw new \RuntimeException((string)$response->Error->ErrorDescription); + throw new RuntimeException((string)$response->Error->ErrorDescription); } else { $shippingLabelContent = (string)$response->ShipmentResults->PackageResults->LabelImage->GraphicImage; $trackingNumber = (string)$response->ShipmentResults->PackageResults->TrackingNumber; @@ -1726,7 +1746,7 @@ private function requestShipments(array $quoteIds): array protected function _doShipmentRequest(DataObject $request) { $this->_prepareShipmentRequest($request); - $result = new \Magento\Framework\DataObject(); + $result = new DataObject(); $rawXmlRequest = $this->_formShipmentRequest($request); $this->setXMLAccessRequest(); $xmlRequest = $this->_xmlAccessRequest . $rawXmlRequest; @@ -1747,14 +1767,14 @@ protected function _doShipmentRequest(DataObject $request) $xmlResponse = $deferredResponse->get()->getBody(); $debugData['result'] = $xmlResponse; $this->_setCachedQuotes($xmlRequest, $xmlResponse); - } catch (\Throwable $e) { + } catch (Throwable $e) { $debugData['result'] = ['code' => $e->getCode(), 'error' => $e->getMessage()]; } } try { $response = $this->_xmlElFactory->create(['data' => $xmlResponse]); - } catch (\Throwable $e) { + } catch (Throwable $e) { $debugData['result'] = ['error' => $e->getMessage(), 'code' => $e->getCode()]; $result->setErrors($e->getMessage()); } @@ -1827,7 +1847,7 @@ public function requestToShipment($request) $labels = $this->requestShipments($quoteIds); } catch (LocalizedException $exception) { return new DataObject(['errors' => [$exception->getMessage()]]); - } catch (\RuntimeException $exception) { + } catch (RuntimeException $exception) { return new DataObject(['errors' => __('Failed to send items')]); } // phpcs:enable @@ -1848,11 +1868,11 @@ public function returnOfShipment($request) /** * Return container types of carrier * - * @param \Magento\Framework\DataObject|null $params + * @param DataObject|null $params * @return array|bool * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ - public function getContainerTypes(\Magento\Framework\DataObject $params = null) + public function getContainerTypes(DataObject $params = null) { if ($params === null) { return $this->_getAllowedContainers($params); @@ -1932,10 +1952,10 @@ public function getContainerTypesFilter() /** * Return delivery confirmation types of carrier * - * @param \Magento\Framework\DataObject|null $params + * @param DataObject|null $params * @return array|bool */ - public function getDeliveryConfirmationTypes(\Magento\Framework\DataObject $params = null) + public function getDeliveryConfirmationTypes(DataObject $params = null) { $countryRecipient = $params != null ? $params->getCountryRecipient() : null; $deliveryConfirmationTypes = []; From 2179e73729b37f3aaebf0229f043f69e8d775b40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 19 Dec 2019 05:04:27 +0100 Subject: [PATCH 422/586] `use` section does not need leading backslash --- app/code/Magento/AdminAnalytics/registration.php | 2 +- app/code/Magento/AdminNotification/registration.php | 2 +- app/code/Magento/AdvancedPricingImportExport/registration.php | 2 +- app/code/Magento/AdvancedSearch/registration.php | 2 +- app/code/Magento/Amqp/registration.php | 2 +- app/code/Magento/AmqpStore/registration.php | 2 +- app/code/Magento/AsynchronousOperations/registration.php | 2 +- app/code/Magento/Authorization/registration.php | 2 +- app/code/Magento/Authorizenet/registration.php | 2 +- app/code/Magento/AuthorizenetAcceptjs/registration.php | 2 +- app/code/Magento/AuthorizenetCardinal/registration.php | 2 +- app/code/Magento/Backend/registration.php | 2 +- app/code/Magento/Backup/registration.php | 2 +- app/code/Magento/Braintree/registration.php | 2 +- app/code/Magento/Bundle/registration.php | 2 +- app/code/Magento/BundleImportExport/registration.php | 2 +- app/code/Magento/CacheInvalidate/registration.php | 2 +- app/code/Magento/Captcha/registration.php | 2 +- app/code/Magento/CardinalCommerce/registration.php | 2 +- app/code/Magento/Catalog/registration.php | 2 +- app/code/Magento/CatalogImportExport/registration.php | 2 +- app/code/Magento/CatalogInventory/registration.php | 2 +- app/code/Magento/CatalogRule/registration.php | 2 +- app/code/Magento/CatalogRuleConfigurable/registration.php | 2 +- app/code/Magento/CatalogSearch/registration.php | 2 +- app/code/Magento/CatalogUrlRewrite/registration.php | 2 +- app/code/Magento/CatalogWidget/registration.php | 2 +- app/code/Magento/Checkout/registration.php | 2 +- app/code/Magento/CheckoutAgreements/registration.php | 2 +- app/code/Magento/Cms/registration.php | 2 +- app/code/Magento/CmsUrlRewrite/registration.php | 2 +- app/code/Magento/Config/registration.php | 2 +- app/code/Magento/ConfigurableImportExport/registration.php | 2 +- app/code/Magento/ConfigurableProduct/registration.php | 2 +- app/code/Magento/ConfigurableProductSales/registration.php | 2 +- app/code/Magento/Contact/registration.php | 2 +- app/code/Magento/Cookie/registration.php | 2 +- app/code/Magento/Cron/registration.php | 2 +- app/code/Magento/Csp/registration.php | 2 +- app/code/Magento/CurrencySymbol/registration.php | 2 +- app/code/Magento/Customer/registration.php | 2 +- app/code/Magento/CustomerImportExport/registration.php | 2 +- app/code/Magento/Deploy/registration.php | 2 +- app/code/Magento/Developer/registration.php | 2 +- app/code/Magento/Dhl/registration.php | 2 +- app/code/Magento/Directory/registration.php | 2 +- app/code/Magento/Downloadable/registration.php | 2 +- app/code/Magento/DownloadableImportExport/registration.php | 2 +- app/code/Magento/Eav/registration.php | 2 +- app/code/Magento/Email/registration.php | 2 +- app/code/Magento/EncryptionKey/registration.php | 2 +- app/code/Magento/Fedex/registration.php | 2 +- app/code/Magento/GiftMessage/registration.php | 2 +- app/code/Magento/GoogleAdwords/registration.php | 2 +- app/code/Magento/GoogleAnalytics/registration.php | 2 +- app/code/Magento/GoogleOptimizer/registration.php | 2 +- app/code/Magento/GroupedCatalogInventory/registration.php | 2 +- app/code/Magento/GroupedImportExport/registration.php | 2 +- app/code/Magento/GroupedProduct/registration.php | 2 +- app/code/Magento/ImportExport/registration.php | 2 +- app/code/Magento/Indexer/registration.php | 2 +- app/code/Magento/InstantPurchase/registration.php | 2 +- app/code/Magento/Integration/registration.php | 2 +- app/code/Magento/LayeredNavigation/registration.php | 2 +- app/code/Magento/Marketplace/registration.php | 2 +- app/code/Magento/MediaStorage/registration.php | 2 +- app/code/Magento/MessageQueue/registration.php | 2 +- app/code/Magento/Msrp/registration.php | 2 +- app/code/Magento/MsrpConfigurableProduct/registration.php | 2 +- app/code/Magento/MsrpGroupedProduct/registration.php | 2 +- app/code/Magento/Multishipping/registration.php | 2 +- app/code/Magento/MysqlMq/registration.php | 2 +- app/code/Magento/NewRelicReporting/registration.php | 2 +- app/code/Magento/Newsletter/registration.php | 2 +- app/code/Magento/OfflinePayments/registration.php | 2 +- app/code/Magento/OfflineShipping/registration.php | 2 +- app/code/Magento/PageCache/registration.php | 2 +- app/code/Magento/Payment/registration.php | 2 +- app/code/Magento/Paypal/registration.php | 2 +- app/code/Magento/PaypalCaptcha/registration.php | 2 +- app/code/Magento/PaypalGraphQl/registration.php | 2 +- app/code/Magento/Persistent/registration.php | 2 +- app/code/Magento/ProductAlert/registration.php | 2 +- app/code/Magento/ProductVideo/registration.php | 2 +- app/code/Magento/Quote/registration.php | 2 +- app/code/Magento/Reports/registration.php | 2 +- app/code/Magento/RequireJs/registration.php | 2 +- app/code/Magento/Review/registration.php | 2 +- app/code/Magento/Robots/registration.php | 2 +- app/code/Magento/Rss/registration.php | 2 +- app/code/Magento/Rule/registration.php | 2 +- app/code/Magento/Sales/registration.php | 2 +- app/code/Magento/SalesInventory/registration.php | 2 +- app/code/Magento/SalesRule/registration.php | 2 +- app/code/Magento/SalesSequence/registration.php | 2 +- app/code/Magento/SampleData/registration.php | 2 +- app/code/Magento/Search/registration.php | 2 +- app/code/Magento/Security/registration.php | 2 +- app/code/Magento/SendFriend/registration.php | 2 +- app/code/Magento/Shipping/registration.php | 2 +- app/code/Magento/Signifyd/registration.php | 2 +- app/code/Magento/Sitemap/registration.php | 2 +- app/code/Magento/Store/registration.php | 2 +- app/code/Magento/Swagger/registration.php | 2 +- app/code/Magento/SwaggerWebapi/registration.php | 2 +- app/code/Magento/SwaggerWebapiAsync/registration.php | 2 +- app/code/Magento/Swatches/registration.php | 2 +- app/code/Magento/SwatchesLayeredNavigation/registration.php | 2 +- app/code/Magento/Tax/registration.php | 2 +- app/code/Magento/TaxImportExport/registration.php | 2 +- app/code/Magento/Theme/registration.php | 2 +- app/code/Magento/Tinymce3/registration.php | 2 +- app/code/Magento/Translation/registration.php | 2 +- app/code/Magento/Ui/registration.php | 2 +- app/code/Magento/Ups/registration.php | 2 +- app/code/Magento/UrlRewrite/registration.php | 2 +- app/code/Magento/User/registration.php | 2 +- app/code/Magento/Usps/registration.php | 2 +- app/code/Magento/Variable/registration.php | 2 +- app/code/Magento/Vault/registration.php | 2 +- app/code/Magento/Version/registration.php | 2 +- app/code/Magento/Webapi/registration.php | 2 +- app/code/Magento/WebapiSecurity/registration.php | 2 +- app/code/Magento/Weee/registration.php | 2 +- app/code/Magento/Widget/registration.php | 2 +- app/code/Magento/Wishlist/registration.php | 2 +- app/design/adminhtml/Magento/backend/registration.php | 2 +- app/design/frontend/Magento/blank/registration.php | 2 +- app/design/frontend/Magento/luma/registration.php | 2 +- app/i18n/Magento/de_DE/registration.php | 2 +- app/i18n/Magento/en_US/registration.php | 2 +- app/i18n/Magento/es_ES/registration.php | 2 +- app/i18n/Magento/fr_FR/registration.php | 2 +- app/i18n/Magento/nl_NL/registration.php | 2 +- app/i18n/Magento/pt_BR/registration.php | 2 +- app/i18n/Magento/zh_Hans_CN/registration.php | 2 +- .../Test/Annotation/_files/components/a/aa/aaa/registration.php | 2 +- .../Test/Annotation/_files/components/a/aa/registration.php | 2 +- .../Test/Annotation/_files/components/b/registration.php | 2 +- .../Magento/Test/Annotation/_files/components/registration.php | 2 +- .../design/adminhtml/Magento/test_default/registration.php | 2 +- .../testsuite/Magento/Deploy/_files/zoom1/registration.php | 2 +- .../testsuite/Magento/Deploy/_files/zoom2/registration.php | 2 +- .../testsuite/Magento/Deploy/_files/zoom3/registration.php | 2 +- .../_files/design/adminhtml/Magento/default/registration.php | 2 +- .../design/adminhtml/Vendor/custom_theme/registration.php | 2 +- .../_files/design/adminhtml/Vendor/default/registration.php | 2 +- .../_files/design/frontend/Magento/default/registration.php | 2 +- .../_files/design/frontend/Vendor/custom_theme/registration.php | 2 +- .../_files/design/frontend/Vendor/default/registration.php | 2 +- .../Framework/App/Language/_files/bar/en_gb/registration.php | 2 +- .../Framework/App/Language/_files/bar/en_us/registration.php | 2 +- .../Framework/App/Language/_files/baz/en_gb/registration.php | 2 +- .../Framework/App/Language/_files/first/en_us/registration.php | 2 +- .../Framework/App/Language/_files/foo/en_au/registration.php | 2 +- .../Framework/App/Language/_files/my/ru_ru/registration.php | 2 +- .../Framework/App/Language/_files/second/en_gb/registration.php | 2 +- .../Framework/App/Language/_files/theirs/ru_ru/registration.php | 2 +- .../App/Utility/_files/fixtures/language/registration.php | 2 +- .../App/Utility/_files/fixtures/library/registration.php | 2 +- .../App/Utility/_files/fixtures/module/registration.php | 2 +- .../App/Utility/_files/fixtures/theme/registration.php | 2 +- .../Css/PreProcessor/_files/code/Magento/Other/registration.php | 2 +- .../Css/PreProcessor/_files/code/Magento/Third/registration.php | 2 +- .../_files/design/frontend/Test/default/registration.php | 2 +- .../_files/design/frontend/Test/parent/registration.php | 2 +- .../Framework/View/_files/Fixture_Module/registration.php | 2 +- .../Framework/View/_files/UiComponent/theme/registration.php | 2 +- .../_files/fallback/app/code/ViewTest_Module/registration.php | 2 +- .../design/frontend/Vendor/custom_theme/registration.php | 2 +- .../design/frontend/Vendor/custom_theme2/registration.php | 2 +- .../fallback/design/frontend/Vendor/default/registration.php | 2 +- .../design/frontend/Vendor/standalone_theme/registration.php | 2 +- .../Magento/Framework/View/_files/static/theme/registration.php | 2 +- .../Command/_files/root/app/code/Magento/A/registration.php | 2 +- .../Command/_files/root/app/code/Magento/B/registration.php | 2 +- .../Command/_files/root/app/code/Magento/C/registration.php | 2 +- .../Command/_files/root/app/code/Magento/D/registration.php | 2 +- .../Model/_files/design/adminhtml/Vendor/test/registration.php | 2 +- .../_files/design/area_two/Vendor/theme_one/registration.php | 2 +- .../_files/design/design_area/Vendor/theme_one/registration.php | 2 +- .../_files/design/frontend/Magento/default/registration.php | 2 +- .../design/frontend/Magento/default_iphone/registration.php | 2 +- .../design/frontend/Test/cache_test_theme/registration.php | 2 +- .../Model/_files/design/frontend/Test/default/registration.php | 2 +- .../_files/design/frontend/Test/publication/registration.php | 2 +- .../_files/design/frontend/Test/test_theme/registration.php | 2 +- .../_files/design/frontend/Vendor/custom_theme/registration.php | 2 +- .../_files/design/frontend/Vendor/default/registration.php | 2 +- lib/internal/Magento/Framework/Amqp/registration.php | 2 +- lib/internal/Magento/Framework/Bulk/registration.php | 2 +- lib/internal/Magento/Framework/MessageQueue/registration.php | 2 +- lib/internal/Magento/Framework/registration.php | 2 +- setup/src/Magento/Setup/registration.php | 2 +- 194 files changed, 194 insertions(+), 194 deletions(-) diff --git a/app/code/Magento/AdminAnalytics/registration.php b/app/code/Magento/AdminAnalytics/registration.php index 65c9955d396a8..7d45f9f2b82e5 100644 --- a/app/code/Magento/AdminAnalytics/registration.php +++ b/app/code/Magento/AdminAnalytics/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_AdminAnalytics', __DIR__); diff --git a/app/code/Magento/AdminNotification/registration.php b/app/code/Magento/AdminNotification/registration.php index 8d427a458c18d..de8995efdb137 100644 --- a/app/code/Magento/AdminNotification/registration.php +++ b/app/code/Magento/AdminNotification/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_AdminNotification', __DIR__); diff --git a/app/code/Magento/AdvancedPricingImportExport/registration.php b/app/code/Magento/AdvancedPricingImportExport/registration.php index 7a1d2feeccd45..8429e82b27fda 100644 --- a/app/code/Magento/AdvancedPricingImportExport/registration.php +++ b/app/code/Magento/AdvancedPricingImportExport/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_AdvancedPricingImportExport', __DIR__); diff --git a/app/code/Magento/AdvancedSearch/registration.php b/app/code/Magento/AdvancedSearch/registration.php index c82ffa8e7e4d6..2c600f550dcf5 100644 --- a/app/code/Magento/AdvancedSearch/registration.php +++ b/app/code/Magento/AdvancedSearch/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_AdvancedSearch', __DIR__); diff --git a/app/code/Magento/Amqp/registration.php b/app/code/Magento/Amqp/registration.php index 17d8382c698e8..2e4a4f362f1a3 100644 --- a/app/code/Magento/Amqp/registration.php +++ b/app/code/Magento/Amqp/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Amqp', __DIR__); diff --git a/app/code/Magento/AmqpStore/registration.php b/app/code/Magento/AmqpStore/registration.php index 4922879bfbf16..22ce677dc8302 100644 --- a/app/code/Magento/AmqpStore/registration.php +++ b/app/code/Magento/AmqpStore/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_AmqpStore', __DIR__); diff --git a/app/code/Magento/AsynchronousOperations/registration.php b/app/code/Magento/AsynchronousOperations/registration.php index d384df583fb5a..748f9d35aad5c 100644 --- a/app/code/Magento/AsynchronousOperations/registration.php +++ b/app/code/Magento/AsynchronousOperations/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_AsynchronousOperations', __DIR__); diff --git a/app/code/Magento/Authorization/registration.php b/app/code/Magento/Authorization/registration.php index 0007aeba9a1ba..a4520bdcdb26b 100644 --- a/app/code/Magento/Authorization/registration.php +++ b/app/code/Magento/Authorization/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Authorization', __DIR__); diff --git a/app/code/Magento/Authorizenet/registration.php b/app/code/Magento/Authorizenet/registration.php index b96b8227bbbf8..cb3bedaaee27d 100644 --- a/app/code/Magento/Authorizenet/registration.php +++ b/app/code/Magento/Authorizenet/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Authorizenet', __DIR__); diff --git a/app/code/Magento/AuthorizenetAcceptjs/registration.php b/app/code/Magento/AuthorizenetAcceptjs/registration.php index 5338c9a4ddc80..52a0c497a0993 100644 --- a/app/code/Magento/AuthorizenetAcceptjs/registration.php +++ b/app/code/Magento/AuthorizenetAcceptjs/registration.php @@ -6,6 +6,6 @@ declare(strict_types=1); -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_AuthorizenetAcceptjs', __DIR__); diff --git a/app/code/Magento/AuthorizenetCardinal/registration.php b/app/code/Magento/AuthorizenetCardinal/registration.php index 0153e9eaa4d29..7d663df3c3e3a 100644 --- a/app/code/Magento/AuthorizenetCardinal/registration.php +++ b/app/code/Magento/AuthorizenetCardinal/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_AuthorizenetCardinal', __DIR__); diff --git a/app/code/Magento/Backend/registration.php b/app/code/Magento/Backend/registration.php index a7a5a58ca0d9c..8f0c19af6e89a 100644 --- a/app/code/Magento/Backend/registration.php +++ b/app/code/Magento/Backend/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Backend', __DIR__); diff --git a/app/code/Magento/Backup/registration.php b/app/code/Magento/Backup/registration.php index 811e3c5657484..59864b84d8217 100644 --- a/app/code/Magento/Backup/registration.php +++ b/app/code/Magento/Backup/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Backup', __DIR__); diff --git a/app/code/Magento/Braintree/registration.php b/app/code/Magento/Braintree/registration.php index 9a266e9706c7d..1a0d00ec6557d 100644 --- a/app/code/Magento/Braintree/registration.php +++ b/app/code/Magento/Braintree/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Braintree', __DIR__); diff --git a/app/code/Magento/Bundle/registration.php b/app/code/Magento/Bundle/registration.php index 85d0b8d5c7a3e..bd7dc39cb4ad6 100644 --- a/app/code/Magento/Bundle/registration.php +++ b/app/code/Magento/Bundle/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Bundle', __DIR__); diff --git a/app/code/Magento/BundleImportExport/registration.php b/app/code/Magento/BundleImportExport/registration.php index 2f68e2e05c036..db96b4d9dd470 100644 --- a/app/code/Magento/BundleImportExport/registration.php +++ b/app/code/Magento/BundleImportExport/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_BundleImportExport', __DIR__); diff --git a/app/code/Magento/CacheInvalidate/registration.php b/app/code/Magento/CacheInvalidate/registration.php index 5910edade1092..1c1ac92e330b0 100644 --- a/app/code/Magento/CacheInvalidate/registration.php +++ b/app/code/Magento/CacheInvalidate/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_CacheInvalidate', __DIR__); diff --git a/app/code/Magento/Captcha/registration.php b/app/code/Magento/Captcha/registration.php index d6c49c719c969..6721e4abcec61 100644 --- a/app/code/Magento/Captcha/registration.php +++ b/app/code/Magento/Captcha/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Captcha', __DIR__); diff --git a/app/code/Magento/CardinalCommerce/registration.php b/app/code/Magento/CardinalCommerce/registration.php index 26fb168fb0ae2..714c7692cf4b5 100644 --- a/app/code/Magento/CardinalCommerce/registration.php +++ b/app/code/Magento/CardinalCommerce/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_CardinalCommerce', __DIR__); diff --git a/app/code/Magento/Catalog/registration.php b/app/code/Magento/Catalog/registration.php index fb94e04aa2be0..e18d43d9a36d8 100644 --- a/app/code/Magento/Catalog/registration.php +++ b/app/code/Magento/Catalog/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Catalog', __DIR__); diff --git a/app/code/Magento/CatalogImportExport/registration.php b/app/code/Magento/CatalogImportExport/registration.php index 144a7cdaeeea0..bd6683f4af4d1 100644 --- a/app/code/Magento/CatalogImportExport/registration.php +++ b/app/code/Magento/CatalogImportExport/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_CatalogImportExport', __DIR__); diff --git a/app/code/Magento/CatalogInventory/registration.php b/app/code/Magento/CatalogInventory/registration.php index da5cb708ea17f..d39cc2074d890 100644 --- a/app/code/Magento/CatalogInventory/registration.php +++ b/app/code/Magento/CatalogInventory/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_CatalogInventory', __DIR__); diff --git a/app/code/Magento/CatalogRule/registration.php b/app/code/Magento/CatalogRule/registration.php index ec3cbee2e1582..fb370fedf3752 100644 --- a/app/code/Magento/CatalogRule/registration.php +++ b/app/code/Magento/CatalogRule/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_CatalogRule', __DIR__); diff --git a/app/code/Magento/CatalogRuleConfigurable/registration.php b/app/code/Magento/CatalogRuleConfigurable/registration.php index 0cc791e23a9a4..5f60111f246f1 100644 --- a/app/code/Magento/CatalogRuleConfigurable/registration.php +++ b/app/code/Magento/CatalogRuleConfigurable/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_CatalogRuleConfigurable', __DIR__); diff --git a/app/code/Magento/CatalogSearch/registration.php b/app/code/Magento/CatalogSearch/registration.php index 959e26c84a722..31f792d2ea90c 100644 --- a/app/code/Magento/CatalogSearch/registration.php +++ b/app/code/Magento/CatalogSearch/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_CatalogSearch', __DIR__); diff --git a/app/code/Magento/CatalogUrlRewrite/registration.php b/app/code/Magento/CatalogUrlRewrite/registration.php index 50a5544c738d0..f00aaf5bb5518 100644 --- a/app/code/Magento/CatalogUrlRewrite/registration.php +++ b/app/code/Magento/CatalogUrlRewrite/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_CatalogUrlRewrite', __DIR__); diff --git a/app/code/Magento/CatalogWidget/registration.php b/app/code/Magento/CatalogWidget/registration.php index f9e6a76047ad9..09cd043c70c76 100644 --- a/app/code/Magento/CatalogWidget/registration.php +++ b/app/code/Magento/CatalogWidget/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_CatalogWidget', __DIR__); diff --git a/app/code/Magento/Checkout/registration.php b/app/code/Magento/Checkout/registration.php index 741146232ee25..ca98e2eef761f 100644 --- a/app/code/Magento/Checkout/registration.php +++ b/app/code/Magento/Checkout/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Checkout', __DIR__); diff --git a/app/code/Magento/CheckoutAgreements/registration.php b/app/code/Magento/CheckoutAgreements/registration.php index b4d4ce25d2826..15562341a94ae 100644 --- a/app/code/Magento/CheckoutAgreements/registration.php +++ b/app/code/Magento/CheckoutAgreements/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_CheckoutAgreements', __DIR__); diff --git a/app/code/Magento/Cms/registration.php b/app/code/Magento/Cms/registration.php index d9feda25d6118..aa55b4932fdba 100644 --- a/app/code/Magento/Cms/registration.php +++ b/app/code/Magento/Cms/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Cms', __DIR__); diff --git a/app/code/Magento/CmsUrlRewrite/registration.php b/app/code/Magento/CmsUrlRewrite/registration.php index aad46cb41827c..6acd495235110 100644 --- a/app/code/Magento/CmsUrlRewrite/registration.php +++ b/app/code/Magento/CmsUrlRewrite/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_CmsUrlRewrite', __DIR__); diff --git a/app/code/Magento/Config/registration.php b/app/code/Magento/Config/registration.php index 8a57e9d5c2217..a6dd84b3a23ef 100644 --- a/app/code/Magento/Config/registration.php +++ b/app/code/Magento/Config/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Config', __DIR__); diff --git a/app/code/Magento/ConfigurableImportExport/registration.php b/app/code/Magento/ConfigurableImportExport/registration.php index 103565fb30a93..305ff345893c0 100644 --- a/app/code/Magento/ConfigurableImportExport/registration.php +++ b/app/code/Magento/ConfigurableImportExport/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_ConfigurableImportExport', __DIR__); diff --git a/app/code/Magento/ConfigurableProduct/registration.php b/app/code/Magento/ConfigurableProduct/registration.php index fdb3fba0c9912..80572b8609ec6 100644 --- a/app/code/Magento/ConfigurableProduct/registration.php +++ b/app/code/Magento/ConfigurableProduct/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_ConfigurableProduct', __DIR__); diff --git a/app/code/Magento/ConfigurableProductSales/registration.php b/app/code/Magento/ConfigurableProductSales/registration.php index 99affe39c15c1..a6d88cff482e4 100644 --- a/app/code/Magento/ConfigurableProductSales/registration.php +++ b/app/code/Magento/ConfigurableProductSales/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_ConfigurableProductSales', __DIR__); diff --git a/app/code/Magento/Contact/registration.php b/app/code/Magento/Contact/registration.php index b280b2e0b81a2..0d8b36f51eda5 100644 --- a/app/code/Magento/Contact/registration.php +++ b/app/code/Magento/Contact/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Contact', __DIR__); diff --git a/app/code/Magento/Cookie/registration.php b/app/code/Magento/Cookie/registration.php index 64f13f19968ce..5b5b7b1f3c96f 100644 --- a/app/code/Magento/Cookie/registration.php +++ b/app/code/Magento/Cookie/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Cookie', __DIR__); diff --git a/app/code/Magento/Cron/registration.php b/app/code/Magento/Cron/registration.php index d22298a2efc37..97f162d76ec52 100644 --- a/app/code/Magento/Cron/registration.php +++ b/app/code/Magento/Cron/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Cron', __DIR__); diff --git a/app/code/Magento/Csp/registration.php b/app/code/Magento/Csp/registration.php index 90f4a25452858..337cfbc23f2de 100644 --- a/app/code/Magento/Csp/registration.php +++ b/app/code/Magento/Csp/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Csp', __DIR__); diff --git a/app/code/Magento/CurrencySymbol/registration.php b/app/code/Magento/CurrencySymbol/registration.php index 4dea4264e8b62..bf30fc7fe6a7b 100644 --- a/app/code/Magento/CurrencySymbol/registration.php +++ b/app/code/Magento/CurrencySymbol/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_CurrencySymbol', __DIR__); diff --git a/app/code/Magento/Customer/registration.php b/app/code/Magento/Customer/registration.php index 744defc54ab27..4b88dbdab1d0e 100644 --- a/app/code/Magento/Customer/registration.php +++ b/app/code/Magento/Customer/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Customer', __DIR__); diff --git a/app/code/Magento/CustomerImportExport/registration.php b/app/code/Magento/CustomerImportExport/registration.php index 1cfb0ed8899ad..68a23fe6be57c 100644 --- a/app/code/Magento/CustomerImportExport/registration.php +++ b/app/code/Magento/CustomerImportExport/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_CustomerImportExport', __DIR__); diff --git a/app/code/Magento/Deploy/registration.php b/app/code/Magento/Deploy/registration.php index 138d03fd303cf..6cd92601dff88 100644 --- a/app/code/Magento/Deploy/registration.php +++ b/app/code/Magento/Deploy/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Deploy', __DIR__); diff --git a/app/code/Magento/Developer/registration.php b/app/code/Magento/Developer/registration.php index 1d3fb6148ce1f..e99b1ed24b104 100644 --- a/app/code/Magento/Developer/registration.php +++ b/app/code/Magento/Developer/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Developer', __DIR__); diff --git a/app/code/Magento/Dhl/registration.php b/app/code/Magento/Dhl/registration.php index 4d69e96f1ff8a..a8a0b58a5c6f3 100644 --- a/app/code/Magento/Dhl/registration.php +++ b/app/code/Magento/Dhl/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Dhl', __DIR__); diff --git a/app/code/Magento/Directory/registration.php b/app/code/Magento/Directory/registration.php index 17dece4a9d79d..142b6a3114384 100644 --- a/app/code/Magento/Directory/registration.php +++ b/app/code/Magento/Directory/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Directory', __DIR__); diff --git a/app/code/Magento/Downloadable/registration.php b/app/code/Magento/Downloadable/registration.php index c50856603fa50..a99b7129eebc8 100644 --- a/app/code/Magento/Downloadable/registration.php +++ b/app/code/Magento/Downloadable/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Downloadable', __DIR__); diff --git a/app/code/Magento/DownloadableImportExport/registration.php b/app/code/Magento/DownloadableImportExport/registration.php index 0dcd082deb6d8..35147034c8d1e 100644 --- a/app/code/Magento/DownloadableImportExport/registration.php +++ b/app/code/Magento/DownloadableImportExport/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_DownloadableImportExport', __DIR__); diff --git a/app/code/Magento/Eav/registration.php b/app/code/Magento/Eav/registration.php index 6506d5cd06738..07b222f67f633 100644 --- a/app/code/Magento/Eav/registration.php +++ b/app/code/Magento/Eav/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Eav', __DIR__); diff --git a/app/code/Magento/Email/registration.php b/app/code/Magento/Email/registration.php index 70601ab3d3b04..132f509e93cc0 100644 --- a/app/code/Magento/Email/registration.php +++ b/app/code/Magento/Email/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Email', __DIR__); diff --git a/app/code/Magento/EncryptionKey/registration.php b/app/code/Magento/EncryptionKey/registration.php index 4426a9200e571..773cf44a207c4 100644 --- a/app/code/Magento/EncryptionKey/registration.php +++ b/app/code/Magento/EncryptionKey/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_EncryptionKey', __DIR__); diff --git a/app/code/Magento/Fedex/registration.php b/app/code/Magento/Fedex/registration.php index bb44e20ec4674..3562091f9ba68 100644 --- a/app/code/Magento/Fedex/registration.php +++ b/app/code/Magento/Fedex/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Fedex', __DIR__); diff --git a/app/code/Magento/GiftMessage/registration.php b/app/code/Magento/GiftMessage/registration.php index c7268d09cf929..78676ef9c32d0 100644 --- a/app/code/Magento/GiftMessage/registration.php +++ b/app/code/Magento/GiftMessage/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_GiftMessage', __DIR__); diff --git a/app/code/Magento/GoogleAdwords/registration.php b/app/code/Magento/GoogleAdwords/registration.php index 76aa83a3a55f9..e6ef3f7625f19 100644 --- a/app/code/Magento/GoogleAdwords/registration.php +++ b/app/code/Magento/GoogleAdwords/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_GoogleAdwords', __DIR__); diff --git a/app/code/Magento/GoogleAnalytics/registration.php b/app/code/Magento/GoogleAnalytics/registration.php index c2a8471a50ba2..6eae65b9d159e 100644 --- a/app/code/Magento/GoogleAnalytics/registration.php +++ b/app/code/Magento/GoogleAnalytics/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_GoogleAnalytics', __DIR__); diff --git a/app/code/Magento/GoogleOptimizer/registration.php b/app/code/Magento/GoogleOptimizer/registration.php index 36b94ef06eb18..4ba336ece8916 100644 --- a/app/code/Magento/GoogleOptimizer/registration.php +++ b/app/code/Magento/GoogleOptimizer/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_GoogleOptimizer', __DIR__); diff --git a/app/code/Magento/GroupedCatalogInventory/registration.php b/app/code/Magento/GroupedCatalogInventory/registration.php index 8899a48edf6d5..f9b2729acb45a 100644 --- a/app/code/Magento/GroupedCatalogInventory/registration.php +++ b/app/code/Magento/GroupedCatalogInventory/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_GroupedCatalogInventory', __DIR__); diff --git a/app/code/Magento/GroupedImportExport/registration.php b/app/code/Magento/GroupedImportExport/registration.php index 90beb26820c47..de4aec530794e 100644 --- a/app/code/Magento/GroupedImportExport/registration.php +++ b/app/code/Magento/GroupedImportExport/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_GroupedImportExport', __DIR__); diff --git a/app/code/Magento/GroupedProduct/registration.php b/app/code/Magento/GroupedProduct/registration.php index 8fd2f11a2f628..c3a7c4c12b1c6 100644 --- a/app/code/Magento/GroupedProduct/registration.php +++ b/app/code/Magento/GroupedProduct/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_GroupedProduct', __DIR__); diff --git a/app/code/Magento/ImportExport/registration.php b/app/code/Magento/ImportExport/registration.php index 5ecc71fa8676c..85df9b374fb4c 100644 --- a/app/code/Magento/ImportExport/registration.php +++ b/app/code/Magento/ImportExport/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_ImportExport', __DIR__); diff --git a/app/code/Magento/Indexer/registration.php b/app/code/Magento/Indexer/registration.php index dda2240601779..0a5f37e97ac82 100644 --- a/app/code/Magento/Indexer/registration.php +++ b/app/code/Magento/Indexer/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Indexer', __DIR__); diff --git a/app/code/Magento/InstantPurchase/registration.php b/app/code/Magento/InstantPurchase/registration.php index 74b4f3e92cf44..1f2fce8c12c07 100644 --- a/app/code/Magento/InstantPurchase/registration.php +++ b/app/code/Magento/InstantPurchase/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_InstantPurchase', __DIR__); diff --git a/app/code/Magento/Integration/registration.php b/app/code/Magento/Integration/registration.php index d73b6ae57eeb5..6d0fea09e2a40 100644 --- a/app/code/Magento/Integration/registration.php +++ b/app/code/Magento/Integration/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Integration', __DIR__); diff --git a/app/code/Magento/LayeredNavigation/registration.php b/app/code/Magento/LayeredNavigation/registration.php index 7c4f8dff9c920..9df0a63ae945f 100644 --- a/app/code/Magento/LayeredNavigation/registration.php +++ b/app/code/Magento/LayeredNavigation/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_LayeredNavigation', __DIR__); diff --git a/app/code/Magento/Marketplace/registration.php b/app/code/Magento/Marketplace/registration.php index 7d4bbca27f15f..6ccf343d76427 100644 --- a/app/code/Magento/Marketplace/registration.php +++ b/app/code/Magento/Marketplace/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Marketplace', __DIR__); diff --git a/app/code/Magento/MediaStorage/registration.php b/app/code/Magento/MediaStorage/registration.php index 8bfa83028eeeb..552f668426125 100644 --- a/app/code/Magento/MediaStorage/registration.php +++ b/app/code/Magento/MediaStorage/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_MediaStorage', __DIR__); diff --git a/app/code/Magento/MessageQueue/registration.php b/app/code/Magento/MessageQueue/registration.php index e27fa71517427..5608dbce482a9 100644 --- a/app/code/Magento/MessageQueue/registration.php +++ b/app/code/Magento/MessageQueue/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_MessageQueue', __DIR__); diff --git a/app/code/Magento/Msrp/registration.php b/app/code/Magento/Msrp/registration.php index 0c0269b39eeac..147d789975c3e 100644 --- a/app/code/Magento/Msrp/registration.php +++ b/app/code/Magento/Msrp/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Msrp', __DIR__); diff --git a/app/code/Magento/MsrpConfigurableProduct/registration.php b/app/code/Magento/MsrpConfigurableProduct/registration.php index d4d58ec3c013b..e0772ae9c78fd 100644 --- a/app/code/Magento/MsrpConfigurableProduct/registration.php +++ b/app/code/Magento/MsrpConfigurableProduct/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_MsrpConfigurableProduct', __DIR__); diff --git a/app/code/Magento/MsrpGroupedProduct/registration.php b/app/code/Magento/MsrpGroupedProduct/registration.php index c5a261e66c640..a429ec00cd437 100644 --- a/app/code/Magento/MsrpGroupedProduct/registration.php +++ b/app/code/Magento/MsrpGroupedProduct/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_MsrpGroupedProduct', __DIR__); diff --git a/app/code/Magento/Multishipping/registration.php b/app/code/Magento/Multishipping/registration.php index 6598a8e431ca8..f19d2c4d740d8 100644 --- a/app/code/Magento/Multishipping/registration.php +++ b/app/code/Magento/Multishipping/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Multishipping', __DIR__); diff --git a/app/code/Magento/MysqlMq/registration.php b/app/code/Magento/MysqlMq/registration.php index e13a38b468005..b0799f79b463f 100644 --- a/app/code/Magento/MysqlMq/registration.php +++ b/app/code/Magento/MysqlMq/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_MysqlMq', __DIR__); diff --git a/app/code/Magento/NewRelicReporting/registration.php b/app/code/Magento/NewRelicReporting/registration.php index 39984a11e26a3..8d43f8d1de563 100644 --- a/app/code/Magento/NewRelicReporting/registration.php +++ b/app/code/Magento/NewRelicReporting/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_NewRelicReporting', __DIR__); diff --git a/app/code/Magento/Newsletter/registration.php b/app/code/Magento/Newsletter/registration.php index 421b594ad6b88..b1a5714ff8a4d 100644 --- a/app/code/Magento/Newsletter/registration.php +++ b/app/code/Magento/Newsletter/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Newsletter', __DIR__); diff --git a/app/code/Magento/OfflinePayments/registration.php b/app/code/Magento/OfflinePayments/registration.php index 4b5473194f1e4..f3d1fd1488c76 100644 --- a/app/code/Magento/OfflinePayments/registration.php +++ b/app/code/Magento/OfflinePayments/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_OfflinePayments', __DIR__); diff --git a/app/code/Magento/OfflineShipping/registration.php b/app/code/Magento/OfflineShipping/registration.php index ce3611a90c657..5c2ff2d82f1fd 100644 --- a/app/code/Magento/OfflineShipping/registration.php +++ b/app/code/Magento/OfflineShipping/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_OfflineShipping', __DIR__); diff --git a/app/code/Magento/PageCache/registration.php b/app/code/Magento/PageCache/registration.php index 32628ae4446c9..69d49f120d4cf 100644 --- a/app/code/Magento/PageCache/registration.php +++ b/app/code/Magento/PageCache/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_PageCache', __DIR__); diff --git a/app/code/Magento/Payment/registration.php b/app/code/Magento/Payment/registration.php index 12f826a2ad5ce..9b1fb56a89600 100644 --- a/app/code/Magento/Payment/registration.php +++ b/app/code/Magento/Payment/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Payment', __DIR__); diff --git a/app/code/Magento/Paypal/registration.php b/app/code/Magento/Paypal/registration.php index f915d1d7b18d7..5b86f0d1ed627 100644 --- a/app/code/Magento/Paypal/registration.php +++ b/app/code/Magento/Paypal/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Paypal', __DIR__); diff --git a/app/code/Magento/PaypalCaptcha/registration.php b/app/code/Magento/PaypalCaptcha/registration.php index 4dac0582a6d1b..79f8a56411078 100644 --- a/app/code/Magento/PaypalCaptcha/registration.php +++ b/app/code/Magento/PaypalCaptcha/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_PaypalCaptcha', __DIR__); diff --git a/app/code/Magento/PaypalGraphQl/registration.php b/app/code/Magento/PaypalGraphQl/registration.php index 2e1676bc087cc..d3eb5dd3095a6 100644 --- a/app/code/Magento/PaypalGraphQl/registration.php +++ b/app/code/Magento/PaypalGraphQl/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_PaypalGraphQl', __DIR__); diff --git a/app/code/Magento/Persistent/registration.php b/app/code/Magento/Persistent/registration.php index bc77434391517..4ff1c96a45ae8 100644 --- a/app/code/Magento/Persistent/registration.php +++ b/app/code/Magento/Persistent/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Persistent', __DIR__); diff --git a/app/code/Magento/ProductAlert/registration.php b/app/code/Magento/ProductAlert/registration.php index d1492a6d10db6..f049de4aef26a 100644 --- a/app/code/Magento/ProductAlert/registration.php +++ b/app/code/Magento/ProductAlert/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_ProductAlert', __DIR__); diff --git a/app/code/Magento/ProductVideo/registration.php b/app/code/Magento/ProductVideo/registration.php index 39f0c452d3611..e49e231283f42 100644 --- a/app/code/Magento/ProductVideo/registration.php +++ b/app/code/Magento/ProductVideo/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_ProductVideo', __DIR__); diff --git a/app/code/Magento/Quote/registration.php b/app/code/Magento/Quote/registration.php index f74a3ac5ff9e5..da3425918cf0f 100644 --- a/app/code/Magento/Quote/registration.php +++ b/app/code/Magento/Quote/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Quote', __DIR__); diff --git a/app/code/Magento/Reports/registration.php b/app/code/Magento/Reports/registration.php index f903b78961992..6ab949d92db73 100644 --- a/app/code/Magento/Reports/registration.php +++ b/app/code/Magento/Reports/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Reports', __DIR__); diff --git a/app/code/Magento/RequireJs/registration.php b/app/code/Magento/RequireJs/registration.php index 8e2104a874ad4..4920ac99bbe96 100644 --- a/app/code/Magento/RequireJs/registration.php +++ b/app/code/Magento/RequireJs/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_RequireJs', __DIR__); diff --git a/app/code/Magento/Review/registration.php b/app/code/Magento/Review/registration.php index 3325f6194118f..0588c9a1a7620 100644 --- a/app/code/Magento/Review/registration.php +++ b/app/code/Magento/Review/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Review', __DIR__); diff --git a/app/code/Magento/Robots/registration.php b/app/code/Magento/Robots/registration.php index 36d898abfa9fb..343344d3910ff 100644 --- a/app/code/Magento/Robots/registration.php +++ b/app/code/Magento/Robots/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Robots', __DIR__); diff --git a/app/code/Magento/Rss/registration.php b/app/code/Magento/Rss/registration.php index 4ab2ddf494665..dc8ba0d5d88ba 100644 --- a/app/code/Magento/Rss/registration.php +++ b/app/code/Magento/Rss/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Rss', __DIR__); diff --git a/app/code/Magento/Rule/registration.php b/app/code/Magento/Rule/registration.php index 00c72c5c0a9ba..21bce7ba05833 100644 --- a/app/code/Magento/Rule/registration.php +++ b/app/code/Magento/Rule/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Rule', __DIR__); diff --git a/app/code/Magento/Sales/registration.php b/app/code/Magento/Sales/registration.php index db3b2aebce0bb..6945521f30abe 100644 --- a/app/code/Magento/Sales/registration.php +++ b/app/code/Magento/Sales/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Sales', __DIR__); diff --git a/app/code/Magento/SalesInventory/registration.php b/app/code/Magento/SalesInventory/registration.php index a6c9a6bc3e669..f2c0adf20a039 100644 --- a/app/code/Magento/SalesInventory/registration.php +++ b/app/code/Magento/SalesInventory/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_SalesInventory', __DIR__); diff --git a/app/code/Magento/SalesRule/registration.php b/app/code/Magento/SalesRule/registration.php index b3e6cf5bc1b14..53305ca8287f7 100644 --- a/app/code/Magento/SalesRule/registration.php +++ b/app/code/Magento/SalesRule/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_SalesRule', __DIR__); diff --git a/app/code/Magento/SalesSequence/registration.php b/app/code/Magento/SalesSequence/registration.php index 57b9c79bc1055..576b3dc5b9efb 100644 --- a/app/code/Magento/SalesSequence/registration.php +++ b/app/code/Magento/SalesSequence/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_SalesSequence', __DIR__); diff --git a/app/code/Magento/SampleData/registration.php b/app/code/Magento/SampleData/registration.php index 05c37ae1aec60..2e86fc7e1cc48 100644 --- a/app/code/Magento/SampleData/registration.php +++ b/app/code/Magento/SampleData/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_SampleData', __DIR__); diff --git a/app/code/Magento/Search/registration.php b/app/code/Magento/Search/registration.php index 177f95971c8af..48210f971c4c0 100644 --- a/app/code/Magento/Search/registration.php +++ b/app/code/Magento/Search/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Search', __DIR__); diff --git a/app/code/Magento/Security/registration.php b/app/code/Magento/Security/registration.php index b5bc1db3aec6e..80cc28f8d2103 100644 --- a/app/code/Magento/Security/registration.php +++ b/app/code/Magento/Security/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Security', __DIR__); diff --git a/app/code/Magento/SendFriend/registration.php b/app/code/Magento/SendFriend/registration.php index f8edd64000b50..37453eca71e3a 100644 --- a/app/code/Magento/SendFriend/registration.php +++ b/app/code/Magento/SendFriend/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_SendFriend', __DIR__); diff --git a/app/code/Magento/Shipping/registration.php b/app/code/Magento/Shipping/registration.php index 10a1bc529a534..9652f5a61a3bc 100644 --- a/app/code/Magento/Shipping/registration.php +++ b/app/code/Magento/Shipping/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Shipping', __DIR__); diff --git a/app/code/Magento/Signifyd/registration.php b/app/code/Magento/Signifyd/registration.php index 72b11f7eac214..e7fa9cfd2f9b3 100644 --- a/app/code/Magento/Signifyd/registration.php +++ b/app/code/Magento/Signifyd/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Signifyd', __DIR__); diff --git a/app/code/Magento/Sitemap/registration.php b/app/code/Magento/Sitemap/registration.php index 9fc965c854779..b713ddb98f381 100644 --- a/app/code/Magento/Sitemap/registration.php +++ b/app/code/Magento/Sitemap/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Sitemap', __DIR__); diff --git a/app/code/Magento/Store/registration.php b/app/code/Magento/Store/registration.php index 62be25fbdf6ab..64b5f9df52c0c 100644 --- a/app/code/Magento/Store/registration.php +++ b/app/code/Magento/Store/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Store', __DIR__); diff --git a/app/code/Magento/Swagger/registration.php b/app/code/Magento/Swagger/registration.php index 7d7b8d2662a1f..562f7d2e5196d 100644 --- a/app/code/Magento/Swagger/registration.php +++ b/app/code/Magento/Swagger/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Swagger', __DIR__); diff --git a/app/code/Magento/SwaggerWebapi/registration.php b/app/code/Magento/SwaggerWebapi/registration.php index 595497df7cfeb..bc551c2ea3cd5 100644 --- a/app/code/Magento/SwaggerWebapi/registration.php +++ b/app/code/Magento/SwaggerWebapi/registration.php @@ -6,6 +6,6 @@ declare(strict_types=1); -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_SwaggerWebapi', __DIR__); diff --git a/app/code/Magento/SwaggerWebapiAsync/registration.php b/app/code/Magento/SwaggerWebapiAsync/registration.php index 8805b81ca28a1..6af92fe040fd5 100644 --- a/app/code/Magento/SwaggerWebapiAsync/registration.php +++ b/app/code/Magento/SwaggerWebapiAsync/registration.php @@ -6,6 +6,6 @@ declare(strict_types=1); -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_SwaggerWebapiAsync', __DIR__); diff --git a/app/code/Magento/Swatches/registration.php b/app/code/Magento/Swatches/registration.php index 8589c4b71ea47..7f1f20aa18cc2 100644 --- a/app/code/Magento/Swatches/registration.php +++ b/app/code/Magento/Swatches/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Swatches', __DIR__); diff --git a/app/code/Magento/SwatchesLayeredNavigation/registration.php b/app/code/Magento/SwatchesLayeredNavigation/registration.php index f773212378ce1..8ddcbb0753810 100644 --- a/app/code/Magento/SwatchesLayeredNavigation/registration.php +++ b/app/code/Magento/SwatchesLayeredNavigation/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_SwatchesLayeredNavigation', __DIR__); diff --git a/app/code/Magento/Tax/registration.php b/app/code/Magento/Tax/registration.php index 3568ba311e9f2..2d36e0cc4c992 100644 --- a/app/code/Magento/Tax/registration.php +++ b/app/code/Magento/Tax/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Tax', __DIR__); diff --git a/app/code/Magento/TaxImportExport/registration.php b/app/code/Magento/TaxImportExport/registration.php index 63093dc25aa6d..67b67b55cbeee 100644 --- a/app/code/Magento/TaxImportExport/registration.php +++ b/app/code/Magento/TaxImportExport/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_TaxImportExport', __DIR__); diff --git a/app/code/Magento/Theme/registration.php b/app/code/Magento/Theme/registration.php index 8f2b360da9d33..c00f6e4ba2136 100644 --- a/app/code/Magento/Theme/registration.php +++ b/app/code/Magento/Theme/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Theme', __DIR__); diff --git a/app/code/Magento/Tinymce3/registration.php b/app/code/Magento/Tinymce3/registration.php index fd57434a6280f..1e561dd1ae36a 100644 --- a/app/code/Magento/Tinymce3/registration.php +++ b/app/code/Magento/Tinymce3/registration.php @@ -3,6 +3,6 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Tinymce3', __DIR__); diff --git a/app/code/Magento/Translation/registration.php b/app/code/Magento/Translation/registration.php index 2e3adaf378181..7c6266026c5b0 100644 --- a/app/code/Magento/Translation/registration.php +++ b/app/code/Magento/Translation/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Translation', __DIR__); diff --git a/app/code/Magento/Ui/registration.php b/app/code/Magento/Ui/registration.php index 28d4d44e82d9b..d6d80766703fe 100644 --- a/app/code/Magento/Ui/registration.php +++ b/app/code/Magento/Ui/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Ui', __DIR__); diff --git a/app/code/Magento/Ups/registration.php b/app/code/Magento/Ups/registration.php index 4c87e21b00ac7..c9d7f2b58c86f 100644 --- a/app/code/Magento/Ups/registration.php +++ b/app/code/Magento/Ups/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Ups', __DIR__); diff --git a/app/code/Magento/UrlRewrite/registration.php b/app/code/Magento/UrlRewrite/registration.php index 225a51f517569..87a28d518fab3 100644 --- a/app/code/Magento/UrlRewrite/registration.php +++ b/app/code/Magento/UrlRewrite/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_UrlRewrite', __DIR__); diff --git a/app/code/Magento/User/registration.php b/app/code/Magento/User/registration.php index c00bc0a633803..9a81d456f5f57 100644 --- a/app/code/Magento/User/registration.php +++ b/app/code/Magento/User/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_User', __DIR__); diff --git a/app/code/Magento/Usps/registration.php b/app/code/Magento/Usps/registration.php index 988089ccda954..32fe2a6a49fbd 100644 --- a/app/code/Magento/Usps/registration.php +++ b/app/code/Magento/Usps/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Usps', __DIR__); diff --git a/app/code/Magento/Variable/registration.php b/app/code/Magento/Variable/registration.php index a35a0da8b2c79..c68fbb63c2e64 100644 --- a/app/code/Magento/Variable/registration.php +++ b/app/code/Magento/Variable/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Variable', __DIR__); diff --git a/app/code/Magento/Vault/registration.php b/app/code/Magento/Vault/registration.php index 704dd359d139c..4959a7f61cd7c 100644 --- a/app/code/Magento/Vault/registration.php +++ b/app/code/Magento/Vault/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Vault', __DIR__); diff --git a/app/code/Magento/Version/registration.php b/app/code/Magento/Version/registration.php index 24daee14ec3da..e2a8d758ae15b 100644 --- a/app/code/Magento/Version/registration.php +++ b/app/code/Magento/Version/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Version', __DIR__); diff --git a/app/code/Magento/Webapi/registration.php b/app/code/Magento/Webapi/registration.php index 1ce2579e4e7c8..1836a29955e86 100644 --- a/app/code/Magento/Webapi/registration.php +++ b/app/code/Magento/Webapi/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Webapi', __DIR__); diff --git a/app/code/Magento/WebapiSecurity/registration.php b/app/code/Magento/WebapiSecurity/registration.php index a25eea9deb660..fc6d8e76c9754 100644 --- a/app/code/Magento/WebapiSecurity/registration.php +++ b/app/code/Magento/WebapiSecurity/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_WebapiSecurity', __DIR__); diff --git a/app/code/Magento/Weee/registration.php b/app/code/Magento/Weee/registration.php index 874705ab5c6b1..73623ce882acb 100644 --- a/app/code/Magento/Weee/registration.php +++ b/app/code/Magento/Weee/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Weee', __DIR__); diff --git a/app/code/Magento/Widget/registration.php b/app/code/Magento/Widget/registration.php index 27e924eba367e..c7821664fdaca 100644 --- a/app/code/Magento/Widget/registration.php +++ b/app/code/Magento/Widget/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Widget', __DIR__); diff --git a/app/code/Magento/Wishlist/registration.php b/app/code/Magento/Wishlist/registration.php index ea46a972ef449..b4c9f523ab95f 100644 --- a/app/code/Magento/Wishlist/registration.php +++ b/app/code/Magento/Wishlist/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Wishlist', __DIR__); diff --git a/app/design/adminhtml/Magento/backend/registration.php b/app/design/adminhtml/Magento/backend/registration.php index 039f3a141e382..e15cc9c18604b 100644 --- a/app/design/adminhtml/Magento/backend/registration.php +++ b/app/design/adminhtml/Magento/backend/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::THEME, 'adminhtml/Magento/backend', __DIR__); diff --git a/app/design/frontend/Magento/blank/registration.php b/app/design/frontend/Magento/blank/registration.php index 211f3fca131cc..297ae6d98ee41 100644 --- a/app/design/frontend/Magento/blank/registration.php +++ b/app/design/frontend/Magento/blank/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::THEME, 'frontend/Magento/blank', __DIR__); diff --git a/app/design/frontend/Magento/luma/registration.php b/app/design/frontend/Magento/luma/registration.php index 41921c06fd040..f8a2c3bdb8b2e 100644 --- a/app/design/frontend/Magento/luma/registration.php +++ b/app/design/frontend/Magento/luma/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::THEME, 'frontend/Magento/luma', __DIR__); diff --git a/app/i18n/Magento/de_DE/registration.php b/app/i18n/Magento/de_DE/registration.php index 12f479d30b1e1..fae5a938af236 100644 --- a/app/i18n/Magento/de_DE/registration.php +++ b/app/i18n/Magento/de_DE/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::LANGUAGE, 'magento_de_de', __DIR__); diff --git a/app/i18n/Magento/en_US/registration.php b/app/i18n/Magento/en_US/registration.php index a8fd609af0592..25c6ce2b53eda 100644 --- a/app/i18n/Magento/en_US/registration.php +++ b/app/i18n/Magento/en_US/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::LANGUAGE, 'magento_en_us', __DIR__); diff --git a/app/i18n/Magento/es_ES/registration.php b/app/i18n/Magento/es_ES/registration.php index b22457a5be4d9..6109afe6b3aa2 100644 --- a/app/i18n/Magento/es_ES/registration.php +++ b/app/i18n/Magento/es_ES/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::LANGUAGE, 'magento_es_es', __DIR__); diff --git a/app/i18n/Magento/fr_FR/registration.php b/app/i18n/Magento/fr_FR/registration.php index ed866adf28cd1..bca5547092867 100644 --- a/app/i18n/Magento/fr_FR/registration.php +++ b/app/i18n/Magento/fr_FR/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::LANGUAGE, 'magento_fr_fr', __DIR__); diff --git a/app/i18n/Magento/nl_NL/registration.php b/app/i18n/Magento/nl_NL/registration.php index b86c41cd8c76d..27a93b13df5eb 100644 --- a/app/i18n/Magento/nl_NL/registration.php +++ b/app/i18n/Magento/nl_NL/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::LANGUAGE, 'magento_nl_nl', __DIR__); diff --git a/app/i18n/Magento/pt_BR/registration.php b/app/i18n/Magento/pt_BR/registration.php index eec9dc7895f29..edfbb40f0a78e 100644 --- a/app/i18n/Magento/pt_BR/registration.php +++ b/app/i18n/Magento/pt_BR/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::LANGUAGE, 'magento_pt_br', __DIR__); diff --git a/app/i18n/Magento/zh_Hans_CN/registration.php b/app/i18n/Magento/zh_Hans_CN/registration.php index 675778b201e41..da291a0d1b98b 100644 --- a/app/i18n/Magento/zh_Hans_CN/registration.php +++ b/app/i18n/Magento/zh_Hans_CN/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::LANGUAGE, 'magento_zh_hans_cn', __DIR__); diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/_files/components/a/aa/aaa/registration.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/_files/components/a/aa/aaa/registration.php index 6dba3551281e3..b3a410e609d52 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/_files/components/a/aa/aaa/registration.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/_files/components/a/aa/aaa/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::THEME, 'frontend/Magento/theme', __DIR__); diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/_files/components/a/aa/registration.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/_files/components/a/aa/registration.php index 30dd39c36f2a4..045a53181a7d3 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/_files/components/a/aa/registration.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/_files/components/a/aa/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::LANGUAGE, 'magento_language', __DIR__); diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/_files/components/b/registration.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/_files/components/b/registration.php index 8d3b9b440fd7d..8c3c7576dc3f4 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/_files/components/b/registration.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/_files/components/b/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::LIBRARY, 'magento/library', __DIR__); diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/_files/components/registration.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/_files/components/registration.php index ddc564ae5a143..effc8b6954787 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/_files/components/registration.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/_files/components/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_ModuleOne', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/Magento/test_default/registration.php b/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/Magento/test_default/registration.php index 89cf740bbd4f4..31ad793efca38 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/Magento/test_default/registration.php +++ b/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/Magento/test_default/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::THEME, 'adminhtml/BackendTest/test_default', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Deploy/_files/zoom1/registration.php b/dev/tests/integration/testsuite/Magento/Deploy/_files/zoom1/registration.php index 52d41c2a2ebb3..21c05427ed6f5 100644 --- a/dev/tests/integration/testsuite/Magento/Deploy/_files/zoom1/registration.php +++ b/dev/tests/integration/testsuite/Magento/Deploy/_files/zoom1/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::THEME, 'frontend/Magento/zoom1', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Deploy/_files/zoom2/registration.php b/dev/tests/integration/testsuite/Magento/Deploy/_files/zoom2/registration.php index a6979a1cae451..b40bf194aee19 100644 --- a/dev/tests/integration/testsuite/Magento/Deploy/_files/zoom2/registration.php +++ b/dev/tests/integration/testsuite/Magento/Deploy/_files/zoom2/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::THEME, 'frontend/Magento/zoom2', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Deploy/_files/zoom3/registration.php b/dev/tests/integration/testsuite/Magento/Deploy/_files/zoom3/registration.php index fc0867f7d0107..bd6adc89add51 100644 --- a/dev/tests/integration/testsuite/Magento/Deploy/_files/zoom3/registration.php +++ b/dev/tests/integration/testsuite/Magento/Deploy/_files/zoom3/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::THEME, 'frontend/Magento/zoom3', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Magento/default/registration.php b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Magento/default/registration.php index 4ef58e212e553..fd9a15a8185c7 100644 --- a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Magento/default/registration.php +++ b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Magento/default/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::THEME, 'adminhtml/Magento_EmailTest/default', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Vendor/custom_theme/registration.php b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Vendor/custom_theme/registration.php index dac1b36e4880f..b03665afa7861 100644 --- a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Vendor/custom_theme/registration.php +++ b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Vendor/custom_theme/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::THEME, 'adminhtml/Vendor_EmailTest/custom_theme', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Vendor/default/registration.php b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Vendor/default/registration.php index 879ba0266769e..e38e516d784e2 100644 --- a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Vendor/default/registration.php +++ b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Vendor/default/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::THEME, 'adminhtml/Vendor_EmailTest/default', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Magento/default/registration.php b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Magento/default/registration.php index 92f1ead3c6d55..2cba0d2b2378c 100644 --- a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Magento/default/registration.php +++ b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Magento/default/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::THEME, 'frontend/Magento_EmailTest/default', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Vendor/custom_theme/registration.php b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Vendor/custom_theme/registration.php index d2953eb161503..39d4b3364aa0c 100644 --- a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Vendor/custom_theme/registration.php +++ b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Vendor/custom_theme/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::THEME, 'frontend/Vendor_EmailTest/custom_theme', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Vendor/default/registration.php b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Vendor/default/registration.php index 3d310791d8f48..3f46f3beb6962 100644 --- a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Vendor/default/registration.php +++ b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Vendor/default/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::THEME, 'frontend/Vendor_EmailTest/default', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/bar/en_gb/registration.php b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/bar/en_gb/registration.php index 9c774ed93ae56..6eb6124298e84 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/bar/en_gb/registration.php +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/bar/en_gb/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::LANGUAGE, 'bar_en_gb', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/bar/en_us/registration.php b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/bar/en_us/registration.php index 19127f4a0e2c8..7f792bf5941ca 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/bar/en_us/registration.php +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/bar/en_us/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::LANGUAGE, 'bar_en_us', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/baz/en_gb/registration.php b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/baz/en_gb/registration.php index c66abb59b91c1..d065d77ad8ca3 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/baz/en_gb/registration.php +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/baz/en_gb/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::LANGUAGE, 'baz_en_gb', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/first/en_us/registration.php b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/first/en_us/registration.php index d15b384138fbc..48dfbf20c9f26 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/first/en_us/registration.php +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/first/en_us/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::LANGUAGE, 'first_en_us', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/foo/en_au/registration.php b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/foo/en_au/registration.php index b8deab01733d0..ba7fd323cfd94 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/foo/en_au/registration.php +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/foo/en_au/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::LANGUAGE, 'foo_en_au', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/my/ru_ru/registration.php b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/my/ru_ru/registration.php index c9e0d2dbf14b4..e7e7a045a36a7 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/my/ru_ru/registration.php +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/my/ru_ru/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::LANGUAGE, 'my_ru_ru', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/second/en_gb/registration.php b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/second/en_gb/registration.php index 742164c4fa56d..6c84974fea235 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/second/en_gb/registration.php +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/second/en_gb/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::LANGUAGE, 'second_en_gb', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/theirs/ru_ru/registration.php b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/theirs/ru_ru/registration.php index 6924c5e624d32..e78422d5ebeb3 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/theirs/ru_ru/registration.php +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/theirs/ru_ru/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::LANGUAGE, 'theirs_ru_ru', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/fixtures/language/registration.php b/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/fixtures/language/registration.php index 0c8673f00dbf6..1a5326ad6627d 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/fixtures/language/registration.php +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/fixtures/language/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::LANGUAGE, 'magento_test_lang', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/fixtures/library/registration.php b/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/fixtures/library/registration.php index 037159b48ce64..f14a169b2e56b 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/fixtures/library/registration.php +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/fixtures/library/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::LIBRARY, 'magento/test', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/fixtures/module/registration.php b/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/fixtures/module/registration.php index 5e082df446665..95def30dd5f26 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/fixtures/module/registration.php +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/fixtures/module/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Module', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/fixtures/theme/registration.php b/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/fixtures/theme/registration.php index c286f6c57d87f..da95bfe5f1519 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/fixtures/theme/registration.php +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/fixtures/theme/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::THEME, 'frontend/Test/theme', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/code/Magento/Other/registration.php b/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/code/Magento/Other/registration.php index 1b40e66b1f7a1..34fb5831076b8 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/code/Magento/Other/registration.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/code/Magento/Other/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'MagentoFrameworkCssTest_Other', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/code/Magento/Third/registration.php b/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/code/Magento/Third/registration.php index dfc0010056f6c..add6e676f220c 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/code/Magento/Third/registration.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/code/Magento/Third/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'MagentoFrameworkCssTest_Third', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/design/frontend/Test/default/registration.php b/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/design/frontend/Test/default/registration.php index 1c605694456d2..2fc5a738b3c66 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/design/frontend/Test/default/registration.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/design/frontend/Test/default/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::THEME, 'frontend/FrameworkCssTest/default', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/design/frontend/Test/parent/registration.php b/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/design/frontend/Test/parent/registration.php index e8b4db3543611..d856d3cd7be29 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/design/frontend/Test/parent/registration.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/design/frontend/Test/parent/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::THEME, 'frontend/FrameworkCssTest/parent', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/Fixture_Module/registration.php b/dev/tests/integration/testsuite/Magento/Framework/View/_files/Fixture_Module/registration.php index da748f3b3299b..7e073d8f7cf50 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/_files/Fixture_Module/registration.php +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/Fixture_Module/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Fixture_Module', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/UiComponent/theme/registration.php b/dev/tests/integration/testsuite/Magento/Framework/View/_files/UiComponent/theme/registration.php index cbba56dcaafa2..886dad410ba72 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/_files/UiComponent/theme/registration.php +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/UiComponent/theme/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::THEME, 'adminhtml/FrameworkViewUiComponent/default', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/app/code/ViewTest_Module/registration.php b/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/app/code/ViewTest_Module/registration.php index 7b1644fc8f40a..eafa89e3abf29 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/app/code/ViewTest_Module/registration.php +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/app/code/ViewTest_Module/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'ViewTest_Module', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/custom_theme/registration.php b/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/custom_theme/registration.php index 6150fcb34dc85..219ec82584f50 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/custom_theme/registration.php +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/custom_theme/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::THEME, 'frontend/Vendor_ViewTest/custom_theme', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/custom_theme2/registration.php b/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/custom_theme2/registration.php index a1d5f994fb75d..938ab2a46e5c0 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/custom_theme2/registration.php +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/custom_theme2/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::THEME, 'frontend/Vendor_ViewTest/custom_theme2', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/default/registration.php b/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/default/registration.php index 8302085feb23f..36caee1923ac3 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/default/registration.php +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/default/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::THEME, 'frontend/Vendor_ViewTest/default', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/standalone_theme/registration.php b/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/standalone_theme/registration.php index ad8402df470e1..5b9e91753c424 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/standalone_theme/registration.php +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/standalone_theme/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::THEME, 'frontend/Vendor_ViewTest/standalone_theme', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/static/theme/registration.php b/dev/tests/integration/testsuite/Magento/Framework/View/_files/static/theme/registration.php index c2e0ac8d8c34e..d51fc082d90cc 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/_files/static/theme/registration.php +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/static/theme/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::THEME, 'frontend/FrameworkViewMinifier/default', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/A/registration.php b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/A/registration.php index f4f907d8814f0..990c43e2ae22b 100644 --- a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/A/registration.php +++ b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/A/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_A', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/B/registration.php b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/B/registration.php index e5746b1350c08..8a615308ffafd 100644 --- a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/B/registration.php +++ b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/B/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_B', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/C/registration.php b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/C/registration.php index 6e987dcef353e..34a4e9f6be45b 100644 --- a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/C/registration.php +++ b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/C/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_C', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/D/registration.php b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/D/registration.php index f243f094d7a10..34b6e22067d67 100644 --- a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/D/registration.php +++ b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/D/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_D', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/adminhtml/Vendor/test/registration.php b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/adminhtml/Vendor/test/registration.php index e1e5021b46204..f2dad036d5265 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/adminhtml/Vendor/test/registration.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/adminhtml/Vendor/test/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::THEME, 'adminhtml/FrameworkThemeTest/test', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/area_two/Vendor/theme_one/registration.php b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/area_two/Vendor/theme_one/registration.php index 3499cf9743a4b..32f7321714c4d 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/area_two/Vendor/theme_one/registration.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/area_two/Vendor/theme_one/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::THEME, 'area_two/FrameworkThemeTest/theme_one', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/design_area/Vendor/theme_one/registration.php b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/design_area/Vendor/theme_one/registration.php index 29e5fa798ca7d..4c1c9297b7ccc 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/design_area/Vendor/theme_one/registration.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/design_area/Vendor/theme_one/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::THEME, 'design_area/FrameworkThemeTest/theme_one', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Magento/default/registration.php b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Magento/default/registration.php index f9c18ad1a2ca5..cc40b0c221176 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Magento/default/registration.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Magento/default/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::THEME, 'frontend/Magento_FrameworkThemeTest/default', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Magento/default_iphone/registration.php b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Magento/default_iphone/registration.php index 30cc438826189..713abc2dd5245 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Magento/default_iphone/registration.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Magento/default_iphone/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::THEME, 'frontend/Magento_FrameworkThemeTest/default_iphone', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/cache_test_theme/registration.php b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/cache_test_theme/registration.php index 40aba67cf4bda..db6a478fc65a4 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/cache_test_theme/registration.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/cache_test_theme/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::THEME, 'frontend/Test_FrameworkThemeTest/cache_test_theme', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/registration.php b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/registration.php index 3e6938955b6d7..3cfea7d3edf06 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/registration.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::THEME, 'frontend/Test_FrameworkThemeTest/default', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/publication/registration.php b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/publication/registration.php index f3668dd5ec603..f59384e42f41b 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/publication/registration.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/publication/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::THEME, 'frontend/Test_FrameworkThemeTest/publication', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/test_theme/registration.php b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/test_theme/registration.php index adcbacd78594c..0a1c9e5ef8e79 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/test_theme/registration.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/test_theme/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::THEME, 'frontend/Test_FrameworkThemeTest/test_theme', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Vendor/custom_theme/registration.php b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Vendor/custom_theme/registration.php index e1ce31a7c8d0b..b0e80d1106d22 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Vendor/custom_theme/registration.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Vendor/custom_theme/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::THEME, 'frontend/Vendor_FrameworkThemeTest/custom_theme', __DIR__); diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Vendor/default/registration.php b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Vendor/default/registration.php index f2e0918421ba0..1c2d96475f9fc 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Vendor/default/registration.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Vendor/default/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::THEME, 'frontend/Vendor_FrameworkThemeTest/default', __DIR__); diff --git a/lib/internal/Magento/Framework/Amqp/registration.php b/lib/internal/Magento/Framework/Amqp/registration.php index ab14d5aab8e94..0e97ffb62a8b8 100644 --- a/lib/internal/Magento/Framework/Amqp/registration.php +++ b/lib/internal/Magento/Framework/Amqp/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::LIBRARY, 'magento/framework-amqp', __DIR__); diff --git a/lib/internal/Magento/Framework/Bulk/registration.php b/lib/internal/Magento/Framework/Bulk/registration.php index f9f5606b76841..00c35b91e4a24 100644 --- a/lib/internal/Magento/Framework/Bulk/registration.php +++ b/lib/internal/Magento/Framework/Bulk/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::LIBRARY, 'magento/framework-bulk', __DIR__); diff --git a/lib/internal/Magento/Framework/MessageQueue/registration.php b/lib/internal/Magento/Framework/MessageQueue/registration.php index aafb0fcffa7c5..d6b908671f9b7 100644 --- a/lib/internal/Magento/Framework/MessageQueue/registration.php +++ b/lib/internal/Magento/Framework/MessageQueue/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::LIBRARY, 'magento/framework-message-queue', __DIR__); diff --git a/lib/internal/Magento/Framework/registration.php b/lib/internal/Magento/Framework/registration.php index 19012a264346c..69ba0ac6273e6 100644 --- a/lib/internal/Magento/Framework/registration.php +++ b/lib/internal/Magento/Framework/registration.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::LIBRARY, 'magento/framework', __DIR__); diff --git a/setup/src/Magento/Setup/registration.php b/setup/src/Magento/Setup/registration.php index e78c32a7f193b..bff16d976bb24 100644 --- a/setup/src/Magento/Setup/registration.php +++ b/setup/src/Magento/Setup/registration.php @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ -use \Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::SETUP, 'magento/setup', __DIR__); From 927e0636e2d2f108787d40be1def2a00f1d6eaad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 19 Dec 2019 05:11:01 +0100 Subject: [PATCH 423/586] Reduce sleep time for Unit Test of Consumer to 0 seconds --- .../Test/Unit/Model/ConsumerRunnerTest.php | 53 +++++++++++-------- 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/app/code/Magento/MessageQueue/Test/Unit/Model/ConsumerRunnerTest.php b/app/code/Magento/MessageQueue/Test/Unit/Model/ConsumerRunnerTest.php index 46a142bf488be..5f4bd9178a890 100644 --- a/app/code/Magento/MessageQueue/Test/Unit/Model/ConsumerRunnerTest.php +++ b/app/code/Magento/MessageQueue/Test/Unit/Model/ConsumerRunnerTest.php @@ -3,20 +3,27 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); namespace Magento\MessageQueue\Test\Unit\Model; -use Magento\Framework\MessageQueue\ConsumerInterface; -use Magento\MessageQueue\Model\ConsumerRunner; +use Magento\Framework\App\MaintenanceMode; use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\MessageQueue\ConsumerFactory; +use Magento\Framework\MessageQueue\ConsumerInterface; use Magento\Framework\Phrase; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\MessageQueue\Model\ConsumerRunner; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; -/** - * Unit tests for consumer runner - */ -class ConsumerRunnerTest extends \PHPUnit\Framework\TestCase +class ConsumerRunnerTest extends TestCase { - /** @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager */ + const STUB_SLEEP_INTERVAL = 0; + + /** + * @var ObjectManager + */ private $objectManager; /** @@ -25,12 +32,12 @@ class ConsumerRunnerTest extends \PHPUnit\Framework\TestCase private $consumerRunner; /** - * @var \Magento\Framework\MessageQueue\ConsumerFactory|\PHPUnit_Framework_MockObject_MockObject + * @var ConsumerFactory|MockObject */ private $consumerFactoryMock; /** - * @var \Magento\Framework\App\MaintenanceMode|\PHPUnit_Framework_MockObject_MockObject + * @var MaintenanceMode|MockObject */ private $maintenanceModeMock; @@ -39,21 +46,23 @@ class ConsumerRunnerTest extends \PHPUnit\Framework\TestCase */ protected function setUp() { - $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - $this->consumerFactoryMock = $this->getMockBuilder(\Magento\Framework\MessageQueue\ConsumerFactory::class) + $this->objectManager = new ObjectManager($this); + + $this->consumerFactoryMock = $this->getMockBuilder(ConsumerFactory::class) ->disableOriginalConstructor() ->getMock(); - $this->maintenanceModeMock = $this->getMockBuilder(\Magento\Framework\App\MaintenanceMode::class) + $this->maintenanceModeMock = $this->getMockBuilder(MaintenanceMode::class) ->disableOriginalConstructor() ->getMock(); + $this->consumerRunner = $this->objectManager->getObject( - \Magento\MessageQueue\Model\ConsumerRunner::class, + ConsumerRunner::class, [ 'consumerFactory' => $this->consumerFactoryMock, - 'maintenanceMode' => $this->maintenanceModeMock + 'maintenanceMode' => $this->maintenanceModeMock, + 'maintenanceSleepInterval' => self::STUB_SLEEP_INTERVAL ] ); - parent::setUp(); } /** @@ -64,8 +73,8 @@ protected function setUp() public function testMagicMethod() { $isMaintenanceModeOn = false; - /** @var ConsumerInterface|\PHPUnit_Framework_MockObject_MockObject $consumerMock */ - $consumerMock = $this->getMockBuilder(\Magento\Framework\MessageQueue\ConsumerInterface::class)->getMock(); + /** @var ConsumerInterface|MockObject $consumerMock */ + $consumerMock = $this->getMockBuilder(ConsumerInterface::class)->getMock(); $consumerMock->expects($this->once())->method('process'); $consumerName = 'someConsumerName'; $this->consumerFactoryMock @@ -81,12 +90,13 @@ public function testMagicMethod() /** * Ensure that exception will be thrown if requested magic method does not correspond to any declared consumer. * - * @expectedException \Magento\Framework\Exception\LocalizedException - * @expectedExceptionMessage "nonDeclaredConsumer" callback method specified in crontab.xml must * @return void */ public function testMagicMethodNoRelatedConsumer() { + $this->expectException(LocalizedException::class); + $this->expectExceptionMessage('"nonDeclaredConsumer" callback method specified in crontab.xml must'); + $consumerName = 'nonDeclaredConsumer'; $this->consumerFactoryMock ->expects($this->once()) @@ -105,8 +115,9 @@ public function testMagicMethodNoRelatedConsumer() public function testMagicMethodMaintenanceModeIsOn() { $isMaintenanceModeOn = true; - /** @var ConsumerInterface|\PHPUnit_Framework_MockObject_MockObject $consumerMock */ - $consumerMock = $this->getMockBuilder(\Magento\Framework\MessageQueue\ConsumerInterface::class)->getMock(); + + /** @var ConsumerInterface|MockObject $consumerMock */ + $consumerMock = $this->getMockBuilder(ConsumerInterface::class)->getMock(); $consumerMock->expects($this->never())->method('process'); $consumerName = 'someConsumerName'; $this->consumerFactoryMock From 2e1ef16d755bbc6b0f675d8624b47b8f6cf35fa8 Mon Sep 17 00:00:00 2001 From: Roman Hanin <rganin@adobe.com> Date: Thu, 19 Dec 2019 00:09:15 -0600 Subject: [PATCH 424/586] B2B-272: Remove Ship To column, fix pagination selector --- app/code/Magento/Sales/Block/Order/History.php | 10 ++++++++++ .../Sales/view/frontend/templates/order/history.phtml | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/Block/Order/History.php b/app/code/Magento/Sales/Block/Order/History.php index c06a5d8b24c1e..09300424212fe 100644 --- a/app/code/Magento/Sales/Block/Order/History.php +++ b/app/code/Magento/Sales/Block/Order/History.php @@ -188,4 +188,14 @@ public function getBackUrl() { return $this->getUrl('customer/account/'); } + + /** + * Get message for no orders. + * + * @return \Magento\Framework\Phrase + */ + public function getEmptyOrdersMessage() + { + return __('You have placed no orders.'); + } } diff --git a/app/code/Magento/Sales/view/frontend/templates/order/history.phtml b/app/code/Magento/Sales/view/frontend/templates/order/history.phtml index a785ca93511ad..bc1887c7669ca 100644 --- a/app/code/Magento/Sales/view/frontend/templates/order/history.phtml +++ b/app/code/Magento/Sales/view/frontend/templates/order/history.phtml @@ -59,5 +59,5 @@ <div class="order-products-toolbar toolbar bottom"><?= $block->getPagerHtml() ?></div> <?php endif ?> <?php else : ?> - <div class="message info empty"><span><?= $block->escapeHtml(__('You have placed no orders.')) ?></span></div> + <div class="message info empty"><span><?= $block->escapeHtml($block->getEmptyOrdersMessage()) ?></span></div> <?php endif ?> From c4a3c0084eeb076f3620f98b716cd04e8113b004 Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <nazarn96@gmail.com> Date: Thu, 19 Dec 2019 11:01:17 +0200 Subject: [PATCH 425/586] Cover changes with unit test --- .../Model/Config/Source/AllmethodsTest.php | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 app/code/Magento/Shipping/Test/Unit/Model/Config/Source/AllmethodsTest.php diff --git a/app/code/Magento/Shipping/Test/Unit/Model/Config/Source/AllmethodsTest.php b/app/code/Magento/Shipping/Test/Unit/Model/Config/Source/AllmethodsTest.php new file mode 100644 index 0000000000000..b3810b6042eee --- /dev/null +++ b/app/code/Magento/Shipping/Test/Unit/Model/Config/Source/AllmethodsTest.php @@ -0,0 +1,106 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Shipping\Test\Unit\Model; + +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Shipping\Model\Carrier\AbstractCarrierInterface; +use Magento\Shipping\Model\Config; +use Magento\Shipping\Model\Config\Source\Allmethods; +use PHPUnit\Framework\MockObject\MockObject; + +/** + * Tests for Allmethods Class + */ +class InfoTest extends \PHPUnit\Framework\TestCase +{ + /** + * @var ScopeConfigInterface|MockObject $scopeConfig + */ + private $scopeConfig; + + /** + * @var Config|MockObject $shippingConfig + */ + private $shippingConfig; + + /** + * @var Allmethods $allmethods + */ + private $allmethods; + + /** + * @var MockObject + */ + private $carriersMock; + + /** + * @inheritdoc + */ + protected function setUp() + { + $this->scopeConfig = $this->createMock(ScopeConfigInterface::class); + $this->shippingConfig = $this->createMock(Config::class); + $this->carriersMock = $this->getMockBuilder(AbstractCarrierInterface::class) + ->setMethods( + [ + 'isActive', + 'getAllowedMethods' + ] + )->getMockForAbstractClass(); + + $this->allmethods = new Allmethods( + $this->scopeConfig, + $this->shippingConfig + ); + } + + /** + * Ensure that options converted correctly + * + * @dataProvider getCarriersMethodsProvider + * @param array $expectedArray + * @return void + */ + public function testToOptionArray(array $expectedArray): void + { + $expectedArray['getAllCarriers'] = [$this->carriersMock]; + + $this->shippingConfig->expects($this->once()) + ->method('getAllCarriers') + ->willReturn($expectedArray['getAllCarriers']); + $this->carriersMock->expects($this->once()) + ->method('isActive') + ->willReturn(true); + $this->carriersMock->expects($this->once()) + ->method('getAllowedMethods') + ->willReturn($expectedArray['allowedMethods']); + $this->assertEquals([$expectedArray['expected_result']], $this->allmethods->toOptionArray()); + } + + /** + * Returns providers data for test + * + * @return array + */ + public function getCarriersMethodsProvider(): array + { + return [ + [ + [ + 'allowedMethods' => [null => 'method_title'], + 'expected_result' => [ 'value' => [], 'label' => null], + 'getAllCarriers' => [] + ], + [ + 'allowedMethods' => ['method_code' => 'method_title'], + 'expected_result' => [ 'value' => [], 'label' => 'method_code'], + 'getAllCarriers' => [] + ] + + ] + ]; + } +} From fd7633b28417b6e621808ae9c10cbb707f1b7821 Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <nazarn96@gmail.com> Date: Thu, 19 Dec 2019 11:29:05 +0200 Subject: [PATCH 426/586] fix static test --- .../Magento/Shipping/Model/Config/Source/Allmethods.php | 6 +++++- .../Test/Unit/Model/Config/Source/AllmethodsTest.php | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Shipping/Model/Config/Source/Allmethods.php b/app/code/Magento/Shipping/Model/Config/Source/Allmethods.php index bafb9ed49cf30..f64c24856eba5 100644 --- a/app/code/Magento/Shipping/Model/Config/Source/Allmethods.php +++ b/app/code/Magento/Shipping/Model/Config/Source/Allmethods.php @@ -5,6 +5,9 @@ */ namespace Magento\Shipping\Model\Config\Source; +/** + * @inheritdoc + */ class Allmethods implements \Magento\Framework\Option\ArrayInterface { /** @@ -33,6 +36,7 @@ public function __construct( /** * Return array of carriers. + * * If $isActiveOnlyFlag is set to true, will return only active carriers * * @param bool $isActiveOnlyFlag @@ -59,7 +63,7 @@ public function toOptionArray($isActiveOnlyFlag = false) /** Check it $carrierMethods array was well formed */ if (!$methodCode) { - continue; + continue; } $methods[$carrierCode]['value'][] = [ 'value' => $carrierCode . '_' . $methodCode, diff --git a/app/code/Magento/Shipping/Test/Unit/Model/Config/Source/AllmethodsTest.php b/app/code/Magento/Shipping/Test/Unit/Model/Config/Source/AllmethodsTest.php index b3810b6042eee..985cc0e53bad5 100644 --- a/app/code/Magento/Shipping/Test/Unit/Model/Config/Source/AllmethodsTest.php +++ b/app/code/Magento/Shipping/Test/Unit/Model/Config/Source/AllmethodsTest.php @@ -3,7 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\Shipping\Test\Unit\Model; +namespace Magento\Shipping\Test\Unit\Model\Config\Source; use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Shipping\Model\Carrier\AbstractCarrierInterface; @@ -14,7 +14,7 @@ /** * Tests for Allmethods Class */ -class InfoTest extends \PHPUnit\Framework\TestCase +class AllmethodsTest extends \PHPUnit\Framework\TestCase { /** * @var ScopeConfigInterface|MockObject $scopeConfig From cc1c96bd3ce491adc41fabda12b81d0e265b5431 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 19 Dec 2019 11:06:16 +0100 Subject: [PATCH 427/586] Replace literal with reference to class --- .../Magento/Version/Test/Unit/Controller/Index/IndexTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Version/Test/Unit/Controller/Index/IndexTest.php b/app/code/Magento/Version/Test/Unit/Controller/Index/IndexTest.php index 9a42fd81cd882..3fc2cecabe990 100644 --- a/app/code/Magento/Version/Test/Unit/Controller/Index/IndexTest.php +++ b/app/code/Magento/Version/Test/Unit/Controller/Index/IndexTest.php @@ -62,7 +62,7 @@ protected function setUp() $objectManager = new ObjectManager($this); $this->model = $objectManager->getObject( - 'Magento\Version\Controller\Index\Index', + VersionIndex::class, [ 'context' => $this->contextMock, 'productMetadata' => $this->productMetadataMock From 63bf4fef932e72952ee318817bead66be7f6963a Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Thu, 19 Dec 2019 14:16:15 +0200 Subject: [PATCH 428/586] MC-25109: B2B changing company admin carries over the addresses --- .../Sales/Test/Mftf/Test/StorefrontOrderPagerDisplayedTest.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontOrderPagerDisplayedTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontOrderPagerDisplayedTest.xml index 0e58bb84988a2..aef3e884c4712 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontOrderPagerDisplayedTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontOrderPagerDisplayedTest.xml @@ -89,6 +89,9 @@ <!-- Customer is created --> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <!-- Reindex and flush the cache to display products on the category page --> + <magentoCLI command="indexer:reindex" stepKey="reindex"/> + <magentoCLI command="cache:flush" stepKey="flushCache"/> </before> <after> <!-- Delete category and products --> From 629c51649b4683ed0680af621f3d3fe4685924b4 Mon Sep 17 00:00:00 2001 From: Sathish <srsathish92@gmail.com> Date: Thu, 19 Dec 2019 19:06:43 +0530 Subject: [PATCH 429/586] Code refactor, updated Unit Test with JsonHexTag Serializer --- .../Magento/Checkout/Block/Cart/Shipping.php | 51 +++-- .../Test/Unit/Block/Cart/ShippingTest.php | 200 +++++++++++++----- 2 files changed, 181 insertions(+), 70 deletions(-) diff --git a/app/code/Magento/Checkout/Block/Cart/Shipping.php b/app/code/Magento/Checkout/Block/Cart/Shipping.php index c52b7fe18814f..f8347fadeb947 100644 --- a/app/code/Magento/Checkout/Block/Cart/Shipping.php +++ b/app/code/Magento/Checkout/Block/Cart/Shipping.php @@ -3,8 +3,18 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + namespace Magento\Checkout\Block\Cart; +use Magento\Checkout\Model\CompositeConfigProvider; +use Magento\Checkout\Block\Checkout\LayoutProcessorInterface; +use Magento\Framework\Serialize\Serializer\Json; +use Magento\Framework\Serialize\Serializer\JsonHexTag; +use Magento\Framework\View\Element\Template\Context; +use Magento\Customer\Model\Session as customerSession; +use Magento\Checkout\Model\Session as checkoutSession; +use Magento\Framework\App\ObjectManager; + /** * @api * @SuppressWarnings(PHPMD.CouplingBetweenObjects) @@ -12,45 +22,52 @@ class Shipping extends \Magento\Checkout\Block\Cart\AbstractCart { /** - * @var \Magento\Checkout\Model\CompositeConfigProvider + * @var CompositeConfigProvider */ protected $configProvider; /** - * @var array|\Magento\Checkout\Block\Checkout\LayoutProcessorInterface[] + * @var array|LayoutProcessorInterface[] */ protected $layoutProcessors; /** - * @var \Magento\Framework\Serialize\Serializer\Json + * @var Json */ private $serializer; /** - * @param \Magento\Framework\View\Element\Template\Context $context - * @param \Magento\Customer\Model\Session $customerSession - * @param \Magento\Checkout\Model\Session $checkoutSession - * @param \Magento\Checkout\Model\CompositeConfigProvider $configProvider + * @var JsonHexTag + */ + private $jsonHexTagSerializer; + + /** + * @param Context $context + * @param customerSession $customerSession + * @param checkoutSession $checkoutSession + * @param CompositeConfigProvider $configProvider * @param array $layoutProcessors * @param array $data - * @param \Magento\Framework\Serialize\Serializer\Json|null $serializer + * @param Json|null $serializer + * @param JsonHexTag|null $jsonHexTagSerializer * @throws \RuntimeException */ public function __construct( - \Magento\Framework\View\Element\Template\Context $context, - \Magento\Customer\Model\Session $customerSession, - \Magento\Checkout\Model\Session $checkoutSession, - \Magento\Checkout\Model\CompositeConfigProvider $configProvider, + Context $context, + customerSession $customerSession, + checkoutSession $checkoutSession, + CompositeConfigProvider $configProvider, array $layoutProcessors = [], array $data = [], - \Magento\Framework\Serialize\Serializer\Json $serializer = null + Json $serializer = null, + JsonHexTag $jsonHexTagSerializer = null ) { $this->configProvider = $configProvider; $this->layoutProcessors = $layoutProcessors; parent::__construct($context, $customerSession, $checkoutSession, $data); $this->_isScopePrivate = true; - $this->serializer = $serializer ?: \Magento\Framework\App\ObjectManager::getInstance() - ->get(\Magento\Framework\Serialize\Serializer\Json::class); + $this->serializer = $serializer ?: ObjectManager::getInstance()->get(Json::class); + $this->jsonHexTagSerializer = $jsonHexTagSerializer ?: ObjectManager::getInstance()->get(JsonHexTag::class); } /** @@ -75,7 +92,7 @@ public function getJsLayout() $this->jsLayout = $processor->process($this->jsLayout); } - return json_encode($this->jsLayout, JSON_HEX_TAG); + return $this->jsonHexTagSerializer->serialize($this->jsLayout); } /** @@ -95,6 +112,6 @@ public function getBaseUrl() */ public function getSerializedCheckoutConfig() { - return json_encode($this->getCheckoutConfig(), JSON_HEX_TAG); + return $this->jsonHexTagSerializer->serialize($this->getCheckoutConfig()); } } diff --git a/app/code/Magento/Checkout/Test/Unit/Block/Cart/ShippingTest.php b/app/code/Magento/Checkout/Test/Unit/Block/Cart/ShippingTest.php index 302188224b97a..e5f33cf0d408f 100644 --- a/app/code/Magento/Checkout/Test/Unit/Block/Cart/ShippingTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Block/Cart/ShippingTest.php @@ -3,44 +3,61 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + +declare(strict_types=1); + namespace Magento\Checkout\Test\Unit\Block\Cart; +use Magento\Checkout\Block\Cart\Shipping; +use Magento\Checkout\Model\CompositeConfigProvider; +use Magento\Checkout\Block\Checkout\LayoutProcessorInterface; +use Magento\Framework\Serialize\Serializer\Json; +use Magento\Framework\Serialize\Serializer\JsonHexTag; +use Magento\Framework\View\Element\Template\Context; +use Magento\Customer\Model\Session as customerSession; +use Magento\Checkout\Model\Session as checkoutSession; +use Magento\Store\Model\StoreManagerInterface; +use PHPUnit\Framework\MockObject\MockObject; + +/** + * Unit Test for Magento\Checkout\Block\Cart\Shipping + */ class ShippingTest extends \PHPUnit\Framework\TestCase { /** - * @var \Magento\Checkout\Block\Cart\Shipping + * @var Shipping */ - protected $model; + protected $block; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var Context|MockObject */ - protected $context; + protected $contextMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var customerSession|MockObject */ - protected $customerSession; + protected $customerSessionMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var checkoutSession|MockObject */ - protected $checkoutSession; + protected $checkoutSessionMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var CompositeConfigProvider|MockObject */ - protected $configProvider; + protected $configProviderMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var LayoutProcessorInterface|MockObject */ - protected $layoutProcessor; + protected $layoutProcessorMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var StoreManagerInterface|MockObject */ - protected $storeManager; + protected $storeManagerMock; /** * @var array @@ -48,17 +65,28 @@ class ShippingTest extends \PHPUnit\Framework\TestCase protected $layout; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var Json|MockObject */ - private $serializer; + private $serializerMock; - protected function setUp() + /** + * @var JsonHexTag|MockObject + */ + private $jsonHexTagSerializerMock; + + /** + * @inheritDoc + */ + protected function setUp(): void { - $this->context = $this->createMock(\Magento\Framework\View\Element\Template\Context::class); - $this->customerSession = $this->createMock(\Magento\Customer\Model\Session::class); - $this->checkoutSession = $this->createMock(\Magento\Checkout\Model\Session::class); - $this->configProvider = $this->createMock(\Magento\Checkout\Model\CompositeConfigProvider::class); - $this->layoutProcessor = $this->createMock(\Magento\Checkout\Block\Checkout\LayoutProcessorInterface::class); + $this->contextMock = $this->createMock(Context::class); + $this->customerSessionMock = $this->createMock(customerSession::class); + $this->checkoutSessionMock = $this->createMock(checkoutSession::class); + $this->configProviderMock = $this->createMock(CompositeConfigProvider::class); + $this->layoutProcessorMock = $this->createMock(LayoutProcessorInterface::class); + $this->serializerMock = $this->createMock(JsonHexTag::class); + $this->jsonHexTagSerializerMock = $this->createMock(JsonHexTag::class); + $this->storeManagerMock = $this->createMock(StoreManagerInterface::class); $this->layout = [ 'components' => [ 'firstComponent' => ['param' => 'value'], @@ -66,59 +94,125 @@ protected function setUp() ] ]; - $this->storeManager = $this->createMock(\Magento\Store\Model\StoreManagerInterface::class); - $this->context->expects($this->once())->method('getStoreManager')->willReturn($this->storeManager); - $this->serializer = $this->createMock(\Magento\Framework\Serialize\Serializer\Json::class); + $this->contextMock->expects($this->once()) + ->method('getStoreManager') + ->willReturn($this->storeManagerMock); - $this->model = new \Magento\Checkout\Block\Cart\Shipping( - $this->context, - $this->customerSession, - $this->checkoutSession, - $this->configProvider, - [$this->layoutProcessor], + $this->block = new Shipping( + $this->contextMock, + $this->customerSessionMock, + $this->checkoutSessionMock, + $this->configProviderMock, + [$this->layoutProcessorMock], ['jsLayout' => $this->layout], - $this->serializer + $this->serializerMock, + $this->jsonHexTagSerializerMock ); } - public function testGetCheckoutConfig() + /** + * Test for getCheckoutConfig + * + * @return void + */ + public function testGetCheckoutConfig(): void { $config = ['param' => 'value']; - $this->configProvider->expects($this->once())->method('getConfig')->willReturn($config); - $this->assertEquals($config, $this->model->getCheckoutConfig()); + $this->configProviderMock->expects($this->once()) + ->method('getConfig') + ->willReturn($config); + + $this->assertEquals($config, $this->block->getCheckoutConfig()); } - public function testGetJsLayout() + /** + * Test for getJsLayout() + * + * @return void + * @dataProvider getJsLayoutDataProvider + */ + public function testGetJsLayout(array $layoutProcessed, string $jsonLayoutProcessed): void { - $layoutProcessed = $this->layout; - $layoutProcessed['components']['thirdComponent'] = ['param' => 'value']; - $jsonLayoutProcessed = json_encode($layoutProcessed); - - $this->layoutProcessor->expects($this->once()) + $this->layoutProcessorMock->expects($this->once()) ->method('process') ->with($this->layout) ->willReturn($layoutProcessed); - $this->assertEquals( - $jsonLayoutProcessed, - $this->model->getJsLayout() - ); + $this->jsonHexTagSerializerMock->expects($this->once()) + ->method('serialize') + ->willReturn($jsonLayoutProcessed); + + $this->assertEquals($jsonLayoutProcessed, $this->block->getJsLayout()); } - public function testGetBaseUrl() + /** + * Data for getJsLayout() + * + * @return array + */ + public function getJsLayoutDataProvider(): array + { + $layoutProcessed = $this->layout; + $layoutProcessed['components']['thirdComponent'] = ['param' => 'value']; + return [ + [ + $layoutProcessed, + '{"components":{"firstComponent":{"param":"value"},"secondComponent":{"param":"value"},"thirdComponent":{"param":"value"}}}' + ] + ]; + } + + /** + * Test for getBaseUrl() + * + * @return void + */ + public function testGetBaseUrl(): void { $baseUrl = 'baseUrl'; $storeMock = $this->createPartialMock(\Magento\Store\Model\Store::class, ['getBaseUrl']); - $storeMock->expects($this->once())->method('getBaseUrl')->willReturn($baseUrl); - $this->storeManager->expects($this->once())->method('getStore')->willReturn($storeMock); - $this->assertEquals($baseUrl, $this->model->getBaseUrl()); + $storeMock->expects($this->once()) + ->method('getBaseUrl') + ->willReturn($baseUrl); + + $this->storeManagerMock->expects($this->once()) + ->method('getStore') + ->willReturn($storeMock); + + $this->assertEquals($baseUrl, $this->block->getBaseUrl()); } - public function testGetSerializedCheckoutConfig() + /** + * Test for getSerializedCheckoutConfig() + * + * @return void + * @dataProvider jsonEncodeDataProvider + */ + public function testGetSerializedCheckoutConfig(array $checkoutConfig, string $expectedJson): void { - $checkoutConfig = ['checkout', 'config']; - $this->configProvider->expects($this->once())->method('getConfig')->willReturn($checkoutConfig); + $this->configProviderMock->expects($this->once()) + ->method('getConfig') + ->willReturn($checkoutConfig); + + $this->jsonHexTagSerializerMock->expects($this->once()) + ->method('serialize') + ->willReturn($expectedJson); + + $this->assertEquals($expectedJson, $this->block->getSerializedCheckoutConfig()); + } - $this->assertEquals(json_encode($checkoutConfig), $this->model->getSerializedCheckoutConfig()); + /** + * Data for getSerializedCheckoutConfig() + * + * @return array + */ + public function jsonEncodeDataProvider(): array + { + return [ + [ + ['checkout', 'config'], + '["checkout","config"]' + ] + ]; } } From 9b84a0438a8228e1fbeac2f6fde67e7dbc6440f6 Mon Sep 17 00:00:00 2001 From: "rostyslav.hymon" <rostyslav.hymon@transoftgroup.com> Date: Thu, 19 Dec 2019 15:39:20 +0200 Subject: [PATCH 430/586] MC-29677: Customizable Options are not imported when row_id is not equal to entity_id for products --- .../ProductCustomOptionsDataProviderTest.php | 37 ++++++++++++++++++- .../ProductCustomOptionsDataProvider.php | 30 +++++++++++++-- 2 files changed, 62 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/ProductCustomOptionsDataProviderTest.php b/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/ProductCustomOptionsDataProviderTest.php index 0e0cb676cdf3e..143ef4461173a 100644 --- a/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/ProductCustomOptionsDataProviderTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/ProductCustomOptionsDataProviderTest.php @@ -11,6 +11,9 @@ use Magento\Framework\App\RequestInterface; use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection; use Magento\Framework\DB\Select as DbSelect; +use Magento\Framework\EntityManager\MetadataPool; +use Magento\Framework\EntityManager\EntityMetadataInterface; +use Magento\Ui\DataProvider\Modifier\PoolInterface; class ProductCustomOptionsDataProviderTest extends \PHPUnit\Framework\TestCase { @@ -44,6 +47,21 @@ class ProductCustomOptionsDataProviderTest extends \PHPUnit\Framework\TestCase */ protected $dbSelectMock; + /** + * @var MetadataPool|\PHPUnit_Framework_MockObject_MockObject + */ + private $metadataPool; + + /** + * @var EntityMetadataInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $entityMetadata; + + /** + * @var PoolInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $modifiersPool; + protected function setUp() { $this->collectionFactoryMock = $this->getMockBuilder(CollectionFactory::class) @@ -73,12 +91,29 @@ protected function setUp() ->method('create') ->willReturn($this->collectionMock); + $this->modifiersPool = $this->getMockBuilder(PoolInterface::class) + ->getMockForAbstractClass(); + $this->entityMetadata = $this->getMockBuilder(EntityMetadataInterface::class) + ->getMockForAbstractClass(); + $this->entityMetadata->expects($this->any()) + ->method('getLinkField') + ->willReturn('entity_id'); + $this->metadataPool = $this->getMockBuilder(MetadataPool::class) + ->disableOriginalConstructor() + ->setMethods(['getMetadata']) + ->getMock(); + $this->metadataPool->expects($this->any()) + ->method('getMetadata') + ->willReturn($this->entityMetadata); + $this->objectManagerHelper = new ObjectManagerHelper($this); $this->dataProvider = $this->objectManagerHelper->getObject( ProductCustomOptionsDataProvider::class, [ 'collectionFactory' => $this->collectionFactoryMock, - 'request' => $this->requestMock + 'request' => $this->requestMock, + 'modifiersPool' => $this->modifiersPool, + 'metadataPool' => $this->metadataPool ] ); } diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductCustomOptionsDataProvider.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductCustomOptionsDataProvider.php index b8e9155b8eab1..6de75e79b56da 100644 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductCustomOptionsDataProvider.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductCustomOptionsDataProvider.php @@ -12,6 +12,9 @@ use Magento\Catalog\Api\Data\ProductInterface; use Magento\Catalog\Model\Product\Option as ProductOption; use Magento\Framework\DataObject; +use Magento\Framework\EntityManager\MetadataPool; +use Magento\Framework\App\ObjectManager; +use Magento\Ui\DataProvider\Modifier\PoolInterface; /** * DataProvider for grid on Import Custom Options modal panel @@ -39,6 +42,11 @@ class ProductCustomOptionsDataProvider extends ProductDataProvider */ protected $productOptionValueModel; + /** + * @var MetadataPool + */ + private $metadataPool; + /** * @param string $name * @param string $primaryFieldName @@ -51,6 +59,8 @@ class ProductCustomOptionsDataProvider extends ProductDataProvider * @param \Magento\Ui\DataProvider\AddFilterToCollectionInterface[] $addFilterStrategies * @param array $meta * @param array $data + * @param PoolInterface|null $modifiersPool + * @param MetadataPool|null $metadataPool * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -64,7 +74,9 @@ public function __construct( array $addFieldStrategies = [], array $addFilterStrategies = [], array $meta = [], - array $data = [] + array $data = [], + PoolInterface $modifiersPool = null, + MetadataPool $metadataPool = null ) { parent::__construct( $name, @@ -74,16 +86,19 @@ public function __construct( $addFieldStrategies, $addFilterStrategies, $meta, - $data + $data, + $modifiersPool ); $this->request = $request; $this->productOptionRepository = $productOptionRepository; $this->productOptionValueModel = $productOptionValueModel; + $this->metadataPool = $metadataPool ?: ObjectManager::getInstance() + ->get(MetadataPool::class); } /** - * {@inheritdoc} + * @inheritdoc * @since 101.0.0 */ public function getData() @@ -95,9 +110,16 @@ public function getData() $this->getCollection()->getSelect()->where('e.entity_id != ?', $currentProductId); } + try { + $entityMetadata = $this->metadataPool->getMetadata(ProductInterface::class); + $linkField = $entityMetadata->getLinkField(); + } catch (\Exception $e) { + $linkField = 'entity_id'; + } + $this->getCollection()->getSelect()->distinct()->join( ['opt' => $this->getCollection()->getTable('catalog_product_option')], - 'opt.product_id = e.entity_id', + 'opt.product_id = e.' . $linkField, null ); $this->getCollection()->load(); From 6222a6aabf9fa573bf08b452207194c5ac45e378 Mon Sep 17 00:00:00 2001 From: Mastiuhin Olexandr <mastiuhin.olexandr@transoftgroup.com> Date: Thu, 19 Dec 2019 16:23:05 +0200 Subject: [PATCH 431/586] MC-29891: rest/async/bulk/V1/orders doesn't work --- app/code/Magento/Sales/etc/webapi.xml | 2 +- app/code/Magento/WebapiAsync/Model/Config.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Sales/etc/webapi.xml b/app/code/Magento/Sales/etc/webapi.xml index 492dff8057039..63d7c24ecd16f 100644 --- a/app/code/Magento/Sales/etc/webapi.xml +++ b/app/code/Magento/Sales/etc/webapi.xml @@ -253,7 +253,7 @@ <resource ref="Magento_Sales::ship" /> </resources> </route> - <route url="/V1/orders/" method="POST"> + <route url="/V1/orders" method="POST"> <service class="Magento\Sales\Api\OrderRepositoryInterface" method="save"/> <resources> <resource ref="Magento_Sales::create" /> diff --git a/app/code/Magento/WebapiAsync/Model/Config.php b/app/code/Magento/WebapiAsync/Model/Config.php index 16c24643ba355..7980be479dfa5 100644 --- a/app/code/Magento/WebapiAsync/Model/Config.php +++ b/app/code/Magento/WebapiAsync/Model/Config.php @@ -179,7 +179,7 @@ private function generateTopicNameFromService($serviceInterface, $serviceMethod, */ private function generateKey($typeName, $methodName, $delimiter = '\\', $lcfirst = true) { - $parts = explode($delimiter, ltrim($typeName, $delimiter)); + $parts = explode($delimiter, trim($typeName, $delimiter)); foreach ($parts as &$part) { $part = ltrim($part, ':'); if ($lcfirst === true) { From fea83cde7acce907bcc6e8f82ab3c1e6c7378975 Mon Sep 17 00:00:00 2001 From: Sathish <srsathish92@gmail.com> Date: Thu, 19 Dec 2019 20:21:05 +0530 Subject: [PATCH 432/586] Fixed static test --- app/code/Magento/Checkout/Block/Cart/Shipping.php | 4 ++++ .../Magento/Checkout/Test/Unit/Block/Cart/ShippingTest.php | 7 +++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Checkout/Block/Cart/Shipping.php b/app/code/Magento/Checkout/Block/Cart/Shipping.php index f8347fadeb947..870cc8dace120 100644 --- a/app/code/Magento/Checkout/Block/Cart/Shipping.php +++ b/app/code/Magento/Checkout/Block/Cart/Shipping.php @@ -16,6 +16,8 @@ use Magento\Framework\App\ObjectManager; /** + * Cart Shipping Block + * * @api * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ @@ -107,6 +109,8 @@ public function getBaseUrl() } /** + * Get Serialized Checkout Config + * * @return bool|string * @since 100.2.0 */ diff --git a/app/code/Magento/Checkout/Test/Unit/Block/Cart/ShippingTest.php b/app/code/Magento/Checkout/Test/Unit/Block/Cart/ShippingTest.php index e5f33cf0d408f..1e2dd08cb20ae 100644 --- a/app/code/Magento/Checkout/Test/Unit/Block/Cart/ShippingTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Block/Cart/ShippingTest.php @@ -89,8 +89,7 @@ protected function setUp(): void $this->storeManagerMock = $this->createMock(StoreManagerInterface::class); $this->layout = [ 'components' => [ - 'firstComponent' => ['param' => 'value'], - 'secondComponent' => ['param' => 'value'], + 'firstComponent' => ['param' => 'value'] ] ]; @@ -153,11 +152,11 @@ public function testGetJsLayout(array $layoutProcessed, string $jsonLayoutProces public function getJsLayoutDataProvider(): array { $layoutProcessed = $this->layout; - $layoutProcessed['components']['thirdComponent'] = ['param' => 'value']; + $layoutProcessed['components']['secondComponent'] = ['param' => 'value']; return [ [ $layoutProcessed, - '{"components":{"firstComponent":{"param":"value"},"secondComponent":{"param":"value"},"thirdComponent":{"param":"value"}}}' + '{"components":{"firstComponent":{"param":"value"},"secondComponent":{"param":"value"}}}' ] ]; } From 9f81875441ed608b4b0029ead9576ab9fd64af09 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Thu, 19 Dec 2019 22:18:30 +0700 Subject: [PATCH 433/586] [ImportExport] Cover Export Source Model by Unit Test --- .../Unit/Model/Source/Export/EntityTest.php | 95 +++++++++++++++++++ .../Unit/Model/Source/Export/FormatTest.php | 86 +++++++++++++++++ 2 files changed, 181 insertions(+) create mode 100644 app/code/Magento/ImportExport/Test/Unit/Model/Source/Export/EntityTest.php create mode 100644 app/code/Magento/ImportExport/Test/Unit/Model/Source/Export/FormatTest.php diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/Source/Export/EntityTest.php b/app/code/Magento/ImportExport/Test/Unit/Model/Source/Export/EntityTest.php new file mode 100644 index 0000000000000..d839e97be8278 --- /dev/null +++ b/app/code/Magento/ImportExport/Test/Unit/Model/Source/Export/EntityTest.php @@ -0,0 +1,95 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\ImportExport\Test\Unit\Model\Source\Export; + +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\ImportExport\Model\Export\ConfigInterface; +use Magento\ImportExport\Model\Source\Export\Entity; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +class EntityTest extends TestCase +{ + /** + * @var ConfigInterface|MockObject + */ + private $exportConfigMock; + + /** + * @var Entity + */ + private $model; + + /** + * Setup environment for test + */ + protected function setUp() + { + $this->exportConfigMock = $this->createMock(ConfigInterface::class); + + $objectManager = new ObjectManager($this); + $this->model = $objectManager->getObject( + Entity::class, + [ + 'exportConfig' => $this->exportConfigMock + ] + ); + } + + /** + * Test toOptionArray with data provider + * + * @param array $entities + * @param array $expected + * @dataProvider toOptionArrayDataProvider + */ + public function testToOptionArray($entities, $expected) + { + $this->exportConfigMock->expects($this->any())->method('getEntities')->willReturn($entities); + + $this->assertEquals($expected, $this->model->toOptionArray()); + } + + /** + * Data Provider for test toOptionArray + * + * @return array + */ + public function toOptionArrayDataProvider() + { + return [ + 'Empty Entity' => [ + [], + [ + [ + 'label' => (string)__('-- Please Select --'), + 'value' => '' + ] + ] + ], + 'Has entities' => [ + [ + 'entity1' => [ + 'label' => 'Entity 1' + ] + ], + [ + [ + 'label' => (string)__('-- Please Select --'), + 'value' => '' + ], + [ + 'label' => (string)__('Entity 1'), + 'value' => 'entity1' + ] + ] + ] + ]; + } +} diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/Source/Export/FormatTest.php b/app/code/Magento/ImportExport/Test/Unit/Model/Source/Export/FormatTest.php new file mode 100644 index 0000000000000..416bab2c124f1 --- /dev/null +++ b/app/code/Magento/ImportExport/Test/Unit/Model/Source/Export/FormatTest.php @@ -0,0 +1,86 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\ImportExport\Test\Unit\Model\Source\Export; + +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\ImportExport\Model\Export\ConfigInterface; +use Magento\ImportExport\Model\Source\Export\Format; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +class FormatTest extends TestCase +{ + /** + * @var ConfigInterface|MockObject + */ + private $exportConfigMock; + + /** + * @var Format + */ + private $model; + + /** + * Setup environment for test + */ + protected function setUp() + { + $this->exportConfigMock = $this->createMock(ConfigInterface::class); + + $objectManager = new ObjectManager($this); + $this->model = $objectManager->getObject( + Format::class, + [ + 'exportConfig' => $this->exportConfigMock + ] + ); + } + + /** + * Test toOptionArray with data provider + * + * @param array $fileFormats + * @param array $expected + * @dataProvider toOptionArrayDataProvider + */ + public function testToOptionArray($fileFormats, $expected) + { + $this->exportConfigMock->expects($this->any())->method('getFileFormats')->willReturn($fileFormats); + + $this->assertEquals($expected, $this->model->toOptionArray()); + } + + /** + * Data Provider for test toOptionArray + * + * @return array + */ + public function toOptionArrayDataProvider() + { + return [ + 'Empty file format' => [ + [], + [] + ], + 'Has file format' => [ + [ + 'fileFormat1' => [ + 'label' => 'File Format 1' + ] + ], + [ + [ + 'label' => (string)__('File Format 1'), + 'value' => 'fileFormat1' + ] + ] + ] + ]; + } +} From ab43702d2e75ba642ee3d696f6dd555c586e4ca3 Mon Sep 17 00:00:00 2001 From: Eden Duong <quocviet312@gmail.com> Date: Thu, 19 Dec 2019 22:23:45 +0700 Subject: [PATCH 434/586] Update app/code/Magento/Weee/Test/Unit/Plugin/Catalog/Controller/Adminhtml/Product/Initialization/Helper/ProcessTaxAttributeTest.php Co-Authored-By: Dmytro Cheshun <d.cheshun@atwix.com> --- .../Product/Initialization/Helper/ProcessTaxAttributeTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Weee/Test/Unit/Plugin/Catalog/Controller/Adminhtml/Product/Initialization/Helper/ProcessTaxAttributeTest.php b/app/code/Magento/Weee/Test/Unit/Plugin/Catalog/Controller/Adminhtml/Product/Initialization/Helper/ProcessTaxAttributeTest.php index 28134a4c00363..002a4f40bff14 100644 --- a/app/code/Magento/Weee/Test/Unit/Plugin/Catalog/Controller/Adminhtml/Product/Initialization/Helper/ProcessTaxAttributeTest.php +++ b/app/code/Magento/Weee/Test/Unit/Plugin/Catalog/Controller/Adminhtml/Product/Initialization/Helper/ProcessTaxAttributeTest.php @@ -79,7 +79,7 @@ public function testAfterInitializeFromDataWhenAttributesAreEmpty() $this->resultMock->expects($this->any())->method('getAttributes') ->willReturn([]); - $this->resultMock->expects($this->never())->method('setData')->willReturnSelf(); + $this->resultMock->expects($this->never())->method('setData'); $this->plugin->afterInitializeFromData($this->subjectMock, $this->resultMock, $this->productMock, []); } From 1c727bb82fc1ff47202c6d1d87f2ee87a1509e30 Mon Sep 17 00:00:00 2001 From: Eden Duong <quocviet312@gmail.com> Date: Thu, 19 Dec 2019 22:23:52 +0700 Subject: [PATCH 435/586] Update app/code/Magento/Weee/Test/Unit/Plugin/Catalog/Controller/Adminhtml/Product/Initialization/Helper/ProcessTaxAttributeTest.php Co-Authored-By: Dmytro Cheshun <d.cheshun@atwix.com> --- .../Product/Initialization/Helper/ProcessTaxAttributeTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Weee/Test/Unit/Plugin/Catalog/Controller/Adminhtml/Product/Initialization/Helper/ProcessTaxAttributeTest.php b/app/code/Magento/Weee/Test/Unit/Plugin/Catalog/Controller/Adminhtml/Product/Initialization/Helper/ProcessTaxAttributeTest.php index 002a4f40bff14..2c88d3e0f0251 100644 --- a/app/code/Magento/Weee/Test/Unit/Plugin/Catalog/Controller/Adminhtml/Product/Initialization/Helper/ProcessTaxAttributeTest.php +++ b/app/code/Magento/Weee/Test/Unit/Plugin/Catalog/Controller/Adminhtml/Product/Initialization/Helper/ProcessTaxAttributeTest.php @@ -98,7 +98,7 @@ public function testAfterInitializeFromDataWhenAttributesDoNotIncludeWeee() $this->resultMock->expects($this->any())->method('getAttributes') ->willReturn([$attributeMock]); - $this->resultMock->expects($this->never())->method('setData')->willReturnSelf(); + $this->resultMock->expects($this->never())->method('setData'); $this->plugin->afterInitializeFromData($this->subjectMock, $this->resultMock, $this->productMock, []); } From e9939e04e6c45e80fa8cc619adc20be0c54df88b Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Thu, 19 Dec 2019 17:36:02 +0200 Subject: [PATCH 436/586] Adjusting the Unit Test --- .../Unit/Plugin/ResetQuoteAddressesTest.php | 145 +++++++++++++----- 1 file changed, 104 insertions(+), 41 deletions(-) diff --git a/app/code/Magento/Checkout/Test/Unit/Plugin/ResetQuoteAddressesTest.php b/app/code/Magento/Checkout/Test/Unit/Plugin/ResetQuoteAddressesTest.php index 60db2a36b34dc..0ec644a381955 100644 --- a/app/code/Magento/Checkout/Test/Unit/Plugin/ResetQuoteAddressesTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Plugin/ResetQuoteAddressesTest.php @@ -21,6 +21,21 @@ */ class ResetQuoteAddressesTest extends TestCase { + /** + * @var int + */ + private const STUB_ADDRESS_ID = 1; + + /** + * @var int + */ + private const STUB_ITEM_ID = 1; + + /** + * @var array + */ + private const STUB_QUOTE_ITEMS = [1, 2]; + /** * @var ResetQuoteAddresses */ @@ -65,11 +80,9 @@ protected function setUp() */ public function testRemovingTheAddressesFromNonEmptyQuote() { - $quoteVisibleItems = [1, 2]; - $this->quoteMock->expects($this->any()) ->method('getAllVisibleItems') - ->will($this->returnValue($quoteVisibleItems)); + ->will($this->returnValue(static::STUB_QUOTE_ITEMS)); $this->quoteMock->expects($this->never()) ->method('getAllAddresses') ->willReturnSelf(); @@ -78,46 +91,81 @@ public function testRemovingTheAddressesFromNonEmptyQuote() } /** - * Test clearing the addresses from an empty quote + * Test clearing the addresses from an empty quote with addresses + * + * @dataProvider quoteAddressesDataProvider * - * @dataProvider quoteDataProvider * @param bool $isVirtualQuote - * @param bool $quoteHasAddresses - * @param $extensionAttributes + * @param array $extensionAttributes */ - public function testClearingTheAddressesFromEmptyQuote( + public function testClearingAddressesSuccessfullyFromEmptyQuoteWithAddress( bool $isVirtualQuote, - bool $quoteHasAddresses, - $extensionAttributes + array $extensionAttributes ) { - $quoteVisibleItems = []; - $this->quoteMock->expects($this->any()) ->method('getAllVisibleItems') - ->will($this->returnValue($quoteVisibleItems)); + ->will($this->returnValue([])); - if ($quoteHasAddresses) { - $address = $this->createPartialMock(Address::class, ['getId']); + $address = $this->createPartialMock(Address::class, ['getId']); - $address->expects($this->any()) - ->method('getId') - ->willReturn(1); + $address->expects($this->any()) + ->method('getId') + ->willReturn(static::STUB_ADDRESS_ID); - $addresses = [$address]; + $addresses = [$address]; - $this->quoteMock->expects($this->any()) - ->method('getAllAddresses') - ->will($this->returnValue($addresses)); + $this->quoteMock->expects($this->any()) + ->method('getAllAddresses') + ->will($this->returnValue($addresses)); - $this->quoteMock->expects($this->exactly(count($addresses))) - ->method('removeAddress') + $this->quoteMock->expects($this->exactly(count($addresses))) + ->method('removeAddress') + ->willReturnSelf(); + + $this->quoteMock->expects($this->once()) + ->method('getExtensionAttributes') + ->willReturn($this->extensionAttributesMock); + + $this->quoteMock->expects($this->once()) + ->method('isVirtual') + ->willReturn($isVirtualQuote); + + if (!$isVirtualQuote && $extensionAttributes) { + $this->extensionAttributesMock->expects($this->any()) + ->method('getShippingAssignments') + ->willReturn($extensionAttributes); + + $this->extensionAttributesMock->expects($this->once()) + ->method('setShippingAssignments') ->willReturnSelf(); - } else { - $this->quoteMock->expects($this->any()) - ->method('getAllAddresses') - ->willReturn([]); } + $this->plugin->afterRemoveItem($this->quoteMock, $this->quoteMock, static::STUB_ITEM_ID); + } + + /** + * Test clearing the addresses from an empty quote + * + * @dataProvider quoteNoAddressesDataProvider + * + * @param bool $isVirtualQuote + * @param array $extensionAttributes + */ + public function testClearingTheAddressesFromEmptyQuote( + bool $isVirtualQuote, + array $extensionAttributes + ) { + $quoteVisibleItems = []; + $addresses = []; + + $this->quoteMock->expects($this->any()) + ->method('getAllVisibleItems') + ->will($this->returnValue($quoteVisibleItems)); + + $this->quoteMock->expects($this->any()) + ->method('getAllAddresses') + ->willReturn($addresses); + $this->quoteMock->expects($this->once()) ->method('getExtensionAttributes') ->willReturn($this->extensionAttributesMock); @@ -126,45 +174,60 @@ public function testClearingTheAddressesFromEmptyQuote( ->method('isVirtual') ->willReturn($isVirtualQuote); - if ($isVirtualQuote && $extensionAttributes) { + if (!$isVirtualQuote && $extensionAttributes) { $this->extensionAttributesMock->expects($this->any()) ->method('getShippingAssignments') - ->willReturn([1]); + ->willReturn($extensionAttributes); $this->extensionAttributesMock->expects($this->once()) ->method('setShippingAssignments') ->willReturnSelf(); } - $this->plugin->afterRemoveItem($this->quoteMock, $this->quoteMock, 1); + $this->plugin->afterRemoveItem($this->quoteMock, $this->quoteMock, static::STUB_ITEM_ID); } /** - * Quote information data provider + * Quote without address data provider * * @return array */ - public function quoteDataProvider(): array + public function quoteNoAddressesDataProvider(): array { return [ 'Test case with virtual quote' => [ true, - true, - null - ], - 'Test case with virtual quote and without a quote address' => [ - true, - false, - null + [] ], 'Test case with a non virtual quote without extension attributes' => [ false, - true, [] ], 'Test case with a non virtual quote with shipping assignments' => [ false, + [1] + ] + ]; + } + + /** + * Quote with address information data provider + * + * @return array + */ + public function quoteAddressesDataProvider(): array + { + return [ + 'Test case with a virtual quote and no shipping assignments' => [ true, + [] + ], + 'Test case with a virtual quote and with shipping assignments' => [ + true, + [1] + ], + 'Test case with none virtual quote and with shipping assignments' => [ + false, [1] ] ]; From 54fe070c63ea4ccad8dd4f3b9821e112e89f1f7e Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Thu, 19 Dec 2019 17:37:51 +0200 Subject: [PATCH 437/586] Small adjustments --- .../Checkout/Test/Unit/Plugin/ResetQuoteAddressesTest.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Checkout/Test/Unit/Plugin/ResetQuoteAddressesTest.php b/app/code/Magento/Checkout/Test/Unit/Plugin/ResetQuoteAddressesTest.php index 0ec644a381955..d5d3e3e8b0469 100644 --- a/app/code/Magento/Checkout/Test/Unit/Plugin/ResetQuoteAddressesTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Plugin/ResetQuoteAddressesTest.php @@ -31,6 +31,11 @@ class ResetQuoteAddressesTest extends TestCase */ private const STUB_ITEM_ID = 1; + /** + * @var int + */ + private const STUB_SHIPPING_ASSIGNMENTS = 1; + /** * @var array */ @@ -133,7 +138,7 @@ public function testClearingAddressesSuccessfullyFromEmptyQuoteWithAddress( if (!$isVirtualQuote && $extensionAttributes) { $this->extensionAttributesMock->expects($this->any()) ->method('getShippingAssignments') - ->willReturn($extensionAttributes); + ->willReturn([static::STUB_SHIPPING_ASSIGNMENTS]); $this->extensionAttributesMock->expects($this->once()) ->method('setShippingAssignments') From 37a953f450a4aa5b83cd2e23fdd40e08abe9118d Mon Sep 17 00:00:00 2001 From: Mastiuhin Olexandr <mastiuhin.olexandr@transoftgroup.com> Date: Thu, 19 Dec 2019 19:01:07 +0200 Subject: [PATCH 438/586] MC-29786: Radio buttons for shipping methods are disabled in shopping cart --- .../view/frontend/web/template/cart/shipping-rates.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Checkout/view/frontend/web/template/cart/shipping-rates.html b/app/code/Magento/Checkout/view/frontend/web/template/cart/shipping-rates.html index 5d1889519a302..9f0d436056924 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/cart/shipping-rates.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/cart/shipping-rates.html @@ -24,7 +24,8 @@ checked: $parents[1].selectedShippingMethod, attr: { value: carrier_code + '_' + method_code, - id: 's_method_' + carrier_code + '_' + method_code + id: 's_method_' + carrier_code + '_' + method_code, + disabled: false } "/> <label class="label" data-bind="attr: {for: 's_method_' + carrier_code + '_' + method_code}"> From 52b66acf17e049dc2c5c7d9e12bd6d29d6a1a16d Mon Sep 17 00:00:00 2001 From: Michael Bottens <michael.bottens@blueacorn.com> Date: Tue, 12 Nov 2019 12:06:45 -0500 Subject: [PATCH 439/586] #1057: Emulate area code for graphql category/product attributes --- app/code/Magento/CatalogGraphQl/etc/graphql/di.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/code/Magento/CatalogGraphQl/etc/graphql/di.xml b/app/code/Magento/CatalogGraphQl/etc/graphql/di.xml index 066a7b38d8967..ed548efc896f8 100644 --- a/app/code/Magento/CatalogGraphQl/etc/graphql/di.xml +++ b/app/code/Magento/CatalogGraphQl/etc/graphql/di.xml @@ -176,4 +176,10 @@ </argument> </arguments> </type> + + <type name="Magento\Catalog\Helper\Data"> + <arguments> + <argument name="templateFilterModel" xsi:type="string">Magento\Widget\Model\Template\FilterEmulate</argument> + </arguments> + </type> </config> From 5fcac84a5d0a080279ff77e681aae051afd9490c Mon Sep 17 00:00:00 2001 From: Karyna Tsymbal <k.tsymbal@atwix.com> Date: Wed, 20 Nov 2019 15:44:32 +0200 Subject: [PATCH 440/586] GraphQl Issue#1061 - Remove redundant logic from resolvers --- .../Customer/SetPaymentMethodTest.php | 120 +----------------- .../Customer/SetPaymentMethodTest.php | 29 ----- .../Braintree/Guest/SetPaymentMethodTest.php | 33 ----- .../Customer/AddSimpleProductToCartTest.php | 56 -------- .../Customer/AddVirtualProductToCartTest.php | 55 -------- .../Quote/Customer/ApplyCouponToCartTest.php | 43 ------- .../GraphQl/Quote/Customer/PlaceOrderTest.php | 20 --- .../Customer/RemoveCouponFromCartTest.php | 23 ---- .../Quote/Customer/RemoveItemFromCartTest.php | 44 ------- .../Customer/SetBillingAddressOnCartTest.php | 9 -- .../SetPaymentMethodAndPlaceOrderTest.php | 11 -- .../Customer/SetPaymentMethodOnCartTest.php | 8 -- .../Customer/SetShippingAddressOnCartTest.php | 13 -- .../Customer/SetShippingMethodsOnCartTest.php | 24 ---- .../Quote/Customer/UpdateCartItemsTest.php | 37 ------ .../Guest/AddSimpleProductToCartTest.php | 51 -------- .../Guest/AddVirtualProductToCartTest.php | 52 -------- .../Quote/Guest/ApplyCouponToCartTest.php | 43 ------- .../Quote/Guest/ApplyCouponsToCartTest.php | 43 ------- .../GraphQl/Quote/Guest/PlaceOrderTest.php | 19 --- .../Quote/Guest/RemoveCouponFromCartTest.php | 22 ---- .../Quote/Guest/RemoveItemFromCartTest.php | 43 ------- .../Guest/SetBillingAddressOnCartTest.php | 52 -------- .../Guest/SetPaymentMethodOnCartTest.php | 8 -- .../Guest/SetShippingAddressOnCartTest.php | 56 -------- .../Guest/SetShippingMethodsOnCartTest.php | 24 ---- .../Quote/Guest/UpdateCartItemsTest.php | 36 ------ 27 files changed, 1 insertion(+), 973 deletions(-) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/AuthorizenetAcceptjs/Customer/SetPaymentMethodTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/AuthorizenetAcceptjs/Customer/SetPaymentMethodTest.php index e9ab4456fae81..d6954c249f209 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/AuthorizenetAcceptjs/Customer/SetPaymentMethodTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/AuthorizenetAcceptjs/Customer/SetPaymentMethodTest.php @@ -157,38 +157,7 @@ function (string $maskedQuoteId) { [ 'Required parameter "authorizenet_acceptjs" for "payment_method" is missing.' ] - ], - [ - function (string $maskedQuoteId) { - return $this->getEmptyAcceptJsInput($maskedQuoteId); - }, - [ - 'Field AuthorizenetInput.cc_last_4 of required type Int! was not provided.', - 'Field AuthorizenetInput.opaque_data_descriptor of required type String! was not provided.', - 'Field AuthorizenetInput.opaque_data_value of required type String! was not provided.' - ] - - ], - [ - function (string $maskedQuoteId) { - return $this->getMissingCcLastFourAcceptJsInput( - $maskedQuoteId, - static::VALID_DESCRIPTOR, - static::VALID_NONCE - ); - }, - [ - 'Field AuthorizenetInput.cc_last_4 of required type Int! was not provided', - ] - ], - [ - function (string $maskedQuoteId) { - return $this->getMissingOpaqueDataValueAcceptJsInput($maskedQuoteId, static::VALID_DESCRIPTOR); - }, - [ - 'Field AuthorizenetInput.opaque_data_value of required type String! was not provided', - ] - ], + ] ]; } @@ -218,93 +187,6 @@ private function getInvalidSetPaymentMutation(string $maskedQuoteId): string QUERY; } - /** - * Get setPaymentMethodOnCart missing required additional data properties - * - * @param string $maskedQuoteId - * @return string - */ - private function getEmptyAcceptJsInput(string $maskedQuoteId): string - { - return <<<QUERY -mutation { - setPaymentMethodOnCart(input:{ - cart_id:"{$maskedQuoteId}" - payment_method:{ - code:"authorizenet_acceptjs" - authorizenet_acceptjs: {} - } - }) { - cart { - selected_payment_method { - code - } - } - } -} -QUERY; - } - - /** - * Get setPaymentMethodOnCart missing required additional data properties - * - * @param string $maskedQuoteId - * @return string - */ - private function getMissingCcLastFourAcceptJsInput(string $maskedQuoteId, string $descriptor, string $nonce): string - { - return <<<QUERY -mutation { - setPaymentMethodOnCart(input:{ - cart_id:"{$maskedQuoteId}" - payment_method:{ - code:"authorizenet_acceptjs" - authorizenet_acceptjs:{ - opaque_data_descriptor: "{$descriptor}" - opaque_data_value: "{$nonce}" - } - } - }) { - cart { - selected_payment_method { - code - } - } - } -} -QUERY; - } - - /** - * Get setPaymentMethodOnCart missing required additional data properties - * - * @param string $maskedQuoteId - * @return string - */ - private function getMissingOpaqueDataValueAcceptJsInput(string $maskedQuoteId, string $descriptor): string - { - return <<<QUERY -mutation { - setPaymentMethodOnCart(input:{ - cart_id:"{$maskedQuoteId}" - payment_method:{ - code:"authorizenet_acceptjs" - authorizenet_acceptjs:{ - opaque_data_descriptor: "{$descriptor}" - cc_last_4: 1111 - } - } - }) { - cart { - selected_payment_method { - code - } - } - } -} -QUERY; - } - private function assertPlaceOrderResponse(array $response, string $reservedOrderId): void { self::assertArrayHasKey('placeOrder', $response); diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Braintree/Customer/SetPaymentMethodTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Braintree/Customer/SetPaymentMethodTest.php index a282b295c2974..fbaa3a98613cf 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Braintree/Customer/SetPaymentMethodTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Braintree/Customer/SetPaymentMethodTest.php @@ -270,35 +270,6 @@ public function testSetPaymentMethodInvalidMethodInput(string $methodCode) $this->graphQlMutation($setPaymentQuery, [], '', $this->getHeaderMap()); } - /** - * @magentoConfigFixture default_store carriers/flatrate/active 1 - * @magentoConfigFixture default_store payment/braintree/active 1 - * @magentoConfigFixture default_store payment/braintree_cc_vault/active 1 - * @magentoConfigFixture default_store payment/braintree/environment sandbox - * @magentoConfigFixture default_store payment/braintree/merchant_id def_merchant_id - * @magentoConfigFixture default_store payment/braintree/public_key def_public_key - * @magentoConfigFixture default_store payment/braintree/private_key def_private_key - * @magentoApiDataFixture Magento/Customer/_files/customer.php - * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_flatrate_shipping_method.php - * @expectedException \Exception - */ - public function testSetPaymentMethodWithoutRequiredPaymentMethodInput() - { - $reservedOrderId = 'test_quote'; - $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute($reservedOrderId); - - $setPaymentQuery = $this->getSetPaymentBraintreeQueryInvalidPaymentMethodInput($maskedQuoteId); - $this->expectExceptionMessage( - 'Field BraintreeInput.is_active_payment_token_enabler of required type Boolean! was not provided.' - ); - $this->graphQlMutation($setPaymentQuery, [], '', $this->getHeaderMap()); - } - public function dataProviderTestSetPaymentMethodInvalidInput(): array { return [ diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Braintree/Guest/SetPaymentMethodTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Braintree/Guest/SetPaymentMethodTest.php index c0a7491cbc1bf..b000d6e7ff347 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Braintree/Guest/SetPaymentMethodTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Braintree/Guest/SetPaymentMethodTest.php @@ -129,39 +129,6 @@ public function testSetPaymentMethodInvalidInput() $this->graphQlMutation($setPaymentQuery); } - /** - * @magentoConfigFixture default_store carriers/flatrate/active 1 - * @magentoConfigFixture default_store payment/braintree/active 1 - * @magentoConfigFixture default_store payment/braintree/environment sandbox - * @magentoConfigFixture default_store payment/braintree/merchant_id def_merchant_id - * @magentoConfigFixture default_store payment/braintree/public_key def_public_key - * @magentoConfigFixture default_store payment/braintree/private_key def_private_key - * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/set_guest_email.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_flatrate_shipping_method.php - * @expectedException \Exception - */ - public function testSetPaymentMethodInvalidMethodInput() - { - $reservedOrderId = 'test_quote'; - $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute($reservedOrderId); - - $setPaymentQuery = $this->getSetPaymentBraintreeQueryInvalidMethodInput($maskedQuoteId); - - $this->expectExceptionMessage( - 'Field BraintreeInput.is_active_payment_token_enabler of required type Boolean! was not provided' - ); - $this->expectExceptionMessage( - 'Field BraintreeInput.payment_method_nonce of required type String! was not provided.' - ); - - $this->graphQlMutation($setPaymentQuery); - } - private function assertPlaceOrderResponse(array $response, string $reservedOrderId): void { self::assertArrayHasKey('placeOrder', $response); diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/AddSimpleProductToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/AddSimpleProductToCartTest.php index 0c676d86a33da..aca98e946054c 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/AddSimpleProductToCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/AddSimpleProductToCartTest.php @@ -82,32 +82,6 @@ public function testAddSimpleProductToCart() self::assertEquals('USD', $rowTotalIncludingTax['currency']); } - /** - * @magentoApiDataFixture Magento/Customer/_files/customer.php - * @expectedException Exception - * @expectedExceptionMessage Field AddSimpleProductsToCartInput.cart_id of required type String! was not provided. - */ - public function testAddSimpleProductToCartIfCartIdIsMissed() - { - $query = <<<QUERY -mutation { - addSimpleProductsToCart( - input: { - cart_items: [] - } - ) { - cart { - items { - id - } - } - } -} -QUERY; - - $this->graphQlMutation($query, [], '', $this->getHeaderMap()); - } - /** * @magentoApiDataFixture Magento/Customer/_files/customer.php * @expectedException Exception @@ -135,36 +109,6 @@ public function testAddSimpleProductToCartIfCartIdIsEmpty() $this->graphQlMutation($query, [], '', $this->getHeaderMap()); } - /** - * @magentoApiDataFixture Magento/Customer/_files/customer.php - * @expectedException Exception - */ - public function testAddSimpleProductToCartIfCartItemsAreMissed() - { - $query = <<<QUERY -mutation { - addSimpleProductsToCart( - input: { - cart_id: "cart_id" - } - ) { - cart { - items { - id - } - } - } -} -QUERY; - - $this->expectExceptionMessage( - 'Field AddSimpleProductsToCartInput.cart_items of required type' - . ' [SimpleProductCartItemInput]! was not provided.' - ); - - $this->graphQlMutation($query, [], '', $this->getHeaderMap()); - } - /** * @magentoApiDataFixture Magento/Customer/_files/customer.php * @expectedException Exception diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/AddVirtualProductToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/AddVirtualProductToCartTest.php index a7a3028f2a369..4805721de625a 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/AddVirtualProductToCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/AddVirtualProductToCartTest.php @@ -54,32 +54,6 @@ public function testAddVirtualProductToCart() self::assertEquals($sku, $response['addVirtualProductsToCart']['cart']['items'][0]['product']['sku']); } - /** - * @magentoApiDataFixture Magento/Customer/_files/customer.php - * @expectedException Exception - * @expectedExceptionMessage Field AddSimpleProductsToCartInput.cart_id of required type String! was not provided. - */ - public function testAddVirtualProductToCartIfCartIdIsMissed() - { - $query = <<<QUERY -mutation { - addSimpleProductsToCart( - input: { - cart_items: [] - } - ) { - cart { - items { - id - } - } - } -} -QUERY; - - $this->graphQlMutation($query, [], '', $this->getHeaderMap()); - } - /** * @magentoApiDataFixture Magento/Customer/_files/customer.php * @expectedException Exception @@ -107,35 +81,6 @@ public function testAddVirtualProductToCartIfCartIdIsEmpty() $this->graphQlMutation($query, [], '', $this->getHeaderMap()); } - /** - * @magentoApiDataFixture Magento/Customer/_files/customer.php - */ - public function testAddVirtualProductToCartIfCartItemsAreMissed() - { - $query = <<<QUERY -mutation { - addSimpleProductsToCart( - input: { - cart_id: "cart_id" - } - ) { - cart { - items { - id - } - } - } -} -QUERY; - $this->expectException(\Exception::class); - $this->expectExceptionMessage( - 'Field AddSimpleProductsToCartInput.cart_items of required type [SimpleProductCartItemInput]!' - . ' was not provided.' - ); - - $this->graphQlMutation($query, [], '', $this->getHeaderMap()); - } - /** * @magentoApiDataFixture Magento/Customer/_files/customer.php * @expectedException Exception diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/ApplyCouponToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/ApplyCouponToCartTest.php index fa96443eaee1e..d96bf77f2ef0e 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/ApplyCouponToCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/ApplyCouponToCartTest.php @@ -183,49 +183,6 @@ public function testApplyCouponWhichIsNotApplicable() $this->graphQlMutation($query, [], '', $this->getHeaderMap()); } - /** - * @param string $input - * @param string $message - * @dataProvider dataProviderUpdateWithMissedRequiredParameters - * @magentoApiDataFixture Magento/Customer/_files/customer.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php - * @expectedException \Exception - */ - public function testApplyCouponWithMissedRequiredParameters(string $input, string $message) - { - $query = <<<QUERY -mutation { - applyCouponToCart(input: {{$input}}) { - cart { - applied_coupon { - code - } - } - } -} -QUERY; - - $this->expectExceptionMessage($message); - $this->graphQlMutation($query, [], '', $this->getHeaderMap()); - } - - /** - * @return array - */ - public function dataProviderUpdateWithMissedRequiredParameters(): array - { - return [ - 'missed_cart_id' => [ - 'coupon_code: "test"', - 'Field ApplyCouponToCartInput.cart_id of required type String! was not provided.' - ], - 'missed_coupon_code' => [ - 'cart_id: "test_quote"', - 'Field ApplyCouponToCartInput.coupon_code of required type String! was not provided.' - ], - ]; - } - /** * Retrieve customer authorization headers * diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/PlaceOrderTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/PlaceOrderTest.php index 189d5ceab838d..88c57cf2fb282 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/PlaceOrderTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/PlaceOrderTest.php @@ -103,26 +103,6 @@ public function testPlaceOrderIfCartIdIsEmpty() $this->graphQlMutation($query, [], '', $this->getHeaderMap()); } - /** - * @magentoApiDataFixture Magento/Customer/_files/customer.php - * @expectedException Exception - * @expectedExceptionMessage Field PlaceOrderInput.cart_id of required type String! was not provided. - */ - public function testPlaceOrderIfCartIdIsMissed() - { - $query = <<<QUERY -mutation { - placeOrder(input: {}) { - order { - order_number - } - } -} -QUERY; - - $this->graphQlMutation($query, [], '', $this->getHeaderMap()); - } - /** * @magentoApiDataFixture Magento/Customer/_files/customer.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/RemoveCouponFromCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/RemoveCouponFromCartTest.php index d4390e902a3f9..1b5a308b5a9a8 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/RemoveCouponFromCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/RemoveCouponFromCartTest.php @@ -70,29 +70,6 @@ public function testRemoveCouponFromCartIfCartIdIsEmpty() $this->graphQlMutation($query, [], '', $this->getHeaderMap()); } - /** - * @magentoApiDataFixture Magento/Customer/_files/customer.php - * @expectedException Exception - * @expectedExceptionMessage Field RemoveCouponFromCartInput.cart_id of required type String! was not provided. - */ - public function testRemoveCouponFromCartIfCartIdIsMissed() - { - $query = <<<QUERY -mutation { - removeCouponFromCart(input: {}) { - cart { - applied_coupon { - code - } - } - } -} - -QUERY; - - $this->graphQlMutation($query, [], '', $this->getHeaderMap()); - } - /** * @magentoApiDataFixture Magento/Customer/_files/customer.php * @expectedException Exception diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/RemoveItemFromCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/RemoveItemFromCartTest.php index a14aacc974af6..c93db424834ef 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/RemoveItemFromCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/RemoveItemFromCartTest.php @@ -90,50 +90,6 @@ public function testRemoveNonExistentItem() $this->graphQlMutation($query, [], '', $this->getHeaderMap()); } - /** - * @magentoApiDataFixture Magento/Customer/_files/customer.php - * @param string $input - * @param string $message - * @dataProvider dataProviderUpdateWithMissedRequiredParameters - */ - public function testUpdateWithMissedItemRequiredParameters(string $input, string $message) - { - $query = <<<QUERY -mutation { - removeItemFromCart( - input: { - {$input} - } - ) { - cart { - items { - quantity - } - } - } -} -QUERY; - $this->expectExceptionMessage($message); - $this->graphQlMutation($query, [], '', $this->getHeaderMap()); - } - - /** - * @return array - */ - public function dataProviderUpdateWithMissedRequiredParameters(): array - { - return [ - 'missed_cart_id' => [ - 'cart_item_id: 1', - 'Field RemoveItemFromCartInput.cart_id of required type String! was not provided.' - ], - 'missed_cart_item_id' => [ - 'cart_id: "test_quote"', - 'Field RemoveItemFromCartInput.cart_item_id of required type Int! was not provided.' - ], - ]; - } - /** * _security * @magentoApiDataFixture Magento/Customer/_files/customer.php diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php index 19a10d9466a32..05323a5a7ddf4 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php @@ -653,15 +653,6 @@ public function testSetBillingAddressWithoutRequiredParameters(string $input, st public function dataProviderSetWithoutRequiredParameters(): array { return [ - 'missed_billing_address' => [ - 'cart_id: "cart_id_value"', - 'Field SetBillingAddressOnCartInput.billing_address of required type BillingAddressInput!' - . ' was not provided.', - ], - 'missed_cart_id' => [ - 'billing_address: {}', - 'Field SetBillingAddressOnCartInput.cart_id of required type String! was not provided.' - ], 'missed_region' => [ 'cart_id: "cart_id_value" billing_address: { diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPaymentMethodAndPlaceOrderTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPaymentMethodAndPlaceOrderTest.php index 543ce6fe9c8e7..b31ce8a7302a9 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPaymentMethodAndPlaceOrderTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPaymentMethodAndPlaceOrderTest.php @@ -132,17 +132,6 @@ public function testSetPaymentOnCartWithException(string $input, string $message public function dataProviderSetPaymentOnCartWithException(): array { return [ - 'missed_cart_id' => [ - 'payment_method: { - code: "' . Checkmo::PAYMENT_METHOD_CHECKMO_CODE . '" - }', - 'Field SetPaymentMethodAndPlaceOrderInput.cart_id of required type String! was not provided.', - ], - 'missed_payment_method' => [ - 'cart_id: "cart_id_value"', - 'Field SetPaymentMethodAndPlaceOrderInput.payment_method of required type PaymentMethodInput!' - . ' was not provided.', - ], 'place_order_with_out_of_stock_products' => [ 'cart_id: "cart_id_value" payment_method: { diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPaymentMethodOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPaymentMethodOnCartTest.php index da190be333600..57aeda3295268 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPaymentMethodOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPaymentMethodOnCartTest.php @@ -233,14 +233,6 @@ public function testSetDisabledPaymentOnCart() public function dataProviderSetPaymentMethodWithoutRequiredParameters(): array { return [ - 'missed_cart_id' => [ - 'payment_method: {code: "' . Checkmo::PAYMENT_METHOD_CHECKMO_CODE . '"}', - 'Field SetPaymentMethodOnCartInput.cart_id of required type String! was not provided.' - ], - 'missed_payment_method' => [ - 'cart_id: "cart_id_value"', - 'Field SetPaymentMethodOnCartInput.payment_method of required type PaymentMethodInput! was not provided' - ], 'missed_payment_method_code' => [ 'cart_id: "cart_id_value", payment_method: {code: ""}', 'Required parameter "code" for "payment_method" is missing.' diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingAddressOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingAddressOnCartTest.php index 47a3a13f05221..2a19fb0d10d6a 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingAddressOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingAddressOnCartTest.php @@ -511,19 +511,6 @@ public function testSetNewShippingAddressWithMissedRequiredStreetParameters() public function dataProviderUpdateWithMissedRequiredParameters(): array { return [ - 'missed_shipping_addresses' => [ - 'cart_id: "cart_id_value"', - 'Field SetShippingAddressesOnCartInput.shipping_addresses of required type [ShippingAddressInput]! ' . - 'was not provided.', - ], - 'missed_city' => [ - 'shipping_addresses: [ { address: { save_in_address_book: false } } ]', - 'Field CartAddressInput.city of required type String! was not provided' - ], - 'missed_cart_id' => [ - 'shipping_addresses: {}', - 'Field SetShippingAddressesOnCartInput.cart_id of required type String! was not provided.' - ], 'missed_region' => [ 'cart_id: "cart_id_value" shipping_addresses: [{ diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingMethodsOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingMethodsOnCartTest.php index 149a2fbb1da32..293bfdaf502d9 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingMethodsOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingMethodsOnCartTest.php @@ -169,28 +169,10 @@ public function testSetShippingMethodWithWrongParameters(string $input, string $ public function dataProviderSetShippingMethodWithWrongParameters(): array { return [ - 'missed_cart_id' => [ - 'shipping_methods: [{ - carrier_code: "flatrate" - method_code: "flatrate" - }]', - 'Field SetShippingMethodsOnCartInput.cart_id of required type String! was not provided.' - ], - 'missed_shipping_methods' => [ - 'cart_id: "cart_id_value"', - 'Field SetShippingMethodsOnCartInput.shipping_methods of required type [ShippingMethodInput]!' - . ' was not provided.' - ], 'shipping_methods_are_empty' => [ 'cart_id: "cart_id_value" shipping_methods: []', 'Required parameter "shipping_methods" is missing' ], - 'missed_carrier_code' => [ - 'cart_id: "cart_id_value", shipping_methods: [{ - method_code: "flatrate" - }]', - 'Field ShippingMethodInput.carrier_code of required type String! was not provided.' - ], 'empty_carrier_code' => [ 'cart_id: "cart_id_value", shipping_methods: [{ carrier_code: "" @@ -205,12 +187,6 @@ public function dataProviderSetShippingMethodWithWrongParameters(): array }]', 'Carrier with such method not found: wrong-carrier-code, flatrate' ], - 'missed_method_code' => [ - 'cart_id: "cart_id_value", shipping_methods: [{ - carrier_code: "flatrate" - }]', - 'Field ShippingMethodInput.method_code of required type String! was not provided.' - ], 'empty_method_code' => [ 'cart_id: "cart_id_value", shipping_methods: [{ carrier_code: "flatrate" diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/UpdateCartItemsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/UpdateCartItemsTest.php index 1ec2de36a0bc2..b351872a69bc7 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/UpdateCartItemsTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/UpdateCartItemsTest.php @@ -209,35 +209,6 @@ public function testUpdateItemInAnotherCustomerCart() $this->graphQlMutation($query, [], '', $this->getHeaderMap()); } - /** - * @magentoApiDataFixture Magento/Customer/_files/customer.php - * @expectedException \Exception - * @expectedExceptionMessage Field UpdateCartItemsInput.cart_id of required type String! was not provided. - */ - public function testUpdateWithMissedCartItemId() - { - $query = <<<QUERY -mutation { - updateCartItems(input: { - cart_items: [ - { - cart_item_id: 1 - quantity: 2 - } - ] - }) { - cart { - items { - id - quantity - } - } - } -} -QUERY; - $this->graphQlMutation($query, [], '', $this->getHeaderMap()); - } - /** * @param string $input * @param string $message @@ -275,14 +246,6 @@ public function testUpdateWithMissedItemRequiredParameters(string $input, string public function dataProviderUpdateWithMissedRequiredParameters(): array { return [ - 'missed_cart_items' => [ - '', - 'Field UpdateCartItemsInput.cart_items of required type [CartItemUpdateInput]! was not provided.' - ], - 'missed_cart_item_id' => [ - 'cart_items: [{ quantity: 2 }]', - 'Field CartItemUpdateInput.cart_item_id of required type Int! was not provided.' - ], 'missed_cart_item_qty' => [ 'cart_items: [{ cart_item_id: 1 }]', 'Required parameter "quantity" for "cart_items" is missing.' diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AddSimpleProductToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AddSimpleProductToCartTest.php index 59f11be6d5b45..01ae565f00bf6 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AddSimpleProductToCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AddSimpleProductToCartTest.php @@ -79,31 +79,6 @@ public function testAddSimpleProductToCart() self::assertEquals('USD', $rowTotalIncludingTax['currency']); } - /** - * @expectedException Exception - * @expectedExceptionMessage Field AddSimpleProductsToCartInput.cart_id of required type String! was not provided. - */ - public function testAddSimpleProductToCartIfCartIdIsMissed() - { - $query = <<<QUERY -mutation { - addSimpleProductsToCart( - input: { - cart_items: [] - } - ) { - cart { - items { - id - } - } - } -} -QUERY; - - $this->graphQlMutation($query); - } - /** * @expectedException Exception * @expectedExceptionMessage Required parameter "cart_id" is missing @@ -130,32 +105,6 @@ public function testAddSimpleProductToCartIfCartIdIsEmpty() $this->graphQlMutation($query); } - public function testAddSimpleProductToCartIfCartItemsAreMissed() - { - $query = <<<QUERY -mutation { - addSimpleProductsToCart( - input: { - cart_id: "cart_id" - } - ) { - cart { - items { - id - } - } - } -} -QUERY; - $this->expectException(\Exception::class); - $this->expectExceptionMessage( - 'Field AddSimpleProductsToCartInput.cart_items of required type [SimpleProductCartItemInput]!' - . ' was not provided.' - ); - - $this->graphQlMutation($query); - } - /** * @expectedException Exception * @expectedExceptionMessage Required parameter "cart_items" is missing diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AddVirtualProductToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AddVirtualProductToCartTest.php index c5723d137d070..3811a60ffc522 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AddVirtualProductToCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AddVirtualProductToCartTest.php @@ -51,31 +51,6 @@ public function testAddVirtualProductToCart() self::assertEquals($sku, $response['addVirtualProductsToCart']['cart']['items'][0]['product']['sku']); } - /** - * @expectedException Exception - * @expectedExceptionMessage Field AddSimpleProductsToCartInput.cart_id of required type String! was not provided. - */ - public function testAddVirtualProductToCartIfCartIdIsMissed() - { - $query = <<<QUERY -mutation { - addSimpleProductsToCart( - input: { - cart_items: [] - } - ) { - cart { - items { - id - } - } - } -} -QUERY; - - $this->graphQlMutation($query); - } - /** * @expectedException Exception * @expectedExceptionMessage Required parameter "cart_id" is missing @@ -102,33 +77,6 @@ public function testAddVirtualProductToCartIfCartIdIsEmpty() $this->graphQlMutation($query); } - public function testAddVirtualProductToCartIfCartItemsAreMissed() - { - $query = <<<QUERY -mutation { - addSimpleProductsToCart( - input: { - cart_id: "cart_id" - } - ) { - cart { - items { - id - } - } - } -} -QUERY; - - $this->expectException(\Exception::class); - $this->expectExceptionMessage( - 'Field AddSimpleProductsToCartInput.cart_items of required type [SimpleProductCartItemInput]!' - . ' was not provided.' - ); - - $this->graphQlMutation($query); - } - /** * @expectedException Exception * @expectedExceptionMessage Required parameter "cart_items" is missing diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/ApplyCouponToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/ApplyCouponToCartTest.php index 865837e6bd629..454f01b5cde19 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/ApplyCouponToCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/ApplyCouponToCartTest.php @@ -150,49 +150,6 @@ public function testApplyCouponWhichIsNotApplicable() $this->graphQlMutation($query); } - /** - * @param string $input - * @param string $message - * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php - * @dataProvider dataProviderUpdateWithMissedRequiredParameters - * @expectedException \Exception - */ - public function testApplyCouponWithMissedRequiredParameters(string $input, string $message) - { - $query = <<<QUERY -mutation { - applyCouponToCart(input: {{$input}}) { - cart { - applied_coupon { - code - } - } - } -} -QUERY; - - $this->expectExceptionMessage($message); - $this->graphQlMutation($query); - } - - /** - * @return array - */ - public function dataProviderUpdateWithMissedRequiredParameters(): array - { - return [ - 'missed_cart_id' => [ - 'coupon_code: "test"', - 'Field ApplyCouponToCartInput.cart_id of required type String! was not provided.' - ], - 'missed_coupon_code' => [ - 'cart_id: "test_quote"', - 'Field ApplyCouponToCartInput.coupon_code of required type String! was not provided.' - ], - ]; - } - /** * @param string $maskedQuoteId * @param string $couponCode diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/ApplyCouponsToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/ApplyCouponsToCartTest.php index 7d5e21cd25b8a..0344e274d6fbc 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/ApplyCouponsToCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/ApplyCouponsToCartTest.php @@ -127,49 +127,6 @@ public function testApplyCouponsWhichIsNotApplicable() $this->graphQlMutation($query); } - /** - * @param string $input - * @param string $message - * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php - * @dataProvider dataProviderUpdateWithMissedRequiredParameters - * @expectedException \Exception - */ - public function testApplyCouponsWithMissedRequiredParameters(string $input, string $message) - { - $query = <<<QUERY -mutation { - applyCouponToCart(input: {{$input}}) { - cart { - applied_coupons { - code - } - } - } -} -QUERY; - - $this->expectExceptionMessage($message); - $this->graphQlMutation($query); - } - - /** - * @return array - */ - public function dataProviderUpdateWithMissedRequiredParameters(): array - { - return [ - 'missed_cart_id' => [ - 'coupon_code: "test"', - 'Field ApplyCouponToCartInput.cart_id of required type String! was not provided.' - ], - 'missed_coupon_code' => [ - 'cart_id: "test_quote"', - 'Field ApplyCouponToCartInput.coupon_code of required type String! was not provided.' - ], - ]; - } - /** * @param string $maskedQuoteId * @param string $couponCode diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/PlaceOrderTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/PlaceOrderTest.php index c6c1d3be99c59..bf31d3c6fa3f4 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/PlaceOrderTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/PlaceOrderTest.php @@ -95,25 +95,6 @@ public function testPlaceOrderIfCartIdIsEmpty() $this->graphQlMutation($query); } - /** - * @expectedException Exception - * @expectedExceptionMessage Field PlaceOrderInput.cart_id of required type String! was not provided. - */ - public function testPlaceOrderIfCartIdIsMissed() - { - $query = <<<QUERY -mutation { - placeOrder(input: {}) { - order { - order_number - } - } -} -QUERY; - - $this->graphQlMutation($query); - } - /** * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php * @magentoConfigFixture default_store carriers/flatrate/active 1 diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/RemoveCouponFromCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/RemoveCouponFromCartTest.php index 12c3918fcd0ac..e94a70cbd929f 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/RemoveCouponFromCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/RemoveCouponFromCartTest.php @@ -61,28 +61,6 @@ public function testRemoveCouponFromCartIfCartIdIsEmpty() $this->graphQlMutation($query); } - /** - * @expectedException Exception - * @expectedExceptionMessage Field RemoveCouponFromCartInput.cart_id of required type String! was not provided. - */ - public function testRemoveCouponFromCartIfCartIdIsMissed() - { - $query = <<<QUERY -mutation { - removeCouponFromCart(input: {}) { - cart { - applied_coupon { - code - } - } - } -} - -QUERY; - - $this->graphQlMutation($query); - } - /** * @expectedException Exception * @expectedExceptionMessage Could not find a cart with ID "non_existent_masked_id" diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/RemoveItemFromCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/RemoveItemFromCartTest.php index c3a66291251c7..6f105259bf65c 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/RemoveItemFromCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/RemoveItemFromCartTest.php @@ -80,49 +80,6 @@ public function testRemoveNonExistentItem() $this->graphQlMutation($query); } - /** - * @param string $input - * @param string $message - * @dataProvider dataProviderUpdateWithMissedRequiredParameters - */ - public function testUpdateWithMissedItemRequiredParameters(string $input, string $message) - { - $query = <<<QUERY -mutation { - removeItemFromCart( - input: { - {$input} - } - ) { - cart { - items { - quantity - } - } - } -} -QUERY; - $this->expectExceptionMessage($message); - $this->graphQlMutation($query); - } - - /** - * @return array - */ - public function dataProviderUpdateWithMissedRequiredParameters(): array - { - return [ - 'missed_cart_id' => [ - 'cart_item_id: 1', - 'Field RemoveItemFromCartInput.cart_id of required type String! was not provided.' - ], - 'missed_cart_item_id' => [ - 'cart_id: "test_quote"', - 'Field RemoveItemFromCartInput.cart_item_id of required type Int! was not provided.' - ], - ]; - } - /** * _security * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetBillingAddressOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetBillingAddressOnCartTest.php index 87335bd5c96dd..ea77ad35d2693 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetBillingAddressOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetBillingAddressOnCartTest.php @@ -296,58 +296,6 @@ public function testSetBillingAddressOnNonExistentCart() $this->graphQlMutation($query); } - /** - * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php - * - * @dataProvider dataProviderSetWithoutRequiredParameters - * @param string $input - * @param string $message - * @throws \Exception - */ - public function testSetBillingAddressWithoutRequiredParameters(string $input, string $message) - { - $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote'); - $input = str_replace('cart_id_value', $maskedQuoteId, $input); - - $query = <<<QUERY -mutation { - setBillingAddressOnCart( - input: { - {$input} - } - ) { - cart { - billing_address { - city - } - } - } -} -QUERY; - $this->expectExceptionMessage($message); - $this->graphQlMutation($query); - } - - /** - * @return array - */ - public function dataProviderSetWithoutRequiredParameters(): array - { - return [ - 'missed_billing_address' => [ - 'cart_id: "cart_id_value"', - 'Field SetBillingAddressOnCartInput.billing_address of required type BillingAddressInput!' - . ' was not provided.', - ], - 'missed_cart_id' => [ - 'billing_address: {}', - 'Field SetBillingAddressOnCartInput.cart_id of required type String! was not provided.' - ] - ]; - } - /** * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetPaymentMethodOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetPaymentMethodOnCartTest.php index 24ba3e78f9b4e..c3e35f0bf80e8 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetPaymentMethodOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetPaymentMethodOnCartTest.php @@ -183,14 +183,6 @@ public function testSetPaymentMethodWithoutRequiredParameters(string $input, str public function dataProviderSetPaymentMethodWithoutRequiredParameters(): array { return [ - 'missed_cart_id' => [ - 'payment_method: {code: "' . Checkmo::PAYMENT_METHOD_CHECKMO_CODE . '"}', - 'Field SetPaymentMethodOnCartInput.cart_id of required type String! was not provided.' - ], - 'missed_payment_method' => [ - 'cart_id: "cart_id_value"', - 'Field SetPaymentMethodOnCartInput.payment_method of required type PaymentMethodInput! was not provided' - ], 'missed_payment_method_code' => [ 'cart_id: "cart_id_value", payment_method: {code: ""}', 'Required parameter "code" for "payment_method" is missing.' diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingAddressOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingAddressOnCartTest.php index b142de71e89a3..53a20b775530b 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingAddressOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingAddressOnCartTest.php @@ -208,40 +208,6 @@ public function testSetShippingAddressToCustomerCart() $this->graphQlMutation($query); } - /** - * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php - * - * @dataProvider dataProviderUpdateWithMissedRequiredParameters - * @param string $input - * @param string $message - * @throws \Exception - */ - public function testSetNewShippingAddressWithMissedRequiredParameters(string $input, string $message) - { - $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote'); - $input = str_replace('cart_id_value', $maskedQuoteId, $input); - - $query = <<<QUERY -mutation { - setShippingAddressesOnCart( - input: { - {$input} - } - ) { - cart { - shipping_addresses { - city - } - } - } -} -QUERY; - $this->expectExceptionMessage($message); - $this->graphQlMutation($query); - } - /** * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php @@ -285,28 +251,6 @@ public function testSetNewShippingAddressOnCartWithRedundantStreetLine() $this->graphQlMutation($query); } - /** - * @return array - */ - public function dataProviderUpdateWithMissedRequiredParameters(): array - { - return [ - 'missed_shipping_addresses' => [ - 'cart_id: "cart_id_value"', - 'Field SetShippingAddressesOnCartInput.shipping_addresses of required type [ShippingAddressInput]! ' . - 'was not provided.', - ], - 'missed_city' => [ - 'shipping_addresses: [ { address: { save_in_address_book: false } } ]', - 'Field CartAddressInput.city of required type String! was not provided' - ], - 'missed_cart_id' => [ - 'shipping_addresses: {}', - 'Field SetShippingAddressesOnCartInput.cart_id of required type String! was not provided.' - ] - ]; - } - /** * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingMethodsOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingMethodsOnCartTest.php index 007ada1ce57cf..0a49136421e9a 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingMethodsOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingMethodsOnCartTest.php @@ -186,28 +186,10 @@ public function testSetShippingMethodWithWrongParameters(string $input, string $ public function dataProviderSetShippingMethodWithWrongParameters(): array { return [ - 'missed_cart_id' => [ - 'shipping_methods: [{ - carrier_code: "flatrate" - method_code: "flatrate" - }]', - 'Field SetShippingMethodsOnCartInput.cart_id of required type String! was not provided.' - ], - 'missed_shipping_methods' => [ - 'cart_id: "cart_id_value"', - 'Field SetShippingMethodsOnCartInput.shipping_methods of required type [ShippingMethodInput]!' - . ' was not provided.' - ], 'shipping_methods_are_empty' => [ 'cart_id: "cart_id_value" shipping_methods: []', 'Required parameter "shipping_methods" is missing' ], - 'missed_carrier_code' => [ - 'cart_id: "cart_id_value", shipping_methods: [{ - method_code: "flatrate" - }]', - 'Field ShippingMethodInput.carrier_code of required type String! was not provided.' - ], 'empty_carrier_code' => [ 'cart_id: "cart_id_value", shipping_methods: [{ carrier_code: "" @@ -222,12 +204,6 @@ public function dataProviderSetShippingMethodWithWrongParameters(): array }]', 'Carrier with such method not found: wrong-carrier-code, flatrate' ], - 'missed_method_code' => [ - 'cart_id: "cart_id_value", shipping_methods: [{ - carrier_code: "flatrate" - }]', - 'Field ShippingMethodInput.method_code of required type String! was not provided.' - ], 'empty_method_code' => [ 'cart_id: "cart_id_value", shipping_methods: [{ carrier_code: "flatrate" diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/UpdateCartItemsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/UpdateCartItemsTest.php index 48d58a0dd8f17..761993d983db8 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/UpdateCartItemsTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/UpdateCartItemsTest.php @@ -181,34 +181,6 @@ public function testUpdateItemFromCustomerCart() $this->graphQlMutation($query); } - /** - * @expectedException \Exception - * @expectedExceptionMessage Field UpdateCartItemsInput.cart_id of required type String! was not provided. - */ - public function testUpdateWithMissedCartItemId() - { - $query = <<<QUERY -mutation { - updateCartItems(input: { - cart_items: [ - { - cart_item_id: 1 - quantity: 2 - } - ] - }) { - cart { - items { - id - quantity - } - } - } -} -QUERY; - $this->graphQlMutation($query); - } - /** * @param string $input * @param string $message @@ -246,14 +218,6 @@ public function testUpdateWithMissedItemRequiredParameters(string $input, string public function dataProviderUpdateWithMissedRequiredParameters(): array { return [ - 'missed_cart_items' => [ - '', - 'Field UpdateCartItemsInput.cart_items of required type [CartItemUpdateInput]! was not provided.' - ], - 'missed_cart_item_id' => [ - 'cart_items: [{ quantity: 2 }]', - 'Field CartItemUpdateInput.cart_item_id of required type Int! was not provided.' - ], 'missed_cart_item_qty' => [ 'cart_items: [{ cart_item_id: 1 }]', 'Required parameter "quantity" for "cart_items" is missing.' From 8fd5c7868a41ae660626cfe077388f02fa0b6a7b Mon Sep 17 00:00:00 2001 From: Vaha <vaha@atwix.com> Date: Wed, 27 Nov 2019 16:15:01 +0200 Subject: [PATCH 441/586] magento/graphql-ce#808: [Test coverage] Add disabled variation of Configurable Product to cart --- .../AddConfigurableProductToCartTest.php | 60 ++++++++++++++++++- ...oduct_configurable_disable_first_child.php | 37 ++++++++++++ ...duct_configurable_zero_qty_first_child.php | 28 +++++++++ 3 files changed, 122 insertions(+), 3 deletions(-) create mode 100644 dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_disable_first_child.php create mode 100644 dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_zero_qty_first_child.php diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartTest.php index b1858e843bf0f..f8eab768ca74d 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartTest.php @@ -199,7 +199,7 @@ public function testAddVariationFromAnotherConfigurableProductWithDifferentSuper /** * @magentoApiDataFixture Magento/ConfigurableProduct/_files/product_configurable_sku.php * @magentoApiDataFixture Magento/Checkout/_files/active_quote.php - * @expectedException \Exception + * @expectedException Exception * @expectedExceptionMessage The requested qty is not available */ public function testAddProductIfQuantityIsNotAvailable() @@ -224,7 +224,7 @@ public function testAddProductIfQuantityIsNotAvailable() /** * @magentoApiDataFixture Magento/ConfigurableProduct/_files/product_configurable_sku.php * @magentoApiDataFixture Magento/Checkout/_files/active_quote.php - * @expectedException \Exception + * @expectedException Exception * @expectedExceptionMessage Could not find a product with SKU "configurable_no_exist" */ public function testAddNonExistentConfigurableProductParentToCart() @@ -263,7 +263,7 @@ public function testAddNonExistentConfigurableProductVariationToCart() 2000 ); - $this->expectException(\Exception::class); + $this->expectException(Exception::class); $this->expectExceptionMessage( 'Could not add the product with SKU configurable to the shopping cart: The product that was requested ' . 'doesn\'t exist. Verify the product and try again.' @@ -272,6 +272,60 @@ public function testAddNonExistentConfigurableProductVariationToCart() $this->graphQlMutation($query); } + /** + * @magentoApiDataFixture Magento/ConfigurableProduct/_files/product_configurable_sku.php + * @magentoApiDataFixture Magento/ConfigurableProduct/_files/product_configurable_disable_first_child.php + * @magentoApiDataFixture Magento/Checkout/_files/active_quote.php + */ + public function testAddDisabledVariationToCart() + { + $searchResponse = $this->graphQlQuery($this->getFetchProductQuery('configurable')); + $product = current($searchResponse['products']['items']); + $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_order_1'); + $parentSku = $product['sku']; + $sku = 'simple_10'; + $query = $this->getQuery( + $maskedQuoteId, + $parentSku, + $sku, + 1 + ); + + $this->expectException(Exception::class); + $this->expectExceptionMessage( + 'Could not add the product with SKU configurable to the shopping cart: This product is out of stock.' + ); + + $this->graphQlMutation($query); + } + + /** + * @magentoApiDataFixture Magento/ConfigurableProduct/_files/product_configurable_sku.php + * @magentoApiDataFixture Magento/ConfigurableProduct/_files/product_configurable_zero_qty_first_child.php + * @magentoApiDataFixture Magento/Checkout/_files/active_quote.php + */ + public function testOutOfStockVariationToCart() + { + $searchResponse = $this->graphQlQuery($this->getFetchProductQuery('configurable')); + $product = current($searchResponse['products']['items']); + $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_order_1'); + $parentSku = $product['sku']; + $sku = 'simple_10'; + $query = $this->getQuery( + $maskedQuoteId, + $parentSku, + $sku, + 1 + ); + + $this->expectException(Exception::class); + $this->expectExceptionMessage( + 'Could not add the product with SKU configurable to the shopping cart: This product is out of stock.' + ); + + $this->graphQlMutation($query); + } + /** * @param string $maskedQuoteId * @param string $parentSku diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_disable_first_child.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_disable_first_child.php new file mode 100644 index 0000000000000..257db999417d1 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_disable_first_child.php @@ -0,0 +1,37 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\Data\ProductAttributeInterface; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\Product\Action; +use Magento\Catalog\Model\Product\Attribute\Source\Status; +use Magento\ConfigurableProduct\Model\Product\Type\Configurable; +use Magento\TestFramework\Helper\Bootstrap; + +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = Bootstrap::getObjectManager()->get(ProductRepositoryInterface::class); + +try { + /** @var Product $configurableProduct */ + $configurableProduct = $productRepository->get('configurable'); + /** @var Configurable $productTypeInstance */ + $productTypeInstance = $configurableProduct->getTypeInstance(); + /** @var Product $child */ + foreach ($productTypeInstance->getUsedProducts($configurableProduct) as $child) { + + $productAction = Bootstrap::getObjectManager()->get(Action::class); + $productAction->updateAttributes( + [$child->getId()], + [ProductAttributeInterface::CODE_STATUS => Status::STATUS_DISABLED], + $child->getStoreId() + ); + break; + } +} catch (Exception $e) { + // Nothing to remove +} diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_zero_qty_first_child.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_zero_qty_first_child.php new file mode 100644 index 0000000000000..77d90e91726a4 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_zero_qty_first_child.php @@ -0,0 +1,28 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Product as ProductModel; +use Magento\TestFramework\Helper\Bootstrap; + +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = Bootstrap::getObjectManager()->get(ProductRepositoryInterface::class); + +try { + $configurableProduct = $productRepository->get('configurable'); + $productTypeInstance = $configurableProduct->getTypeInstance(); + + /** @var ProductModel $child */ + foreach ($productTypeInstance->getUsedProducts($configurableProduct) as $child) { + $childProduct = $productRepository->getById($child->getId()); + $childProduct->setStockData(['use_config_manage_stock' => 1, 'qty' => 0, 'is_qty_decimal' => 0, 'is_in_stock' => 0]); + $productRepository->save($childProduct); + break; + } +} catch (Exception $e) { + // Nothing to remove +} From 201f9be15d8bbb9e944b4587aff1c9025fabcea1 Mon Sep 17 00:00:00 2001 From: Vaha <vaha@atwix.com> Date: Thu, 28 Nov 2019 18:34:21 +0200 Subject: [PATCH 442/586] magento/graphql-ce#808: [Test coverage] Add disabled variation of Configurable Product to cart, improved fixtures --- .../AddConfigurableProductToCartTest.php | 2 -- ...oduct_configurable_disable_first_child.php | 31 ++++++------------- ...figurable_disable_first_child_roolback.php | 8 +++++ ...duct_configurable_zero_qty_first_child.php | 21 +++---------- ...igurable_zero_qty_first_child_roolback.php | 8 +++++ 5 files changed, 31 insertions(+), 39 deletions(-) create mode 100644 dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_disable_first_child_roolback.php create mode 100644 dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_zero_qty_first_child_roolback.php diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartTest.php index f8eab768ca74d..dac59d1e34077 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartTest.php @@ -273,7 +273,6 @@ public function testAddNonExistentConfigurableProductVariationToCart() } /** - * @magentoApiDataFixture Magento/ConfigurableProduct/_files/product_configurable_sku.php * @magentoApiDataFixture Magento/ConfigurableProduct/_files/product_configurable_disable_first_child.php * @magentoApiDataFixture Magento/Checkout/_files/active_quote.php */ @@ -300,7 +299,6 @@ public function testAddDisabledVariationToCart() } /** - * @magentoApiDataFixture Magento/ConfigurableProduct/_files/product_configurable_sku.php * @magentoApiDataFixture Magento/ConfigurableProduct/_files/product_configurable_zero_qty_first_child.php * @magentoApiDataFixture Magento/Checkout/_files/active_quote.php */ diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_disable_first_child.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_disable_first_child.php index 257db999417d1..e7b644b318fd2 100644 --- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_disable_first_child.php +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_disable_first_child.php @@ -5,33 +5,22 @@ */ declare(strict_types=1); +require __DIR__ . '/product_configurable_sku.php'; + use Magento\Catalog\Api\Data\ProductAttributeInterface; -use Magento\Catalog\Api\ProductRepositoryInterface; -use Magento\Catalog\Model\Product; use Magento\Catalog\Model\Product\Action; use Magento\Catalog\Model\Product\Attribute\Source\Status; -use Magento\ConfigurableProduct\Model\Product\Type\Configurable; use Magento\TestFramework\Helper\Bootstrap; -/** @var ProductRepositoryInterface $productRepository */ -$productRepository = Bootstrap::getObjectManager()->get(ProductRepositoryInterface::class); - +$childSku = 'simple_10'; try { - /** @var Product $configurableProduct */ - $configurableProduct = $productRepository->get('configurable'); - /** @var Configurable $productTypeInstance */ - $productTypeInstance = $configurableProduct->getTypeInstance(); - /** @var Product $child */ - foreach ($productTypeInstance->getUsedProducts($configurableProduct) as $child) { - - $productAction = Bootstrap::getObjectManager()->get(Action::class); - $productAction->updateAttributes( - [$child->getId()], - [ProductAttributeInterface::CODE_STATUS => Status::STATUS_DISABLED], - $child->getStoreId() - ); - break; - } + $childProduct = $productRepository->get($childSku); + $productAction = Bootstrap::getObjectManager()->get(Action::class); + $productAction->updateAttributes( + [$childProduct->getEntityId()], + [ProductAttributeInterface::CODE_STATUS => Status::STATUS_DISABLED], + $childProduct->getStoreId() + ); } catch (Exception $e) { // Nothing to remove } diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_disable_first_child_roolback.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_disable_first_child_roolback.php new file mode 100644 index 0000000000000..7c73fa65cfcd1 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_disable_first_child_roolback.php @@ -0,0 +1,8 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +require __DIR__ . '/product_configurable_sku_rollback.php'; diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_zero_qty_first_child.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_zero_qty_first_child.php index 77d90e91726a4..f813beab19610 100644 --- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_zero_qty_first_child.php +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_zero_qty_first_child.php @@ -5,24 +5,13 @@ */ declare(strict_types=1); -use Magento\Catalog\Api\ProductRepositoryInterface; -use Magento\Catalog\Model\Product as ProductModel; -use Magento\TestFramework\Helper\Bootstrap; - -/** @var ProductRepositoryInterface $productRepository */ -$productRepository = Bootstrap::getObjectManager()->get(ProductRepositoryInterface::class); +require __DIR__ . '/product_configurable_sku.php'; +$childSku = 'simple_10'; try { - $configurableProduct = $productRepository->get('configurable'); - $productTypeInstance = $configurableProduct->getTypeInstance(); - - /** @var ProductModel $child */ - foreach ($productTypeInstance->getUsedProducts($configurableProduct) as $child) { - $childProduct = $productRepository->getById($child->getId()); - $childProduct->setStockData(['use_config_manage_stock' => 1, 'qty' => 0, 'is_qty_decimal' => 0, 'is_in_stock' => 0]); - $productRepository->save($childProduct); - break; - } + $childProduct = $productRepository->get($childSku); + $childProduct->setStockData(['use_config_manage_stock' => 1, 'qty' => 0, 'is_qty_decimal' => 0, 'is_in_stock' => 0]); + $productRepository->save($childProduct); } catch (Exception $e) { // Nothing to remove } diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_zero_qty_first_child_roolback.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_zero_qty_first_child_roolback.php new file mode 100644 index 0000000000000..7c73fa65cfcd1 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_zero_qty_first_child_roolback.php @@ -0,0 +1,8 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +require __DIR__ . '/product_configurable_sku_rollback.php'; From ad9115c5cfc20006e52b7106ab3741ed9272fbd4 Mon Sep 17 00:00:00 2001 From: Vaha <vaha@atwix.com> Date: Thu, 28 Nov 2019 22:41:57 +0200 Subject: [PATCH 443/586] magento/graphql-ce#808: [Test coverage] Add disabled variation of Configurable Product to cart, improved fixtures (line limit) --- .../_files/product_configurable_zero_qty_first_child.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_zero_qty_first_child.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_zero_qty_first_child.php index f813beab19610..f8cce222f6605 100644 --- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_zero_qty_first_child.php +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_zero_qty_first_child.php @@ -10,7 +10,12 @@ $childSku = 'simple_10'; try { $childProduct = $productRepository->get($childSku); - $childProduct->setStockData(['use_config_manage_stock' => 1, 'qty' => 0, 'is_qty_decimal' => 0, 'is_in_stock' => 0]); + $childProduct->setStockData([ + 'use_config_manage_stock' => 1, + 'qty' => 0, + 'is_qty_decimal' => 0, + 'is_in_stock' => 0 + ]); $productRepository->save($childProduct); } catch (Exception $e) { // Nothing to remove From 5eae8f1b28a50b6f4ff4019e590df1205a04b1e4 Mon Sep 17 00:00:00 2001 From: Lena Orobei <oorobei@magento.com> Date: Fri, 6 Dec 2019 13:04:23 -0600 Subject: [PATCH 444/586] magento/graphql-ce#808: [Test coverage] Add disabled variation of Configurable Product to cart - code style fixes --- .../product_configurable_zero_qty_first_child.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_zero_qty_first_child.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_zero_qty_first_child.php index f8cce222f6605..5dcc461d83759 100644 --- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_zero_qty_first_child.php +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_zero_qty_first_child.php @@ -10,12 +10,14 @@ $childSku = 'simple_10'; try { $childProduct = $productRepository->get($childSku); - $childProduct->setStockData([ - 'use_config_manage_stock' => 1, - 'qty' => 0, - 'is_qty_decimal' => 0, - 'is_in_stock' => 0 - ]); + $childProduct->setStockData( + [ + 'use_config_manage_stock' => 1, + 'qty' => 0, + 'is_qty_decimal' => 0, + 'is_in_stock' => 0 + ] + ); $productRepository->save($childProduct); } catch (Exception $e) { // Nothing to remove From 2d76c5addb9d7b8c772ebc11eaa61e254771d325 Mon Sep 17 00:00:00 2001 From: Lena Orobei <oorobei@magento.com> Date: Fri, 6 Dec 2019 13:21:04 -0600 Subject: [PATCH 445/586] magento/graphql-ce#1061: Remove redundant logic from resolvers --- .../Model/AuthorizenetDataProvider.php | 15 ----------- .../Model/BraintreeDataProvider.php | 13 --------- .../Customer/SetPaymentMethodTest.php | 27 ------------------- .../Braintree/Guest/SetPaymentMethodTest.php | 25 ----------------- 4 files changed, 80 deletions(-) diff --git a/app/code/Magento/AuthorizenetGraphQl/Model/AuthorizenetDataProvider.php b/app/code/Magento/AuthorizenetGraphQl/Model/AuthorizenetDataProvider.php index ffbacbf6ac88c..27d0693884121 100644 --- a/app/code/Magento/AuthorizenetGraphQl/Model/AuthorizenetDataProvider.php +++ b/app/code/Magento/AuthorizenetGraphQl/Model/AuthorizenetDataProvider.php @@ -49,21 +49,6 @@ public function getData(array $data): array __('Required parameter "authorizenet_acceptjs" for "payment_method" is missing.') ); } - if (!isset($data[self::PATH_ADDITIONAL_DATA]['opaque_data_descriptor'])) { - throw new GraphQlInputException( - __('Required parameter "opaque_data_descriptor" for "authorizenet_acceptjs" is missing.') - ); - } - if (!isset($data[self::PATH_ADDITIONAL_DATA]['opaque_data_value'])) { - throw new GraphQlInputException( - __('Required parameter "opaque_data_value" for "authorizenet_acceptjs" is missing.') - ); - } - if (!isset($data[self::PATH_ADDITIONAL_DATA]['cc_last_4'])) { - throw new GraphQlInputException( - __('Required parameter "cc_last_4" for "authorizenet_acceptjs" is missing.') - ); - } $additionalData = $this->arrayManager->get(static::PATH_ADDITIONAL_DATA, $data); foreach ($additionalData as $key => $value) { diff --git a/app/code/Magento/BraintreeGraphQl/Model/BraintreeDataProvider.php b/app/code/Magento/BraintreeGraphQl/Model/BraintreeDataProvider.php index 23ca1d88e3625..cb5c4a31837b4 100644 --- a/app/code/Magento/BraintreeGraphQl/Model/BraintreeDataProvider.php +++ b/app/code/Magento/BraintreeGraphQl/Model/BraintreeDataProvider.php @@ -31,19 +31,6 @@ public function getData(array $args): array __('Required parameter "braintree" for "payment_method" is missing.') ); } - - if (!isset($args[self::PATH_ADDITIONAL_DATA]['payment_method_nonce'])) { - throw new GraphQlInputException( - __('Required parameter "payment_method_nonce" for "braintree" is missing.') - ); - } - - if (!isset($args[self::PATH_ADDITIONAL_DATA]['is_active_payment_token_enabler'])) { - throw new GraphQlInputException( - __('Required parameter "is_active_payment_token_enabler" for "braintree" is missing.') - ); - } - return $args[self::PATH_ADDITIONAL_DATA]; } } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Braintree/Customer/SetPaymentMethodTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Braintree/Customer/SetPaymentMethodTest.php index fbaa3a98613cf..a36a4f5d38223 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Braintree/Customer/SetPaymentMethodTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Braintree/Customer/SetPaymentMethodTest.php @@ -380,33 +380,6 @@ private function getSetPaymentBraintreeQueryInvalidInput(string $maskedQuoteId, QUERY; } - /** - * @param string $maskedQuoteId - * @return string - */ - private function getSetPaymentBraintreeQueryInvalidPaymentMethodInput(string $maskedQuoteId): string - { - return <<<QUERY -mutation { - setPaymentMethodOnCart(input:{ - cart_id:"{$maskedQuoteId}" - payment_method:{ - code:"braintree" - braintree:{ - payment_method_nonce:"fake-valid-nonce" - } - } - }) { - cart { - selected_payment_method { - code - } - } - } -} -QUERY; - } - /** * @param string $maskedQuoteId * @param string $methodCode diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Braintree/Guest/SetPaymentMethodTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Braintree/Guest/SetPaymentMethodTest.php index b000d6e7ff347..5376634c05146 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Braintree/Guest/SetPaymentMethodTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Braintree/Guest/SetPaymentMethodTest.php @@ -198,31 +198,6 @@ private function getSetPaymentBraintreeQueryInvalidInput(string $maskedQuoteId): QUERY; } - /** - * @param string $maskedQuoteId - * @return string - */ - private function getSetPaymentBraintreeQueryInvalidMethodInput(string $maskedQuoteId): string - { - return <<<QUERY -mutation { - setPaymentMethodOnCart(input:{ - cart_id:"{$maskedQuoteId}" - payment_method:{ - code:"braintree" - braintree: {} - } - }) { - cart { - selected_payment_method { - code - } - } - } -} -QUERY; - } - /** * @param string $maskedQuoteId * @return string From b254712a9d550d56a151aa11d91f9145811af1e3 Mon Sep 17 00:00:00 2001 From: Lena Orobei <oorobei@magento.com> Date: Fri, 6 Dec 2019 14:45:30 -0600 Subject: [PATCH 446/586] magento/graphql-ce#808: [Test coverage] Add disabled variation of Configurable Product to cart --- ...oduct_configurable_disable_first_child.php | 19 ++++++-------- ...igurable_disable_first_child_rollback.php} | 0 ...duct_configurable_zero_qty_first_child.php | 25 ++++++++----------- ...gurable_zero_qty_first_child_rollback.php} | 0 4 files changed, 19 insertions(+), 25 deletions(-) rename dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/{product_configurable_disable_first_child_roolback.php => product_configurable_disable_first_child_rollback.php} (100%) rename dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/{product_configurable_zero_qty_first_child_roolback.php => product_configurable_zero_qty_first_child_rollback.php} (100%) diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_disable_first_child.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_disable_first_child.php index e7b644b318fd2..51d192f76c807 100644 --- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_disable_first_child.php +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_disable_first_child.php @@ -13,14 +13,11 @@ use Magento\TestFramework\Helper\Bootstrap; $childSku = 'simple_10'; -try { - $childProduct = $productRepository->get($childSku); - $productAction = Bootstrap::getObjectManager()->get(Action::class); - $productAction->updateAttributes( - [$childProduct->getEntityId()], - [ProductAttributeInterface::CODE_STATUS => Status::STATUS_DISABLED], - $childProduct->getStoreId() - ); -} catch (Exception $e) { - // Nothing to remove -} + +$childProduct = $productRepository->get($childSku); +$productAction = Bootstrap::getObjectManager()->get(Action::class); +$productAction->updateAttributes( + [$childProduct->getEntityId()], + [ProductAttributeInterface::CODE_STATUS => Status::STATUS_DISABLED], + $childProduct->getStoreId() +); diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_disable_first_child_roolback.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_disable_first_child_rollback.php similarity index 100% rename from dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_disable_first_child_roolback.php rename to dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_disable_first_child_rollback.php diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_zero_qty_first_child.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_zero_qty_first_child.php index 5dcc461d83759..b923ae6399cc3 100644 --- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_zero_qty_first_child.php +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_zero_qty_first_child.php @@ -8,17 +8,14 @@ require __DIR__ . '/product_configurable_sku.php'; $childSku = 'simple_10'; -try { - $childProduct = $productRepository->get($childSku); - $childProduct->setStockData( - [ - 'use_config_manage_stock' => 1, - 'qty' => 0, - 'is_qty_decimal' => 0, - 'is_in_stock' => 0 - ] - ); - $productRepository->save($childProduct); -} catch (Exception $e) { - // Nothing to remove -} + +$childProduct = $productRepository->get($childSku); +$childProduct->setStockData( + [ + 'use_config_manage_stock' => 1, + 'qty' => 0, + 'is_qty_decimal' => 0, + 'is_in_stock' => 0 + ] +); +$productRepository->save($childProduct); diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_zero_qty_first_child_roolback.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_zero_qty_first_child_rollback.php similarity index 100% rename from dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_zero_qty_first_child_roolback.php rename to dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_zero_qty_first_child_rollback.php From ee228afd4c469d590332dc6f79130fab88ab6857 Mon Sep 17 00:00:00 2001 From: Lena Orobei <oorobei@magento.com> Date: Mon, 9 Dec 2019 13:17:12 -0600 Subject: [PATCH 447/586] magento/graphql-ce#808: [Test coverage] Add disabled variation of Configurable Product to cart --- .../ConfigurableProduct/AddConfigurableProductToCartTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartTest.php index dac59d1e34077..8e6400a9a3b93 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartTest.php @@ -292,7 +292,7 @@ public function testAddDisabledVariationToCart() $this->expectException(Exception::class); $this->expectExceptionMessage( - 'Could not add the product with SKU configurable to the shopping cart: This product is out of stock.' + 'Could not add the product with SKU configurable to the shopping cart' ); $this->graphQlMutation($query); @@ -318,7 +318,7 @@ public function testOutOfStockVariationToCart() $this->expectException(Exception::class); $this->expectExceptionMessage( - 'Could not add the product with SKU configurable to the shopping cart: This product is out of stock.' + 'Could not add the product with SKU configurable to the shopping cart' ); $this->graphQlMutation($query); From 746f813e50ccf2e795499e6fce9f5ee617e172c8 Mon Sep 17 00:00:00 2001 From: Sathish <srsathish92@gmail.com> Date: Fri, 20 Dec 2019 00:41:06 +0530 Subject: [PATCH 448/586] Feedback updated with object manager helper & stub --- .../Test/Unit/Block/Cart/ShippingTest.php | 72 +++++++++++-------- 1 file changed, 42 insertions(+), 30 deletions(-) diff --git a/app/code/Magento/Checkout/Test/Unit/Block/Cart/ShippingTest.php b/app/code/Magento/Checkout/Test/Unit/Block/Cart/ShippingTest.php index 1e2dd08cb20ae..5ab4615c52828 100644 --- a/app/code/Magento/Checkout/Test/Unit/Block/Cart/ShippingTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Block/Cart/ShippingTest.php @@ -14,16 +14,34 @@ use Magento\Framework\Serialize\Serializer\Json; use Magento\Framework\Serialize\Serializer\JsonHexTag; use Magento\Framework\View\Element\Template\Context; -use Magento\Customer\Model\Session as customerSession; -use Magento\Checkout\Model\Session as checkoutSession; +use Magento\Customer\Model\Session as CustomerSession; +use Magento\Checkout\Model\Session as CheckoutSession; use Magento\Store\Model\StoreManagerInterface; +use Magento\Store\Model\Store; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; /** * Unit Test for Magento\Checkout\Block\Cart\Shipping */ -class ShippingTest extends \PHPUnit\Framework\TestCase +class ShippingTest extends TestCase { + + /** + * Stub Preinitialized Componets + */ + private const STUB_PREINITIALIZED_COMPONENTS = [ + 'components' => [ + 'firstComponent' => ['param' => 'value'] + ] + ]; + + /** + * Stub Base URL + */ + private const STUB_BASE_URL = 'baseurl'; + /** * @var Shipping */ @@ -35,12 +53,12 @@ class ShippingTest extends \PHPUnit\Framework\TestCase protected $contextMock; /** - * @var customerSession|MockObject + * @var CustomerSession|MockObject */ protected $customerSessionMock; /** - * @var checkoutSession|MockObject + * @var CheckoutSession|MockObject */ protected $checkoutSessionMock; @@ -57,7 +75,7 @@ class ShippingTest extends \PHPUnit\Framework\TestCase /** * @var StoreManagerInterface|MockObject */ - protected $storeManagerMock; + protected $storeManagerInterfaceMock; /** * @var array @@ -80,32 +98,26 @@ class ShippingTest extends \PHPUnit\Framework\TestCase protected function setUp(): void { $this->contextMock = $this->createMock(Context::class); - $this->customerSessionMock = $this->createMock(customerSession::class); - $this->checkoutSessionMock = $this->createMock(checkoutSession::class); + $this->customerSessionMock = $this->createMock(CustomerSession::class); + $this->checkoutSessionMock = $this->createMock(CheckoutSession::class); $this->configProviderMock = $this->createMock(CompositeConfigProvider::class); $this->layoutProcessorMock = $this->createMock(LayoutProcessorInterface::class); $this->serializerMock = $this->createMock(JsonHexTag::class); $this->jsonHexTagSerializerMock = $this->createMock(JsonHexTag::class); - $this->storeManagerMock = $this->createMock(StoreManagerInterface::class); - $this->layout = [ - 'components' => [ - 'firstComponent' => ['param' => 'value'] - ] - ]; + $this->storeManagerInterfaceMock = $this->createMock(StoreManagerInterface::class); + $this->layout = self::STUB_PREINITIALIZED_COMPONENTS; - $this->contextMock->expects($this->once()) - ->method('getStoreManager') - ->willReturn($this->storeManagerMock); - - $this->block = new Shipping( - $this->contextMock, - $this->customerSessionMock, - $this->checkoutSessionMock, - $this->configProviderMock, - [$this->layoutProcessorMock], - ['jsLayout' => $this->layout], - $this->serializerMock, - $this->jsonHexTagSerializerMock + $objectManager = new ObjectManager($this); + $this->block = $objectManager->getObject( + Shipping::class, + [ + 'configProvider' => $this->configProviderMock, + 'layoutProcessors' => [$this->layoutProcessorMock], + 'jsLayout' => $this->layout, + 'serializer' => $this->serializerMock, + 'jsonHexTagSerializer' => $this->jsonHexTagSerializerMock, + 'storeManager' => $this->storeManagerInterfaceMock + ] ); } @@ -168,13 +180,13 @@ public function getJsLayoutDataProvider(): array */ public function testGetBaseUrl(): void { - $baseUrl = 'baseUrl'; - $storeMock = $this->createPartialMock(\Magento\Store\Model\Store::class, ['getBaseUrl']); + $baseUrl = self::STUB_BASE_URL; + $storeMock = $this->createPartialMock(Store::class, ['getBaseUrl']); $storeMock->expects($this->once()) ->method('getBaseUrl') ->willReturn($baseUrl); - $this->storeManagerMock->expects($this->once()) + $this->storeManagerInterfaceMock->expects($this->once()) ->method('getStore') ->willReturn($storeMock); From 1e1cbf5dc979b951e1de87fdef29ea6666864619 Mon Sep 17 00:00:00 2001 From: Sathish <srsathish92@gmail.com> Date: Fri, 20 Dec 2019 01:00:07 +0530 Subject: [PATCH 449/586] PascalCase updated --- app/code/Magento/Checkout/Block/Cart/Shipping.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Checkout/Block/Cart/Shipping.php b/app/code/Magento/Checkout/Block/Cart/Shipping.php index 870cc8dace120..712ee84afd232 100644 --- a/app/code/Magento/Checkout/Block/Cart/Shipping.php +++ b/app/code/Magento/Checkout/Block/Cart/Shipping.php @@ -11,8 +11,8 @@ use Magento\Framework\Serialize\Serializer\Json; use Magento\Framework\Serialize\Serializer\JsonHexTag; use Magento\Framework\View\Element\Template\Context; -use Magento\Customer\Model\Session as customerSession; -use Magento\Checkout\Model\Session as checkoutSession; +use Magento\Customer\Model\Session as CustomerSession; +use Magento\Checkout\Model\Session as CheckoutSession; use Magento\Framework\App\ObjectManager; /** @@ -45,8 +45,8 @@ class Shipping extends \Magento\Checkout\Block\Cart\AbstractCart /** * @param Context $context - * @param customerSession $customerSession - * @param checkoutSession $checkoutSession + * @param CustomerSession $customerSession + * @param CheckoutSession $checkoutSession * @param CompositeConfigProvider $configProvider * @param array $layoutProcessors * @param array $data @@ -56,8 +56,8 @@ class Shipping extends \Magento\Checkout\Block\Cart\AbstractCart */ public function __construct( Context $context, - customerSession $customerSession, - checkoutSession $checkoutSession, + CustomerSession $customerSession, + CheckoutSession $checkoutSession, CompositeConfigProvider $configProvider, array $layoutProcessors = [], array $data = [], From ebbe8131927704cbd27a381e1d160896a014786c Mon Sep 17 00:00:00 2001 From: Lena Orobei <oorobei@magento.com> Date: Thu, 19 Dec 2019 14:38:42 -0600 Subject: [PATCH 450/586] Forward-port magento/graphql-ce#443 and magento/graphql-ce#1073 --- .../Model/Customer/ValidateCustomerData.php | 22 +- .../DataProvider/SwatchDataProvider.php | 250 ++++++++++++++++++ .../Resolver/Product/Options/SwatchData.php | 56 ++++ .../Options/SwatchDataTypeResolver.php | 34 +++ .../SwatchesGraphQl/etc/graphql/di.xml | 2 +- .../SwatchesGraphQl/etc/schema.graphqls | 20 ++ .../GraphQl/Customer/CreateCustomerTest.php | 43 ++- .../Swatches/ProductSwatchDataTest.php | 166 ++++++++++++ .../_files/text_swatch_attribute_rollback.php | 23 ++ .../_files/textual_swatch_attribute.php | 103 ++++++++ ..._attribute_with_different_options_type.php | 116 ++++++++ ...e_with_different_options_type_rollback.php | 34 +++ ..._with_enabled_product_image_for_swatch.php | 35 +++ ...bled_product_image_for_swatch_rollback.php | 11 + 14 files changed, 900 insertions(+), 15 deletions(-) create mode 100644 app/code/Magento/SwatchesGraphQl/Model/Resolver/Product/Options/DataProvider/SwatchDataProvider.php create mode 100644 app/code/Magento/SwatchesGraphQl/Model/Resolver/Product/Options/SwatchData.php create mode 100644 app/code/Magento/SwatchesGraphQl/Model/Resolver/Product/Options/SwatchDataTypeResolver.php create mode 100644 dev/tests/api-functional/testsuite/Magento/GraphQl/Swatches/ProductSwatchDataTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Swatches/_files/text_swatch_attribute_rollback.php create mode 100644 dev/tests/integration/testsuite/Magento/Swatches/_files/textual_swatch_attribute.php create mode 100644 dev/tests/integration/testsuite/Magento/Swatches/_files/visual_swatch_attribute_with_different_options_type.php create mode 100644 dev/tests/integration/testsuite/Magento/Swatches/_files/visual_swatch_attribute_with_different_options_type_rollback.php create mode 100644 dev/tests/integration/testsuite/Magento/Swatches/_files/visual_swatch_attribute_with_enabled_product_image_for_swatch.php create mode 100644 dev/tests/integration/testsuite/Magento/Swatches/_files/visual_swatch_attribute_with_enabled_product_image_for_swatch_rollback.php diff --git a/app/code/Magento/CustomerGraphQl/Model/Customer/ValidateCustomerData.php b/app/code/Magento/CustomerGraphQl/Model/Customer/ValidateCustomerData.php index 794cb0048592d..3861ce324ea7d 100644 --- a/app/code/Magento/CustomerGraphQl/Model/Customer/ValidateCustomerData.php +++ b/app/code/Magento/CustomerGraphQl/Model/Customer/ValidateCustomerData.php @@ -8,9 +8,10 @@ namespace Magento\CustomerGraphQl\Model\Customer; use Magento\Framework\GraphQl\Exception\GraphQlInputException; +use Magento\Framework\Validator\EmailAddress as EmailAddressValidator; /** - * Class ValidateCustomerData + * Customer data validation used during customer account creation and updating */ class ValidateCustomerData { @@ -21,14 +22,23 @@ class ValidateCustomerData */ private $getAllowedCustomerAttributes; + /** + * @var EmailAddressValidator + */ + private $emailAddressValidator; + /** * ValidateCustomerData constructor. * * @param GetAllowedCustomerAttributes $getAllowedCustomerAttributes + * @param EmailAddressValidator $emailAddressValidator */ - public function __construct(GetAllowedCustomerAttributes $getAllowedCustomerAttributes) - { + public function __construct( + GetAllowedCustomerAttributes $getAllowedCustomerAttributes, + EmailAddressValidator $emailAddressValidator + ) { $this->getAllowedCustomerAttributes = $getAllowedCustomerAttributes; + $this->emailAddressValidator = $emailAddressValidator; } /** @@ -59,5 +69,11 @@ public function execute(array $customerData): void __('Required parameters are missing: %1', [implode(', ', $errorInput)]) ); } + + if (isset($customerData['email']) && !$this->emailAddressValidator->isValid($customerData['email'])) { + throw new GraphQlInputException( + __('"%1" is not a valid email address.', $customerData['email']) + ); + } } } diff --git a/app/code/Magento/SwatchesGraphQl/Model/Resolver/Product/Options/DataProvider/SwatchDataProvider.php b/app/code/Magento/SwatchesGraphQl/Model/Resolver/Product/Options/DataProvider/SwatchDataProvider.php new file mode 100644 index 0000000000000..9e62ae928fb53 --- /dev/null +++ b/app/code/Magento/SwatchesGraphQl/Model/Resolver/Product/Options/DataProvider/SwatchDataProvider.php @@ -0,0 +1,250 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\SwatchesGraphQl\Model\Resolver\Product\Options\DataProvider; + +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Catalog\Model\Product\Image\UrlBuilder; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Exception\RuntimeException; +use Magento\Framework\GraphQl\Query\EnumLookup; +use Magento\Swatches\Helper\Data as SwatchData; +use Magento\Swatches\Helper\Media as SwatchesMedia; +use Magento\Swatches\Model\Swatch; + +/** + * Swatch data provider + */ +class SwatchDataProvider +{ + /** + * @var SwatchData + */ + private $swatchHelper; + + /** + * @var SwatchesMedia + */ + private $swatchMediaHelper; + + /** + * @var UrlBuilder + */ + private $imageUrlBuilder; + + /** + * @var EnumLookup + */ + private $enumLookup; + + /** + * SwatchDataProvider constructor. + * + * @param SwatchData $swatchHelper + * @param SwatchesMedia $swatchMediaHelper + * @param UrlBuilder $imageUrlBuilder + * @param EnumLookup $enumLookup + */ + public function __construct( + SwatchData $swatchHelper, + SwatchesMedia $swatchMediaHelper, + UrlBuilder $imageUrlBuilder, + EnumLookup $enumLookup + ) { + $this->swatchHelper = $swatchHelper; + $this->swatchMediaHelper = $swatchMediaHelper; + $this->imageUrlBuilder = $imageUrlBuilder; + $this->enumLookup = $enumLookup; + } + + /** + * Get swatch data + * + * @param string $optionId + * @param ProductInterface $product + * + * @return array + * + * @throws LocalizedException + * @throws NoSuchEntityException + * @throws \LogicException + */ + public function getData(string $optionId, ProductInterface $product): array + { + $swatches = $this->swatchHelper->getSwatchesByOptionsId([$optionId]); + if (!isset($swatches[$optionId], $swatches[$optionId]['type'], $swatches[$optionId]['value'])) { + return null; + } + + $type = (int)$swatches[$optionId]['type']; + $value = $swatches[$optionId]['value']; + $thumbnail = null; + + // change value & thumbnail if type is 'visual' + if ($type === Swatch::SWATCH_TYPE_VISUAL_IMAGE) { + $thumbnail = $this->swatchMediaHelper->getSwatchAttributeImage(Swatch::SWATCH_THUMBNAIL_NAME, $value); + $value = $this->swatchMediaHelper->getSwatchAttributeImage(Swatch::SWATCH_IMAGE_NAME, $value); + } + + $attributeData = $this->getSwatchAttributeDataByOptionId($product, $optionId); + // check if swatch value should be getting from related product image + if (!$this->isUseProductImageForSwatch($attributeData)) { + return $this->getResultArray($value, $type, $thumbnail); + } + + // get product with existing image + $variationProduct = $this->getVariationProduct($attributeData, $optionId, $product); + if (null === $variationProduct) { + return $this->getResultArray($value, $type, $thumbnail); + } + + // set 'visual' type, because the product image is using as swatch value + $type = Swatch::SWATCH_TYPE_VISUAL_IMAGE; + + // get image from child product + $productImage = $this->getSwatchProductImage($variationProduct, Swatch::SWATCH_IMAGE_NAME); + if (null !== $productImage) { + $value = $productImage; + } + + // get thumbnail from child product + $productThumbnail = $this->getSwatchProductImage($variationProduct, Swatch::SWATCH_THUMBNAIL_NAME); + if (null !== $productThumbnail) { + $thumbnail = $productThumbnail; + } + + return $this->getResultArray($value, $type, $thumbnail); + } + + /** + * Get result array + * + * @param string $value + * @param int $type + * @param null|string $thumbnail + * + * @return array + * + * @throws RuntimeException + */ + private function getResultArray(string $value, int $type, ?string $thumbnail) + { + return [ + 'value' => $value, + 'type' => $this->enumLookup->getEnumValueFromField('SwatchTypeEnum', (string)$type), + 'thumbnail' => $thumbnail + ]; + } + + /** + * Is swatch images should be getting from related simple products + * + * @param array $attributeData + * + * @return bool + */ + private function isUseProductImageForSwatch(array $attributeData) : bool + { + return isset($attributeData['use_product_image_for_swatch']) && $attributeData['use_product_image_for_swatch']; + } + + /** + * Get simple product with first variation swatch image or image + * + * @param array $attributeData + * @param string $optionId + * @param ProductInterface $product + * + * @return ProductInterface|null + */ + private function getVariationProduct(array $attributeData, string $optionId, ProductInterface $product) : ?ProductInterface + { + $attributeCode = $attributeData['attribute_code']; + $requiredAttributes = [ + $attributeCode => $optionId + ]; + + $variationProduct = $this->swatchHelper->loadFirstVariationWithSwatchImage($product, $requiredAttributes); + if ($variationProduct instanceof ProductInterface) { + return $variationProduct; + } + + $variationProduct = $this->swatchHelper->loadFirstVariationWithImage($product, $requiredAttributes); + if ($variationProduct instanceof ProductInterface) { + return $variationProduct; + } + + return null; + } + + /** + * Get swatch product image + * + * @param ProductInterface $product + * @param string $imageType + * + * @return string|null + */ + private function getSwatchProductImage(ProductInterface $product, $imageType) : ?string + { + if ($this->isProductHasImage($product, Swatch::SWATCH_IMAGE_NAME)) { + $swatchImageId = $imageType; + $imageAttributes = ['type' => Swatch::SWATCH_IMAGE_NAME]; + } elseif ($this->isProductHasImage($product, 'image')) { + $swatchImageId = $imageType == Swatch::SWATCH_IMAGE_NAME ? 'swatch_image_base' : 'swatch_thumb_base'; + $imageAttributes = ['type' => 'image']; + } + + if (empty($swatchImageId) || empty($imageAttributes['type'])) { + return null; + } + + return $this->imageUrlBuilder->getUrl($product->getData($imageAttributes['type']), $swatchImageId); + } + + /** + * Is product has image + * + * @param ProductInterface $product + * @param string $imageType + * + * @return bool + */ + private function isProductHasImage(ProductInterface $product, string $imageType) : bool + { + return $product->getData($imageType) !== null && $product->getData($imageType) != SwatchData::EMPTY_IMAGE_VALUE; + } + + /** + * Get swatch attribute data by option id + * + * @param ProductInterface $product + * @param string $optionId + * + * @return array + * + * @throws LocalizedException + * @throws \LogicException + * @throws NoSuchEntityException + */ + private function getSwatchAttributeDataByOptionId(ProductInterface $product, string $optionId) : array + { + $attributesData = $this->swatchHelper->getSwatchAttributesAsArray($product); + foreach ($attributesData as $attributeData) { + if (!isset($attributeData['options']) || !is_array($attributeData['options'])) { + continue; + } + + if (array_key_exists($optionId, $attributeData['options'])) { + return $attributeData; + } + } + + throw new LocalizedException(__(sprintf('Cannot find the attribute with option id "%1".', $optionId))); + } +} diff --git a/app/code/Magento/SwatchesGraphQl/Model/Resolver/Product/Options/SwatchData.php b/app/code/Magento/SwatchesGraphQl/Model/Resolver/Product/Options/SwatchData.php new file mode 100644 index 0000000000000..9fea3b3ff59e5 --- /dev/null +++ b/app/code/Magento/SwatchesGraphQl/Model/Resolver/Product/Options/SwatchData.php @@ -0,0 +1,56 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\SwatchesGraphQl\Model\Resolver\Product\Options; + +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\GraphQl\Config\Element\Field; +use Magento\Framework\GraphQl\Query\ResolverInterface; +use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; +use Magento\SwatchesGraphQl\Model\Resolver\Product\Options\DataProvider\SwatchDataProvider; + +/** + * Class SwatchData + * + * Product swatch data resolver, used for GraphQL request processing + */ +class SwatchData implements ResolverInterface +{ + /** + * @var SwatchDataProvider + */ + private $swatchDataProvider; + + /** + * SwatchData constructor. + * + * @param SwatchDataProvider $swatchDataProvider + */ + public function __construct( + SwatchDataProvider $swatchDataProvider + ) { + $this->swatchDataProvider = $swatchDataProvider; + } + + /** + * @inheritdoc + */ + public function resolve( + Field $field, + $context, + ResolveInfo $info, + array $value = null, + array $args = null + ) { + if (!array_key_exists('model', $value) || !$value['model'] instanceof ProductInterface) { + throw new LocalizedException(__('"model" value should be specified')); + } + + return $this->swatchDataProvider->getData($value['value_index'], $value['model']); + } +} diff --git a/app/code/Magento/SwatchesGraphQl/Model/Resolver/Product/Options/SwatchDataTypeResolver.php b/app/code/Magento/SwatchesGraphQl/Model/Resolver/Product/Options/SwatchDataTypeResolver.php new file mode 100644 index 0000000000000..96f584524fd27 --- /dev/null +++ b/app/code/Magento/SwatchesGraphQl/Model/Resolver/Product/Options/SwatchDataTypeResolver.php @@ -0,0 +1,34 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\SwatchesGraphQl\Model\Resolver\Product\Options; + +use Magento\Framework\GraphQl\Query\Resolver\TypeResolverInterface; +use Magento\Swatches\Model\Swatch; + +/** + * Resolver for swatch data interface. + */ +class SwatchDataTypeResolver implements TypeResolverInterface +{ + /** + * {@inheritdoc} + */ + public function resolveType(array $data): string + { + switch ($data['type']) { + case Swatch::SWATCH_TYPE_TEXTUAL: + return 'TextSwatchData'; + case Swatch::SWATCH_TYPE_VISUAL_COLOR; + return 'ColorSwatchData'; + case Swatch::SWATCH_TYPE_VISUAL_IMAGE; + return 'ImageSwatchData'; + default: + return ''; + } + } +} diff --git a/app/code/Magento/SwatchesGraphQl/etc/graphql/di.xml b/app/code/Magento/SwatchesGraphQl/etc/graphql/di.xml index 34f65d8e30e57..07391aead332b 100644 --- a/app/code/Magento/SwatchesGraphQl/etc/graphql/di.xml +++ b/app/code/Magento/SwatchesGraphQl/etc/graphql/di.xml @@ -16,4 +16,4 @@ </argument> </arguments> </type> -</config> \ No newline at end of file +</config> diff --git a/app/code/Magento/SwatchesGraphQl/etc/schema.graphqls b/app/code/Magento/SwatchesGraphQl/etc/schema.graphqls index bdd2631e7aa10..f986723a24545 100644 --- a/app/code/Magento/SwatchesGraphQl/etc/schema.graphqls +++ b/app/code/Magento/SwatchesGraphQl/etc/schema.graphqls @@ -26,4 +26,24 @@ type SwatchLayerFilterItem implements LayerFilterItemInterface, SwatchLayerFilte type SwatchData { type: String @doc(description: "Type of swatch filter item: 1 - text, 2 - image") value: String @doc(description: "Value for swatch item (text or image link)") +} + +type ConfigurableProductOptionsValues { + swatch_data: SwatchDataInterface @doc(description: "Swatch data for configurable product option") @resolver(class: "Magento\\SwatchesGraphQl\\Model\\Resolver\\Product\\Options\\SwatchData") +} + +interface SwatchDataInterface @typeResolver(class: "Magento\\SwatchesGraphQl\\Model\\Resolver\\Product\\Options\\SwatchDataTypeResolver") { + value: String @doc(description: "Value of swatch item (HEX color code, image link or textual value)") +} + +type ImageSwatchData implements SwatchDataInterface { + thumbnail: String @doc(description: "Thumbnail swatch image URL") +} + +type TextSwatchData implements SwatchDataInterface { + +} + +type ColorSwatchData implements SwatchDataInterface { + } \ No newline at end of file diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/CreateCustomerTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/CreateCustomerTest.php index a6455a9728fec..3da51088f0af6 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/CreateCustomerTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/CreateCustomerTest.php @@ -172,24 +172,25 @@ public function testCreateCustomerIfEmailMissed() } /** - * @expectedException \Exception - * @expectedExceptionMessage "Email" is not a valid email address. + * @dataProvider invalidEmailAddressDataProvider + * + * @param string $email + * @throws \Exception */ - public function testCreateCustomerIfEmailIsNotValid() + public function testCreateCustomerIfEmailIsNotValid(string $email) { - $newFirstname = 'Richard'; - $newLastname = 'Rowe'; - $currentPassword = 'test123#'; - $newEmail = 'email'; + $firstname = 'Richard'; + $lastname = 'Rowe'; + $password = 'test123#'; $query = <<<QUERY mutation { createCustomer( input: { - firstname: "{$newFirstname}" - lastname: "{$newLastname}" - email: "{$newEmail}" - password: "{$currentPassword}" + firstname: "{$firstname}" + lastname: "{$lastname}" + email: "{$email}" + password: "{$password}" is_subscribed: true } ) { @@ -203,9 +204,29 @@ public function testCreateCustomerIfEmailIsNotValid() } } QUERY; + $this->expectExceptionMessage('"' . $email . '" is not a valid email address.'); $this->graphQlMutation($query); } + /** + * @return array + */ + public function invalidEmailAddressDataProvider(): array + { + return [ + ['plainaddress'], + ['jØrgen@somedomain.com'], + ['#@%^%#$@#$@#.com'], + ['@example.com'], + ['Joe Smith <email@example.com>'], + ['email.example.com'], + ['email@example@example.com'], + ['email@example.com (Joe Smith)'], + ['email@example'], + ['“email”@example.com'], + ]; + } + /** * @expectedException \Exception * @expectedExceptionMessage Field "test123" is not defined by type CustomerInput. diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Swatches/ProductSwatchDataTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Swatches/ProductSwatchDataTest.php new file mode 100644 index 0000000000000..ab4e001e9d633 --- /dev/null +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Swatches/ProductSwatchDataTest.php @@ -0,0 +1,166 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\GraphQl\Swatches; + +use Magento\Catalog\Model\Product\Image\UrlBuilder; +use Magento\Swatches\Helper\Media as SwatchesMedia; +use Magento\Swatches\Model\Swatch; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\TestCase\GraphQlAbstract; + +/** + * Class ProductSwatchDataTest + */ +class ProductSwatchDataTest extends GraphQlAbstract +{ + /** + * @var SwatchesMedia + */ + private $swatchMediaHelper; + + /** + * @var UrlBuilder + */ + private $imageUrlBuilder; + + /** + * @inheritdoc + */ + protected function setUp() + { + $objectManager = Bootstrap::getObjectManager(); + $this->swatchMediaHelper = $objectManager->get(SwatchesMedia::class); + $this->imageUrlBuilder = $objectManager->get(UrlBuilder::class); + } + + /** + * @param string $productSku + * + * @return mixed + * @throws \PHPUnit\Framework\Exception + */ + private function getSwatchDataValues($productSku = 'configurable') + { + $query = <<<QUERY +{ + products(filter: {sku: {eq: "{$productSku}"}}) { + items { + ... on ConfigurableProduct{ + configurable_options{ + values { + swatch_data{ + type + value + thumbnail + } + } + } + } + } + } +} +QUERY; + $response = $this->graphQlQuery($query); + + $this->assertArrayHasKey('products', $response); + $this->assertArrayHasKey('items', $response['products']); + $this->assertArrayHasKey(0, $response['products']['items']); + + $product = $response['products']['items'][0]; + $this->assertArrayHasKey('configurable_options', $product); + $this->assertArrayHasKey(0, $product['configurable_options']); + + $option = $product['configurable_options'][0]; + $this->assertArrayHasKey('values', $option); + + return $option['values']; + } + + /** + * @magentoApiDataFixture Magento/Swatches/_files/visual_swatch_attribute_with_enabled_product_image_for_swatch.php + */ + public function testGetSwatchDataForVisualOptionsWithProductImage() + { + $productSku = 'configurable_12345'; + $productImage = '/m/a/magento_image.jpg'; + $swatchImageName = '/visual_swatch_attribute_option_type_image.jpg'; + $expectedValues = [ + 0 => [ + 'swatch_data' => [ + 'type' => 'IMAGE', + 'value' => $this->imageUrlBuilder->getUrl($productImage, Swatch::SWATCH_IMAGE_NAME), + 'thumbnail' => $this->imageUrlBuilder->getUrl($productImage, Swatch::SWATCH_THUMBNAIL_NAME), + ], + ], + 1 => [ + 'swatch_data' => [ + 'type' => 'IMAGE', + 'value' => $this->swatchMediaHelper->getSwatchAttributeImage(Swatch::SWATCH_IMAGE_NAME, $swatchImageName), + 'thumbnail' => $this->swatchMediaHelper->getSwatchAttributeImage(Swatch::SWATCH_THUMBNAIL_NAME, $swatchImageName), + ], + ], + 2 => [ + 'swatch_data' => NULL, + ], + ]; + + $values = $this->getSwatchDataValues($productSku); + $this->assertEquals($values, $expectedValues); + } + + /** + * @magentoApiDataFixture Magento/Swatches/_files/textual_swatch_attribute.php + * @magentoApiDataFixture Magento/ConfigurableProduct/_files/configurable_products.php + */ + public function testGetSwatchDataForTextualOptions() + { + $expectType = "TEXTUAL"; + $expectValue = "option 1"; + $expectThumbnail = null; + + $values = $this->getSwatchDataValues(); + $this->assertArrayHasKey(0, $values); + + $value = $values[0]; + $this->assertArrayHasKey('swatch_data', $value); + $this->assertEquals($expectType, $value['swatch_data']['type']); + $this->assertEquals($expectValue, $value['swatch_data']['value']); + $this->assertEquals($expectThumbnail, $value['swatch_data']['thumbnail']); + } + + /** + * @magentoApiDataFixture Magento/Swatches/_files/visual_swatch_attribute_with_different_options_type.php + * @magentoApiDataFixture Magento/ConfigurableProduct/_files/configurable_products.php + */ + public function testGetSwatchDataForVisualOptions() + { + $imageName = '/visual_swatch_attribute_option_type_image.jpg'; + $expectedValues = [ + 0 => [ + 'swatch_data' => [ + 'type' => 'COLOR', + 'value' => '#000000', + 'thumbnail' => NULL, + ], + ], + 1 => [ + 'swatch_data' => [ + 'type' => 'IMAGE', + 'value' => $this->swatchMediaHelper->getSwatchAttributeImage(Swatch::SWATCH_IMAGE_NAME, $imageName), + 'thumbnail' => $this->swatchMediaHelper->getSwatchAttributeImage(Swatch::SWATCH_THUMBNAIL_NAME, $imageName), + ], + ], + 2 => [ + 'swatch_data' => NULL, + ], + ]; + + $values = $this->getSwatchDataValues(); + $this->assertEquals($values, $expectedValues); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Swatches/_files/text_swatch_attribute_rollback.php b/dev/tests/integration/testsuite/Magento/Swatches/_files/text_swatch_attribute_rollback.php new file mode 100644 index 0000000000000..3b1810766c915 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Swatches/_files/text_swatch_attribute_rollback.php @@ -0,0 +1,23 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +/** @var \Magento\Framework\Registry $registry */ +$registry = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(\Magento\Framework\Registry::class); + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); + +/** @var \Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute */ +$attribute = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create(\Magento\Catalog\Model\ResourceModel\Eav\Attribute::class); + +$attribute->loadByCode(4, 'test_configurable'); + +if ($attribute->getId()) { + $attribute->delete(); +} + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); diff --git a/dev/tests/integration/testsuite/Magento/Swatches/_files/textual_swatch_attribute.php b/dev/tests/integration/testsuite/Magento/Swatches/_files/textual_swatch_attribute.php new file mode 100644 index 0000000000000..26602d2b2e2f0 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Swatches/_files/textual_swatch_attribute.php @@ -0,0 +1,103 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\Data\ProductAttributeInterface; +use Magento\Catalog\Setup\CategorySetup; +use Magento\Eav\Api\AttributeRepositoryInterface; +use Magento\Eav\Api\Data\AttributeOptionInterface; +use Magento\Swatches\Model\Swatch; +use Magento\TestFramework\Helper\Bootstrap; + +/** @var $installer CategorySetup */ +$installer = Bootstrap::getObjectManager()->create(\Magento\Catalog\Setup\CategorySetup::class); +/** @var AttributeRepositoryInterface $attributeRepository */ +$attributeRepository = Bootstrap::getObjectManager()->create(AttributeRepositoryInterface::class); + +// Add attribute data +$data = [ + 'attribute_code' => 'test_configurable', + 'entity_type_id' => $installer->getEntityTypeId('catalog_product'), + 'is_global' => 1, + 'is_user_defined' => 1, + 'frontend_input' => 'select', + 'is_unique' => 0, + 'is_required' => 0, + 'is_searchable' => 0, + 'is_visible_in_advanced_search' => 0, + 'is_comparable' => 0, + 'is_filterable' => 0, + 'is_filterable_in_search' => 0, + 'is_used_for_promo_rules' => 0, + 'is_html_allowed_on_front' => 1, + 'is_visible_on_front' => 0, + 'used_in_product_listing' => 0, + 'used_for_sort_by' => 0, + 'frontend_label' => ['Test Configurable'], + 'backend_type' => 'int', +]; + +$optionsPerAttribute = 3; + +$data['frontend_input'] = 'select'; +$data['swatch_input_type'] = Swatch::SWATCH_INPUT_TYPE_TEXT; + +$data['swatchtext']['value'] = array_reduce( + range(1, $optionsPerAttribute), + function ($values, $index) use ($optionsPerAttribute) { + $values['option_' . $index] = ['option ' . $index]; + return $values; + }, + [] +); + +$data['optiontext']['value'] = array_reduce( + range(1, $optionsPerAttribute), + function ($values, $index) use ($optionsPerAttribute) { + $values['option_' . $index] = ['option ' . $index]; + return $values; + }, + [] +); + +$data['optiontext']['order'] = array_reduce( + range(1, $optionsPerAttribute), + function ($values, $index) use ($optionsPerAttribute) { + $values['option_' . $index] = $index; + return $values; + }, + [] +); + +$data['options']['option'] = array_reduce( + range(1, $optionsPerAttribute), + function ($values, $index) use ($optionsPerAttribute) { + $values[] = [ + 'label' => 'option ' . $index, + 'value' => 'option_' . $index, + ]; + return $values; + }, + [] +); + +$options = []; +foreach ($data['options']['option'] as $optionData) { + $options[] = Bootstrap::getObjectManager()->create(AttributeOptionInterface::class) + ->setLabel($optionData['label']) + ->setValue($optionData['value']); +} + +$attribute = Bootstrap::getObjectManager()->create( + ProductAttributeInterface::class, + ['data' => $data] +); + +$attribute->setOptions($options); +$attributeRepository->save($attribute); + +/* Assign attribute to attribute set */ +$installer->addAttributeToGroup('catalog_product', 'Default', 'General', $attribute->getId()); diff --git a/dev/tests/integration/testsuite/Magento/Swatches/_files/visual_swatch_attribute_with_different_options_type.php b/dev/tests/integration/testsuite/Magento/Swatches/_files/visual_swatch_attribute_with_different_options_type.php new file mode 100644 index 0000000000000..a4a755c4b92db --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Swatches/_files/visual_swatch_attribute_with_different_options_type.php @@ -0,0 +1,116 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\Data\ProductAttributeInterface; +use Magento\Catalog\Setup\CategorySetup; +use Magento\Eav\Api\AttributeRepositoryInterface; +use Magento\Eav\Api\Data\AttributeOptionInterface; +use Magento\Setup\Fixtures\ImagesGenerator\ImagesGenerator; +use Magento\Swatches\Helper\Media as SwatchesMedia; +use Magento\Swatches\Model\Swatch; +use Magento\TestFramework\Helper\Bootstrap; + +/** @var $installer CategorySetup */ +$installer = Bootstrap::getObjectManager()->create(\Magento\Catalog\Setup\CategorySetup::class); +/** @var AttributeRepositoryInterface $attributeRepository */ +$attributeRepository = Bootstrap::getObjectManager()->create(AttributeRepositoryInterface::class); + +// Generate swatch image +/** @var ImagesGenerator $imagesGenerator */ +$imagesGenerator = Bootstrap::getObjectManager()->get(ImagesGenerator::class); +/** @var SwatchesMedia $swatchesMedia */ +$swatchesMedia = Bootstrap::getObjectManager()->get(SwatchesMedia::class); +$imageName = 'visual_swatch_attribute_option_type_image.jpg'; +$imagesGenerator->generate([ + 'image-width' => 110, + 'image-height' => 90, + 'image-name' => $imageName, +]); +$imagePath = substr($swatchesMedia->moveImageFromTmp($imageName), 1); +$swatchesMedia->generateSwatchVariations($imagePath); + +// Add attribute data +$data = [ + 'attribute_code' => 'test_configurable', + 'entity_type_id' => $installer->getEntityTypeId('catalog_product'), + 'is_global' => 1, + 'is_user_defined' => 1, + 'frontend_input' => 'select', + 'is_unique' => 0, + 'is_required' => 0, + 'is_searchable' => 0, + 'is_visible_in_advanced_search' => 0, + 'is_comparable' => 0, + 'is_filterable' => 0, + 'is_filterable_in_search' => 0, + 'is_used_for_promo_rules' => 0, + 'is_html_allowed_on_front' => 1, + 'is_visible_on_front' => 0, + 'used_in_product_listing' => 0, + 'used_for_sort_by' => 0, + 'frontend_label' => ['Test Configurable'], + 'backend_type' => 'int', +]; + +$optionsPerAttribute = 3; + +$data['frontend_input'] = 'select'; +$data['swatch_input_type'] = Swatch::SWATCH_INPUT_TYPE_VISUAL; + +$data['swatchvisual']['value'] = [ + 'option_1' => '#000000', // HEX color (color type) + 'option_2' => $imagePath, // image path (image type) + 'option_3' => null, // null (empty type) +]; + +$data['optionvisual']['value'] = array_reduce( + range(1, $optionsPerAttribute), + function ($values, $index) use ($optionsPerAttribute) { + $values['option_' . $index] = ['option ' . $index]; + return $values; + }, + [] +); + +$data['optionvisual']['order'] = array_reduce( + range(1, $optionsPerAttribute), + function ($values, $index) use ($optionsPerAttribute) { + $values['option_' . $index] = $index; + return $values; + }, + [] +); + +$data['options']['option'] = array_reduce( + range(1, $optionsPerAttribute), + function ($values, $index) use ($optionsPerAttribute) { + $values[] = [ + 'label' => 'option ' . $index, + 'value' => 'option_' . $index, + ]; + return $values; + }, + [] +); + +$options = []; +foreach ($data['options']['option'] as $optionData) { + $options[] = Bootstrap::getObjectManager()->create(AttributeOptionInterface::class) + ->setLabel($optionData['label']) + ->setValue($optionData['value']); +} + +$attribute = Bootstrap::getObjectManager()->create( + ProductAttributeInterface::class, + ['data' => $data] +); + +$attribute->setOptions($options); +$attributeRepository->save($attribute); + +/* Assign attribute to attribute set */ +$installer->addAttributeToGroup('catalog_product', 'Default', 'General', $attribute->getId()); diff --git a/dev/tests/integration/testsuite/Magento/Swatches/_files/visual_swatch_attribute_with_different_options_type_rollback.php b/dev/tests/integration/testsuite/Magento/Swatches/_files/visual_swatch_attribute_with_different_options_type_rollback.php new file mode 100644 index 0000000000000..ef1db34708fb3 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Swatches/_files/visual_swatch_attribute_with_different_options_type_rollback.php @@ -0,0 +1,34 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Filesystem; +use Magento\Framework\Filesystem\Directory\WriteInterface; +use Magento\Swatches\Helper\Media as SwatchesMedia; +use Magento\TestFramework\Helper\Bootstrap; + +/** @var WriteInterface $mediaDirectory */ +$mediaDirectory = Bootstrap::getObjectManager()->get(Filesystem::class) + ->getDirectoryWrite( + DirectoryList::MEDIA + ); + +/** @var SwatchesMedia $swatchesMedia */ +$swatchesMedia = Bootstrap::getObjectManager()->get(SwatchesMedia::class); + +$testImageName = 'visual_swatch_attribute_option_type_image.jpg'; +$testImageSwatchPath = $swatchesMedia->getAttributeSwatchPath($testImageName); +$mediaDirectory->delete($testImageSwatchPath); + +$imageConfig = $swatchesMedia->getImageConfig(); +$swatchTypes = ['swatch_image', 'swatch_thumb']; + +foreach ($swatchTypes as $swatchType) { + $absolutePath = $mediaDirectory->getAbsolutePath($swatchesMedia->getSwatchCachePath($swatchType)); + $swatchTypePath = $absolutePath . $swatchesMedia->getFolderNameSize($swatchType, $imageConfig) . '/' . $testImageName; + $mediaDirectory->delete($swatchTypePath); +} diff --git a/dev/tests/integration/testsuite/Magento/Swatches/_files/visual_swatch_attribute_with_enabled_product_image_for_swatch.php b/dev/tests/integration/testsuite/Magento/Swatches/_files/visual_swatch_attribute_with_enabled_product_image_for_swatch.php new file mode 100644 index 0000000000000..0e171094516ba --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Swatches/_files/visual_swatch_attribute_with_enabled_product_image_for_swatch.php @@ -0,0 +1,35 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Model\Product; + +require __DIR__ . '/visual_swatch_attribute_with_different_options_type.php'; +require __DIR__ . '/../../../Magento/ConfigurableProduct/_files/configurable_products.php'; +require __DIR__ . '/../../../Magento/Catalog/_files/product_image.php'; + +// set 'Product Image for Swatch' for attribute +$attribute->setData('use_product_image_for_swatch', 1); +$attributeRepository->save($attribute); + +// get first child and set image +$childrenProducts = $product->getTypeInstance()->getUsedProducts($product); +/** @var Product $firstChildSimpleProduct */ +$firstChildSimpleProduct = array_shift($childrenProducts); +$firstChildSimpleProduct + ->setImage('/m/a/magento_image.jpg') + ->setSmallImage('/m/a/magento_image.jpg') + ->setThumbnail('/m/a/magento_image.jpg') + ->setData('media_gallery', ['images' => [ + [ + 'file' => '/m/a/magento_image.jpg', + 'position' => 1, + 'label' => 'Image Alt Text', + 'disabled' => 0, + 'media_type' => 'image' + ], + ]]) + ->save(); diff --git a/dev/tests/integration/testsuite/Magento/Swatches/_files/visual_swatch_attribute_with_enabled_product_image_for_swatch_rollback.php b/dev/tests/integration/testsuite/Magento/Swatches/_files/visual_swatch_attribute_with_enabled_product_image_for_swatch_rollback.php new file mode 100644 index 0000000000000..c708971326162 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Swatches/_files/visual_swatch_attribute_with_enabled_product_image_for_swatch_rollback.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +require __DIR__ . '/visual_swatch_attribute_with_different_options_type_rollback.php'; +require __DIR__ . '/../../../Magento/ConfigurableProduct/_files/configurable_products_rollback.php'; +require __DIR__ . '/../../../Magento/Catalog/_files/product_image_rollback.php'; + From d34a54c263c8fe86cc82b5c4c10667eea8e74224 Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Fri, 20 Dec 2019 11:55:46 +0200 Subject: [PATCH 451/586] Covering the SetAttributeTabBlockObserver for Bundles by Unit Test --- .../SetAttributeTabBlockObserverTest.php | 112 ++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 app/code/Magento/Bundle/Test/Unit/Observer/SetAttributeTabBlockObserverTest.php diff --git a/app/code/Magento/Bundle/Test/Unit/Observer/SetAttributeTabBlockObserverTest.php b/app/code/Magento/Bundle/Test/Unit/Observer/SetAttributeTabBlockObserverTest.php new file mode 100644 index 0000000000000..67368bdf89409 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Unit/Observer/SetAttributeTabBlockObserverTest.php @@ -0,0 +1,112 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Bundle\Test\Unit\Observer; + +use Magento\Bundle\Block\Adminhtml\Catalog\Product\Edit\Tab\Attributes; +use Magento\Bundle\Observer\SetAttributeTabBlockObserver; +use Magento\Catalog\Helper\Catalog; +use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\Product\Type; +use Magento\Framework\Event; +use Magento\Framework\Event\Observer; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Class SetAttributeTabBlockObserverTest + * + * Test setting attribute tab block for bundle products + */ +class SetAttributeTabBlockObserverTest extends TestCase +{ + /** + * @var SetAttributeTabBlockObserver + */ + private $observer; + + /** + * @var Catalog|MockObject + */ + private $helperCatalogMock; + + /** + * @var Observer|MockObject + */ + private $observerMock; + + /** + * @var Event|MockObject + */ + private $eventMock; + + /** + * @var Product|MockObject + */ + private $productMock; + + /** + * Set Up + */ + public function setUp() + { + $this->helperCatalogMock = $this->createMock(Catalog::class); + $this->observerMock = $this->createMock(Observer::class); + $this->eventMock = $this->getMockBuilder(Event::class) + ->disableOriginalConstructor() + ->setMethods(['getProduct']) + ->getMock(); + $this->productMock = $this->getMockBuilder(Product::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->observer = new SetAttributeTabBlockObserver( + $this->helperCatalogMock + ); + } + + /** + * Test setting attribute tab block for bundle product + */ + public function testAddingAttributeTabForBundleProduct() + { + $this->productMock->expects($this->any()) + ->method('getTypeId') + ->willReturn(Type::TYPE_BUNDLE); + $this->eventMock->expects($this->any()) + ->method('getProduct') + ->willReturn($this->productMock); + $this->observerMock->expects($this->any()) + ->method('getEvent') + ->willReturn($this->eventMock); + $this->helperCatalogMock->expects($this->once()) + ->method('setAttributeTabBlock') + ->with(Attributes::class); + + $this->observer->execute($this->observerMock); + } + + /** + * Test setting attribute tab block for a non bundle product + */ + public function testAddingAttributeTabForNonBundleProduct() + { + $this->productMock->expects($this->any()) + ->method('getTypeId') + ->willReturn(Type::TYPE_VIRTUAL); + $this->eventMock->expects($this->any()) + ->method('getProduct') + ->willReturn($this->productMock); + $this->observerMock->expects($this->any()) + ->method('getEvent') + ->willReturn($this->eventMock); + $this->helperCatalogMock->expects($this->never()) + ->method('setAttributeTabBlock'); + + $this->observer->execute($this->observerMock); + } +} From df7b502c8fbb11b294a119abc232db1c422466eb Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Fri, 20 Dec 2019 12:23:38 +0200 Subject: [PATCH 452/586] Covering the InvalidatePriceIndexUponConfigChangeObserver for CatalogInventory by Unit Test --- ...PriceIndexUponConfigChangeObserverTest.php | 113 ++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 app/code/Magento/CatalogInventory/Test/Unit/Observer/InvalidatePriceIndexUponConfigChangeObserverTest.php diff --git a/app/code/Magento/CatalogInventory/Test/Unit/Observer/InvalidatePriceIndexUponConfigChangeObserverTest.php b/app/code/Magento/CatalogInventory/Test/Unit/Observer/InvalidatePriceIndexUponConfigChangeObserverTest.php new file mode 100644 index 0000000000000..9762b59c3e883 --- /dev/null +++ b/app/code/Magento/CatalogInventory/Test/Unit/Observer/InvalidatePriceIndexUponConfigChangeObserverTest.php @@ -0,0 +1,113 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogInventory\Test\Unit\Observer; + +use Magento\Catalog\Model\Indexer\Product\Price\Processor; +use Magento\CatalogInventory\Model\Configuration; +use Magento\CatalogInventory\Observer\InvalidatePriceIndexUponConfigChangeObserver; +use Magento\Framework\Event; +use Magento\Framework\Event\Observer; +use Magento\Framework\Indexer\IndexerInterface; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Class InvalidatePriceIndexUponConfigChangeObserverTest + * + * Testing invalidating product price index onn config changing + */ +class InvalidatePriceIndexUponConfigChangeObserverTest extends TestCase +{ + /** + * @var InvalidatePriceIndexUponConfigChangeObserver + */ + private $observer; + + /** + * @var Processor|MockObject + */ + private $priceIndexProcessorMock; + + /** + * @var Observer|MockObject + */ + private $observerMock; + + /** + * @var Event|MockObject + */ + private $eventMock; + + /** + * @var IndexerInterface|MockObject + */ + private $indexerMock; + + /** + * Set Up + */ + public function setUp() + { + $this->priceIndexProcessorMock = $this->createMock(Processor::class); + $this->indexerMock = $this->getMockBuilder(IndexerInterface::class) + ->getMockForAbstractClass(); + $this->observerMock = $this->createMock(Observer::class); + $this->eventMock = $this->getMockBuilder(Event::class) + ->disableOriginalConstructor() + ->setMethods(['getChangedPaths']) + ->getMock(); + + $this->observer = new InvalidatePriceIndexUponConfigChangeObserver( + $this->priceIndexProcessorMock + ); + } + + /** + * Testing invalidating product price index on catalog inventory config changes + */ + public function testInvalidatingPriceOnChangingOutOfStockConfig() + { + $changedPaths = [Configuration::XML_PATH_SHOW_OUT_OF_STOCK]; + + $this->eventMock->expects($this->once()) + ->method('getChangedPaths') + ->willReturn($changedPaths); + $this->observerMock->expects($this->once()) + ->method('getEvent') + ->willReturn($this->eventMock); + $this->indexerMock->expects($this->once()) + ->method('invalidate'); + $this->priceIndexProcessorMock->expects($this->once()) + ->method('getIndexer') + ->willReturn($this->indexerMock); + + $this->observer->execute($this->observerMock); + } + + /** + * Testing invalidating product price index on changing any other config + */ + public function testInvalidatingPriceOnChangingAnyOtherConfig() + { + $changedPaths = [Configuration::XML_PATH_ITEM_AUTO_RETURN]; + + $this->eventMock->expects($this->once()) + ->method('getChangedPaths') + ->willReturn($changedPaths); + $this->observerMock->expects($this->once()) + ->method('getEvent') + ->willReturn($this->eventMock); + $this->indexerMock->expects($this->never()) + ->method('invalidate'); + $this->priceIndexProcessorMock->expects($this->never()) + ->method('getIndexer') + ->willReturn($this->indexerMock); + + $this->observer->execute($this->observerMock); + } +} From f9cf1882fa890caade0e9894e26218c82ff9867c Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Fri, 20 Dec 2019 12:32:05 +0200 Subject: [PATCH 453/586] Adding ObjectManager usage --- .../Unit/Observer/SetAttributeTabBlockObserverTest.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Bundle/Test/Unit/Observer/SetAttributeTabBlockObserverTest.php b/app/code/Magento/Bundle/Test/Unit/Observer/SetAttributeTabBlockObserverTest.php index 67368bdf89409..08f6a05bd10bf 100644 --- a/app/code/Magento/Bundle/Test/Unit/Observer/SetAttributeTabBlockObserverTest.php +++ b/app/code/Magento/Bundle/Test/Unit/Observer/SetAttributeTabBlockObserverTest.php @@ -14,6 +14,7 @@ use Magento\Catalog\Model\Product\Type; use Magento\Framework\Event; use Magento\Framework\Event\Observer; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -54,6 +55,7 @@ class SetAttributeTabBlockObserverTest extends TestCase */ public function setUp() { + $objectManager = new ObjectManager($this); $this->helperCatalogMock = $this->createMock(Catalog::class); $this->observerMock = $this->createMock(Observer::class); $this->eventMock = $this->getMockBuilder(Event::class) @@ -64,8 +66,11 @@ public function setUp() ->disableOriginalConstructor() ->getMock(); - $this->observer = new SetAttributeTabBlockObserver( - $this->helperCatalogMock + $this->observer = $objectManager->getObject( + SetAttributeTabBlockObserver::class, + [ + 'helperCatalog' => $this->helperCatalogMock + ] ); } From 82fee14d8ae788c0da5eb1f23d5f335376b90613 Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Fri, 20 Dec 2019 12:34:02 +0200 Subject: [PATCH 454/586] Adding ObjectManager --- .../InvalidatePriceIndexUponConfigChangeObserverTest.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/CatalogInventory/Test/Unit/Observer/InvalidatePriceIndexUponConfigChangeObserverTest.php b/app/code/Magento/CatalogInventory/Test/Unit/Observer/InvalidatePriceIndexUponConfigChangeObserverTest.php index 9762b59c3e883..1dd7df8952473 100644 --- a/app/code/Magento/CatalogInventory/Test/Unit/Observer/InvalidatePriceIndexUponConfigChangeObserverTest.php +++ b/app/code/Magento/CatalogInventory/Test/Unit/Observer/InvalidatePriceIndexUponConfigChangeObserverTest.php @@ -13,6 +13,7 @@ use Magento\Framework\Event; use Magento\Framework\Event\Observer; use Magento\Framework\Indexer\IndexerInterface; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -53,6 +54,7 @@ class InvalidatePriceIndexUponConfigChangeObserverTest extends TestCase */ public function setUp() { + $objectManager = new ObjectManager($this); $this->priceIndexProcessorMock = $this->createMock(Processor::class); $this->indexerMock = $this->getMockBuilder(IndexerInterface::class) ->getMockForAbstractClass(); @@ -62,8 +64,11 @@ public function setUp() ->setMethods(['getChangedPaths']) ->getMock(); - $this->observer = new InvalidatePriceIndexUponConfigChangeObserver( - $this->priceIndexProcessorMock + $this->observer = $objectManager->getObject( + InvalidatePriceIndexUponConfigChangeObserver::class, + [ + 'priceIndexProcessor' => $this->priceIndexProcessorMock + ] ); } From 8251bc91a45ffb61cdfb0015ccf570f63f23484b Mon Sep 17 00:00:00 2001 From: divyajyothi5321 <54176640+divyajyothi5321@users.noreply.github.com> Date: Fri, 20 Dec 2019 17:07:29 +0530 Subject: [PATCH 455/586] Update Send.php --- app/code/Magento/Wishlist/Controller/Index/Send.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/Wishlist/Controller/Index/Send.php b/app/code/Magento/Wishlist/Controller/Index/Send.php index b7c93473cde94..2f1813cf886ed 100644 --- a/app/code/Magento/Wishlist/Controller/Index/Send.php +++ b/app/code/Magento/Wishlist/Controller/Index/Send.php @@ -318,7 +318,6 @@ protected function addLayoutHandles(ResultLayout $resultLayout) * * @param int $wishlistId * @param \Magento\Framework\View\Result\Layout $resultLayout - * @return mixed */ protected function getRssLink($wishlistId, ResultLayout $resultLayout) { From 51a83785e0af99a03020d0a2da7d5a5dca8cb7f0 Mon Sep 17 00:00:00 2001 From: Viktor Petryk <victor.petryk@transoftgroup.com> Date: Fri, 20 Dec 2019 14:10:38 +0200 Subject: [PATCH 456/586] MC-29444: Extra Values of UPS and USPS are in dropdown list Cart Price Rule - Condition - Shipping Method --- app/code/Magento/Ups/Model/Carrier.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Ups/Model/Carrier.php b/app/code/Magento/Ups/Model/Carrier.php index 05f12f8999212..7a2123629ca12 100644 --- a/app/code/Magento/Ups/Model/Carrier.php +++ b/app/code/Magento/Ups/Model/Carrier.php @@ -1320,13 +1320,11 @@ public function getAllowedMethods() ? $this->configHelper->getCode('originShipment', $origin) : $this->configHelper->getCode('method'); - $filteredMethods = array_filter($availableByTypeMethods, function ($methodCode) use ($allowedMethods) { - return in_array($methodCode, $allowedMethods); - }, ARRAY_FILTER_USE_KEY); - $methods = []; - foreach ($filteredMethods as $methodCode => $methodData) { - $methods[$methodCode] = $methodData->getText(); + foreach ($availableByTypeMethods as $methodCode => $methodData) { + if (in_array($methodCode, $allowedMethods)) { + $methods[$methodCode] = $methodData->getText(); + } } return $methods; From c7bb3b4ede5450c69059b9ea0e314d577ff5a3ad Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Fri, 20 Dec 2019 14:47:01 +0200 Subject: [PATCH 457/586] Covering the ProductAttributeGridBuildObserver for LayeredNavigation by Unit Test --- .../ProductAttributeGridBuildObserverTest.php | 102 ++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 app/code/Magento/LayeredNavigation/Test/Unit/Observer/Grid/ProductAttributeGridBuildObserverTest.php diff --git a/app/code/Magento/LayeredNavigation/Test/Unit/Observer/Grid/ProductAttributeGridBuildObserverTest.php b/app/code/Magento/LayeredNavigation/Test/Unit/Observer/Grid/ProductAttributeGridBuildObserverTest.php new file mode 100644 index 0000000000000..f21908d11ad44 --- /dev/null +++ b/app/code/Magento/LayeredNavigation/Test/Unit/Observer/Grid/ProductAttributeGridBuildObserverTest.php @@ -0,0 +1,102 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\LayeredNavigation\Test\Unit\Observer\Grid; + +use Magento\Catalog\Block\Adminhtml\Product\Attribute\Grid; +use Magento\Framework\Event\Observer; +use Magento\Framework\Module\Manager; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\LayeredNavigation\Observer\Grid\ProductAttributeGridBuildObserver; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Class ProductAttributeGridBuildObserverTest + * + * Testing adding new grid column for Layered Navigation + */ +class ProductAttributeGridBuildObserverTest extends TestCase +{ + /** + * @var ProductAttributeGridBuildObserver + */ + private $observer; + + /** + * @var Manager|MockObject + */ + private $moduleManagerMock; + + /** + * @var Observer|MockObject + */ + private $observerMock; + + /** + * @var Grid|MockObject + */ + private $gridMock; + + /** + * Set Up + */ + protected function setUp() + { + $objectManager = new ObjectManager($this); + $this->moduleManagerMock = $this->createMock(Manager::class); + $this->gridMock = $this->createMock(Grid::class); + $this->observerMock = $this->getMockBuilder(Observer::class) + ->disableOriginalConstructor() + ->setMethods(['getGrid']) + ->getMock(); + + $this->observer = $objectManager->getObject( + ProductAttributeGridBuildObserver::class, + [ + 'moduleManager' => $this->moduleManagerMock, + ] + ); + } + + /** + * Testing the column adding if the output is not enabled + */ + public function testColumnAddingOnDisabledOutput() + { + $enabledOutput = false; + + $this->moduleManagerMock->expects($this->once()) + ->method('isOutputEnabled') + ->with('Magento_LayeredNavigation') + ->willReturn($enabledOutput); + + $this->observerMock->expects($this->never()) + ->method('getGrid'); + + $this->observer->execute($this->observerMock); + } + + /** + * Testing the column adding if the output is enabled + */ + public function testColumnAddingOnEnabledOutput() + { + $enabledOutput = true; + + $this->moduleManagerMock->expects($this->once()) + ->method('isOutputEnabled') + ->with('Magento_LayeredNavigation') + ->willReturn($enabledOutput); + + $this->observerMock->expects($this->once()) + ->method('getGrid') + ->willReturn($this->gridMock); + + $this->observer->execute($this->observerMock); + } +} From d1e4bbe8d5d85265266d125a2a9bf9bf862e4990 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Fri, 20 Dec 2019 15:27:51 +0200 Subject: [PATCH 458/586] MC-29916: [Magento Cloud] Configurable product images missing in the admin --- .../Import/Product/MediaGalleryProcessor.php | 266 +++++++++++------- .../Model/Import/ProductTest.php | 107 +++++++ ...import_configurable_product_multistore.csv | 5 + 3 files changed, 270 insertions(+), 108 deletions(-) create mode 100644 dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_configurable_product_multistore.csv diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product/MediaGalleryProcessor.php b/app/code/Magento/CatalogImportExport/Model/Import/Product/MediaGalleryProcessor.php index bd8523a4e396e..a94a87a44b32a 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product/MediaGalleryProcessor.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product/MediaGalleryProcessor.php @@ -108,40 +108,161 @@ public function __construct( public function saveMediaGallery(array $mediaGalleryData) { $this->initMediaGalleryResources(); - $mediaGalleryDataGlobal = array_replace_recursive(...$mediaGalleryData); - $imageNames = []; - $multiInsertData = []; - $valueToProductId = []; - foreach ($mediaGalleryDataGlobal as $productSku => $mediaGalleryRows) { - $productId = $this->skuProcessor->getNewSku($productSku)[$this->getProductEntityLinkField()]; - $insertedGalleryImgs = []; - foreach ($mediaGalleryRows as $insertValue) { - if (!in_array($insertValue['value'], $insertedGalleryImgs)) { - $valueArr = [ - 'attribute_id' => $insertValue['attribute_id'], - 'value' => $insertValue['value'], + $mediaGalleryValues = []; + $mediaGalleryValueData = []; + $productMediaGalleryValueData = []; + $mediaGalleryValueToEntityData = []; + $mediaGalleryValueToStoreData = []; + $productLinkIdField = $this->getProductEntityLinkField(); + foreach ($mediaGalleryData as $storeId => $storeMediaGalleryData) { + foreach ($storeMediaGalleryData as $sku => $productMediaGalleryData) { + $productId = $this->skuProcessor->getNewSku($sku)[$productLinkIdField]; + $productMediaGalleryValueData[$productId] = $productMediaGalleryValueData[$productId] ?? []; + foreach ($productMediaGalleryData as $data) { + if (!in_array($data['value'], $productMediaGalleryValueData[$productId])) { + $productMediaGalleryValueData[$productId][] = $data['value']; + $mediaGalleryValueData[] = [ + 'attribute_id' => $data['attribute_id'], + 'value' => $data['value'], + ]; + $mediaGalleryValueToEntityData[] = [ + 'value' => $data['value'], + $productLinkIdField => $productId, + ]; + } + $mediaGalleryValues[] = $data['value']; + $mediaGalleryValueToStoreData[] = [ + 'value' => $data['value'], + 'store_id' => $storeId, + $productLinkIdField => $productId, + 'label' => $data['label'], + 'position' => $data['position'], + 'disabled' => $data['disabled'], ]; - $valueToProductId[$insertValue['value']][] = $productId; - $imageNames[] = $insertValue['value']; - $multiInsertData[] = $valueArr; - $insertedGalleryImgs[] = $insertValue['value']; } } } - $oldMediaValues = $this->connection->fetchAssoc( - $this->connection->select()->from($this->mediaGalleryTableName, ['value_id', 'value']) - ->where('value IN (?)', $imageNames) - ); - $this->connection->insertOnDuplicate($this->mediaGalleryTableName, $multiInsertData); - $newMediaSelect = $this->connection->select()->from($this->mediaGalleryTableName, ['value_id', 'value']) - ->where('value IN (?)', $imageNames); - if (array_keys($oldMediaValues)) { - $newMediaSelect->where('value_id NOT IN (?)', array_keys($oldMediaValues)); + try { + $mediaValueIdValueMap = []; + $oldMediaValues = $this->connection->fetchCol( + $this->connection->select() + ->from($this->mediaGalleryTableName, ['value_id']) + ->where('value IN (?)', $mediaGalleryValues) + ); + $this->connection->insertOnDuplicate( + $this->mediaGalleryTableName, + $mediaGalleryValueData + ); + $newMediaSelect = $this->connection->select() + ->from($this->mediaGalleryTableName, ['value_id', 'value']) + ->where('value IN (?)', $mediaGalleryValues); + if ($oldMediaValues) { + $newMediaSelect->where('value_id NOT IN (?)', $oldMediaValues); + } + $mediaValueIdValueMap = $this->connection->fetchPairs($newMediaSelect); + $productIdMediaValueIdMap = $this->getProductIdMediaValueIdMap( + $productMediaGalleryValueData, + $mediaValueIdValueMap + ); + $mediaGalleryValueToEntityData = $this->prepareMediaGalleryValueToEntityData( + $mediaGalleryValueToEntityData, + $productIdMediaValueIdMap + ); + $this->connection->insertOnDuplicate( + $this->mediaGalleryEntityToValueTableName, + $mediaGalleryValueToEntityData, + ['value_id'] + ); + $mediaGalleryValueToStoreData = $this->prepareMediaGalleryValueData( + $mediaGalleryValueToStoreData, + $productIdMediaValueIdMap + ); + $this->connection->insertOnDuplicate( + $this->mediaGalleryValueTableName, + $mediaGalleryValueToStoreData, + ['value_id', 'store_id', $productLinkIdField, 'label', 'position', 'disabled'] + ); + } catch (\Throwable $exception) { + if ($mediaValueIdValueMap) { + $this->connection->delete( + $this->mediaGalleryTableName, + $this->connection->quoteInto('value_id IN (?)', array_keys($mediaValueIdValueMap)) + ); + } + throw $exception; } - $newMediaValues = $this->connection->fetchAssoc($newMediaSelect); - foreach ($mediaGalleryData as $storeId => $storeMediaGalleryData) { - $this->processMediaPerStore((int)$storeId, $storeMediaGalleryData, $newMediaValues, $valueToProductId); + } + + /** + * Get media values IDs per products IDs + * + * @param array $productMediaGalleryValueData + * @param array $mediaValueIdValueMap + * @return array + */ + private function getProductIdMediaValueIdMap( + array $productMediaGalleryValueData, + array $mediaValueIdValueMap + ): array { + $productIdMediaValueIdMap = []; + foreach ($productMediaGalleryValueData as $productId => $productMediaGalleryValues) { + foreach ($productMediaGalleryValues as $productMediaGalleryValue) { + foreach ($mediaValueIdValueMap as $valueId => $value) { + if ($productMediaGalleryValue === $value) { + $productIdMediaValueIdMap[$productId][$value] = $valueId; + unset($mediaValueIdValueMap[$valueId]); + break; + } + } + } + } + return $productIdMediaValueIdMap; + } + + /** + * Prepare media entity gallery value to entity data for insert + * + * @param array $mediaGalleryValueToEntityData + * @param array $productIdMediaValueIdMap + * @return array + */ + private function prepareMediaGalleryValueToEntityData( + array $mediaGalleryValueToEntityData, + array $productIdMediaValueIdMap + ): array { + $productLinkIdField = $this->getProductEntityLinkField(); + foreach ($mediaGalleryValueToEntityData as $index => $data) { + $productId = $data[$productLinkIdField]; + $value = $data['value']; + $mediaGalleryValueToEntityData[$index]['value_id'] = $productIdMediaValueIdMap[$productId][$value]; + unset($mediaGalleryValueToEntityData[$index]['value']); + } + return $mediaGalleryValueToEntityData; + } + + /** + * Prepare media entity gallery value data for insert + * + * @param array $mediaGalleryValueData + * @param array $productIdMediaValueIdMap + * @return array + */ + private function prepareMediaGalleryValueData( + array $mediaGalleryValueData, + array $productIdMediaValueIdMap + ): array { + $productLinkIdField = $this->getProductEntityLinkField(); + $lastPositions = $this->getLastMediaPositionPerProduct(array_keys($productIdMediaValueIdMap)); + foreach ($mediaGalleryValueData as $index => $data) { + $productId = $data[$productLinkIdField]; + $value = $data['value']; + $position = $data['position']; + $storeId = $data['store_id']; + $mediaGalleryValueData[$index]['value_id'] = $productIdMediaValueIdMap[$productId][$value]; + $mediaGalleryValueData[$index]['position'] = $position + ($lastPositions[$storeId][$productId] ?? 0); + unset($mediaGalleryValueData[$index]['value']); } + return $mediaGalleryValueData; } /** @@ -289,13 +410,12 @@ private function initMediaGalleryResources() } /** - * Get the last media position for each product from the given list + * Get the last media position for each product per store from the given list * - * @param int $storeId * @param array $productIds * @return array */ - private function getLastMediaPositionPerProduct(int $storeId, array $productIds): array + private function getLastMediaPositionPerProduct(array $productIds): array { $result = []; if ($productIds) { @@ -305,95 +425,25 @@ private function getLastMediaPositionPerProduct(int $storeId, array $productIds) $positions = $this->connection->fetchAll( $this->connection ->select() - ->from($this->mediaGalleryValueTableName, [$productKeyName, 'position']) + ->from($this->mediaGalleryValueTableName, [$productKeyName, 'store_id', 'position']) ->where("$productKeyName IN (?)", $productIds) - ->where('value_id is not null') - ->where('store_id = ?', $storeId) ); - // Make sure the result contains all product ids even if the product has no media files - $result = array_fill_keys($productIds, 0); // Find the largest position for each product foreach ($positions as $record) { $productId = $record[$productKeyName]; - $result[$productId] = $result[$productId] < $record['position'] + $storeId = $record['store_id']; + if (!isset($result[$storeId][$productId])) { + $result[$storeId][$productId] = 0; + } + $result[$storeId][$productId] = $result[$storeId][$productId] < $record['position'] ? $record['position'] - : $result[$productId]; + : $result[$storeId][$productId]; } } return $result; } - /** - * Save media gallery data per store. - * - * @param int $storeId - * @param array $mediaGalleryData - * @param array $newMediaValues - * @param array $valueToProductId - * @return void - */ - private function processMediaPerStore( - int $storeId, - array $mediaGalleryData, - array $newMediaValues, - array $valueToProductId - ) { - $multiInsertData = []; - $dataForSkinnyTable = []; - $lastMediaPositionPerProduct = $this->getLastMediaPositionPerProduct( - $storeId, - array_unique(array_merge(...array_values($valueToProductId))) - ); - - foreach ($mediaGalleryData as $mediaGalleryRows) { - foreach ($mediaGalleryRows as $insertValue) { - foreach ($newMediaValues as $valueId => $values) { - if ($values['value'] == $insertValue['value']) { - $insertValue['value_id'] = $valueId; - $insertValue[$this->getProductEntityLinkField()] - = array_shift($valueToProductId[$values['value']]); - unset($newMediaValues[$valueId]); - break; - } - } - if (isset($insertValue['value_id'])) { - $productId = $insertValue[$this->getProductEntityLinkField()]; - $valueArr = [ - 'value_id' => $insertValue['value_id'], - 'store_id' => $storeId, - $this->getProductEntityLinkField() => $productId, - 'label' => $insertValue['label'], - 'position' => $lastMediaPositionPerProduct[$productId] + $insertValue['position'], - 'disabled' => $insertValue['disabled'], - ]; - $multiInsertData[] = $valueArr; - $dataForSkinnyTable[] = [ - 'value_id' => $insertValue['value_id'], - $this->getProductEntityLinkField() => $insertValue[$this->getProductEntityLinkField()], - ]; - } - } - } - try { - $this->connection->insertOnDuplicate( - $this->mediaGalleryValueTableName, - $multiInsertData, - ['value_id', 'store_id', $this->getProductEntityLinkField(), 'label', 'position', 'disabled'] - ); - $this->connection->insertOnDuplicate( - $this->mediaGalleryEntityToValueTableName, - $dataForSkinnyTable, - ['value_id'] - ); - } catch (\Exception $e) { - $this->connection->delete( - $this->mediaGalleryTableName, - $this->connection->quoteInto('value_id IN (?)', $newMediaValues) - ); - } - } - /** * Get product entity link field. * diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php index c47a4f340f983..855fcbb1f35ae 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php @@ -2833,4 +2833,111 @@ public function testChangeImageLabelForStoreView() $this->assertEquals($expectedImageFile, $imageItem->getFile()); $this->assertEquals($expectedLabelForSecondStoreView, $imageItem->getLabel()); } + + /** + * Test that configurable product images are imported correctly. + * + * @magentoDataFixture mediaImportImageFixture + * @magentoDataFixture Magento/Store/_files/core_fixturestore.php + * @magentoDataFixture Magento/ConfigurableProduct/_files/configurable_attribute.php + */ + public function testImportConfigurableProductImages() + { + $this->importDataForMediaTest('import_configurable_product_multistore.csv'); + $expected = [ + 'import-configurable-option-1' => [ + [ + 'file' => '/m/a/magento_image.jpg', + 'label' => 'Base Image Label - Option 1', + ], + [ + 'file' => '/m/a/magento_small_image.jpg', + 'label' => 'Small Image Label - Option 1', + ], + [ + 'file' => '/m/a/magento_thumbnail.jpg', + 'label' => 'Thumbnail Image Label - Option 1', + ], + [ + 'file' => '/m/a/magento_additional_image_one.jpg', + 'label' => '', + ], + ], + 'import-configurable-option-2' => [ + [ + 'file' => '/m/a/magento_image.jpg', + 'label' => 'Base Image Label - Option 2', + ], + [ + 'file' => '/m/a/magento_small_image.jpg', + 'label' => 'Small Image Label - Option 2', + ], + [ + 'file' => '/m/a/magento_thumbnail.jpg', + 'label' => 'Thumbnail Image Label - Option 2', + ], + [ + 'file' => '/m/a/magento_additional_image_two.jpg', + 'label' => '', + ], + ], + 'import-configurable' => [ + [ + 'file' => '/m/a/magento_image.jpg', + 'label' => 'Base Image Label - Configurable', + ], + [ + 'file' => '/m/a/magento_small_image.jpg', + 'label' => 'Small Image Label - Configurable', + ], + [ + 'file' => '/m/a/magento_thumbnail.jpg', + 'label' => 'Thumbnail Image Label - Configurable', + ], + [ + 'file' => '/m/a/magento_additional_image_three.jpg', + 'label' => '', + ], + ] + ]; + $actual = []; + $products = ['import-configurable-option-1', 'import-configurable-option-2', 'import-configurable']; + foreach ($products as $sku) { + $product = $this->getProductBySku($sku); + $gallery = $product->getMediaGalleryImages(); + foreach ($gallery->getItems() as $item) { + $actual[$sku][] = $item->toArray(['file', 'label']); + } + } + $this->assertEquals($expected, $actual); + + $expected['import-configurable'] = [ + [ + 'file' => '/m/a/magento_image.jpg', + 'label' => 'Base Image Label - Configurable (fixturestore)', + ], + [ + 'file' => '/m/a/magento_small_image.jpg', + 'label' => 'Small Image Label - Configurable (fixturestore)', + ], + [ + 'file' => '/m/a/magento_thumbnail.jpg', + 'label' => 'Thumbnail Image Label - Configurable (fixturestore)', + ], + [ + 'file' => '/m/a/magento_additional_image_three.jpg', + 'label' => '', + ], + ]; + + $actual = []; + foreach ($products as $sku) { + $product = $this->getProductBySku($sku, 'fixturestore'); + $gallery = $product->getMediaGalleryImages(); + foreach ($gallery->getItems() as $item) { + $actual[$sku][] = $item->toArray(['file', 'label']); + } + } + $this->assertEquals($expected, $actual); + } } diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_configurable_product_multistore.csv b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_configurable_product_multistore.csv new file mode 100644 index 0000000000000..c13e9b10e90ae --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_configurable_product_multistore.csv @@ -0,0 +1,5 @@ +"sku","store_view_code","product_type","categories","name","base_image","base_image_label","thumbnail_image","thumbnail_image_label","small_image","small_image_label","additional_images","weight","product_online","tax_class_name","visibility","price","url_key","allow_backorders","min_cart_qty","max_cart_qty","is_in_stock","additional_attributes","configurable_variations","configurable_variation_labels","qty","attribute_set_code" +"import-configurable-option-1",,"simple","Default Category","import-configurable-option-1","magento_image.jpg","Base Image Label - Option 1","magento_thumbnail.jpg","Thumbnail Image Label - Option 1","magento_small_image.jpg","Small Image Label - Option 1","magento_additional_image_one.jpg","1","1","Taxable Goods","Not Visible Individually","14.99","import-configurable-option-1-key","0","1","10","1","test_configurable=Option 1",,,"100","Default" +"import-configurable-option-2",,"simple","Default Category","import-configurable-option-2","magento_image.jpg","Base Image Label - Option 2","magento_thumbnail.jpg","Thumbnail Image Label - Option 2","magento_small_image.jpg","Small Image Label - Option 2","magento_additional_image_two.jpg","1","1","Taxable Goods","Not Visible Individually","14.99","import-configurable-option-2-key","0","1","10","1","test_configurable=Option 2",,,"100","Default" +"import-configurable",,"configurable","Default Category","import-configurable","magento_image.jpg","Base Image Label - Configurable","magento_thumbnail.jpg","Thumbnail Image Label - Configurable","magento_small_image.jpg","Small Image Label - Configurable","magento_additional_image_three.jpg","1","1","Taxable Goods","Catalog, Search","14.99","import-configurable-key","0",,,,,"sku=import-configurable-option-1,test_configurable=Option 1|sku=import-configurable-option-2,test_configurable=Option 2","test_configurable=test_configurable=test_configurable",,"Default" +"import-configurable","fixturestore","configurable",,"import-configurable (fixturestore)","magento_image.jpg","Base Image Label - Configurable (fixturestore)","magento_thumbnail.jpg","Thumbnail Image Label - Configurable (fixturestore)","magento_small_image.jpg","Small Image Label - Configurable (fixturestore)",,,,,,,,,,,,,,,,"Default" From d4b68c72a1dd12db257f5eba6261f966a6d42e2f Mon Sep 17 00:00:00 2001 From: Gihovani Filipp <gihovani@gmail.com> Date: Fri, 20 Dec 2019 16:19:39 -0300 Subject: [PATCH 459/586] Remove blank space at the end of label Removed white space because in crowdin translation there is no space at end of text --- app/code/Magento/Cron/etc/adminhtml/system.xml | 2 +- app/code/Magento/Cron/i18n/en_US.csv | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Cron/etc/adminhtml/system.xml b/app/code/Magento/Cron/etc/adminhtml/system.xml index c8753f1b0b56f..cef45ba386be2 100644 --- a/app/code/Magento/Cron/etc/adminhtml/system.xml +++ b/app/code/Magento/Cron/etc/adminhtml/system.xml @@ -12,7 +12,7 @@ <label>Cron (Scheduled Tasks)</label> <comment>For correct URLs generated during cron runs please make sure that Web > Secure and Unsecure Base URLs are explicitly set. All the times are in minutes.</comment> <group id="template" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0"> - <label>Cron configuration options for group: </label> + <label>Cron configuration options for group:</label> <field id="schedule_generate_every" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1"> <label>Generate Schedules Every</label> <validate>validate-zero-or-greater validate-digits</validate> diff --git a/app/code/Magento/Cron/i18n/en_US.csv b/app/code/Magento/Cron/i18n/en_US.csv index b1969d7723315..df9aef7f13747 100644 --- a/app/code/Magento/Cron/i18n/en_US.csv +++ b/app/code/Magento/Cron/i18n/en_US.csv @@ -11,7 +11,7 @@ Monthly,Monthly "Test exception","Test exception" "Cron (Scheduled Tasks)","Cron (Scheduled Tasks)" "For correct URLs generated during cron runs please make sure that Web > Secure and Unsecure Base URLs are explicitly set. All the times are in minutes.","For correct URLs generated during cron runs please make sure that Web > Secure and Unsecure Base URLs are explicitly set. All the times are in minutes." -"Cron configuration options for group: ","Cron configuration options for group: " +"Cron configuration options for group:","Cron configuration options for group:" "Generate Schedules Every","Generate Schedules Every" "Schedule Ahead for","Schedule Ahead for" "Missed if Not Run Within","Missed if Not Run Within" From 0621d52235993e3eec4835490e1939af09137481 Mon Sep 17 00:00:00 2001 From: Ravi Chandra <ravi.chandra@krishtechnolabs.com> Date: Mon, 23 Dec 2019 10:34:31 +0530 Subject: [PATCH 460/586] Changing the data type for quote column customer_note --- app/code/Magento/Quote/etc/db_schema.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Quote/etc/db_schema.xml b/app/code/Magento/Quote/etc/db_schema.xml index d41591c619cde..44a5f275b4d9f 100644 --- a/app/code/Magento/Quote/etc/db_schema.xml +++ b/app/code/Magento/Quote/etc/db_schema.xml @@ -56,7 +56,7 @@ <column xsi:type="varchar" name="customer_lastname" nullable="true" length="255" comment="Customer Lastname"/> <column xsi:type="varchar" name="customer_suffix" nullable="true" length="40" comment="Customer Suffix"/> <column xsi:type="datetime" name="customer_dob" on_update="false" nullable="true" comment="Customer Dob"/> - <column xsi:type="varchar" name="customer_note" nullable="true" length="255" comment="Customer Note"/> + <column xsi:type="text" name="customer_note" nullable="true" comment="Customer Note"/> <column xsi:type="smallint" name="customer_note_notify" padding="5" unsigned="true" nullable="true" identity="false" default="1" comment="Customer Note Notify"/> <column xsi:type="smallint" name="customer_is_guest" padding="5" unsigned="true" nullable="true" From 20af9fcf6165ba42a70f9382a30ea7a92b53a7c8 Mon Sep 17 00:00:00 2001 From: Serhiy Yelahin <serhiy.yelahin@transoftgroup.com> Date: Mon, 23 Dec 2019 10:32:28 +0200 Subject: [PATCH 461/586] MC-29896: [QUESTION] Stretched Out Images --- .../view/frontend/web/template/product/image_with_borders.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/view/frontend/web/template/product/image_with_borders.html b/app/code/Magento/Catalog/view/frontend/web/template/product/image_with_borders.html index d59237c190f71..f8b8ede792566 100644 --- a/app/code/Magento/Catalog/view/frontend/web/template/product/image_with_borders.html +++ b/app/code/Magento/Catalog/view/frontend/web/template/product/image_with_borders.html @@ -6,6 +6,6 @@ --> <span class="product-image-container" data-bind="style: {width: width + 'px'}"> <span class="product-image-wrapper" data-bind="style: {'padding-bottom': height/width*100 + '%'}"> - <img class="product-image-photo" data-bind="attr: {src: src, alt: alt}, style: {width: width + 'px', height: height + 'px'}" /> + <img class="product-image-photo" data-bind="attr: {src: src, alt: alt}, style: {width: 'auto', height: 'auto'}" /> </span> </span> From 0802b480a0f29e3d9e609d33915abf8e4dbf2e10 Mon Sep 17 00:00:00 2001 From: divyajyothi5321 <54176640+divyajyothi5321@users.noreply.github.com> Date: Mon, 23 Dec 2019 14:09:27 +0530 Subject: [PATCH 462/586] added requested changes --- app/code/Magento/Wishlist/Controller/Index/Send.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Wishlist/Controller/Index/Send.php b/app/code/Magento/Wishlist/Controller/Index/Send.php index 2f1813cf886ed..283400a6f94ea 100644 --- a/app/code/Magento/Wishlist/Controller/Index/Send.php +++ b/app/code/Magento/Wishlist/Controller/Index/Send.php @@ -203,7 +203,7 @@ public function execute() $error = __('Please enter an email address.'); } else { if (count($emails) > $emailsLeft) { - $error = __('Maximum of %1 Emails can be Sent.', $emailsLeft); + $error = __('Maximum of %1 emails can be sent.', $emailsLeft); } else { foreach ($emails as $index => $email) { $email = trim($email); From c188e03da4049a7e610d7f2c41497138ff5b1255 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Mon, 23 Dec 2019 12:46:17 +0200 Subject: [PATCH 463/586] MC-25187: Session lost after switching stores on different domains --- .../Test/Mftf/Test/StorefrontShareWishlistEntityTest.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontShareWishlistEntityTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontShareWishlistEntityTest.xml index 87c5ed950949f..bb566ef2d03a4 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontShareWishlistEntityTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontShareWishlistEntityTest.xml @@ -26,6 +26,10 @@ <requiredEntity createDataKey="category"/> </createData> <createData entity="Simple_US_Customer" stepKey="customer"/> + + <!-- Perform reindex and flush cache --> + <magentoCLI command="indexer:reindex" stepKey="reindex"/> + <magentoCLI command="cache:flush" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="category" stepKey="deleteCategory"/> From 0c72dd4fa81554dda63c6354161a4351bb8a06cc Mon Sep 17 00:00:00 2001 From: Myroslav Dobra <dmaraptor@gmail.com> Date: Mon, 23 Dec 2019 15:28:15 +0200 Subject: [PATCH 464/586] MC-24268: MFTF\Integration\WebApi Tests failed if magento installed with 'db-prefix' --- .../Catalog/Model/Indexer/Category/Flat/Action/Full.php | 5 +++-- .../Catalog/Model/Indexer/Product/Flat/AbstractAction.php | 2 +- .../Model/ResourceModel/GetPurchasedDownloadableProducts.php | 4 ++-- .../Model/CategoryUrlRewriteGeneratorTest.php | 2 +- .../testsuite/Magento/Webapi/_files/webapi_user.php | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Indexer/Category/Flat/Action/Full.php b/app/code/Magento/Catalog/Model/Indexer/Category/Flat/Action/Full.php index a62e3d8f83b85..57fb3d64dea4a 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Category/Flat/Action/Full.php +++ b/app/code/Magento/Catalog/Model/Indexer/Category/Flat/Action/Full.php @@ -79,6 +79,7 @@ protected function populateFlatTables(array $stores) } $category['store_id'] = $store->getId(); $data[] = $this->prepareValuesToInsert( + // phpcs:ignore Magento2.Performance.ForeachArrayMerge array_merge($category, $attributesData[$category[$linkField]]) ); } @@ -183,7 +184,7 @@ private function getActualStoreTablesForCategoryFlat(): array foreach ($this->storeManager->getStores() as $store) { $actualStoreTables[] = sprintf( '%s_store_%s', - $this->connection->getTableName('catalog_category_flat'), + $this->connection->getTableName($this->getTableName('catalog_category_flat')), $store->getId() ); } @@ -199,7 +200,7 @@ private function getActualStoreTablesForCategoryFlat(): array private function deleteAbandonedStoreCategoryFlatTables(): void { $existentTables = $this->connection->getTables( - $this->connection->getTableName('catalog_category_flat_store_%') + $this->connection->getTableName($this->getTableName('catalog_category_flat_store_%')) ); $actualStoreTables = $this->getActualStoreTablesForCategoryFlat(); diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/AbstractAction.php b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/AbstractAction.php index a0acacd4dfd2f..565ac1b121980 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/AbstractAction.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/AbstractAction.php @@ -222,7 +222,7 @@ protected function _updateRelationProducts($storeId, $productIds = null) ['t' => $this->_productIndexerHelper->getTable($relation->getTable())], ['entity_table.entity_id', $relation->getChildFieldName(), new \Zend_Db_Expr('1')] )->join( - ['entity_table' => $this->_connection->getTableName('catalog_product_entity')], + ['entity_table' => $this->_productIndexerHelper->getTable('catalog_product_entity')], "entity_table.{$metadata->getLinkField()} = t.{$relation->getParentFieldName()}", [] )->join( diff --git a/app/code/Magento/DownloadableGraphQl/Model/ResourceModel/GetPurchasedDownloadableProducts.php b/app/code/Magento/DownloadableGraphQl/Model/ResourceModel/GetPurchasedDownloadableProducts.php index 82f448ec450f6..4bbdfdb360415 100644 --- a/app/code/Magento/DownloadableGraphQl/Model/ResourceModel/GetPurchasedDownloadableProducts.php +++ b/app/code/Magento/DownloadableGraphQl/Model/ResourceModel/GetPurchasedDownloadableProducts.php @@ -39,13 +39,13 @@ public function execute(int $customerId): array { $connection = $this->resourceConnection->getConnection(); $allowedItemsStatuses = [Item::LINK_STATUS_PENDING_PAYMENT, Item::LINK_STATUS_PAYMENT_REVIEW]; - $downloadablePurchasedTable = $connection->getTableName('downloadable_link_purchased'); + $downloadablePurchasedTable = $this->resourceConnection->getTableName('downloadable_link_purchased'); /* The fields names are hardcoded since there's no existing name reference in the code */ $selectQuery = $connection->select() ->from($downloadablePurchasedTable) ->joinLeft( - ['item' => $connection->getTableName('downloadable_link_purchased_item')], + ['item' => $this->resourceConnection->getTableName('downloadable_link_purchased_item')], "$downloadablePurchasedTable.purchased_id = item.purchased_id" ) ->where("$downloadablePurchasedTable.customer_id = ?", $customerId) diff --git a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/CategoryUrlRewriteGeneratorTest.php b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/CategoryUrlRewriteGeneratorTest.php index b6fa2fac2ca80..67a1e0bb43ecb 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/CategoryUrlRewriteGeneratorTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/CategoryUrlRewriteGeneratorTest.php @@ -351,7 +351,7 @@ private function getCountOfRewrites($productId, $categoryId): string $model = $this->objectManager->get(Product::class); $connection = $model->getConnection(); $select = $connection->select(); - $select->from(Product::TABLE_NAME, 'COUNT(*)'); + $select->from($model->getTable(Product::TABLE_NAME), 'COUNT(*)'); $select->where('category_id = ?', $categoryId); $select->where('product_id = ?', $productId); return $connection->fetchOne($select); diff --git a/dev/tests/integration/testsuite/Magento/Webapi/_files/webapi_user.php b/dev/tests/integration/testsuite/Magento/Webapi/_files/webapi_user.php index 63479bee9cf6d..50204998c7da3 100644 --- a/dev/tests/integration/testsuite/Magento/Webapi/_files/webapi_user.php +++ b/dev/tests/integration/testsuite/Magento/Webapi/_files/webapi_user.php @@ -15,7 +15,7 @@ ->create(Magento\Framework\App\ResourceConnection::class); $adapter = $connection->getConnection(); $select = $adapter->select() - ->from('authorization_role', ['role_id']) + ->from($connection->getTableName('authorization_role'), ['role_id']) ->where('role_name = ?', 'Administrators') ->where('parent_id = ?', 0) ->limit(1); From 526817cb1919b722eeb3c27562ed277b7530fb20 Mon Sep 17 00:00:00 2001 From: Yaroslav Rogoza <enarc@atwix.com> Date: Mon, 23 Dec 2019 17:57:26 +0100 Subject: [PATCH 465/586] Jasmine test coverage --- .../lib/jquery/jstree/jquery.hotkeys.test.js | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 dev/tests/js/jasmine/tests/lib/jquery/jstree/jquery.hotkeys.test.js diff --git a/dev/tests/js/jasmine/tests/lib/jquery/jstree/jquery.hotkeys.test.js b/dev/tests/js/jasmine/tests/lib/jquery/jstree/jquery.hotkeys.test.js new file mode 100644 index 0000000000000..b9d8ab1d4a82c --- /dev/null +++ b/dev/tests/js/jasmine/tests/lib/jquery/jstree/jquery.hotkeys.test.js @@ -0,0 +1,73 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +define([ + 'jquery', + 'jquery/jstree/jquery.hotkeys' +], function ($) { + 'use strict'; + + describe('Test for jquery/jstree/jquery.hotkeys', function () { + var divElement = $('<div></div>'), + divBodyAfterTrigger = 'pressed', + inputNumberElement = $('<input type="number">'); + + beforeAll(function () { + $(document).bind('keyup', 'right', function () { + // Change element body to track a trigger action + divElement.html(divBodyAfterTrigger); + }); + + $(document).bind('keyup', 'left', function () { + // Change element body to track a trigger action + divElement.html(divBodyAfterTrigger); + }); + + }); + + beforeEach(function () { + inputNumberElement.appendTo(document.body); + divElement.appendTo(document.body); + }); + + afterEach(function () { + divElement.remove(); + inputNumberElement.remove(); + }); + + it('Check "left key" hotkey is not being processed when number input is focused', function () { + var keypress = $.Event("keyup"); + keypress.which = 37; // "left arrow" key + inputNumberElement.trigger(keypress); + + expect(divElement.html()).toEqual(''); + }); + + it('Check "right key" hotkey is not being processed when number input is focused', function () { + var keypress = $.Event("keyup"); + keypress.which = 39; // "right arrow" key + inputNumberElement.trigger(keypress); + + expect(divElement.html()).toEqual(''); + }); + + it('Check "left key" hotkey is being processed when registered on the page', function () { + var keypress = $.Event("keyup"); + keypress.which = 37; // "left arrow" key + divElement.trigger(keypress); + + expect(divElement.html()).toEqual(divBodyAfterTrigger); + }); + + it('Check "right key" hotkey is being processed when registered on the page', function () { + var keypress = $.Event("keyup"); + keypress.which = 39; // "right arrow" key + $('body').trigger(keypress); + + expect(divElement.html()).toEqual(divBodyAfterTrigger); + }); + + }); +}); From 80398d0386391c0d5f626c3dc9f774fecf6c6b98 Mon Sep 17 00:00:00 2001 From: pawankparmar <comp1@comp1-All-Series> Date: Tue, 24 Dec 2019 10:44:54 +0530 Subject: [PATCH 466/586] Adjust space b/w Short and Long Description --- .../Api/Data/ProductRender/FormattedPriceInfoInterface.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/code/Magento/Catalog/Api/Data/ProductRender/FormattedPriceInfoInterface.php b/app/code/Magento/Catalog/Api/Data/ProductRender/FormattedPriceInfoInterface.php index 65ff84ef719f0..abcc4bfe4ede2 100644 --- a/app/code/Magento/Catalog/Api/Data/ProductRender/FormattedPriceInfoInterface.php +++ b/app/code/Magento/Catalog/Api/Data/ProductRender/FormattedPriceInfoInterface.php @@ -29,6 +29,7 @@ public function getFinalPrice(); /** * Set the final price: usually it calculated as minimal price of the product + * * Can be different depends on type of product * * @param string $finalPrice @@ -39,6 +40,7 @@ public function setFinalPrice($finalPrice); /** * Retrieve max price of a product + * * E.g. for product with custom options is price with the most expensive custom option * * @return string @@ -57,6 +59,7 @@ public function setMaxPrice($maxPrice); /** * Retrieve the minimal price of the product or variation + * * The minimal price is for example, the lowest price of all variations for complex product * * @return string @@ -130,6 +133,7 @@ public function setMinimalPrice($minimalPrice); /** * Regular price - is price of product without discounts and special price with taxes and fixed product tax + * * Usually this price is corresponding to price in admin panel of product * * @return string From f49510b06beda972ae031a2a53764ff9cd14592d Mon Sep 17 00:00:00 2001 From: pawankparmar <comp1@comp1-All-Series> Date: Tue, 24 Dec 2019 11:49:02 +0530 Subject: [PATCH 467/586] Remove Whitespace --- .../Data/ProductRender/FormattedPriceInfoInterface.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Catalog/Api/Data/ProductRender/FormattedPriceInfoInterface.php b/app/code/Magento/Catalog/Api/Data/ProductRender/FormattedPriceInfoInterface.php index abcc4bfe4ede2..d111de1b04b94 100644 --- a/app/code/Magento/Catalog/Api/Data/ProductRender/FormattedPriceInfoInterface.php +++ b/app/code/Magento/Catalog/Api/Data/ProductRender/FormattedPriceInfoInterface.php @@ -29,7 +29,7 @@ public function getFinalPrice(); /** * Set the final price: usually it calculated as minimal price of the product - * + * * Can be different depends on type of product * * @param string $finalPrice @@ -40,7 +40,7 @@ public function setFinalPrice($finalPrice); /** * Retrieve max price of a product - * + * * E.g. for product with custom options is price with the most expensive custom option * * @return string @@ -59,7 +59,7 @@ public function setMaxPrice($maxPrice); /** * Retrieve the minimal price of the product or variation - * + * * The minimal price is for example, the lowest price of all variations for complex product * * @return string @@ -133,7 +133,7 @@ public function setMinimalPrice($minimalPrice); /** * Regular price - is price of product without discounts and special price with taxes and fixed product tax - * + * * Usually this price is corresponding to price in admin panel of product * * @return string From e50c17fb6f3adb9271712a3d025b321798cc6be3 Mon Sep 17 00:00:00 2001 From: Viktor Petryk <victor.petryk@transoftgroup.com> Date: Tue, 24 Dec 2019 09:31:06 +0200 Subject: [PATCH 468/586] MC-29023: Custom attribute values cannot be saved in Admin panel --- .../Product/AddAttributeToTemplate.php | 18 +++- ...nExpandProductAttributesTabActionGroup.xml | 19 ++++ ...nPresentInLayeredNavigationActionGroup.xml | 26 ++++++ .../StorefrontCategorySidebarSection.xml | 4 +- ...tomAttributeValuesAfterProductSaveTest.xml | 91 +++++++++++++++++++ 5 files changed, 153 insertions(+), 5 deletions(-) create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminExpandProductAttributesTabActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontAttributeOptionPresentInLayeredNavigationActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckCustomAttributeValuesAfterProductSaveTest.xml diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/AddAttributeToTemplate.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/AddAttributeToTemplate.php index a05602403e08f..21312e4614dc3 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/AddAttributeToTemplate.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/AddAttributeToTemplate.php @@ -17,9 +17,11 @@ use Magento\Eav\Api\Data\AttributeGroupInterfaceFactory; use Magento\Eav\Api\Data\AttributeInterface; use Magento\Eav\Api\Data\AttributeSetInterface; +use Magento\Eav\Model\Cache\Type as CacheType; use Magento\Framework\Api\ExtensionAttributesFactory; use Magento\Framework\Api\SearchCriteriaBuilder; use Magento\Framework\App\Action\HttpPostActionInterface; +use Magento\Framework\App\CacheInterface; use Magento\Framework\App\ObjectManager; use Magento\Framework\Controller\Result\Json; use Magento\Framework\Controller\Result\JsonFactory; @@ -29,7 +31,7 @@ use Psr\Log\LoggerInterface; /** - * Class AddAttributeToTemplate + * Assign attribute to attribute set. * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ @@ -80,6 +82,11 @@ class AddAttributeToTemplate extends Product implements HttpPostActionInterface */ protected $extensionAttributesFactory; + /** + * @var CacheInterface + */ + private $cache; + /** * Constructor * @@ -94,8 +101,8 @@ class AddAttributeToTemplate extends Product implements HttpPostActionInterface * @param AttributeManagementInterface $attributeManagement * @param LoggerInterface $logger * @param ExtensionAttributesFactory $extensionAttributesFactory + * @param CacheInterface|null $cache * @SuppressWarnings(PHPMD.ExcessiveParameterList) - * @SuppressWarnings(PHPMD.LongVariable) * @SuppressWarnings(PHPMD.NPathComplexity) */ public function __construct( @@ -109,7 +116,8 @@ public function __construct( SearchCriteriaBuilder $searchCriteriaBuilder = null, AttributeManagementInterface $attributeManagement = null, LoggerInterface $logger = null, - ExtensionAttributesFactory $extensionAttributesFactory = null + ExtensionAttributesFactory $extensionAttributesFactory = null, + CacheInterface $cache = null ) { parent::__construct($context, $productBuilder); $this->resultJsonFactory = $resultJsonFactory; @@ -129,6 +137,7 @@ public function __construct( ->get(LoggerInterface::class); $this->extensionAttributesFactory = $extensionAttributesFactory ?: ObjectManager::getInstance() ->get(ExtensionAttributesFactory::class); + $this->cache = $cache ?? ObjectManager::getInstance()->get(CacheInterface::class); } /** @@ -203,6 +212,7 @@ function (AttributeInterface $attribute) use ($attributeSet, $attributeGroup) { ); } ); + $this->cache->clean([CacheType::CACHE_TAG]); } catch (LocalizedException $e) { $response->setError(true); $response->setMessage($e->getMessage()); @@ -223,7 +233,7 @@ function (AttributeInterface $attribute) use ($attributeSet, $attributeGroup) { */ private function getBasicAttributeSearchCriteriaBuilder() { - $attributeIds = (array) $this->getRequest()->getParam('attributeIds', []); + $attributeIds = (array)$this->getRequest()->getParam('attributeIds', []); if (empty($attributeIds['selected'])) { throw new LocalizedException(__('Attributes were missing and must be specified.')); diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminExpandProductAttributesTabActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminExpandProductAttributesTabActionGroup.xml new file mode 100644 index 0000000000000..a423681c0a490 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminExpandProductAttributesTabActionGroup.xml @@ -0,0 +1,19 @@ +<?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="AdminExpandProductAttributesTabActionGroup"> + <annotations> + <description>Expands the 'Attributes' tab on the Admin Product page.</description> + </annotations> + + <scrollTo selector="{{AdminProductAttributeSection.attributeSectionHeader}}" stepKey="scrollToAttributesTab"/> + <conditionalClick selector="{{AdminProductAttributeSection.attributeSectionHeader}}" dependentSelector="{{AdminProductAttributeSection.attributeSection}}" visible="false" stepKey="expandAttributesTab"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontAttributeOptionPresentInLayeredNavigationActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontAttributeOptionPresentInLayeredNavigationActionGroup.xml new file mode 100644 index 0000000000000..46d017b9094e8 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontAttributeOptionPresentInLayeredNavigationActionGroup.xml @@ -0,0 +1,26 @@ +<?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="AssertStorefrontAttributeOptionPresentInLayeredNavigationActionGroup"> + <annotations> + <description>Clicks on the attribute label. Checks for attribute option presence.</description> + </annotations> + <arguments> + <argument name="attributeLabel" type="string" defaultValue="{{ProductAttributeFrontendLabel.label}}"/> + <argument name="attributeOptionLabel" type="string" defaultValue="{{Option1Store0.label}}"/> + <argument name="attributeOptionPosition" type="string" defaultValue="1"/> + </arguments> + + <waitForElementVisible selector="{{StorefrontCategorySidebarSection.filterOptionsTitle(attributeLabel)}}" stepKey="waitForAttributeVisible"/> + <conditionalClick selector="{{StorefrontCategorySidebarSection.filterOptionsTitle(attributeLabel)}}" dependentSelector="{{StorefrontCategorySidebarSection.activeFilterOptions}}" visible="false" stepKey="clickToExpandAttribute"/> + <waitForElementVisible selector="{{StorefrontCategorySidebarSection.activeFilterOptions}}" stepKey="waitForAttributeOptionsVisible"/> + <see selector="{{StorefrontCategorySidebarSection.activeFilterOptionItemByPosition(attributeOptionPosition)}}" userInput="{{attributeOptionLabel}}" stepKey="assertAttributeOptionInLayeredNavigation"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategorySidebarSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategorySidebarSection.xml index 2ec7997f87b7e..d629441782551 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategorySidebarSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategorySidebarSection.xml @@ -15,8 +15,10 @@ <element name="optionQty" type="text" selector=".filter-options-content .item .count"/> <element name="filterOptionByLabel" type="button" selector=" div.filter-options-item div[option-label='{{optionLabel}}']" parameterized="true"/> <element name="removeFilter" type="button" selector="div.filter-current .remove"/> + <element name="activeFilterOptions" type="text" selector=".filter-options-item.active .items"/> + <element name="activeFilterOptionItemByPosition" type="text" selector=".filter-options-item.active .items li:nth-child({{itemPosition}}) a" parameterized="true"/> </section> <section name="StorefrontCategorySidebarMobileSection"> <element name="shopByButton" type="button" selector="//div[contains(@class, 'filter-title')]/strong[contains(text(), 'Shop By')]"/> </section> -</sections> \ No newline at end of file +</sections> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckCustomAttributeValuesAfterProductSaveTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckCustomAttributeValuesAfterProductSaveTest.xml new file mode 100644 index 0000000000000..7c6f6ab66f63d --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckCustomAttributeValuesAfterProductSaveTest.xml @@ -0,0 +1,91 @@ +<?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="AdminCheckCustomAttributeValuesAfterProductSaveTest"> + <annotations> + <features value="Catalog"/> + <stories value="Product attributes"/> + <title value="Saving custom attribute values using UI"/> + <description value="Checks that saved custom attribute values are reflected on the product's edit page"/> + <severity value="MAJOR"/> + <testCaseId value="MC-29653"/> + <useCaseId value="MC-29023"/> + <group value="catalog"/> + </annotations> + <before> + <!-- Create multi select product attribute --> + <createData entity="productAttributeMultiselectTwoOptions" stepKey="createMultiSelectProductAttribute"/> + <!-- Add options to created product attribute --> + <createData entity="productAttributeOption1" stepKey="addFirstOptionToAttribute"> + <requiredEntity createDataKey="createMultiSelectProductAttribute"/> + </createData> + <createData entity="productAttributeOption2" stepKey="addSecondOptionToAttribute"> + <requiredEntity createDataKey="createMultiSelectProductAttribute"/> + </createData> + <createData entity="productAttributeOption3" stepKey="addThirdOptionToAttribute"> + <requiredEntity createDataKey="createMultiSelectProductAttribute"/> + </createData> + <!-- Create simple product --> + <createData entity="SimpleProduct2" stepKey="createSimpleProduct"/> + <magentoCLI command="indexer:reindex" arguments="catalogsearch_fulltext" stepKey="reindexCatalogSearch"/> + <!-- Login to Admin page --> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + </before> + <after> + <!-- Delete created entities --> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> + <deleteData createDataKey="createMultiSelectProductAttribute" stepKey="deleteMultiSelectProductAttribute"/> + <!-- Logout from Admin page --> + <actionGroup ref="logout" stepKey="logoutFromAdmin"/> + </after> + + <!-- Open created product for edit --> + <amOnPage url="{{AdminProductEditPage.url($createSimpleProduct.id$)}}" stepKey="goToProductEditPage"/> + <waitForPageLoad stepKey="waitForProductPageLoad"/> + + <!-- Add created attribute to the product --> + <actionGroup ref="AddProductAttributeInProductModalActionGroup" stepKey="addAttributeToProduct"> + <argument name="attributeCode" value="$createMultiSelectProductAttribute.attribute_code$"/> + </actionGroup> + <waitForPageLoad stepKey="waitForAttributeAdded"/> + + <!-- Expand 'Attributes' tab --> + <actionGroup ref="AdminExpandProductAttributesTabActionGroup" stepKey="expandAttributesTab"/> + <!-- Check created attribute presents in the 'Attributes' tab --> + <seeElement selector="{{AdminProductAttributesSection.attributeDropdownByCode($createMultiSelectProductAttribute.attribute_code$)}}" stepKey="assertAttributeIsPresentInTab"/> + <!-- Select attribute options --> + <selectOption selector="{{AdminProductAttributesSection.attributeDropdownByCode($createMultiSelectProductAttribute.attribute_code$)}}" parameterArray="[$addFirstOptionToAttribute.option[store_labels][0][label]$, $addThirdOptionToAttribute.option[store_labels][0][label]$]" stepKey="selectAttributeOptions"/> + <!-- Save product --> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> + + <!-- Check attribute options are selected --> + <actionGroup ref="AdminExpandProductAttributesTabActionGroup" stepKey="expandAttributesTabAfterProductSave"/> + <seeOptionIsSelected selector="{{AdminProductAttributesSection.attributeDropdownByCode($createMultiSelectProductAttribute.attribute_code$)}}" userInput="$addFirstOptionToAttribute.option[store_labels][0][label]$" stepKey="assertFirstOptionIsSelected"/> + <seeOptionIsSelected selector="{{AdminProductAttributesSection.attributeDropdownByCode($createMultiSelectProductAttribute.attribute_code$)}}" userInput="$addThirdOptionToAttribute.option[store_labels][0][label]$" stepKey="assertThirdOptionIsSelected"/> + + <!-- Search for the product on Storefront --> + <amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToHomePage"/> + <waitForPageLoad stepKey="waitForHomePageLoad"/> + <actionGroup ref="StorefrontCheckQuickSearchActionGroup" stepKey="searchProductOnStorefront"> + <argument name="phrase" value="$createSimpleProduct.name$"/> + </actionGroup> + + <!-- Assert that attribute values present in layered navigation --> + <actionGroup ref="AssertStorefrontAttributeOptionPresentInLayeredNavigationActionGroup" stepKey="assertFirstAttributeOptionPresence"> + <argument name="attributeLabel" value="$createMultiSelectProductAttribute.attribute[frontend_labels][0][label]$"/> + <argument name="attributeOptionLabel" value="$addFirstOptionToAttribute.option[store_labels][0][label]$"/> + <argument name="attributeOptionPosition" value="1"/> + </actionGroup> + <actionGroup ref="AssertStorefrontAttributeOptionPresentInLayeredNavigationActionGroup" stepKey="assertThirdAttributeOptionPresence"> + <argument name="attributeLabel" value="$createMultiSelectProductAttribute.attribute[frontend_labels][0][label]$"/> + <argument name="attributeOptionLabel" value="$addThirdOptionToAttribute.option[store_labels][0][label]$"/> + <argument name="attributeOptionPosition" value="2"/> + </actionGroup> + </test> +</tests> From 9882e96dab666d5609e47af52d7130e5c33a7a6c Mon Sep 17 00:00:00 2001 From: divyajyothi5321 <54176640+divyajyothi5321@users.noreply.github.com> Date: Tue, 24 Dec 2019 14:24:55 +0530 Subject: [PATCH 469/586] Added Fix for issue 26168 --- .../web/css/source/module/checkout/_payments.less | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_payments.less b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_payments.less index eb9c069053661..494483ff60dda 100644 --- a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_payments.less +++ b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_payments.less @@ -133,6 +133,10 @@ .lib-css(line-height, @checkout-billing-address-details__line-height); .lib-css(padding, @checkout-billing-address-details__padding); } + + input[type="checkbox"] { + vertical-align: top; + } } .payment-method-note { From a729f62278afff3c79cdfb7998a1f5a8446b3d0a Mon Sep 17 00:00:00 2001 From: Myroslav Dobra <dmaraptor@gmail.com> Date: Tue, 24 Dec 2019 12:35:44 +0200 Subject: [PATCH 470/586] MC-24239: [Integration Test] CategoryTree::getTree() returns all the child categories --- .../integration/testsuite/Magento/Sales/_files/quotes.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/quotes.php b/dev/tests/integration/testsuite/Magento/Sales/_files/quotes.php index 508563df2d5c0..bd0ae81b15862 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/_files/quotes.php +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/quotes.php @@ -5,6 +5,7 @@ */ declare(strict_types=1); +use Magento\Framework\App\Config; use Magento\Store\Model\StoreRepository; use Magento\Quote\Model\QuoteFactory; use Magento\Quote\Model\Quote; @@ -23,6 +24,9 @@ $quoteRepository = $objectManager->get(QuoteRepository::class); /** @var StoreRepository $storeRepository */ $storeRepository = $objectManager->get(StoreRepository::class); +/** @var Config $appConfig */ +$appConfig = $objectManager->get(Config::class); +$appConfig->clean(); /** @var Store $defaultStore */ $defaultStore = $storeRepository->getActiveStoreByCode('default'); From 216d2c127c311244f52b5530286b2679488ed033 Mon Sep 17 00:00:00 2001 From: divyajyothi5321 <54176640+divyajyothi5321@users.noreply.github.com> Date: Tue, 24 Dec 2019 18:12:20 +0530 Subject: [PATCH 471/586] Added Fix for 26164 --- .../luma/Magento_Checkout/web/css/source/module/_cart.less | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_cart.less b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_cart.less index cbf1d185a5a08..87990c3e48280 100644 --- a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_cart.less +++ b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_cart.less @@ -267,6 +267,10 @@ .lib-icon-font-symbol( @_icon-font-content: @icon-trash ); + + &:hover { + .lib-css(text-decoration, @link__text-decoration); + } } } From 666d4c0ff2b3a498d97acd101ae1ec86592bee70 Mon Sep 17 00:00:00 2001 From: Ravi Chandra <ravi.chandra@krishtechnolabs.com> Date: Tue, 24 Dec 2019 18:29:37 +0530 Subject: [PATCH 472/586] Fixed Special Price class not added in configurable product page --- app/code/Magento/Swatches/view/base/web/js/swatch-renderer.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/Magento/Swatches/view/base/web/js/swatch-renderer.js b/app/code/Magento/Swatches/view/base/web/js/swatch-renderer.js index 894a4518f4de8..c80962a44d0dc 100644 --- a/app/code/Magento/Swatches/view/base/web/js/swatch-renderer.js +++ b/app/code/Magento/Swatches/view/base/web/js/swatch-renderer.js @@ -952,6 +952,8 @@ define([ isShow = typeof result != 'undefined' && result.oldPrice.amount !== result.finalPrice.amount; + $productPrice.find('span:first').toggleClass('special-price',isShow); + $product.find(this.options.slyOldPriceSelector)[isShow ? 'show' : 'hide'](); if (typeof result != 'undefined' && result.tierPrices && result.tierPrices.length) { From c0373016d4da3e154f7a65cbe2987cc5319fe6b5 Mon Sep 17 00:00:00 2001 From: Yaroslav Rogoza <enarc@atwix.com> Date: Tue, 24 Dec 2019 17:30:27 +0100 Subject: [PATCH 473/586] Code style fixes --- .../lib/jquery/jstree/jquery.hotkeys.test.js | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/dev/tests/js/jasmine/tests/lib/jquery/jstree/jquery.hotkeys.test.js b/dev/tests/js/jasmine/tests/lib/jquery/jstree/jquery.hotkeys.test.js index b9d8ab1d4a82c..6041b70abc7f7 100644 --- a/dev/tests/js/jasmine/tests/lib/jquery/jstree/jquery.hotkeys.test.js +++ b/dev/tests/js/jasmine/tests/lib/jquery/jstree/jquery.hotkeys.test.js @@ -15,15 +15,15 @@ define([ inputNumberElement = $('<input type="number">'); beforeAll(function () { - $(document).bind('keyup', 'right', function () { - // Change element body to track a trigger action + /** + * Insert text to the divElement + */ + var addHtmlToDivElement = function () { divElement.html(divBodyAfterTrigger); - }); + }; - $(document).bind('keyup', 'left', function () { - // Change element body to track a trigger action - divElement.html(divBodyAfterTrigger); - }); + $(document).bind('keyup', 'right', addHtmlToDivElement); + $(document).bind('keyup', 'left', addHtmlToDivElement); }); @@ -38,7 +38,8 @@ define([ }); it('Check "left key" hotkey is not being processed when number input is focused', function () { - var keypress = $.Event("keyup"); + var keypress = $.Event('keyup'); + keypress.which = 37; // "left arrow" key inputNumberElement.trigger(keypress); @@ -46,7 +47,8 @@ define([ }); it('Check "right key" hotkey is not being processed when number input is focused', function () { - var keypress = $.Event("keyup"); + var keypress = $.Event('keyup'); + keypress.which = 39; // "right arrow" key inputNumberElement.trigger(keypress); @@ -54,7 +56,8 @@ define([ }); it('Check "left key" hotkey is being processed when registered on the page', function () { - var keypress = $.Event("keyup"); + var keypress = $.Event('keyup'); + keypress.which = 37; // "left arrow" key divElement.trigger(keypress); @@ -62,7 +65,8 @@ define([ }); it('Check "right key" hotkey is being processed when registered on the page', function () { - var keypress = $.Event("keyup"); + var keypress = $.Event('keyup'); + keypress.which = 39; // "right arrow" key $('body').trigger(keypress); From feceb401df48f199acc2b5a7f7e1a0a5400a65bc Mon Sep 17 00:00:00 2001 From: DmitryTsymbal <d.tsymbal@atwix.com> Date: Wed, 25 Dec 2019 18:39:12 +0200 Subject: [PATCH 474/586] Delete Product URL Rewrite --- ...AdminDeleteProductURLRewriteEntityTest.xml | 57 +++++++++++++++++++ .../DeleteProductUrlRewriteEntityTest.xml | 1 + 2 files changed, 58 insertions(+) create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteProductURLRewriteEntityTest.xml diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteProductURLRewriteEntityTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteProductURLRewriteEntityTest.xml new file mode 100644 index 0000000000000..f9c57a0c0bf4c --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteProductURLRewriteEntityTest.xml @@ -0,0 +1,57 @@ +<?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="AdminDeleteProductURLRewriteEntityTest"> + <annotations> + <stories value="Delete Product UrlRewrite"/> + <title value="Delete created product URL rewrite"/> + <description value="Login as admin, create product with category and UrlRewrite, delete created URL rewrite"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <createData entity="SimpleSubCategory" stepKey="createCategory"/> + <createData entity="SimpleProduct" stepKey="createSimpleProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + </before> + <after> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!--Filter and Select the created Product --> + <actionGroup ref="AdminSearchUrlRewriteProductBySkuActionGroup" stepKey="searchProduct"> + <argument name="productSku" value="$$createSimpleProduct.sku$$"/> + </actionGroup> + + <!-- Update the Store, RequestPath, RedirectType and Description --> + <actionGroup ref="AdminAddUrlRewriteForProductActionGroup" stepKey="addUrlRewrite"> + <argument name="storeValue" value="Default Store View"/> + <argument name="requestPath" value="{{FirstLevelSubCat.name_lwr}}/{{_defaultProduct.urlKey}}.html"/> + <argument name="redirectTypeValue" value="Temporary (302)"/> + <argument name="description" value="End To End Test"/> + </actionGroup> + + <!--Delete Created Rewrite, Assert Success Message --> + <actionGroup ref="AdminDeleteUrlRewriteActionGroup" stepKey="deleteCreatedRewrite"> + <argument name="requestPath" value="{{FirstLevelSubCat.name_lwr}}/{{_defaultProduct.urlKey}}.html"/> + </actionGroup> + <!-- Assert Deleted Rewrite is Not in Grid --> + <actionGroup ref="AdminSearchDeletedUrlRewriteActionGroup" stepKey="searchDeletedURLRewriteInGrid"> + <argument name="requestPath" value="{{FirstLevelSubCat.name_lwr}}/{{_defaultProduct.urlKey}}.html"/> + </actionGroup> + <!-- Assert Page By Url Rewrite is Not Found --> + <actionGroup ref="AssertPageByUrlRewriteIsNotFoundActionGroup" stepKey="amOnPage"> + <argument name="requestPath" value="{{FirstLevelSubCat.name_lwr}}/{{_defaultProduct.urlKey}}.html"/> + </actionGroup> + </test> +</tests> diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/DeleteProductUrlRewriteEntityTest.xml b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/DeleteProductUrlRewriteEntityTest.xml index 7a98f463072cb..7e8f8729716b0 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/DeleteProductUrlRewriteEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/DeleteProductUrlRewriteEntityTest.xml @@ -8,6 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\UrlRewrite\Test\TestCase\DeleteProductUrlRewriteEntityTest" summary="Delete Product URL Rewrites" ticketId="MAGETWO-23287"> <variation name="DeleteProductUrlRewriteEntityTestVariation1"> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> <data name="productRedirect/dataset" xsi:type="string">default_without_target</data> <data name="productRedirect/data/target_path/entity" xsi:type="string">product/%catalogProductSimple::product_100_dollar%</data> <constraint name="Magento\UrlRewrite\Test\Constraint\AssertUrlRewriteDeletedMessage" /> From 715af4f65e9f63a89e8ca41cd0be41b98541f08d Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Wed, 25 Dec 2019 20:49:28 -0600 Subject: [PATCH 475/586] Update StorefrontFotoramaArrowsTest.xml Fix action group according to changes in mainline --- .../Catalog/Test/Mftf/Test/StorefrontFotoramaArrowsTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontFotoramaArrowsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontFotoramaArrowsTest.xml index 25d1dcedea0d5..239ec975a9663 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontFotoramaArrowsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontFotoramaArrowsTest.xml @@ -47,7 +47,7 @@ <actionGroup ref="addProductImage" stepKey="addThirdImageToProduct"> <argument name="image" value="TestImageNew"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveSimpleProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSimpleProduct"/> <!-- Assert product in storefront product page --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openCreatedProductPage"> From 56a0f6cc582b4dc0e24beb10286ad4de4de06cc1 Mon Sep 17 00:00:00 2001 From: Serhii Voloshkov <serhii.voloshkov@transoftgroup.com> Date: Thu, 26 Dec 2019 09:24:36 +0200 Subject: [PATCH 476/586] MC-29967: [Braintree] Place Order button is not disabled --- .../js/view/payment/method-renderer/vault.js | 18 +++ .../frontend/web/template/payment/form.html | 5 +- .../payment/method-renderer/vault.test.js | 123 ++++++++++++++++++ 3 files changed, 145 insertions(+), 1 deletion(-) create mode 100644 dev/tests/js/jasmine/tests/app/code/Magento/Vault/view/frontend/web/js/view/payment/method-renderer/vault.test.js diff --git a/app/code/Magento/Vault/view/frontend/web/js/view/payment/method-renderer/vault.js b/app/code/Magento/Vault/view/frontend/web/js/view/payment/method-renderer/vault.js index 732bd4961f4fc..9a2e75f6c07d1 100644 --- a/app/code/Magento/Vault/view/frontend/web/js/view/payment/method-renderer/vault.js +++ b/app/code/Magento/Vault/view/frontend/web/js/view/payment/method-renderer/vault.js @@ -104,6 +104,24 @@ define( : false; }, + /** + * Return state of place order button. + * + * @return {Boolean} + */ + isButtonActive: function () { + return this.isActive() && this.isPlaceOrderActionAllowed(); + }, + + /** + * Check if payment is active. + * + * @return {Boolean} + */ + isActive: function () { + return this.isChecked() === this.getId(); + }, + /** * @returns {*} */ diff --git a/app/code/Magento/Vault/view/frontend/web/template/payment/form.html b/app/code/Magento/Vault/view/frontend/web/template/payment/form.html index 5f32281686a65..98c0fbfb00177 100644 --- a/app/code/Magento/Vault/view/frontend/web/template/payment/form.html +++ b/app/code/Magento/Vault/view/frontend/web/template/payment/form.html @@ -49,7 +49,10 @@ type="submit" data-bind=" click: placeOrder, - attr: {title: $t('Place Order')}"> + attr: {title: $t('Place Order')}, + enable: isButtonActive() + " + disabled> <span translate="'Place Order'"></span> </button> </div> diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Vault/view/frontend/web/js/view/payment/method-renderer/vault.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Vault/view/frontend/web/js/view/payment/method-renderer/vault.test.js new file mode 100644 index 0000000000000..f24d8d085da5c --- /dev/null +++ b/dev/tests/js/jasmine/tests/app/code/Magento/Vault/view/frontend/web/js/view/payment/method-renderer/vault.test.js @@ -0,0 +1,123 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +define([ + 'squire', + 'ko' +], function (Squire, ko) { + 'use strict'; + + var injector = new Squire(), + vault, + mocks = { + 'Magento_Checkout/js/model/checkout-data-resolver': { + resolveBillingAddress: jasmine.createSpy().and.returnValue(true) + }, + 'Magento_Checkout/js/checkout-data': { + setSelectedPaymentMethod: jasmine.createSpy().and.returnValue(false) + }, + 'Magento_Checkout/js/model/quote': { + billingAddress: ko.observable(null), + shippingAddress: ko.observable(null), + paymentMethod: ko.observable(null), + totals: ko.observable({}) + } + }, + billingAddress = { + city: 'Culver City', + company: 'Magento', + country_id: 'US',// jscs:ignore requireCamelCaseOrUpperCaseIdentifiers + firstname: 'John', + lastname: 'Doe', + postcode: '90230', + region: '', + region_id: '12',// jscs:ignore requireCamelCaseOrUpperCaseIdentifiers + street: { + 0: '6161 West Centinela Avenue', + 1: '' + }, + telephone: '+15555555555' + }; + + beforeEach(function (done) { + window.checkoutConfig = { + quoteData: { + /* jscs:disable requireCamelCaseOrUpperCaseIdentifiers */ + entity_Id: 1 + }, + formKey: 'formKey' + }; + injector.mock(mocks); + injector.require(['Magento_Vault/js/view/payment/method-renderer/vault'], function (Constr) { + var params = { + index: 'vaultIndex', + item: { + method: 'vault' + } + }; + + vault = new Constr(params); + // eslint-disable-next-line max-nested-callbacks + /** Stub */ + vault.isChecked = function () { + return mocks['Magento_Checkout/js/model/quote'].paymentMethod() ? + mocks['Magento_Checkout/js/model/quote'].paymentMethod().method : null; + }; + done(); + }); + }); + + afterEach(function () { + try { + injector.remove(); + injector.clean(); + } catch (e) { + } + mocks['Magento_Checkout/js/model/quote'].billingAddress(null); + mocks['Magento_Checkout/js/model/quote'].paymentMethod(null); + }); + + describe('Magento_Vault/js/view/payment/method-renderer/vault', function () { + + it('There is no payment method and billing address', function () { + expect(vault.isButtonActive()).toBeFalsy(); + + expect(vault.isActive()).toBeFalsy(); + expect(vault.isPlaceOrderActionAllowed()).toBeFalsy(); + }); + + it('Payment method exist but place order action is not allowed', function () { + vault.selectPaymentMethod(); + expect(mocks['Magento_Checkout/js/model/quote'].paymentMethod().method).toEqual('vaultIndex'); + + expect(vault.isButtonActive()).toBeFalsy(); + + expect(vault.isActive()).toBeTruthy(); + expect(vault.isPlaceOrderActionAllowed()).toBeFalsy(); + + }); + + it('Billing address exist but there is no selected payment method', function () { + mocks['Magento_Checkout/js/model/quote'].billingAddress(billingAddress); + + expect(vault.isButtonActive()).toBeFalsy(); + + expect(vault.isActive()).toBeFalsy(); + expect(vault.isPlaceOrderActionAllowed).toBeTruthy(); + }); + + it('Button is active', function () { + vault.selectPaymentMethod(); + expect(mocks['Magento_Checkout/js/model/quote'].paymentMethod().method).toEqual('vaultIndex'); + + mocks['Magento_Checkout/js/model/quote'].billingAddress(billingAddress); + + expect(vault.isButtonActive()).toBeTruthy(); + + expect(vault.isActive()).toBeTruthy(); + expect(vault.isPlaceOrderActionAllowed()).toBeTruthy(); + }); + }); +}); From 934338c35070359a34c1214cb590c3a0c5d1160d Mon Sep 17 00:00:00 2001 From: Yurii Sapiha <yurasapiga93@gmail.com> Date: Thu, 26 Dec 2019 10:55:13 +0200 Subject: [PATCH 477/586] MC-29691: Storefront: Simple product with custom attribute per multiple websites/storeviews, countries/states --- .../View/Attribute/AbstractAttributeTest.php | 39 ++- .../View/Attribute/DropdownAttributeTest.php | 39 +++ .../View/Attribute/TextAttributeTest.php | 39 +++ .../_files/customer_with_uk_address.php | 78 ++++++ .../customer_with_uk_address_rollback.php | 30 +++ .../FixedProductTaxAttributeTest.php | 233 ++++++++++++++++-- 6 files changed, 434 insertions(+), 24 deletions(-) create mode 100644 dev/tests/integration/testsuite/Magento/Customer/_files/customer_with_uk_address.php create mode 100644 dev/tests/integration/testsuite/Magento/Customer/_files/customer_with_uk_address_rollback.php diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/AbstractAttributeTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/AbstractAttributeTest.php index 399abea6a0760..80e2ac52cecd6 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/AbstractAttributeTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/AbstractAttributeTest.php @@ -16,6 +16,7 @@ use Magento\Framework\ObjectManagerInterface; use Magento\Framework\Registry; use Magento\Framework\View\LayoutInterface; +use Magento\Store\Model\StoreManagerInterface; use Magento\TestFramework\Helper\Bootstrap; use PHPUnit\Framework\TestCase; @@ -48,6 +49,9 @@ abstract class AbstractAttributeTest extends TestCase /** @var Output */ private $outputHelper; + /** @var StoreManagerInterface */ + private $storeManager; + /** * @inheritdoc */ @@ -62,6 +66,7 @@ protected function setUp() $this->registry = $this->objectManager->get(Registry::class); $this->block = $this->layout->createBlock(Attributes::class); $this->outputHelper = $this->objectManager->create(Output::class); + $this->storeManager = $this->objectManager->get(StoreManagerInterface::class); } /** @@ -145,6 +150,35 @@ protected function processAttributeHtmlOutput( $this->assertEquals($expectedAttributeValue, $output); } + /** + * Process attribute view per store views + * + * @param string $sku + * @param int $attributeScopeValue + * @param string $attributeValue + * @param string $expectedAttributeValue + * @param string $storeCode + * @return void + */ + protected function processMultiStoreView( + string $sku, + int $attributeScopeValue, + string $attributeValue, + string $storeCode + ): void { + $currentStore = $this->storeManager->getStore(); + $this->updateAttribute(['is_global' => $attributeScopeValue, 'is_visible_on_front' => true]); + $this->storeManager->setCurrentStore($storeCode); + + try { + $product = $this->updateProduct($sku, $attributeValue); + $this->registerProduct($product); + $this->assertEquals($this->prepareExpectedData($attributeValue), $this->block->getAdditionalData()); + } finally { + $this->storeManager->setCurrentStore($currentStore); + } + } + /** * Get attribute * @@ -185,8 +219,11 @@ private function prepareExpectedData(string $expectedValue): array */ private function updateProduct(string $productSku, string $attributeValue): ProductInterface { + $value = $this->getAttribute()->usesSource() + ? $this->attribute->getSource()->getOptionId($attributeValue) + : $attributeValue; $product = $this->productRepository->get($productSku); - $product->addData([$this->getAttributeCode() => $attributeValue]); + $product->addData([$this->getAttributeCode() => $value]); return $this->productRepository->save($product); } diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/DropdownAttributeTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/DropdownAttributeTest.php index 98799822dcfb0..f6c7e81b13a23 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/DropdownAttributeTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/DropdownAttributeTest.php @@ -7,6 +7,8 @@ namespace Magento\Catalog\Block\Product\View\Attribute; +use Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface; + /** * Class checks dropdown attribute displaying on frontend * @@ -77,6 +79,43 @@ public function attributeWithTagsProvider(): array ]; } + /** + * @magentoDbIsolation disabled + * + * @magentoDataFixture Magento/Catalog/_files/dropdown_attribute.php + * @magentoDataFixture Magento/Store/_files/core_fixturestore.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + * + * @return void + */ + public function testAttributePerStoreView(): void + { + $this->processMultiStoreView( + 'simple2', + ScopedAttributeInterface::SCOPE_STORE, + 'Option 3', + 'fixturestore' + ); + } + + /** + * @magentoDbIsolation disabled + * + * @magentoDataFixture Magento/Catalog/_files/dropdown_attribute.php + * @magentoDataFixture Magento/Catalog/_files/product_two_websites.php + * + * @return void + */ + public function testAttributePerWebsites(): void + { + $this->processMultiStoreView( + 'simple-on-two-websites', + ScopedAttributeInterface::SCOPE_WEBSITE, + 'Option 3', + 'fixture_second_store' + ); + } + /** * @inheritdoc */ diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/TextAttributeTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/TextAttributeTest.php index b61c5fd22d5b0..dae5fad160128 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/TextAttributeTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Attribute/TextAttributeTest.php @@ -7,6 +7,8 @@ namespace Magento\Catalog\Block\Product\View\Attribute; +use Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface; + /** * Class checks text attribute displaying on frontend * @@ -77,6 +79,43 @@ public function attributeWithTagsProvider(): array ]; } + /** + * @magentoDbIsolation disabled + * + * @magentoDataFixture Magento/Catalog/_files/product_varchar_attribute.php + * @magentoDataFixture Magento/Store/_files/core_fixturestore.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + * + * @return void + */ + public function testAttributePerStoreView(): void + { + $this->processMultiStoreView( + 'simple2', + ScopedAttributeInterface::SCOPE_STORE, + 'second store view value', + 'fixturestore' + ); + } + + /** + * @magentoDbIsolation disabled + * + * @magentoDataFixture Magento/Catalog/_files/product_two_websites.php + * @magentoDataFixture Magento/Catalog/_files/product_varchar_attribute.php + * + * @return void + */ + public function testAttributePerWebsites(): void + { + $this->processMultiStoreView( + 'simple-on-two-websites', + ScopedAttributeInterface::SCOPE_WEBSITE, + 'second website value', + 'fixture_second_store' + ); + } + /** * @inheritdoc */ diff --git a/dev/tests/integration/testsuite/Magento/Customer/_files/customer_with_uk_address.php b/dev/tests/integration/testsuite/Magento/Customer/_files/customer_with_uk_address.php new file mode 100644 index 0000000000000..a7ad0bb82719f --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Customer/_files/customer_with_uk_address.php @@ -0,0 +1,78 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Customer\Api\AddressMetadataInterface; +use Magento\Customer\Api\AddressRepositoryInterface; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\AddressInterface; +use Magento\Customer\Model\Address; +use Magento\Customer\Model\AddressFactory; +use Magento\Customer\Model\CustomerFactory; +use Magento\Customer\Model\CustomerRegistry; +use Magento\Customer\Model\AddressRegistry; +use Magento\Store\Api\WebsiteRepositoryInterface; +use Magento\Store\Model\Website; +use Magento\Store\Model\WebsiteRepository; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); +/** @var CustomerRepositoryInterface $customerRepository */ +$customerRepository = $objectManager->create(CustomerRepositoryInterface::class); +/** @var CustomerFactory $customerFactory */ +$customerFactory = $objectManager->get(CustomerFactory::class); +$customer = $customerFactory->create(); +/** @var CustomerRegistry $customerRegistry */ +$customerRegistry = $objectManager->get(CustomerRegistry::class); +/** @var WebsiteRepository $websiteRepository */ +$websiteRepository = $objectManager->create(WebsiteRepositoryInterface::class); +/** @var Website $mainWebsite */ +$mainWebsite = $websiteRepository->get('base'); +$customer->setWebsiteId($mainWebsite->getId()) + ->setEmail('customer_uk_address@test.com') + ->setPassword('password') + ->setGroupId(1) + ->setStoreId($mainWebsite->getDefaultStore()->getId()) + ->setIsActive(1) + ->setPrefix('Mr.') + ->setFirstname('John') + ->setMiddlename('A') + ->setLastname('Smith') + ->setSuffix('Esq.') + ->setTaxvat('12') + ->setGender(0); +/** @var AddressFactory $customerAddressFactory */ +$customerAddressFactory = $objectManager->get(AddressFactory::class); +/** @var AddressRepositoryInterface $customerAddressRepository */ +$customerAddressRepository = $objectManager->create(AddressRepositoryInterface::class); +/** @var Address $customerAddress */ +$customerAddress = $customerAddressFactory->create(); +$customerAddress->isObjectNew(true); +$customerAddress->setData( + [ + 'attribute_set_id' => AddressMetadataInterface::ATTRIBUTE_SET_ID_ADDRESS, + AddressInterface::TELEPHONE => 3468676, + AddressInterface::POSTCODE => 'EC1A 1AA', + AddressInterface::COUNTRY_ID => 'GB', + AddressInterface::CITY => 'London', + AddressInterface::COMPANY => 'CompanyName', + AddressInterface::STREET => 'test street address', + AddressInterface::LASTNAME => 'Smith', + AddressInterface::FIRSTNAME => 'John', + AddressInterface::REGION_ID => 1, + ] +); +$customer->addAddress($customerAddress); +$customer->isObjectNew(true); +$customerDataModel = $customerRepository->save($customer->getDataModel()); +$addressId = $customerDataModel->getAddresses()[0]->getId(); +$customerDataModel->setDefaultShipping($addressId); +$customerDataModel->setDefaultBilling($addressId); +$customerRepository->save($customerDataModel); +$customerRegistry->remove($customerDataModel->getId()); +/** @var AddressRegistry $addressRegistry */ +$addressRegistry = $objectManager->get(AddressRegistry::class); +$addressRegistry->remove($customerAddress->getId()); diff --git a/dev/tests/integration/testsuite/Magento/Customer/_files/customer_with_uk_address_rollback.php b/dev/tests/integration/testsuite/Magento/Customer/_files/customer_with_uk_address_rollback.php new file mode 100644 index 0000000000000..e00d80833ea04 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Customer/_files/customer_with_uk_address_rollback.php @@ -0,0 +1,30 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Customer\Api\AddressRepositoryInterface; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Registry; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); +/** @var Registry $registry */ +$registry = $objectManager->get(Registry::class); +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); +/** @var CustomerRepositoryInterface $customerRepository */ +$customerRepository = $objectManager->get(CustomerRepositoryInterface::class); + +try { + $customer = $customerRepository->get('customer_uk_address@test.com'); + $customerRepository->delete($customer); +} catch (NoSuchEntityException $exception) { + //Already deleted +} + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); diff --git a/dev/tests/integration/testsuite/Magento/Weee/Block/Product/View/Attribute/FixedProductTaxAttributeTest.php b/dev/tests/integration/testsuite/Magento/Weee/Block/Product/View/Attribute/FixedProductTaxAttributeTest.php index 6cb7d6dc0346d..a0aeb13f77518 100644 --- a/dev/tests/integration/testsuite/Magento/Weee/Block/Product/View/Attribute/FixedProductTaxAttributeTest.php +++ b/dev/tests/integration/testsuite/Magento/Weee/Block/Product/View/Attribute/FixedProductTaxAttributeTest.php @@ -11,11 +11,14 @@ use Magento\Catalog\Api\ProductRepositoryInterface; use Magento\Catalog\Block\Product\ListProduct; use Magento\Catalog\Pricing\Render as CatalogPricingRender; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Model\Session; use Magento\Framework\ObjectManagerInterface; use Magento\Framework\Pricing\Render; use Magento\Framework\Pricing\Render\RendererPool; use Magento\Framework\Registry; use Magento\Framework\View\LayoutInterface; +use Magento\Store\Model\StoreManagerInterface; use Magento\TestFramework\Helper\Bootstrap; use PHPUnit\Framework\TestCase; @@ -27,20 +30,12 @@ * @magentoAppArea frontend * @magentoDataFixture Magento/Weee/_files/fixed_product_attribute.php * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class FixedProductTaxAttributeTest extends TestCase { - /** @var array */ - private const TEST_TAX_DATA = [ - [ - 'region_id' => '1', - 'country' => 'US', - 'val' => '', - 'value' => '5', - 'website_id' => '1', - 'state' => '', - ] - ]; + /** @var array */ + private $textTaxData; /** @var ObjectManagerInterface */ private $objectManager; @@ -60,6 +55,18 @@ class FixedProductTaxAttributeTest extends TestCase /** @var Registry */ private $registry; + /** @var StoreManagerInterface */ + private $storeManager; + + /** @var CustomerRepositoryInterface */ + private $customerRepository; + + /** @var Session */ + private $customerSession; + + /** @var int */ + private $baseWebsiteId; + /** * @inheritdoc */ @@ -73,6 +80,19 @@ protected function setUp() $this->productListBlock = $this->layout->createBlock(ListProduct::class); $this->attributeCode = 'fixed_product_attribute'; $this->registry = $this->objectManager->get(Registry::class); + $this->storeManager = $this->objectManager->get(StoreManagerInterface::class); + $this->customerRepository = $this->objectManager->create(CustomerRepositoryInterface::class); + $this->customerSession = $this->objectManager->get(Session::class); + $this->baseWebsiteId = (int) $this->storeManager->getWebsite('base')->getId(); + $this->textTaxData = [ + [ + 'country' => 'US', + 'val' => '', + 'value' => '5', + 'website_id' => $this->baseWebsiteId, + 'state' => '', + ] + ]; } /** @@ -81,6 +101,8 @@ protected function setUp() protected function tearDown() { $this->registry->unregister('product'); + $this->registry->unregister('current_product'); + $this->customerSession->logout(); parent::tearDown(); } @@ -88,11 +110,13 @@ protected function tearDown() /** * @magentoConfigFixture default_store tax/weee/enable 1 * @magentoConfigFixture default_store tax/weee/display_list 0 + * + * @return void */ public function testFPTCategoryPageIncludingFPTOnly(): void { $this->prepareLayoutCategoryPage(); - $product = $this->updateProduct('simple2', self::TEST_TAX_DATA); + $product = $this->updateProduct('simple2', $this->textTaxData); $productPrice = $this->productListBlock->getProductPrice($product); $this->assertEquals('$15.00', preg_replace('/\s+/', '', strip_tags($productPrice))); } @@ -100,11 +124,13 @@ public function testFPTCategoryPageIncludingFPTOnly(): void /** * @magentoConfigFixture default_store tax/weee/enable 1 * @magentoConfigFixture default_store tax/weee/display_list 1 + * + * @return void */ public function testFPTCategoryPageIncludingFPTAndDescription(): void { $this->prepareLayoutCategoryPage(); - $product = $this->updateProduct('simple2', self::TEST_TAX_DATA); + $product = $this->updateProduct('simple2', $this->textTaxData); $productPrice = $this->productListBlock->getProductPrice($product); $this->assertContains('data-label="fixed product tax"', $productPrice); $this->assertEquals('$15.00$5.00', preg_replace('/\s+/', '', strip_tags($productPrice))); @@ -113,11 +139,13 @@ public function testFPTCategoryPageIncludingFPTAndDescription(): void /** * @magentoConfigFixture default_store tax/weee/enable 1 * @magentoConfigFixture default_store tax/weee/display_list 2 + * + * @return void */ public function testFPTCategoryPageExcludingFPTIncludingDescriptionAndPrice(): void { $this->prepareLayoutCategoryPage(); - $product = $this->updateProduct('simple2', self::TEST_TAX_DATA); + $product = $this->updateProduct('simple2', $this->textTaxData); $productPrice = $this->productListBlock->getProductPrice($product); $this->assertContains('data-label="fixed product tax"', $productPrice); $this->assertEquals('$10.00$5.00$15.00', preg_replace('/\s+/', '', strip_tags($productPrice))); @@ -126,22 +154,26 @@ public function testFPTCategoryPageExcludingFPTIncludingDescriptionAndPrice(): v /** * @magentoConfigFixture default_store tax/weee/enable 1 * @magentoConfigFixture default_store tax/weee/display_list 3 + * + * @return void */ public function testFPTCategoryPageExcludingFPT(): void { $this->prepareLayoutCategoryPage(); - $product = $this->updateProduct('simple2', self::TEST_TAX_DATA); + $product = $this->updateProduct('simple2', $this->textTaxData); $productPrice = $this->productListBlock->getProductPrice($product); $this->assertEquals('$10.00', preg_replace('/\s+/', '', strip_tags($productPrice))); } /** * @magentoConfigFixture default_store tax/weee/enable 1 - * @magentoConfigFixture default_store tax/weee/display_list 0 + * @magentoConfigFixture default_store tax/weee/display 0 + * + * @return void */ public function testFPTProductPageIncludingFPTOnly(): void { - $product = $this->updateProduct('simple2', self::TEST_TAX_DATA); + $product = $this->updateProduct('simple2', $this->textTaxData); $this->registerProduct($product); $block = $this->prepareLayoutProductPage(); $productPrice = $block->toHtml(); @@ -150,11 +182,13 @@ public function testFPTProductPageIncludingFPTOnly(): void /** * @magentoConfigFixture default_store tax/weee/enable 1 - * @magentoConfigFixture default_store tax/weee/display_list 1 + * @magentoConfigFixture default_store tax/weee/display 1 + * + * @return void */ public function testFPTProductPageIncludingFPTAndDescription(): void { - $product = $this->updateProduct('simple2', self::TEST_TAX_DATA); + $product = $this->updateProduct('simple2', $this->textTaxData); $this->registerProduct($product); $block = $this->prepareLayoutProductPage(); $productPrice = $block->toHtml(); @@ -164,11 +198,13 @@ public function testFPTProductPageIncludingFPTAndDescription(): void /** * @magentoConfigFixture default_store tax/weee/enable 1 - * @magentoConfigFixture default_store tax/weee/display_list 2 + * @magentoConfigFixture default_store tax/weee/display 2 + * + * @return void */ public function testFPTProductPageExcludingFPTIncludingDescriptionAndPrice(): void { - $product = $this->updateProduct('simple2', self::TEST_TAX_DATA); + $product = $this->updateProduct('simple2', $this->textTaxData); $this->registerProduct($product); $block = $this->prepareLayoutProductPage(); $productPrice = $block->toHtml(); @@ -178,11 +214,148 @@ public function testFPTProductPageExcludingFPTIncludingDescriptionAndPrice(): vo /** * @magentoConfigFixture default_store tax/weee/enable 1 - * @magentoConfigFixture default_store tax/weee/display_list 3 + * @magentoConfigFixture default_store tax/weee/display 3 + * + * @return void */ public function testFPTProductPageExcludingFPT(): void { - $product = $this->updateProduct('simple2', self::TEST_TAX_DATA); + $product = $this->updateProduct('simple2', $this->textTaxData); + $this->registerProduct($product); + $block = $this->prepareLayoutProductPage(); + $productPrice = $block->toHtml(); + $this->assertEquals('$10.00', preg_replace('/\s+/', '', strip_tags($productPrice))); + } + + /** + * @magentoDbIsolation disabled + * + * @magentoConfigFixture default/catalog/price/scope 1 + * @magentoConfigFixture fixture_second_store_store tax/weee/enable 1 + * @magentoConfigFixture fixture_second_store_store tax/weee/display 2 + * + * @magentoDataFixture Magento/Weee/_files/fixed_product_attribute.php + * @magentoDataFixture Magento/Catalog/_files/product_two_websites.php + * + * @return void + */ + public function testFPTPerWebsites(): void + { + $currentStore = $this->storeManager->getStore(); + try { + $secondStore = $this->storeManager->getStore('fixture_second_store'); + $taxData = [ + [ + 'region_id' => '1', + 'country' => 'US', + 'val' => '', + 'value' => '5', + 'website_id' => $secondStore->getWebsiteId(), + 'state' => '', + ] + ]; + $this->storeManager->setCurrentStore($secondStore); + $product = $this->updateProduct('simple-on-two-websites', $taxData); + $this->registerProduct($product); + $block = $this->prepareLayoutProductPage(); + $productPrice = $block->toHtml(); + $this->assertEquals('$10.00$5.00$15.00', preg_replace('/\s+/', '', strip_tags($productPrice))); + } finally { + $this->storeManager->setCurrentStore($currentStore); + } + } + + /** + * @magentoConfigFixture default_store tax/weee/enable 1 + * @magentoConfigFixture default_store tax/weee/display 0 + * + * @magentoDataFixture Magento/Weee/_files/fixed_product_attribute.php + * @magentoDataFixture Magento/Customer/_files/customer_one_address.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + * + * @return void + */ + public function testApplyTwoFPTForCustomer(): void + { + $email = 'customer_one_address@test.com'; + $expectedPrice = '$30.00'; + $taxData = [ + [ + 'country' => 'US', + 'val' => '', + 'value' => '5', + 'website_id' => $this->baseWebsiteId, + 'state' => '', + ], + [ + 'country' => 'US', + 'val' => '', + 'value' => '15', + 'website_id' => $this->baseWebsiteId, + 'state' => 1, + ] + ]; + $this->loginCustomerByEmail($email); + $product = $this->updateProduct('simple2', $taxData); + $this->registerProduct($product); + $block = $this->prepareLayoutProductPage(); + $productPrice = $block->toHtml(); + $this->assertEquals($expectedPrice, preg_replace('/\s+/', '', strip_tags($productPrice))); + } + + /** + * @magentoConfigFixture default_store tax/defaults/country GB + * @magentoConfigFixture default_store tax/weee/enable 1 + * @magentoConfigFixture default_store tax/weee/display 0 + * + * @magentoDataFixture Magento/Weee/_files/fixed_product_attribute.php + * @magentoDataFixture Magento/Customer/_files/customer_no_address.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + * + * @return void + */ + public function testApplyFPTWithoutAddressCustomer(): void + { + $email = 'customer5@example.com'; + $expectedPrice = '$10.00'; + $taxData = [ + [ + 'country' => 'US', + 'val' => '', + 'value' => '5', + 'website_id' => $this->baseWebsiteId, + 'state' => '', + ], + [ + 'country' => 'US', + 'val' => '', + 'value' => '15', + 'website_id' => $this->baseWebsiteId, + 'state' => 1, + ], + ]; + $this->loginCustomerByEmail($email); + $product = $this->updateProduct('simple2', $taxData); + $this->registerProduct($product); + $block = $this->prepareLayoutProductPage(); + $productPrice = $block->toHtml(); + $this->assertEquals($expectedPrice, preg_replace('/\s+/', '', strip_tags($productPrice))); + } + + /** + * @magentoConfigFixture default_store tax/weee/enable 1 + * @magentoConfigFixture default_store tax/weee/display 0 + * + * @magentoDataFixture Magento/Weee/_files/fixed_product_attribute.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + * @magentoDataFixture Magento/Customer/_files/customer_with_uk_address.php + * + * @return void + */ + public function testApplyFPTWithForeignCountryAddress(): void + { + $this->loginCustomerByEmail('customer_uk_address@test.com'); + $product = $this->updateProduct('simple2', $this->textTaxData); $this->registerProduct($product); $block = $this->prepareLayoutProductPage(); $productPrice = $block->toHtml(); @@ -248,5 +421,19 @@ private function registerProduct(ProductInterface $product): void { $this->registry->unregister('product'); $this->registry->register('product', $product); + $this->registry->unregister('current_product'); + $this->registry->register('current_product', $product); + } + + /** + * Login customer by email + * + * @param string $email + * @return void + */ + private function loginCustomerByEmail(string $email): void + { + $customer = $this->customerRepository->get($email); + $this->customerSession->loginById($customer->getId()); } } From 3751889f34f82bb72127aee5022a7c202d0d46f9 Mon Sep 17 00:00:00 2001 From: Yurii Sapiha <yurasapiga93@gmail.com> Date: Thu, 26 Dec 2019 11:01:14 +0200 Subject: [PATCH 478/586] MC-29686: Storefront: Out of Stock product on category page with config Show Out of Stock=Yes --- .../ProductInCategoriesViewTest.php | 13 +++++ .../out_of_stock_product_with_category.php | 53 +++++++++++++++++++ ...f_stock_product_with_category_rollback.php | 30 +++++++++++ 3 files changed, 96 insertions(+) create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/out_of_stock_product_with_category.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/out_of_stock_product_with_category_rollback.php diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/ListProduct/ProductInCategoriesViewTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/ListProduct/ProductInCategoriesViewTest.php index b9adb051981c0..48f6e455a5b9f 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/ListProduct/ProductInCategoriesViewTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/ListProduct/ProductInCategoriesViewTest.php @@ -100,6 +100,19 @@ public function productDataProvider(): array ]; } + /** + * @magentoConfigFixture default_store cataloginventory/options/show_out_of_stock 1 + * @magentoDataFixture Magento/Catalog/_files/out_of_stock_product_with_category.php + * @return void + */ + public function testCategoryOutOfStockProductView(): void + { + $collection = $this->getCategoryProductCollection(333); + + $this->assertEquals(1, $collection->getSize()); + $this->assertEquals('out-of-stock-product', $collection->getFirstItem()->getSku()); + } + /** * @magentoDataFixture Magento/Catalog/_files/category_product.php * @dataProvider productVisibilityProvider diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/out_of_stock_product_with_category.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/out_of_stock_product_with_category.php new file mode 100644 index 0000000000000..43670125e0315 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/out_of_stock_product_with_category.php @@ -0,0 +1,53 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\CategoryLinkManagementInterface; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Product\Attribute\Source\Status; +use Magento\Catalog\Model\Product\Type; +use Magento\Catalog\Model\Product\Visibility; +use Magento\Catalog\Model\ProductFactory; +use Magento\TestFramework\Helper\Bootstrap; + +require __DIR__ . '/category.php'; + +$objectManager = Bootstrap::getObjectManager(); +/** @var ProductFactory $productFactory */ +$productFactory = $objectManager->get(ProductFactory::class); +/** @var CategoryLinkManagementInterface $categoryLinkManagement */ +$categoryLinkManagement = $objectManager->get(CategoryLinkManagementInterface::class); +$product = $productFactory->create(); +$product->isObjectNew(true); +$product->setTypeId(Type::TYPE_SIMPLE) + ->setAttributeSetId($product->getDefaultAttributeSetId()) + ->setWebsiteIds([1]) + ->setName('Simple Product Out Of Stock') + ->setSku('out-of-stock-product') + ->setPrice(10) + ->setWeight(1) + ->setShortDescription("Short description") + ->setTaxClassId(0) + ->setDescription('Description with <b>html tag</b>') + ->setMetaTitle('meta title') + ->setMetaKeyword('meta keyword') + ->setMetaDescription('meta description') + ->setVisibility(Visibility::VISIBILITY_BOTH) + ->setStatus(Status::STATUS_ENABLED) + ->setCategoryIds([333]) + ->setStockData( + [ + 'use_config_manage_stock' => 1, + 'qty' => 0, + 'is_qty_decimal' => 0, + 'is_in_stock' => 0, + ] + ) + ->setCanSaveCustomOptions(true) + ->setHasOptions(true); +/** @var ProductRepositoryInterface $productRepositoryFactory */ +$productRepository = $objectManager->create(ProductRepositoryInterface::class); +$productRepository->save($product); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/out_of_stock_product_with_category_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/out_of_stock_product_with_category_rollback.php new file mode 100644 index 0000000000000..ee07b064adc66 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/out_of_stock_product_with_category_rollback.php @@ -0,0 +1,30 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Registry; +use Magento\TestFramework\Helper\Bootstrap; + +require __DIR__ . '/category_rollback.php'; + +$objectManager = Bootstrap::getObjectManager(); +/** @var Registry $registry */ +$registry = $objectManager->get(Registry::class); + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->create(ProductRepositoryInterface::class); + +try { + $productRepository->deleteById('out-of-stock-product'); +} catch (NoSuchEntityException $e) { + //already removed +} +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); From 63ec3e575ca3f9621867e891c102a4bd0f55ed5d Mon Sep 17 00:00:00 2001 From: divyajyothi5321 <54176640+divyajyothi5321@users.noreply.github.com> Date: Thu, 26 Dec 2019 14:44:55 +0530 Subject: [PATCH 479/586] Added fix for - 26176 --- .../luma/Magento_Newsletter/web/css/source/_module.less | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/design/frontend/Magento/luma/Magento_Newsletter/web/css/source/_module.less b/app/design/frontend/Magento/luma/Magento_Newsletter/web/css/source/_module.less index 5d44a32b9391b..cebde47e35191 100644 --- a/app/design/frontend/Magento/luma/Magento_Newsletter/web/css/source/_module.less +++ b/app/design/frontend/Magento/luma/Magento_Newsletter/web/css/source/_module.less @@ -81,6 +81,13 @@ .block.newsletter { max-width: 44%; width: max-content; + + .form.subscribe { + > .field, + > .actions { + float: left; + } + } } } From e520c8b45ee5aaea9d19e3e48bc85bf65a6b871d Mon Sep 17 00:00:00 2001 From: divyajyothi5321 <54176640+divyajyothi5321@users.noreply.github.com> Date: Thu, 26 Dec 2019 15:12:48 +0530 Subject: [PATCH 480/586] Added Fix for - 26181 --- .../Magento_Catalog/web/css/source/module/_listings.less | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less b/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less index 7745900f1766c..b7fcbf7888b38 100644 --- a/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less +++ b/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less @@ -108,6 +108,14 @@ .actions-primary { display: inline-block; vertical-align: middle; + + > .stock.unavailable { + line-height: 1; + padding: @indent__s 11px; + color: @color-orange-red1; + border: 1px solid @color-orange-red1; + font-weight: @font-weight__semibold; + } } } From adc7908db1db52171e4ec60ffe0eaad152535230 Mon Sep 17 00:00:00 2001 From: divyajyothi5321 <54176640+divyajyothi5321@users.noreply.github.com> Date: Thu, 26 Dec 2019 15:33:51 +0530 Subject: [PATCH 481/586] Added necessary indentations --- .../luma/Magento_Newsletter/web/css/source/_module.less | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/design/frontend/Magento/luma/Magento_Newsletter/web/css/source/_module.less b/app/design/frontend/Magento/luma/Magento_Newsletter/web/css/source/_module.less index cebde47e35191..a72f31d72ce48 100644 --- a/app/design/frontend/Magento/luma/Magento_Newsletter/web/css/source/_module.less +++ b/app/design/frontend/Magento/luma/Magento_Newsletter/web/css/source/_module.less @@ -84,9 +84,9 @@ .form.subscribe { > .field, - > .actions { - float: left; - } + > .actions { + float: left; + } } } } From aaf147837c1da4fcd5229236387bc46d4c44319d Mon Sep 17 00:00:00 2001 From: divyajyothi5321 <54176640+divyajyothi5321@users.noreply.github.com> Date: Thu, 26 Dec 2019 15:54:52 +0530 Subject: [PATCH 482/586] Added necessary indentations --- .../luma/Magento_Catalog/web/css/source/module/_listings.less | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less b/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less index b7fcbf7888b38..9b088ae0e9025 100644 --- a/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less +++ b/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less @@ -110,12 +110,12 @@ vertical-align: middle; > .stock.unavailable { - line-height: 1; + line-height: 1; padding: @indent__s 11px; color: @color-orange-red1; border: 1px solid @color-orange-red1; font-weight: @font-weight__semibold; - } + } } } From b87672a94535a9cb5c7cec3f6cc522aec9f5505b Mon Sep 17 00:00:00 2001 From: divyajyothi5321 <54176640+divyajyothi5321@users.noreply.github.com> Date: Thu, 26 Dec 2019 16:45:19 +0530 Subject: [PATCH 483/586] Added Changes --- .../Magento_Catalog/web/css/source/module/_listings.less | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less b/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less index 9b088ae0e9025..8c71f87360807 100644 --- a/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less +++ b/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less @@ -110,11 +110,11 @@ vertical-align: middle; > .stock.unavailable { - line-height: 1; - padding: @indent__s 11px; - color: @color-orange-red1; border: 1px solid @color-orange-red1; + color: @color-orange-red1; font-weight: @font-weight__semibold; + line-height: 1; + padding: @indent__s 11px; } } } From 23dfe2baf9c324f4a45bf8614dbe8bcdea2aae10 Mon Sep 17 00:00:00 2001 From: Serhii Voloshkov <serhii.voloshkov@transoftgroup.com> Date: Thu, 26 Dec 2019 14:03:55 +0200 Subject: [PATCH 484/586] MC-29967: [Braintree] Place Order button is not disabled --- .../web/js/view/payment/method-renderer/vault.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Vault/view/frontend/web/js/view/payment/method-renderer/vault.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Vault/view/frontend/web/js/view/payment/method-renderer/vault.test.js index f24d8d085da5c..3724a3ab0c9f3 100644 --- a/dev/tests/js/jasmine/tests/app/code/Magento/Vault/view/frontend/web/js/view/payment/method-renderer/vault.test.js +++ b/dev/tests/js/jasmine/tests/app/code/Magento/Vault/view/frontend/web/js/view/payment/method-renderer/vault.test.js @@ -88,7 +88,7 @@ define([ expect(vault.isPlaceOrderActionAllowed()).toBeFalsy(); }); - it('Payment method exist but place order action is not allowed', function () { + it('Payment method exists, but place order action is not allowed', function () { vault.selectPaymentMethod(); expect(mocks['Magento_Checkout/js/model/quote'].paymentMethod().method).toEqual('vaultIndex'); @@ -99,7 +99,7 @@ define([ }); - it('Billing address exist but there is no selected payment method', function () { + it('Billing address exists, but there is no selected payment method', function () { mocks['Magento_Checkout/js/model/quote'].billingAddress(billingAddress); expect(vault.isButtonActive()).toBeFalsy(); From e037d514215f9e662b5585a5ab967ca4edcde3af Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <nazarn96@gmail.com> Date: Thu, 26 Dec 2019 14:05:28 +0200 Subject: [PATCH 485/586] Fix static test, civer with jasmine test --- .../view/base/web/js/swatch-renderer.js | 2 +- .../frontend/web/js/swatch-renderer.test.js | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Swatches/view/base/web/js/swatch-renderer.js b/app/code/Magento/Swatches/view/base/web/js/swatch-renderer.js index c80962a44d0dc..ee55beb440f59 100644 --- a/app/code/Magento/Swatches/view/base/web/js/swatch-renderer.js +++ b/app/code/Magento/Swatches/view/base/web/js/swatch-renderer.js @@ -952,7 +952,7 @@ define([ isShow = typeof result != 'undefined' && result.oldPrice.amount !== result.finalPrice.amount; - $productPrice.find('span:first').toggleClass('special-price',isShow); + $productPrice.find('span:first').toggleClass('special-price', isShow); $product.find(this.options.slyOldPriceSelector)[isShow ? 'show' : 'hide'](); diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.test.js index bf0ff3466c529..f486123ba0bd3 100644 --- a/dev/tests/js/jasmine/tests/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.test.js +++ b/dev/tests/js/jasmine/tests/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.test.js @@ -28,6 +28,7 @@ define([ id: optionId }] }; + widget.options = { classes: { optionClass: 'swatch-option' @@ -50,6 +51,7 @@ define([ } } }; + optionConfig = widget.options.jsonSwatchConfig[attribute.id]; html = $(widget._RenderSwatchOptions(attribute, 'option-label-control-id-1'))[0]; }); @@ -76,5 +78,25 @@ define([ expect(html.style.height).toEqual(swathImageHeight + 'px'); expect(html.style.width).toEqual(swathImageWidth + 'px'); }); + + it('check udate price method', function () { + var productPriceMock = { + find: jasmine.createSpy().and.returnValue({ + hide: jasmine.createSpy(), + priceBox: jasmine.createSpy().and.returnValue(''), + trigger: jasmine.createSpy(), + find: jasmine.createSpy().and.returnValue({ + toggleClass: jasmine.createSpy() + }) + }) + }; + + widget.element = { + parents: jasmine.createSpy().and.returnValue(productPriceMock) + }; + widget._getNewPrices = jasmine.createSpy().and.returnValue(undefined); + widget._UpdatePrice(); + expect(productPriceMock.find().find.calls.count()).toBe(1); + }); }); }); From 5e284e0dec5559315e18e6e9505fc19e6fb6a807 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Thu, 26 Dec 2019 20:17:02 -0600 Subject: [PATCH 486/586] Fix action group according to changes in mainline --- .../Catalog/Test/Mftf/Test/StorefrontFotoramaArrowsTest.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontFotoramaArrowsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontFotoramaArrowsTest.xml index 239ec975a9663..1a8e0c95a304c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontFotoramaArrowsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontFotoramaArrowsTest.xml @@ -38,13 +38,13 @@ </actionGroup> <!-- Add images to product --> - <actionGroup ref="addProductImage" stepKey="addFirstImageToProduct"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addFirstImageToProduct"> <argument name="image" value="MagentoLogo"/> </actionGroup> - <actionGroup ref="addProductImage" stepKey="addSecondImageToProduct"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addSecondImageToProduct"> <argument name="image" value="ProductImage"/> </actionGroup> - <actionGroup ref="addProductImage" stepKey="addThirdImageToProduct"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addThirdImageToProduct"> <argument name="image" value="TestImageNew"/> </actionGroup> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSimpleProduct"/> From 4e266f2ef1c310a2b8f3846c33e6fb26034e6dd9 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Thu, 26 Dec 2019 22:09:28 -0600 Subject: [PATCH 487/586] Fix action group according to changes in mainline --- .../Mftf/Test/ProductAttributeWithoutValueInCompareListTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/ProductAttributeWithoutValueInCompareListTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/ProductAttributeWithoutValueInCompareListTest.xml index f32ce60706423..f1288da1e6125 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/ProductAttributeWithoutValueInCompareListTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/ProductAttributeWithoutValueInCompareListTest.xml @@ -23,7 +23,7 @@ <createData entity="CatalogAttributeSet" stepKey="createAttributeSet"/> <amOnPage url="{{AdminProductAttributeSetEditPage.url}}/$$createAttributeSet.attribute_set_id$$/" stepKey="onAttributeSetEdit"/> - <actionGroup ref="AssignAttributeToGroup" stepKey="assignAttributeToGroup"> + <actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup"> <argument name="group" value="Product Details"/> <argument name="attribute" value="$$createProductAttribute.attribute_code$$"/> </actionGroup> From 03e4cb8d5afb3b55ee6af3af1cdc86dcd69c3eca Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Thu, 26 Dec 2019 22:10:34 -0600 Subject: [PATCH 488/586] Update actiongroup according to changes in mainline --- .../StorefrontNoJavascriptErrorOnAddYourReviewClickTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Review/Test/Mftf/Test/StorefrontNoJavascriptErrorOnAddYourReviewClickTest.xml b/app/code/Magento/Review/Test/Mftf/Test/StorefrontNoJavascriptErrorOnAddYourReviewClickTest.xml index 667e352cde837..72b175d2dcacb 100644 --- a/app/code/Magento/Review/Test/Mftf/Test/StorefrontNoJavascriptErrorOnAddYourReviewClickTest.xml +++ b/app/code/Magento/Review/Test/Mftf/Test/StorefrontNoJavascriptErrorOnAddYourReviewClickTest.xml @@ -22,7 +22,7 @@ <createData entity="CatalogAttributeSet" stepKey="createAttributeSet"/> <amOnPage url="{{AdminProductAttributeSetEditPage.url}}/$$createAttributeSet.attribute_set_id$$/" stepKey="onAttributeSetEdit"/> - <actionGroup ref="AssignAttributeToGroup" stepKey="assignAttributeToGroup"> + <actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup"> <argument name="group" value="Product Details"/> <argument name="attribute" value="$$createProductAttribute.attribute_code$$"/> </actionGroup> From b51f02a4e439e8290d92c9d86bb9ec3b0f131a62 Mon Sep 17 00:00:00 2001 From: Mykhailo Matiola <mykhailo.matiola@transoftgroup.com> Date: Fri, 27 Dec 2019 10:48:48 +0200 Subject: [PATCH 489/586] MC-25125: Layered Navigation with different Scope for attribute --- ...fferent_price_products_on_two_websites.php | 26 +++ ...rice_products_on_two_websites_rollback.php | 9 + .../Block/Navigation/AbstractFiltersTest.php | 55 +++--- .../Navigation/Category/DecimalFilterTest.php | 9 +- .../Navigation/Category/FilterScopeTest.php | 160 ++++++++++++++++++ 5 files changed, 234 insertions(+), 25 deletions(-) create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/category_with_different_price_products_on_two_websites.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/category_with_different_price_products_on_two_websites_rollback.php create mode 100644 dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Category/FilterScopeTest.php diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/category_with_different_price_products_on_two_websites.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/category_with_different_price_products_on_two_websites.php new file mode 100644 index 0000000000000..91a5ece179ba6 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/category_with_different_price_products_on_two_websites.php @@ -0,0 +1,26 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Store\Api\WebsiteRepositoryInterface; +use Magento\TestFramework\Helper\Bootstrap; + +require __DIR__ . '/category_with_different_price_products.php'; +require __DIR__ . '/../../Store/_files/second_website_with_two_stores.php'; + +$objectManager = Bootstrap::getObjectManager(); +/** @var WebsiteRepositoryInterface $websiteRepository */ +$websiteRepository = $objectManager->get(WebsiteRepositoryInterface::class); +$defaultWebsiteId = $websiteRepository->get('base')->getId(); +$websiteId = $websiteRepository->get('test')->getId(); + +$product = $productRepository->get('simple1000'); +$product->setWebsiteIds([$defaultWebsiteId, $websiteId]); +$productRepository->save($product); + +$product = $productRepository->get('simple1001'); +$product->setWebsiteIds([$defaultWebsiteId, $websiteId]); +$productRepository->save($product); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/category_with_different_price_products_on_two_websites_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/category_with_different_price_products_on_two_websites_rollback.php new file mode 100644 index 0000000000000..d4c531c4da4db --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/category_with_different_price_products_on_two_websites_rollback.php @@ -0,0 +1,9 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +require __DIR__ . '/category_with_different_price_products_rollback.php'; +require __DIR__ . '/../../Store/_files/second_website_with_two_stores_rollback.php'; diff --git a/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/AbstractFiltersTest.php b/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/AbstractFiltersTest.php index 472eac444b9d4..fed8c76852872 100644 --- a/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/AbstractFiltersTest.php +++ b/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/AbstractFiltersTest.php @@ -74,22 +74,9 @@ protected function setUp() $this->objectManager = Bootstrap::getObjectManager(); $this->categoryCollectionFactory = $this->objectManager->create(CollectionFactory::class); $this->layout = $this->objectManager->get(LayoutInterface::class); - $layerResolver = $this->objectManager->create(Resolver::class); - - if ($this->getLayerType() === Resolver::CATALOG_LAYER_SEARCH) { - $layerResolver->create(Resolver::CATALOG_LAYER_SEARCH); - $this->navigationBlock = $this->objectManager->create( - SearchNavigationBlock::class, - [ - 'layerResolver' => $layerResolver, - ] - ); - } else { - $this->navigationBlock = $this->objectManager->create(CategoryNavigationBlock::class); - } - $this->attributeRepository = $this->objectManager->create(ProductAttributeRepositoryInterface::class); $this->productRepository = $this->objectManager->create(ProductRepositoryInterface::class); + $this->createNavigationBlockInstance(); } /** @@ -121,7 +108,7 @@ protected function getCategoryFiltersAndAssert( array $expectation, string $categoryName ): void { - $this->updateAttribute($this->getAttributeCode(), $attributeData); + $this->updateAttribute($attributeData); $this->updateProducts($products, $this->getAttributeCode()); $this->clearInstanceAndReindexSearch(); $category = $this->loadCategory($categoryName, Store::DEFAULT_STORE_ID); @@ -150,7 +137,7 @@ protected function getSearchFiltersAndAssert( array $attributeData, array $expectation ): void { - $this->updateAttribute($this->getAttributeCode(), $attributeData); + $this->updateAttribute($attributeData); $this->updateProducts($products, $this->getAttributeCode()); $this->clearInstanceAndReindexSearch(); $this->navigationBlock->getRequest()->setParams(['q' => 'Simple Product']); @@ -188,15 +175,13 @@ function (AbstractFilter $filter) use ($code) { /** * Updates attribute data. * - * @param string $attributeCode * @param array $data * @return void */ protected function updateAttribute( - string $attributeCode, array $data ): void { - $attribute = $this->attributeRepository->get($attributeCode); + $attribute = $this->attributeRepository->get($this->getAttributeCode()); $attribute->addData($data); $this->attributeRepository->save($attribute); } @@ -226,14 +211,18 @@ protected function prepareFilterItems(AbstractFilter $filter): array * * @param array $products * @param string $attributeCode + * @param int $storeId * @return void */ - protected function updateProducts(array $products, string $attributeCode): void - { + protected function updateProducts( + array $products, + string $attributeCode, + int $storeId = Store::DEFAULT_STORE_ID + ): void { $attribute = $this->attributeRepository->get($attributeCode); foreach ($products as $productSku => $stringValue) { - $product = $this->productRepository->get($productSku, false, Store::DEFAULT_STORE_ID, true); + $product = $this->productRepository->get($productSku, false, $storeId, true); $product->addData( [$attribute->getAttributeCode() => $attribute->getSource()->getOptionId($stringValue)] ); @@ -275,4 +264,26 @@ protected function loadCategory(string $categoryName, int $storeId): CategoryInt return $category; } + + /** + * Creates navigation block instance. + * + * @return void + */ + protected function createNavigationBlockInstance(): void + { + $layerResolver = $this->objectManager->create(Resolver::class); + + if ($this->getLayerType() === Resolver::CATALOG_LAYER_SEARCH) { + $layerResolver->create(Resolver::CATALOG_LAYER_SEARCH); + $this->navigationBlock = $this->objectManager->create( + SearchNavigationBlock::class, + [ + 'layerResolver' => $layerResolver, + ] + ); + } else { + $this->navigationBlock = $this->objectManager->create(CategoryNavigationBlock::class); + } + } } diff --git a/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Category/DecimalFilterTest.php b/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Category/DecimalFilterTest.php index c8cb6397b12fd..eb4148d77b21e 100644 --- a/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Category/DecimalFilterTest.php +++ b/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Category/DecimalFilterTest.php @@ -74,12 +74,15 @@ protected function prepareFilterItems(AbstractFilter $filter): array /** * @inheritdoc */ - protected function updateProducts(array $products, string $attributeCode): void - { + protected function updateProducts( + array $products, + string $attributeCode, + int $storeId = Store::DEFAULT_STORE_ID + ): void { $attribute = $this->attributeRepository->get($attributeCode); foreach ($products as $productSku => $value) { - $product = $this->productRepository->get($productSku, false, Store::DEFAULT_STORE_ID, true); + $product = $this->productRepository->get($productSku, false, $storeId, true); $product->addData( [$attribute->getAttributeCode() => $value] ); diff --git a/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Category/FilterScopeTest.php b/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Category/FilterScopeTest.php new file mode 100644 index 0000000000000..5dad3c0cafa24 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Category/FilterScopeTest.php @@ -0,0 +1,160 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\LayeredNavigation\Block\Navigation\Category; + +use Magento\Catalog\Model\Layer\Filter\AbstractFilter; +use Magento\Catalog\Model\Layer\Resolver; +use Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface; +use Magento\LayeredNavigation\Block\Navigation\AbstractFiltersTest; +use Magento\Store\Model\StoreManagerInterface; + +/** + * Provides tests for custom filter with different scopes in navigation block on category page. + * + * @magentoAppArea frontend + * @magentoAppIsolation enabled + * @magentoDbIsolation disabled + */ +class FilterScopeTest extends AbstractFiltersTest +{ + /** + * @var StoreManagerInterface + */ + private $storeManager; + + /** + * @var int + */ + private $oldStoreId; + + /** + * @var int + */ + private $currentStoreId; + + /** + * @inheritdoc + */ + protected function setUp() + { + parent::setUp(); + $this->storeManager = $this->objectManager->get(StoreManagerInterface::class); + $this->oldStoreId = (int)$this->storeManager->getStore()->getId(); + $this->currentStoreId = (int)$this->storeManager->getStore('fixture_second_store')->getId(); + } + + /** + * @magentoDataFixture Magento/Catalog/_files/product_dropdown_attribute.php + * @magentoDataFixture Magento/Catalog/_files/category_with_different_price_products_on_two_websites.php + * @dataProvider filtersWithScopeDataProvider + * @param int $scope + * @param array $products + * @param array $expectation + * @return void + */ + public function testGetFilters(int $scope, array $products, array $expectation): void + { + $this->updateAttribute( + [ + 'is_filterable' => AbstractFilter::ATTRIBUTE_OPTIONS_ONLY_WITH_RESULTS, + 'is_global' => $scope, + ] + ); + $this->updateProductsOnStore($products); + $this->clearInstanceAndReindexSearch(); + try { + $this->storeManager->setCurrentStore($this->currentStoreId); + $this->navigationBlock->getLayer()->setCurrentCategory( + $this->loadCategory('Category 999', $this->currentStoreId) + ); + $this->navigationBlock->setLayout($this->layout); + $filter = $this->getFilterByCode($this->navigationBlock->getFilters(), $this->getAttributeCode()); + $this->assertNotNull($filter); + $this->assertEquals($expectation, $this->prepareFilterItems($filter)); + } finally { + $this->storeManager->setCurrentStore($this->oldStoreId); + } + } + + /** + * @return array + */ + public function filtersWithScopeDataProvider(): array + { + return [ + 'with_scope_store' => [ + 'scope' => ScopedAttributeInterface::SCOPE_STORE, + 'products' => [ + 'default' => ['simple1000' => 'Option 1', 'simple1001' => 'Option 2'], + 'fixture_second_store' => ['simple1000' => 'Option 2', 'simple1001' => 'Option 3'], + ], + 'expectation' => [ + ['label' => 'Option 2', 'count' => 1], + ['label' => 'Option 3', 'count' => 1], + ], + ], + 'with_scope_website' => [ + 'scope' => ScopedAttributeInterface::SCOPE_WEBSITE, + 'products' => [ + 'default' => ['simple1000' => 'Option 3', 'simple1001' => 'Option 2'], + 'fixture_second_store' => ['simple1000' => 'Option 1', 'simple1001' => 'Option 2'], + ], + 'expectation' => [ + ['label' => 'Option 1', 'count' => 1], + ['label' => 'Option 2', 'count' => 1], + ], + ], + 'with_scope_global' => [ + 'scope' => ScopedAttributeInterface::SCOPE_GLOBAL, + 'products' => [ + 'default' => ['simple1000' => 'Option 1'], + 'fixture_second_store' => ['simple1001' => 'Option 2'], + ], + 'expectation' => [ + ['label' => 'Option 1', 'count' => 1], + ['label' => 'Option 2', 'count' => 1], + ], + ], + ]; + } + + /** + * @inheritdoc + */ + protected function getLayerType(): string + { + return Resolver::CATALOG_LAYER_CATEGORY; + } + + /** + * @inheritdoc + */ + protected function getAttributeCode(): string + { + return 'dropdown_attribute'; + } + + /** + * Updates products data for store. + * + * @param array $productsData + * @return void + */ + private function updateProductsOnStore(array $productsData): void + { + try { + foreach ($productsData as $storeCode => $products) { + $storeId = (int)$this->storeManager->getStore($storeCode)->getId(); + $this->storeManager->setCurrentStore($storeId); + $this->updateProducts($products, $this->getAttributeCode(), $storeId); + } + } finally { + $this->storeManager->setCurrentStore($this->oldStoreId); + } + } +} From 27f7626fe3d2518e3f36a9f72e551191b134a299 Mon Sep 17 00:00:00 2001 From: "ivan.pletnyov" <ivan.pletnyov@transoftgroup.com> Date: Fri, 27 Dec 2019 14:40:02 +0200 Subject: [PATCH 490/586] MC-29689: Admin: Check Product Price index table --- .../Product/Save/AdvancedPricingTest.php | 105 ++++++++++ .../Catalog/Model/Product/Type/PriceTest.php | 193 ++++++++++++++---- ...roduct_with_tier_price_for_logged_user.php | 23 +++ ...th_tier_price_for_logged_user_rollback.php | 8 + .../_files/catalog_rule_6_off_logged_user.php | 38 ++++ ...atalog_rule_6_off_logged_user_rollback.php | 29 +++ 6 files changed, 354 insertions(+), 42 deletions(-) create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Save/AdvancedPricingTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_tier_price_for_logged_user.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_tier_price_for_logged_user_rollback.php create mode 100644 dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_6_off_logged_user.php create mode 100644 dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_6_off_logged_user_rollback.php diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Save/AdvancedPricingTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Save/AdvancedPricingTest.php new file mode 100644 index 0000000000000..da4cf6335fb05 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Save/AdvancedPricingTest.php @@ -0,0 +1,105 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Controller\Adminhtml\Product\Save; + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Customer\Api\Data\GroupInterface; +use Magento\Framework\App\Request\Http; +use Magento\Framework\Message\MessageInterface; +use Magento\TestFramework\TestCase\AbstractBackendController; + +/** + * Test cases for set advanced price to product. + * + * @magentoAppArea adminhtml + * @magentoDbIsolation enabled + */ +class AdvancedPricingTest extends AbstractBackendController +{ + /** + * @var ProductRepositoryInterface + */ + private $productRepository; + + /** + * @inheritdoc + */ + protected function setUp() + { + parent::setUp(); + $this->productRepository = $this->_objectManager->get(ProductRepositoryInterface::class); + } + + /** + * Assert that special price correctly saved to product. + * + * @magentoDataFixture Magento/Catalog/_files/product_without_options.php + * + * @return void + */ + public function testAddSpecialPriceToProduct(): void + { + $product = $this->productRepository->get('simple'); + $postData = [ + 'product' => [ + 'special_price' => 8, + ], + ]; + $this->assertNull($product->getSpecialPrice()); + $this->dispatchWithData((int)$product->getEntityId(), $postData); + $product = $this->productRepository->get('simple', false, null, true); + $this->assertEquals(8, $product->getSpecialPrice()); + } + + /** + * Assert that tier price correctly saved to product. + * + * @magentoDataFixture Magento/Catalog/_files/product_without_options.php + * + * @return void + */ + public function testAddTierPriceToProduct(): void + { + $product = $this->productRepository->get('simple'); + $postData = [ + 'product' => [ + 'tier_price' => [ + [ + 'website_id' => '0', + 'cust_group' => GroupInterface::CUST_GROUP_ALL, + 'price_qty' => '100', + 'price' => 5, + 'value_type' => 'fixed', + ] + ], + ], + ]; + $this->assertEquals(10, $product->getTierPrice(100)); + $this->dispatchWithData((int)$product->getEntityId(), $postData); + $product = $this->productRepository->get('simple', false, null, true); + $this->assertEquals(5, $product->getTierPrice(100)); + } + + /** + * Dispatch product save with data. + * + * @param int $productId + * @param array $productPostData + * @return void + */ + private function dispatchWithData(int $productId, array $productPostData): void + { + $this->getRequest()->setPostValue($productPostData); + $this->getRequest()->setMethod(Http::METHOD_POST); + $this->dispatch('backend/catalog/product/save/id/' . $productId); + $this->assertSessionMessages( + $this->contains('You saved the product.'), + MessageInterface::TYPE_SUCCESS + ); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Type/PriceTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Type/PriceTest.php index 8d3a119873afb..fe7207d310345 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Type/PriceTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Type/PriceTest.php @@ -3,105 +3,214 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Catalog\Model\Product\Type; +use Magento\Catalog\Api\Data\ProductCustomOptionInterface; +use Magento\Catalog\Api\ProductRepositoryInterface; use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\Product\Option; +use Magento\Customer\Model\Session; +use Magento\Framework\DataObject; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\ObjectManager; +use PHPUnit\Framework\TestCase; /** + * Simple product price test. + * * @magentoDataFixture Magento/Catalog/_files/product_simple.php + * @magentoDbIsolation enabled */ -class PriceTest extends \PHPUnit\Framework\TestCase +class PriceTest extends TestCase { /** - * @var \Magento\Catalog\Model\Product\Type\Price + * @var ObjectManager + */ + private $objectManager; + + /** + * @var Price */ - protected $_model; + private $productPrice; - protected function setUp() + /** + * @var ProductRepositoryInterface + */ + private $productRepository; + + /** + * @var Session + */ + private $customerSession; + + /** + * @inheritdoc + */ + protected function setUp(): void { - $this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Catalog\Model\Product\Type\Price::class - ); + $this->objectManager = Bootstrap::getObjectManager(); + $this->productPrice = $this->objectManager->create(Price::class); + $this->productRepository = $this->objectManager->create(ProductRepositoryInterface::class); + $this->customerSession = $this->objectManager->get(Session::class); } - public function testGetPrice() + /** + * Assert that for logged user product price equal to price from catalog rule. + * + * @magentoDataFixture Magento/Catalog/_files/product_simple.php + * @magentoDataFixture Magento/CatalogRule/_files/catalog_rule_6_off_logged_user.php + * @magentoDataFixture Magento/Customer/_files/customer.php + * + * @magentoDbIsolation disabled + * @magentoAppArea frontend + * @magentoAppIsolation enabled + * + * @return void + */ + public function testPriceByRuleForLoggedUser(): void { - $this->assertEquals('test', $this->_model->getPrice(new \Magento\Framework\DataObject(['price' => 'test']))); + $product = $this->productRepository->get('simple'); + $this->assertEquals(10, $this->productPrice->getFinalPrice(1, $product)); + $this->customerSession->setCustomerId(1); + try { + $this->assertEquals(4, $this->productPrice->getFinalPrice(1, $product)); + } finally { + $this->customerSession->setCustomerId(null); + } } - public function testGetFinalPrice() + /** + * Assert price for different customer groups. + * + * @magentoDataFixture Magento/Catalog/_files/simple_product_with_tier_price_for_logged_user.php + * @magentoDataFixture Magento/Customer/_files/customer.php + * + * @magentoAppIsolation enabled + * + * @return void + */ + public function testTierPriceWithDifferentCustomerGroups(): void { - $repository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Catalog\Model\ProductRepository::class - ); - $product = $repository->get('simple'); - // fixture + $product = $this->productRepository->get('simple'); + $this->assertEquals(8, $this->productPrice->getFinalPrice(2, $product)); + $this->assertEquals(5, $this->productPrice->getFinalPrice(3, $product)); + $this->customerSession->setCustomerId(1); + try { + $this->assertEquals(1, $this->productPrice->getFinalPrice(3, $product)); + } finally { + $this->customerSession->setCustomerId(null); + } + } + + /** + * Get price from custom object. + * + * @return void + */ + public function testGetPrice(): void + { + $objectWithPrice = $this->objectManager->create(DataObject::class, ['data' => ['price' => 'test']]); + $this->assertEquals('test', $this->productPrice->getPrice($objectWithPrice)); + } + + /** + * Get product final price for different product count. + * + * @return void + */ + public function testGetFinalPrice(): void + { + $product = $this->productRepository->get('simple'); // regular & tier prices - $this->assertEquals(10.0, $this->_model->getFinalPrice(1, $product)); - $this->assertEquals(8.0, $this->_model->getFinalPrice(2, $product)); - $this->assertEquals(5.0, $this->_model->getFinalPrice(5, $product)); + $this->assertEquals(10.0, $this->productPrice->getFinalPrice(1, $product)); + $this->assertEquals(8.0, $this->productPrice->getFinalPrice(2, $product)); + $this->assertEquals(5.0, $this->productPrice->getFinalPrice(5, $product)); // with options $buyRequest = $this->prepareBuyRequest($product); $product->getTypeInstance()->prepareForCart($buyRequest, $product); //product price + options price(10+1+2+3+3) - $this->assertEquals(19.0, $this->_model->getFinalPrice(1, $product)); + $this->assertEquals(19.0, $this->productPrice->getFinalPrice(1, $product)); //product tier price + options price(5+1+2+3+3) - $this->assertEquals(14.0, $this->_model->getFinalPrice(5, $product)); + $this->assertEquals(14.0, $this->productPrice->getFinalPrice(5, $product)); } - public function testGetFormatedPrice() + /** + * Assert that formated price is correct. + * + * @return void + */ + public function testGetFormatedPrice(): void { - $repository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Catalog\Model\ProductRepository::class - ); - $product = $repository->get('simple'); - // fixture - $this->assertEquals('<span class="price">$10.00</span>', $this->_model->getFormatedPrice($product)); + $product = $this->productRepository->get('simple'); + $this->assertEquals('<span class="price">$10.00</span>', $this->productPrice->getFormatedPrice($product)); } - public function testCalculatePrice() + /** + * Test calculate price by date. + * + * @return void + */ + public function testCalculatePrice(): void { - $this->assertEquals(10, $this->_model->calculatePrice(10, 8, '1970-12-12 23:59:59', '1971-01-01 01:01:01')); - $this->assertEquals(8, $this->_model->calculatePrice(10, 8, '1970-12-12 23:59:59', '2034-01-01 01:01:01')); + $this->assertEquals( + 10, + $this->productPrice->calculatePrice(10, 8, '1970-12-12 23:59:59', '1971-01-01 01:01:01') + ); + $this->assertEquals( + 8, + $this->productPrice->calculatePrice(10, 8, '1970-12-12 23:59:59', '2034-01-01 01:01:01') + ); } - public function testCalculateSpecialPrice() + /** + * Test calculate price by date. + * + * @return void + */ + public function testCalculateSpecialPrice(): void { $this->assertEquals( 10, - $this->_model->calculateSpecialPrice(10, 8, '1970-12-12 23:59:59', '1971-01-01 01:01:01') + $this->productPrice->calculateSpecialPrice(10, 8, '1970-12-12 23:59:59', '1971-01-01 01:01:01') ); $this->assertEquals( 8, - $this->_model->calculateSpecialPrice(10, 8, '1970-12-12 23:59:59', '2034-01-01 01:01:01') + $this->productPrice->calculateSpecialPrice(10, 8, '1970-12-12 23:59:59', '2034-01-01 01:01:01') ); } - public function testIsTierPriceFixed() + /** + * Assert that product tier price is fixed. + * + * @return void + */ + public function testIsTierPriceFixed(): void { - $this->assertTrue($this->_model->isTierPriceFixed()); + $this->assertTrue($this->productPrice->isTierPriceFixed()); } /** - * Build buy request based on product custom options + * Build buy request based on product custom options. * * @param Product $product - * @return \Magento\Framework\DataObject + * @return DataObject */ - private function prepareBuyRequest(Product $product) + private function prepareBuyRequest(Product $product): DataObject { $options = []; - /** @var $option \Magento\Catalog\Model\Product\Option */ + /** @var Option $option */ foreach ($product->getOptions() as $option) { switch ($option->getGroupByType()) { - case \Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_GROUP_DATE: + case ProductCustomOptionInterface::OPTION_GROUP_DATE: $value = ['year' => 2013, 'month' => 8, 'day' => 9, 'hour' => 13, 'minute' => 35]; break; - case \Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_GROUP_SELECT: + case ProductCustomOptionInterface::OPTION_GROUP_SELECT: $value = key($option->getValues()); break; default: @@ -111,6 +220,6 @@ private function prepareBuyRequest(Product $product) $options[$option->getId()] = $value; } - return new \Magento\Framework\DataObject(['qty' => 1, 'options' => $options]); + return $this->objectManager->create(DataObject::class, ['data' => ['qty' => 1, 'options' => $options]]); } } diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_tier_price_for_logged_user.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_tier_price_for_logged_user.php new file mode 100644 index 0000000000000..e7e64566a4371 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_tier_price_for_logged_user.php @@ -0,0 +1,23 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +require __DIR__ . '/product_simple.php'; + +$product = $productRepository->get('simple', false, null, true); +$tierPrices = $product->getTierPrices() ?? []; +$tierPriceExtensionAttributes = $tpExtensionAttributesFactory->create()->setWebsiteId($adminWebsite->getId()); +$tierPrices[] = $tierPriceFactory->create( + [ + 'data' => [ + 'customer_group_id' => 1, + 'qty' => 3, + 'value' => 1 + ] + ] +)->setExtensionAttributes($tierPriceExtensionAttributes); +$product->setTierPrices($tierPrices); +$productRepository->save($product); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_tier_price_for_logged_user_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_tier_price_for_logged_user_rollback.php new file mode 100644 index 0000000000000..e17fdac4904c9 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_tier_price_for_logged_user_rollback.php @@ -0,0 +1,8 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +require __DIR__ . '/product_simple_rollback.php'; diff --git a/dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_6_off_logged_user.php b/dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_6_off_logged_user.php new file mode 100644 index 0000000000000..3343a837d17db --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_6_off_logged_user.php @@ -0,0 +1,38 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\CatalogRule\Api\CatalogRuleRepositoryInterface; +use Magento\CatalogRule\Api\Data\RuleInterface; +use Magento\CatalogRule\Api\Data\RuleInterfaceFactory; +use Magento\CatalogRule\Model\Indexer\IndexBuilder; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); +/** @var IndexBuilder $indexBuilder */ +$indexBuilder = $objectManager->get(IndexBuilder::class); +/** @var CatalogRuleRepositoryInterface $catalogRuleRepository */ +$catalogRuleRepository = $objectManager->get(CatalogRuleRepositoryInterface::class); +/** @var RuleInterfaceFactory $catalogRuleFactory */ +$catalogRuleFactory = $objectManager->get(RuleInterfaceFactory::class); +$catalogRule = $catalogRuleFactory->create( + [ + 'data' => [ + RuleInterface::IS_ACTIVE => 1, + RuleInterface::NAME => 'Test Catalog Rule for logged user', + 'customer_group_ids' => 1, + RuleInterface::DISCOUNT_AMOUNT => 6, + 'website_ids' => [1], + RuleInterface::SIMPLE_ACTION => 'by_fixed', + RuleInterface::STOP_RULES_PROCESSING => false, + RuleInterface::SORT_ORDER => 0, + 'sub_is_enable' => 0, + 'sub_discount_amount' => 0, + ] + ] +); +$catalogRuleRepository->save($catalogRule); +$indexBuilder->reindexFull(); diff --git a/dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_6_off_logged_user_rollback.php b/dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_6_off_logged_user_rollback.php new file mode 100644 index 0000000000000..37c2c8c1f2173 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_6_off_logged_user_rollback.php @@ -0,0 +1,29 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\CatalogRule\Api\CatalogRuleRepositoryInterface; +use Magento\CatalogRule\Model\Indexer\IndexBuilder; +use Magento\CatalogRule\Model\ResourceModel\Rule\CollectionFactory; +use Magento\CatalogRule\Model\Rule; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); +/** @var IndexBuilder $indexBuilder */ +$indexBuilder = $objectManager->get(IndexBuilder::class); +/** @var CatalogRuleRepositoryInterface $ruleRepository */ +$ruleRepository = $objectManager->create(CatalogRuleRepositoryInterface::class); +/** @var CollectionFactory $ruleCollectionFactory */ +$ruleCollectionFactory = $objectManager->get(CollectionFactory::class); +$ruleCollection = $ruleCollectionFactory->create(); +$ruleCollection->addFieldToFilter('name', ['eq' => 'Test Catalog Rule for logged user']); +$ruleCollection->setPageSize(1); +/** @var Rule $rule */ +$rule = $ruleCollection->getFirstItem(); +if ($rule->getId()) { + $ruleRepository->delete($rule); +} +$indexBuilder->reindexFull(); From 27a415cf85cfc30bebd810e5d037334f3fcd53e8 Mon Sep 17 00:00:00 2001 From: "ivan.pletnyov" <ivan.pletnyov@transoftgroup.com> Date: Fri, 27 Dec 2019 14:45:35 +0200 Subject: [PATCH 491/586] MC-24952: Storefront: Product custom options on product page --- .../View/Options/DateGroupDataProvider.php | 210 ++++++++++ .../View/Options/FileGroupDataProvider.php | 134 +++++++ .../View/Options/SelectGroupDataProvider.php | 363 ++++++++++++++++++ .../View/Options/TextGroupDataProvider.php | 212 ++++++++++ .../View/Options/RenderOptionsTest.php | 295 ++++++++++++++ 5 files changed, 1214 insertions(+) create mode 100644 dev/tests/integration/framework/Magento/TestFramework/Catalog/Block/Product/View/Options/DateGroupDataProvider.php create mode 100644 dev/tests/integration/framework/Magento/TestFramework/Catalog/Block/Product/View/Options/FileGroupDataProvider.php create mode 100644 dev/tests/integration/framework/Magento/TestFramework/Catalog/Block/Product/View/Options/SelectGroupDataProvider.php create mode 100644 dev/tests/integration/framework/Magento/TestFramework/Catalog/Block/Product/View/Options/TextGroupDataProvider.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Options/RenderOptionsTest.php diff --git a/dev/tests/integration/framework/Magento/TestFramework/Catalog/Block/Product/View/Options/DateGroupDataProvider.php b/dev/tests/integration/framework/Magento/TestFramework/Catalog/Block/Product/View/Options/DateGroupDataProvider.php new file mode 100644 index 0000000000000..7f9d5362c4f83 --- /dev/null +++ b/dev/tests/integration/framework/Magento/TestFramework/Catalog/Block/Product/View/Options/DateGroupDataProvider.php @@ -0,0 +1,210 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\TestFramework\Catalog\Block\Product\View\Options; + +use Magento\Catalog\Api\Data\ProductCustomOptionInterface; +use Magento\Catalog\Model\Product\Option; + +/** + * Data provider with product custom options from date group(date, date & time, time). + */ +class DateGroupDataProvider +{ + /** + * Return options data. + * + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + * + * @return array + */ + public function getData(): array + { + return [ + 'type_date_required' => [ + [ + Option::KEY_TITLE => 'Test option date title 1', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_DATE, + Option::KEY_IS_REQUIRE => 1, + Option::KEY_PRICE => 10, + Option::KEY_PRICE_TYPE => 'fixed', + Option::KEY_SKU => 'test-option-date-title-1', + ], + [ + 'block_with_required_class' => '<div class="field date required"', + 'title' => '<span>Test option date title 1</span>', + 'price' => 'data-price-amount="10"', + ], + ], + 'type_date_not_required' => [ + [ + Option::KEY_TITLE => 'Test option date title 2', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_DATE, + Option::KEY_IS_REQUIRE => 0, + Option::KEY_PRICE => 10, + Option::KEY_PRICE_TYPE => 'fixed', + Option::KEY_SKU => 'test-option-date-title-2', + ], + [ + 'block_with_required_class' => '<div class="field date"', + 'title' => '<span>Test option date title 2</span>', + 'price' => 'data-price-amount="10"', + ], + ], + 'type_date_fixed_price' => [ + [ + Option::KEY_TITLE => 'Test option date title 3', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_DATE, + Option::KEY_IS_REQUIRE => 0, + Option::KEY_PRICE => 50, + Option::KEY_PRICE_TYPE => 'fixed', + Option::KEY_SKU => 'test-option-date-title-3', + ], + [ + 'block_with_required_class' => '<div class="field date"', + 'title' => '<span>Test option date title 3</span>', + 'price' => 'data-price-amount="50"', + ], + ], + 'type_date_percent_price' => [ + [ + Option::KEY_TITLE => 'Test option date title 4', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_DATE, + Option::KEY_IS_REQUIRE => 0, + Option::KEY_PRICE => 50, + Option::KEY_PRICE_TYPE => 'percent', + Option::KEY_SKU => 'test-option-date-title-4', + ], + [ + 'block_with_required_class' => '<div class="field date"', + 'title' => '<span>Test option date title 4</span>', + 'price' => 'data-price-amount="5"', + ], + ], + 'type_date_and_time_required' => [ + [ + Option::KEY_TITLE => 'Test option date and time title 1', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_DATE_TIME, + Option::KEY_IS_REQUIRE => 1, + Option::KEY_PRICE => 10, + Option::KEY_PRICE_TYPE => 'fixed', + Option::KEY_SKU => 'test-option-date-and-time-title-1', + ], + [ + 'block_with_required_class' => '<div class="field date required"', + 'title' => '<span>Test option date and time title 1</span>', + 'price' => 'data-price-amount="10"', + ], + ], + 'type_date_and_time_not_required' => [ + [ + Option::KEY_TITLE => 'Test option date and time title 2', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_DATE_TIME, + Option::KEY_IS_REQUIRE => 0, + Option::KEY_PRICE => 10, + Option::KEY_PRICE_TYPE => 'fixed', + Option::KEY_SKU => 'test-option-date-and-time-title-2', + ], + [ + 'block_with_required_class' => '<div class="field date"', + 'title' => '<span>Test option date and time title 2</span>', + 'price' => 'data-price-amount="10"', + ], + ], + 'type_date_and_time_fixed_price' => [ + [ + Option::KEY_TITLE => 'Test option date and time title 3', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_DATE_TIME, + Option::KEY_IS_REQUIRE => 0, + Option::KEY_PRICE => 50, + Option::KEY_PRICE_TYPE => 'fixed', + Option::KEY_SKU => 'test-option-date-and-time-title-3', + ], + [ + 'block_with_required_class' => '<div class="field date"', + 'title' => '<span>Test option date and time title 3</span>', + 'price' => 'data-price-amount="50"', + ], + ], + 'type_date_and_time_percent_price' => [ + [ + Option::KEY_TITLE => 'Test option date and time title 4', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_DATE_TIME, + Option::KEY_IS_REQUIRE => 0, + Option::KEY_PRICE => 50, + Option::KEY_PRICE_TYPE => 'percent', + Option::KEY_SKU => 'test-option-date-and-time-title-4', + ], + [ + 'block_with_required_class' => '<div class="field date"', + 'title' => '<span>Test option date and time title 4</span>', + 'price' => 'data-price-amount="5"', + ], + ], + 'type_time_required' => [ + [ + Option::KEY_TITLE => 'Test option time title 1', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_TIME, + Option::KEY_IS_REQUIRE => 1, + Option::KEY_PRICE => 10, + Option::KEY_PRICE_TYPE => 'fixed', + Option::KEY_SKU => 'test-option-time-title-1', + ], + [ + 'block_with_required_class' => '<div class="field date required"', + 'title' => '<span>Test option time title 1</span>', + 'price' => 'data-price-amount="10"', + ], + ], + 'type_time_not_required' => [ + [ + Option::KEY_TITLE => 'Test option time title 2', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_TIME, + Option::KEY_IS_REQUIRE => 0, + Option::KEY_PRICE => 10, + Option::KEY_PRICE_TYPE => 'fixed', + Option::KEY_SKU => 'test-option-time-title-2', + ], + [ + 'block_with_required_class' => '<div class="field date"', + 'title' => '<span>Test option time title 2</span>', + 'price' => 'data-price-amount="10"', + ], + ], + 'type_time_fixed_price' => [ + [ + Option::KEY_TITLE => 'Test option time title 3', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_TIME, + Option::KEY_IS_REQUIRE => 0, + Option::KEY_PRICE => 50, + Option::KEY_PRICE_TYPE => 'fixed', + Option::KEY_SKU => 'test-option-time-title-3', + ], + [ + 'block_with_required_class' => '<div class="field date"', + 'title' => '<span>Test option time title 3</span>', + 'price' => 'data-price-amount="50"', + ], + ], + 'type_time_percent_price' => [ + [ + Option::KEY_TITLE => 'Test option time title 4', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_TIME, + Option::KEY_IS_REQUIRE => 0, + Option::KEY_PRICE => 50, + Option::KEY_PRICE_TYPE => 'percent', + Option::KEY_SKU => 'test-option-time-title-4', + ], + [ + 'block_with_required_class' => '<div class="field date"', + 'title' => '<span>Test option time title 4</span>', + 'price' => 'data-price-amount="5"', + ], + ], + ]; + } +} diff --git a/dev/tests/integration/framework/Magento/TestFramework/Catalog/Block/Product/View/Options/FileGroupDataProvider.php b/dev/tests/integration/framework/Magento/TestFramework/Catalog/Block/Product/View/Options/FileGroupDataProvider.php new file mode 100644 index 0000000000000..c28cb770a806e --- /dev/null +++ b/dev/tests/integration/framework/Magento/TestFramework/Catalog/Block/Product/View/Options/FileGroupDataProvider.php @@ -0,0 +1,134 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\TestFramework\Catalog\Block\Product\View\Options; + +use Magento\Catalog\Api\Data\ProductCustomOptionInterface; +use Magento\Catalog\Model\Product\Option; + +/** + * Data provider with product custom options from file group(file). + */ +class FileGroupDataProvider +{ + /** + * Return options data. + * + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + * + * @return array + */ + public function getData(): array + { + return [ + 'type_file_required' => [ + [ + Option::KEY_TITLE => 'Test option file title 1', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_FILE, + Option::KEY_IS_REQUIRE => 1, + Option::KEY_PRICE => 10, + Option::KEY_PRICE_TYPE => 'fixed', + Option::KEY_SKU => 'test-option-file-title-1', + Option::KEY_SORT_ORDER => 1, + Option::KEY_FILE_EXTENSION => 'png, jpg', + ], + [ + 'block_with_required_class' => '<div class="field file required">', + 'label_for_created_option' => '<label class="label" for="options_%s_file"', + 'title' => '<span>Test option file title 1</span>', + 'price' => 'data-price-amount="10"', + 'required_element' => '/<input type="file"/', + 'file_extension' => '<strong>png, jpg</strong>', + ], + ], + 'type_file_not_required' => [ + [ + Option::KEY_TITLE => 'Test option file title 2', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_FILE, + Option::KEY_IS_REQUIRE => 0, + Option::KEY_PRICE => 10, + Option::KEY_PRICE_TYPE => 'fixed', + Option::KEY_SKU => 'test-option-file-title-2', + Option::KEY_SORT_ORDER => 1, + Option::KEY_FILE_EXTENSION => 'png, jpg', + ], + [ + 'block_with_required_class' => '<div class="field file">', + 'label_for_created_option' => '<label class="label" for="options_%s_file"', + 'title' => '<span>Test option file title 2</span>', + 'price' => 'data-price-amount="10"', + 'required_element' => '/<input type="file"/', + 'file_extension' => '<strong>png, jpg</strong>', + ], + ], + 'type_file_fixed_price' => [ + [ + Option::KEY_TITLE => 'Test option file title 3', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_FILE, + Option::KEY_IS_REQUIRE => 0, + Option::KEY_PRICE => 50, + Option::KEY_PRICE_TYPE => 'fixed', + Option::KEY_SKU => 'test-option-file-title-3', + Option::KEY_SORT_ORDER => 1, + Option::KEY_FILE_EXTENSION => 'png, jpg', + ], + [ + 'block_with_required_class' => '<div class="field file">', + 'label_for_created_option' => '<label class="label" for="options_%s_file"', + 'title' => '<span>Test option file title 3</span>', + 'price' => 'data-price-amount="50"', + 'required_element' => '/<input type="file"/', + 'file_extension' => '<strong>png, jpg</strong>', + ], + ], + 'type_file_percent_price' => [ + [ + Option::KEY_TITLE => 'Test option file title 4', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_FILE, + Option::KEY_IS_REQUIRE => 0, + Option::KEY_PRICE => 50, + Option::KEY_PRICE_TYPE => 'percent', + Option::KEY_SKU => 'test-option-file-title-4', + Option::KEY_SORT_ORDER => 1, + Option::KEY_FILE_EXTENSION => 'png, jpg', + ], + [ + 'block_with_required_class' => '<div class="field file">', + 'label_for_created_option' => '<label class="label" for="options_%s_file"', + 'title' => '<span>Test option file title 4</span>', + 'price' => 'data-price-amount="5"', + 'required_element' => '/<input type="file"/', + 'file_extension' => '<strong>png, jpg</strong>', + ], + ], + 'type_file_with_width_and_height' => [ + [ + Option::KEY_TITLE => 'Test option file title 5', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_FILE, + Option::KEY_IS_REQUIRE => 0, + Option::KEY_PRICE => 50, + Option::KEY_PRICE_TYPE => 'percent', + Option::KEY_SKU => 'test-option-file-title-5', + Option::KEY_SORT_ORDER => 1, + Option::KEY_FILE_EXTENSION => 'png, jpg', + Option::KEY_IMAGE_SIZE_X => 10, + Option::KEY_IMAGE_SIZE_Y => 81, + ], + [ + 'block_with_required_class' => '<div class="field file">', + 'label_for_created_option' => '<label class="label" for="options_%s_file"', + 'title' => '<span>Test option file title 5</span>', + 'price' => 'data-price-amount="5"', + 'required_element' => '/<input type="file"/', + 'file_extension' => '<strong>png, jpg</strong>', + 'file_width' => '/%s:.*<strong>10 px.<\/strong>/', + 'file_height' => '/%s:.*<strong>81 px.<\/strong>/', + ], + ], + ]; + } +} diff --git a/dev/tests/integration/framework/Magento/TestFramework/Catalog/Block/Product/View/Options/SelectGroupDataProvider.php b/dev/tests/integration/framework/Magento/TestFramework/Catalog/Block/Product/View/Options/SelectGroupDataProvider.php new file mode 100644 index 0000000000000..2a13c1cd45466 --- /dev/null +++ b/dev/tests/integration/framework/Magento/TestFramework/Catalog/Block/Product/View/Options/SelectGroupDataProvider.php @@ -0,0 +1,363 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\TestFramework\Catalog\Block\Product\View\Options; + +use Magento\Catalog\Api\Data\ProductCustomOptionInterface; +use Magento\Catalog\Model\Product\Option; +use Magento\Catalog\Model\Product\Option\Value; + +/** + * Data provider with product custom options from select group(drop-down, radio buttons, checkbox, multiple select). + */ +class SelectGroupDataProvider +{ + /** + * Return options data. + * + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + * + * @return array + */ + public function getData(): array + { + return [ + 'type_drop_down_required' => [ + [ + Option::KEY_TITLE => 'Test option drop-down title 1', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_DROP_DOWN, + Option::KEY_IS_REQUIRE => 1, + ], + [ + Value::KEY_TITLE => 'Test option drop-down title 1 value 1', + Value::KEY_PRICE => 10, + Value::KEY_PRICE_TYPE => 'fixed', + Value::KEY_SKU => 'test-option-drop-down-title-1-value-1', + ], + [ + 'block_with_required_class' => '<div class="field required">', + 'label_for_created_option' => '<label class="label" for="select_%s">', + 'title' => '<span>Test option drop-down title 1</span>', + 'required_element' => '/<select/', + 'option_value_item' => '/<option value="%s" price="10" >%s \+\s{11}\$10.00.*/', + 'not_contain_arr' => [ + '/<select.*multiple="multiple"/', + ], + ], + ], + 'type_drop_down_not_required' => [ + [ + Option::KEY_TITLE => 'Test option drop-down title 2', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_DROP_DOWN, + Option::KEY_IS_REQUIRE => 0, + ], + [ + Value::KEY_TITLE => 'Test option drop-down title 2 value 1', + Value::KEY_PRICE => 10, + Value::KEY_PRICE_TYPE => 'fixed', + Value::KEY_SKU => 'test-option-drop-down-title-2-value-1', + ], + [ + 'block_with_required_class' => '<div class="field">', + 'label_for_created_option' => '<label class="label" for="select_%s">', + 'title' => '<span>Test option drop-down title 2</span>', + 'required_element' => '/<select/', + 'option_value_item' => '/<option value="%s" price="10" >%s \+\s{11}\$10.00.*/', + 'not_contain_arr' => [ + '/<select.*multiple="multiple"/', + ], + ], + ], + 'type_drop_down_value_fixed_price' => [ + [ + Option::KEY_TITLE => 'Test option drop-down title 3', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_DROP_DOWN, + Option::KEY_IS_REQUIRE => 0, + ], + [ + Value::KEY_TITLE => 'Test option drop-down title 3 value 1', + Value::KEY_PRICE => 50, + Value::KEY_PRICE_TYPE => 'fixed', + Value::KEY_SKU => 'test-option-drop-down-title-3-value-1', + ], + [ + 'block_with_required_class' => '<div class="field">', + 'label_for_created_option' => '<label class="label" for="select_%s">', + 'title' => '<span>Test option drop-down title 3</span>', + 'required_element' => '/<select/', + 'option_value_item' => '/<option value="%s" price="50" >%s \+\s{11}\$50.00.*/', + 'not_contain_arr' => [ + '/<select.*multiple="multiple"/', + ], + ], + ], + 'type_drop_down_value_percent_price' => [ + [ + Option::KEY_TITLE => 'Test option drop-down title 4', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_DROP_DOWN, + Option::KEY_IS_REQUIRE => 0, + ], + [ + Value::KEY_TITLE => 'Test option drop-down title 4 value 1', + Value::KEY_PRICE => 50, + Value::KEY_PRICE_TYPE => 'percent', + Value::KEY_SKU => 'test-option-drop-down-title-4-value-1', + ], + [ + 'block_with_required_class' => '<div class="field">', + 'label_for_created_option' => '<label class="label" for="select_%s">', + 'title' => '<span>Test option drop-down title 4</span>', + 'required_element' => '/<select/', + 'option_value_item' => '/<option value="%s" price="5" >%s \+\s{11}\$5.00.*/', + 'not_contain_arr' => [ + '/<select.*multiple="multiple"/', + ], + ], + ], + 'type_radio_button_required' => [ + [ + Option::KEY_TITLE => 'Test option radio-button title 1', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_RADIO, + Option::KEY_IS_REQUIRE => 1, + ], + [ + Value::KEY_TITLE => 'Test option radio-button title 1 value 1', + Value::KEY_PRICE => 10, + Value::KEY_PRICE_TYPE => 'fixed', + Value::KEY_SKU => 'test-option-radio-button-title-1-value-1', + ], + [ + 'block_with_required_class' => '<div class="field required">', + 'label_for_created_option' => '<label class="label" for="select_%s">', + 'title' => '<span>Test option radio-button title 1</span>', + 'required_element' => '/<input type="radio"/', + 'price' => 'data-price-amount="10"', + ], + ], + 'type_radio_button_not_required' => [ + [ + Option::KEY_TITLE => 'Test option radio-button title 2', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_RADIO, + Option::KEY_IS_REQUIRE => 0, + ], + [ + Value::KEY_TITLE => 'Test option radio-button title 2 value 1', + Value::KEY_PRICE => 10, + Value::KEY_PRICE_TYPE => 'fixed', + Value::KEY_SKU => 'test-option-radio-button-title-2-value-1', + ], + [ + 'block_with_required_class' => '<div class="field">', + 'label_for_created_option' => '<label class="label" for="select_%s">', + 'title' => '<span>Test option radio-button title 2</span>', + 'required_element' => '/<input type="radio"/', + 'price' => 'data-price-amount="10"', + ], + ], + 'type_radio_button_value_fixed_price' => [ + [ + Option::KEY_TITLE => 'Test option radio-button title 3', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_RADIO, + Option::KEY_IS_REQUIRE => 0, + ], + [ + Value::KEY_TITLE => 'Test option radio-button title 3 value 1', + Value::KEY_PRICE => 50, + Value::KEY_PRICE_TYPE => 'fixed', + Value::KEY_SKU => 'test-option-radio-button-title-3-value-1', + ], + [ + 'block_with_required_class' => '<div class="field">', + 'label_for_created_option' => '<label class="label" for="select_%s">', + 'title' => '<span>Test option radio-button title 3</span>', + 'required_element' => '/<input type="radio"/', + 'price' => 'data-price-amount="50"', + ], + ], + 'type_radio_button_value_percent_price' => [ + [ + Option::KEY_TITLE => 'Test option radio-button title 4', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_RADIO, + Option::KEY_IS_REQUIRE => 0, + ], + [ + Value::KEY_TITLE => 'Test option radio-button title 4 value 1', + Value::KEY_PRICE => 50, + Value::KEY_PRICE_TYPE => 'percent', + Value::KEY_SKU => 'test-option-radio-button-title-4-value-1', + ], + [ + 'block_with_required_class' => '<div class="field">', + 'label_for_created_option' => '<label class="label" for="select_%s">', + 'title' => '<span>Test option radio-button title 4</span>', + 'required_element' => '/<input type="radio"/', + 'price' => 'data-price-amount="5"', + ], + ], + 'type_checkbox_required' => [ + [ + Option::KEY_TITLE => 'Test option checkbox title 1', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_CHECKBOX, + Option::KEY_IS_REQUIRE => 1, + ], + [ + Value::KEY_TITLE => 'Test option checkbox title 1 value 1', + Value::KEY_PRICE => 10, + Value::KEY_PRICE_TYPE => 'fixed', + Value::KEY_SKU => 'test-option-checkbox-title-1-value-1', + ], + [ + 'block_with_required_class' => '<div class="field required">', + 'label_for_created_option' => '<label class="label" for="select_%s">', + 'title' => '<span>Test option checkbox title 1</span>', + 'required_element' => '/<input type="checkbox"/', + 'price' => 'data-price-amount="10"', + ], + ], + 'type_checkbox_not_required' => [ + [ + Option::KEY_TITLE => 'Test option checkbox title 2', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_CHECKBOX, + Option::KEY_IS_REQUIRE => 0, + ], + [ + Value::KEY_TITLE => 'Test option checkbox title 2 value 1', + Value::KEY_PRICE => 10, + Value::KEY_PRICE_TYPE => 'fixed', + Value::KEY_SKU => 'test-option-checkbox-title-2-value-1', + ], + [ + 'block_with_required_class' => '<div class="field">', + 'label_for_created_option' => '<label class="label" for="select_%s">', + 'title' => '<span>Test option checkbox title 2</span>', + 'required_element' => '/<input type="checkbox"/', + 'price' => 'data-price-amount="10"', + ], + ], + 'type_checkbox_value_fixed_price' => [ + [ + Option::KEY_TITLE => 'Test option checkbox title 3', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_CHECKBOX, + Option::KEY_IS_REQUIRE => 0, + ], + [ + Value::KEY_TITLE => 'Test option checkbox title 3 value 1', + Value::KEY_PRICE => 50, + Value::KEY_PRICE_TYPE => 'fixed', + Value::KEY_SKU => 'test-option-checkbox-title-3-value-1', + ], + [ + 'block_with_required_class' => '<div class="field">', + 'label_for_created_option' => '<label class="label" for="select_%s">', + 'title' => '<span>Test option checkbox title 3</span>', + 'required_element' => '/<input type="checkbox"/', + 'price' => 'data-price-amount="50"', + ], + ], + 'type_checkbox_value_percent_price' => [ + [ + Option::KEY_TITLE => 'Test option checkbox title 4', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_CHECKBOX, + Option::KEY_IS_REQUIRE => 0, + ], + [ + Value::KEY_TITLE => 'Test option checkbox title 4 value 1', + Value::KEY_PRICE => 50, + Value::KEY_PRICE_TYPE => 'percent', + Value::KEY_SKU => 'test-option-checkbox-title-4-value-1', + ], + [ + 'block_with_required_class' => '<div class="field">', + 'label_for_created_option' => '<label class="label" for="select_%s">', + 'title' => '<span>Test option checkbox title 4</span>', + 'required_element' => '/<input type="checkbox"/', + 'price' => 'data-price-amount="5"', + ], + ], + 'type_multiselect_required' => [ + [ + Option::KEY_TITLE => 'Test option multiselect title 1', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_MULTIPLE, + Option::KEY_IS_REQUIRE => 1, + ], + [ + Value::KEY_TITLE => 'Test option multiselect title 1 value 1', + Value::KEY_PRICE => 10, + Value::KEY_PRICE_TYPE => 'fixed', + Value::KEY_SKU => 'test-option-multiselect-title-1-value-1', + ], + [ + 'block_with_required_class' => '<div class="field required">', + 'label_for_created_option' => '<label class="label" for="select_%s">', + 'title' => '<span>Test option multiselect title 1</span>', + 'required_element' => '/<select.*multiple="multiple"/', + 'option_value_item' => '/<option value="%s" price="10" >%s \+\s{11}\$10.00.*/', + ], + ], + 'type_multiselect_not_required' => [ + [ + Option::KEY_TITLE => 'Test option multiselect title 2', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_MULTIPLE, + Option::KEY_IS_REQUIRE => 0, + ], + [ + Value::KEY_TITLE => 'Test option multiselect title 2 value 1', + Value::KEY_PRICE => 10, + Value::KEY_PRICE_TYPE => 'fixed', + Value::KEY_SKU => 'test-option-multiselect-title-2-value-1', + ], + [ + 'block_with_required_class' => '<div class="field">', + 'label_for_created_option' => '<label class="label" for="select_%s">', + 'title' => '<span>Test option multiselect title 2</span>', + 'required_element' => '/<select.*multiple="multiple"/', + 'option_value_item' => '/<option value="%s" price="10" >%s \+\s{11}\$10.00.*/', + ], + ], + 'type_multiselect_value_fixed_price' => [ + [ + Option::KEY_TITLE => 'Test option multiselect title 3', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_MULTIPLE, + Option::KEY_IS_REQUIRE => 0, + ], + [ + Value::KEY_TITLE => 'Test option multiselect title 3 value 1', + Value::KEY_PRICE => 50, + Value::KEY_PRICE_TYPE => 'fixed', + Value::KEY_SKU => 'test-option-multiselect-title-3-value-1', + ], + [ + 'block_with_required_class' => '<div class="field">', + 'label_for_created_option' => '<label class="label" for="select_%s">', + 'title' => '<span>Test option multiselect title 3</span>', + 'required_element' => '/<select.*multiple="multiple"/', + 'option_value_item' => '/<option value="%s" price="50" >%s \+\s{11}\$50.00.*/', + ], + ], + 'type_multiselect_value_percent_price' => [ + [ + Option::KEY_TITLE => 'Test option multiselect title 4', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_MULTIPLE, + Option::KEY_IS_REQUIRE => 0, + ], + [ + Value::KEY_TITLE => 'Test option multiselect title 4 value 1', + Value::KEY_PRICE => 50, + Value::KEY_PRICE_TYPE => 'percent', + Value::KEY_SKU => 'test-option-multiselect-title-4-value-1', + ], + [ + 'block_with_required_class' => '<div class="field">', + 'label_for_created_option' => '<label class="label" for="select_%s">', + 'title' => '<span>Test option multiselect title 4</span>', + 'required_element' => '/<select.*multiple="multiple"/', + 'option_value_item' => '/<option value="%s" price="5" >%s \+\s{11}\$5.00.*/', + ], + ], + ]; + } +} diff --git a/dev/tests/integration/framework/Magento/TestFramework/Catalog/Block/Product/View/Options/TextGroupDataProvider.php b/dev/tests/integration/framework/Magento/TestFramework/Catalog/Block/Product/View/Options/TextGroupDataProvider.php new file mode 100644 index 0000000000000..75a6da0593d73 --- /dev/null +++ b/dev/tests/integration/framework/Magento/TestFramework/Catalog/Block/Product/View/Options/TextGroupDataProvider.php @@ -0,0 +1,212 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\TestFramework\Catalog\Block\Product\View\Options; + +use Magento\Catalog\Api\Data\ProductCustomOptionInterface; +use Magento\Catalog\Model\Product\Option; + +/** + * Data provider with product custom options from text group(field, area). + */ +class TextGroupDataProvider +{ + /** + * Return options data. + * + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + * + * @return array + */ + public function getData(): array + { + return [ + 'type_field_required' => [ + [ + Option::KEY_TITLE => 'Test option field title 1', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_FIELD, + Option::KEY_IS_REQUIRE => 1, + Option::KEY_PRICE => 10, + Option::KEY_PRICE_TYPE => 'fixed', + Option::KEY_SKU => 'test-option-field-title-1', + Option::KEY_MAX_CHARACTERS => 0, + ], + [ + 'block_with_required_class' => '<div class="field required">', + 'label_for_created_option' => '<label class="label" for="options_%s_text">', + 'title' => '<span>Test option field title 1</span>', + 'price' => 'data-price-amount="10"', + 'required_element' => '/<input type="text"/', + ], + ], + 'type_field_not_required' => [ + [ + Option::KEY_TITLE => 'Test option field title 2', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_FIELD, + Option::KEY_IS_REQUIRE => 0, + Option::KEY_PRICE => 10, + Option::KEY_PRICE_TYPE => 'fixed', + Option::KEY_SKU => 'test-option-field-title-2', + Option::KEY_MAX_CHARACTERS => 0, + ], + [ + 'block_with_required_class' => '<div class="field">', + 'label_for_created_option' => '<label class="label" for="options_%s_text">', + 'title' => '<span>Test option field title 2</span>', + 'price' => 'data-price-amount="10"', + 'required_element' => '/<input type="text"/', + ], + ], + 'type_field_fixed_price' => [ + [ + Option::KEY_TITLE => 'Test option field title 3', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_FIELD, + Option::KEY_IS_REQUIRE => 0, + Option::KEY_PRICE => 50, + Option::KEY_PRICE_TYPE => 'fixed', + Option::KEY_SKU => 'test-option-field-title-3', + Option::KEY_MAX_CHARACTERS => 0, + ], + [ + 'block_with_required_class' => '<div class="field">', + 'label_for_created_option' => '<label class="label" for="options_%s_text">', + 'title' => '<span>Test option field title 3</span>', + 'price' => 'data-price-amount="50"', + 'required_element' => '/<input type="text"/', + ], + ], + 'type_field_percent_price' => [ + [ + Option::KEY_TITLE => 'Test option field title 4', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_FIELD, + Option::KEY_IS_REQUIRE => 0, + Option::KEY_PRICE => 50, + Option::KEY_PRICE_TYPE => 'percent', + Option::KEY_SKU => 'test-option-field-title-4', + Option::KEY_MAX_CHARACTERS => 0, + ], + [ + 'block_with_required_class' => '<div class="field">', + 'label_for_created_option' => '<label class="label" for="options_%s_text">', + 'title' => '<span>Test option field title 4</span>', + 'price' => 'data-price-amount="5"', + 'required_element' => '/<input type="text"/', + ], + ], + 'type_field_max_characters' => [ + [ + Option::KEY_TITLE => 'Test option field title 5', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_FIELD, + Option::KEY_IS_REQUIRE => 0, + Option::KEY_PRICE => 10, + Option::KEY_PRICE_TYPE => 'fixed', + Option::KEY_SKU => 'test-option-field-title-5', + Option::KEY_MAX_CHARACTERS => 99, + ], + [ + 'block_with_required_class' => '<div class="field">', + 'label_for_created_option' => '<label class="label" for="options_%s_text">', + 'title' => '<span>Test option field title 5</span>', + 'price' => 'data-price-amount="10"', + 'required_element' => '/<input type="text"/', + 'max_characters' => 'Maximum 99 characters', + ], + ], + 'type_area_required' => [ + [ + Option::KEY_TITLE => 'Test option area title 1', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_AREA, + Option::KEY_IS_REQUIRE => 1, + Option::KEY_PRICE => 10, + Option::KEY_PRICE_TYPE => 'fixed', + Option::KEY_SKU => 'test-option-area-title-1', + Option::KEY_MAX_CHARACTERS => 0, + ], + [ + 'block_with_required_class' => '<div class="field textarea required">', + 'label_for_created_option' => '<label class="label" for="options_%s_text">', + 'title' => '<span>Test option area title 1</span>', + 'price' => 'data-price-amount="10"', + 'required_element' => '/<textarea/', + ], + ], + 'type_area_not_required' => [ + [ + Option::KEY_TITLE => 'Test option area title 2', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_AREA, + Option::KEY_IS_REQUIRE => 0, + Option::KEY_PRICE => 10, + Option::KEY_PRICE_TYPE => 'fixed', + Option::KEY_SKU => 'test-option-area-title-2', + Option::KEY_MAX_CHARACTERS => 0, + ], + [ + 'block_with_required_class' => '<div class="field textarea">', + 'label_for_created_option' => '<label class="label" for="options_%s_text">', + 'title' => '<span>Test option area title 2</span>', + 'price' => 'data-price-amount="10"', + 'required_element' => '/<textarea/', + ], + ], + 'type_area_fixed_price' => [ + [ + Option::KEY_TITLE => 'Test option area title 3', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_AREA, + Option::KEY_IS_REQUIRE => 0, + Option::KEY_PRICE => 50, + Option::KEY_PRICE_TYPE => 'fixed', + Option::KEY_SKU => 'test-option-area-title-3', + Option::KEY_MAX_CHARACTERS => 0, + ], + [ + 'block_with_required_class' => '<div class="field textarea">', + 'label_for_created_option' => '<label class="label" for="options_%s_text">', + 'title' => '<span>Test option area title 3</span>', + 'price' => 'data-price-amount="50"', + 'required_element' => '/<textarea/', + ], + ], + 'type_area_percent_price' => [ + [ + Option::KEY_TITLE => 'Test option area title 4', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_AREA, + Option::KEY_IS_REQUIRE => 0, + Option::KEY_PRICE => 50, + Option::KEY_PRICE_TYPE => 'percent', + Option::KEY_SKU => 'test-option-area-title-4', + Option::KEY_MAX_CHARACTERS => 0, + ], + [ + 'block_with_required_class' => '<div class="field textarea">', + 'label_for_created_option' => '<label class="label" for="options_%s_text">', + 'title' => '<span>Test option area title 4</span>', + 'price' => 'data-price-amount="5"', + 'required_element' => '/<textarea/', + ], + ], + 'type_area_max_characters' => [ + [ + Option::KEY_TITLE => 'Test option area title 5', + Option::KEY_TYPE => ProductCustomOptionInterface::OPTION_TYPE_AREA, + Option::KEY_IS_REQUIRE => 0, + Option::KEY_PRICE => 10, + Option::KEY_PRICE_TYPE => 'fixed', + Option::KEY_SKU => 'test-option-area-title-5', + Option::KEY_MAX_CHARACTERS => 99, + ], + [ + 'block_with_required_class' => '<div class="field textarea">', + 'label_for_created_option' => '<label class="label" for="options_%s_text">', + 'title' => '<span>Test option area title 5</span>', + 'price' => 'data-price-amount="10"', + 'required_element' => '/<textarea/', + 'max_characters' => 'Maximum 99 characters', + ], + ], + ]; + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Options/RenderOptionsTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Options/RenderOptionsTest.php new file mode 100644 index 0000000000000..e83563a6ad474 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Options/RenderOptionsTest.php @@ -0,0 +1,295 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Block\Product\View\Options; + +use Magento\Catalog\Api\Data\ProductCustomOptionInterface; +use Magento\Catalog\Api\Data\ProductCustomOptionInterfaceFactory; +use Magento\Catalog\Api\Data\ProductCustomOptionValuesInterfaceFactory; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Block\Product\View\Options; +use Magento\Catalog\Model\Product\Option; +use Magento\Catalog\Model\Product\Option\Value; +use Magento\Framework\View\Element\Template; +use Magento\Framework\View\Result\Page; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Helper\CacheCleaner; +use Magento\TestFramework\ObjectManager; +use PHPUnit\Framework\TestCase; + +/** + * Assert that product custom options render as expected. + * + * @magentoDbIsolation disabled + * @magentoAppArea frontend + */ +class RenderOptionsTest extends TestCase +{ + /** + * @var ObjectManager + */ + private $objectManager; + + /** + * @var ProductRepositoryInterface + */ + private $productRepository; + + /** + * @var ProductCustomOptionInterfaceFactory + */ + private $productCustomOptionFactory; + + /** + * @var ProductCustomOptionValuesInterfaceFactory + */ + private $productCustomOptionValuesFactory; + + /** + * @var Page + */ + private $page; + + /** + * @inheritdoc + */ + protected function setUp() + { + CacheCleaner::cleanAll(); + $this->objectManager = Bootstrap::getObjectManager(); + $this->productRepository = $this->objectManager->create(ProductRepositoryInterface::class); + $this->productCustomOptionFactory = $this->objectManager->get(ProductCustomOptionInterfaceFactory::class); + $this->productCustomOptionValuesFactory = $this->objectManager->get( + ProductCustomOptionValuesInterfaceFactory::class + ); + $this->page = $this->objectManager->create(Page::class); + parent::setUp(); + } + + /** + * Check that options from text group(field, area) render as expected. + * + * @magentoDataFixture Magento/Catalog/_files/product_without_options_with_stock_data.php + * @dataProvider \Magento\TestFramework\Catalog\Block\Product\View\Options\TextGroupDataProvider::getData() + * + * @param array $optionData + * @param array $checkArray + * @return void + */ + public function testRenderCustomOptionsFromTextGroup(array $optionData, array $checkArray): void + { + $option = $this->addOptionToProduct($optionData); + $optionHtml = $this->getOptionHtml(); + $this->baseOptionAsserts($option, $optionHtml, $checkArray); + + if ($optionData[Option::KEY_MAX_CHARACTERS] > 0) { + $this->assertContains($checkArray['max_characters'], $optionHtml); + } else { + $this->assertNotContains('class="character-counter', $optionHtml); + } + } + + /** + * Check that options from file group(file) render as expected. + * + * @magentoDataFixture Magento/Catalog/_files/product_without_options_with_stock_data.php + * @dataProvider \Magento\TestFramework\Catalog\Block\Product\View\Options\FileGroupDataProvider::getData() + * + * @param array $optionData + * @param array $checkArray + * @return void + */ + public function testRenderCustomOptionsFromFileGroup(array $optionData, array $checkArray): void + { + $option = $this->addOptionToProduct($optionData); + $optionHtml = $this->getOptionHtml(); + $this->baseOptionAsserts($option, $optionHtml, $checkArray); + $this->assertContains($checkArray['file_extension'], $optionHtml); + + if (isset($checkArray['file_width'])) { + $checkArray['file_width'] = sprintf($checkArray['file_width'], __('Maximum image width')); + $this->assertRegExp($checkArray['file_width'], $optionHtml); + } + + if (isset($checkArray['file_height'])) { + $checkArray['file_height'] = sprintf($checkArray['file_height'], __('Maximum image height')); + $this->assertRegExp($checkArray['file_height'], $optionHtml); + } + } + + /** + * Check that options from select group(drop-down, radio buttons, checkbox, multiple select) render as expected. + * + * @magentoDataFixture Magento/Catalog/_files/product_without_options_with_stock_data.php + * @dataProvider \Magento\TestFramework\Catalog\Block\Product\View\Options\SelectGroupDataProvider::getData() + * + * @param array $optionData + * @param array $optionValueData + * @param array $checkArray + * @return void + */ + public function testRenderCustomOptionsFromSelectGroup( + array $optionData, + array $optionValueData, + array $checkArray + ): void { + $option = $this->addOptionToProduct($optionData, $optionValueData); + $optionValues = $option->getValues(); + $optionValue = reset($optionValues); + $optionHtml = $this->getOptionHtml(); + $this->baseOptionAsserts($option, $optionHtml, $checkArray); + + if (isset($checkArray['not_contain_arr'])) { + foreach ($checkArray['not_contain_arr'] as $notContainPattern) { + $this->assertNotRegExp($notContainPattern, $optionHtml); + } + } + + if (isset($checkArray['option_value_item'])) { + $checkArray['option_value_item'] = sprintf( + $checkArray['option_value_item'], + $optionValue->getOptionTypeId(), + $optionValueData[Value::KEY_TITLE] + ); + $this->assertRegExp($checkArray['option_value_item'], $optionHtml); + } + } + + /** + * Check that options from date group(date, date & time, time) render as expected. + * + * @magentoDataFixture Magento/Catalog/_files/product_without_options_with_stock_data.php + * @dataProvider \Magento\TestFramework\Catalog\Block\Product\View\Options\DateGroupDataProvider::getData() + * + * @param array $optionData + * @param array $checkArray + * @return void + */ + public function testRenderCustomOptionsFromDateGroup(array $optionData, array $checkArray): void + { + $option = $this->addOptionToProduct($optionData); + $optionHtml = $this->getOptionHtml(); + $this->baseOptionAsserts($option, $optionHtml, $checkArray); + + switch ($optionData[Option::KEY_TYPE]) { + case ProductCustomOptionInterface::OPTION_TYPE_DATE: + $this->assertContains("<select name=\"options[{$option->getOptionId()}][month]\"", $optionHtml); + $this->assertContains("<select name=\"options[{$option->getOptionId()}][day]\"", $optionHtml); + $this->assertContains("<select name=\"options[{$option->getOptionId()}][year]\"", $optionHtml); + $this->assertNotContains("<select name=\"options[{$option->getOptionId()}][hour]\"", $optionHtml); + $this->assertNotContains("<select name=\"options[{$option->getOptionId()}][minute]\"", $optionHtml); + $this->assertNotContains("<select name=\"options[{$option->getOptionId()}][day_part]\"", $optionHtml); + break; + case ProductCustomOptionInterface::OPTION_TYPE_DATE_TIME: + $this->assertContains("<select name=\"options[{$option->getOptionId()}][month]\"", $optionHtml); + $this->assertContains("<select name=\"options[{$option->getOptionId()}][day]\"", $optionHtml); + $this->assertContains("<select name=\"options[{$option->getOptionId()}][year]\"", $optionHtml); + $this->assertContains("<select name=\"options[{$option->getOptionId()}][hour]\"", $optionHtml); + $this->assertContains("<select name=\"options[{$option->getOptionId()}][minute]\"", $optionHtml); + $this->assertContains("<select name=\"options[{$option->getOptionId()}][day_part]\"", $optionHtml); + break; + case ProductCustomOptionInterface::OPTION_TYPE_TIME: + $this->assertNotContains("<select name=\"options[{$option->getOptionId()}][month]\"", $optionHtml); + $this->assertNotContains("<select name=\"options[{$option->getOptionId()}][day]\"", $optionHtml); + $this->assertNotContains("<select name=\"options[{$option->getOptionId()}][year]\"", $optionHtml); + $this->assertContains("<select name=\"options[{$option->getOptionId()}][hour]\"", $optionHtml); + $this->assertContains("<select name=\"options[{$option->getOptionId()}][minute]\"", $optionHtml); + $this->assertContains("<select name=\"options[{$option->getOptionId()}][day_part]\"", $optionHtml); + break; + } + } + + /** + * Base asserts for rendered options. + * + * @param ProductCustomOptionInterface $option + * @param string $optionHtml + * @param array $checkArray + * @return void + */ + private function baseOptionAsserts( + ProductCustomOptionInterface $option, + string $optionHtml, + array $checkArray + ): void { + $this->assertContains($checkArray['block_with_required_class'], $optionHtml); + $this->assertContains($checkArray['title'], $optionHtml); + + if (isset($checkArray['label_for_created_option'])) { + $checkArray['label_for_created_option'] = sprintf( + $checkArray['label_for_created_option'], + $option->getOptionId() + ); + $this->assertContains($checkArray['label_for_created_option'], $optionHtml); + } + + if (isset($checkArray['price'])) { + $this->assertContains($checkArray['price'], $optionHtml); + } + + if (isset($checkArray['required_element'])) { + $this->assertRegExp($checkArray['required_element'], $optionHtml); + } + } + + /** + * Add custom option to product with data. + * + * @param array $optionData + * @param array $optionValueData + * @return ProductCustomOptionInterface + */ + private function addOptionToProduct(array $optionData, array $optionValueData = []): ProductCustomOptionInterface + { + $product = $this->productRepository->get('simple'); + $optionData[Option::KEY_PRODUCT_SKU] = $product->getSku(); + + if (!empty($optionValueData)) { + $optionValueData = $this->productCustomOptionValuesFactory->create(['data' => $optionValueData]); + $optionData['values'] = [$optionValueData]; + } + + $option = $this->productCustomOptionFactory->create(['data' => $optionData]); + $product->setOptions([$option]); + $createdOptions = $this->productRepository->save($product)->getOptions(); + + return reset($createdOptions); + } + + /** + * Render custom options block. + * + * @return string + */ + private function getOptionHtml(): string + { + $product = $this->productRepository->get('simple'); + $optionsBlock = $this->getOptionsBlock(); + $optionsBlock->setProduct($product); + + return $optionsBlock->toHtml(); + } + + /** + * Get options block. + * + * @return Options + */ + private function getOptionsBlock(): Options + { + $this->page->addHandle([ + 'default', + 'catalog_product_view', + ]); + $this->page->getLayout()->generateXml(); + /** @var Template $productInfoFormOptionsBlock */ + $productInfoFormOptionsBlock = $this->page->getLayout()->getBlock('product.info.form.options'); + $optionsWrapperBlock = $productInfoFormOptionsBlock->getChildBlock('product_options_wrapper'); + + return $optionsWrapperBlock->getChildBlock('product_options'); + } +} From bc6ec62c9c361a2ad12013127062d123c24d7edc Mon Sep 17 00:00:00 2001 From: "ivan.pletnyov" <ivan.pletnyov@transoftgroup.com> Date: Fri, 27 Dec 2019 14:52:28 +0200 Subject: [PATCH 492/586] MC-24931: Admin: Delete product attribute --- .../AbstractDeleteAttributeControllerTest.php | 83 ++++++++++ .../CatalogAttributesControllerTest.php | 145 ++++++++++++++++++ .../DeleteAttributeControllerErrorTest.php | 79 ++++++++++ .../_files/product_texteditor_attribute.php | 51 ++++++ .../product_texteditor_attribute_rollback.php | 27 ++++ .../SwatchesAttributesControllerTest.php | 48 ++++++ .../Delete/WeeeAttributesControllerTest.php | 34 ++++ 7 files changed, 467 insertions(+) create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Delete/AbstractDeleteAttributeControllerTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Delete/CatalogAttributesControllerTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Delete/DeleteAttributeControllerErrorTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Eav/_files/product_texteditor_attribute.php create mode 100644 dev/tests/integration/testsuite/Magento/Eav/_files/product_texteditor_attribute_rollback.php create mode 100644 dev/tests/integration/testsuite/Magento/Swatches/Controller/Adminhtml/Product/Attribute/Delete/SwatchesAttributesControllerTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Weee/Controller/Adminhtml/Product/Attribute/Delete/WeeeAttributesControllerTest.php diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Delete/AbstractDeleteAttributeControllerTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Delete/AbstractDeleteAttributeControllerTest.php new file mode 100644 index 0000000000000..6f1ff8567349f --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Delete/AbstractDeleteAttributeControllerTest.php @@ -0,0 +1,83 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Controller\Adminhtml\Product\Attribute\Delete; + +use Magento\Catalog\Api\ProductAttributeRepositoryInterface; +use Magento\Framework\App\Request\Http; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Message\MessageInterface; +use Magento\TestFramework\TestCase\AbstractBackendController; + +/** + * Abstract delete attribute test using catalog/product_attribute/delete controller action. + */ +abstract class AbstractDeleteAttributeControllerTest extends AbstractBackendController +{ + /** + * @var string + */ + protected $uri = 'backend/catalog/product_attribute/delete/attribute_id/%s'; + + /** + * @var ProductAttributeRepositoryInterface + */ + private $productAttributeRepository; + + /** + * @inheritdoc + */ + protected function setUp() + { + parent::setUp(); + $this->productAttributeRepository = $this->_objectManager->get(ProductAttributeRepositoryInterface::class); + } + + /** + * Delete attribute via controller action. + * + * @param string $attributeCode + * @return void + */ + protected function dispatchDeleteAttribute(string $attributeCode): void + { + $attribute = $this->productAttributeRepository->get($attributeCode); + $this->getRequest()->setMethod(Http::METHOD_POST); + $this->dispatch(sprintf($this->uri, $attribute->getAttributeId())); + $this->assertSessionMessages( + $this->equalTo([(string)__('You deleted the product attribute.')]), + MessageInterface::TYPE_SUCCESS + ); + } + + /** + * Assert that attribute is deleted from DB. + * + * @param string $attributeCode + * @return void + */ + protected function assertAttributeIsDeleted(string $attributeCode): void + { + $this->expectExceptionObject( + new NoSuchEntityException( + __( + 'The attribute with a "%1" attributeCode doesn\'t exist. Verify the attribute and try again.', + $attributeCode + ) + ) + ); + $this->productAttributeRepository->get($attributeCode); + } + + /** + * @inheritdoc + */ + public function testAclHasAccess() + { + $this->markTestIncomplete('AclHasAccess test is not complete'); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Delete/CatalogAttributesControllerTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Delete/CatalogAttributesControllerTest.php new file mode 100644 index 0000000000000..e95737209cb7f --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Delete/CatalogAttributesControllerTest.php @@ -0,0 +1,145 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Controller\Adminhtml\Product\Attribute\Delete; + +/** + * Delete catalog product attributes with input types like "media_image", "price", + * "date", "select", "multiselect", "textarea", "texteditor", "text" and "boolean". + * Attributes from Magento_Catalog and Magento_Eav modules. + * + * @magentoAppArea adminhtml + * @magentoDbIsolation enabled + */ +class CatalogAttributesControllerTest extends AbstractDeleteAttributeControllerTest +{ + /** + * Assert that attribute with input type "media_image" will be deleted + * after dispatch delete product attribute action. + * + * @magentoDataFixture Magento/Catalog/_files/product_image_attribute.php + * + * @return void + */ + public function testDeleteMediaImageAttribute(): void + { + $this->dispatchDeleteAttribute('image_attribute'); + $this->assertAttributeIsDeleted('image_attribute'); + } + + /** + * Assert that attribute with input type "price" will be deleted + * after dispatch delete product attribute action. + * + * @magentoDataFixture Magento/Catalog/_files/product_decimal_attribute.php + * + * @return void + */ + public function testDeletePriceAttribute(): void + { + $this->dispatchDeleteAttribute('decimal_attribute'); + $this->assertAttributeIsDeleted('decimal_attribute'); + } + + /** + * Assert that attribute with input type "date" will be deleted + * after dispatch delete product attribute action. + * + * @magentoDataFixture Magento/Catalog/_files/product_date_attribute.php + * + * @return void + */ + public function testDeleteDateAttribute(): void + { + $this->dispatchDeleteAttribute('date_attribute'); + $this->assertAttributeIsDeleted('date_attribute'); + } + + /** + * Assert that attribute with input type "select" will be deleted + * after dispatch delete product attribute action. + * + * @magentoDataFixture Magento/Catalog/_files/product_dropdown_attribute.php + * + * @return void + */ + public function testDeleteSelectAttribute(): void + { + $this->dispatchDeleteAttribute('dropdown_attribute'); + $this->assertAttributeIsDeleted('dropdown_attribute'); + } + + /** + * Assert that attribute with input type "multiselect" will be deleted + * after dispatch delete product attribute action. + * + * @magentoDataFixture Magento/Catalog/_files/multiselect_attribute.php + * + * @return void + */ + public function testDeleteMultiselectAttribute(): void + { + $this->dispatchDeleteAttribute('multiselect_attribute'); + $this->assertAttributeIsDeleted('multiselect_attribute'); + } + + /** + * Assert that attribute with input type "textarea" will be deleted + * after dispatch delete product attribute action. + * + * @magentoDataFixture Magento/Catalog/_files/product_text_attribute.php + * + * @return void + */ + public function testDeleteTextareaAttribute(): void + { + $this->dispatchDeleteAttribute('text_attribute'); + $this->assertAttributeIsDeleted('text_attribute'); + } + + /** + * Assert that attribute with input type "texteditor" will be deleted + * after dispatch delete product attribute action. + * + * @magentoDataFixture Magento/Eav/_files/product_texteditor_attribute.php + * + * @return void + */ + public function testDeleteTextEditorAttribute(): void + { + $this->dispatchDeleteAttribute('text_editor_attribute'); + $this->assertAttributeIsDeleted('text_editor_attribute'); + } + + /** + * Assert that attribute with input type "text" will be deleted + * after dispatch delete product attribute action. + * + * @magentoDataFixture Magento/Catalog/_files/product_varchar_attribute.php + * + * @return void + */ + public function testDeleteTextAttribute(): void + { + $this->dispatchDeleteAttribute('varchar_attribute'); + $this->assertAttributeIsDeleted('varchar_attribute'); + } + + /** + * Assert that attribute with input type "boolean" will be deleted + * after dispatch delete product attribute action. + * + * @magentoDataFixture Magento/Catalog/_files/product_boolean_attribute.php + * + * @return void + */ + public function testDeleteBooleanAttribute(): void + { + $this->dispatchDeleteAttribute('boolean_attribute'); + $this->assertAttributeIsDeleted('boolean_attribute'); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Delete/DeleteAttributeControllerErrorTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Delete/DeleteAttributeControllerErrorTest.php new file mode 100644 index 0000000000000..31aef9c85b9bd --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Delete/DeleteAttributeControllerErrorTest.php @@ -0,0 +1,79 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Controller\Adminhtml\Product\Attribute\Delete; + +use Magento\Catalog\Model\Category; +use Magento\Eav\Api\AttributeRepositoryInterface; +use Magento\Framework\App\Request\Http; +use Magento\Framework\Escaper; +use Magento\Framework\Message\MessageInterface; + +/** + * Error during delete attribute using catalog/product_attribute/delete controller action. + * + * @magentoAppArea adminhtml + * @magentoDbIsolation enabled + */ +class DeleteAttributeControllerErrorTest extends AbstractDeleteAttributeControllerTest +{ + /** + * @var Escaper + */ + private $escaper; + + /** + * @var AttributeRepositoryInterface + */ + private $attributeRepository; + + /** + * @inheritdoc + */ + protected function setUp() + { + parent::setUp(); + $this->escaper = $this->_objectManager->get(Escaper::class); + $this->attributeRepository = $this->_objectManager->get(AttributeRepositoryInterface::class); + } + + /** + * Try to delete attribute via controller action without attribute ID. + * + * @return void + */ + public function testDispatchWithoutAttributeId(): void + { + $this->getRequest()->setMethod(Http::METHOD_POST); + $this->dispatch(sprintf($this->uri, '')); + $this->assertSessionMessages( + $this->equalTo([$this->escaper->escapeHtml((string)__('We can\'t find an attribute to delete.'))]), + MessageInterface::TYPE_ERROR + ); + } + + /** + * Try to delete category attribute via controller action. + * + * @magentoDataFixture Magento/Catalog/_files/category_attribute.php + * + * @return void + */ + public function testDispatchWithNonProductAttribute(): void + { + $categoryAttribute = $this->attributeRepository->get( + Category::ENTITY, + 'test_attribute_code_666' + ); + $this->getRequest()->setMethod(Http::METHOD_POST); + $this->dispatch(sprintf($this->uri, $categoryAttribute->getAttributeId())); + $this->assertSessionMessages( + $this->equalTo([$this->escaper->escapeHtml((string)__('We can\'t delete the attribute.'))]), + MessageInterface::TYPE_ERROR + ); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Eav/_files/product_texteditor_attribute.php b/dev/tests/integration/testsuite/Magento/Eav/_files/product_texteditor_attribute.php new file mode 100644 index 0000000000000..1ac4a35e8c6a5 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Eav/_files/product_texteditor_attribute.php @@ -0,0 +1,51 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\ProductAttributeRepositoryInterface; +use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\ResourceModel\Eav\AttributeFactory; +use Magento\Eav\Setup\EavSetup; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\Catalog\Model\Product\Attribute\Frontend\Inputtype\Presentation; + +$objectManager = Bootstrap::getObjectManager(); +/** @var AttributeFactory $attributeFactory */ +$attributeFactory = $objectManager->get(AttributeFactory::class); +/** @var ProductAttributeRepositoryInterface $productAttributeRepository */ +$productAttributeRepository = $objectManager->get(ProductAttributeRepositoryInterface::class); +$attribute = $attributeFactory->create()->loadByCode(Product::ENTITY, 'text_editor_attribute'); +if (!$attribute->getId()) { + /** @var Presentation $presentation */ + $presentation = $objectManager->get(Presentation::class); + /** @var EavSetup $installer */ + $installer = $objectManager->create(EavSetup::class); + $attributeData = [ + 'attribute_code' => 'text_editor_attribute', + 'is_global' => 1, + 'is_user_defined' => 1, + 'frontend_input' => 'texteditor', + 'is_unique' => 0, + 'is_required' => 0, + 'is_searchable' => 0, + 'is_visible_in_advanced_search' => 0, + 'is_comparable' => 0, + 'is_filterable' => 0, + 'is_filterable_in_search' => 0, + 'is_used_for_promo_rules' => 0, + 'is_html_allowed_on_front' => 1, + 'is_visible_on_front' => 0, + 'used_in_product_listing' => 0, + 'used_for_sort_by' => 0, + 'frontend_label' => ['Text editor attribute'], + 'backend_type' => 'text', + ]; + $attribute->setData($presentation->convertPresentationDataToInputType($attributeData)); + $productAttributeRepository->save($attribute); + $attribute = $productAttributeRepository->get('text_editor_attribute'); + /* Assign attribute to attribute set */ + $installer->addAttributeToGroup(Product::ENTITY, 'Default', 'Attributes', $attribute->getId()); +} diff --git a/dev/tests/integration/testsuite/Magento/Eav/_files/product_texteditor_attribute_rollback.php b/dev/tests/integration/testsuite/Magento/Eav/_files/product_texteditor_attribute_rollback.php new file mode 100644 index 0000000000000..e3b1fa0202a44 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Eav/_files/product_texteditor_attribute_rollback.php @@ -0,0 +1,27 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\ProductAttributeRepositoryInterface; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Registry; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); +/** @var ProductAttributeRepositoryInterface $productAttributeRepository */ +$productAttributeRepository = $objectManager->get(ProductAttributeRepositoryInterface::class); +/** @var Registry $registry */ +$registry = $objectManager->get(Registry::class); +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); +try { + $attribute = $productAttributeRepository->get('text_editor_attribute'); + $productAttributeRepository->delete($attribute); +} catch (NoSuchEntityException $e) { + //Attribute already deleted. +} +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); diff --git a/dev/tests/integration/testsuite/Magento/Swatches/Controller/Adminhtml/Product/Attribute/Delete/SwatchesAttributesControllerTest.php b/dev/tests/integration/testsuite/Magento/Swatches/Controller/Adminhtml/Product/Attribute/Delete/SwatchesAttributesControllerTest.php new file mode 100644 index 0000000000000..1ff53b312e65a --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Swatches/Controller/Adminhtml/Product/Attribute/Delete/SwatchesAttributesControllerTest.php @@ -0,0 +1,48 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Swatches\Controller\Adminhtml\Product\Attribute\Delete; + +use Magento\Catalog\Controller\Adminhtml\Product\Attribute\Delete\AbstractDeleteAttributeControllerTest; + +/** + * Delete catalog product attributes with input types like "swatch_text" and "swatch_visual". + * Attributes from Magento_Swatches module. + * + * @magentoAppArea adminhtml + * @magentoDbIsolation enabled + */ +class SwatchesAttributesControllerTest extends AbstractDeleteAttributeControllerTest +{ + /** + * Assert that attribute with input type "swatch_text" will be deleted + * after dispatch delete product attribute action. + * + * @magentoDataFixture Magento/Swatches/_files/product_text_swatch_attribute.php + * + * @return void + */ + public function testDeleteSwatchTextAttribute(): void + { + $this->dispatchDeleteAttribute('text_swatch_attribute'); + $this->assertAttributeIsDeleted('text_swatch_attribute'); + } + + /** + * Assert that attribute with input type "swatch_visual" will be deleted + * after dispatch delete product attribute action. + * + * @magentoDataFixture Magento/Swatches/_files/swatch_attribute.php + * + * @return void + */ + public function testDeleteSwatchVisualAttribute(): void + { + $this->dispatchDeleteAttribute('color_swatch'); + $this->assertAttributeIsDeleted('color_swatch'); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Weee/Controller/Adminhtml/Product/Attribute/Delete/WeeeAttributesControllerTest.php b/dev/tests/integration/testsuite/Magento/Weee/Controller/Adminhtml/Product/Attribute/Delete/WeeeAttributesControllerTest.php new file mode 100644 index 0000000000000..19e4ea2259641 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Weee/Controller/Adminhtml/Product/Attribute/Delete/WeeeAttributesControllerTest.php @@ -0,0 +1,34 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Weee\Controller\Adminhtml\Product\Attribute\Delete; + +use Magento\Catalog\Controller\Adminhtml\Product\Attribute\Delete\AbstractDeleteAttributeControllerTest; + +/** + * Delete catalog product attributes with input types like "weee". + * Attributes from Magento_Weee module. + * + * @magentoAppArea adminhtml + * @magentoDbIsolation enabled + */ +class WeeeAttributesControllerTest extends AbstractDeleteAttributeControllerTest +{ + /** + * Assert that attribute with input type "weee" will be deleted + * after dispatch delete product attribute action. + * + * @magentoDataFixture Magento/Weee/_files/fixed_product_attribute.php + * + * @return void + */ + public function testDeleteSwatchTextAttribute(): void + { + $this->dispatchDeleteAttribute('fixed_product_attribute'); + $this->assertAttributeIsDeleted('fixed_product_attribute'); + } +} From ad1059fb9a0abb316a6cb92b62ef9fee546f1f77 Mon Sep 17 00:00:00 2001 From: Marco Oliveira <marcoaacoliveira@gmail.com> Date: Fri, 27 Dec 2019 15:40:25 -0300 Subject: [PATCH 493/586] Adding coverage test cases, fixing Order/Payment/Info that had the same problem. --- .../Sales/Model/Order/Payment/Info.php | 1 + .../Magento/Payment/Model/PaymentInfoTest.php | 64 ++++++++++++++ .../Magento/Payment/_files/payment_info.php | 83 +++++++++++++++++++ 3 files changed, 148 insertions(+) create mode 100644 dev/tests/integration/testsuite/Magento/Payment/Model/PaymentInfoTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Payment/_files/payment_info.php diff --git a/app/code/Magento/Sales/Model/Order/Payment/Info.php b/app/code/Magento/Sales/Model/Order/Payment/Info.php index fee846fe6a62c..479d96b5842d9 100644 --- a/app/code/Magento/Sales/Model/Order/Payment/Info.php +++ b/app/code/Magento/Sales/Model/Order/Payment/Info.php @@ -192,6 +192,7 @@ public function getAdditionalInformation($key = null) */ public function unsAdditionalInformation($key = null) { + $this->initAdditionalInformation(); if ($key && isset($this->additionalInformation[$key])) { unset($this->additionalInformation[$key]); return $this->setData('additional_information', $this->additionalInformation); diff --git a/dev/tests/integration/testsuite/Magento/Payment/Model/PaymentInfoTest.php b/dev/tests/integration/testsuite/Magento/Payment/Model/PaymentInfoTest.php new file mode 100644 index 0000000000000..7a4efe4a22ce9 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Payment/Model/PaymentInfoTest.php @@ -0,0 +1,64 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Payment\Model; + +use Magento\Sales\Model\Order; +use Magento\Quote\Model\Quote; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\ObjectManager; + +/** + * @magentoAppArea adminhtml + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ +class PaymentInfoTest extends \PHPUnit\Framework\TestCase +{ + /** + * @var ObjectManager + */ + protected $_objectManager; + + /** + * @var Order + */ + protected $_order; + + /** @var Quote */ + protected $_quote; + + protected function setUp() + { + $this->_objectManager = Bootstrap::getObjectManager(); + $this->_order = $this->_objectManager->create( + Order::class + ); + $this->_quote = $this->_objectManager->create( + Quote::class + ); + } + + /** + * @magentoDbIsolation enabled + * @magentoAppIsolation enabled + * @magentoDataFixture Magento/Payment/_files/payment_info.php + */ + public function testUnsetPaymentInformation() + { + $order = $this->_order->loadByIncrementId('100000001'); + /** @var \Magento\Sales\Model\Order\Payment $paymentOrder */ + $paymentOrder = $order->getPayment(); + $paymentOrder->unsAdditionalInformation('testing'); + + $quote = $this->_quote->load('reserved_order_id', 'reserved_order_id'); + /** @var \Magento\Quote\Model\Quote\Payment $paymentQuote */ + $paymentQuote = $quote->getPayment(); + $paymentQuote->unsAdditionalInformation('testing'); + + + $this->assertFalse($paymentOrder->hasAdditionalInformation('testing')); + $this->assertFalse($paymentQuote->hasAdditionalInformation('testing')); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Payment/_files/payment_info.php b/dev/tests/integration/testsuite/Magento/Payment/_files/payment_info.php new file mode 100644 index 0000000000000..bf40cb6b99820 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Payment/_files/payment_info.php @@ -0,0 +1,83 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +use Magento\Quote\Api\CartRepositoryInterface; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\Sales\Model\Order\Address; +use Magento\Sales\Model\Order\Payment; +use Magento\Paypal\Model\Config; +use Magento\Sales\Model\Order; +use Magento\Quote\Model\Quote; +use Magento\Quote\Model\Quote\Payment as PaymentQuote; + +/** @var $objectManager \Magento\TestFramework\ObjectManager */ +$objectManager = Bootstrap::getObjectManager(); + +$addressData = [ + 'firstname' => 'guest', + 'lastname' => 'guest', + 'email' => 'customer@example.com', + 'street' => 'street', + 'city' => 'Los Angeles', + 'region' => 'CA', + 'postcode' => '1', + 'country_id' => 'US', + 'telephone' => '1' +]; +$billingAddress = $objectManager->create( + Address::class, + ['data' => $addressData] +); +$billingAddress->setAddressType('billing'); +$shippingAddress = clone $billingAddress; +$shippingAddress->setId(null)->setAddressType('shipping'); + +/** @var Payment $paymentOrder */ +$paymentOrder = $objectManager->create( + Payment::class +); + +$paymentOrder->setMethod(Config::METHOD_WPP_EXPRESS); +$paymentOrder->setAdditionalInformation('testing', 'testing additional data'); + +$amount = 100; + +/** @var Order $order */ +$order = $objectManager->create(Order::class); +$order->setCustomerEmail('co@co.co') + ->setIncrementId('100000001') + ->setSubtotal($amount) + ->setBaseSubtotal($amount) + ->setBaseGrandTotal($amount) + ->setGrandTotal($amount) + ->setBaseCurrencyCode('USD') + ->setCustomerIsGuest(true) + ->setStoreId(1) + ->setEmailSent(true) + ->setBillingAddress($billingAddress) + ->setShippingAddress($shippingAddress) + ->setPayment($paymentOrder); +$order->save(); + + + +/** @var Quote $quote */ +$quote = $objectManager->create(Quote::class); +$quote->setStoreId(1) + ->setIsActive(true) + ->setIsMultiShipping(false) + ->setReservedOrderId('reserved_order_id'); + +$quote->getPayment() + ->setMethod(Config::METHOD_WPP_EXPRESS) + ->setAdditionalInformation('testing', 'testing additional data'); + +$quote->collectTotals(); + + +/** @var CartRepositoryInterface $repository */ +$repository = $objectManager->get(CartRepositoryInterface::class); +$repository->save($quote); From 408b725157f031a81119cb27816d204d48b45b97 Mon Sep 17 00:00:00 2001 From: Marco Oliveira <marcoaacoliveira@gmail.com> Date: Fri, 27 Dec 2019 16:04:17 -0300 Subject: [PATCH 494/586] Removing unnecessary line. --- .../testsuite/Magento/Payment/Model/PaymentInfoTest.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Payment/Model/PaymentInfoTest.php b/dev/tests/integration/testsuite/Magento/Payment/Model/PaymentInfoTest.php index 7a4efe4a22ce9..3d037ceb17044 100644 --- a/dev/tests/integration/testsuite/Magento/Payment/Model/PaymentInfoTest.php +++ b/dev/tests/integration/testsuite/Magento/Payment/Model/PaymentInfoTest.php @@ -56,8 +56,7 @@ public function testUnsetPaymentInformation() /** @var \Magento\Quote\Model\Quote\Payment $paymentQuote */ $paymentQuote = $quote->getPayment(); $paymentQuote->unsAdditionalInformation('testing'); - - + $this->assertFalse($paymentOrder->hasAdditionalInformation('testing')); $this->assertFalse($paymentQuote->hasAdditionalInformation('testing')); } From 438e6067de61f98c90c27067ff91e88a7e1ad6b5 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Fri, 27 Dec 2019 14:51:21 -0600 Subject: [PATCH 495/586] Update action group due to changes in mainline --- .../Mftf/Test/ProductAttributeWithoutValueInCompareListTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/ProductAttributeWithoutValueInCompareListTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/ProductAttributeWithoutValueInCompareListTest.xml index f1288da1e6125..70d2fb63941c7 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/ProductAttributeWithoutValueInCompareListTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/ProductAttributeWithoutValueInCompareListTest.xml @@ -27,7 +27,7 @@ <argument name="group" value="Product Details"/> <argument name="attribute" value="$$createProductAttribute.attribute_code$$"/> </actionGroup> - <actionGroup ref="SaveAttributeSet" stepKey="SaveAttributeSet"/> + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="SaveAttributeSet"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="_defaultProduct" stepKey="createProductDefault"> <requiredEntity createDataKey="createCategory"/> From ccc9b63e0c404bf50cb8ff3311ad9a51abede010 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Fri, 27 Dec 2019 17:01:51 -0600 Subject: [PATCH 496/586] Add action group --- .../SeeProductInComparisonListActionGroup.xml | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/SeeProductInComparisonListActionGroup.xml diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/SeeProductInComparisonListActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SeeProductInComparisonListActionGroup.xml new file mode 100644 index 0000000000000..44dc8353d314d --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SeeProductInComparisonListActionGroup.xml @@ -0,0 +1,24 @@ +<?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="SeeProductInComparisonListActionGroup"> + <annotations> + <description>Validate that the Product is present in the comparison list</description> + </annotations> + <arguments> + <argument name="productVar"/> + </arguments> + + <amOnPage url="{{StorefrontProductComparePage.url}}" stepKey="navigateToComparePage"/> + <waitForPageLoad stepKey="waitForStorefrontProductComparePageLoad"/> + <seeElement selector="{{StorefrontProductCompareMainSection.ProductLinkByName(productVar.name)}}" + stepKey="seeProductInCompareList"/> + </actionGroup> +</actionGroups> From 0b1d6544ff35dc5d4a70ea1fa102552dbda40d74 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Fri, 27 Dec 2019 17:55:38 -0600 Subject: [PATCH 497/586] Update action group due to changes in mainline --- .../Test/Mftf/Test/AdminCreateOrderWithDateTimeOptionUITest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithDateTimeOptionUITest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithDateTimeOptionUITest.xml index 06c2375a26616..7e58e55c8981e 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithDateTimeOptionUITest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithDateTimeOptionUITest.xml @@ -32,7 +32,7 @@ <deleteData createDataKey="createCustomer" stepKey="deleteSimpleCustomer"/> </after> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$createCustomer$$"/> </actionGroup> From 6d092dc8a2e394641c5a46c353ae9e3bb75c9f81 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Fri, 27 Dec 2019 20:59:50 -0600 Subject: [PATCH 498/586] Update actiongroup name due to changes in mainline --- .../StorefrontNoJavascriptErrorOnAddYourReviewClickTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Review/Test/Mftf/Test/StorefrontNoJavascriptErrorOnAddYourReviewClickTest.xml b/app/code/Magento/Review/Test/Mftf/Test/StorefrontNoJavascriptErrorOnAddYourReviewClickTest.xml index 72b175d2dcacb..99e418a950c69 100644 --- a/app/code/Magento/Review/Test/Mftf/Test/StorefrontNoJavascriptErrorOnAddYourReviewClickTest.xml +++ b/app/code/Magento/Review/Test/Mftf/Test/StorefrontNoJavascriptErrorOnAddYourReviewClickTest.xml @@ -26,7 +26,7 @@ <argument name="group" value="Product Details"/> <argument name="attribute" value="$$createProductAttribute.attribute_code$$"/> </actionGroup> - <actionGroup ref="SaveAttributeSet" stepKey="SaveAttributeSet"/> + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="SaveAttributeSet"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="SimpleProductWithCustomAttributeSet" stepKey="createProduct"> <requiredEntity createDataKey="createCategory"/> From cbfd175023ccbdaffef1f0b7b8786143a63453f5 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Sat, 28 Dec 2019 11:34:16 -0600 Subject: [PATCH 499/586] Remove unused action group --- .../Test/Mftf/ActionGroup/StorefrontCompareActionGroup.xml | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCompareActionGroup.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCompareActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCompareActionGroup.xml deleted file mode 100644 index e69de29bb2d1d..0000000000000 From 0fb43446d90346f94c7e04ef52c7eecdcb597d1b Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Sun, 29 Dec 2019 12:49:14 -0600 Subject: [PATCH 500/586] Fix static --- .../Order/Payment/State/RegisterCaptureNotificationCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/Model/Order/Payment/State/RegisterCaptureNotificationCommand.php b/app/code/Magento/Sales/Model/Order/Payment/State/RegisterCaptureNotificationCommand.php index d8afcc71cc6af..2551092a64e9a 100644 --- a/app/code/Magento/Sales/Model/Order/Payment/State/RegisterCaptureNotificationCommand.php +++ b/app/code/Magento/Sales/Model/Order/Payment/State/RegisterCaptureNotificationCommand.php @@ -14,7 +14,7 @@ /** * Class RegisterCaptureNotificationCommand * - * @package Magento\Sales\Model\Order\Payment\State + * Command that Register Capture Notification */ class RegisterCaptureNotificationCommand implements CommandInterface { From dbcb81df310cb16d07e9f8b8397fe529239dba9b Mon Sep 17 00:00:00 2001 From: Yogesh Suhagiya <yksuhagiya@gmail.com> Date: Mon, 30 Dec 2019 11:34:12 +0530 Subject: [PATCH 501/586] Fixed transaction issues --- app/code/Magento/CatalogUrlRewrite/etc/adminhtml/system.xml | 6 ++---- app/code/Magento/CatalogUrlRewrite/i18n/en_US.csv | 3 ++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/CatalogUrlRewrite/etc/adminhtml/system.xml b/app/code/Magento/CatalogUrlRewrite/etc/adminhtml/system.xml index 1e1f4e86fa3dc..ad0ff68192af4 100644 --- a/app/code/Magento/CatalogUrlRewrite/etc/adminhtml/system.xml +++ b/app/code/Magento/CatalogUrlRewrite/etc/adminhtml/system.xml @@ -28,13 +28,11 @@ <label>Create Permanent Redirect for URLs if URL Key Changed</label> <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> </field> - <field id="generate_category_product_rewrites" translate="label" type="select" sortOrder="6" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1"> + <field id="generate_category_product_rewrites" translate="label comment" type="select" sortOrder="6" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1"> <label>Generate "category/product" URL Rewrites</label> <backend_model>Magento\CatalogUrlRewrite\Model\TableCleaner</backend_model> <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> - <comment> - <![CDATA[<strong style="color:red">Warning!</strong> Turning this option off will result in permanent removal of category/product URL rewrites without an ability to restore them.]]> - </comment> + <comment><![CDATA[<strong style="color:red">Warning!</strong> Turning this option off will result in permanent removal of category/product URL rewrites without an ability to restore them.]]></comment> <frontend_class>generate_category_product_rewrites</frontend_class> </field> </group> diff --git a/app/code/Magento/CatalogUrlRewrite/i18n/en_US.csv b/app/code/Magento/CatalogUrlRewrite/i18n/en_US.csv index 0f21e8ddf9fc9..1dddaa458a16c 100644 --- a/app/code/Magento/CatalogUrlRewrite/i18n/en_US.csv +++ b/app/code/Magento/CatalogUrlRewrite/i18n/en_US.csv @@ -5,5 +5,6 @@ "Product URL Suffix","Product URL Suffix" "Use Categories Path for Product URLs","Use Categories Path for Product URLs" "Create Permanent Redirect for URLs if URL Key Changed","Create Permanent Redirect for URLs if URL Key Changed" -"Generate "category/product" URL Rewrites","Generate "category/product" URL Rewrites" +"Generate ""category/product"" URL Rewrites","Generate ""category/product"" URL Rewrites" "URL key ""%1"" matches a reserved endpoint name (%2). Use another URL key.","URL key ""%1"" matches a reserved endpoint name (%2). Use another URL key." +"<strong style=""color:red"">Warning!</strong> Turning this option off will result in permanent removal of category/product URL rewrites without an ability to restore them.","<strong style=""color:red"">Warning!</strong> Turning this option off will result in permanent removal of category/product URL rewrites without an ability to restore them." From 1ca03a336588fded3f516b8d7ffe57f8201f718a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Mon, 30 Dec 2019 12:13:38 +0100 Subject: [PATCH 502/586] #26206 Add information about currently reindexed index. --- .../Indexer/Console/Command/IndexerReindexCommand.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Indexer/Console/Command/IndexerReindexCommand.php b/app/code/Magento/Indexer/Console/Command/IndexerReindexCommand.php index fffa4503e14a7..7e4ec766dc089 100644 --- a/app/code/Magento/Indexer/Console/Command/IndexerReindexCommand.php +++ b/app/code/Magento/Indexer/Console/Command/IndexerReindexCommand.php @@ -76,6 +76,7 @@ protected function execute(InputInterface $input, OutputInterface $output) { $returnValue = Cli::RETURN_FAILURE; foreach ($this->getIndexers($input) as $indexer) { + $output->write($indexer->getTitle() . ' '); try { $this->validateIndexerStatus($indexer); $startTime = microtime(true); @@ -90,8 +91,9 @@ protected function execute(InputInterface $input, OutputInterface $output) } } $resultTime = microtime(true) - $startTime; + $output->writeln( - $indexer->getTitle() . ' index has been rebuilt successfully in ' . gmdate('H:i:s', $resultTime) + __('index has been rebuilt successfully in %time', ['time' => gmdate('H:i:s', $resultTime)]) ); $returnValue = Cli::RETURN_SUCCESS; } catch (LocalizedException $e) { @@ -111,7 +113,7 @@ protected function execute(InputInterface $input, OutputInterface $output) */ protected function getIndexers(InputInterface $input) { - $indexers = parent::getIndexers($input); + $indexers = parent::getIndexers($input); $allIndexers = $this->getAllIndexers(); if (!array_diff_key($allIndexers, $indexers)) { return $indexers; From 7117ac4e49df34d04a149d591c49f51d029beb1e Mon Sep 17 00:00:00 2001 From: divyajyothi5321 <54176640+divyajyothi5321@users.noreply.github.com> Date: Mon, 30 Dec 2019 20:07:28 +0530 Subject: [PATCH 503/586] Added Changes --- .../web/css/source/module/_listings.less | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less b/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less index 8c71f87360807..e6c595dd08628 100644 --- a/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less +++ b/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less @@ -110,11 +110,10 @@ vertical-align: middle; > .stock.unavailable { - border: 1px solid @color-orange-red1; - color: @color-orange-red1; - font-weight: @font-weight__semibold; line-height: 1; - padding: @indent__s 11px; + padding-bottom: @indent__s; + padding-top: @indent__s; + padding-right: 24px; } } } @@ -424,7 +423,19 @@ } } -// +// +// Mobile +// _____________________________________________ + +.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__s) { + .product-item-actions { + .actions-primary { + display: block; + } + } +} + +// // Desktop // _____________________________________________ From 135df0bc846d06ae00758fb86fb36cf54c852820 Mon Sep 17 00:00:00 2001 From: divyajyothi5321 <54176640+divyajyothi5321@users.noreply.github.com> Date: Mon, 30 Dec 2019 20:36:56 +0530 Subject: [PATCH 504/586] Added necessary indentations --- .../luma/Magento_Catalog/web/css/source/module/_listings.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less b/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less index e6c595dd08628..4c1517184e7f8 100644 --- a/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less +++ b/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less @@ -112,8 +112,8 @@ > .stock.unavailable { line-height: 1; padding-bottom: @indent__s; - padding-top: @indent__s; padding-right: 24px; + padding-top: @indent__s; } } } From 79fe786afcc193a6424e5d2d31e8120a06d8700b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Mon, 30 Dec 2019 13:07:54 +0100 Subject: [PATCH 505/586] #26206 Improve the output, fix the implementation of array_merge() in foreach() --- .../Console/Command/IndexerReindexCommand.php | 55 +++++++++---------- .../Command/IndexerReindexCommandTest.php | 24 ++++++-- 2 files changed, 44 insertions(+), 35 deletions(-) diff --git a/app/code/Magento/Indexer/Console/Command/IndexerReindexCommand.php b/app/code/Magento/Indexer/Console/Command/IndexerReindexCommand.php index 7e4ec766dc089..858fcdeb02c6c 100644 --- a/app/code/Magento/Indexer/Console/Command/IndexerReindexCommand.php +++ b/app/code/Magento/Indexer/Console/Command/IndexerReindexCommand.php @@ -6,16 +6,16 @@ namespace Magento\Indexer\Console\Command; +use Magento\Framework\App\ObjectManagerFactory; use Magento\Framework\Console\Cli; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Indexer\Config\DependencyInfoProvider; +use Magento\Framework\Indexer\ConfigInterface; use Magento\Framework\Indexer\IndexerInterface; use Magento\Framework\Indexer\IndexerRegistry; use Magento\Framework\Indexer\StateInterface; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -use Magento\Framework\Indexer\ConfigInterface; -use Magento\Framework\App\ObjectManagerFactory; /** * Command to run indexers @@ -76,9 +76,11 @@ protected function execute(InputInterface $input, OutputInterface $output) { $returnValue = Cli::RETURN_FAILURE; foreach ($this->getIndexers($input) as $indexer) { - $output->write($indexer->getTitle() . ' '); try { $this->validateIndexerStatus($indexer); + + $output->write($indexer->getTitle() . ' index '); + $startTime = microtime(true); $indexerConfig = $this->getConfig()->getIndexer($indexer->getId()); $sharedIndex = $indexerConfig['shared_index']; @@ -93,16 +95,19 @@ protected function execute(InputInterface $input, OutputInterface $output) $resultTime = microtime(true) - $startTime; $output->writeln( - __('index has been rebuilt successfully in %time', ['time' => gmdate('H:i:s', $resultTime)]) + __('has been rebuilt successfully in %time', ['time' => gmdate('H:i:s', $resultTime)]) ); $returnValue = Cli::RETURN_SUCCESS; } catch (LocalizedException $e) { - $output->writeln($e->getMessage()); + $output->writeln(__('exception: %message', ['message' => $e->getMessage()])); } catch (\Exception $e) { - $output->writeln($indexer->getTitle() . ' indexer process unknown error:'); + $output->writeln('process unknown error:'); $output->writeln($e->getMessage()); + + $output->writeln($e->getTraceAsString(), OutputInterface::VERBOSITY_DEBUG); } } + return $returnValue; } @@ -119,19 +124,17 @@ protected function getIndexers(InputInterface $input) return $indexers; } - $relatedIndexers = []; - $dependentIndexers = []; + $relatedIndexers = [[]]; + $dependentIndexers = [[]]; + foreach ($indexers as $indexer) { - $relatedIndexers = array_merge( - $relatedIndexers, - $this->getRelatedIndexerIds($indexer->getId()) - ); - $dependentIndexers = array_merge( - $dependentIndexers, - $this->getDependentIndexerIds($indexer->getId()) - ); + array_push($relatedIndexers, $this->getRelatedIndexerIds($indexer->getId())); + array_push($dependentIndexers, $this->getDependentIndexerIds($indexer->getId())); } + $relatedIndexers = array_merge(...$relatedIndexers); + $dependentIndexers = array_merge(...$dependentIndexers); + $invalidRelatedIndexers = []; foreach (array_unique($relatedIndexers) as $relatedIndexer) { if ($allIndexers[$relatedIndexer]->isInvalid()) { @@ -161,15 +164,13 @@ protected function getIndexers(InputInterface $input) */ private function getRelatedIndexerIds(string $indexerId) { - $relatedIndexerIds = []; + $relatedIndexerIds = [[]]; foreach ($this->getDependencyInfoProvider()->getIndexerIdsToRunBefore($indexerId) as $relatedIndexerId) { - $relatedIndexerIds = array_merge( - $relatedIndexerIds, - [$relatedIndexerId], - $this->getRelatedIndexerIds($relatedIndexerId) - ); + array_push($relatedIndexerIds, [$relatedIndexerId], $this->getRelatedIndexerIds($relatedIndexerId)); } + $relatedIndexerIds = array_merge(...$relatedIndexerIds); + return array_unique($relatedIndexerIds); } @@ -181,19 +182,15 @@ private function getRelatedIndexerIds(string $indexerId) */ private function getDependentIndexerIds(string $indexerId) { - $dependentIndexerIds = []; + $dependentIndexerIds = [[]]; foreach (array_keys($this->getConfig()->getIndexers()) as $id) { $dependencies = $this->getDependencyInfoProvider()->getIndexerIdsToRunBefore($id); if (array_search($indexerId, $dependencies) !== false) { - $dependentIndexerIds = array_merge( - $dependentIndexerIds, - [$id], - $this->getDependentIndexerIds($id) - ); + array_push($dependentIndexerIds, [$id], $this->getDependentIndexerIds($id)); } } - return array_unique($dependentIndexerIds); + return array_unique(array_merge(...$dependentIndexerIds)); } /** diff --git a/app/code/Magento/Indexer/Test/Unit/Console/Command/IndexerReindexCommandTest.php b/app/code/Magento/Indexer/Test/Unit/Console/Command/IndexerReindexCommandTest.php index bdfeff8a89eb9..3a1bf113b942a 100644 --- a/app/code/Magento/Indexer/Test/Unit/Console/Command/IndexerReindexCommandTest.php +++ b/app/code/Magento/Indexer/Test/Unit/Console/Command/IndexerReindexCommandTest.php @@ -22,6 +22,7 @@ */ class IndexerReindexCommandTest extends AbstractIndexerCommandCommonSetup { + const STUB_INDEXER_NAME = 'Indexer Name'; /** * Command being tested * @@ -107,7 +108,7 @@ public function testExecuteAll() [ $this->getIndexerMock( ['reindexAll', 'getStatus'], - ['indexer_id' => 'id_indexerOne', 'title' => 'Title_indexerOne'] + ['indexer_id' => 'id_indexerOne', 'title' => self::STUB_INDEXER_NAME] ) ] ); @@ -117,7 +118,10 @@ public function testExecuteAll() $commandTester->execute([]); $actualValue = $commandTester->getDisplay(); $this->assertSame(Cli::RETURN_SUCCESS, $commandTester->getStatusCode()); - $this->assertStringStartsWith('Title_indexerOne index has been rebuilt successfully in', $actualValue); + $this->assertStringStartsWith( + self::STUB_INDEXER_NAME . ' index has been rebuilt successfully in', + $actualValue + ); } /** @@ -174,6 +178,7 @@ public function testExecuteWithIndex( $this->objectManagerFactory, $this->indexerRegistryMock ); + $commandTester = new CommandTester($this->command); $commandTester->execute(['index' => $inputIndexers]); $this->assertSame(Cli::RETURN_SUCCESS, $commandTester->getStatusCode()); @@ -344,7 +349,8 @@ public function executeWithIndexDataProvider() ], 'With dependencies and multiple indexers in request' => [ 'inputIndexers' => [ - 'indexer_1', 'indexer_3' + 'indexer_1', + 'indexer_3' ], 'indexers' => [ 'indexer_2' => [ @@ -405,7 +411,10 @@ public function executeWithIndexDataProvider() public function testExecuteWithLocalizedException() { $this->configureAdminArea(); - $indexerOne = $this->getIndexerMock(['reindexAll', 'getStatus'], ['indexer_id' => 'indexer_1']); + $indexerOne = $this->getIndexerMock( + ['reindexAll', 'getStatus'], + ['indexer_id' => 'indexer_1', 'title' => self::STUB_INDEXER_NAME] + ); $localizedException = new LocalizedException(new Phrase('Some Exception Message')); $indexerOne->expects($this->once())->method('reindexAll')->will($this->throwException($localizedException)); $this->initIndexerCollectionByItems([$indexerOne]); @@ -414,7 +423,10 @@ public function testExecuteWithLocalizedException() $commandTester->execute(['index' => ['indexer_1']]); $actualValue = $commandTester->getDisplay(); $this->assertSame(Cli::RETURN_FAILURE, $commandTester->getStatusCode()); - $this->assertStringStartsWith('Some Exception Message', $actualValue); + $this->assertStringStartsWith( + self::STUB_INDEXER_NAME . ' index exception: Some Exception Message', + $actualValue + ); } public function testExecuteWithException() @@ -433,7 +445,7 @@ public function testExecuteWithException() $commandTester->execute(['index' => ['indexer_1']]); $actualValue = $commandTester->getDisplay(); $this->assertSame(Cli::RETURN_FAILURE, $commandTester->getStatusCode()); - $this->assertStringStartsWith('Title_indexer_1' . ' indexer process unknown error:', $actualValue); + $this->assertStringStartsWith('Title_indexer_1' . ' index process unknown error:', $actualValue); } public function testExecuteWithExceptionInGetIndexers() From 6a7179a7f7b1ec7d80dfe124477dc2c967d516ae Mon Sep 17 00:00:00 2001 From: divyajyothi5321 <54176640+divyajyothi5321@users.noreply.github.com> Date: Tue, 31 Dec 2019 10:59:22 +0530 Subject: [PATCH 506/586] Added Indentations --- .../luma/Magento_Catalog/web/css/source/module/_listings.less | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less b/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less index 4c1517184e7f8..9dba96f89639e 100644 --- a/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less +++ b/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less @@ -423,7 +423,7 @@ } } -// +// // Mobile // _____________________________________________ @@ -435,7 +435,7 @@ } } -// +// // Desktop // _____________________________________________ From 4c545f23dd44026a87ab001e8294075cc98b1fea Mon Sep 17 00:00:00 2001 From: divyajyothi5321 <54176640+divyajyothi5321@users.noreply.github.com> Date: Tue, 31 Dec 2019 14:02:22 +0530 Subject: [PATCH 507/586] Added Changes --- .../web/css/source/module/_listings.less | 25 +++++-------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less b/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less index 9dba96f89639e..3a3cfe3cd2231 100644 --- a/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less +++ b/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less @@ -108,13 +108,6 @@ .actions-primary { display: inline-block; vertical-align: middle; - - > .stock.unavailable { - line-height: 1; - padding-bottom: @indent__s; - padding-right: 24px; - padding-top: @indent__s; - } } } @@ -286,6 +279,12 @@ } } } + + .product-item-actions { + .actions-primary { + display: block; + } + } } .media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__s) { @@ -423,18 +422,6 @@ } } -// -// Mobile -// _____________________________________________ - -.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__s) { - .product-item-actions { - .actions-primary { - display: block; - } - } -} - // // Desktop // _____________________________________________ From 3a7ec0d71b080c221e9212863bf0efe407336465 Mon Sep 17 00:00:00 2001 From: divyajyothi5321 <54176640+divyajyothi5321@users.noreply.github.com> Date: Tue, 31 Dec 2019 14:36:07 +0530 Subject: [PATCH 508/586] Update _listings.less --- .../Magento_Catalog/web/css/source/module/_listings.less | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less b/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less index 3a3cfe3cd2231..d106fa8886c05 100644 --- a/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less +++ b/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less @@ -108,6 +108,13 @@ .actions-primary { display: inline-block; vertical-align: middle; + + > .stock.unavailable { + line-height: 1; + padding-bottom: @indent__s; + padding-right: 24px; + padding-top: @indent__s; + } } } From e4e4b4e3849dc4a645b352b03ec1535d9733a681 Mon Sep 17 00:00:00 2001 From: Sathish <srsathish92@gmail.com> Date: Tue, 31 Dec 2019 17:16:21 +0530 Subject: [PATCH 509/586] Removed the sortable option from cache grid --- .../Backend/view/adminhtml/layout/adminhtml_cache_block.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_cache_block.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_cache_block.xml index 6d2ecd8d36a99..0fbf777bdf607 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_cache_block.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_cache_block.xml @@ -80,6 +80,7 @@ <argument name="type" xsi:type="string">options</argument> <argument name="width" xsi:type="string">120</argument> <argument name="align" xsi:type="string">left</argument> + <argument name="sortable" xsi:type="string">0</argument> <argument name="options" xsi:type="array"> <item name="disabled" xsi:type="array"> <item name="value" xsi:type="string">0</item> From 2b5720c84624084226e2df6fd0c0d605ebfaf0dd Mon Sep 17 00:00:00 2001 From: Riccardo Tempesta <riccardo.tempesta@gmail.com> Date: Tue, 31 Dec 2019 18:03:31 +0100 Subject: [PATCH 510/586] FIX issue#26217 - Wrong fields selection while using fragments on GraphQL products query --- .../Products/Query/FieldSelection.php | 54 +++---------------- 1 file changed, 7 insertions(+), 47 deletions(-) diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/Query/FieldSelection.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/Query/FieldSelection.php index ffa0a3e6848e1..64ab128b22ab4 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/Query/FieldSelection.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/Query/FieldSelection.php @@ -7,7 +7,6 @@ namespace Magento\CatalogGraphQl\Model\Resolver\Products\Query; -use GraphQL\Language\AST\SelectionNode; use Magento\Framework\GraphQl\Query\FieldTranslator; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; @@ -37,57 +36,18 @@ public function __construct(FieldTranslator $fieldTranslator) */ public function getProductsFieldSelection(ResolveInfo $resolveInfo): array { - return $this->getProductFields($resolveInfo); - } + $productFields = $resolveInfo->getFieldSelection(1); + $sectionNames = ['items', 'product']; - /** - * Return field names for all requested product fields. - * - * @param ResolveInfo $info - * @return string[] - */ - private function getProductFields(ResolveInfo $info): array - { $fieldNames = []; - foreach ($info->fieldNodes as $node) { - if ($node->name->value !== 'products' && $node->name->value !== 'variants') { - continue; - } - foreach ($node->selectionSet->selections as $selection) { - if ($selection->name->value !== 'items' && $selection->name->value !== 'product') { - continue; - } - $fieldNames[] = $this->collectProductFieldNames($selection, $fieldNames); - } - } - if (!empty($fieldNames)) { - $fieldNames = array_merge(...$fieldNames); - } - return $fieldNames; - } - - /** - * Collect field names for each node in selection - * - * @param SelectionNode $selection - * @param array $fieldNames - * @return array - */ - private function collectProductFieldNames(SelectionNode $selection, array $fieldNames = []): array - { - foreach ($selection->selectionSet->selections as $itemSelection) { - if ($itemSelection->kind === 'InlineFragment') { - foreach ($itemSelection->selectionSet->selections as $inlineSelection) { - if ($inlineSelection->kind === 'InlineFragment') { - continue; - } - $fieldNames[] = $this->fieldTranslator->translate($inlineSelection->name->value); + foreach ($sectionNames as $sectionName) { + if (isset($productFields[$sectionName])) { + foreach (array_keys($productFields[$sectionName]) as $fieldName) { + $fieldNames[] = $this->fieldTranslator->translate($fieldName); } - continue; } - $fieldNames[] = $this->fieldTranslator->translate($itemSelection->name->value); } - return $fieldNames; + return array_unique($fieldNames); } } From d6a73f9f678df05f9731dcb435857c64002e872a Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Tue, 31 Dec 2019 15:44:48 -0600 Subject: [PATCH 511/586] Fix static --- .../Framework/Setup/Declaration/Schema/Dto/Factories/Json.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/internal/Magento/Framework/Setup/Declaration/Schema/Dto/Factories/Json.php b/lib/internal/Magento/Framework/Setup/Declaration/Schema/Dto/Factories/Json.php index ec20e4a9438f3..5c9c88bb4fe26 100644 --- a/lib/internal/Magento/Framework/Setup/Declaration/Schema/Dto/Factories/Json.php +++ b/lib/internal/Magento/Framework/Setup/Declaration/Schema/Dto/Factories/Json.php @@ -10,6 +10,8 @@ /** * Class Json + * + * Json Factory */ class Json implements FactoryInterface { From 84b131070043a4ad47f8bfa7a4999c42ed9940ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 2 Jan 2020 00:33:45 +0100 Subject: [PATCH 512/586] Set of fixes for Integration and Functional tests failing because of date used --- ...dminCreateDatetimeProductAttributeTest.xml | 2 +- .../Report/Product/Viewed/CollectionTest.php | 52 +++++++++---------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml index 5da824d2ccdb9..981af5b5abb4a 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml @@ -27,7 +27,7 @@ <actionGroup ref="logout" stepKey="logout"/> </after> <!-- Generate the datetime default value --> - <generateDate date="now" format="m/j/y g:i A" stepKey="generateDefaultValue"/> + <generateDate date="now" format="n/j/y g:i A" stepKey="generateDefaultValue"/> <!-- Create new datetime product attribute --> <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="goToProductAttributes"/> <waitForPageLoad stepKey="waitForPageLoadAttributes"/> diff --git a/dev/tests/integration/testsuite/Magento/Reports/Model/ResourceModel/Report/Product/Viewed/CollectionTest.php b/dev/tests/integration/testsuite/Magento/Reports/Model/ResourceModel/Report/Product/Viewed/CollectionTest.php index fff057fd05688..18b6aa6405663 100644 --- a/dev/tests/integration/testsuite/Magento/Reports/Model/ResourceModel/Report/Product/Viewed/CollectionTest.php +++ b/dev/tests/integration/testsuite/Magento/Reports/Model/ResourceModel/Report/Product/Viewed/CollectionTest.php @@ -72,20 +72,20 @@ public function testTableSelection($period, $expectedTable, $dateFrom, $dateTo, $this->assertArrayHasKey('tableName', $from[$dbTableName]); } else { $union = $this->_collection->getSelect()->getPart('union'); + $count = count($union); if ($period !== null && $dateFrom !== null && $dateTo !== null && $period != 'month') { - $count = count($union); if ($period == 'year') { if ($dbTableName == "report_viewed_product_aggregated_daily") { - $this->assertEquals($count, 2); + $this->assertEquals(2, $count); } if ($dbTableName == "report_viewed_product_aggregated_yearly") { - $this->assertEquals($count, 3); + $this->assertEquals(3, $count); } } else { - $this->assertEquals($count, 3); + $this->assertEquals(3, $count); } } else { - $this->assertEquals(count($union), 2); + $this->assertEquals(2, $count); } } } @@ -98,8 +98,8 @@ public function testTableSelection($period, $expectedTable, $dateFrom, $dateTo, */ public function tableForPeriodDataProvider() { - $dateNow = date('Y-m-d', time()); - $dateYearAgo = date('Y-m-d', strtotime($dateNow . ' -1 year')); + $dateFrom = '2019-10-15'; + $dateYearBefore = date('Y-m-d', strtotime($dateFrom . ' -1 year')); return [ [ 'period' => 'year', @@ -111,32 +111,32 @@ public function tableForPeriodDataProvider() [ 'period' => 'year', 'table' => 'report_viewed_product_aggregated_yearly', - 'date_from' => $dateYearAgo, - 'date_to' => $dateNow, + 'date_from' => $dateYearBefore, + 'date_to' => $dateFrom, ], [ 'period' => 'year', 'table' => 'report_viewed_product_aggregated_yearly', - 'date_from' => $dateYearAgo, + 'date_from' => $dateYearBefore, 'date_to' => null, ], [ 'period' => 'month', 'table' => 'report_viewed_product_aggregated_monthly', 'date_from' => null, - 'date_to' => $dateNow, + 'date_to' => $dateFrom, ], [ 'period' => 'year', 'table' => 'report_viewed_product_aggregated_yearly', - 'date_from' => $dateYearAgo, + 'date_from' => $dateYearBefore, 'date_to' => null, ], [ 'period' => 'year', 'table' => 'report_viewed_product_aggregated_yearly', 'date_from' => null, - 'date_to' => $dateNow, + 'date_to' => $dateFrom, ], [ 'period' => 'month', @@ -147,19 +147,19 @@ public function tableForPeriodDataProvider() [ 'period' => 'month', 'table' => 'report_viewed_product_aggregated_monthly', - 'date_from' => $dateYearAgo, - 'date_to' => $dateYearAgo, + 'date_from' => $dateYearBefore, + 'date_to' => $dateYearBefore, ], [ 'period' => 'month', 'table' => 'report_viewed_product_aggregated_monthly', 'date_from' => null, - 'date_to' => $dateYearAgo, + 'date_to' => $dateYearBefore, ], [ 'period' => 'month', 'table' => 'report_viewed_product_aggregated_monthly', - 'date_from' => $dateYearAgo, + 'date_from' => $dateYearBefore, 'date_to' => null, ], [ @@ -177,32 +177,32 @@ public function tableForPeriodDataProvider() [ 'period' => null, 'table' => 'report_viewed_product_aggregated_daily', - 'date_from' => $dateYearAgo, - 'date_to' => $dateNow, + 'date_from' => $dateYearBefore, + 'date_to' => $dateFrom, ], [ 'period' => null, 'table' => 'report_viewed_product_aggregated_daily', - 'date_from' => $dateNow, - 'date_to' => $dateNow, + 'date_from' => $dateFrom, + 'date_to' => $dateFrom, ], [ 'period' => 'day', 'table' => 'report_viewed_product_aggregated_daily', - 'date_from' => $dateYearAgo, - 'date_to' => $dateYearAgo, + 'date_from' => $dateYearBefore, + 'date_to' => $dateYearBefore, ], [ 'period' => 'year', 'table' => 'report_viewed_product_aggregated_daily', - 'date_from' => $dateYearAgo, - 'date_to' => $dateYearAgo, + 'date_from' => $dateYearBefore, + 'date_to' => $dateYearBefore, ], [ 'period' => 'year', 'table' => 'report_viewed_product_aggregated_daily', 'date_from' => null, - 'date_to' => $dateYearAgo, + 'date_to' => $dateYearBefore, ], [ 'period' => null, From 80684d725413f93744b37c33b02301506a394110 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Tue, 31 Dec 2019 11:39:46 +0100 Subject: [PATCH 513/586] #26206 Changes requested during Code Review --- .../Console/Command/IndexerReindexCommand.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/Indexer/Console/Command/IndexerReindexCommand.php b/app/code/Magento/Indexer/Console/Command/IndexerReindexCommand.php index 858fcdeb02c6c..c7207c853b95e 100644 --- a/app/code/Magento/Indexer/Console/Command/IndexerReindexCommand.php +++ b/app/code/Magento/Indexer/Console/Command/IndexerReindexCommand.php @@ -128,8 +128,8 @@ protected function getIndexers(InputInterface $input) $dependentIndexers = [[]]; foreach ($indexers as $indexer) { - array_push($relatedIndexers, $this->getRelatedIndexerIds($indexer->getId())); - array_push($dependentIndexers, $this->getDependentIndexerIds($indexer->getId())); + $relatedIndexers[] = $this->getRelatedIndexerIds($indexer->getId()); + $dependentIndexers[] = $this->getDependentIndexerIds($indexer->getId()); } $relatedIndexers = array_merge(...$relatedIndexers); @@ -162,16 +162,15 @@ protected function getIndexers(InputInterface $input) * @param string $indexerId * @return array */ - private function getRelatedIndexerIds(string $indexerId) + private function getRelatedIndexerIds(string $indexerId): array { $relatedIndexerIds = [[]]; foreach ($this->getDependencyInfoProvider()->getIndexerIdsToRunBefore($indexerId) as $relatedIndexerId) { - array_push($relatedIndexerIds, [$relatedIndexerId], $this->getRelatedIndexerIds($relatedIndexerId)); + $relatedIndexerIds[] = [$relatedIndexerId]; + $relatedIndexerIds[] = $this->getRelatedIndexerIds($relatedIndexerId); } - $relatedIndexerIds = array_merge(...$relatedIndexerIds); - - return array_unique($relatedIndexerIds); + return array_unique(array_merge(...$relatedIndexerIds)); } /** @@ -180,13 +179,14 @@ private function getRelatedIndexerIds(string $indexerId) * @param string $indexerId * @return array */ - private function getDependentIndexerIds(string $indexerId) + private function getDependentIndexerIds(string $indexerId): array { $dependentIndexerIds = [[]]; foreach (array_keys($this->getConfig()->getIndexers()) as $id) { $dependencies = $this->getDependencyInfoProvider()->getIndexerIdsToRunBefore($id); if (array_search($indexerId, $dependencies) !== false) { - array_push($dependentIndexerIds, [$id], $this->getDependentIndexerIds($id)); + $dependentIndexerIds[] = [$id]; + $dependentIndexerIds[] = $this->getDependentIndexerIds($id); } } From add2bbb8f6b82f450dbf7e466f12f93254c0eed0 Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <nazarn96@gmail.com> Date: Thu, 2 Jan 2020 11:35:27 +0200 Subject: [PATCH 514/586] cover changes with unit test --- .../Test/Unit/Controller/Index/SendTest.php | 57 ++++++++++++++++--- 1 file changed, 50 insertions(+), 7 deletions(-) diff --git a/app/code/Magento/Wishlist/Test/Unit/Controller/Index/SendTest.php b/app/code/Magento/Wishlist/Test/Unit/Controller/Index/SendTest.php index 47148f7878134..c70c2a1a6a9b6 100644 --- a/app/code/Magento/Wishlist/Test/Unit/Controller/Index/SendTest.php +++ b/app/code/Magento/Wishlist/Test/Unit/Controller/Index/SendTest.php @@ -5,7 +5,10 @@ */ namespace Magento\Wishlist\Test\Unit\Controller\Index; +use Magento\Captcha\Helper\Data as CaptchaHelper; +use Magento\Captcha\Model\DefaultModel as CaptchaModel; use Magento\Customer\Model\Data\Customer as CustomerData; +use Magento\Customer\Model\Session; use Magento\Framework\App\Action\Context as ActionContext; use Magento\Framework\App\RequestInterface; use Magento\Framework\Controller\Result\Redirect as ResultRedirect; @@ -14,15 +17,13 @@ use Magento\Framework\Event\ManagerInterface as EventManagerInterface; use Magento\Framework\Mail\TransportInterface; use Magento\Framework\Message\ManagerInterface; +use Magento\Framework\Phrase; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use Magento\Framework\UrlInterface; use Magento\Framework\View\Result\Layout as ResultLayout; use Magento\Store\Model\Store; use Magento\Wishlist\Controller\Index\Send; use Magento\Wishlist\Controller\WishlistProviderInterface; -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; -use Magento\Captcha\Helper\Data as CaptchaHelper; -use Magento\Captcha\Model\DefaultModel as CaptchaModel; -use Magento\Customer\Model\Session; /** * @SuppressWarnings(PHPMD.TooManyFields) @@ -212,7 +213,12 @@ protected function setUp() ); } - public function testExecuteNoFormKeyValidated() + /** + * Verify execute method without Form Key validated + * + * @return void + */ + public function testExecuteNoFormKeyValidated(): void { $this->formKeyValidator->expects($this->once()) ->method('validate') @@ -228,8 +234,43 @@ public function testExecuteNoFormKeyValidated() } /** - * @expectedException \Magento\Framework\Exception\NotFoundException - * @expectedExceptionMessage Page not found. + * Verify execute with no emails left + * + * @return void + */ + public function testExecuteWithNoEmailLeft(): void + { + $expectedMessage = new Phrase('Maximum of %1 emails can be sent.', [0]); + + $this->formKeyValidator->expects($this->once()) + ->method('validate') + ->with($this->request) + ->willReturn(true); + + $this->request->expects($this->at(0)) + ->method('getPost') + ->with('emails') + ->willReturn('some.Email@gmail.com', 'some.email2@gmail.com'); + $this->request->expects($this->at(1)) + ->method('getPost') + ->with('message'); + $wishlist = $this->createMock(\Magento\Wishlist\Model\Wishlist::class); + $this->wishlistProvider->expects($this->once()) + ->method('getWishlist') + ->willReturn($wishlist); + $this->resultRedirect->expects($this->once()) + ->method('setPath') + ->with('*/*/share') + ->willReturnSelf(); + $this->messageManager->expects($this->once()) + ->method('addErrorMessage') + ->with($expectedMessage); + + $this->assertEquals($this->resultRedirect, $this->model->execute()); + } + + /** + * Execute method with no wishlist available */ public function testExecuteNoWishlistAvailable() { @@ -241,6 +282,8 @@ public function testExecuteNoWishlistAvailable() $this->wishlistProvider->expects($this->once()) ->method('getWishlist') ->willReturn(null); + $this->expectException(\Magento\Framework\Exception\NotFoundException::class); + $this->expectExceptionMessage('Page not found'); $this->model->execute(); } From 69f6da07a6443eddd099f7f53ebc52bf3f7f2ba0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chitesh=40wagento=2Ecom=E2=80=9D?= <hitesh@wagento.com> Date: Thu, 2 Jan 2020 15:21:14 +0530 Subject: [PATCH 515/586] [Align some space between input and update button Minicart] --- .../blank/Magento_Checkout/web/css/source/module/_minicart.less | 2 ++ .../luma/Magento_Checkout/web/css/source/module/_minicart.less | 2 ++ 2 files changed, 4 insertions(+) diff --git a/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_minicart.less b/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_minicart.less index 133dd0fe721bb..ba07580e17c03 100644 --- a/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_minicart.less +++ b/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_minicart.less @@ -348,6 +348,7 @@ .update-cart-item { .lib-font-size(11); vertical-align: top; + margin-left: 5px; } .subtitle { @@ -399,6 +400,7 @@ } .update-cart-item { float: right; + margin-left: 0; } } } diff --git a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_minicart.less b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_minicart.less index 43ccee738a45e..556a3ca689afb 100644 --- a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_minicart.less +++ b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_minicart.less @@ -377,6 +377,7 @@ .update-cart-item { .lib-font-size(11); vertical-align: top; + margin-left: 5px; } .subtitle { @@ -428,6 +429,7 @@ } .update-cart-item { float: right; + margin-left: 0; } } } From 3182759c834cdb623a2194b75e5ae6bd4188577d Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <nazarn96@gmail.com> Date: Thu, 2 Jan 2020 12:42:49 +0200 Subject: [PATCH 516/586] Cover changes with unit test --- .../Unit/Model/ResourceModel/CustomerRepositoryTest.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/CustomerRepositoryTest.php b/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/CustomerRepositoryTest.php index 8032399e14881..015213847e7ee 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/CustomerRepositoryTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/CustomerRepositoryTest.php @@ -211,6 +211,7 @@ public function testSave() 'setFirstFailure', 'setLockExpires', 'save', + 'setGroupId' ] ); @@ -245,9 +246,15 @@ public function testSave() $this->customer->expects($this->atLeastOnce()) ->method('getId') ->willReturn($customerId); - $this->customer->expects($this->atLeastOnce()) + $this->customer->expects($this->at(4)) ->method('__toArray') ->willReturn([]); + $this->customer->expects($this->at(3)) + ->method('__toArray') + ->willReturn(['group_id' => 1]); + $customerModel->expects($this->once()) + ->method('setGroupId') + ->with(1); $this->customerRegistry->expects($this->atLeastOnce()) ->method('retrieve') ->with($customerId) From 3bce77fda3f048829b217b49dc37368fc6bf79e4 Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <nazarn96@gmail.com> Date: Thu, 2 Jan 2020 13:12:42 +0200 Subject: [PATCH 517/586] fix phpStan test --- .../Magento/Customer/Model/ResourceModel/CustomerRepository.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Customer/Model/ResourceModel/CustomerRepository.php b/app/code/Magento/Customer/Model/ResourceModel/CustomerRepository.php index 323b6c5d53714..0611a2df641e7 100644 --- a/app/code/Magento/Customer/Model/ResourceModel/CustomerRepository.php +++ b/app/code/Magento/Customer/Model/ResourceModel/CustomerRepository.php @@ -17,6 +17,7 @@ use Magento\Customer\Model\Data\CustomerSecureFactory; use Magento\Customer\Model\Delegation\Data\NewOperation; use Magento\Customer\Model\Delegation\Storage as DelegatedStorage; +use Magento\Customer\Model\ResourceModel\Customer\Collection; use Magento\Framework\Api\DataObjectHelper; use Magento\Framework\Api\ExtensibleDataObjectConverter; use Magento\Framework\Api\ExtensionAttribute\JoinProcessorInterface; From c39e85c84449f86b2c9d27d377e548547273883f Mon Sep 17 00:00:00 2001 From: divyajyothi5321 <54176640+divyajyothi5321@users.noreply.github.com> Date: Thu, 2 Jan 2020 16:58:27 +0530 Subject: [PATCH 518/586] Added Fix for 25936 --- .../luma/Magento_Catalog/web/css/source/_module.less | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/_module.less b/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/_module.less index 9b6986249b009..27533a0eb598f 100644 --- a/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/_module.less +++ b/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/_module.less @@ -174,9 +174,9 @@ width: 100%; .price-box { - display: table-cell; + display: inline-block; vertical-align: top; - width: 1px; + width: auto; .price-container { > span { @@ -228,7 +228,8 @@ } .product-info-stock-sku { - display: table-cell; + display: inline-block; + float: right; padding-bottom: @indent__s; padding-left: 10%; text-align: right; From 7e5e6c773712359e303f4b4ee1ebc1b2fb8b85af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chitesh=40wagento=2Ecom=E2=80=9D?= <hitesh@wagento.com> Date: Thu, 2 Jan 2020 17:39:32 +0530 Subject: [PATCH 519/586] [Align some space between input and update button Minicart] --- .../blank/Magento_Checkout/web/css/source/module/_minicart.less | 2 +- .../luma/Magento_Checkout/web/css/source/module/_minicart.less | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_minicart.less b/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_minicart.less index ba07580e17c03..c9b1d41857eee 100644 --- a/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_minicart.less +++ b/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_minicart.less @@ -347,8 +347,8 @@ .update-cart-item { .lib-font-size(11); - vertical-align: top; margin-left: 5px; + vertical-align: top; } .subtitle { diff --git a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_minicart.less b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_minicart.less index 556a3ca689afb..14c754623cf03 100644 --- a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_minicart.less +++ b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_minicart.less @@ -376,8 +376,8 @@ .update-cart-item { .lib-font-size(11); - vertical-align: top; margin-left: 5px; + vertical-align: top; } .subtitle { From e79febaf020687637fb15a3308a3f1702d4c9040 Mon Sep 17 00:00:00 2001 From: Lena Orobei <oorobei@magento.com> Date: Thu, 2 Jan 2020 11:56:13 -0600 Subject: [PATCH 520/586] Forward-port magento/graphql-ce#443 and magento/graphql-ce#1073 --- .../DataProvider/SwatchDataProvider.php | 208 +----------------- .../Resolver/Product/Options/SwatchData.php | 8 +- .../Options/SwatchDataTypeResolver.php | 9 +- .../SwatchesGraphQl/etc/schema.graphqls | 2 +- .../Swatches/ProductSwatchDataTest.php | 145 +++++------- ...e_with_different_options_type_rollback.php | 5 +- ...bled_product_image_for_swatch_rollback.php | 1 - 7 files changed, 75 insertions(+), 303 deletions(-) diff --git a/app/code/Magento/SwatchesGraphQl/Model/Resolver/Product/Options/DataProvider/SwatchDataProvider.php b/app/code/Magento/SwatchesGraphQl/Model/Resolver/Product/Options/DataProvider/SwatchDataProvider.php index 9e62ae928fb53..e7cd4c567da7f 100644 --- a/app/code/Magento/SwatchesGraphQl/Model/Resolver/Product/Options/DataProvider/SwatchDataProvider.php +++ b/app/code/Magento/SwatchesGraphQl/Model/Resolver/Product/Options/DataProvider/SwatchDataProvider.php @@ -7,18 +7,12 @@ namespace Magento\SwatchesGraphQl\Model\Resolver\Product\Options\DataProvider; -use Magento\Catalog\Api\Data\ProductInterface; -use Magento\Catalog\Model\Product\Image\UrlBuilder; -use Magento\Framework\Exception\LocalizedException; -use Magento\Framework\Exception\NoSuchEntityException; -use Magento\Framework\Exception\RuntimeException; -use Magento\Framework\GraphQl\Query\EnumLookup; use Magento\Swatches\Helper\Data as SwatchData; use Magento\Swatches\Helper\Media as SwatchesMedia; use Magento\Swatches\Model\Swatch; /** - * Swatch data provider + * Data provider for options swatches. */ class SwatchDataProvider { @@ -32,219 +26,41 @@ class SwatchDataProvider */ private $swatchMediaHelper; - /** - * @var UrlBuilder - */ - private $imageUrlBuilder; - - /** - * @var EnumLookup - */ - private $enumLookup; - /** * SwatchDataProvider constructor. * * @param SwatchData $swatchHelper * @param SwatchesMedia $swatchMediaHelper - * @param UrlBuilder $imageUrlBuilder - * @param EnumLookup $enumLookup */ public function __construct( SwatchData $swatchHelper, - SwatchesMedia $swatchMediaHelper, - UrlBuilder $imageUrlBuilder, - EnumLookup $enumLookup + SwatchesMedia $swatchMediaHelper ) { $this->swatchHelper = $swatchHelper; $this->swatchMediaHelper = $swatchMediaHelper; - $this->imageUrlBuilder = $imageUrlBuilder; - $this->enumLookup = $enumLookup; } /** - * Get swatch data + * Returns swatch data by option ID. * * @param string $optionId - * @param ProductInterface $product - * - * @return array - * - * @throws LocalizedException - * @throws NoSuchEntityException - * @throws \LogicException + * @return array|null */ - public function getData(string $optionId, ProductInterface $product): array + public function getData(string $optionId): ?array { $swatches = $this->swatchHelper->getSwatchesByOptionsId([$optionId]); - if (!isset($swatches[$optionId], $swatches[$optionId]['type'], $swatches[$optionId]['value'])) { + if (!isset($swatches[$optionId]['type'], $swatches[$optionId]['value'])) { return null; } - $type = (int)$swatches[$optionId]['type']; $value = $swatches[$optionId]['value']; - $thumbnail = null; - - // change value & thumbnail if type is 'visual' + $data = ['value' => $value, 'type' => $type]; if ($type === Swatch::SWATCH_TYPE_VISUAL_IMAGE) { - $thumbnail = $this->swatchMediaHelper->getSwatchAttributeImage(Swatch::SWATCH_THUMBNAIL_NAME, $value); - $value = $this->swatchMediaHelper->getSwatchAttributeImage(Swatch::SWATCH_IMAGE_NAME, $value); + $data['thumbnail'] = $this->swatchMediaHelper->getSwatchAttributeImage( + Swatch::SWATCH_THUMBNAIL_NAME, + $value + ); } - - $attributeData = $this->getSwatchAttributeDataByOptionId($product, $optionId); - // check if swatch value should be getting from related product image - if (!$this->isUseProductImageForSwatch($attributeData)) { - return $this->getResultArray($value, $type, $thumbnail); - } - - // get product with existing image - $variationProduct = $this->getVariationProduct($attributeData, $optionId, $product); - if (null === $variationProduct) { - return $this->getResultArray($value, $type, $thumbnail); - } - - // set 'visual' type, because the product image is using as swatch value - $type = Swatch::SWATCH_TYPE_VISUAL_IMAGE; - - // get image from child product - $productImage = $this->getSwatchProductImage($variationProduct, Swatch::SWATCH_IMAGE_NAME); - if (null !== $productImage) { - $value = $productImage; - } - - // get thumbnail from child product - $productThumbnail = $this->getSwatchProductImage($variationProduct, Swatch::SWATCH_THUMBNAIL_NAME); - if (null !== $productThumbnail) { - $thumbnail = $productThumbnail; - } - - return $this->getResultArray($value, $type, $thumbnail); - } - - /** - * Get result array - * - * @param string $value - * @param int $type - * @param null|string $thumbnail - * - * @return array - * - * @throws RuntimeException - */ - private function getResultArray(string $value, int $type, ?string $thumbnail) - { - return [ - 'value' => $value, - 'type' => $this->enumLookup->getEnumValueFromField('SwatchTypeEnum', (string)$type), - 'thumbnail' => $thumbnail - ]; - } - - /** - * Is swatch images should be getting from related simple products - * - * @param array $attributeData - * - * @return bool - */ - private function isUseProductImageForSwatch(array $attributeData) : bool - { - return isset($attributeData['use_product_image_for_swatch']) && $attributeData['use_product_image_for_swatch']; - } - - /** - * Get simple product with first variation swatch image or image - * - * @param array $attributeData - * @param string $optionId - * @param ProductInterface $product - * - * @return ProductInterface|null - */ - private function getVariationProduct(array $attributeData, string $optionId, ProductInterface $product) : ?ProductInterface - { - $attributeCode = $attributeData['attribute_code']; - $requiredAttributes = [ - $attributeCode => $optionId - ]; - - $variationProduct = $this->swatchHelper->loadFirstVariationWithSwatchImage($product, $requiredAttributes); - if ($variationProduct instanceof ProductInterface) { - return $variationProduct; - } - - $variationProduct = $this->swatchHelper->loadFirstVariationWithImage($product, $requiredAttributes); - if ($variationProduct instanceof ProductInterface) { - return $variationProduct; - } - - return null; - } - - /** - * Get swatch product image - * - * @param ProductInterface $product - * @param string $imageType - * - * @return string|null - */ - private function getSwatchProductImage(ProductInterface $product, $imageType) : ?string - { - if ($this->isProductHasImage($product, Swatch::SWATCH_IMAGE_NAME)) { - $swatchImageId = $imageType; - $imageAttributes = ['type' => Swatch::SWATCH_IMAGE_NAME]; - } elseif ($this->isProductHasImage($product, 'image')) { - $swatchImageId = $imageType == Swatch::SWATCH_IMAGE_NAME ? 'swatch_image_base' : 'swatch_thumb_base'; - $imageAttributes = ['type' => 'image']; - } - - if (empty($swatchImageId) || empty($imageAttributes['type'])) { - return null; - } - - return $this->imageUrlBuilder->getUrl($product->getData($imageAttributes['type']), $swatchImageId); - } - - /** - * Is product has image - * - * @param ProductInterface $product - * @param string $imageType - * - * @return bool - */ - private function isProductHasImage(ProductInterface $product, string $imageType) : bool - { - return $product->getData($imageType) !== null && $product->getData($imageType) != SwatchData::EMPTY_IMAGE_VALUE; - } - - /** - * Get swatch attribute data by option id - * - * @param ProductInterface $product - * @param string $optionId - * - * @return array - * - * @throws LocalizedException - * @throws \LogicException - * @throws NoSuchEntityException - */ - private function getSwatchAttributeDataByOptionId(ProductInterface $product, string $optionId) : array - { - $attributesData = $this->swatchHelper->getSwatchAttributesAsArray($product); - foreach ($attributesData as $attributeData) { - if (!isset($attributeData['options']) || !is_array($attributeData['options'])) { - continue; - } - - if (array_key_exists($optionId, $attributeData['options'])) { - return $attributeData; - } - } - - throw new LocalizedException(__(sprintf('Cannot find the attribute with option id "%1".', $optionId))); + return $data; } } diff --git a/app/code/Magento/SwatchesGraphQl/Model/Resolver/Product/Options/SwatchData.php b/app/code/Magento/SwatchesGraphQl/Model/Resolver/Product/Options/SwatchData.php index 9fea3b3ff59e5..980f779e8e9f6 100644 --- a/app/code/Magento/SwatchesGraphQl/Model/Resolver/Product/Options/SwatchData.php +++ b/app/code/Magento/SwatchesGraphQl/Model/Resolver/Product/Options/SwatchData.php @@ -7,8 +7,6 @@ namespace Magento\SwatchesGraphQl\Model\Resolver\Product\Options; -use Magento\Catalog\Api\Data\ProductInterface; -use Magento\Framework\Exception\LocalizedException; use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; @@ -47,10 +45,6 @@ public function resolve( array $value = null, array $args = null ) { - if (!array_key_exists('model', $value) || !$value['model'] instanceof ProductInterface) { - throw new LocalizedException(__('"model" value should be specified')); - } - - return $this->swatchDataProvider->getData($value['value_index'], $value['model']); + return $this->swatchDataProvider->getData($value['value_index']); } } diff --git a/app/code/Magento/SwatchesGraphQl/Model/Resolver/Product/Options/SwatchDataTypeResolver.php b/app/code/Magento/SwatchesGraphQl/Model/Resolver/Product/Options/SwatchDataTypeResolver.php index 96f584524fd27..add6f7123b921 100644 --- a/app/code/Magento/SwatchesGraphQl/Model/Resolver/Product/Options/SwatchDataTypeResolver.php +++ b/app/code/Magento/SwatchesGraphQl/Model/Resolver/Product/Options/SwatchDataTypeResolver.php @@ -7,6 +7,7 @@ namespace Magento\SwatchesGraphQl\Model\Resolver\Product\Options; +use Magento\Framework\Exception\LocalizedException; use Magento\Framework\GraphQl\Query\Resolver\TypeResolverInterface; use Magento\Swatches\Model\Swatch; @@ -16,19 +17,19 @@ class SwatchDataTypeResolver implements TypeResolverInterface { /** - * {@inheritdoc} + * @inheritdoc */ public function resolveType(array $data): string { switch ($data['type']) { case Swatch::SWATCH_TYPE_TEXTUAL: return 'TextSwatchData'; - case Swatch::SWATCH_TYPE_VISUAL_COLOR; + case Swatch::SWATCH_TYPE_VISUAL_COLOR: return 'ColorSwatchData'; - case Swatch::SWATCH_TYPE_VISUAL_IMAGE; + case Swatch::SWATCH_TYPE_VISUAL_IMAGE: return 'ImageSwatchData'; default: - return ''; + throw new LocalizedException(__('Unsupported swatch type')); } } } diff --git a/app/code/Magento/SwatchesGraphQl/etc/schema.graphqls b/app/code/Magento/SwatchesGraphQl/etc/schema.graphqls index f986723a24545..c51468ccd2856 100644 --- a/app/code/Magento/SwatchesGraphQl/etc/schema.graphqls +++ b/app/code/Magento/SwatchesGraphQl/etc/schema.graphqls @@ -46,4 +46,4 @@ type TextSwatchData implements SwatchDataInterface { type ColorSwatchData implements SwatchDataInterface { -} \ No newline at end of file +} diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Swatches/ProductSwatchDataTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Swatches/ProductSwatchDataTest.php index ab4e001e9d633..c356012c71f47 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Swatches/ProductSwatchDataTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Swatches/ProductSwatchDataTest.php @@ -7,14 +7,13 @@ namespace Magento\GraphQl\Swatches; -use Magento\Catalog\Model\Product\Image\UrlBuilder; use Magento\Swatches\Helper\Media as SwatchesMedia; use Magento\Swatches\Model\Swatch; use Magento\TestFramework\Helper\Bootstrap; use Magento\TestFramework\TestCase\GraphQlAbstract; /** - * Class ProductSwatchDataTest + * Test for configurable product option swatch data */ class ProductSwatchDataTest extends GraphQlAbstract { @@ -23,11 +22,6 @@ class ProductSwatchDataTest extends GraphQlAbstract */ private $swatchMediaHelper; - /** - * @var UrlBuilder - */ - private $imageUrlBuilder; - /** * @inheritdoc */ @@ -35,28 +29,24 @@ protected function setUp() { $objectManager = Bootstrap::getObjectManager(); $this->swatchMediaHelper = $objectManager->get(SwatchesMedia::class); - $this->imageUrlBuilder = $objectManager->get(UrlBuilder::class); } /** - * @param string $productSku - * - * @return mixed - * @throws \PHPUnit\Framework\Exception + * @magentoApiDataFixture Magento/Swatches/_files/text_swatch_attribute.php + * @magentoApiDataFixture Magento/ConfigurableProduct/_files/configurable_products.php */ - private function getSwatchDataValues($productSku = 'configurable') + public function testTextSwatchDataValues() { + $productSku = 'configurable'; $query = <<<QUERY { - products(filter: {sku: {eq: "{$productSku}"}}) { + products(filter: {sku: {eq: "$productSku"}}) { items { ... on ConfigurableProduct{ configurable_options{ values { swatch_data{ - type value - thumbnail } } } @@ -77,90 +67,61 @@ private function getSwatchDataValues($productSku = 'configurable') $option = $product['configurable_options'][0]; $this->assertArrayHasKey('values', $option); - - return $option['values']; - } - - /** - * @magentoApiDataFixture Magento/Swatches/_files/visual_swatch_attribute_with_enabled_product_image_for_swatch.php - */ - public function testGetSwatchDataForVisualOptionsWithProductImage() - { - $productSku = 'configurable_12345'; - $productImage = '/m/a/magento_image.jpg'; - $swatchImageName = '/visual_swatch_attribute_option_type_image.jpg'; - $expectedValues = [ - 0 => [ - 'swatch_data' => [ - 'type' => 'IMAGE', - 'value' => $this->imageUrlBuilder->getUrl($productImage, Swatch::SWATCH_IMAGE_NAME), - 'thumbnail' => $this->imageUrlBuilder->getUrl($productImage, Swatch::SWATCH_THUMBNAIL_NAME), - ], - ], - 1 => [ - 'swatch_data' => [ - 'type' => 'IMAGE', - 'value' => $this->swatchMediaHelper->getSwatchAttributeImage(Swatch::SWATCH_IMAGE_NAME, $swatchImageName), - 'thumbnail' => $this->swatchMediaHelper->getSwatchAttributeImage(Swatch::SWATCH_THUMBNAIL_NAME, $swatchImageName), - ], - ], - 2 => [ - 'swatch_data' => NULL, - ], - ]; - - $values = $this->getSwatchDataValues($productSku); - $this->assertEquals($values, $expectedValues); - } - - /** - * @magentoApiDataFixture Magento/Swatches/_files/textual_swatch_attribute.php - * @magentoApiDataFixture Magento/ConfigurableProduct/_files/configurable_products.php - */ - public function testGetSwatchDataForTextualOptions() - { - $expectType = "TEXTUAL"; - $expectValue = "option 1"; - $expectThumbnail = null; - - $values = $this->getSwatchDataValues(); - $this->assertArrayHasKey(0, $values); - - $value = $values[0]; - $this->assertArrayHasKey('swatch_data', $value); - $this->assertEquals($expectType, $value['swatch_data']['type']); - $this->assertEquals($expectValue, $value['swatch_data']['value']); - $this->assertEquals($expectThumbnail, $value['swatch_data']['thumbnail']); + $length = count($option['values']); + for ($i = 0; $i < $length; $i++) { + $this->assertEquals('option ' . ($i + 1), $option['values'][$i]['swatch_data']['value']); + } } /** * @magentoApiDataFixture Magento/Swatches/_files/visual_swatch_attribute_with_different_options_type.php * @magentoApiDataFixture Magento/ConfigurableProduct/_files/configurable_products.php */ - public function testGetSwatchDataForVisualOptions() + public function testVisualSwatchDataValues() { + $productSku = 'configurable'; $imageName = '/visual_swatch_attribute_option_type_image.jpg'; - $expectedValues = [ - 0 => [ - 'swatch_data' => [ - 'type' => 'COLOR', - 'value' => '#000000', - 'thumbnail' => NULL, - ], - ], - 1 => [ - 'swatch_data' => [ - 'type' => 'IMAGE', - 'value' => $this->swatchMediaHelper->getSwatchAttributeImage(Swatch::SWATCH_IMAGE_NAME, $imageName), - 'thumbnail' => $this->swatchMediaHelper->getSwatchAttributeImage(Swatch::SWATCH_THUMBNAIL_NAME, $imageName), - ], - ], - 2 => [ - 'swatch_data' => NULL, - ], - ]; + $color = '#000000'; + $query = <<<QUERY +{ + products(filter: {sku: {eq: "$productSku"}}) { + items { + ... on ConfigurableProduct{ + configurable_options{ + values { + swatch_data{ + value + ... on ImageSwatchData { + thumbnail + } + } + } + } + } + } + } +} +QUERY; + $response = $this->graphQlQuery($query); + + $this->assertArrayHasKey('products', $response); + $this->assertArrayHasKey('items', $response['products']); + $this->assertArrayHasKey(0, $response['products']['items']); - $values = $this->getSwatchDataValues(); - $this->assertEquals($values, $expectedValues); + $product = $response['products']['items'][0]; + $this->assertArrayHasKey('configurable_options', $product); + $this->assertArrayHasKey(0, $product['configurable_options']); + + $option = $product['configurable_options'][0]; + $this->assertArrayHasKey('values', $option); + $this->assertEquals($color, $option['values'][0]['swatch_data']['value']); + $this->assertContains( + $option['values'][1]['swatch_data']['value'], + $this->swatchMediaHelper->getSwatchAttributeImage(Swatch::SWATCH_IMAGE_NAME, $imageName) + ); + $this->assertEquals( + $option['values'][1]['swatch_data']['thumbnail'], + $this->swatchMediaHelper->getSwatchAttributeImage(Swatch::SWATCH_THUMBNAIL_NAME, $imageName) + ); } } diff --git a/dev/tests/integration/testsuite/Magento/Swatches/_files/visual_swatch_attribute_with_different_options_type_rollback.php b/dev/tests/integration/testsuite/Magento/Swatches/_files/visual_swatch_attribute_with_different_options_type_rollback.php index ef1db34708fb3..7f9328368464e 100644 --- a/dev/tests/integration/testsuite/Magento/Swatches/_files/visual_swatch_attribute_with_different_options_type_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Swatches/_files/visual_swatch_attribute_with_different_options_type_rollback.php @@ -29,6 +29,7 @@ foreach ($swatchTypes as $swatchType) { $absolutePath = $mediaDirectory->getAbsolutePath($swatchesMedia->getSwatchCachePath($swatchType)); - $swatchTypePath = $absolutePath . $swatchesMedia->getFolderNameSize($swatchType, $imageConfig) . '/' . $testImageName; + $swatchTypePath = $absolutePath . $swatchesMedia->getFolderNameSize($swatchType, $imageConfig) . + '/' . $testImageName; $mediaDirectory->delete($swatchTypePath); -} +} \ No newline at end of file diff --git a/dev/tests/integration/testsuite/Magento/Swatches/_files/visual_swatch_attribute_with_enabled_product_image_for_swatch_rollback.php b/dev/tests/integration/testsuite/Magento/Swatches/_files/visual_swatch_attribute_with_enabled_product_image_for_swatch_rollback.php index c708971326162..85c02049a992a 100644 --- a/dev/tests/integration/testsuite/Magento/Swatches/_files/visual_swatch_attribute_with_enabled_product_image_for_swatch_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Swatches/_files/visual_swatch_attribute_with_enabled_product_image_for_swatch_rollback.php @@ -8,4 +8,3 @@ require __DIR__ . '/visual_swatch_attribute_with_different_options_type_rollback.php'; require __DIR__ . '/../../../Magento/ConfigurableProduct/_files/configurable_products_rollback.php'; require __DIR__ . '/../../../Magento/Catalog/_files/product_image_rollback.php'; - From aba1a24ee2146a85c6728fba78ee9c701792a40c Mon Sep 17 00:00:00 2001 From: Lena Orobei <oorobei@magento.com> Date: Thu, 2 Jan 2020 12:51:42 -0600 Subject: [PATCH 521/586] Forward-port magento/graphql-ce#443 and magento/graphql-ce#1073 --- ...al_swatch_attribute_with_different_options_type_rollback.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/integration/testsuite/Magento/Swatches/_files/visual_swatch_attribute_with_different_options_type_rollback.php b/dev/tests/integration/testsuite/Magento/Swatches/_files/visual_swatch_attribute_with_different_options_type_rollback.php index 7f9328368464e..c480906619a4a 100644 --- a/dev/tests/integration/testsuite/Magento/Swatches/_files/visual_swatch_attribute_with_different_options_type_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Swatches/_files/visual_swatch_attribute_with_different_options_type_rollback.php @@ -32,4 +32,4 @@ $swatchTypePath = $absolutePath . $swatchesMedia->getFolderNameSize($swatchType, $imageConfig) . '/' . $testImageName; $mediaDirectory->delete($swatchTypePath); -} \ No newline at end of file +} From 388f2e95d36ddae1ecb2a6c2730672e55c859720 Mon Sep 17 00:00:00 2001 From: Daniel Renaud <drenaud@magento.com> Date: Thu, 2 Jan 2020 16:35:15 -0600 Subject: [PATCH 522/586] MC-25215: [Forwardport] [GraphQL] Row_id is used as id for product resolver - MC-25216: [Forwardport] [GraphQL] Deprecate fields in ProductInterface - MC-29135: [Forwardport] Throw GraphQL input exception when provided store is not enabled --- .../Model/Resolver/Product/EntityIdToId.php | 2 +- .../CatalogGraphQl/etc/schema.graphqls | 4 +- .../HttpRequestValidator/StoreValidator.php | 12 ++-- .../Magento/StoreGraphQl/etc/schema.graphqls | 14 ++--- .../GraphQl/Bundle/BundleProductViewTest.php | 16 ------ .../GraphQl/Catalog/ProductViewTest.php | 14 ----- .../Catalog/VirtualProductViewTest.php | 6 -- .../ConfigurableProductViewTest.php | 2 +- .../GraphQl/Store/StoreValidatorTest.php | 56 +++++++++++++++++++ .../Magento/GraphQl/Tax/ProductViewTest.php | 6 -- .../Magento/Store/_files/inactive_store.php | 34 +++++++++++ .../Store/_files/inactive_store_rollback.php | 24 ++++++++ 12 files changed, 130 insertions(+), 60 deletions(-) create mode 100644 dev/tests/api-functional/testsuite/Magento/GraphQl/Store/StoreValidatorTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Store/_files/inactive_store.php create mode 100644 dev/tests/integration/testsuite/Magento/Store/_files/inactive_store_rollback.php diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/EntityIdToId.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/EntityIdToId.php index ada3caad5f9f8..701ee70204486 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/EntityIdToId.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/EntityIdToId.php @@ -53,7 +53,7 @@ public function resolve( $product = $value['model']; $productId = $product->getData( - $this->metadataPool->getMetadata(ProductInterface::class)->getLinkField() + $this->metadataPool->getMetadata(ProductInterface::class)->getIdentifierField() ); return $productId; diff --git a/app/code/Magento/CatalogGraphQl/etc/schema.graphqls b/app/code/Magento/CatalogGraphQl/etc/schema.graphqls index f70a32a1b549e..8da50beacb2fe 100644 --- a/app/code/Magento/CatalogGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CatalogGraphQl/etc/schema.graphqls @@ -100,8 +100,8 @@ interface ProductInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model\ created_at: String @doc(description: "Timestamp indicating when the product was created.") updated_at: String @doc(description: "Timestamp indicating when the product was updated.") country_of_manufacture: String @doc(description: "The product's country of origin.") - type_id: String @doc(description: "One of simple, virtual, bundle, downloadable, grouped, or configurable.") - websites: [Website] @doc(description: "An array of websites in which the product is available.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\Websites") + type_id: String @doc(description: "One of simple, virtual, bundle, downloadable, grouped, or configurable.") @deprecated(reason: "Use __typename instead.") + websites: [Website] @doc(description: "An array of websites in which the product is available.") @deprecated(reason: "The field should not be used on the storefront.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\Websites") product_links: [ProductLinksInterface] @doc(description: "An array of ProductLinks objects.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\BatchProductLinks") media_gallery_entries: [MediaGalleryEntry] @deprecated(reason: "Use product's `media_gallery` instead") @doc(description: "An array of MediaGalleryEntry objects.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\MediaGalleryEntries") price: ProductPrices @deprecated(reason: "Use price_range for product price information.") @doc(description: "A ProductPrices object, indicating the price of an item.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\Price") diff --git a/app/code/Magento/StoreGraphQl/Controller/HttpRequestValidator/StoreValidator.php b/app/code/Magento/StoreGraphQl/Controller/HttpRequestValidator/StoreValidator.php index 144905d728141..3d41c975e591a 100644 --- a/app/code/Magento/StoreGraphQl/Controller/HttpRequestValidator/StoreValidator.php +++ b/app/code/Magento/StoreGraphQl/Controller/HttpRequestValidator/StoreValidator.php @@ -44,13 +44,11 @@ public function validate(HttpRequestInterface $request): void if (!empty($headerValue)) { $storeCode = ltrim(rtrim($headerValue)); $stores = $this->storeManager->getStores(false, true); - if (!isset($stores[$storeCode])) { - if (strtolower($storeCode) !== 'default') { - $this->storeManager->setCurrentStore(null); - throw new GraphQlInputException( - __("Requested store is not found") - ); - } + if ((!isset($stores[$storeCode]) && strtolower($storeCode) !== 'default') + || !$stores[$storeCode]->getIsActive() + ) { + $this->storeManager->setCurrentStore(null); + throw new GraphQlInputException(__('Requested store is not found')); } } } diff --git a/app/code/Magento/StoreGraphQl/etc/schema.graphqls b/app/code/Magento/StoreGraphQl/etc/schema.graphqls index aaef3aa13dbaf..919c94684eb21 100644 --- a/app/code/Magento/StoreGraphQl/etc/schema.graphqls +++ b/app/code/Magento/StoreGraphQl/etc/schema.graphqls @@ -4,13 +4,13 @@ type Query { storeConfig : StoreConfig @resolver(class: "Magento\\StoreGraphQl\\Model\\Resolver\\StoreConfigResolver") @doc(description: "The store config query") @cache(cacheable: false) } -type Website @doc(description: "The type contains information about a website") { - id : Int @doc(description: "The ID number assigned to the website") - name : String @doc(description: "The website name. Websites use this name to identify it easier.") - code : String @doc(description: "A code assigned to the website to identify it") - sort_order : Int @doc(description: "The attribute to use for sorting websites") - default_group_id : String @doc(description: "The default group ID that the website has") - is_default : Boolean @doc(description: "Specifies if this is the default website") +type Website @doc(description: "Website is deprecated because it is should not be used on storefront. The type contains information about a website") { + id : Int @deprecated(reason: "The field should not be used on the storefront.") @doc(description: "The ID number assigned to the website") + name : String @deprecated(reason: "The field should not be used on the storefront.") @doc(description: "The website name. Websites use this name to identify it easier.") + code : String @deprecated(reason: "The field should not be used on the storefront.") @doc(description: "A code assigned to the website to identify it") + sort_order : Int @deprecated(reason: "The field should not be used on the storefront.") @doc(description: "The attribute to use for sorting websites") + default_group_id : String @deprecated(reason: "The field should not be used on the storefront.") @doc(description: "The default group ID that the website has") + is_default : Boolean @deprecated(reason: "The field should not be used on the storefront.") @doc(description: "Specifies if this is the default website") } type StoreConfig @doc(description: "The type contains information about a store config") { diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/BundleProductViewTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/BundleProductViewTest.php index 5d08078cf7646..e7d939bc76c37 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/BundleProductViewTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/BundleProductViewTest.php @@ -10,7 +10,6 @@ use Magento\Bundle\Model\Product\OptionList; use Magento\Catalog\Api\Data\ProductInterface; use Magento\Catalog\Api\ProductRepositoryInterface; -use Magento\Framework\EntityManager\MetadataPool; use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\TestFramework\ObjectManager; use Magento\TestFramework\TestCase\GraphQlAbstract; @@ -83,12 +82,7 @@ public function testAllFieldsBundleProducts() /** @var ProductRepositoryInterface $productRepository */ $productRepository = ObjectManager::getInstance()->get(ProductRepositoryInterface::class); - /** @var MetadataPool $metadataPool */ - $metadataPool = ObjectManager::getInstance()->get(MetadataPool::class); $bundleProduct = $productRepository->get($productSku, false, null, true); - $bundleProduct->setId( - $bundleProduct->getData($metadataPool->getMetadata(ProductInterface::class)->getLinkField()) - ); if ((bool)$bundleProduct->getShipmentType()) { $this->assertEquals('SEPARATELY', $response['products']['items'][0]['ship_bundle_items']); } else { @@ -182,12 +176,7 @@ public function testBundleProductWithNotVisibleChildren() /** @var ProductRepositoryInterface $productRepository */ $productRepository = ObjectManager::getInstance()->get(ProductRepositoryInterface::class); - /** @var MetadataPool $metadataPool */ - $metadataPool = ObjectManager::getInstance()->get(MetadataPool::class); $bundleProduct = $productRepository->get($productSku, false, null, true); - $bundleProduct->setId( - $bundleProduct->getData($metadataPool->getMetadata(ProductInterface::class)->getLinkField()) - ); if ((bool)$bundleProduct->getShipmentType()) { $this->assertEquals('SEPARATELY', $response['products']['items'][0]['ship_bundle_items']); } else { @@ -238,7 +227,6 @@ private function assertBundleProductOptions($product, $actualResponse) $actualResponse['items'], "Precondition failed: 'bundle product items' must not be empty" ); - $metadataPool = ObjectManager::getInstance()->get(MetadataPool::class); /** @var OptionList $optionList */ $optionList = ObjectManager::getInstance()->get(\Magento\Bundle\Model\Product\OptionList::class); $options = $optionList->getItems($product); @@ -249,10 +237,6 @@ private function assertBundleProductOptions($product, $actualResponse) $childProductSku = $bundleProductLink->getSku(); $productRepository = ObjectManager::getInstance()->get(ProductRepositoryInterface::class); $childProduct = $productRepository->get($childProductSku); - /** @var MetadataPool $metadataPool */ - $childProduct->setId( - $childProduct->getData($metadataPool->getMetadata(ProductInterface::class)->getLinkField()) - ); $this->assertEquals(1, count($options)); $this->assertResponseFields( $actualResponse['items'][0], diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php index 3ade1a0ef17d0..9d6a5e6d414e0 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php @@ -13,7 +13,6 @@ use Magento\Catalog\Api\ProductRepositoryInterface; use Magento\Catalog\Model\Category; use Magento\Framework\DataObject; -use Magento\Framework\EntityManager\MetadataPool; use Magento\TestFramework\ObjectManager; use Magento\TestFramework\TestCase\GraphQlAbstract; @@ -270,11 +269,6 @@ public function testQueryAllFieldsSimpleProduct() /** @var ProductRepositoryInterface $productRepository */ $productRepository = ObjectManager::getInstance()->get(ProductRepositoryInterface::class); $product = $productRepository->get($productSku, false, null, true); - /** @var MetadataPool $metadataPool */ - $metadataPool = ObjectManager::getInstance()->get(MetadataPool::class); - $product->setId( - $product->getData($metadataPool->getMetadata(ProductInterface::class)->getLinkField()) - ); $this->assertArrayHasKey('products', $response); $this->assertArrayHasKey('items', $response['products']); $this->assertEquals(1, count($response['products']['items'])); @@ -656,15 +650,7 @@ public function testProductPrices() */ $productRepository = ObjectManager::getInstance()->get(ProductRepositoryInterface::class); $firstProduct = $productRepository->get($firstProductSku, false, null, true); - /** @var MetadataPool $metadataPool */ - $metadataPool = ObjectManager::getInstance()->get(MetadataPool::class); - $firstProduct->setId( - $firstProduct->getData($metadataPool->getMetadata(ProductInterface::class)->getLinkField()) - ); $secondProduct = $productRepository->get($secondProductSku, false, null, true); - $secondProduct->setId( - $secondProduct->getData($metadataPool->getMetadata(ProductInterface::class)->getLinkField()) - ); self::assertNotNull($response['products']['items'][0]['price'], "price must be not null"); self::assertCount(2, $response['products']['items']); $this->assertBaseFields($firstProduct, $response['products']['items'][0]); diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/VirtualProductViewTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/VirtualProductViewTest.php index 58b6d4f0e4ea2..80206b232585f 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/VirtualProductViewTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/VirtualProductViewTest.php @@ -9,7 +9,6 @@ use Magento\Catalog\Api\Data\ProductInterface; use Magento\Catalog\Api\ProductRepositoryInterface; -use Magento\Framework\EntityManager\MetadataPool; use Magento\TestFramework\ObjectManager; use Magento\TestFramework\TestCase\GraphQlAbstract; @@ -57,11 +56,6 @@ public function testQueryAllFieldsVirtualProduct() /** @var ProductRepositoryInterface $productRepository */ $productRepository = ObjectManager::getInstance()->get(ProductRepositoryInterface::class); $product = $productRepository->get($productSku, false, null, true); - /** @var MetadataPool $metadataPool */ - $metadataPool = ObjectManager::getInstance()->get(MetadataPool::class); - $product->setId( - $product->getData($metadataPool->getMetadata(ProductInterface::class)->getLinkField()) - ); $this->assertArrayHasKey('products', $response); $this->assertArrayHasKey('items', $response['products']); $this->assertEquals(1, count($response['products']['items'])); diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableProductViewTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableProductViewTest.php index 4729cae92717d..4837e2c6ec98a 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableProductViewTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableProductViewTest.php @@ -243,7 +243,7 @@ private function assertBaseFields($product, $actualResponse) 'expected_value' => $product->getData( $metadataPool->getMetadata( ProductInterface::class - )->getLinkField() + )->getIdentifierField() ) ], ['response_field' => 'name', 'expected_value' => $product->getName()], diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Store/StoreValidatorTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Store/StoreValidatorTest.php new file mode 100644 index 0000000000000..3e5f868a21da5 --- /dev/null +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Store/StoreValidatorTest.php @@ -0,0 +1,56 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\GraphQl\Store; + +use Magento\TestFramework\TestCase\GraphQlAbstract; + +/** + * Test the GraphQL `Store` header validation + */ +class StoreValidatorTest extends GraphQlAbstract +{ + /** + * @param string $storeCode + * @param string $errorMessage + * + * @dataProvider dataProviderInvalidStore + * @magentoApiDataFixture Magento/Store/_files/inactive_store.php + */ + public function testInvalidStoreHeader(string $storeCode, string $errorMessage) + { + $query + = <<<QUERY +{ + storeConfig{ + code + } +} +QUERY; + $this->expectExceptionMessage($errorMessage); + $this->graphQlMutation($query, [], '', ['Store' => $storeCode]); + } + + /** + * Data provider with invalid store codes and expected error messages + * + * @return array + */ + public function dataProviderInvalidStore(): array + { + return [ + 'non_existing' => [ + 'non_existing', + 'Requested store is not found' + ], + 'inactive_store' => [ + 'inactive_store', + 'Requested store is not found' + ] + ]; + } +} diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Tax/ProductViewTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Tax/ProductViewTest.php index 1dc5a813de2b8..461b5673235dd 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Tax/ProductViewTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Tax/ProductViewTest.php @@ -9,7 +9,6 @@ use Magento\Catalog\Api\Data\ProductInterface; use Magento\Catalog\Api\ProductRepositoryInterface; -use Magento\Framework\EntityManager\MetadataPool; use Magento\TestFramework\ObjectManager; use Magento\TestFramework\TestCase\GraphQlAbstract; use Magento\Store\Model\StoreManagerInterface; @@ -208,11 +207,6 @@ public function testQueryAllFieldsSimpleProduct() /** @var \Magento\Catalog\Model\Product $product */ $product = $this->productRepository->get($productSku, false, null, true); - /** @var MetadataPool $metadataPool */ - $metadataPool = ObjectManager::getInstance()->get(MetadataPool::class); - $product->setId( - $product->getData($metadataPool->getMetadata(ProductInterface::class)->getLinkField()) - ); $this->assertArrayHasKey('products', $response); $this->assertArrayHasKey('items', $response['products']); $this->assertEquals(1, count($response['products']['items'])); diff --git a/dev/tests/integration/testsuite/Magento/Store/_files/inactive_store.php b/dev/tests/integration/testsuite/Magento/Store/_files/inactive_store.php new file mode 100644 index 0000000000000..bcd170bf3c2d7 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Store/_files/inactive_store.php @@ -0,0 +1,34 @@ +<?php +/** + * Create store fixture + * + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +/** @var \Magento\Store\Model\Store $store */ +$store = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(\Magento\Store\Model\Store::class); +if (!$store->load('inactive_store', 'code')->getId()) { + $websiteId = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( + \Magento\Store\Model\StoreManagerInterface::class + )->getWebsite() + ->getId(); + $groupId = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( + \Magento\Store\Model\StoreManagerInterface::class + )->getWebsite()->getDefaultGroupId(); + $store->setCode( + 'inactive_store' + )->setWebsiteId( + $websiteId + )->setGroupId( + $groupId + )->setName( + 'Inactive Store' + )->setSortOrder( + 15 + )->setIsActive( + 0 + ); + $store->save(); +} diff --git a/dev/tests/integration/testsuite/Magento/Store/_files/inactive_store_rollback.php b/dev/tests/integration/testsuite/Magento/Store/_files/inactive_store_rollback.php new file mode 100644 index 0000000000000..4b03d2b0d5fde --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Store/_files/inactive_store_rollback.php @@ -0,0 +1,24 @@ +<?php +/** + * + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +/** @var \Magento\Framework\Registry $registry */ +$registry = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(\Magento\Framework\Registry::class); + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); + +/** @var Magento\Store\Model\Store $store */ +$store = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(\Magento\Store\Model\Store::class); +$store->load('inactive_store'); + +if ($store->getId()) { + $store->delete(); +} + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); From 82b29aac0789f2c2a5e0aad598df3a472c00d759 Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Fri, 3 Jan 2020 14:58:20 +0200 Subject: [PATCH 523/586] Removing the delete buttons for default customer groups --- .../Listing/Column/GroupActionsTest.php | 251 ++++++++++++++++++ .../Component/Listing/Column/GroupActions.php | 60 +++-- 2 files changed, 288 insertions(+), 23 deletions(-) create mode 100644 app/code/Magento/Customer/Test/Unit/Ui/Component/Listing/Column/GroupActionsTest.php diff --git a/app/code/Magento/Customer/Test/Unit/Ui/Component/Listing/Column/GroupActionsTest.php b/app/code/Magento/Customer/Test/Unit/Ui/Component/Listing/Column/GroupActionsTest.php new file mode 100644 index 0000000000000..51e652b15f53f --- /dev/null +++ b/app/code/Magento/Customer/Test/Unit/Ui/Component/Listing/Column/GroupActionsTest.php @@ -0,0 +1,251 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Customer\Test\Unit\Ui\Component\Listing\Column; + +use Magento\Customer\Api\GroupManagementInterface; +use Magento\Customer\Ui\Component\Listing\Column\GroupActions; +use Magento\Framework\Escaper; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Framework\UrlInterface; +use Magento\Framework\View\Element\UiComponent\ContextInterface; +use Magento\Framework\View\Element\UiComponentFactory; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Class GroupActionsTest + */ +class GroupActionsTest extends TestCase +{ + /** + * @var GroupActions + */ + private $component; + + /** + * @var ContextInterface|MockObject + */ + private $contextMock; + + /** + * @var UiComponentFactory|MockObject + */ + private $uiComponentFactoryMock; + + /** + * @var UrlInterface|MockObject + */ + private $urlBuilderMock; + + /** + * @var Escaper|MockObject + */ + private $escaperMock; + + /** + * @var GroupManagementInterface|MockObject + */ + private $groupManagementMock; + + /** + * Set Up + */ + public function setUp() + { + $objectManager = new ObjectManager($this); + + $this->contextMock = $this->getMockBuilder(ContextInterface::class)->getMockForAbstractClass(); + $this->uiComponentFactoryMock = $this->createMock(UiComponentFactory::class); + $this->escaperMock = $this->createMock(Escaper::class); + $this->groupManagementMock = $this->createMock(GroupManagementInterface::class); + $this->urlBuilderMock = $this->getMockForAbstractClass( + UrlInterface::class, + [], + '', + false + ); + + $this->component = $objectManager->getObject( + GroupActions::class, + [ + 'context' => $this->contextMock, + 'uiComponentFactory' => $this->uiComponentFactoryMock, + 'urlBuilder' => $this->urlBuilderMock, + 'escaper' => $this->escaperMock, + 'components' => [], + 'data' => [ + 'name' => 'name' + ], + 'groupManagement' => $this->groupManagementMock + ] + ); + } + + /** + * Test data source with a non default customer group + * + * @dataProvider customerGroupsDataProvider + * + * @param array $items + * @param bool $isDefaultGroup + * @param array $expected + */ + public function testPrepareDataSourceWithNonDefaultGroup(array $items, bool $isDefaultGroup, array $expected) + { + $customerGroup = 'General'; + $dataSource = [ + 'data' => [ + 'items' => $items + ] + ]; + $expectedDataSource = [ + 'data' => [ + 'items' => $expected + ] + ]; + + $this->groupManagementMock->expects($this->any()) + ->method('isReadonly') + ->with(1) + ->willReturn($isDefaultGroup); + $this->escaperMock->expects($this->any()) + ->method('escapeHtml') + ->with($customerGroup) + ->willReturn($customerGroup); + $this->urlBuilderMock->expects($this->any()) + ->method('getUrl') + ->willReturnMap( + [ + ['customer/group/edit', ['id' => 1], 'http://magento.com/customer/group/edit'], + ['customer/group/delete', ['id' => 1], 'http://magento.com/customer/group/delete'] + ] + ); + + $dataSource = $this->component->prepareDataSource($dataSource); + $this->assertEquals($expectedDataSource, $dataSource); + } + + /** + * Test data source with a default customer group + * + * @dataProvider customerGroupsDataProvider + */ + public function testPrepareDataSourceWithDefaultGroup() + { + $isDefaultGroup = true; + $dataSource = [ + 'data' => [ + 'items' => [ + [ + 'customer_group_id' => 1, + 'customer_group_code' => 'General', + ], + [ + 'customer_group_id' => 0, + 'customer_group_code' => 'Not Logged In', + ], + ] + ] + ]; + $expectedDataSource = [ + 'data' => [ + 'items' => [ + [ + 'customer_group_id' => 1, + 'customer_group_code' => 'General', + 'name' => [ + 'edit' => [ + 'href' => 'http://magento.com/customer/group/edit', + 'label' => __('Edit'), + '__disableTmpl' => true, + ] + ] + ], + [ + 'customer_group_id' => 0, + 'customer_group_code' => 'Not Logged In', + 'name' => [ + 'edit' => [ + 'href' => 'http://magento.com/customer/group/edit', + 'label' => __('Edit'), + '__disableTmpl' => true, + ] + ] + ] + ] + ] + ]; + + $this->groupManagementMock->expects($this->any()) + ->method('isReadonly') + ->willReturn($isDefaultGroup); + $this->escaperMock->expects($this->any()) + ->method('escapeHtml') + ->willReturnMap( + [ + ['General', null, 'General'], + ['Not Logged In', null, 'Not Logged In'] + ] + ); + $this->urlBuilderMock->expects($this->any()) + ->method('getUrl') + ->willReturnMap( + [ + ['customer/group/edit', ['id' => 1], 'http://magento.com/customer/group/edit'], + ['customer/group/edit', ['id' => 0], 'http://magento.com/customer/group/edit'] + ] + ); + + $dataSource = $this->component->prepareDataSource($dataSource); + $this->assertEquals($expectedDataSource, $dataSource); + } + + /** + * Providing customer group data + * + * @return array + */ + public function customerGroupsDataProvider(): array + { + return [ + [ + [ + [ + 'customer_group_id' => 1, + 'customer_group_code' => 'General', + ], + ], + false, + [ + [ + 'customer_group_id' => 1, + 'customer_group_code' => 'General', + 'name' => [ + 'edit' => [ + 'href' => 'http://magento.com/customer/group/edit', + 'label' => __('Edit'), + '__disableTmpl' => true, + ], + 'delete' => [ + 'href' => 'http://magento.com/customer/group/delete', + 'label' => __('Delete'), + 'post' => true, + '__disableTmpl' => true, + 'confirm' => [ + 'title' => __('Delete %1', 'General'), + 'message' => __( + 'Are you sure you want to delete a %1 record?', + 'General' + ) + ], + ] + ] + ] + ] + ] + ]; + } +} diff --git a/app/code/Magento/Customer/Ui/Component/Listing/Column/GroupActions.php b/app/code/Magento/Customer/Ui/Component/Listing/Column/GroupActions.php index 5d974088b0d54..5f575aacb2e10 100644 --- a/app/code/Magento/Customer/Ui/Component/Listing/Column/GroupActions.php +++ b/app/code/Magento/Customer/Ui/Component/Listing/Column/GroupActions.php @@ -8,6 +8,10 @@ namespace Magento\Customer\Ui\Component\Listing\Column; +use Magento\Customer\Api\GroupManagementInterface; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\UrlInterface; use Magento\Framework\View\Element\UiComponent\ContextInterface; use Magento\Framework\View\Element\UiComponentFactory; @@ -16,6 +20,8 @@ /** * Class GroupActions + * + * Customer Groups actions column */ class GroupActions extends Column { @@ -25,6 +31,11 @@ class GroupActions extends Column const URL_PATH_EDIT = 'customer/group/edit'; const URL_PATH_DELETE = 'customer/group/delete'; + /** + * @var GroupManagementInterface + */ + private $groupManagement; + /** * @var UrlInterface */ @@ -44,6 +55,7 @@ class GroupActions extends Column * @param Escaper $escaper * @param array $components * @param array $data + * @param GroupManagementInterface $groupManagement */ public function __construct( ContextInterface $context, @@ -51,10 +63,13 @@ public function __construct( UrlInterface $urlBuilder, Escaper $escaper, array $components = [], - array $data = [] + array $data = [], + GroupManagementInterface $groupManagement = null ) { $this->urlBuilder = $urlBuilder; $this->escaper = $escaper; + $this->groupManagement = $groupManagement ?: ObjectManager::getInstance()->get(GroupManagementInterface::class);; + parent::__construct($context, $uiComponentFactory, $components, $data); } @@ -63,6 +78,8 @@ public function __construct( * * @param array $dataSource * @return array + * @throws LocalizedException + * @throws NoSuchEntityException */ public function prepareDataSource(array $dataSource) { @@ -83,29 +100,26 @@ public function prepareDataSource(array $dataSource) ], ]; - // hide delete action for 'NOT LOGGED IN' group - if ($item['customer_group_id'] == 0 && $item['customer_group_code']) { - continue; + if (!$this->groupManagement->isReadonly($item['customer_group_id'])) { + $item[$this->getData('name')]['delete'] = [ + 'href' => $this->urlBuilder->getUrl( + static::URL_PATH_DELETE, + [ + 'id' => $item['customer_group_id'] + ] + ), + 'label' => __('Delete'), + 'confirm' => [ + 'title' => __('Delete %1', $this->escaper->escapeHtml($title)), + 'message' => __( + 'Are you sure you want to delete a %1 record?', + $this->escaper->escapeHtml($title) + ) + ], + 'post' => true, + '__disableTmpl' => true + ]; } - - $item[$this->getData('name')]['delete'] = [ - 'href' => $this->urlBuilder->getUrl( - static::URL_PATH_DELETE, - [ - 'id' => $item['customer_group_id'] - ] - ), - 'label' => __('Delete'), - 'confirm' => [ - 'title' => __('Delete %1', $this->escaper->escapeHtml($title)), - 'message' => __( - 'Are you sure you want to delete a %1 record?', - $this->escaper->escapeHtml($title) - ) - ], - 'post' => true, - '__disableTmpl' => true - ]; } } } From 3064b666219424399e3671a72639dc8b972e6990 Mon Sep 17 00:00:00 2001 From: DmitryTsymbal <d.tsymbal@atwix.com> Date: Fri, 3 Jan 2020 15:08:17 +0200 Subject: [PATCH 524/586] Create Integration Entity With Duplicated Name Test --- ...ntegrationEntityWithDuplicatedNameTest.xml | 58 +++++++++++++++++++ ...reateIntegrationWithDuplicatedNameTest.xml | 1 + 2 files changed, 59 insertions(+) create mode 100644 app/code/Magento/Integration/Test/Mftf/Test/AdminCreateIntegrationEntityWithDuplicatedNameTest.xml diff --git a/app/code/Magento/Integration/Test/Mftf/Test/AdminCreateIntegrationEntityWithDuplicatedNameTest.xml b/app/code/Magento/Integration/Test/Mftf/Test/AdminCreateIntegrationEntityWithDuplicatedNameTest.xml new file mode 100644 index 0000000000000..842500f7d7195 --- /dev/null +++ b/app/code/Magento/Integration/Test/Mftf/Test/AdminCreateIntegrationEntityWithDuplicatedNameTest.xml @@ -0,0 +1,58 @@ +<?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="AdminCreateIntegrationEntityWithDuplicatedNameTest"> + <annotations> + <features value="Integration"/> + <stories value="Creating System Integration With Duplicated Name"/> + <title value="Admin System Integration With Duplicated Name"/> + <description value="Admin Creates New Integration With Duplicated Name"/> + <group value="integration"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + </before> + <after> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!-- TEST BODY --> + <!-- Navigate To Integrations Page --> + <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToIntegrationsPage"> + <argument name="menuUiId" value="{{AdminMenuSystem.dataUiId}}"/> + <argument name="submenuUiId" value="{{AdminMenuSystemExtensionsIntegrations.dataUiId}}"/> + </actionGroup> + <!-- Click the "Add New Integration" button --> + <actionGroup ref="AdminNavigateToCreateIntegrationPageActionGroup" stepKey="clickAddNewIntegrationButton"/> + <!-- Create New Integration --> + <actionGroup ref="AdminCreatesNewIntegrationActionGroup" stepKey="createNewIntegration"> + <argument name="name" value="Integration1"/> + <argument name="password" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/> + </actionGroup> + <!-- Submit The Form --> + <actionGroup ref="AdminSubmitNewIntegrationFormActionGroup" stepKey="submitTheForm"/> + <!-- Click the "Add New Integration" button --> + <actionGroup ref="AdminNavigateToCreateIntegrationPageActionGroup" stepKey="clickAddNewIntegrationButtonSecondTime"/> + <!-- Create New Integration With Duplicated Name--> + <actionGroup ref="AdminCreatesNewIntegrationActionGroup" stepKey="createNewIntegrationWithDuplicatedName"> + <argument name="name" value="Integration1"/> + <argument name="password" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/> + </actionGroup> + <!-- Submit The Form --> + <actionGroup ref="AdminSubmitNewIntegrationFormActionGroup" stepKey="submitTheFormWithDuplicatedName"/> + <!-- See Error Message--> + <actionGroup ref="AssertAdminMessageCreateIntegrationEntityActionGroup" stepKey="seeErrorMessage"> + <argument name="message" value="The integration with name "Integration1" exists."/> + <argument value="error" name="messageType"/> + </actionGroup> + <!-- END TEST BODY --> + </test> +</tests> diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/CreateIntegrationWithDuplicatedNameTest.xml b/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/CreateIntegrationWithDuplicatedNameTest.xml index 0a3fff5b3e510..2cd14d9de05a1 100644 --- a/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/CreateIntegrationWithDuplicatedNameTest.xml +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/CreateIntegrationWithDuplicatedNameTest.xml @@ -8,6 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Integration\Test\TestCase\CreateIntegrationWithDuplicatedNameTest" summary="Create Integration with existing name" ticketId="MAGETWO-16756"> <variation name="CreateIntegrationWithDuplicatedNameTestVariation1"> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> <data name="integration/dataset" xsi:type="string">default</data> <constraint name="Magento\Integration\Test\Constraint\AssertIntegrationNameDuplicationErrorMessage" /> </variation> From 198f6e00afa8fa93f7e4927f9edccf43334f5569 Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Fri, 3 Jan 2020 15:09:43 +0200 Subject: [PATCH 525/586] Static tests --- .../Test/Unit/Ui/Component/Listing/Column/GroupActionsTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/Magento/Customer/Test/Unit/Ui/Component/Listing/Column/GroupActionsTest.php b/app/code/Magento/Customer/Test/Unit/Ui/Component/Listing/Column/GroupActionsTest.php index 51e652b15f53f..51cf0e5395b47 100644 --- a/app/code/Magento/Customer/Test/Unit/Ui/Component/Listing/Column/GroupActionsTest.php +++ b/app/code/Magento/Customer/Test/Unit/Ui/Component/Listing/Column/GroupActionsTest.php @@ -17,6 +17,8 @@ /** * Class GroupActionsTest + * + * Testing GroupAction grid column */ class GroupActionsTest extends TestCase { From dd541f0019d06ae79aab2d65278d464ac2c0c281 Mon Sep 17 00:00:00 2001 From: DmitryTsymbal <d.tsymbal@atwix.com> Date: Fri, 3 Jan 2020 15:20:33 +0200 Subject: [PATCH 526/586] Comments Deleting --- ...CreateIntegrationEntityWithDuplicatedNameTest.xml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/app/code/Magento/Integration/Test/Mftf/Test/AdminCreateIntegrationEntityWithDuplicatedNameTest.xml b/app/code/Magento/Integration/Test/Mftf/Test/AdminCreateIntegrationEntityWithDuplicatedNameTest.xml index 842500f7d7195..d1809cf909f9c 100644 --- a/app/code/Magento/Integration/Test/Mftf/Test/AdminCreateIntegrationEntityWithDuplicatedNameTest.xml +++ b/app/code/Magento/Integration/Test/Mftf/Test/AdminCreateIntegrationEntityWithDuplicatedNameTest.xml @@ -23,36 +23,26 @@ <after> <actionGroup ref="logout" stepKey="logout"/> </after> - - <!-- TEST BODY --> - <!-- Navigate To Integrations Page --> + <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToIntegrationsPage"> <argument name="menuUiId" value="{{AdminMenuSystem.dataUiId}}"/> <argument name="submenuUiId" value="{{AdminMenuSystemExtensionsIntegrations.dataUiId}}"/> </actionGroup> - <!-- Click the "Add New Integration" button --> <actionGroup ref="AdminNavigateToCreateIntegrationPageActionGroup" stepKey="clickAddNewIntegrationButton"/> - <!-- Create New Integration --> <actionGroup ref="AdminCreatesNewIntegrationActionGroup" stepKey="createNewIntegration"> <argument name="name" value="Integration1"/> <argument name="password" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/> </actionGroup> - <!-- Submit The Form --> <actionGroup ref="AdminSubmitNewIntegrationFormActionGroup" stepKey="submitTheForm"/> - <!-- Click the "Add New Integration" button --> <actionGroup ref="AdminNavigateToCreateIntegrationPageActionGroup" stepKey="clickAddNewIntegrationButtonSecondTime"/> - <!-- Create New Integration With Duplicated Name--> <actionGroup ref="AdminCreatesNewIntegrationActionGroup" stepKey="createNewIntegrationWithDuplicatedName"> <argument name="name" value="Integration1"/> <argument name="password" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/> </actionGroup> - <!-- Submit The Form --> <actionGroup ref="AdminSubmitNewIntegrationFormActionGroup" stepKey="submitTheFormWithDuplicatedName"/> - <!-- See Error Message--> <actionGroup ref="AssertAdminMessageCreateIntegrationEntityActionGroup" stepKey="seeErrorMessage"> <argument name="message" value="The integration with name "Integration1" exists."/> <argument value="error" name="messageType"/> </actionGroup> - <!-- END TEST BODY --> </test> </tests> From 86ff8fa07a878a10c5b188173a6a0b1d4ad00e72 Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Fri, 3 Jan 2020 15:39:29 +0200 Subject: [PATCH 527/586] Static tests --- .../Customer/Ui/Component/Listing/Column/GroupActions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Customer/Ui/Component/Listing/Column/GroupActions.php b/app/code/Magento/Customer/Ui/Component/Listing/Column/GroupActions.php index 5f575aacb2e10..e5a536dc6ecd6 100644 --- a/app/code/Magento/Customer/Ui/Component/Listing/Column/GroupActions.php +++ b/app/code/Magento/Customer/Ui/Component/Listing/Column/GroupActions.php @@ -68,7 +68,7 @@ public function __construct( ) { $this->urlBuilder = $urlBuilder; $this->escaper = $escaper; - $this->groupManagement = $groupManagement ?: ObjectManager::getInstance()->get(GroupManagementInterface::class);; + $this->groupManagement = $groupManagement ?: ObjectManager::getInstance()->get(GroupManagementInterface::class); parent::__construct($context, $uiComponentFactory, $components, $data); } From 837675cf7299be85b90f8640166c7b8001e2d835 Mon Sep 17 00:00:00 2001 From: Lena Orobei <oorobei@magento.com> Date: Fri, 3 Jan 2020 11:41:34 -0600 Subject: [PATCH 528/586] Forward-port magento/graphql-ce#443 and magento/graphql-ce#1073 --- .../{textual_swatch_attribute.php => text_swatch_attribute.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename dev/tests/integration/testsuite/Magento/Swatches/_files/{textual_swatch_attribute.php => text_swatch_attribute.php} (100%) diff --git a/dev/tests/integration/testsuite/Magento/Swatches/_files/textual_swatch_attribute.php b/dev/tests/integration/testsuite/Magento/Swatches/_files/text_swatch_attribute.php similarity index 100% rename from dev/tests/integration/testsuite/Magento/Swatches/_files/textual_swatch_attribute.php rename to dev/tests/integration/testsuite/Magento/Swatches/_files/text_swatch_attribute.php From 2819c7c65f9cb74785d891f9b354c91aaec343fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Sat, 4 Jan 2020 17:07:23 +0100 Subject: [PATCH 529/586] Fix invalid Schema location --- .../Test/Mftf/Section/CaptchaFormsDisplayingSection.xml | 2 +- .../Magento/Catalog/Test/Mftf/Metadata/image_content-meta.xml | 2 +- .../ActionGroup/FilterOrderStatusByLabelAndCodeActionGroup.xml | 2 +- .../Test/Mftf/ActionGroup/SelectActionForOrdersActionGroup.xml | 2 +- .../Sales/Test/Mftf/Page/StorefrontCustomerSignOutPage.xml | 2 +- .../Sales/Test/Mftf/Page/StorefrontSalesOrderPrintPage.xml | 2 +- .../Magento/Sales/Test/Mftf/Section/SalesOrderPrintSection.xml | 2 +- .../Magento/Store/Test/Mftf/Data/StorePaymentMethodsData.xml | 3 ++- .../Magento/Store/Test/Mftf/Data/StoreShippingMethodsData.xml | 3 ++- .../Store/Test/Mftf/Metadata/store_payment_methods-meta.xml | 2 +- .../Store/Test/Mftf/Metadata/store_shipping_methods-meta.xml | 2 +- .../Magento/Tax/Test/Mftf/Section/AdminTaxReportsSection.xml | 2 +- 12 files changed, 14 insertions(+), 12 deletions(-) diff --git a/app/code/Magento/Captcha/Test/Mftf/Section/CaptchaFormsDisplayingSection.xml b/app/code/Magento/Captcha/Test/Mftf/Section/CaptchaFormsDisplayingSection.xml index 4c974e6fced05..9103c4191544c 100644 --- a/app/code/Magento/Captcha/Test/Mftf/Section/CaptchaFormsDisplayingSection.xml +++ b/app/code/Magento/Captcha/Test/Mftf/Section/CaptchaFormsDisplayingSection.xml @@ -7,7 +7,7 @@ --> <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="CaptchaFormsDisplayingSection"> <element name="store" type="button" selector="#menu-magento-backend-stores"/> <element name="config" type="button" selector="//li[@data-ui-id='menu-magento-config-system-config']//span"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Metadata/image_content-meta.xml b/app/code/Magento/Catalog/Test/Mftf/Metadata/image_content-meta.xml index 8b12a2fbbbc5d..ac75a819548ae 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Metadata/image_content-meta.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Metadata/image_content-meta.xml @@ -7,7 +7,7 @@ --> <operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataOperation.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd"> <operation name="CreateImageContent" dataType="ImageContent" type="create"> <field key="base64_encoded_data" required="true">string</field> <field key="type" required="true">string</field> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderStatusByLabelAndCodeActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderStatusByLabelAndCodeActionGroup.xml index 96e562cb95c6f..06ff1597dc608 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderStatusByLabelAndCodeActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderStatusByLabelAndCodeActionGroup.xml @@ -7,7 +7,7 @@ --> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="FilterOrderStatusByLabelAndCodeActionGroup"> <arguments> <argument name="statusLabel" type="string"/> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/SelectActionForOrdersActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SelectActionForOrdersActionGroup.xml index 073eb03b11bfa..4351c44ed75aa 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/SelectActionForOrdersActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SelectActionForOrdersActionGroup.xml @@ -7,7 +7,7 @@ --> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="SelectActionForOrdersActionGroup"> <arguments> <argument name="action" type="string"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Page/StorefrontCustomerSignOutPage.xml b/app/code/Magento/Sales/Test/Mftf/Page/StorefrontCustomerSignOutPage.xml index 4e89e5476c3bc..0cfc9f2231f85 100644 --- a/app/code/Magento/Sales/Test/Mftf/Page/StorefrontCustomerSignOutPage.xml +++ b/app/code/Magento/Sales/Test/Mftf/Page/StorefrontCustomerSignOutPage.xml @@ -7,6 +7,6 @@ --> <pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> <page name="StorefrontCustomerSignOutPage" url="/customer/account/logout/" area="storefront" module="Magento_Customer"/> </pages> diff --git a/app/code/Magento/Sales/Test/Mftf/Page/StorefrontSalesOrderPrintPage.xml b/app/code/Magento/Sales/Test/Mftf/Page/StorefrontSalesOrderPrintPage.xml index 874e6889ec58c..437449aa887d2 100644 --- a/app/code/Magento/Sales/Test/Mftf/Page/StorefrontSalesOrderPrintPage.xml +++ b/app/code/Magento/Sales/Test/Mftf/Page/StorefrontSalesOrderPrintPage.xml @@ -7,7 +7,7 @@ --> <pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> <page name="StorefrontSalesOrderPrintPage" url="/sales/order/print/order_id/{{var1}}/" parameterized="true" area="storefront" module="Magento_Sales"> <section name="SalesOrderPrintSection"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/SalesOrderPrintSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/SalesOrderPrintSection.xml index b08a66140fabf..7c1d7319e30ea 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/SalesOrderPrintSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/SalesOrderPrintSection.xml @@ -7,7 +7,7 @@ --> <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="SalesOrderPrintSection"> <element name="isOrderPrintPage" type="block" selector=".preview-area"/> </section> diff --git a/app/code/Magento/Store/Test/Mftf/Data/StorePaymentMethodsData.xml b/app/code/Magento/Store/Test/Mftf/Data/StorePaymentMethodsData.xml index 912399142fa61..27a6150b95798 100644 --- a/app/code/Magento/Store/Test/Mftf/Data/StorePaymentMethodsData.xml +++ b/app/code/Magento/Store/Test/Mftf/Data/StorePaymentMethodsData.xml @@ -5,7 +5,8 @@ * See COPYING.txt for license details. */ --> -<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd"> +<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> <entity name="PaymentMethodsSettingConfig" type="zero_subtotal_checkout_config_state"> <requiredEntity type="active">active</requiredEntity> <requiredEntity type="order_status">orderStatus</requiredEntity> diff --git a/app/code/Magento/Store/Test/Mftf/Data/StoreShippingMethodsData.xml b/app/code/Magento/Store/Test/Mftf/Data/StoreShippingMethodsData.xml index 11b8931618f70..3b749928308bd 100644 --- a/app/code/Magento/Store/Test/Mftf/Data/StoreShippingMethodsData.xml +++ b/app/code/Magento/Store/Test/Mftf/Data/StoreShippingMethodsData.xml @@ -5,7 +5,8 @@ * See COPYING.txt for license details. */ --> -<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd"> +<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> <entity name="FreeShippingMethodsSettingConfig" type="free_shipping_config_state"> <requiredEntity type="active">active</requiredEntity> </entity> diff --git a/app/code/Magento/Store/Test/Mftf/Metadata/store_payment_methods-meta.xml b/app/code/Magento/Store/Test/Mftf/Metadata/store_payment_methods-meta.xml index cbad7265cbbd6..1995dceb3bf0b 100644 --- a/app/code/Magento/Store/Test/Mftf/Metadata/store_payment_methods-meta.xml +++ b/app/code/Magento/Store/Test/Mftf/Metadata/store_payment_methods-meta.xml @@ -7,7 +7,7 @@ --> <operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataOperation.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd"> <operation name="EnableZeroSubtotalCheckoutConfigState" dataType="zero_subtotal_checkout_config_state" type="create" auth="adminFormKey" url="/admin/system_config/save/section/payment/" method="POST"> <object key="groups" dataType="zero_subtotal_checkout_config_state"> <object key="free" dataType="zero_subtotal_checkout_config_state"> diff --git a/app/code/Magento/Store/Test/Mftf/Metadata/store_shipping_methods-meta.xml b/app/code/Magento/Store/Test/Mftf/Metadata/store_shipping_methods-meta.xml index 6f88bca760204..091d0ae673f7a 100644 --- a/app/code/Magento/Store/Test/Mftf/Metadata/store_shipping_methods-meta.xml +++ b/app/code/Magento/Store/Test/Mftf/Metadata/store_shipping_methods-meta.xml @@ -7,7 +7,7 @@ --> <operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataOperation.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd"> <operation name="EnableFreeShippingConfigState" dataType="free_shipping_config_state" type="create" auth="adminFormKey" url="/admin/system_config/save/section/carriers/" method="POST"> <object key="groups" dataType="free_shipping_config_state"> <object key="freeshipping" dataType="free_shipping_config_state"> diff --git a/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxReportsSection.xml b/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxReportsSection.xml index 80101687e173e..71bc4cbceff83 100644 --- a/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxReportsSection.xml +++ b/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxReportsSection.xml @@ -7,7 +7,7 @@ --> <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminTaxReportsSection"> <element name="refreshStatistics" type="button" selector="//a[contains(text(),'here')]"/> <element name="fromDate" type="input" selector="#sales_report_from"/> From f076e553211d4e6a4a9ffdd48b0521ab0ee3bf38 Mon Sep 17 00:00:00 2001 From: lfolco <me@laurafolco.com> Date: Sat, 4 Jan 2020 14:57:30 -0500 Subject: [PATCH 530/586] Update SOAP tests to test changed functionality (#19093) --- .../Api/OrderGetRepositoryTest.php | 6 ++---- .../Api/OrderItemGetRepositoryTest.php | 20 ++++--------------- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/dev/tests/api-functional/testsuite/Magento/GiftMessage/Api/OrderGetRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/GiftMessage/Api/OrderGetRepositoryTest.php index 7ae7e200cfb5b..91d1954581da7 100644 --- a/dev/tests/api-functional/testsuite/Magento/GiftMessage/Api/OrderGetRepositoryTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GiftMessage/Api/OrderGetRepositoryTest.php @@ -12,9 +12,7 @@ class OrderGetRepositoryTest extends WebapiAbstract { const SERVICE_VERSION = 'V1'; - - const SERVICE_NAME = 'giftMessageItemRepositoryV1'; - + const SERVICE_NAME = 'salesOrderRepositoryV1'; const RESOURCE_PATH = '/V1/orders/'; /** @@ -45,7 +43,7 @@ public function testGet() 'sender' => 'Romeo', 'message' => 'I thought all for the best.', ]; - $requestData = ["orderId" => $orderId]; + $requestData = ['id' => $orderId]; $result = $this->_webApiCall($serviceInfo, $requestData); $resultMessage = $result['extension_attributes']['gift_message']; static::assertCount(5, $resultMessage); diff --git a/dev/tests/api-functional/testsuite/Magento/GiftMessage/Api/OrderItemGetRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/GiftMessage/Api/OrderItemGetRepositoryTest.php index f68b50b7746eb..074133835f6da 100644 --- a/dev/tests/api-functional/testsuite/Magento/GiftMessage/Api/OrderItemGetRepositoryTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GiftMessage/Api/OrderItemGetRepositoryTest.php @@ -11,23 +11,10 @@ class OrderItemGetRepositoryTest extends WebapiAbstract { - const SERVICE_VERSION = 'V1'; - - const SERVICE_NAME = 'giftMessageItemRepositoryV1'; - + const SERVICE_NAME = 'salesOrderItemRepositoryV1'; const RESOURCE_PATH = '/V1/orders/items/'; - /** - * @var \Magento\TestFramework\ObjectManager - */ - protected $objectManager; - - protected function setUp() - { - $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - } - /** * @magentoDataFixture Magento/GiftMessage/_files/order_with_message.php * @magentoConfigFixture default_store sales/gift_options/allow_items 1 @@ -36,8 +23,9 @@ protected function setUp() */ public function testGet() { + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); /** @var \Magento\Sales\Model\Order $order */ - $order = $this->objectManager->create(\Magento\Sales\Model\Order::class)->loadByIncrementId('100000001'); + $order = $objectManager->create(\Magento\Sales\Model\Order::class)->loadByIncrementId('100000001'); $items = $order->getItems(); /** @var \Magento\Sales\Api\Data\OrderItemInterface $orderItem */ $orderItem = array_shift($items); @@ -58,7 +46,7 @@ public function testGet() 'sender' => 'Romeo', 'message' => 'I thought all for the best.', ]; - $requestData = ["orderItemId" => $itemId]; + $requestData = ['id' => $itemId]; $result = $this->_webApiCall($serviceInfo, $requestData); $resultMessage = $result['extension_attributes']['gift_message']; static::assertCount(5, $resultMessage); From fe984387fc73f559599f27798642e5c22b55ae62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Szubert?= <bartlomiejszubert@gmail.com> Date: Sat, 4 Jan 2020 22:38:32 +0100 Subject: [PATCH 531/586] Fix #14913 - bookmark views become uneditable after deleting the first bookmark view --- .../grid/controls/bookmarks/bookmarks.html | 6 ++--- .../grid/controls/bookmarks/view.html | 22 +++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/controls/bookmarks/bookmarks.html b/app/code/Magento/Ui/view/base/web/templates/grid/controls/bookmarks/bookmarks.html index 36a3232c3e61a..6d50ed7e5bd03 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/controls/bookmarks/bookmarks.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/controls/bookmarks/bookmarks.html @@ -9,9 +9,9 @@ <span class="admin__action-dropdown-text" translate="activeView.label"/> </button> <ul class="admin__action-dropdown-menu"> - <repeat args="foreach: viewsArray, item: '$view'"> - <li css="_edit: isEditing($view().index)" outerClick="endEdit.bind($data, $view().index)" template="viewTmpl"/> - </repeat> + <!-- ko foreach: { data: viewsArray, as: '$view'} --> + <li css="_edit: $parent.isEditing($view.index)" outerClick="$parent.endEdit.bind($parent, $view.index)" template="$parent.viewTmpl"/> + <!-- /ko --> <li visible="hasChanges" outerClick="hideCustom.bind($data)" css=" _edit: customVisible, diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/controls/bookmarks/view.html b/app/code/Magento/Ui/view/base/web/templates/grid/controls/bookmarks/view.html index 521ce9fc806ac..1262fce544599 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/controls/bookmarks/view.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/controls/bookmarks/view.html @@ -4,36 +4,36 @@ * See COPYING.txt for license details. */ --> -<div class="action-dropdown-menu-item-edit" if="$view().editable"> +<div class="action-dropdown-menu-item-edit" if="$view.editable"> <input class="admin__control-text" data-bind=" - value: $view().value, - hasFocus: isEditing($view().index), + value: $view.value, + hasFocus: $parent.isEditing($view.index), autoselect, attr: { - placeholder: $view().label + placeholder: $view.label }, keyboard: { - 13: updateAndSave.bind($data, $view().index), - 27: endEdit.bind($data, $view().index) + 13: $parent.updateAndSave.bind($parent, $view.index), + 27: $parent.endEdit.bind($parent, $view.index) }" type="text"> - <button class="action-submit" type="button" attr="title: $t('Save all changes')" click="updateAndSave.bind($data, $view().index)"> + <button class="action-submit" type="button" attr="title: $t('Save all changes')" click="$parent.updateAndSave.bind($parent, $view.index)"> <span translate="'Submit'"/> </button> <div class="action-dropdown-menu-item-actions"> - <button class="action-delete" type="button" attr="title: $t('Delete bookmark')" click="removeView.bind($data, $view().index)"> + <button class="action-delete" type="button" attr="title: $t('Delete bookmark')" click="$parent.removeView.bind($parent, $view.index)"> <span translate="'Delete'"/> </button> </div> </div> <div class="action-dropdown-menu-item"> - <a href="" class="action-dropdown-menu-link" translate="$view().label" click="applyView.bind($data, $view().index)" closeCollapsible/> + <a href="" class="action-dropdown-menu-link" translate="$view.label" click="$parent.applyView.bind($parent, $view.index)" closeCollapsible/> - <div class="action-dropdown-menu-item-actions" if="$view().editable"> - <button class="action-edit" type="button" attr="title: $t('Edit bookmark')" click="editView.bind($data, $view().index)"> + <div class="action-dropdown-menu-item-actions" if="$view.editable"> + <button class="action-edit" type="button" attr="title: $t('Edit bookmark')" click="$parent.editView.bind($parent, $view.index)"> <span translate="'Edit'"/> </button> </div> From b015b65baa6d54dbffd85f11e37d62ca1a28d5da Mon Sep 17 00:00:00 2001 From: aleromano89 <alx.romano89@gmail.com> Date: Sat, 4 Jan 2020 23:20:19 +0100 Subject: [PATCH 532/586] fix issue #23521 --- .../Downloadable/Test/Unit/Helper/DownloadTest.php | 6 +++++- .../Downloadable/Test/Unit/_files/download_mock.php | 10 ++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Downloadable/Test/Unit/Helper/DownloadTest.php b/app/code/Magento/Downloadable/Test/Unit/Helper/DownloadTest.php index 9551cfe982bd5..d4ebf0a7e3fb9 100644 --- a/app/code/Magento/Downloadable/Test/Unit/Helper/DownloadTest.php +++ b/app/code/Magento/Downloadable/Test/Unit/Helper/DownloadTest.php @@ -17,7 +17,10 @@ */ class DownloadTest extends \PHPUnit\Framework\TestCase { - /** @var DownloadHelper */ + /** @var array Result of get_headers() function */ + public static $headers; + + /** @var DownloadHelper */ protected $_helper; /** @var Filesystem|\PHPUnit_Framework_MockObject_MockObject */ @@ -230,6 +233,7 @@ protected function _setupUrlMocks($size = self::FILE_SIZE, $url = self::URL, $ad $this->returnValue($this->_handleMock) ); + self::$headers = ['200 OK']; $this->_helper->setResource($url, DownloadHelper::LINK_TYPE_URL); } diff --git a/app/code/Magento/Downloadable/Test/Unit/_files/download_mock.php b/app/code/Magento/Downloadable/Test/Unit/_files/download_mock.php index e634f0ffa341d..bb3c4715a48e4 100644 --- a/app/code/Magento/Downloadable/Test/Unit/_files/download_mock.php +++ b/app/code/Magento/Downloadable/Test/Unit/_files/download_mock.php @@ -22,3 +22,13 @@ function mime_content_type() { return DownloadTest::$mimeContentType; } + +/** + * Override standard function + * + * @return array + */ +function get_headers() +{ + return DownloadTest::$headers; +} From 5fe745450451d43764281da227bf70e2aaec5735 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Szubert?= <bartlomiejszubert@gmail.com> Date: Sun, 5 Jan 2020 11:28:05 +0100 Subject: [PATCH 533/586] Fix #14001 - M2.2.3 directory_country_region_name locale fix? 8bytes zh_Hans_CN(11bytes) ca_ES_VALENCIA(14bytes) --- app/code/Magento/Directory/etc/db_schema.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Directory/etc/db_schema.xml b/app/code/Magento/Directory/etc/db_schema.xml index 163e972423b98..a9fb2c536a3fd 100644 --- a/app/code/Magento/Directory/etc/db_schema.xml +++ b/app/code/Magento/Directory/etc/db_schema.xml @@ -45,7 +45,7 @@ </table> <table name="directory_country_region_name" resource="default" engine="innodb" comment="Directory Country Region Name"> - <column xsi:type="varchar" name="locale" nullable="false" length="8" comment="Locale"/> + <column xsi:type="varchar" name="locale" nullable="false" length="16" comment="Locale"/> <column xsi:type="int" name="region_id" padding="10" unsigned="true" nullable="false" identity="false" default="0" comment="Region ID"/> <column xsi:type="varchar" name="name" nullable="true" length="255" comment="Region Name"/> From bb16e33f41d14fac93ae93e56b051f485e0d53d2 Mon Sep 17 00:00:00 2001 From: Marco Oliveira <marcoaacoliveira@gmail.com> Date: Sun, 5 Jan 2020 11:54:14 -0300 Subject: [PATCH 534/586] Solving #22964 It was needed to change the appendTimeIfNeeded, because isn't right to transform DateTime without hour into with hour just appending a string in the end of other string. --- .../Framework/Stdlib/DateTime/Timezone.php | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/lib/internal/Magento/Framework/Stdlib/DateTime/Timezone.php b/lib/internal/Magento/Framework/Stdlib/DateTime/Timezone.php index 118a3e053bd79..2e4ef10a76141 100644 --- a/lib/internal/Magento/Framework/Stdlib/DateTime/Timezone.php +++ b/lib/internal/Magento/Framework/Stdlib/DateTime/Timezone.php @@ -182,7 +182,7 @@ public function date($date = null, $locale = null, $useTimezone = true, $include new \DateTimeZone($timezone) ); - $date = $this->appendTimeIfNeeded($date, $includeTime); + $date = $this->appendTimeIfNeeded($date, $includeTime, $timezone, $locale); $date = $formatter->parse($date) ?: (new \DateTime($date))->getTimestamp(); break; } @@ -347,16 +347,31 @@ public function convertConfigTimeToUtc($date, $format = 'Y-m-d H:i:s') } /** - * Retrieve date with time - * * @param string $date - * @param bool $includeTime + * @param boolean $includeTime + * @param string $timezone + * @param string $locale * @return string */ - private function appendTimeIfNeeded($date, $includeTime) + private function appendTimeIfNeeded($date, $includeTime, $timezone, $locale) { if ($includeTime && !preg_match('/\d{1}:\d{2}/', $date)) { - $date .= " 0:00am"; + + $formatterWithoutHour = new \IntlDateFormatter( + $locale, + \IntlDateFormatter::SHORT, + \IntlDateFormatter::NONE, + new \DateTimeZone($timezone) + ); + $convertedDate = $formatterWithoutHour->parse($date); + $formatterWithHour = new \IntlDateFormatter( + $locale, + \IntlDateFormatter::SHORT, + \IntlDateFormatter::SHORT, + new \DateTimeZone($timezone) + ); + + $date = $formatterWithHour->format($convertedDate); } return $date; } From 05ecfda9c34698c670ff8fc302632e52fe82f9de Mon Sep 17 00:00:00 2001 From: aleromano89 <alx.romano89@gmail.com> Date: Sun, 5 Jan 2020 16:57:41 +0100 Subject: [PATCH 535/586] fix indentation --- .../Downloadable/Test/Unit/Helper/DownloadTest.php | 8 ++++---- .../Downloadable/Test/Unit/_files/download_mock.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Downloadable/Test/Unit/Helper/DownloadTest.php b/app/code/Magento/Downloadable/Test/Unit/Helper/DownloadTest.php index d4ebf0a7e3fb9..f90c3f27b27c7 100644 --- a/app/code/Magento/Downloadable/Test/Unit/Helper/DownloadTest.php +++ b/app/code/Magento/Downloadable/Test/Unit/Helper/DownloadTest.php @@ -17,10 +17,10 @@ */ class DownloadTest extends \PHPUnit\Framework\TestCase { - /** @var array Result of get_headers() function */ - public static $headers; + /** @var array Result of get_headers() function */ + public static $headers; - /** @var DownloadHelper */ + /** @var DownloadHelper */ protected $_helper; /** @var Filesystem|\PHPUnit_Framework_MockObject_MockObject */ @@ -233,7 +233,7 @@ protected function _setupUrlMocks($size = self::FILE_SIZE, $url = self::URL, $ad $this->returnValue($this->_handleMock) ); - self::$headers = ['200 OK']; + self::$headers = ['200 OK']; $this->_helper->setResource($url, DownloadHelper::LINK_TYPE_URL); } diff --git a/app/code/Magento/Downloadable/Test/Unit/_files/download_mock.php b/app/code/Magento/Downloadable/Test/Unit/_files/download_mock.php index bb3c4715a48e4..7ab3bc939f4d0 100644 --- a/app/code/Magento/Downloadable/Test/Unit/_files/download_mock.php +++ b/app/code/Magento/Downloadable/Test/Unit/_files/download_mock.php @@ -30,5 +30,5 @@ function mime_content_type() */ function get_headers() { - return DownloadTest::$headers; + return DownloadTest::$headers; } From d12ac2178592c7a999e14e04b98b6f319357a725 Mon Sep 17 00:00:00 2001 From: Marco Oliveira <marcoaacoliveira@gmail.com> Date: Sun, 5 Jan 2020 13:31:28 -0300 Subject: [PATCH 536/586] Fixing code style and creating new cases tests. --- .../Magento/Framework/Stdlib/DateTime/Timezone.php | 2 ++ .../Stdlib/Test/Unit/DateTime/TimezoneTest.php | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/lib/internal/Magento/Framework/Stdlib/DateTime/Timezone.php b/lib/internal/Magento/Framework/Stdlib/DateTime/Timezone.php index 2e4ef10a76141..70435df54aa68 100644 --- a/lib/internal/Magento/Framework/Stdlib/DateTime/Timezone.php +++ b/lib/internal/Magento/Framework/Stdlib/DateTime/Timezone.php @@ -347,6 +347,8 @@ public function convertConfigTimeToUtc($date, $format = 'Y-m-d H:i:s') } /** + * Append time to DateTime + * * @param string $date * @param boolean $includeTime * @param string $timezone diff --git a/lib/internal/Magento/Framework/Stdlib/Test/Unit/DateTime/TimezoneTest.php b/lib/internal/Magento/Framework/Stdlib/Test/Unit/DateTime/TimezoneTest.php index 53980e574c267..fef6bbbbddb54 100644 --- a/lib/internal/Magento/Framework/Stdlib/Test/Unit/DateTime/TimezoneTest.php +++ b/lib/internal/Magento/Framework/Stdlib/Test/Unit/DateTime/TimezoneTest.php @@ -128,6 +128,18 @@ public function dateIncludeTimeDataProvider(): array true, // include time 1495170060 // expected timestamp ], + 'Parse greek d/m/y date without time' => [ + '30/10/2021', // datetime + 'el_GR', // locale + false, // include time + 1635552000 // expected timestamp + ], + 'Parse greek d/m/y date with time' => [ + '30/10/21, 12:00 π.μ.', // datetime + 'el_GR', // locale + true, // include time + 1635552000 // expected timestamp + ], ]; } From 32be47258b96b18f8f589635ff4bd22a6aeabe32 Mon Sep 17 00:00:00 2001 From: Marco Oliveira <marcoaacoliveira@gmail.com> Date: Sun, 5 Jan 2020 14:50:32 -0300 Subject: [PATCH 537/586] Changing timestamp to correspond to Chicago TimeZone --- .../Framework/Stdlib/Test/Unit/DateTime/TimezoneTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/internal/Magento/Framework/Stdlib/Test/Unit/DateTime/TimezoneTest.php b/lib/internal/Magento/Framework/Stdlib/Test/Unit/DateTime/TimezoneTest.php index fef6bbbbddb54..1de5fc8967bd7 100644 --- a/lib/internal/Magento/Framework/Stdlib/Test/Unit/DateTime/TimezoneTest.php +++ b/lib/internal/Magento/Framework/Stdlib/Test/Unit/DateTime/TimezoneTest.php @@ -132,13 +132,13 @@ public function dateIncludeTimeDataProvider(): array '30/10/2021', // datetime 'el_GR', // locale false, // include time - 1635552000 // expected timestamp + 1635570000 // expected timestamp ], 'Parse greek d/m/y date with time' => [ - '30/10/21, 12:00 π.μ.', // datetime + '30/10/2021, 12:00 π.μ.', // datetime 'el_GR', // locale true, // include time - 1635552000 // expected timestamp + 1635570000 // expected timestamp ], ]; } From 6a19b1297a7f740ecb4cedcd4afbd6a42e70904a Mon Sep 17 00:00:00 2001 From: Marco Oliveira <marcoaacoliveira@gmail.com> Date: Sun, 5 Jan 2020 15:02:59 -0300 Subject: [PATCH 538/586] Making test similar to others. --- .../Framework/Stdlib/Test/Unit/DateTime/TimezoneTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/Stdlib/Test/Unit/DateTime/TimezoneTest.php b/lib/internal/Magento/Framework/Stdlib/Test/Unit/DateTime/TimezoneTest.php index 1de5fc8967bd7..566992c70b5e3 100644 --- a/lib/internal/Magento/Framework/Stdlib/Test/Unit/DateTime/TimezoneTest.php +++ b/lib/internal/Magento/Framework/Stdlib/Test/Unit/DateTime/TimezoneTest.php @@ -135,10 +135,10 @@ public function dateIncludeTimeDataProvider(): array 1635570000 // expected timestamp ], 'Parse greek d/m/y date with time' => [ - '30/10/2021, 12:00 π.μ.', // datetime + '30/10/2021, 12:01 π.μ.', // datetime 'el_GR', // locale true, // include time - 1635570000 // expected timestamp + 1635570060 // expected timestamp ], ]; } From 6e80158edd564a14d2643798584d3f9331b4fff9 Mon Sep 17 00:00:00 2001 From: Marco Oliveira <marcoaacoliveira@gmail.com> Date: Sun, 5 Jan 2020 16:59:24 -0300 Subject: [PATCH 539/586] Standardizing thrown exceptions --- .../Magento/Framework/Stdlib/DateTime/Timezone.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/internal/Magento/Framework/Stdlib/DateTime/Timezone.php b/lib/internal/Magento/Framework/Stdlib/DateTime/Timezone.php index 70435df54aa68..533c4cc513e72 100644 --- a/lib/internal/Magento/Framework/Stdlib/DateTime/Timezone.php +++ b/lib/internal/Magento/Framework/Stdlib/DateTime/Timezone.php @@ -354,6 +354,7 @@ public function convertConfigTimeToUtc($date, $format = 'Y-m-d H:i:s') * @param string $timezone * @param string $locale * @return string + * @throws LocalizedException */ private function appendTimeIfNeeded($date, $includeTime, $timezone, $locale) { @@ -366,6 +367,16 @@ private function appendTimeIfNeeded($date, $includeTime, $timezone, $locale) new \DateTimeZone($timezone) ); $convertedDate = $formatterWithoutHour->parse($date); + + if (!$convertedDate) { + throw new LocalizedException( + new Phrase( + 'Could not append time to DateTime' + ) + ); + + } + $formatterWithHour = new \IntlDateFormatter( $locale, \IntlDateFormatter::SHORT, From 8ee89af88ec90b3992fb26b305ec63d39c0f4b2e Mon Sep 17 00:00:00 2001 From: Marco Oliveira <marcoaacoliveira@gmail.com> Date: Sun, 5 Jan 2020 20:28:55 -0300 Subject: [PATCH 540/586] Using MEDIUM size for dates in format so it doesn't lose anymore reference in 2099. --- lib/internal/Magento/Framework/Stdlib/DateTime/Timezone.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/Stdlib/DateTime/Timezone.php b/lib/internal/Magento/Framework/Stdlib/DateTime/Timezone.php index 533c4cc513e72..e9873b39a6090 100644 --- a/lib/internal/Magento/Framework/Stdlib/DateTime/Timezone.php +++ b/lib/internal/Magento/Framework/Stdlib/DateTime/Timezone.php @@ -362,7 +362,7 @@ private function appendTimeIfNeeded($date, $includeTime, $timezone, $locale) $formatterWithoutHour = new \IntlDateFormatter( $locale, - \IntlDateFormatter::SHORT, + \IntlDateFormatter::MEDIUM, \IntlDateFormatter::NONE, new \DateTimeZone($timezone) ); @@ -379,7 +379,7 @@ private function appendTimeIfNeeded($date, $includeTime, $timezone, $locale) $formatterWithHour = new \IntlDateFormatter( $locale, - \IntlDateFormatter::SHORT, + \IntlDateFormatter::MEDIUM, \IntlDateFormatter::SHORT, new \DateTimeZone($timezone) ); From acf41666b7f4493b63469f4d436d7565dd1b9023 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Mon, 6 Jan 2020 06:15:32 +0100 Subject: [PATCH 541/586] Replace incorrect use of <amOnPage> with <actionGroup> for Admin log out --- .../Mftf/ActionGroup/AdminLogoutActionGroup.xml | 14 ++++++++++++++ .../Mftf/Test/PriceRuleCategoryNestingTest.xml | 2 +- ...omerWishListShareOptionsInputValidationTest.xml | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminLogoutActionGroup.xml diff --git a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminLogoutActionGroup.xml b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminLogoutActionGroup.xml new file mode 100644 index 0000000000000..de0def48a1f52 --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminLogoutActionGroup.xml @@ -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="AdminLogoutActionGroup"> + <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/PriceRuleCategoryNestingTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/PriceRuleCategoryNestingTest.xml index 091e09e32f1e6..f99b19f4a6289 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/PriceRuleCategoryNestingTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/PriceRuleCategoryNestingTest.xml @@ -32,7 +32,7 @@ </before> <after> <deleteData createDataKey="subcategory1" stepKey="deleteCategory1"/> - <amOnPage url="{{_ENV.MAGENTO_BACKEND_NAME}}/admin/auth/logout/" stepKey="amOnLogoutPage"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> <!-- Login as admin and open page for creation new Price Rule --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/AdminCustomerWishListShareOptionsInputValidationTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/AdminCustomerWishListShareOptionsInputValidationTest.xml index da51bdf917e37..32c16ff7f5a55 100755 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/AdminCustomerWishListShareOptionsInputValidationTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/AdminCustomerWishListShareOptionsInputValidationTest.xml @@ -26,7 +26,7 @@ <argument name="emailTextLengthLimit" value="{{Wishlist.default_email_text_length_limit}}"/> </actionGroup> <checkOption selector="{{WishListShareOptionsSection.useSystemValueForWishListEmailTextLimit}}" stepKey="checkUseSystemValueForWishListEmailTextLimit"/> - <amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> <actionGroup ref="setEmailTextLengthLimitActionGroup" stepKey="setEmailTextLengthLimitToMin"> From bb39dd03c63515edda774146794e573cad351900 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Mon, 6 Jan 2020 06:34:10 +0100 Subject: [PATCH 542/586] Replace incorrect URLs in Tests and ActionGroups --- .../Test/Mftf/Test/StorefrontAdminEditDataTest.xml | 4 ++-- .../Mftf/Test/StorefrontEditBundleProductTest.xml | 4 ++-- .../Mftf/Test/AdminApplyTierPriceToProductTest.xml | 4 ++-- .../Test/AdminCheckPaginationInStorefrontTest.xml | 2 +- ...urableProductWithAssignedSimpleProductsTest.xml | 2 +- ...ogRuleForConfigurableProductWithOptionsTest.xml | 2 +- .../Mftf/Test/CheckCheckoutSuccessPageTest.xml | 2 +- .../ConfigAdminAccountSharingActionGroup.xml | 2 +- ...ProductWithTwoOptionsAssignedToCategoryTest.xml | 2 +- ...WithTwoOptionsWithoutAssignedToCategoryTest.xml | 2 +- .../SignUpNewUserFromStorefrontActionGroup.xml | 14 +++++++------- .../UpdateIndexerByScheduleActionGroup.xml | 2 +- .../ActionGroup/UpdateIndexerOnSaveActionGroup.xml | 2 +- .../VerifySubscribedNewsletterDisplayedTest.xml | 2 +- .../Mftf/ActionGroup/ClearCacheActionGroup.xml | 2 +- .../Mftf/ActionGroup/ClearPageCacheActionGroup.xml | 2 +- 16 files changed, 25 insertions(+), 25 deletions(-) diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAdminEditDataTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAdminEditDataTest.xml index 75e1fa5d7cd4d..05100284a3fe9 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAdminEditDataTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAdminEditDataTest.xml @@ -79,7 +79,7 @@ <waitForPageLoad stepKey="waitForElementAdded"/> <!-- Go to the shopping cart page and grab the value of the option title --> - <amOnPage url="/checkout/cart/" stepKey="onPageShoppingCart"/> + <amOnPage url="{{CheckoutCartPage.url}}" stepKey="onPageShoppingCart"/> <waitForPageLoad stepKey="waitForCartPageLoad"/> <grabTextFrom selector="{{CheckoutCartProductSection.nthBundleOptionName('1')}}" stepKey="grabTotalBefore"/> @@ -100,7 +100,7 @@ <see stepKey="assertSuccess2" selector="{{AdminProductMessagesSection.successMessage}}" userInput="You saved the product."/> <!-- Go to the shopping cart page and make sure the title has changed --> - <amOnPage url="/checkout/cart/" stepKey="onPageShoppingCart1"/> + <amOnPage url="{{CheckoutCartPage.url}}" stepKey="onPageShoppingCart1"/> <waitForPageLoad stepKey="waitForCartPageLoad1"/> <grabTextFrom selector="{{CheckoutCartProductSection.nthBundleOptionName('1')}}" stepKey="grabTotalAfter"/> <assertNotEquals expected="{$grabTotalBefore}" expectedType="string" actual="{$grabTotalAfter}" actualType="string" stepKey="assertNotEquals"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontEditBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontEditBundleProductTest.xml index 0ac47a27f1f95..9dbd6e26bddc4 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontEditBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontEditBundleProductTest.xml @@ -86,7 +86,7 @@ <waitForPageLoad stepKey="waitForElementAdded2"/> <!-- Go to the shopping cart page and edit the first product --> - <amOnPage url="/checkout/cart/" stepKey="onPageShoppingCart"/> + <amOnPage url="{{CheckoutCartPage.url}}" stepKey="onPageShoppingCart"/> <waitForPageLoad stepKey="waitForCartPageLoad"/> <waitForElementVisible stepKey="waitForInfoDropdown" selector="{{CheckoutCartSummarySection.total}}"/> <waitForPageLoad stepKey="waitForCartPageLoad3"/> @@ -104,7 +104,7 @@ <waitForPageLoad stepKey="waitForElementAdded3"/> <!-- Go to the shopping cart page --> - <amOnPage url="/checkout/cart/" stepKey="onPageShoppingCart2"/> + <amOnPage url="{{CheckoutCartPage.url}}" stepKey="onPageShoppingCart2"/> <waitForPageLoad stepKey="waitForCartPageLoad2"/> <!-- Assert that the options are both there and the proce no longer matches --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest.xml index 6edb7daf50026..4f1618e076642 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest.xml @@ -60,7 +60,7 @@ <seeElement selector="{{StorefrontCategoryProductSection.productPriceFinal('90')}}" stepKey="assertProductFinalPriceIs90_1"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceLabel('Regular Price')}}" stepKey="assertRegularPriceLabel_1"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceOld('100')}}" stepKey="assertRegularPriceAmount_1"/> - <amOnPage url="customer/account/logout/" stepKey="logoutCustomer1"/> + <amOnPage url="{{StorefrontCustomerLogoutPage.url}}" stepKey="logoutCustomer1"/> <waitForPageLoad time="30" stepKey="waitForPageLoad2"/> <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="navigateToCategoryPage2"/> <waitForPageLoad time="30" stepKey="waitForPageLoad3"/> @@ -116,7 +116,7 @@ <seeElement selector="{{StorefrontCategoryProductSection.productPriceFinal('100')}}" stepKey="assertProductFinalPriceIs100_2"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceLabel('As low as')}}" stepKey="assertAsLowAsPriceLabel_1"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceLinkAfterLabel('As low as', '82')}}" stepKey="assertPriceAfterAsLowAsLabel_1"/> - <amOnPage url="customer/account/logout/" stepKey="logoutCustomer2"/> + <amOnPage url="{{StorefrontCustomerLogoutPage.url}}" stepKey="logoutCustomer2"/> <waitForPageLoad time="30" stepKey="waitForPageLoad7"/> <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="navigateToCategoryPage6"/> <waitForPageLoad time="30" stepKey="waitForPageLoad8"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckPaginationInStorefrontTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckPaginationInStorefrontTest.xml index 1b72458747067..6eb7b7ea456b3 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckPaginationInStorefrontTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckPaginationInStorefrontTest.xml @@ -115,7 +115,7 @@ <click selector="{{CatalogProductsSection.resetFilter}}" stepKey="clickOnResetFilter"/> <waitForPageLoad stepKey="waitForPageToLoad3"/> <selectOption selector="{{AdminProductGridFilterSection.productPerPage}}" userInput="30" stepKey="selectPagePerView"/> - <wait stepKey="waitFroPageToLoad1" time="30"/> + <waitForPageLoad stepKey="waitFroPageToLoad1" time="30"/> <fillField selector="{{AdminCategoryContentSection.productTableColumnName}}" userInput="pagi" stepKey="selectProduct1"/> <click selector="{{AdminCategoryContentSection.productSearch}}" stepKey="clickSearchButton"/> <waitForPageLoad stepKey="waitFroPageToLoad2"/> diff --git a/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithAssignedSimpleProductsTest.xml b/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithAssignedSimpleProductsTest.xml index 71ab764453b20..1bc794ae80cd7 100644 --- a/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithAssignedSimpleProductsTest.xml +++ b/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithAssignedSimpleProductsTest.xml @@ -258,7 +258,7 @@ </actionGroup> <!--Assert products prices in the cart --> - <amOnPage url="/checkout/cart/" stepKey="amOnShoppingCartPage"/> + <amOnPage url="{{CheckoutCartPage.url}}" stepKey="amOnShoppingCartPage"/> <waitForPageLoad stepKey="waitForShoppingCartPageLoad"/> <see userInput="$210.69" selector="{{CheckoutCartProductSection.ProductPriceByOption($$createFirstConfigProductAttributeFirstOption.option[store_labels][1][label]$$)}}" stepKey="assertFirstProductPriceForFirstProductOption"/> <see userInput="$120.70" selector="{{CheckoutCartProductSection.ProductPriceByOption($$createFirstConfigProductAttributeSecondOption.option[store_labels][1][label]$$)}}" stepKey="assertFirstProductPriceForSecondProductOption"/> diff --git a/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithOptionsTest.xml b/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithOptionsTest.xml index bfe7aadeca5ec..fcf5e2c038047 100644 --- a/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithOptionsTest.xml +++ b/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithOptionsTest.xml @@ -212,7 +212,7 @@ </actionGroup> <!--Assert product price in the cart --> - <amOnPage url="/checkout/cart/" stepKey="amOnShoppingCartPage"/> + <amOnPage url="{{CheckoutCartPage.url}}" stepKey="amOnShoppingCartPage"/> <waitForPageLoad stepKey="waitForShoppingCartPageLoad"/> <see userInput="{{CatalogRuleToFixed.discount_amount}}" selector="{{CheckoutCartProductSection.ProductPriceByOption($$createConfigProductAttributeFirstOption.option[store_labels][1][label]$$)}}" stepKey="assertProductPriceForFirstProductOption"/> <see userInput="$110.70" selector="{{CheckoutCartProductSection.ProductPriceByOption($$createConfigProductAttributeSecondOption.option[store_labels][1][label]$$)}}" stepKey="assertProductPriceForSecondProductOption"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/CheckCheckoutSuccessPageTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/CheckCheckoutSuccessPageTest.xml index 971af9688e754..5f898492ad016 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/CheckCheckoutSuccessPageTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/CheckCheckoutSuccessPageTest.xml @@ -28,7 +28,7 @@ <after> <!--Logout from customer account--> - <amOnPage url="customer/account/logout/" stepKey="logoutCustomerOne"/> + <amOnPage url="{{StorefrontCustomerLogoutPage.url}}" stepKey="logoutCustomerOne"/> <waitForPageLoad stepKey="waitLogoutCustomerOne"/> <actionGroup ref="logout" stepKey="adminLogout"/> <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigAdminAccountSharingActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigAdminAccountSharingActionGroup.xml index 4e11dd6e971de..976f64a457074 100644 --- a/app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigAdminAccountSharingActionGroup.xml +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigAdminAccountSharingActionGroup.xml @@ -13,7 +13,7 @@ <description>Goes to the 'Configuration' page for 'Admin'. Enables 'Admin Account Sharing'. Clicks on the Save button.</description> </annotations> - <amOnPage url="{{_ENV.MAGENTO_BACKEND_NAME}}/admin/system_config/edit/section/admin/" stepKey="navigateToConfigurationPage"/> + <amOnPage url="{{AdminConfigAdvancedAdmin.url}}" stepKey="navigateToConfigurationPage"/> <waitForPageLoad stepKey="wait1"/> <conditionalClick stepKey="expandSecurityTab" selector="{{AdminSection.SecurityTab}}" dependentSelector="{{AdminSection.CheckIfTabExpand}}" visible="true"/> <waitForElementVisible selector="{{AdminSection.AdminAccountSharing}}" stepKey="waitForAdminAccountSharingDrpDown"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsAssignedToCategoryTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsAssignedToCategoryTest.xml index 2f4fc97cb48ff..6ab4734a074a5 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsAssignedToCategoryTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsAssignedToCategoryTest.xml @@ -131,7 +131,7 @@ <waitForElementVisible selector="{{StorefrontCategoryMainSection.SuccessMsg}}" stepKey="waitForSuccessMessage"/> <!-- Assert configurable product in cart --> - <amOnPage url="/checkout/cart/" stepKey="amOnShoppingCartPage"/> + <amOnPage url="{{CheckoutCartPage.url}}" stepKey="amOnShoppingCartPage"/> <waitForPageLoad stepKey="waitForShoppingCartPageLoad"/> <actionGroup ref="StorefrontCheckCartConfigurableProductActionGroup" stepKey="storefrontCheckCartConfigurableProductActionGroup"> <argument name="product" value="ApiConfigurableProduct"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsWithoutAssignedToCategoryTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsWithoutAssignedToCategoryTest.xml index 0d8f8bfb65c16..14303aa9b650b 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsWithoutAssignedToCategoryTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsWithoutAssignedToCategoryTest.xml @@ -113,7 +113,7 @@ <waitForElementVisible selector="{{StorefrontCategoryMainSection.SuccessMsg}}" stepKey="waitForSuccessMessage"/> <!-- Assert configurable product in cart --> - <amOnPage url="/checkout/cart/" stepKey="amOnShoppingCartPage"/> + <amOnPage url="{{CheckoutCartPage.url}}" stepKey="amOnShoppingCartPage"/> <waitForPageLoad stepKey="waitForShoppingCartPageLoad"/> <actionGroup ref="StorefrontCheckCartConfigurableProductActionGroup" stepKey="storefrontCheckCartConfigurableProductActionGroup"> <argument name="product" value="ApiConfigurableProduct"/> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/SignUpNewUserFromStorefrontActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/SignUpNewUserFromStorefrontActionGroup.xml index 44988b202ab57..4260417b46fd0 100644 --- a/app/code/Magento/Customer/Test/Mftf/ActionGroup/SignUpNewUserFromStorefrontActionGroup.xml +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/SignUpNewUserFromStorefrontActionGroup.xml @@ -117,10 +117,10 @@ <arguments> <argument name="address"/> </arguments> - - <amOnPage url="customer/address/index/" stepKey="goToAddressPage"/> + + <amOnPage url="{{StorefrontCustomerAddressesPage.url}}" stepKey="goToAddressPage"/> <waitForPageLoad stepKey="waitForAddressPageLoad"/> - + <!--Verify customer default billing address--> <see selector="{{StorefrontCustomerAddressesSection.defaultBillingAddress}}" userInput="{{address.firstname}} {{address.lastname}}" stepKey="seeAssertCustomerDefaultBillingAddressFirstnameAndLastname"/> <see selector="{{StorefrontCustomerAddressesSection.defaultBillingAddress}}" userInput="{{address.company}}" stepKey="seeAssertCustomerDefaultBillingAddressCompany"/> @@ -139,7 +139,7 @@ <argument name="address"/> </arguments> - <amOnPage url="customer/address/index/" stepKey="goToAddressPage"/> + <amOnPage url="{{StorefrontCustomerAddressesPage.url}}" stepKey="goToAddressPage"/> <waitForPageLoad stepKey="waitForAddressPageLoad"/> <!--Verify customer default shipping address--> <see selector="{{StorefrontCustomerAddressesSection.defaultShippingAddress}}" userInput="{{address.firstname}} {{address.lastname}}" stepKey="seeAssertCustomerDefaultShippingAddressFirstnameAndLastname"/> @@ -159,7 +159,7 @@ <argument name="address"/> </arguments> - <amOnPage url="customer/address/index/" stepKey="goToAddressPage"/> + <amOnPage url="{{StorefrontCustomerAddressesPage.url}}" stepKey="goToAddressPage"/> <waitForPageLoad stepKey="waitForAddressPageLoad"/> <!--Verify customer default billing address--> @@ -180,7 +180,7 @@ <argument name="address"/> </arguments> - <amOnPage url="customer/address/index/" stepKey="goToAddressPage"/> + <amOnPage url="{{StorefrontCustomerAddressesPage.url}}" stepKey="goToAddressPage"/> <waitForPageLoad stepKey="waitForAddressPageLoad"/> <!--Verify customer default shipping address--> @@ -202,7 +202,7 @@ </arguments> <!--Verify customer name on frontend--> - <amOnPage url="customer/account/edit/" stepKey="goToAddressPage"/> + <amOnPage url="{{StorefrontCustomerEditPage.url}}" stepKey="goToAddressPage"/> <waitForPageLoad stepKey="waitForAddressPageLoad"/> <click selector="{{StorefrontCustomerSidebarSection.sidebarCurrentTab('Account Information')}}" stepKey="clickAccountInformationFromSidebarCurrentTab"/> <waitForPageLoad stepKey="waitForAccountInformationTabToOpen"/> diff --git a/app/code/Magento/Indexer/Test/Mftf/ActionGroup/UpdateIndexerByScheduleActionGroup.xml b/app/code/Magento/Indexer/Test/Mftf/ActionGroup/UpdateIndexerByScheduleActionGroup.xml index 04a5b97469c8e..3b6c8c1504a3a 100644 --- a/app/code/Magento/Indexer/Test/Mftf/ActionGroup/UpdateIndexerByScheduleActionGroup.xml +++ b/app/code/Magento/Indexer/Test/Mftf/ActionGroup/UpdateIndexerByScheduleActionGroup.xml @@ -16,7 +16,7 @@ <argument name="indexerName" type="string"/> </arguments> - <amOnPage url="{{_ENV.MAGENTO_BACKEND_NAME}}/indexer/indexer/list/" stepKey="amOnIndexManagementPage"/> + <amOnPage url="{{AdminIndexManagementPage.url}}" stepKey="amOnIndexManagementPage"/> <waitForPageLoad stepKey="waitForIndexManagementPageToLoad"/> <click selector="{{AdminIndexManagementSection.indexerCheckbox(indexerName)}}" stepKey="selectIndexer1"/> <selectOption selector="{{AdminIndexManagementSection.massActionSelect}}" userInput="change_mode_changelog" stepKey="selectUpdateBySchedule"/> diff --git a/app/code/Magento/Indexer/Test/Mftf/ActionGroup/UpdateIndexerOnSaveActionGroup.xml b/app/code/Magento/Indexer/Test/Mftf/ActionGroup/UpdateIndexerOnSaveActionGroup.xml index 65be57a335006..023b5b8e0aa0e 100644 --- a/app/code/Magento/Indexer/Test/Mftf/ActionGroup/UpdateIndexerOnSaveActionGroup.xml +++ b/app/code/Magento/Indexer/Test/Mftf/ActionGroup/UpdateIndexerOnSaveActionGroup.xml @@ -16,7 +16,7 @@ <argument name="indexerName" type="string"/> </arguments> - <amOnPage url="{{_ENV.MAGENTO_BACKEND_NAME}}/indexer/indexer/list/" stepKey="amOnIndexManagementPage2"/> + <amOnPage url="{{AdminIndexManagementPage.url}}" stepKey="amOnIndexManagementPage2"/> <waitForPageLoad stepKey="waitForIndexManagementPageToLoad2"/> <click selector="{{AdminIndexManagementSection.indexerCheckbox(indexerName)}}" stepKey="selectIndexer2"/> <selectOption selector="{{AdminIndexManagementSection.massActionSelect}}" userInput="change_mode_onthefly" stepKey="selectUpdateOnSave"/> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/VerifySubscribedNewsletterDisplayedTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/VerifySubscribedNewsletterDisplayedTest.xml index 740b8fbaa0ab7..200eb0e49f5b2 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Test/VerifySubscribedNewsletterDisplayedTest.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Test/VerifySubscribedNewsletterDisplayedTest.xml @@ -57,7 +57,7 @@ <argument name="Customer" value="CustomerEntityOne"/> </actionGroup> <!--Sign Out--> - <amOnPage url="customer/account/logout/" stepKey="customerOnLogoutPage"/> + <amOnPage url="{{StorefrontCustomerLogoutPage.url}}" stepKey="customerOnLogoutPage"/> <waitForPageLoad stepKey="waitLogoutCustomer"/> <!--Create new Account with the same email address. (unchecked Sign Up for Newsletter checkbox)--> <actionGroup ref="StorefrontCreateNewAccountNewsletterUncheckedActionGroup" stepKey="createNewAccountNewsletterUnchecked"> diff --git a/app/code/Magento/PageCache/Test/Mftf/ActionGroup/ClearCacheActionGroup.xml b/app/code/Magento/PageCache/Test/Mftf/ActionGroup/ClearCacheActionGroup.xml index 4bd68fa1e9929..ea76b133bb414 100644 --- a/app/code/Magento/PageCache/Test/Mftf/ActionGroup/ClearCacheActionGroup.xml +++ b/app/code/Magento/PageCache/Test/Mftf/ActionGroup/ClearCacheActionGroup.xml @@ -13,7 +13,7 @@ <description>Goes to the Admin Cache Management page. Clicks on 'Flush Magento Cache'.</description> </annotations> - <amOnPage url="{{_ENV.MAGENTO_BACKEND_NAME}}/admin/cache/" stepKey="goToNewCustomVarialePage"/> + <amOnPage url="{{AdminCacheManagementPage.url}}" stepKey="goToCacheManagement"/> <waitForPageLoad stepKey="waitForPageLoad"/> <click selector="{{AdminCacheManagementSection.FlushMagentoCache}}" stepKey="clickFlushMagentoCache"/> <waitForPageLoad stepKey="waitForCacheFlush"/> diff --git a/app/code/Magento/PageCache/Test/Mftf/ActionGroup/ClearPageCacheActionGroup.xml b/app/code/Magento/PageCache/Test/Mftf/ActionGroup/ClearPageCacheActionGroup.xml index 88ed167e24e1a..3c0d2aa8082b1 100644 --- a/app/code/Magento/PageCache/Test/Mftf/ActionGroup/ClearPageCacheActionGroup.xml +++ b/app/code/Magento/PageCache/Test/Mftf/ActionGroup/ClearPageCacheActionGroup.xml @@ -13,7 +13,7 @@ <description>Goes to the Admin Cache Management page. Selects 'Refresh'. Checks the 'Page Cache' row. Clicks on Submit.</description> </annotations> - <amOnPage url="{{_ENV.MAGENTO_BACKEND_NAME}}/admin/cache/" stepKey="goToCacheManagementPage"/> + <amOnPage url="{{AdminCacheManagementPage.url}}" stepKey="goToCacheManagementPage"/> <waitForPageLoad stepKey="waitForPageLoad"/> <click selector="{{AdminCacheManagementSection.actionDropDown}}" stepKey="actionSelection"/> <click selector="{{AdminCacheManagementSection.refreshOption}}" stepKey="selectRefreshOption"/> From c85410d14fc4db09d21ebbc37f880330a7094390 Mon Sep 17 00:00:00 2001 From: Marco Oliveira <marcoaacoliveira@gmail.com> Date: Mon, 6 Jan 2020 04:25:24 -0300 Subject: [PATCH 543/586] Making formatter with IntlDateFormatter::MEDIUM, to solve errors when trying to convert a bigger string into timestamp. --- lib/internal/Magento/Framework/Stdlib/DateTime/Timezone.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Stdlib/DateTime/Timezone.php b/lib/internal/Magento/Framework/Stdlib/DateTime/Timezone.php index e9873b39a6090..2568a5ccf21c1 100644 --- a/lib/internal/Magento/Framework/Stdlib/DateTime/Timezone.php +++ b/lib/internal/Magento/Framework/Stdlib/DateTime/Timezone.php @@ -177,7 +177,7 @@ public function date($date = null, $locale = null, $useTimezone = true, $include $timeType = $includeTime ? \IntlDateFormatter::SHORT : \IntlDateFormatter::NONE; $formatter = new \IntlDateFormatter( $locale, - \IntlDateFormatter::SHORT, + \IntlDateFormatter::MEDIUM, $timeType, new \DateTimeZone($timezone) ); From 4a751093851852a3eaf71f08803f661a6523a2d4 Mon Sep 17 00:00:00 2001 From: "rostyslav.hymon" <rostyslav.hymon@transoftgroup.com> Date: Mon, 6 Jan 2020 09:32:37 +0200 Subject: [PATCH 544/586] MC-29951: [On-Prem] Out of stock items included in Category Filtering --- .../CustomAttributeStockStatusFilter.php | 100 +++++++++++ .../Search/FilterMapper/FilterMapper.php | 38 ++-- .../Search/FilterMapper/StockStatusFilter.php | 114 +++--------- .../FilterMapper/StockStatusQueryBuilder.php | 106 +++++++++++ .../ResourceModel/Fulltext/CollectionTest.php | 156 ++++++++++++++++ .../product_configurable_two_options.php | 166 ++++++++++++++++++ ...duct_configurable_two_options_rollback.php | 49 ++++++ .../Magento/CatalogSearch/_files/requests.xml | 38 ++++ 8 files changed, 663 insertions(+), 104 deletions(-) create mode 100644 app/code/Magento/CatalogSearch/Model/Search/FilterMapper/CustomAttributeStockStatusFilter.php create mode 100644 app/code/Magento/CatalogSearch/Model/Search/FilterMapper/StockStatusQueryBuilder.php create mode 100644 dev/tests/integration/testsuite/Magento/CatalogSearch/_files/product_configurable_two_options.php create mode 100644 dev/tests/integration/testsuite/Magento/CatalogSearch/_files/product_configurable_two_options_rollback.php create mode 100644 dev/tests/integration/testsuite/Magento/CatalogSearch/_files/requests.xml diff --git a/app/code/Magento/CatalogSearch/Model/Search/FilterMapper/CustomAttributeStockStatusFilter.php b/app/code/Magento/CatalogSearch/Model/Search/FilterMapper/CustomAttributeStockStatusFilter.php new file mode 100644 index 0000000000000..28aa3df2d56b4 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Model/Search/FilterMapper/CustomAttributeStockStatusFilter.php @@ -0,0 +1,100 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogSearch\Model\Search\FilterMapper; + +use Magento\Catalog\Model\Product; +use Magento\CatalogSearch\Model\Adapter\Mysql\Filter\AliasResolver; +use Magento\Eav\Model\Config as EavConfig; +use Magento\Framework\DB\Select; +use Magento\Framework\Search\Request\FilterInterface; + +/** + * Add stock status filter for each requested filter + */ +class CustomAttributeStockStatusFilter +{ + /** + * Suffix to append to filter name in order to generate stock status table alias for JOIN clause + */ + private const STOCK_STATUS_TABLE_ALIAS_SUFFIX = '_stock_index'; + /** + * Attribute types to apply + */ + private const TARGET_ATTRIBUTE_TYPES = [ + 'select', + 'multiselect' + ]; + /** + * @var EavConfig + */ + private $eavConfig; + /** + * @var AliasResolver + */ + private $aliasResolver; + /** + * @var StockStatusQueryBuilder|null + */ + private $stockStatusQueryBuilder; + + /** + * @param EavConfig $eavConfig + * @param AliasResolver $aliasResolver + * @param StockStatusQueryBuilder $stockStatusQueryBuilder + */ + public function __construct( + EavConfig $eavConfig, + AliasResolver $aliasResolver, + StockStatusQueryBuilder $stockStatusQueryBuilder + ) { + $this->eavConfig = $eavConfig; + $this->aliasResolver = $aliasResolver; + $this->stockStatusQueryBuilder = $stockStatusQueryBuilder; + } + + /** + * Apply stock status filter to provided filter + * + * @param Select $select + * @param mixed $values + * @param FilterInterface[] $filters + * @return Select + */ + public function apply(Select $select, $values = null, FilterInterface ...$filters): Select + { + $select = clone $select; + foreach ($filters as $filter) { + if ($this->isApplicable($filter)) { + $mainTableAlias = $this->aliasResolver->getAlias($filter); + $stockTableAlias = $mainTableAlias . self::STOCK_STATUS_TABLE_ALIAS_SUFFIX; + $select = $this->stockStatusQueryBuilder->apply( + $select, + $mainTableAlias, + $stockTableAlias, + 'source_id', + $values + ); + } + } + return $select; + } + + /** + * Check if stock status filter is applicable to provided filter + * + * @param FilterInterface $filter + * @return bool + */ + private function isApplicable(FilterInterface $filter): bool + { + $attribute = $this->eavConfig->getAttribute(Product::ENTITY, $filter->getField()); + return $attribute + && $filter->getType() === FilterInterface::TYPE_TERM + && in_array($attribute->getFrontendInput(), self::TARGET_ATTRIBUTE_TYPES, true); + } +} diff --git a/app/code/Magento/CatalogSearch/Model/Search/FilterMapper/FilterMapper.php b/app/code/Magento/CatalogSearch/Model/Search/FilterMapper/FilterMapper.php index 7136fad5b19a9..1c4a803c1dd00 100644 --- a/app/code/Magento/CatalogSearch/Model/Search/FilterMapper/FilterMapper.php +++ b/app/code/Magento/CatalogSearch/Model/Search/FilterMapper/FilterMapper.php @@ -9,13 +9,14 @@ use Magento\CatalogSearch\Model\Search\SelectContainer\SelectContainer; use Magento\CatalogSearch\Model\Adapter\Mysql\Filter\AliasResolver; use Magento\CatalogInventory\Model\Stock; +use Magento\Framework\App\ObjectManager; /** - * Class FilterMapper * This class applies filters to Select based on SelectContainer configuration * - * @deprecated + * @deprecated MySQL search engine is not recommended. * @see \Magento\ElasticSearch + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class FilterMapper { @@ -43,6 +44,10 @@ class FilterMapper * @var StockStatusFilter */ private $stockStatusFilter; + /** + * @var CustomAttributeStockStatusFilter + */ + private $customAttributeStockStatusFilter; /** * @param AliasResolver $aliasResolver @@ -50,24 +55,27 @@ class FilterMapper * @param FilterStrategyInterface $filterStrategy * @param VisibilityFilter $visibilityFilter * @param StockStatusFilter $stockStatusFilter + * @param CustomAttributeStockStatusFilter|null $customAttributeStockStatusFilter */ public function __construct( AliasResolver $aliasResolver, CustomAttributeFilter $customAttributeFilter, FilterStrategyInterface $filterStrategy, VisibilityFilter $visibilityFilter, - StockStatusFilter $stockStatusFilter + StockStatusFilter $stockStatusFilter, + ?CustomAttributeStockStatusFilter $customAttributeStockStatusFilter = null ) { $this->aliasResolver = $aliasResolver; $this->customAttributeFilter = $customAttributeFilter; $this->filterStrategy = $filterStrategy; $this->visibilityFilter = $visibilityFilter; $this->stockStatusFilter = $stockStatusFilter; + $this->customAttributeStockStatusFilter = $customAttributeStockStatusFilter + ?? ObjectManager::getInstance()->get(CustomAttributeStockStatusFilter::class); } /** - * Applies filters to Select query in SelectContainer - * based on SelectContainer configuration + * Applies filters to Select query in SelectContainer based on SelectContainer configuration * * @param SelectContainer $selectContainer * @return SelectContainer @@ -79,22 +87,22 @@ public function applyFilters(SelectContainer $selectContainer) { $select = $selectContainer->getSelect(); - if ($selectContainer->hasCustomAttributesFilters()) { - $select = $this->customAttributeFilter->apply($select, ...$selectContainer->getCustomAttributesFilters()); - } - - $filterType = StockStatusFilter::FILTER_JUST_ENTITY; - if ($selectContainer->hasCustomAttributesFilters()) { - $filterType = StockStatusFilter::FILTER_ENTITY_AND_SUB_PRODUCTS; - } - $select = $this->stockStatusFilter->apply( $select, Stock::STOCK_IN_STOCK, - $filterType, + StockStatusFilter::FILTER_JUST_ENTITY, $selectContainer->isShowOutOfStockEnabled() ); + if ($selectContainer->hasCustomAttributesFilters()) { + $select = $this->customAttributeFilter->apply($select, ...$selectContainer->getCustomAttributesFilters()); + $select = $this->customAttributeStockStatusFilter->apply( + $select, + $selectContainer->isShowOutOfStockEnabled() ? null : Stock::STOCK_IN_STOCK, + ...$selectContainer->getCustomAttributesFilters() + ); + } + $appliedFilters = []; if ($selectContainer->hasVisibilityFilter()) { diff --git a/app/code/Magento/CatalogSearch/Model/Search/FilterMapper/StockStatusFilter.php b/app/code/Magento/CatalogSearch/Model/Search/FilterMapper/StockStatusFilter.php index 0e3ba0d4e669f..420c69a7325f6 100644 --- a/app/code/Magento/CatalogSearch/Model/Search/FilterMapper/StockStatusFilter.php +++ b/app/code/Magento/CatalogSearch/Model/Search/FilterMapper/StockStatusFilter.php @@ -6,6 +6,7 @@ namespace Magento\CatalogSearch\Model\Search\FilterMapper; +use Magento\Framework\App\ObjectManager; use Magento\Framework\App\ResourceConnection; use Magento\Framework\DB\Select; use Magento\Framework\Search\Adapter\Mysql\ConditionManager; @@ -13,10 +14,9 @@ use Magento\CatalogInventory\Api\StockRegistryInterface; /** - * Class StockStatusFilter * Adds filter by stock status to base select * - * @deprecated + * @deprecated MySQL search engine is not recommended. * @see \Magento\ElasticSearch */ class StockStatusFilter @@ -56,23 +56,31 @@ class StockStatusFilter * @var StockRegistryInterface */ private $stockRegistry; + /** + * @var StockStatusQueryBuilder + */ + private $stockStatusQueryBuilder; /** * @param ResourceConnection $resourceConnection * @param ConditionManager $conditionManager * @param StockConfigurationInterface $stockConfiguration * @param StockRegistryInterface $stockRegistry + * @param StockStatusQueryBuilder|null $stockStatusQueryBuilder */ public function __construct( ResourceConnection $resourceConnection, ConditionManager $conditionManager, StockConfigurationInterface $stockConfiguration, - StockRegistryInterface $stockRegistry + StockRegistryInterface $stockRegistry, + ?StockStatusQueryBuilder $stockStatusQueryBuilder = null ) { $this->resourceConnection = $resourceConnection; $this->conditionManager = $conditionManager; $this->stockConfiguration = $stockConfiguration; $this->stockRegistry = $stockRegistry; + $this->stockStatusQueryBuilder = $stockStatusQueryBuilder + ?? ObjectManager::getInstance()->get(StockStatusQueryBuilder::class); } /** @@ -94,99 +102,27 @@ public function apply(Select $select, $stockValues, $type, $showOutOfStockFlag) $select = clone $select; $mainTableAlias = $this->extractTableAliasFromSelect($select); - $this->addMainStockStatusJoin($select, $stockValues, $mainTableAlias, $showOutOfStockFlag); + $select = $this->stockStatusQueryBuilder->apply( + $select, + $mainTableAlias, + 'stock_index', + 'entity_id', + $showOutOfStockFlag ? null : $stockValues + ); if ($type === self::FILTER_ENTITY_AND_SUB_PRODUCTS) { - $this->addSubProductsStockStatusJoin($select, $stockValues, $mainTableAlias, $showOutOfStockFlag); + $select = $this->stockStatusQueryBuilder->apply( + $select, + $mainTableAlias, + 'sub_products_stock_index', + 'source_id', + $showOutOfStockFlag ? null : $stockValues + ); } return $select; } - /** - * Adds filter join for products by stock status - * In case when $showOutOfStockFlag is true - joins are still required to filter only enabled products - * - * @param Select $select - * @param array|int $stockValues - * @param string $mainTableAlias - * @param bool $showOutOfStockFlag - * @return void - */ - private function addMainStockStatusJoin(Select $select, $stockValues, $mainTableAlias, $showOutOfStockFlag) - { - $catalogInventoryTable = $this->resourceConnection->getTableName('cataloginventory_stock_status'); - $select->joinInner( - ['stock_index' => $catalogInventoryTable], - $this->conditionManager->combineQueries( - [ - sprintf('stock_index.product_id = %s.entity_id', $mainTableAlias), - $this->conditionManager->generateCondition( - 'stock_index.website_id', - '=', - $this->stockConfiguration->getDefaultScopeId() - ), - $showOutOfStockFlag - ? '' - : $this->conditionManager->generateCondition( - 'stock_index.stock_status', - is_array($stockValues) ? 'in' : '=', - $stockValues - ), - $this->conditionManager->generateCondition( - 'stock_index.stock_id', - '=', - (int) $this->stockRegistry->getStock()->getStockId() - ), - ], - Select::SQL_AND - ), - [] - ); - } - - /** - * Adds filter join for sub products by stock status - * In case when $showOutOfStockFlag is true - joins are still required to filter only enabled products - * - * @param Select $select - * @param array|int $stockValues - * @param string $mainTableAlias - * @param bool $showOutOfStockFlag - * @return void - */ - private function addSubProductsStockStatusJoin(Select $select, $stockValues, $mainTableAlias, $showOutOfStockFlag) - { - $catalogInventoryTable = $this->resourceConnection->getTableName('cataloginventory_stock_status'); - $select->joinInner( - ['sub_products_stock_index' => $catalogInventoryTable], - $this->conditionManager->combineQueries( - [ - sprintf('sub_products_stock_index.product_id = %s.source_id', $mainTableAlias), - $this->conditionManager->generateCondition( - 'sub_products_stock_index.website_id', - '=', - $this->stockConfiguration->getDefaultScopeId() - ), - $showOutOfStockFlag - ? '' - : $this->conditionManager->generateCondition( - 'sub_products_stock_index.stock_status', - is_array($stockValues) ? 'in' : '=', - $stockValues - ), - $this->conditionManager->generateCondition( - 'sub_products_stock_index.stock_id', - '=', - (int) $this->stockRegistry->getStock()->getStockId() - ), - ], - Select::SQL_AND - ), - [] - ); - } - /** * Extracts alias for table that is used in FROM clause in Select * diff --git a/app/code/Magento/CatalogSearch/Model/Search/FilterMapper/StockStatusQueryBuilder.php b/app/code/Magento/CatalogSearch/Model/Search/FilterMapper/StockStatusQueryBuilder.php new file mode 100644 index 0000000000000..2d0d408875661 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Model/Search/FilterMapper/StockStatusQueryBuilder.php @@ -0,0 +1,106 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogSearch\Model\Search\FilterMapper; + +use Magento\CatalogInventory\Model\ResourceModel\Stock\Status as StockStatusResourceModel; +use Magento\Framework\DB\Select; +use Magento\Framework\Search\Adapter\Mysql\ConditionManager; +use Magento\CatalogInventory\Api\StockConfigurationInterface; +use Magento\CatalogInventory\Api\StockRegistryInterface; + +/** + * Add stock status filter to Select + */ +class StockStatusQueryBuilder +{ + /** + * @var StockStatusResourceModel + */ + private $stockStatusResourceModel; + + /** + * @var ConditionManager + */ + private $conditionManager; + + /** + * @var StockConfigurationInterface + */ + private $stockConfiguration; + + /** + * @var StockRegistryInterface + */ + private $stockRegistry; + + /** + * @param StockStatusResourceModel $stockStatusResourceModel + * @param ConditionManager $conditionManager + * @param StockConfigurationInterface $stockConfiguration + * @param StockRegistryInterface $stockRegistry + */ + public function __construct( + StockStatusResourceModel $stockStatusResourceModel, + ConditionManager $conditionManager, + StockConfigurationInterface $stockConfiguration, + StockRegistryInterface $stockRegistry + ) { + $this->stockStatusResourceModel = $stockStatusResourceModel; + $this->conditionManager = $conditionManager; + $this->stockConfiguration = $stockConfiguration; + $this->stockRegistry = $stockRegistry; + } + + /** + * Add stock filter to Select + * + * @param Select $select + * @param string $mainTableAlias + * @param string $stockTableAlias + * @param string $joinField + * @param mixed $values + * @return Select + */ + public function apply( + Select $select, + string $mainTableAlias, + string $stockTableAlias, + string $joinField, + $values = null + ): Select { + $select->joinInner( + [$stockTableAlias => $this->stockStatusResourceModel->getMainTable()], + $this->conditionManager->combineQueries( + [ + sprintf('%s.product_id = %s.%s', $stockTableAlias, $mainTableAlias, $joinField), + $this->conditionManager->generateCondition( + sprintf('%s.website_id', $stockTableAlias), + '=', + $this->stockConfiguration->getDefaultScopeId() + ), + $values === null + ? '' + : $this->conditionManager->generateCondition( + sprintf('%s.stock_status', $stockTableAlias), + is_array($values) ? 'in' : '=', + $values + ), + $this->conditionManager->generateCondition( + sprintf('%s.stock_id', $stockTableAlias), + '=', + (int) $this->stockRegistry->getStock()->getStockId() + ), + ], + Select::SQL_AND + ), + [] + ); + + return $select; + } +} diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/ResourceModel/Fulltext/CollectionTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/ResourceModel/Fulltext/CollectionTest.php index 8863834078214..55465e938e71b 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/ResourceModel/Fulltext/CollectionTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/ResourceModel/Fulltext/CollectionTest.php @@ -40,6 +40,7 @@ public function testLoadWithFilterSearch($request, $filters, $expectedCount) /** * @dataProvider filtersDataProviderQuickSearch * @magentoDataFixture Magento/Framework/Search/_files/products.php + * @magentoAppIsolation enabled */ public function testLoadWithFilterQuickSearch($filters, $expectedCount) { @@ -61,6 +62,7 @@ public function testLoadWithFilterQuickSearch($filters, $expectedCount) /** * @dataProvider filtersDataProviderCatalogView * @magentoDataFixture Magento/Framework/Search/_files/products.php + * @magentoAppIsolation enabled */ public function testLoadWithFilterCatalogView($filters, $expectedCount) { @@ -78,6 +80,7 @@ public function testLoadWithFilterCatalogView($filters, $expectedCount) /** * @magentoDataFixture Magento/Framework/Search/_files/products_with_the_same_search_score.php + * @magentoAppIsolation enabled */ public function testSearchResultsAreTheSameForSameRequests() { @@ -142,4 +145,157 @@ public function filtersDataProviderCatalogView() [[], 5], ]; } + + /** + * Test configurable product with multiple options + * + * @magentoDataFixture Magento/CatalogSearch/_files/product_configurable_two_options.php + * @magentoConfigFixture default/catalog/search/engine mysql + * @magentoDataFixture Magento/CatalogSearch/_files/full_reindex.php + * @magentoAppIsolation enabled + * @dataProvider configurableProductWithMultipleOptionsDataProvider + * @param array $filters + * @param bool $found + * @param array $outOfStock + * @throws \Magento\Framework\Exception\NoSuchEntityException + */ + public function testConfigurableProductWithMultipleOptions(array $filters, bool $found, array $outOfStock = []) + { + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + /**@var $stockRegistry \Magento\CatalogInventory\Model\StockRegistry */ + $stockRegistry = $objectManager->get(\Magento\CatalogInventory\Model\StockRegistry::class); + /**@var $stockItemRepository \Magento\CatalogInventory\Api\StockItemRepositoryInterface */ + $stockItemRepository = $objectManager->get(\Magento\CatalogInventory\Api\StockItemRepositoryInterface::class); + $collection = $objectManager->create( + \Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection::class, + ['searchRequestName' => 'filter_by_configurable_product_options'] + ); + foreach ($outOfStock as $sku) { + $stockItem = $stockRegistry->getStockItemBySku($sku); + $stockItem->setQty(0); + $stockItem->setIsInStock(0); + $stockItemRepository->save($stockItem); + } + + $options = ['test_configurable', 'test_configurable_2']; + foreach ($options as $option) { + if (isset($filters[$option])) { + $filters[$option] = $this->getOptionValue($option, $filters[$option]); + } + } + $filters['category_ids'] = 2; + foreach ($filters as $field => $value) { + $collection->addFieldToFilter($field, $value); + } + $collection->load(); + $items = $collection->getItems(); + if ($found) { + $this->assertCount(1, $items); + $item = array_shift($items); + $this->assertEquals('configurable_with_2_opts', $item['sku']); + } + $this->assertCount(0, $items); + } + + /** + * Provide filters to test configurable product with multiple options + * + * @return array + */ + public function configurableProductWithMultipleOptionsDataProvider(): array + { + return [ + [ + [], + true + ], + [ + ['test_configurable' => 'Option 1'], + true + ], + [ + ['test_configurable' => 'Option 2'], + true + ], + [ + ['test_configurable_2' => 'Option 1'], + true + ], + [ + ['test_configurable_2' => 'Option 2'], + true + ], + [ + ['test_configurable' => 'Option 1', 'test_configurable_2' => 'Option 1'], + true + ], + [ + ['test_configurable' => 'Option 1', 'test_configurable_2' => 'Option 2'], + true + ], + [ + ['test_configurable' => 'Option 2', 'test_configurable_2' => 'Option 1'], + true + ], + [ + ['test_configurable' => 'Option 2', 'test_configurable_2' => 'Option 2'], + true + ], + [ + ['test_configurable' => 'Option 2', 'test_configurable_2' => 'Option 2'], + false, + [ + 'configurable2_option_12', + 'configurable2_option_22', + ] + ], + [ + ['test_configurable' => 'Option 2', 'test_configurable_2' => 'Option 2'], + false, + [ + 'configurable2_option_21', + 'configurable2_option_22', + ] + ], + [ + ['test_configurable' => 'Option 2'], + false, + [ + 'configurable2_option_21', + 'configurable2_option_22', + ] + ], + [ + [], + false, + [ + 'configurable2_option_11', + 'configurable2_option_12', + 'configurable2_option_21', + 'configurable2_option_22', + ] + ], + ]; + } + + /** + * Get attribute option value by label + * + * @param string $attributeName + * @param string $optionLabel + * @return string|null + */ + private function getOptionValue(string $attributeName, string $optionLabel): ?string + { + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $eavConfig = $objectManager->get(\Magento\Eav\Model\Config::class); + $attribute = $eavConfig->getAttribute(\Magento\Catalog\Model\Product::ENTITY, $attributeName); + $option = null; + foreach ($attribute->getOptions() as $option) { + if ($option->getLabel() === $optionLabel) { + return $option->getValue(); + } + } + return null; + } } diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/product_configurable_two_options.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/product_configurable_two_options.php new file mode 100644 index 0000000000000..67bd8b831b878 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/product_configurable_two_options.php @@ -0,0 +1,166 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +require __DIR__ . '/../../../Magento/ConfigurableProduct/_files/configurable_attribute.php'; +require __DIR__ . '/../../../Magento/ConfigurableProduct/_files/configurable_attribute_2.php'; + +use Magento\Catalog\Api\CategoryLinkManagementInterface; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\Product\Attribute\Source\Status; +use Magento\Catalog\Model\Product\Type; +use Magento\Catalog\Model\Product\Visibility; +use Magento\Catalog\Setup\CategorySetup; +use Magento\CatalogInventory\Model\Stock\Item; +use Magento\ConfigurableProduct\Helper\Product\Options\Factory; +use Magento\ConfigurableProduct\Model\Product\Type\Configurable; +use Magento\Eav\Api\AttributeRepositoryInterface; +use Magento\Eav\Api\Data\AttributeOptionInterface; +use Magento\Framework\Search\Request\Config; +use Magento\Framework\Search\Request\Config\Converter; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); +/** @var AttributeRepositoryInterface $attributeRepository */ +$attributeRepository = $objectManager->create(AttributeRepositoryInterface::class); +/** @var \Magento\Eav\Model\Config $eavConfig */ +$eavConfig = $objectManager->get(\Magento\Eav\Model\Config::class); +$attributes = ['test_configurable', 'test_configurable_2']; +foreach ($attributes as $attributeName) { + $attributeModel = $eavConfig->getAttribute(Product::ENTITY, $attributeName); + $attributeModel->addData([ + 'is_searchable' => 1, + 'is_filterable' => 1, + 'is_filterable_in_search' => 1, + 'is_visible_in_advanced_search' => 1, + ]); + $attributeRepository->save($attributeModel); +} + +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->create(ProductRepositoryInterface::class); + +/** @var $installer CategorySetup */ +$installer = $objectManager->create(CategorySetup::class); + +/** @var AttributeOptionInterface[] $options */ +$options = $attribute->getOptions(); + +$attribute1Values = []; +$attribute2Values = []; +$attributeSetId = $installer->getAttributeSetId('catalog_product', 'Default'); +$associatedProductIds = []; +array_shift($options); +$index1 = 1; +foreach ($options as $option1) { + /** @var AttributeOptionInterface[] $options */ + $options2 = $attribute2->getOptions(); + array_shift($options2); + $index2 = 1; + foreach ($options2 as $option2) { + /** @var $product Product */ + $product = $objectManager->create(Product::class); + $product->setTypeId(Type::TYPE_SIMPLE) + ->setAttributeSetId($attributeSetId) + ->setWebsiteIds([1]) + ->setName('Configurable2 Option' . $index1 . $index2) + ->setSku('configurable2_option_' . $index1 . $index2) + ->setPrice(random_int(10, 100)) + ->setTestConfigurable($option1->getValue()) + ->setTestConfigurable2($option2->getValue()) + ->setVisibility(Visibility::VISIBILITY_NOT_VISIBLE) + ->setStatus(Status::STATUS_ENABLED) + ->setStockData(['use_config_manage_stock' => 1, 'qty' => 100, 'is_qty_decimal' => 0, 'is_in_stock' => 1]); + + $product = $productRepository->save($product); + + /** @var Item $stockItem */ + $stockItem = $objectManager->create(Item::class); + $stockItem->load($product->getId(), 'product_id'); + + if (!$stockItem->getProductId()) { + $stockItem->setProductId($product->getId()); + } + $stockItem->setUseConfigManageStock(1); + $stockItem->setQty(1000); + $stockItem->setIsQtyDecimal(0); + $stockItem->setIsInStock(1); + $stockItem->save(); + + $attribute1Values[] = [ + 'label' => 'test1', + 'attribute_id' => $attribute->getId(), + 'value_index' => $option1->getValue(), + ]; + $attribute2Values[] = [ + 'label' => 'test2', + 'attribute_id' => $attribute2->getId(), + 'value_index' => $option2->getValue(), + ]; + $associatedProductIds[] = $product->getId(); + $index2++; + } + $index1++; +} + +/** @var $product Product */ +$product = $objectManager->create(Product::class); + +/** @var Factory $optionsFactory */ +$optionsFactory = $objectManager->create(Factory::class); + +$configurableAttributesData = [ + [ + 'attribute_id' => $attribute->getId(), + 'code' => $attribute->getAttributeCode(), + 'label' => $attribute->getStoreLabel(), + 'position' => '0', + 'values' => $attribute1Values, + ], + [ + 'attribute_id' => $attribute2->getId(), + 'code' => $attribute2->getAttributeCode(), + 'label' => $attribute2->getStoreLabel(), + 'position' => '1', + 'values' => $attribute2Values, + ], +]; + +$configurableOptions = $optionsFactory->create($configurableAttributesData); + +$extensionConfigurableAttributes = $product->getExtensionAttributes(); +$extensionConfigurableAttributes->setConfigurableProductOptions($configurableOptions); +$extensionConfigurableAttributes->setConfigurableProductLinks($associatedProductIds); + +$product->setExtensionAttributes($extensionConfigurableAttributes); + +$product->setTypeId(Configurable::TYPE_CODE) + ->setAttributeSetId($attributeSetId) + ->setWebsiteIds([1]) + ->setName('configurable with 2 opts') + ->setSku('configurable_with_2_opts') + ->setVisibility(Visibility::VISIBILITY_BOTH) + ->setStatus(Status::STATUS_ENABLED) + ->setStockData(['use_config_manage_stock' => 1, 'is_in_stock' => 1]); + +$productRepository->save($product); + +/** @var CategoryLinkManagementInterface $categoryLinkManagement */ +$categoryLinkManagement = $objectManager->create(CategoryLinkManagementInterface::class); + +$categoryLinkManagement->assignProductToCategories( + $product->getSku(), + [2] +); + +/** @var Converter $converter */ +$converter = $objectManager->create(Converter::class); +$document = new DOMDocument(); +$document->load(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'requests.xml'); +$requestConfig = $converter->convert($document); +/** @var Config $config */ +$config = $objectManager->get(Config::class); +$config->merge($requestConfig); diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/product_configurable_two_options_rollback.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/product_configurable_two_options_rollback.php new file mode 100644 index 0000000000000..4bb2ea4fa8178 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/product_configurable_two_options_rollback.php @@ -0,0 +1,49 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\CatalogInventory\Model\Stock\Status; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Registry; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); + +/** @var Registry $registry */ +$registry = $objectManager->get(Registry::class); + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); + +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->get(ProductRepositoryInterface::class); +$list = [ + 'configurable2_option_11', + 'configurable2_option_12', + 'configurable2_option_21', + 'configurable2_option_22', + 'configurable_with_2_opts' +]; + +foreach ($list as $sku) { + try { + $product = $productRepository->get($sku, true); + + $stockStatus = $objectManager->create(Status::class); + $stockStatus->load($product->getEntityId(), 'product_id'); + $stockStatus->delete(); + + $productRepository->delete($product); + } catch (NoSuchEntityException $e) { + //Product already removed + } +} + +require __DIR__ . '/../../../Magento/ConfigurableProduct/_files/configurable_attribute_rollback.php'; +require __DIR__ . '/../../../Magento/ConfigurableProduct/_files/configurable_attribute_2_rollback.php'; + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/requests.xml b/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/requests.xml new file mode 100644 index 0000000000000..660aa36cc291d --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/requests.xml @@ -0,0 +1,38 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<requests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Search/etc/search_request_merged.xsd"> + <request query="filter_by_configurable_product_options" index="catalogsearch_fulltext"> + <dimensions> + <dimension name="scope" value="default"/> + </dimensions> + <queries> + <query xsi:type="boolQuery" name="filter_by_configurable_product_options" boost="1"> + <queryReference clause="must" ref="category"/> + <queryReference clause="must" ref="test_configurable"/> + <queryReference clause="must" ref="test_configurable_2"/> + </query> + <query xsi:type="filteredQuery" name="category"> + <filterReference clause="must" ref="category_filter"/> + </query> + <query xsi:type="filteredQuery" name="test_configurable"> + <filterReference clause="must" ref="test_configurable_filter"/> + </query> + <query xsi:type="filteredQuery" name="test_configurable_2"> + <filterReference clause="must" ref="test_configurable_2_filter"/> + </query> + </queries> + <filters> + <filter xsi:type="termFilter" name="category_filter" field="category_ids" value="$category_ids$"/> + <filter xsi:type="termFilter" name="test_configurable_filter" field="test_configurable" value="$test_configurable$"/> + <filter xsi:type="termFilter" name="test_configurable_2_filter" field="test_configurable_2" value="$test_configurable_2$"/> + </filters> + <aggregations/> + <from>0</from> + <size>10</size> + </request> +</requests> From 2860283bd1797bab573925501964712e0c177ed8 Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <nazarn96@gmail.com> Date: Mon, 6 Jan 2020 11:29:20 +0200 Subject: [PATCH 545/586] Cover changes with unit test --- .../Theme/Test/Unit/Block/Html/PagerTest.php | 109 ++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 app/code/Magento/Theme/Test/Unit/Block/Html/PagerTest.php diff --git a/app/code/Magento/Theme/Test/Unit/Block/Html/PagerTest.php b/app/code/Magento/Theme/Test/Unit/Block/Html/PagerTest.php new file mode 100644 index 0000000000000..79a06e64479c7 --- /dev/null +++ b/app/code/Magento/Theme/Test/Unit/Block/Html/PagerTest.php @@ -0,0 +1,109 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Theme\Test\Unit\Block\Html; + +use Magento\Framework\App\Config; +use Magento\Framework\Data\Collection; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Framework\UrlInterface; +use Magento\Framework\View\Element\Template\Context; +use Magento\Theme\Block\Html\Pager; +use PHPUnit\Framework\TestCase; + +/** + * Test For Page class + */ +class PagerTest extends TestCase +{ + + /** + * @var Pager $pager + */ + private $pager; + + /** + * @var Context $context + */ + private $context; + + /** + * @var Config $scopeConfig + */ + private $scopeConfig; + + /** + * @var ObjectManager $objectManager + */ + private $objectManager; + + /** + * @var UrlInterface $urlBuilderMock + */ + private $urlBuilderMock; + + /** + * @inheritdoc + */ + protected function setUp() + { + $this->context = $this->createMock(Context::class); + $this->urlBuilderMock = $this->createMock(UrlInterface::class); + $this->context->expects($this->any()) + ->method('getUrlBuilder') + ->willReturn($this->urlBuilderMock); + $this->scopeConfig = $this->createMock(Config::class); + $this->pager = (new ObjectManager($this))->getObject( + Pager::class, + ['context' => $this->context] + ); + } + + /** + * Verify current page Url + * + * @return void + */ + public function testGetPageUrl(): void + { + $expectedPageUrl = 'page-url'; + $this->urlBuilderMock->expects($this->once()) + ->method('getUrl') + ->willReturn($expectedPageUrl); + $this->assertEquals($expectedPageUrl, $this->pager->getPageUrl(0)); + } + + /** + * Verify get pages method. + * + * @return void + */ + public function testGetPages(): void + { + $expectedPages = range(1, 5); + $collectionMock = $this->createMock(Collection::class); + $collectionMock->expects($this->exactly(2)) + ->method('getCurPage') + ->willReturn(2); + $collectionMock->expects($this->any()) + ->method('getLastPageNumber') + ->willReturn(10); + $this->setCollectionProperty($collectionMock); + $this->assertEquals($expectedPages, $this->pager->getPages()); + } + + /** + * Set Collection + * + * @return void + */ + private function setCollectionProperty($collection): void + { + $reflection = new \ReflectionClass($this->pager); + $reflection_property = $reflection->getProperty('_collection'); + $reflection_property->setAccessible(true); + $reflection_property->setValue($this->pager, $collection); + } +} From 9c4991a5828b34c98e753ecc62dda592a6ff54fc Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <nazarn96@gmail.com> Date: Mon, 6 Jan 2020 11:51:45 +0200 Subject: [PATCH 546/586] fix static test --- app/code/Magento/Theme/Test/Unit/Block/Html/PagerTest.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/code/Magento/Theme/Test/Unit/Block/Html/PagerTest.php b/app/code/Magento/Theme/Test/Unit/Block/Html/PagerTest.php index 79a06e64479c7..2fa1c637f1838 100644 --- a/app/code/Magento/Theme/Test/Unit/Block/Html/PagerTest.php +++ b/app/code/Magento/Theme/Test/Unit/Block/Html/PagerTest.php @@ -34,11 +34,6 @@ class PagerTest extends TestCase */ private $scopeConfig; - /** - * @var ObjectManager $objectManager - */ - private $objectManager; - /** * @var UrlInterface $urlBuilderMock */ From d05e25bdd421321dff3da3576d0b63c18141728e Mon Sep 17 00:00:00 2001 From: Myroslav Dobra <dmaraptor@gmail.com> Date: Mon, 6 Jan 2020 12:22:43 +0200 Subject: [PATCH 547/586] MC-30224: [2.4] Deleting an empty user model caused deleting admin role --- .../Magento/User/Model/ResourceModel/User.php | 20 ++++++------ .../User/Model/ResourceModel/UserTest.php | 31 ++++++++++++++++++- 2 files changed, 41 insertions(+), 10 deletions(-) diff --git a/app/code/Magento/User/Model/ResourceModel/User.php b/app/code/Magento/User/Model/ResourceModel/User.php index 4eaf6116056dd..b5927bbe4cef0 100644 --- a/app/code/Magento/User/Model/ResourceModel/User.php +++ b/app/code/Magento/User/Model/ResourceModel/User.php @@ -258,15 +258,17 @@ public function delete(\Magento\Framework\Model\AbstractModel $user) $uid = $user->getId(); $connection->beginTransaction(); - try { - $connection->delete($this->getMainTable(), ['user_id = ?' => $uid]); - $connection->delete( - $this->getTable('authorization_role'), - ['user_id = ?' => $uid, 'user_type = ?' => UserContextInterface::USER_TYPE_ADMIN] - ); - } catch (\Magento\Framework\Exception\LocalizedException $e) { - $connection->rollBack(); - return false; + if ($uid) { + try { + $connection->delete($this->getMainTable(), ['user_id = ?' => $uid]); + $connection->delete( + $this->getTable('authorization_role'), + ['user_id = ?' => $uid, 'user_type = ?' => UserContextInterface::USER_TYPE_ADMIN] + ); + } catch (\Magento\Framework\Exception\LocalizedException $e) { + $connection->rollBack(); + return false; + } } $connection->commit(); $this->_afterDelete($user); diff --git a/dev/tests/integration/testsuite/Magento/User/Model/ResourceModel/UserTest.php b/dev/tests/integration/testsuite/Magento/User/Model/ResourceModel/UserTest.php index 53a0b748c32f6..d9f11b3d2f08e 100644 --- a/dev/tests/integration/testsuite/Magento/User/Model/ResourceModel/UserTest.php +++ b/dev/tests/integration/testsuite/Magento/User/Model/ResourceModel/UserTest.php @@ -5,9 +5,11 @@ */ namespace Magento\User\Model\ResourceModel; +use Magento\Authorization\Model\ResourceModel\Role\Collection as UserRoleCollection; +use Magento\Authorization\Model\UserContextInterface; use Magento\TestFramework\Helper\Bootstrap; -use Magento\User\Model\User; use Magento\User\Model\ResourceModel\User as UserResourceModel; +use Magento\User\Model\User; /** * @magentoAppArea adminhtml @@ -46,6 +48,33 @@ public function testGetLatestPasswordWhenZeroPasswordLifetime() ); } + /** + * Test that user role is not deleted after deleting empty user + */ + public function testDelete() + { + $this->checkRoleCollectionSize(); + /** @var User $user */ + $user = Bootstrap::getObjectManager()->create( + User::class + ); + $this->model->delete($user); + $this->checkRoleCollectionSize(); + } + + /** + * Ensure that role collection size is correct + */ + private function checkRoleCollectionSize() + { + /** @var UserRoleCollection $roleCollection */ + $roleCollection = Bootstrap::getObjectManager()->create( + UserRoleCollection::class + ); + $roleCollection->setUserFilter(0, UserContextInterface::USER_TYPE_ADMIN); + $this->assertEquals(1, $roleCollection->getSize()); + } + public function testCountAll() { $this->assertSame(1, $this->model->countAll()); From e3b7d351c962624e85f8946fbf35b474d64e408a Mon Sep 17 00:00:00 2001 From: Nikita Shcherbatykh <nikita.shcherbatykh@transoftgroup.com> Date: Mon, 6 Jan 2020 13:29:43 +0200 Subject: [PATCH 548/586] MC-29946: [On Prem] - When transaction is declined, no default shipping / billing gets set after entering another card --- .../Model/ResourceModel/Address/Relation.php | 66 ++++++++++++---- .../ResourceModel/AddressRepositoryTest.php | 78 ++++++++++++++----- 2 files changed, 107 insertions(+), 37 deletions(-) diff --git a/app/code/Magento/Customer/Model/ResourceModel/Address/Relation.php b/app/code/Magento/Customer/Model/ResourceModel/Address/Relation.php index ae342a1b10dd8..cf837e2924161 100644 --- a/app/code/Magento/Customer/Model/ResourceModel/Address/Relation.php +++ b/app/code/Magento/Customer/Model/ResourceModel/Address/Relation.php @@ -1,14 +1,18 @@ <?php /** - * Customer address entity resource model - * * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Customer\Model\ResourceModel\Address; +use Magento\Customer\Api\Data\CustomerInterface; use Magento\Customer\Model\Address; use Magento\Customer\Model\Customer; +use Magento\Customer\Model\CustomerFactory; +use Magento\Customer\Model\CustomerRegistry; +use Magento\Framework\Model\AbstractModel; use Magento\Framework\Model\ResourceModel\Db\VersionControl\RelationInterface; /** @@ -17,29 +21,36 @@ class Relation implements RelationInterface { /** - * @var \Magento\Customer\Model\CustomerFactory + * @var CustomerFactory */ protected $customerFactory; /** - * @param \Magento\Customer\Model\CustomerFactory $customerFactory + * @var CustomerRegistry */ - public function __construct(\Magento\Customer\Model\CustomerFactory $customerFactory) - { + private $customerRegistry; + + /** + * @param CustomerFactory $customerFactory + * @param CustomerRegistry $customerRegistry + */ + public function __construct( + CustomerFactory $customerFactory, + CustomerRegistry $customerRegistry + ) { $this->customerFactory = $customerFactory; + $this->customerRegistry = $customerRegistry; } /** * Process object relations * - * @param \Magento\Framework\Model\AbstractModel $object + * @param AbstractModel $object * @return void */ - public function processRelation(\Magento\Framework\Model\AbstractModel $object) + public function processRelation(AbstractModel $object): void { - /** - * @var $object Address - */ + /** @var $object Address */ if (!$object->getIsCustomerSaveTransaction() && $object->getId()) { $customer = $this->customerFactory->create()->load($object->getCustomerId()); @@ -53,6 +64,7 @@ public function processRelation(\Magento\Framework\Model\AbstractModel $object) $changedAddresses, $customer->getResource()->getConnection()->quoteInto('entity_id = ?', $customer->getId()) ); + $this->updateCustomerRegistry($customer, $changedAddresses); } } } @@ -71,12 +83,12 @@ private function getDefaultBillingChangedAddress( array $changedAddresses ): array { if ($object->getIsDefaultBilling()) { - $changedAddresses['default_billing'] = $object->getId(); + $changedAddresses[CustomerInterface::DEFAULT_BILLING] = $object->getId(); } elseif ($customer->getDefaultBillingAddress() && $object->getIsDefaultBilling() === false && (int)$customer->getDefaultBillingAddress()->getId() === (int)$object->getId() ) { - $changedAddresses['default_billing'] = null; + $changedAddresses[CustomerInterface::DEFAULT_BILLING] = null; } return $changedAddresses; @@ -96,27 +108,47 @@ private function getDefaultShippingChangedAddress( array $changedAddresses ): array { if ($object->getIsDefaultShipping()) { - $changedAddresses['default_shipping'] = $object->getId(); + $changedAddresses[CustomerInterface::DEFAULT_SHIPPING] = $object->getId(); } elseif ($customer->getDefaultShippingAddress() && $object->getIsDefaultShipping() === false && (int)$customer->getDefaultShippingAddress()->getId() === (int)$object->getId() ) { - $changedAddresses['default_shipping'] = null; + $changedAddresses[CustomerInterface::DEFAULT_SHIPPING] = null; } return $changedAddresses; } + /** + * Push updated customer entity to the registry. + * + * @param Customer $customer + * @param array $changedAddresses + * @return void + */ + private function updateCustomerRegistry(Customer $customer, array $changedAddresses): void + { + if (array_key_exists(CustomerInterface::DEFAULT_BILLING, $changedAddresses)) { + $customer->setDefaultBilling($changedAddresses[CustomerInterface::DEFAULT_BILLING]); + } + + if (array_key_exists(CustomerInterface::DEFAULT_SHIPPING, $changedAddresses)) { + $customer->setDefaultShipping($changedAddresses[CustomerInterface::DEFAULT_SHIPPING]); + } + + $this->customerRegistry->push($customer); + } + /** * Checks if address has chosen as default and has had an id * * @deprecated Is not used anymore due to changes in logic of save of address. * If address was default and becomes not default than default address id for customer must be * set to null - * @param \Magento\Framework\Model\AbstractModel $object + * @param AbstractModel $object * @return bool */ - protected function isAddressDefault(\Magento\Framework\Model\AbstractModel $object) + protected function isAddressDefault(AbstractModel $object) { return $object->getId() && ($object->getIsDefaultBilling() || $object->getIsDefaultShipping()); } diff --git a/dev/tests/integration/testsuite/Magento/Customer/Model/ResourceModel/AddressRepositoryTest.php b/dev/tests/integration/testsuite/Magento/Customer/Model/ResourceModel/AddressRepositoryTest.php index 299d09d9400de..fb88a66423e65 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Model/ResourceModel/AddressRepositoryTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Model/ResourceModel/AddressRepositoryTest.php @@ -40,6 +40,8 @@ class AddressRepositoryTest extends \PHPUnit\Framework\TestCase /** @var \Magento\Framework\Api\DataObjectHelper */ private $dataObjectHelper; + private $customerRegistry; + /** * Set up. */ @@ -56,6 +58,7 @@ protected function setUp() \Magento\Customer\Api\Data\AddressInterfaceFactory::class ); $this->dataObjectHelper = $this->objectManager->create(\Magento\Framework\Api\DataObjectHelper::class); + $this->customerRegistry = $this->objectManager->get(\Magento\Customer\Model\CustomerRegistry::class); $regionFactory = $this->objectManager->get(RegionInterfaceFactory::class); $region = $regionFactory->create() @@ -96,10 +99,7 @@ protected function setUp() */ protected function tearDown() { - $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var \Magento\Customer\Model\CustomerRegistry $customerRegistry */ - $customerRegistry = $objectManager->get(\Magento\Customer\Model\CustomerRegistry::class); - $customerRegistry->remove(1); + $this->customerRegistry->remove(1); } /** @@ -506,6 +506,60 @@ public function testSaveAddressWithRestrictedCountries() self::assertNotEmpty($saved->getId()); } + /** + * Test for saving address with extra spaces in phone. + * + * @magentoDataFixture Magento/Customer/_files/customer.php + * @magentoDataFixture Magento/Customer/_files/customer_address.php + */ + public function testSaveNewAddressWithExtraSpacesInPhone() + { + $proposedAddress = $this->_createSecondAddress() + ->setCustomerId(1) + ->setTelephone(' 123456 '); + $returnedAddress = $this->repository->save($proposedAddress); + $savedAddress = $this->repository->getById($returnedAddress->getId()); + $this->assertEquals('123456', $savedAddress->getTelephone()); + } + + /** + * Scenario for customer's default shipping and billing address saving and rollback. + * + * @magentoDataFixture Magento/Customer/_files/customer_without_addresses.php + */ + public function testCustomerAddressRelationSynchronisation() + { + /** + * Creating new address which is default shipping and billing for existing customer. + */ + $address = $this->expectedAddresses[0]; + $address->setId(null); + $address->setCustomerId(1); + $address->setIsDefaultShipping(true); + $address->setIsDefaultBilling(true); + $savedAddress = $this->repository->save($address); + + /** + * Customer registry should be updated with default shipping and billing addresses. + */ + $customer = $this->getCustomer('customer@example.com', 1); + $this->assertEquals($savedAddress->getId(), $customer->getDefaultShipping()); + $this->assertEquals($savedAddress->getId(), $customer->getDefaultBilling()); + + /** + * Registry should be clean up for reading data from DB. + */ + $this->repository->deleteById($savedAddress->getId()); + $this->customerRegistry->removeByEmail('customer@example.com'); + + /** + * Customer's default shipping and billing addresses should be updated. + */ + $customer = $this->getCustomer('customer@example.com', 1); + $this->assertNull($customer->getDefaultShipping()); + $this->assertNull($customer->getDefaultBilling()); + } + /** * Helper function that returns an Address Data Object that matches the data from customer_address fixture * @@ -571,20 +625,4 @@ private function getWebsite(string $code): WebsiteInterface $repository = $this->objectManager->get(WebsiteRepositoryInterface::class); return $repository->get($code); } - - /** - * Test for saving address with extra spaces in phone. - * - * @magentoDataFixture Magento/Customer/_files/customer.php - * @magentoDataFixture Magento/Customer/_files/customer_address.php - */ - public function testSaveNewAddressWithExtraSpacesInPhone() - { - $proposedAddress = $this->_createSecondAddress() - ->setCustomerId(1) - ->setTelephone(' 123456 '); - $returnedAddress = $this->repository->save($proposedAddress); - $savedAddress = $this->repository->getById($returnedAddress->getId()); - $this->assertEquals('123456', $savedAddress->getTelephone()); - } } From cfd7771232d328da6c5ed6903b53984e06b027e7 Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <nazarn96@gmail.com> Date: Mon, 6 Jan 2020 15:37:41 +0200 Subject: [PATCH 549/586] Cover changes with unit test --- .../Test/Unit/Model/Config/StructureTest.php | 128 ++++++++++++++---- .../Unit/Model/_files/converted_config.php | 14 +- 2 files changed, 108 insertions(+), 34 deletions(-) diff --git a/app/code/Magento/Config/Test/Unit/Model/Config/StructureTest.php b/app/code/Magento/Config/Test/Unit/Model/Config/StructureTest.php index a17faf8f35883..93f143b99a42d 100644 --- a/app/code/Magento/Config/Test/Unit/Model/Config/StructureTest.php +++ b/app/code/Magento/Config/Test/Unit/Model/Config/StructureTest.php @@ -50,6 +50,9 @@ class StructureTest extends \PHPUnit\Framework\TestCase */ protected $_structureData; + /** + * @inheritdoc + */ protected function setUp() { $this->_flyweightFactory = $this->getMockBuilder(FlyweightFactory::class) @@ -82,7 +85,12 @@ protected function setUp() ); } - public function testGetTabsBuildsSectionTree() + /** + * Verify tabs build section tree + * + * @return void + */ + public function testGetTabsBuildsSectionTree(): void { $expected = ['tab1' => ['children' => ['section1' => ['tab' => 'tab1']]]]; @@ -108,7 +116,12 @@ public function testGetTabsBuildsSectionTree() $this->assertEquals($this->_tabIteratorMock, $model->getTabs()); } - public function testGetSectionList() + /** + * Verify get section list method + * + * @return void + */ + public function testGetSectionList(): void { $expected = [ 'section1_child_id_1' => true, @@ -152,6 +165,8 @@ public function testGetSectionList() } /** + * Verify Get Element return empty element if element is requested + * * @param string $path * @param string $expectedType * @param string $expectedId @@ -174,6 +189,8 @@ public function testGetElementReturnsEmptyElementIfNotExistingElementIsRequested } /** + * Verify get Element return empty by path element if not exist + * * @param string $path * @param string $expectedType * @param string $expectedId @@ -196,6 +213,8 @@ public function testGetElementReturnsEmptyByConfigPathElementIfNotExistingElemen } /** + * Verify Element return e,pty element if not exists + * * @param string $expectedType * @param string $expectedId * @param string $expectedPath @@ -234,14 +253,24 @@ public function emptyElementDataProvider() ]; } - public function testGetElementReturnsProperElementByPath() + /** + * Verify get element returns proper element by path + * + * @return void + */ + public function testGetElementReturnsProperElementByPath(): void { $elementMock = $this->getElementPathReturnsProperElementByPath(); $this->assertEquals($elementMock, $this->_model->getElement('section_1/group_level_1/field_3')); } - public function testGetElementByConfigPathReturnsProperElementByPath() + /** + * Verify get element by config path return proper path + * + * @return void + */ + public function testGetElementByConfigPathReturnsProperElementByPath(): void { $elementMock = $this->getElementPathReturnsProperElementByPath(); @@ -249,6 +278,8 @@ public function testGetElementByConfigPathReturnsProperElementByPath() } /** + * Build mock element + * * @return Mock */ private function getElementPathReturnsProperElementByPath() @@ -271,7 +302,12 @@ private function getElementPathReturnsProperElementByPath() return $elementMock; } - public function testGetElementByPathPartsIfSectionDataIsEmpty() + /** + * Verefy get element by path part + * + * @return void + */ + public function testGetElementByPathPartsIfSectionDataIsEmpty(): void { $fieldData = [ 'id' => 'field_3', @@ -342,7 +378,12 @@ public function testGetFirstSectionReturnsFirstAllowedSection() $this->assertEquals('currentSection', $this->_model->getFirstSection()->getData()); } - public function testGetElementReturnsProperElementByPathCachesObject() + /** + * Verify get element return element by path caches object + * + * @return void + */ + public function testGetElementReturnsProperElementByPathCachesObject(): void { $elementMock = $this->getElementReturnsProperElementByPathCachesObject(); @@ -350,7 +391,12 @@ public function testGetElementReturnsProperElementByPathCachesObject() $this->assertEquals($elementMock, $this->_model->getElement('section_1/group_level_1/field_3')); } - public function testGetElementByConfigPathReturnsProperElementByPathCachesObject() + /** + * Verify Get Element by id returns proper element + * + * @return void + */ + public function testGetElementByConfigPathReturnsProperElementByPathCachesObject(): void { $elementMock = $this->getElementReturnsProperElementByPathCachesObject(); @@ -393,6 +439,8 @@ public function testGetFieldPathsByAttribute($attributeName, $attributeValue, $p } /** + * DataProvider + * * @return array */ public function getFieldPathsByAttributeDataProvider() @@ -411,33 +459,53 @@ public function getFieldPathsByAttributeDataProvider() ]; } - public function testGetFieldPaths() + /** + * Verify get Fields paths method + * + * @dataProvider getFieldPaths + * @param array $expected + * @return void + */ + public function testGetFieldPaths(array $expected): void { - $expected = [ - 'section/group/field2' => [ - 'field_2' - ], - 'field_3' => [ - 'field_3', - 'field_3' - ], - 'field_3_1' => [ - 'field_3_1' - ], - 'field_3_1_1' => [ - 'field_3_1_1' - ], - 'section/group/field4' => [ - 'field_4', - ], - 'field_5' => [ - 'field_5', - ], - ]; - $this->assertSame( $expected, $this->_model->getFieldPaths() ); } + + /** + * dataprovider for Field Paths + * + * @return array + */ + public function getFieldPaths(): array + { + return [ + [ + [ + 'section/group/field2' => [ + 'field_2' + ], + 'field_3' => [ + 'field_3', + 'field_3' + ], + 'field_3_1' => [ + 'field_3_1' + ], + 'field_3_1_1' => [ + 'field_3_1_1' + ], + 'section/group/field4' => [ + 'field_4', + ], + 'field_5' => [ + 'field_5', + ], + 'section_3' => ['section_3'] + ] + ] + ]; + } } diff --git a/app/code/Magento/Config/Test/Unit/Model/_files/converted_config.php b/app/code/Magento/Config/Test/Unit/Model/_files/converted_config.php index ef2447338dc07..8f4b152e4dcd1 100644 --- a/app/code/Magento/Config/Test/Unit/Model/_files/converted_config.php +++ b/app/code/Magento/Config/Test/Unit/Model/_files/converted_config.php @@ -76,7 +76,7 @@ 'translate' => 'label', 'showInWebsite' => '1', 'backend_model' => - \Magento\Config\Model\Config\Backend\Encrypted::class, + \Magento\Config\Model\Config\Backend\Encrypted::class, 'type' => 'text', 'label' => 'Field 3.1.1', '_elementType' => 'field', @@ -158,14 +158,14 @@ ], '_elementType' => 'field', ], - 'field_5' => [ + 'field_5' => [ 'id' => 'field_5', 'translate' => 'label', 'showInWebsite' => '1', 'type' => 'text', 'label' => '', '_elementType' => 'field', - ], + ], ], '_elementType' => 'group', ], @@ -190,7 +190,13 @@ ], '_elementType' => 'section', ], - ], + 'section_3' => [ + 'id' => 'section_3', + 'type' => 'text', + 'tab' => 'tab_1', + '_elementType' => 'field' + ], + ], ], ], ]; From 5e6c59522154c4c72db3d6f2472869bf33657cd8 Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <nazarn96@gmail.com> Date: Mon, 6 Jan 2020 15:58:44 +0200 Subject: [PATCH 550/586] Static test fix --- .../Config/Test/Unit/Model/_files/converted_config.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Config/Test/Unit/Model/_files/converted_config.php b/app/code/Magento/Config/Test/Unit/Model/_files/converted_config.php index 8f4b152e4dcd1..54fd5719c4881 100644 --- a/app/code/Magento/Config/Test/Unit/Model/_files/converted_config.php +++ b/app/code/Magento/Config/Test/Unit/Model/_files/converted_config.php @@ -75,8 +75,7 @@ 'id' => 'field_3_1_1', 'translate' => 'label', 'showInWebsite' => '1', - 'backend_model' => - \Magento\Config\Model\Config\Backend\Encrypted::class, + 'backend_model' => \Magento\Config\Model\Config\Backend\Encrypted::class, 'type' => 'text', 'label' => 'Field 3.1.1', '_elementType' => 'field', @@ -196,7 +195,7 @@ 'tab' => 'tab_1', '_elementType' => 'field' ], - ], + ], ], ], ]; From b60c0dc35da998d2fac96fe340d26f72c4bcdf13 Mon Sep 17 00:00:00 2001 From: Lukasz Bajsarowicz <lukasz.bajsarowicz@gmail.com> Date: Mon, 6 Jan 2020 15:06:40 +0100 Subject: [PATCH 551/586] Update app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckPaginationInStorefrontTest.xml Co-Authored-By: Ihor Sviziev <ihor-sviziev@users.noreply.github.com> --- .../Test/Mftf/Test/AdminCheckPaginationInStorefrontTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckPaginationInStorefrontTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckPaginationInStorefrontTest.xml index 6eb7b7ea456b3..668a4e096c83d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckPaginationInStorefrontTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckPaginationInStorefrontTest.xml @@ -115,7 +115,7 @@ <click selector="{{CatalogProductsSection.resetFilter}}" stepKey="clickOnResetFilter"/> <waitForPageLoad stepKey="waitForPageToLoad3"/> <selectOption selector="{{AdminProductGridFilterSection.productPerPage}}" userInput="30" stepKey="selectPagePerView"/> - <waitForPageLoad stepKey="waitFroPageToLoad1" time="30"/> + <waitForPageLoad stepKey="waitForPageToLoad1" time="30"/> <fillField selector="{{AdminCategoryContentSection.productTableColumnName}}" userInput="pagi" stepKey="selectProduct1"/> <click selector="{{AdminCategoryContentSection.productSearch}}" stepKey="clickSearchButton"/> <waitForPageLoad stepKey="waitFroPageToLoad2"/> From ff1aa7e5f0a37bf13c9c466c50297843bd949d47 Mon Sep 17 00:00:00 2001 From: Nikita Shcherbatykh <nikita.shcherbatykh@transoftgroup.com> Date: Mon, 6 Jan 2020 16:44:06 +0200 Subject: [PATCH 552/586] MC-29804: [Magento Cloud] JsFooterPlugin.php Bug --- app/code/Magento/Theme/Controller/Result/JsFooterPlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Theme/Controller/Result/JsFooterPlugin.php b/app/code/Magento/Theme/Controller/Result/JsFooterPlugin.php index 317ab39d307cd..6a80dec460660 100644 --- a/app/code/Magento/Theme/Controller/Result/JsFooterPlugin.php +++ b/app/code/Magento/Theme/Controller/Result/JsFooterPlugin.php @@ -41,7 +41,7 @@ public function beforeSendResponse(Http $subject) { $content = $subject->getContent(); $script = []; - if (strpos($content, '</body') !== false) { + if (is_string($content) && strpos($content, '</body') !== false) { if ($this->scopeConfig->isSetFlag( self::XML_PATH_DEV_MOVE_JS_TO_BOTTOM, ScopeInterface::SCOPE_STORE From f563d2c9f33055291db7ae1ae33d14dde8862154 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Mon, 6 Jan 2020 16:33:29 +0100 Subject: [PATCH 553/586] Fix duplicated stepKey after typo fix --- .../Test/Mftf/Test/AdminCheckPaginationInStorefrontTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckPaginationInStorefrontTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckPaginationInStorefrontTest.xml index 668a4e096c83d..5bb9cc8a080df 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckPaginationInStorefrontTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckPaginationInStorefrontTest.xml @@ -115,7 +115,7 @@ <click selector="{{CatalogProductsSection.resetFilter}}" stepKey="clickOnResetFilter"/> <waitForPageLoad stepKey="waitForPageToLoad3"/> <selectOption selector="{{AdminProductGridFilterSection.productPerPage}}" userInput="30" stepKey="selectPagePerView"/> - <waitForPageLoad stepKey="waitForPageToLoad1" time="30"/> + <waitForPageLoad stepKey="waitForPageToLoadProductPerPage" time="30"/> <fillField selector="{{AdminCategoryContentSection.productTableColumnName}}" userInput="pagi" stepKey="selectProduct1"/> <click selector="{{AdminCategoryContentSection.productSearch}}" stepKey="clickSearchButton"/> <waitForPageLoad stepKey="waitFroPageToLoad2"/> From 327acbc9ee945a85cfd3a0862bd5462747bb6e94 Mon Sep 17 00:00:00 2001 From: Daniel Renaud <drenaud@magento.com> Date: Mon, 6 Jan 2020 09:39:08 -0600 Subject: [PATCH 554/586] MC-25215: [Forwardport] [GraphQL] Row_id is used as id for product resolver - Fix static failure --- .../testsuite/Magento/GraphQl/Bundle/BundleProductViewTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/BundleProductViewTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/BundleProductViewTest.php index e7d939bc76c37..4c58241590540 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/BundleProductViewTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/BundleProductViewTest.php @@ -15,7 +15,7 @@ use Magento\TestFramework\TestCase\GraphQlAbstract; /** - * Bundle product view test + * Test querying Bundle products */ class BundleProductViewTest extends GraphQlAbstract { From 7079ff504290e8e3017ea7363357209c06780790 Mon Sep 17 00:00:00 2001 From: Daniel Renaud <drenaud@magento.com> Date: Mon, 6 Jan 2020 12:20:13 -0600 Subject: [PATCH 555/586] MC-29135: [Forwardport] Throw GraphQL input exception when provided store is not enabled --- .../HttpRequestValidator/StoreValidator.php | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/StoreGraphQl/Controller/HttpRequestValidator/StoreValidator.php b/app/code/Magento/StoreGraphQl/Controller/HttpRequestValidator/StoreValidator.php index 3d41c975e591a..5d0a4edd44b73 100644 --- a/app/code/Magento/StoreGraphQl/Controller/HttpRequestValidator/StoreValidator.php +++ b/app/code/Magento/StoreGraphQl/Controller/HttpRequestValidator/StoreValidator.php @@ -42,14 +42,30 @@ public function validate(HttpRequestInterface $request): void { $headerValue = $request->getHeader('Store'); if (!empty($headerValue)) { - $storeCode = ltrim(rtrim($headerValue)); - $stores = $this->storeManager->getStores(false, true); - if ((!isset($stores[$storeCode]) && strtolower($storeCode) !== 'default') - || !$stores[$storeCode]->getIsActive() - ) { + $storeCode = trim($headerValue); + if (!$this->isStoreActive($storeCode)) { $this->storeManager->setCurrentStore(null); throw new GraphQlInputException(__('Requested store is not found')); } } } + + /** + * Check if provided store code corresponds to an active store + * + * @param string $storeCode + * @return bool + */ + private function isStoreActive(string $storeCode): bool + { + $stores = $this->storeManager->getStores(false, true); + if (strtolower($storeCode) === 'default') { + return true; + } + if (isset($stores[$storeCode])) { + return (bool)$stores[$storeCode]->getIsActive(); + } + + return false; + } } From 571900ac97dfbf7222ca75e4f487047f2823621e Mon Sep 17 00:00:00 2001 From: Dan Mooney <dmooney@adobe.com> Date: Mon, 6 Jan 2020 13:37:34 -0600 Subject: [PATCH 556/586] B2B-286: Order search across websites - Fix AdminReorderWithCatalogPriceTest; this test uses the order ID and not its increment ID as is expected by the filter grid - Disable company config in StorefrontVerifyOrdersVisibleInCompanyStructureAcrossMultipleWebsites --- .../Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml index d0502b41e2856..4c7c8b163a38c 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml @@ -52,10 +52,9 @@ </after> <!-- Login as admin --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <!--Open order by Id--> - <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrderById"> - <argument name="orderId" value="$createGuestCart.return$"/> - </actionGroup> + <!--Open order page by Id--> + <amOnPage url="{{AdminOrderPage.url($createGuestCart.return$)}}" stepKey="navigateToOrderPage"/> + <waitForPageLoad stepKey="waitForCreatedOrderPage"/> <!--Reorder--> <click selector="{{AdminOrderDetailsMainActionsSection.reorder}}" stepKey="clickReorder"/> <!--Verify order item row--> From 243c9df89e1a8b0fc410678e43fdc045e6759305 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Mon, 6 Jan 2020 16:01:52 -0600 Subject: [PATCH 557/586] Fix code style --- lib/internal/Magento/Framework/App/Bootstrap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/App/Bootstrap.php b/lib/internal/Magento/Framework/App/Bootstrap.php index e98631ec4adbd..cb86552489472 100644 --- a/lib/internal/Magento/Framework/App/Bootstrap.php +++ b/lib/internal/Magento/Framework/App/Bootstrap.php @@ -225,7 +225,7 @@ public function getParams() * * @param string $type * @param array $arguments - * @return \Magento\Framework\AppInterface + * @return \Magento\Framework\AppInterface | void * @throws \InvalidArgumentException */ public function createApplication($type, $arguments = []) From ae280acd2e87aebfa3bb8cb66fe6a940fa057035 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Tue, 7 Jan 2020 00:52:58 +0100 Subject: [PATCH 558/586] HOTFIX: Invalid use of OpenOrderById (used `entity_id` instead of `increment_id`) --- .../AdminOpenOrderByEntityIdActionGroup.xml | 17 +++++++++++++++++ .../Test/AdminReorderWithCatalogPriceTest.xml | 4 ++-- 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOpenOrderByEntityIdActionGroup.xml diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOpenOrderByEntityIdActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOpenOrderByEntityIdActionGroup.xml new file mode 100644 index 0000000000000..c1beb0ee9790a --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOpenOrderByEntityIdActionGroup.xml @@ -0,0 +1,17 @@ +<?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="AdminOpenOrderByEntityIdActionGroup"> + <arguments> + <argument name="entityId" type="string"/> + </arguments> + <amOnPage url="{{AdminOrderPage.url(entityId)}}" stepKey="openOrder"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml index d0502b41e2856..64974a1c357e4 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml @@ -53,8 +53,8 @@ <!-- Login as admin --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!--Open order by Id--> - <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrderById"> - <argument name="orderId" value="$createGuestCart.return$"/> + <actionGroup ref="AdminOpenOrderByEntityIdActionGroup" stepKey="openOrderById"> + <argument name="entityId" value="$createGuestCart.return$"/> </actionGroup> <!--Reorder--> <click selector="{{AdminOrderDetailsMainActionsSection.reorder}}" stepKey="clickReorder"/> From 557247fcd9c55119dcf97bc4804366aefe2274b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chitesh=40wagento=2Ecom=E2=80=9D?= <hitesh@wagento.com> Date: Tue, 7 Jan 2020 16:21:00 +0530 Subject: [PATCH 559/586] [Fixed Jump Datepicker issue in Catalog Price Rule] --- .../backend/web/css/source/components/_calendar-temp.less | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/design/adminhtml/Magento/backend/web/css/source/components/_calendar-temp.less b/app/design/adminhtml/Magento/backend/web/css/source/components/_calendar-temp.less index 11b187db3d1e4..3ed4ac91d32a4 100644 --- a/app/design/adminhtml/Magento/backend/web/css/source/components/_calendar-temp.less +++ b/app/design/adminhtml/Magento/backend/web/css/source/components/_calendar-temp.less @@ -47,10 +47,6 @@ vertical-align: top; z-index: 1; - &:active { - .scale(.975); - } - + .admin__control-support-text, + .admin__control-label { margin-left: @action__height + .5rem; From 040b212001a285bd1261f550bae1aab76acd5582 Mon Sep 17 00:00:00 2001 From: Iryna Lagno <ilagno@adobe.com> Date: Tue, 7 Jan 2020 11:44:17 -0600 Subject: [PATCH 560/586] MC-30257: Price of a Bundle Product is calculated incorrectly at the product page --- .../Bundle/view/base/web/js/price-bundle.js | 42 ++++++++--- .../Catalog/view/base/web/js/price-box.js | 1 + .../Bundle/base/js/price-bundle.test.js | 73 +++++++++++++++++++ 3 files changed, 104 insertions(+), 12 deletions(-) create mode 100644 dev/tests/js/jasmine/tests/app/code/Magento/Bundle/base/js/price-bundle.test.js diff --git a/app/code/Magento/Bundle/view/base/web/js/price-bundle.js b/app/code/Magento/Bundle/view/base/web/js/price-bundle.js index 49ee253ad1e88..207a97c270eeb 100644 --- a/app/code/Magento/Bundle/view/base/web/js/price-bundle.js +++ b/app/code/Magento/Bundle/view/base/web/js/price-bundle.js @@ -28,7 +28,8 @@ define([ controlContainer: 'dd', // should be eliminated priceFormat: {}, isFixedPrice: false, - optionTierPricesBlocksSelector: '#option-tier-prices-{1} [data-role="selection-tier-prices"]' + optionTierPricesBlocksSelector: '#option-tier-prices-{1} [data-role="selection-tier-prices"]', + isOptionsInitialized: false }; $.widget('mage.priceBundle', { @@ -53,20 +54,37 @@ define([ priceBox = $(this.options.priceBoxSelector, form), qty = $(this.options.qtyFieldSelector, form); - if (priceBox.data('magePriceBox') && - priceBox.priceBox('option') && - priceBox.priceBox('option').priceConfig - ) { - if (priceBox.priceBox('option').priceConfig.optionTemplate) { - this._setOption('optionTemplate', priceBox.priceBox('option').priceConfig.optionTemplate); + this._updatePriceBox(); + priceBox.on('price-box-initialized', this._updatePriceBox.bind(this)); + options.on('change', this._onBundleOptionChanged.bind(this)); + qty.on('change', this._onQtyFieldChanged.bind(this)); + }, + + /** + * Update price box config with bundle option prices + * @private + */ + _updatePriceBox: function () { + var form = this.element, + options = $(this.options.productBundleSelector, form), + priceBox = $(this.options.priceBoxSelector, form); + + if (!this.options.isOptionsInitialized) { + if (priceBox.data('magePriceBox') && + priceBox.priceBox('option') && + priceBox.priceBox('option').priceConfig + ) { + if (priceBox.priceBox('option').priceConfig.optionTemplate) { //eslint-disable-line max-depth + this._setOption('optionTemplate', priceBox.priceBox('option').priceConfig.optionTemplate); + } + this._setOption('priceFormat', priceBox.priceBox('option').priceConfig.priceFormat); + priceBox.priceBox('setDefault', this.options.optionConfig.prices); + this.options.isOptionsInitialized = true; } - this._setOption('priceFormat', priceBox.priceBox('option').priceConfig.priceFormat); - priceBox.priceBox('setDefault', this.options.optionConfig.prices); + this._applyOptionNodeFix(options); } - this._applyOptionNodeFix(options); - options.on('change', this._onBundleOptionChanged.bind(this)); - qty.on('change', this._onQtyFieldChanged.bind(this)); + return this; }, /** diff --git a/app/code/Magento/Catalog/view/base/web/js/price-box.js b/app/code/Magento/Catalog/view/base/web/js/price-box.js index 02ae6eadef672..6ca7f24b90c36 100644 --- a/app/code/Magento/Catalog/view/base/web/js/price-box.js +++ b/app/code/Magento/Catalog/view/base/web/js/price-box.js @@ -49,6 +49,7 @@ define([ box.on('reloadPrice', this.reloadPrice.bind(this)); box.on('updatePrice', this.onUpdatePrice.bind(this)); + box.trigger('price-box-initialized'); }, /** diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Bundle/base/js/price-bundle.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Bundle/base/js/price-bundle.test.js new file mode 100644 index 0000000000000..04dd5a9b51407 --- /dev/null +++ b/dev/tests/js/jasmine/tests/app/code/Magento/Bundle/base/js/price-bundle.test.js @@ -0,0 +1,73 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +define([ + 'jquery', + 'Magento_Bundle/js/price-bundle', + 'Magento_Catalog/js/price-box' +], function ($) { + 'use strict'; + + describe('Magento_Bundle/js/price-bundle', function () { + + var htmlContainer; + + beforeEach(function () { + htmlContainer = $('<div class="price-final_price" data-role="priceBox"><ul class="price-box"></ul></div>'); + }); + + afterEach(function () { + htmlContainer.remove(); + }); + + it('Widget extends jQuery object.', function () { + expect($.fn.priceBundle).toBeDefined(); + }); + + it('Check _updatePriceBox method call.', function () { + + spyOn($.mage.priceBundle.prototype, '_updatePriceBox'); + + htmlContainer.priceBundle(); + + expect($.mage.priceBundle.prototype._updatePriceBox).toEqual(jasmine.any(Function)); + expect($.mage.priceBundle.prototype._updatePriceBox).toHaveBeenCalledTimes(1); + }); + + it('Check _updatePriceBox method call after priceBox was initialized.', function () { + spyOn($.mage.priceBundle.prototype, '_updatePriceBox').and.callThrough(); + htmlContainer.priceBundle(); + $('.price-box', htmlContainer).priceBox(); + expect($.mage.priceBundle.prototype._updatePriceBox).toEqual(jasmine.any(Function)); + expect($.mage.priceBundle.prototype._updatePriceBox).toHaveBeenCalledTimes(2); + }); + + it('Check _applyOptionNodeFix method doesn\'t call after priceBox initialization.', function () { + var optionConfig = { + optionConfig: { + prices: {} + } + }, + priceConfig = { + priceConfig: 10 + }; + + spyOn($.mage.priceBundle.prototype, '_applyOptionNodeFix').and.callThrough(); + htmlContainer.priceBundle(optionConfig); + $('.price-box', htmlContainer).priceBox(priceConfig); + $('.price-box', htmlContainer).trigger('price-box-initialized'); + expect($.mage.priceBundle.prototype._applyOptionNodeFix).toEqual(jasmine.any(Function)); + expect($.mage.priceBundle.prototype._applyOptionNodeFix).toHaveBeenCalledTimes(2); + }); + + it('Check _updatePriceBox method call before priceBox was initialized.', function () { + spyOn($.mage.priceBundle.prototype, '_updatePriceBox').and.callThrough(); + $('.price-box', htmlContainer).priceBox(); + htmlContainer.priceBundle(); + expect($.mage.priceBundle.prototype._updatePriceBox).toEqual(jasmine.any(Function)); + expect($.mage.priceBundle.prototype._updatePriceBox).toHaveBeenCalledTimes(1); + }); + }); +}); From f30a06a6695f590f261953d2b576efcb1ce512a3 Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <nazarn96@gmail.com> Date: Tue, 7 Jan 2020 21:05:30 +0200 Subject: [PATCH 561/586] Refactoring config fixtures --- .../Test/Unit/Model/Config/StructureTest.php | 4 +-- .../Unit/Model/_files/converted_config.php | 26 ++++++++++++++++--- .../Test/Unit/Model/_files/system_2.xml | 6 +++++ 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Config/Test/Unit/Model/Config/StructureTest.php b/app/code/Magento/Config/Test/Unit/Model/Config/StructureTest.php index 93f143b99a42d..57e57fcd2503f 100644 --- a/app/code/Magento/Config/Test/Unit/Model/Config/StructureTest.php +++ b/app/code/Magento/Config/Test/Unit/Model/Config/StructureTest.php @@ -502,8 +502,8 @@ public function getFieldPaths(): array ], 'field_5' => [ 'field_5', - ], - 'section_3' => ['section_3'] + 'field_5' + ] ] ] ]; diff --git a/app/code/Magento/Config/Test/Unit/Model/_files/converted_config.php b/app/code/Magento/Config/Test/Unit/Model/_files/converted_config.php index 54fd5719c4881..ed6cc868f8d08 100644 --- a/app/code/Magento/Config/Test/Unit/Model/_files/converted_config.php +++ b/app/code/Magento/Config/Test/Unit/Model/_files/converted_config.php @@ -75,7 +75,8 @@ 'id' => 'field_3_1_1', 'translate' => 'label', 'showInWebsite' => '1', - 'backend_model' => \Magento\Config\Model\Config\Backend\Encrypted::class, + 'backend_model' => + \Magento\Config\Model\Config\Backend\Encrypted::class, 'type' => 'text', 'label' => 'Field 3.1.1', '_elementType' => 'field', @@ -192,9 +193,26 @@ 'section_3' => [ 'id' => 'section_3', 'type' => 'text', - 'tab' => 'tab_1', - '_elementType' => 'field' - ], + '_elementType' => 'section', + 'children' => [ + 'group_5' => [ + 'id' => 'group_5', + 'type' => 'text', + 'showInDefault' => 1, + 'showInWebsite' => 1, + 'showInStore' => 1, + '_elementType' => 'group', + 'children' => [ + 'field_5' => [ + 'id' => 'field_5', + 'showInWebsite' => '1', + 'type' => 'text', + '_elementType' => 'field', + ] + ] + ] + ] + ] ], ], ], diff --git a/app/code/Magento/Config/Test/Unit/Model/_files/system_2.xml b/app/code/Magento/Config/Test/Unit/Model/_files/system_2.xml index c4001f47ced0b..715d7cf4e8a61 100644 --- a/app/code/Magento/Config/Test/Unit/Model/_files/system_2.xml +++ b/app/code/Magento/Config/Test/Unit/Model/_files/system_2.xml @@ -86,5 +86,11 @@ </depends> </group> </section> + <section id="section_3" type="text"> + <group id="group_5" type="text" showInDefault="1" showInWebsite="1" showInStore="1"> + <field id="field_5" showInWebsite="1" type="text"> + </field> + </group> + </section> </system> </config> From 36dd5acf9db8b2a19568468a461c8f19fa8d6876 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Tue, 7 Jan 2020 14:52:59 -0600 Subject: [PATCH 562/586] Replace inheritdoc with full declaration --- .../Magento/Catalog/Model/Product/Option.php | 91 +++++++++++++++---- 1 file changed, 71 insertions(+), 20 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Product/Option.php b/app/code/Magento/Catalog/Model/Product/Option.php index ca5251de13e69..128f420e033c2 100644 --- a/app/code/Magento/Catalog/Model/Product/Option.php +++ b/app/code/Magento/Catalog/Model/Product/Option.php @@ -205,7 +205,10 @@ public function __construct( } /** - * @inheritdoc + * Get resource instance + * + * @return \Magento\Framework\Model\ResourceModel\Db\AbstractDb + * @deprecated 101.1.0 because resource models should be used directly */ protected function _getResource() { @@ -570,7 +573,9 @@ public function getSearchableData($productId, $storeId) } /** - * @inheritdoc + * Clearing object's data + * + * @return $this */ protected function _clearData() { @@ -580,7 +585,9 @@ protected function _clearData() } /** - * @inheritdoc + * Clearing cyclic references + * + * @return $this */ protected function _clearReferences() { @@ -601,7 +608,9 @@ protected function _getValidationRulesBeforeSave() } /** - * @inheritdoc + * Get product SKU + * + * @return string */ public function getProductSku() { @@ -613,7 +622,9 @@ public function getProductSku() } /** - * @inheritdoc + * Get option id + * + * @return int|null * @codeCoverageIgnoreStart */ public function getOptionId() @@ -622,7 +633,9 @@ public function getOptionId() } /** - * @inheritdoc + * Get option title + * + * @return string */ public function getTitle() { @@ -630,7 +643,9 @@ public function getTitle() } /** - * @inheritdoc + * Get option type + * + * @return string */ public function getType() { @@ -638,7 +653,9 @@ public function getType() } /** - * @inheritdoc + * Get sort order + * + * @return int */ public function getSortOrder() { @@ -646,7 +663,10 @@ public function getSortOrder() } /** - * @inheritdoc + * Get is require + * + * @return bool + * @SuppressWarnings(PHPMD.BooleanGetMethodName) */ public function getIsRequire() { @@ -654,7 +674,9 @@ public function getIsRequire() } /** - * @inheritdoc + * Get price type + * + * @return string|null */ public function getPriceType() { @@ -662,7 +684,9 @@ public function getPriceType() } /** - * @inheritdoc + * Get Sku + * + * @return string|null */ public function getSku() { @@ -710,7 +734,10 @@ public function getImageSizeY() } /** - * @inheritdoc + * Set product SKU + * + * @param string $productSku + * @return $this */ public function setProductSku($productSku) { @@ -718,7 +745,10 @@ public function setProductSku($productSku) } /** - * @inheritdoc + * Set option id + * + * @param int $optionId + * @return $this */ public function setOptionId($optionId) { @@ -726,7 +756,10 @@ public function setOptionId($optionId) } /** - * @inheritdoc + * Set option title + * + * @param string $title + * @return $this */ public function setTitle($title) { @@ -734,7 +767,10 @@ public function setTitle($title) } /** - * @inheritdoc + * Set option type + * + * @param string $type + * @return $this */ public function setType($type) { @@ -742,7 +778,10 @@ public function setType($type) } /** - * @inheritdoc + * Set sort order + * + * @param int $sortOrder + * @return $this */ public function setSortOrder($sortOrder) { @@ -750,7 +789,10 @@ public function setSortOrder($sortOrder) } /** - * @inheritdoc + * Set is require + * + * @param bool $isRequired + * @return $this */ public function setIsRequire($isRequired) { @@ -758,7 +800,10 @@ public function setIsRequire($isRequired) } /** - * @inheritdoc + * Set price + * + * @param float $price + * @return $this */ public function setPrice($price) { @@ -766,7 +811,10 @@ public function setPrice($price) } /** - * @inheritdoc + * Set price type + * + * @param string $priceType + * @return $this */ public function setPriceType($priceType) { @@ -774,7 +822,10 @@ public function setPriceType($priceType) } /** - * @inheritdoc + * Set Sku + * + * @param string $sku + * @return $this */ public function setSku($sku) { From 82cfc5e5cae032df86c44064673aea7e09d2533a Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Tue, 7 Jan 2020 14:55:16 -0600 Subject: [PATCH 563/586] Fix static --- app/code/Magento/Catalog/Model/Product/Option/Value.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Model/Product/Option/Value.php b/app/code/Magento/Catalog/Model/Product/Option/Value.php index fce39614248ca..da70c747806e1 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/Value.php +++ b/app/code/Magento/Catalog/Model/Product/Option/Value.php @@ -113,7 +113,7 @@ public function __construct( } /** - * @inheritDoc + * @return void */ protected function _construct() { From 7d8ab4c87cf37d8326117cb77d6889956752c685 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Tue, 7 Jan 2020 14:58:52 -0600 Subject: [PATCH 564/586] The test is broken --- .../lib/jquery/jstree/jquery.hotkeys.test.js | 77 ------------------- 1 file changed, 77 deletions(-) delete mode 100644 dev/tests/js/jasmine/tests/lib/jquery/jstree/jquery.hotkeys.test.js diff --git a/dev/tests/js/jasmine/tests/lib/jquery/jstree/jquery.hotkeys.test.js b/dev/tests/js/jasmine/tests/lib/jquery/jstree/jquery.hotkeys.test.js deleted file mode 100644 index 6041b70abc7f7..0000000000000 --- a/dev/tests/js/jasmine/tests/lib/jquery/jstree/jquery.hotkeys.test.js +++ /dev/null @@ -1,77 +0,0 @@ -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -define([ - 'jquery', - 'jquery/jstree/jquery.hotkeys' -], function ($) { - 'use strict'; - - describe('Test for jquery/jstree/jquery.hotkeys', function () { - var divElement = $('<div></div>'), - divBodyAfterTrigger = 'pressed', - inputNumberElement = $('<input type="number">'); - - beforeAll(function () { - /** - * Insert text to the divElement - */ - var addHtmlToDivElement = function () { - divElement.html(divBodyAfterTrigger); - }; - - $(document).bind('keyup', 'right', addHtmlToDivElement); - $(document).bind('keyup', 'left', addHtmlToDivElement); - - }); - - beforeEach(function () { - inputNumberElement.appendTo(document.body); - divElement.appendTo(document.body); - }); - - afterEach(function () { - divElement.remove(); - inputNumberElement.remove(); - }); - - it('Check "left key" hotkey is not being processed when number input is focused', function () { - var keypress = $.Event('keyup'); - - keypress.which = 37; // "left arrow" key - inputNumberElement.trigger(keypress); - - expect(divElement.html()).toEqual(''); - }); - - it('Check "right key" hotkey is not being processed when number input is focused', function () { - var keypress = $.Event('keyup'); - - keypress.which = 39; // "right arrow" key - inputNumberElement.trigger(keypress); - - expect(divElement.html()).toEqual(''); - }); - - it('Check "left key" hotkey is being processed when registered on the page', function () { - var keypress = $.Event('keyup'); - - keypress.which = 37; // "left arrow" key - divElement.trigger(keypress); - - expect(divElement.html()).toEqual(divBodyAfterTrigger); - }); - - it('Check "right key" hotkey is being processed when registered on the page', function () { - var keypress = $.Event('keyup'); - - keypress.which = 39; // "right arrow" key - $('body').trigger(keypress); - - expect(divElement.html()).toEqual(divBodyAfterTrigger); - }); - - }); -}); From d86c358e68cfc466067fcdc7ee5ecf604888fea3 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Tue, 7 Jan 2020 16:24:58 -0600 Subject: [PATCH 565/586] Fix static --- app/code/Magento/Catalog/Model/Product/Option/Value.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/Magento/Catalog/Model/Product/Option/Value.php b/app/code/Magento/Catalog/Model/Product/Option/Value.php index da70c747806e1..783bda4699792 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/Value.php +++ b/app/code/Magento/Catalog/Model/Product/Option/Value.php @@ -113,6 +113,8 @@ public function __construct( } /** + * Override parent _construct method + * * @return void */ protected function _construct() From 5d0e12bd42e1c19b718f2e22f246db039e015520 Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Wed, 8 Jan 2020 09:26:02 +0200 Subject: [PATCH 566/586] Adjusting the Unit Test --- .../Listing/Column/GroupActionsTest.php | 112 ++++++++++++++---- 1 file changed, 86 insertions(+), 26 deletions(-) diff --git a/app/code/Magento/Customer/Test/Unit/Ui/Component/Listing/Column/GroupActionsTest.php b/app/code/Magento/Customer/Test/Unit/Ui/Component/Listing/Column/GroupActionsTest.php index 51cf0e5395b47..02cacea5c2601 100644 --- a/app/code/Magento/Customer/Test/Unit/Ui/Component/Listing/Column/GroupActionsTest.php +++ b/app/code/Magento/Customer/Test/Unit/Ui/Component/Listing/Column/GroupActionsTest.php @@ -22,6 +22,36 @@ */ class GroupActionsTest extends TestCase { + /** + * @var int + */ + private const STUB_NOT_LOGGED_IN_CUSTOMER_GROUP_ID = 0; + + /** + * @var string + */ + private const STUB_NOT_LOGGED_IN_CUSTOMER_GROUP_NAME = 'Not Logged In'; + + /** + * @var int + */ + private const STUB_GENERAL_CUSTOMER_GROUP_ID = 1; + + /** + * @var string + */ + private const STUB_GENERAL_CUSTOMER_GROUP_NAME = 'General'; + + /** + * @var string + */ + private const STUB_GROUP_EDIT_URL = 'http://magento.com/customer/group/edit'; + + /** + * @var string + */ + private const STUB_GROUP_DELETE_URL = 'http://magento.com/customer/group/delete'; + /** * @var GroupActions */ @@ -97,7 +127,6 @@ public function setUp() */ public function testPrepareDataSourceWithNonDefaultGroup(array $items, bool $isDefaultGroup, array $expected) { - $customerGroup = 'General'; $dataSource = [ 'data' => [ 'items' => $items @@ -111,18 +140,29 @@ public function testPrepareDataSourceWithNonDefaultGroup(array $items, bool $isD $this->groupManagementMock->expects($this->any()) ->method('isReadonly') - ->with(1) + ->with(static::STUB_GENERAL_CUSTOMER_GROUP_ID) ->willReturn($isDefaultGroup); $this->escaperMock->expects($this->any()) ->method('escapeHtml') - ->with($customerGroup) - ->willReturn($customerGroup); + ->with(static::STUB_GENERAL_CUSTOMER_GROUP_NAME) + ->willReturn(static::STUB_GENERAL_CUSTOMER_GROUP_NAME); $this->urlBuilderMock->expects($this->any()) ->method('getUrl') ->willReturnMap( [ - ['customer/group/edit', ['id' => 1], 'http://magento.com/customer/group/edit'], - ['customer/group/delete', ['id' => 1], 'http://magento.com/customer/group/delete'] + [ + 'customer/group/edit', + [ + 'id' => static::STUB_GENERAL_CUSTOMER_GROUP_ID + ], + static::STUB_GROUP_EDIT_URL], + [ + 'customer/group/delete', + [ + 'id' => static::STUB_GENERAL_CUSTOMER_GROUP_ID + ], + static::STUB_GROUP_DELETE_URL + ] ] ); @@ -142,12 +182,12 @@ public function testPrepareDataSourceWithDefaultGroup() 'data' => [ 'items' => [ [ - 'customer_group_id' => 1, - 'customer_group_code' => 'General', + 'customer_group_id' => static::STUB_GENERAL_CUSTOMER_GROUP_ID, + 'customer_group_code' => static::STUB_GENERAL_CUSTOMER_GROUP_NAME, ], [ - 'customer_group_id' => 0, - 'customer_group_code' => 'Not Logged In', + 'customer_group_id' => static::STUB_NOT_LOGGED_IN_CUSTOMER_GROUP_ID, + 'customer_group_code' => static::STUB_NOT_LOGGED_IN_CUSTOMER_GROUP_NAME, ], ] ] @@ -156,22 +196,22 @@ public function testPrepareDataSourceWithDefaultGroup() 'data' => [ 'items' => [ [ - 'customer_group_id' => 1, - 'customer_group_code' => 'General', + 'customer_group_id' => static::STUB_GENERAL_CUSTOMER_GROUP_ID, + 'customer_group_code' => static::STUB_GENERAL_CUSTOMER_GROUP_NAME, 'name' => [ 'edit' => [ - 'href' => 'http://magento.com/customer/group/edit', + 'href' => static::STUB_GROUP_EDIT_URL, 'label' => __('Edit'), '__disableTmpl' => true, ] ] ], [ - 'customer_group_id' => 0, - 'customer_group_code' => 'Not Logged In', + 'customer_group_id' => static::STUB_NOT_LOGGED_IN_CUSTOMER_GROUP_ID, + 'customer_group_code' => static::STUB_NOT_LOGGED_IN_CUSTOMER_GROUP_NAME, 'name' => [ 'edit' => [ - 'href' => 'http://magento.com/customer/group/edit', + 'href' => static::STUB_GROUP_EDIT_URL, 'label' => __('Edit'), '__disableTmpl' => true, ] @@ -188,16 +228,36 @@ public function testPrepareDataSourceWithDefaultGroup() ->method('escapeHtml') ->willReturnMap( [ - ['General', null, 'General'], - ['Not Logged In', null, 'Not Logged In'] + [ + static::STUB_GENERAL_CUSTOMER_GROUP_NAME, + null, + static::STUB_GENERAL_CUSTOMER_GROUP_NAME + ], + [ + static::STUB_NOT_LOGGED_IN_CUSTOMER_GROUP_NAME, + null, + static::STUB_NOT_LOGGED_IN_CUSTOMER_GROUP_NAME + ] ] ); $this->urlBuilderMock->expects($this->any()) ->method('getUrl') ->willReturnMap( [ - ['customer/group/edit', ['id' => 1], 'http://magento.com/customer/group/edit'], - ['customer/group/edit', ['id' => 0], 'http://magento.com/customer/group/edit'] + [ + 'customer/group/edit', + [ + 'id' => static::STUB_GENERAL_CUSTOMER_GROUP_ID + ], + static::STUB_GROUP_EDIT_URL + ], + [ + 'customer/group/edit', + [ + 'id' => static::STUB_NOT_LOGGED_IN_CUSTOMER_GROUP_ID + ], + static::STUB_GROUP_EDIT_URL + ] ] ); @@ -216,23 +276,23 @@ public function customerGroupsDataProvider(): array [ [ [ - 'customer_group_id' => 1, - 'customer_group_code' => 'General', + 'customer_group_id' => static::STUB_GENERAL_CUSTOMER_GROUP_ID, + 'customer_group_code' => static::STUB_GENERAL_CUSTOMER_GROUP_NAME, ], ], false, [ [ - 'customer_group_id' => 1, - 'customer_group_code' => 'General', + 'customer_group_id' => static::STUB_GENERAL_CUSTOMER_GROUP_ID, + 'customer_group_code' => static::STUB_GENERAL_CUSTOMER_GROUP_NAME, 'name' => [ 'edit' => [ - 'href' => 'http://magento.com/customer/group/edit', + 'href' => static::STUB_GROUP_EDIT_URL, 'label' => __('Edit'), '__disableTmpl' => true, ], 'delete' => [ - 'href' => 'http://magento.com/customer/group/delete', + 'href' => static::STUB_GROUP_DELETE_URL, 'label' => __('Delete'), 'post' => true, '__disableTmpl' => true, From 3237e1840ed653333517922eade603b75efc53c1 Mon Sep 17 00:00:00 2001 From: Soumya Unnikrishnan <sunnikri@adobe.com> Date: Wed, 8 Jan 2020 13:38:42 -0600 Subject: [PATCH 567/586] MQE-1949: [MTF-to-MFTF] Delete Product URL Rewrite #757 Added test case ids and updated action group names. --- .../AddStoreViewToCmsPageActionGroup.xml | 2 +- .../AdminFillCMSPageContentFieldActionGroup.xml | 2 +- .../AdminOpenCreateNewCMSPageActionGroup.xml | 2 +- .../AdminSelectCMSPageFromGridActionGroup.xml | 2 +- ...ssertCMSPageNotFoundOnStorefrontActionGroup.xml | 2 +- .../Cms/Test/Mftf/Section/CmsNewPagePiwSection.xml | 2 +- .../Test/AdminCMSPageCreateDisabledPageTest.xml | 8 +++++--- .../AdminCMSPageCreatePageForDefaultStoreTest.xml | 12 +++++++----- ...AdminCMSPageCreatePageInSingleStoreModeTest.xml | 14 ++++++++------ .../Test/Mftf/Test/AdminCMSPageCreatePageTest.xml | 12 +++++++----- .../Test/AdminCMSPageCreatePageWithBlockTest.xml | 10 ++++++---- ...eateIntegrationEntityWithDuplicatedNameTest.xml | 2 ++ .../AdminDeleteProductURLRewriteEntityTest.xml | 3 +++ 13 files changed, 44 insertions(+), 29 deletions(-) diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AddStoreViewToCmsPageActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AddStoreViewToCmsPageActionGroup.xml index 505f3bebbf70c..fabf6480b174b 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AddStoreViewToCmsPageActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AddStoreViewToCmsPageActionGroup.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AddStoreViewToCmsPageActionGroup" extends="NavigateToCreatedCMSPageActionGroup"> <annotations> - <description>EXTENDS: navigateToCreatedCMSPage. Adds the provided Store View to a Page.</description> + <description>EXTENDS: NavigateToCreatedCMSPageActionGroup. Adds the provided Store View to a Page.</description> </annotations> <arguments> <argument name="storeViewName" type="string"/> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminFillCMSPageContentFieldActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminFillCMSPageContentFieldActionGroup.xml index 9bd440695ecf2..f62ee4a8a4ccd 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminFillCMSPageContentFieldActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminFillCMSPageContentFieldActionGroup.xml @@ -13,4 +13,4 @@ </arguments> <fillField selector="{{CmsNewPagePageContentSection.content}}" userInput="{{content}}" stepKey="fillFieldContent"/> </actionGroup> -</actionGroups> \ No newline at end of file +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminOpenCreateNewCMSPageActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminOpenCreateNewCMSPageActionGroup.xml index c9f97855be79d..79ce1bc9d8e47 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminOpenCreateNewCMSPageActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminOpenCreateNewCMSPageActionGroup.xml @@ -11,4 +11,4 @@ <amOnPage url="{{CmsNewPagePage.url}}" stepKey="navigateToCreateNewPage"/> <waitForPageLoad stepKey="waitForNewPagePageLoad"/> </actionGroup> -</actionGroups> \ No newline at end of file +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminSelectCMSPageFromGridActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminSelectCMSPageFromGridActionGroup.xml index 6a08b8fa89eef..bd721b4d7d40c 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminSelectCMSPageFromGridActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminSelectCMSPageFromGridActionGroup.xml @@ -13,4 +13,4 @@ </arguments> <click selector="{{CmsPagesPageActionsSection.select(identifier)}}" stepKey="clickSelectCMSPage" /> </actionGroup> -</actionGroups> \ No newline at end of file +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageNotFoundOnStorefrontActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageNotFoundOnStorefrontActionGroup.xml index bcffadc7c2b05..ff5724a55dec9 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageNotFoundOnStorefrontActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageNotFoundOnStorefrontActionGroup.xml @@ -15,4 +15,4 @@ <see userInput="Whoops, our bad..." stepKey="seePageErrorNotFound"/> </actionGroup> -</actionGroups> \ No newline at end of file +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/Section/CmsNewPagePiwSection.xml b/app/code/Magento/Cms/Test/Mftf/Section/CmsNewPagePiwSection.xml index cccdbaddfb4d2..7bb6e606d7943 100644 --- a/app/code/Magento/Cms/Test/Mftf/Section/CmsNewPagePiwSection.xml +++ b/app/code/Magento/Cms/Test/Mftf/Section/CmsNewPagePiwSection.xml @@ -13,4 +13,4 @@ <element name="selectStoreView" type="select" selector="//option[contains(text(),'{{var1}}')]" parameterized="true"/> <element name="storeIdDropdown" type="select" selector="//div[@data-bind="scope: 'cms_page_form.cms_page_form'"]//select[@name='store_id']"/> </section> -</sections> \ No newline at end of file +</sections> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreateDisabledPageTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreateDisabledPageTest.xml index dc40310b15191..b2def26279dc5 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreateDisabledPageTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreateDisabledPageTest.xml @@ -12,8 +12,10 @@ <features value="Cms"/> <title value="Create disabled CMS Page via the Admin"/> <description value="Admin should be able to create a CMS Page"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-14677"/> <group value="backend"/> - <group value="cMSContent"/> + <group value="Cms"/> <group value="mtf_migrated"/> </annotations> <before> @@ -29,7 +31,7 @@ <!--Fill the CMS page form--> <actionGroup ref="FillOutCMSPageContent" stepKey="fillBasicPageDataForDisabledPage"/> <!--Verify successfully saved--> - <actionGroup ref="saveCmsPage" stepKey="saveDisabledPage"/> + <actionGroup ref="SaveCmsPageActionGroup" stepKey="saveDisabledPage"/> <!--Check that page is disabled on frontend--> <actionGroup ref="StorefrontGoToCMSPageActionGroup" stepKey="goToCMSPageOnStorefront"> <argument name="identifier" value="{{_duplicatedCMSPage.identifier}}"/> @@ -40,4 +42,4 @@ <argument name="UrlKey" value="{{_duplicatedCMSPage.identifier}}"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageForDefaultStoreTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageForDefaultStoreTest.xml index eaab13202c89d..b381ae429ed2b 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageForDefaultStoreTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageForDefaultStoreTest.xml @@ -12,8 +12,10 @@ <features value="Cms"/> <title value="Create CMS Page via the Admin for default store"/> <description value="Admin should be able to create a CMS Page"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-14676"/> <group value="backend"/> - <group value="cMSContent"/> + <group value="Cms"/> <group value="mtf_migrated"/> </annotations> <before> @@ -30,13 +32,13 @@ <argument name="storeViewName" value="Default Store View"/> </actionGroup> <!--Verify successfully saved--> - <actionGroup ref="saveCmsPage" stepKey="savePageWithDefaultStore"/> + <actionGroup ref="SaveCmsPageActionGroup" stepKey="savePageWithDefaultStore"/> <!--Navigate to page in Admin--> - <actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCMSPageWithDefaultStoreInAdmin"> + <actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCMSPageWithDefaultStoreInAdmin"> <argument name="CMSPage" value="_duplicatedCMSPage"/> </actionGroup> <!--Verify Page Data in Admin--> - <actionGroup ref="AssertCMSPageContent" stepKey="verifyPageWithDefaultStoreDataInAdmin"/> + <actionGroup ref="AssertCMSPageContentActionGroup" stepKey="verifyPageWithDefaultStoreDataInAdmin"/> <!--Verify Store ID--> <actionGroup ref="AssertCMSPageStoreIdActionGroup" stepKey="verifyStoreId"> <argument name="storeId" value="1"/> @@ -46,4 +48,4 @@ <argument name="UrlKey" value="{{_duplicatedCMSPage.identifier}}"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageInSingleStoreModeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageInSingleStoreModeTest.xml index a550ce6f4a9c5..ef083ae61069d 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageInSingleStoreModeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageInSingleStoreModeTest.xml @@ -12,8 +12,10 @@ <features value="Cms"/> <title value="Create CMS Page via the Admin in single store mode"/> <description value="Admin should be able to create a CMS Page"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-14679"/> <group value="backend"/> - <group value="cMSContent"/> + <group value="Cms"/> <group value="mtf_migrated"/> </annotations> <before> @@ -29,25 +31,25 @@ <!--Fill the CMS page form--> <actionGroup ref="FillOutCMSPageContent" stepKey="fillBasicPageDataForPageWithDefaultStore"/> <!--Verify successfully saved--> - <actionGroup ref="saveCmsPage" stepKey="savePageInSingleStoreMode"/> + <actionGroup ref="SaveCmsPageActionGroup" stepKey="savePageInSingleStoreMode"/> <!--verify page on frontend--> <actionGroup ref="StorefrontGoToCMSPageActionGroup" stepKey="navigateToPageOnStoreFront"> <argument name="identifier" value="{{_duplicatedCMSPage.identifier}}"/> </actionGroup> - <actionGroup ref="AssertStoreFrontCMSPage" stepKey="verifyPageDataOnFrontend"> + <actionGroup ref="AssertStoreFrontCMSPageActionGroup" stepKey="verifyPageDataOnFrontend"> <argument name="cmsTitle" value="{{_duplicatedCMSPage.title}}"/> <argument name="cmsContent" value="{{_duplicatedCMSPage.content}}"/> <argument name="cmsContentHeading" value="{{_duplicatedCMSPage.content_heading}}"/> </actionGroup> <!--Navigate to page in Admin--> - <actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCMSPageInAdminInSingleStoreMode"> + <actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCMSPageInAdminInSingleStoreMode"> <argument name="CMSPage" value="_duplicatedCMSPage"/> </actionGroup> <!--Verify Page Data in Admin--> - <actionGroup ref="AssertCMSPageContent" stepKey="verifyPageDataInAdminInSingleStoreMode"/> + <actionGroup ref="AssertCMSPageContentActionGroup" stepKey="verifyPageDataInAdminInSingleStoreMode"/> <!--Delete page--> <actionGroup ref="DeletePageByUrlKeyActionGroup" stepKey="deletePageInSingleStoreMode"> <argument name="UrlKey" value="{{_duplicatedCMSPage.identifier}}"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageTest.xml index 4e1a5b5ed6422..536c7055c9932 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageTest.xml @@ -12,8 +12,10 @@ <features value="Cms"/> <title value="Create CMS Page via the Admin"/> <description value="Admin should be able to create a CMS Page"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-14675"/> <group value="backend"/> - <group value="cMSContent"/> + <group value="Cms"/> <group value="mtf_migrated"/> </annotations> <before> @@ -26,19 +28,19 @@ <actionGroup ref="AdminOpenCreateNewCMSPageActionGroup" stepKey="navigateToCreateNewPage"/> <actionGroup ref="FillOutCMSPageContent" stepKey="fillBasicPageData"/> <!--verify successfully saved--> - <actionGroup ref="saveCmsPage" stepKey="saveNewPage"/> + <actionGroup ref="SaveCmsPageActionGroup" stepKey="saveNewPage"/> <!--verify page on frontend--> <actionGroup ref="StorefrontGoToCMSPageActionGroup" stepKey="navigateToPageOnStoreFront"> <argument name="identifier" value="{{_duplicatedCMSPage.identifier}}"/> </actionGroup> - <actionGroup ref="AssertStoreFrontCMSPage" stepKey="verifyPageDataOnFrontend"> + <actionGroup ref="AssertStoreFrontCMSPageActionGroup" stepKey="verifyPageDataOnFrontend"> <argument name="cmsTitle" value="{{_duplicatedCMSPage.title}}"/> <argument name="cmsContent" value="{{_duplicatedCMSPage.content}}"/> <argument name="cmsContentHeading" value="{{_duplicatedCMSPage.content_heading}}"/> </actionGroup> <!--verify page in grid--> <actionGroup ref="AdminOpenCMSPagesGridActionGroup" stepKey="openCMSPagesGridActionGroup"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearGridFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearGridFilters"/> <actionGroup ref="SortByIdDescendingActionGroup" stepKey="sortGridByIdDescending"/> <actionGroup ref="AdminSelectCMSPageFromGridActionGroup" stepKey="verifyPageInGrid"> <argument name="identifier" value="_duplicatedCMSPage.identifier"/> @@ -47,4 +49,4 @@ <argument name="UrlKey" value="{{_duplicatedCMSPage.identifier}}"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageWithBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageWithBlockTest.xml index c4112111aa839..396507dddaca1 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageWithBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageWithBlockTest.xml @@ -12,8 +12,10 @@ <features value="Cms"/> <title value="Create CMS Page that contains block content via the Admin"/> <description value="Admin should be able to create a CMS Page"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-14678"/> <group value="backend"/> - <group value="cMSContent"/> + <group value="Cms"/> <group value="mtf_migrated"/> </annotations> <before> @@ -32,12 +34,12 @@ <argument name="storeViewName" value="Default Store View"/> </actionGroup> <!--Verify successfully saved--> - <actionGroup ref="saveCmsPage" stepKey="savePageWithBlock"/> + <actionGroup ref="SaveCmsPageActionGroup" stepKey="savePageWithBlock"/> <!--verify page on frontend--> <actionGroup ref="StorefrontGoToCMSPageActionGroup" stepKey="navigateToPageOnStoreFront"> <argument name="identifier" value="{{_duplicatedCMSPage.identifier}}"/> </actionGroup> - <actionGroup ref="AssertStoreFrontCMSPage" stepKey="verifyPageWithBlockDataOnFrontend"> + <actionGroup ref="AssertStoreFrontCMSPageActionGroup" stepKey="verifyPageWithBlockDataOnFrontend"> <argument name="cmsTitle" value="{{_duplicatedCMSPage.title}}"/> <argument name="cmsContent" value="bla bla bla"/> <argument name="cmsContentHeading" value="{{_duplicatedCMSPage.content_heading}}"/> @@ -47,4 +49,4 @@ <argument name="UrlKey" value="{{_duplicatedCMSPage.identifier}}"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Integration/Test/Mftf/Test/AdminCreateIntegrationEntityWithDuplicatedNameTest.xml b/app/code/Magento/Integration/Test/Mftf/Test/AdminCreateIntegrationEntityWithDuplicatedNameTest.xml index d1809cf909f9c..b23436d474ed8 100644 --- a/app/code/Magento/Integration/Test/Mftf/Test/AdminCreateIntegrationEntityWithDuplicatedNameTest.xml +++ b/app/code/Magento/Integration/Test/Mftf/Test/AdminCreateIntegrationEntityWithDuplicatedNameTest.xml @@ -14,6 +14,8 @@ <stories value="Creating System Integration With Duplicated Name"/> <title value="Admin System Integration With Duplicated Name"/> <description value="Admin Creates New Integration With Duplicated Name"/> + <severity value="MAJOR"/> + <testCaseId value="MC-19889"/> <group value="integration"/> <group value="mtf_migrated"/> </annotations> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteProductURLRewriteEntityTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteProductURLRewriteEntityTest.xml index f9c57a0c0bf4c..2becb177ee72b 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteProductURLRewriteEntityTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteProductURLRewriteEntityTest.xml @@ -12,6 +12,9 @@ <stories value="Delete Product UrlRewrite"/> <title value="Delete created product URL rewrite"/> <description value="Login as admin, create product with category and UrlRewrite, delete created URL rewrite"/> + <testCaseId value="MC-5347"/> + <severity value="MAJOR"/> + <group value="urlRewrite"/> <group value="mtf_migrated"/> </annotations> From 6aeeb2378d275c13409d5fe37ef29c2f8f28c50d Mon Sep 17 00:00:00 2001 From: Soumya Unnikrishnan <sunnikri@adobe.com> Date: Wed, 8 Jan 2020 14:50:05 -0600 Subject: [PATCH 568/586] MQE-1931: [MTF-To-MFTF] Process PR 718 Added test case ids and updated action group names --- .../Test/Mftf/Test/AdminCreateActiveHtmlTermEntityTest.xml | 4 ++-- .../Test/Mftf/Test/AdminCreateActiveTextTermEntityTest.xml | 4 ++-- .../Mftf/Test/AdminCreateDisabledTextTermEntityTest.xml | 4 ++-- .../AdminCreateEnabledTextTermOnMultishippingEntityTest.xml | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveHtmlTermEntityTest.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveHtmlTermEntityTest.xml index ed9f5959be9d4..3b180576b557c 100644 --- a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveHtmlTermEntityTest.xml +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveHtmlTermEntityTest.xml @@ -15,7 +15,7 @@ <title value="Create active HTML checkout agreement"/> <description value="Admin should be able to create active HTML checkout agreement"/> <severity value="CRITICAL"/> - <testCaseId value=""/> + <testCaseId value="MC-14668"/> <group value="checkoutAgreements"/> <group value="mtf_migrated"/> </annotations> @@ -39,7 +39,7 @@ <actionGroup ref="AdminAssertTermInGridActionGroup" stepKey="assertTermInGrid"> <argument name="termName" value="{{activeHtmlTerm.name}}"/> </actionGroup> - <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToTheCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToTheCart"> <argument name="product" value="$$createdProduct$$"/> </actionGroup> <actionGroup ref="StorefrontProcessCheckoutToPaymentActionGroup" stepKey="processCheckoutToThePaymentMethodsPage"/> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveTextTermEntityTest.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveTextTermEntityTest.xml index 2a95c44a6d4eb..9b2d3da9ece34 100644 --- a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveTextTermEntityTest.xml +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveTextTermEntityTest.xml @@ -15,7 +15,7 @@ <title value="Create active text checkout agreement"/> <description value="Admin should be able to create active text checkout agreement"/> <severity value="CRITICAL"/> - <testCaseId value=""/> + <testCaseId value="MC-14667"/> <group value="checkoutAgreements"/> <group value="mtf_migrated"/> </annotations> @@ -39,7 +39,7 @@ <actionGroup ref="AdminAssertTermInGridActionGroup" stepKey="assertTermInGrid"> <argument name="termName" value="{{activeTextTerm.name}}"/> </actionGroup> - <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToTheCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToTheCart"> <argument name="product" value="$$createdProduct$$"/> </actionGroup> <actionGroup ref="StorefrontProcessCheckoutToPaymentActionGroup" stepKey="processCheckoutToThePaymentMethodsPage"/> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateDisabledTextTermEntityTest.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateDisabledTextTermEntityTest.xml index d279d38f854d1..8a1efcdce85e1 100644 --- a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateDisabledTextTermEntityTest.xml +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateDisabledTextTermEntityTest.xml @@ -15,7 +15,7 @@ <title value="Create disabled text checkout agreement"/> <description value="Admin should be able to create disabled text checkout agreement"/> <severity value="CRITICAL"/> - <testCaseId value=""/> + <testCaseId value="MC-14669"/> <group value="checkoutAgreements"/> <group value="mtf_migrated"/> </annotations> @@ -39,7 +39,7 @@ <actionGroup ref="AdminAssertTermInGridActionGroup" stepKey="assertTermInGrid"> <argument name="termName" value="{{disabledTextTerm.name}}"/> </actionGroup> - <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToTheCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToTheCart"> <argument name="product" value="$$createdProduct$$"/> </actionGroup> <actionGroup ref="StorefrontProcessCheckoutToPaymentActionGroup" stepKey="processCheckoutToThePaymentMethodsPage"/> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateEnabledTextTermOnMultishippingEntityTest.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateEnabledTextTermOnMultishippingEntityTest.xml index e579d2653b44d..93e8e6a01d543 100644 --- a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateEnabledTextTermOnMultishippingEntityTest.xml +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateEnabledTextTermOnMultishippingEntityTest.xml @@ -15,7 +15,7 @@ <title value="Create enabled text checkout multishipping agreement"/> <description value="Admin should be able to create enabled text checkout multishipping agreement"/> <severity value="CRITICAL"/> - <testCaseId value=""/> + <testCaseId value="MC-14670"/> <group value="checkoutAgreements"/> <group value="mtf_migrated"/> </annotations> @@ -43,10 +43,10 @@ <actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLogin"> <argument name="Customer" value="$$createdCustomer$$" /> </actionGroup> - <actionGroup ref="AddSimpleProductToCart" stepKey="addProduct1ToTheCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProduct1ToTheCart"> <argument name="product" value="$$createdProduct1$$"/> </actionGroup> - <actionGroup ref="AddSimpleProductToCart" stepKey="addProduct2ToTheCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProduct2ToTheCart"> <argument name="product" value="$$createdProduct2$$"/> </actionGroup> <actionGroup ref="StorefrontAssertTermRequireMessageInMultishippingCheckoutActionGroup" stepKey="assertTermInCheckout"> From 7a7719177e279e68488631590238f7576b265da1 Mon Sep 17 00:00:00 2001 From: Soumya Unnikrishnan <sunnikri@adobe.com> Date: Wed, 8 Jan 2020 15:57:55 -0600 Subject: [PATCH 569/586] MQE-1920: [MTF-To-MFTF] Process PR 701 Added wait to fix jenkins failure --- .../Test/Mftf/ActionGroup/AdminOpenCMSPagesGridActionGroup.xml | 2 +- .../Test/Mftf/ActionGroup/FillOutCMSPageContentActionGroup.xml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminOpenCMSPagesGridActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminOpenCMSPagesGridActionGroup.xml index 1ae07d55f376d..fe2bf741c5bdc 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminOpenCMSPagesGridActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminOpenCMSPagesGridActionGroup.xml @@ -16,4 +16,4 @@ <amOnPage url="{{CmsPagesPage.url}}" stepKey="navigateToCMSPagesGrid"/> <waitForPageLoad stepKey="waitForPageLoad"/> </actionGroup> -</actionGroups> \ No newline at end of file +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/FillOutCMSPageContentActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/FillOutCMSPageContentActionGroup.xml index 3a0a2f3b75b55..1bf74ba206bbd 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/FillOutCMSPageContentActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/FillOutCMSPageContentActionGroup.xml @@ -15,8 +15,9 @@ <fillField selector="{{CmsNewPagePageBasicFieldsSection.pageTitle}}" userInput="{{_duplicatedCMSPage.title}}" stepKey="fillFieldTitle"/> <click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickExpandContentTabForPage"/> - <fillField selector="{{CmsNewPagePageContentSection.content}}" userInput="{{_duplicatedCMSPage.content}}" stepKey="fillFieldContent"/> + <waitForElementVisible selector="{{CmsNewPagePageContentSection.contentHeading}}" stepKey="waitForContentSection"/> <fillField selector="{{CmsNewPagePageContentSection.contentHeading}}" userInput="{{_duplicatedCMSPage.content_heading}}" stepKey="fillFieldContentHeading"/> + <fillField selector="{{CmsNewPagePageContentSection.content}}" userInput="{{_duplicatedCMSPage.content}}" stepKey="fillFieldContent"/> <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_duplicatedCMSPage.identifier}}" stepKey="fillFieldUrlKey"/> </actionGroup> From 631282eadb8e24cd752ab3ba91f3e74e91e2c0e0 Mon Sep 17 00:00:00 2001 From: Lena Orobei <oorobei@magento.com> Date: Wed, 8 Jan 2020 16:02:04 -0600 Subject: [PATCH 570/586] - added api-functional test for product fragment --- .../GraphQl/Catalog/ProductFragmentTest.php | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductFragmentTest.php diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductFragmentTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductFragmentTest.php new file mode 100644 index 0000000000000..32a2f8f763572 --- /dev/null +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductFragmentTest.php @@ -0,0 +1,54 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\GraphQl\Catalog; + +use Magento\TestFramework\TestCase\GraphQlAbstract; + +/** + * Test for simple product fragment. + */ +class ProductFragmentTest extends GraphQlAbstract +{ + /** + * @magentoApiDataFixture Magento/Catalog/_files/product_simple.php + */ + public function testSimpleProductFragment() + { + $sku = 'simple'; + $name = 'Simple Product'; + $price = 10; + + $query = <<<QUERY +query GetProduct { + products(filter: { sku: { eq: "$sku" } }) { + items { + sku + ...BasicProductInformation + } + } +} + +fragment BasicProductInformation on ProductInterface { + sku + name + price { + regularPrice { + amount { + value + } + } + } +} +QUERY; + $result = $this->graphQlQuery($query); + $actualProductData = $result['products']['items'][0]; + $this->assertNotEmpty($actualProductData); + $this->assertEquals($name, $actualProductData['name']); + $this->assertEquals($price, $actualProductData['price']['regularPrice']['amount']['value']); + } +} From d5fa89c0d9e1467246034eb9efe6d23ebd986966 Mon Sep 17 00:00:00 2001 From: Soumya Unnikrishnan <sunnikri@adobe.com> Date: Wed, 8 Jan 2020 18:59:03 -0600 Subject: [PATCH 571/586] MQE-1920: [MTF-To-MFTF] Process PR 701 Added wait to fix jenkins failure --- .../Test/Mftf/ActionGroup/FillOutCMSPageContentActionGroup.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/FillOutCMSPageContentActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/FillOutCMSPageContentActionGroup.xml index 1bf74ba206bbd..a4ffff5c8760a 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/FillOutCMSPageContentActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/FillOutCMSPageContentActionGroup.xml @@ -15,8 +15,8 @@ <fillField selector="{{CmsNewPagePageBasicFieldsSection.pageTitle}}" userInput="{{_duplicatedCMSPage.title}}" stepKey="fillFieldTitle"/> <click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickExpandContentTabForPage"/> - <waitForElementVisible selector="{{CmsNewPagePageContentSection.contentHeading}}" stepKey="waitForContentSection"/> <fillField selector="{{CmsNewPagePageContentSection.contentHeading}}" userInput="{{_duplicatedCMSPage.content_heading}}" stepKey="fillFieldContentHeading"/> + <wait time="5" stepKey="waitForTextAreaToAppear"/> <fillField selector="{{CmsNewPagePageContentSection.content}}" userInput="{{_duplicatedCMSPage.content}}" stepKey="fillFieldContent"/> <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_duplicatedCMSPage.identifier}}" stepKey="fillFieldUrlKey"/> From b2ac86ec5a841c7c1374cca9897aac5c856adb6d Mon Sep 17 00:00:00 2001 From: Nikita Shcherbatykh <nikita.shcherbatykh@transoftgroup.com> Date: Thu, 9 Jan 2020 10:55:07 +0200 Subject: [PATCH 572/586] MC-29960: [Magento Cloud] Unable to delete CSV files from Export Grid --- .../Component/Columns/ExportGridActions.php | 10 ++- .../DataProvider/ExportFileDataProvider.php | 33 ++++++++- .../Adminhtml/Export/File/DeleteTest.php | 58 +++++++++++++--- .../Adminhtml/Export/File/DownloadTest.php | 68 ++++++++++++++----- 4 files changed, 135 insertions(+), 34 deletions(-) diff --git a/app/code/Magento/ImportExport/Ui/Component/Columns/ExportGridActions.php b/app/code/Magento/ImportExport/Ui/Component/Columns/ExportGridActions.php index b5e36ccd9fbab..2cdc39866a521 100644 --- a/app/code/Magento/ImportExport/Ui/Component/Columns/ExportGridActions.php +++ b/app/code/Magento/ImportExport/Ui/Component/Columns/ExportGridActions.php @@ -56,11 +56,17 @@ public function prepareDataSource(array $dataSource) $name = $this->getData('name'); if (isset($item['file_name'])) { $item[$name]['view'] = [ - 'href' => $this->urlBuilder->getUrl(Download::URL, ['filename' => $item['file_name']]), + 'href' => $this->urlBuilder->getUrl( + Download::URL, + ['_query' => ['filename' => $item['file_name']]] + ), 'label' => __('Download') ]; $item[$name]['delete'] = [ - 'href' => $this->urlBuilder->getUrl(Delete::URL, ['filename' => $item['file_name']]), + 'href' => $this->urlBuilder->getUrl( + Delete::URL, + ['_query' => ['filename' => $item['file_name']]] + ), 'label' => __('Delete'), 'confirm' => [ 'title' => __('Delete'), diff --git a/app/code/Magento/ImportExport/Ui/DataProvider/ExportFileDataProvider.php b/app/code/Magento/ImportExport/Ui/DataProvider/ExportFileDataProvider.php index 83203f1ad8aff..57d1982d3500f 100644 --- a/app/code/Magento/ImportExport/Ui/DataProvider/ExportFileDataProvider.php +++ b/app/code/Magento/ImportExport/Ui/DataProvider/ExportFileDataProvider.php @@ -100,7 +100,7 @@ public function getData() } $result = []; foreach ($files as $file) { - $result['items'][]['file_name'] = $this->fileIO->getPathInfo($file)['basename']; + $result['items'][]['file_name'] = $this->getPathToExportFile($this->fileIO->getPathInfo($file)); } $pageSize = (int) $this->request->getParam('paging')['pageSize']; @@ -112,6 +112,31 @@ public function getData() return $result; } + /** + * Return relative export file path after "var/export" + * + * @param mixed $file + * @return string + */ + private function getPathToExportFile($file): string + { + $directory = $this->fileSystem->getDirectoryRead(DirectoryList::VAR_DIR); + $delimiter = '/'; + $cutPath = explode( + $delimiter, + $directory->getAbsolutePath() . 'export' + ); + $filePath = explode( + $delimiter, + $file['dirname'] + ); + + return ltrim( + implode($delimiter, array_diff($filePath, $cutPath)) . $delimiter . $file['basename'], + $delimiter + ); + } + /** * Get files from directory path, sort them by date modified and return sorted array of full path to files * @@ -127,8 +152,10 @@ private function getExportFiles(string $directoryPath): array return []; } foreach ($files as $filePath) { - //phpcs:ignore Magento2.Functions.DiscouragedFunction - $sortedFiles[filemtime($filePath)] = $filePath; + if ($this->file->isFile($filePath)) { + //phpcs:ignore Magento2.Functions.DiscouragedFunction + $sortedFiles[filemtime($filePath)] = $filePath; + } } //sort array elements using key value krsort($sortedFiles); diff --git a/dev/tests/integration/testsuite/Magento/ImportExport/Controller/Adminhtml/Export/File/DeleteTest.php b/dev/tests/integration/testsuite/Magento/ImportExport/Controller/Adminhtml/Export/File/DeleteTest.php index 91764684da173..6b1463aa1a9df 100644 --- a/dev/tests/integration/testsuite/Magento/ImportExport/Controller/Adminhtml/Export/File/DeleteTest.php +++ b/dev/tests/integration/testsuite/Magento/ImportExport/Controller/Adminhtml/Export/File/DeleteTest.php @@ -29,6 +29,16 @@ class DeleteTest extends AbstractBackendController */ private $fileName = 'catalog_product.csv'; + /** + * @var Filesystem + */ + private $fileSystem; + + /** + * @var string + */ + private $sourceFilePath; + /** * @inheritdoc */ @@ -36,35 +46,61 @@ protected function setUp() { parent::setUp(); - $filesystem = $this->_objectManager->get(Filesystem::class); - $sourceFilePath = __DIR__ . '/../../Import/_files' . DIRECTORY_SEPARATOR . $this->fileName; - $destinationFilePath = 'export' . DIRECTORY_SEPARATOR . $this->fileName; + $this->fileSystem = $this->_objectManager->get(Filesystem::class); + $this->sourceFilePath = __DIR__ . '/../../Import/_files' . DIRECTORY_SEPARATOR . $this->fileName; //Refers to tests 'var' directory - $this->varDirectory = $filesystem->getDirectoryRead(DirectoryList::VAR_DIR); - //Refers to application root directory - $rootDirectory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - $rootDirectory->copyFile($sourceFilePath, $this->varDirectory->getAbsolutePath($destinationFilePath)); + $this->varDirectory = $this->fileSystem->getDirectoryRead(DirectoryList::VAR_DIR); } /** * Check that file can be removed under var/export directory. * + * @param string $file + * @dataProvider testExecuteProvider * @return void * @magentoConfigFixture default_store admin/security/use_form_key 1 */ - public function testExecute(): void + public function testExecute($file): void { + $fullPath = 'export/' . $file; + $this->copyFile($fullPath); $request = $this->getRequest(); - $request->setParam('filename', $this->fileName); + $request->setParam('filename', $file); $request->setMethod(Http::METHOD_POST); - if ($this->varDirectory->isExist('export/' . $this->fileName)) { + if ($this->varDirectory->isExist($fullPath)) { $this->dispatch('backend/admin/export_file/delete'); } else { throw new \AssertionError('Export product file supposed to exist'); } - $this->assertFalse($this->varDirectory->isExist('export/' . $this->fileName)); + $this->assertFalse($this->varDirectory->isExist($fullPath)); + } + + /** + * Copy csv file from sourceFilePath to destinationFilePath + * + * @param $destinationFilePath + * @return void + */ + private function copyFile($destinationFilePath): void + { + //Refers to application root directory + $rootDirectory = $this->fileSystem->getDirectoryWrite(DirectoryList::ROOT); + $rootDirectory->copyFile($this->sourceFilePath, $this->varDirectory->getAbsolutePath($destinationFilePath)); + } + + /** + * Csv file path for copying from sourceFilePath and for future deleting + * + * @return array + */ + public static function testExecuteProvider(): array + { + return [ + ['catalog_product.csv'], + ['test/catalog_product.csv'] + ]; } /** diff --git a/dev/tests/integration/testsuite/Magento/ImportExport/Controller/Adminhtml/Export/File/DownloadTest.php b/dev/tests/integration/testsuite/Magento/ImportExport/Controller/Adminhtml/Export/File/DownloadTest.php index 073ecc6fd06a4..578df4290a99e 100644 --- a/dev/tests/integration/testsuite/Magento/ImportExport/Controller/Adminhtml/Export/File/DownloadTest.php +++ b/dev/tests/integration/testsuite/Magento/ImportExport/Controller/Adminhtml/Export/File/DownloadTest.php @@ -7,7 +7,6 @@ namespace Magento\ImportExport\Controller\Adminhtml\Export\File; -use Magento\Backend\Model\Auth\Session; use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\App\Request\Http; use Magento\Framework\Filesystem; @@ -16,7 +15,6 @@ use Magento\TestFramework\TestCase\AbstractBackendController; use Magento\Backend\Model\UrlInterface as BackendUrl; use Magento\Backend\Model\Auth; -use Magento\TestFramework\Bootstrap as TestBootstrap; /** * Test for \Magento\ImportExport\Controller\Adminhtml\Export\File\Download class. @@ -28,11 +26,6 @@ class DownloadTest extends AbstractBackendController */ private $fileName = 'catalog_product.csv'; - /** - * @var string - */ - private $filesize; - /** * @var Auth */ @@ -43,6 +36,21 @@ class DownloadTest extends AbstractBackendController */ private $backendUrl; + /** + * @var WriteInterface + */ + private $varDirectory; + + /** + * @var Filesystem + */ + private $fileSystem; + + /** + * @var string + */ + private $sourceFilePath; + /** * @inheritdoc */ @@ -50,31 +58,29 @@ protected function setUp() { parent::setUp(); - $filesystem = $this->_objectManager->get(Filesystem::class); + $this->fileSystem = $this->_objectManager->get(Filesystem::class); $auth = $this->_objectManager->get(Auth::class); $auth->getAuthStorage()->setIsFirstPageAfterLogin(false); $this->backendUrl = $this->_objectManager->get(BackendUrl::class); $this->backendUrl->turnOnSecretKey(); - - $sourceFilePath = __DIR__ . '/../../Import/_files' . DIRECTORY_SEPARATOR . $this->fileName; - $destinationFilePath = 'export' . DIRECTORY_SEPARATOR . $this->fileName; + $this->sourceFilePath = __DIR__ . '/../../Import/_files' . DIRECTORY_SEPARATOR . $this->fileName; //Refers to tests 'var' directory - $varDirectory = $filesystem->getDirectoryRead(DirectoryList::VAR_DIR); - //Refers to application root directory - $rootDirectory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - $rootDirectory->copyFile($sourceFilePath, $varDirectory->getAbsolutePath($destinationFilePath)); - $this->filesize = $varDirectory->stat($destinationFilePath)['size']; + $this->varDirectory = $this->fileSystem->getDirectoryRead(DirectoryList::VAR_DIR); } /** * Check that file can be downloaded. * + * @param string $file + * @dataProvider testExecuteProvider * @return void * @magentoConfigFixture default_store admin/security/use_form_key 1 * @magentoAppArea adminhtml */ - public function testExecute(): void + public function testExecute($file): void { + $this->copyFile('export/' . $file); + $fileSize = $this->varDirectory->stat('export/' . $file)['size']; $request = $this->getRequest(); list($routeName, $controllerName, $actionName) = explode('/', Download::URL); $request->setMethod(Http::METHOD_GET) @@ -104,12 +110,38 @@ public function testExecute(): void 'Incorrect response header "content-disposition"' ); $this->assertEquals( - $this->filesize, + $fileSize, $contentLength->getFieldValue(), 'Incorrect response header "content-length"' ); } + /** + * Copy csv file from sourceFilePath to destinationFilePath + * + * @param $destinationFilePath + * @return void + */ + private function copyFile($destinationFilePath): void + { + //Refers to application root directory + $rootDirectory = $this->fileSystem->getDirectoryWrite(DirectoryList::ROOT); + $rootDirectory->copyFile($this->sourceFilePath, $this->varDirectory->getAbsolutePath($destinationFilePath)); + } + + /** + * Csv file path for copying from sourceFilePath and for future deleting + * + * @return array + */ + public static function testExecuteProvider(): array + { + return [ + ['catalog_product.csv'], + ['test/catalog_product.csv'] + ]; + } + /** * @inheritdoc */ From 64c0d3ee1a99fb82b59bfd94d93a6d38d09b1440 Mon Sep 17 00:00:00 2001 From: Nikita Shcherbatykh <nikita.shcherbatykh@transoftgroup.com> Date: Thu, 9 Jan 2020 11:34:15 +0200 Subject: [PATCH 573/586] MC-30140: Some environment variables do not lock the settings in the backend --- .../Magento/Config/Block/System/Config/Form/Field.php | 6 +++++- .../Test/Unit/Block/System/Config/Form/FieldTest.php | 8 ++++---- lib/web/mage/adminhtml/form.js | 3 ++- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Config/Block/System/Config/Form/Field.php b/app/code/Magento/Config/Block/System/Config/Form/Field.php index e4b582a1f0504..ac4a85b7d3bc6 100644 --- a/app/code/Magento/Config/Block/System/Config/Form/Field.php +++ b/app/code/Magento/Config/Block/System/Config/Form/Field.php @@ -43,6 +43,10 @@ public function render(\Magento\Framework\Data\Form\Element\AbstractElement $ele $element->setDisabled(true); } + if ($element->getIsDisableInheritance()) { + $element->setReadonly(true); + } + $html = '<td class="label"><label for="' . $element->getHtmlId() . '"><span' . $this->_renderScopeLabel($element) . '>' . @@ -94,7 +98,7 @@ protected function _renderInheritCheckbox(\Magento\Framework\Data\Form\Element\A $htmlId = $element->getHtmlId(); $namePrefix = preg_replace('#\[value\](\[\])?$#', '', $element->getName()); $checkedHtml = $element->getInherit() == 1 ? 'checked="checked"' : ''; - $disabled = $element->getIsDisableInheritance() == true ? ' disabled="disabled"' : ''; + $disabled = $element->getIsDisableInheritance() == true ? ' disabled="disabled" readonly="1"' : ''; $html = '<td class="use-default">'; $html .= '<input id="' . diff --git a/app/code/Magento/Config/Test/Unit/Block/System/Config/Form/FieldTest.php b/app/code/Magento/Config/Test/Unit/Block/System/Config/Form/FieldTest.php index 6be1fe04b68dd..d942af9352e6c 100644 --- a/app/code/Magento/Config/Test/Unit/Block/System/Config/Form/FieldTest.php +++ b/app/code/Magento/Config/Test/Unit/Block/System/Config/Form/FieldTest.php @@ -7,8 +7,6 @@ /** * Test how class render field html element in Stores Configuration - * - * @package Magento\Config\Test\Unit\Block\System\Config\Form */ class FieldTest extends \PHPUnit\Framework\TestCase { @@ -72,6 +70,7 @@ protected function setUp() 'getCanUseDefaultValue', 'setDisabled', 'getTooltip', + 'setReadonly' ] ); @@ -179,7 +178,8 @@ public function testRenderInheritCheckbox() $this->_elementMock->expects($this->any())->method('getCanUseWebsiteValue')->will($this->returnValue(true)); $this->_elementMock->expects($this->any())->method('getCanUseDefaultValue')->will($this->returnValue(true)); $this->_elementMock->expects($this->once())->method('setDisabled')->with(true); - $this->_elementMock->expects($this->once())->method('getIsDisableInheritance')->willReturn(true); + $this->_elementMock->method('getIsDisableInheritance')->willReturn(true); + $this->_elementMock->method('setReadonly')->with(true); $expected = '<td class="use-default">'; $expected .= '<input id="' . @@ -187,7 +187,7 @@ public function testRenderInheritCheckbox() '_inherit" name="' . $this->_testData['name'] . '[inherit]" type="checkbox" value="1"' . - ' class="checkbox config-inherit" checked="checked"' . ' disabled="disabled"' . + ' class="checkbox config-inherit" checked="checked"' . ' disabled="disabled"' . ' readonly="1"' . ' onclick="toggleValueElements(this, Element.previous(this.parentNode))" /> '; $expected .= '<label for="' . $this->_testData['htmlId'] . '_inherit" class="inherit">Use Website</label>'; diff --git a/lib/web/mage/adminhtml/form.js b/lib/web/mage/adminhtml/form.js index 487c71484e4c5..4dfbde6afa9d7 100644 --- a/lib/web/mage/adminhtml/form.js +++ b/lib/web/mage/adminhtml/form.js @@ -494,7 +494,8 @@ define([ inputs.each(function (item) { // don't touch hidden inputs (and Use Default inputs too), bc they may have custom logic if ((!item.type || item.type != 'hidden') && !($(item.id + '_inherit') && $(item.id + '_inherit').checked) && //eslint-disable-line - !(currentConfig['can_edit_price'] != undefined && !currentConfig['can_edit_price']) //eslint-disable-line + !(currentConfig['can_edit_price'] != undefined && !currentConfig['can_edit_price']) && //eslint-disable-line + !item.getAttribute('readonly') //eslint-disable-line ) { item.disabled = false; jQuery(item).removeClass('ignore-validate'); From 592cb1e90eb42fd763fa71cbcaa588caaf3834c8 Mon Sep 17 00:00:00 2001 From: Myroslav Dobra <dmaraptor@gmail.com> Date: Thu, 9 Jan 2020 14:54:50 +0200 Subject: [PATCH 574/586] MC-30224: [2.4] Deleting an empty user model caused deleting admin role --- .../Magento/User/Model/ResourceModel/User.php | 33 +++++---- .../User/Model/ResourceModel/UserTest.php | 68 +++++++++++++------ 2 files changed, 67 insertions(+), 34 deletions(-) diff --git a/app/code/Magento/User/Model/ResourceModel/User.php b/app/code/Magento/User/Model/ResourceModel/User.php index b5927bbe4cef0..d9bc555b8e391 100644 --- a/app/code/Magento/User/Model/ResourceModel/User.php +++ b/app/code/Magento/User/Model/ResourceModel/User.php @@ -13,6 +13,7 @@ use Magento\Authorization\Model\UserContextInterface; use Magento\Framework\Acl\Data\CacheInterface; use Magento\Framework\App\ObjectManager; +use Magento\Framework\Exception\LocalizedException; use Magento\User\Model\Backend\Config\ObserverConfig; use Magento\User\Model\User as ModelUser; @@ -249,29 +250,33 @@ protected function _afterLoad(\Magento\Framework\Model\AbstractModel $user) * * @param \Magento\Framework\Model\AbstractModel $user * @return bool - * @throws \Magento\Framework\Exception\LocalizedException + * @throws LocalizedException */ public function delete(\Magento\Framework\Model\AbstractModel $user) { + $uid = $user->getId(); + if (!$uid) { + return false; + } + $this->_beforeDelete($user); $connection = $this->getConnection(); - - $uid = $user->getId(); $connection->beginTransaction(); - if ($uid) { - try { - $connection->delete($this->getMainTable(), ['user_id = ?' => $uid]); - $connection->delete( - $this->getTable('authorization_role'), - ['user_id = ?' => $uid, 'user_type = ?' => UserContextInterface::USER_TYPE_ADMIN] - ); - } catch (\Magento\Framework\Exception\LocalizedException $e) { - $connection->rollBack(); - return false; - } + try { + $connection->delete($this->getMainTable(), ['user_id = ?' => $uid]); + $connection->delete( + $this->getTable('authorization_role'), + ['user_id = ?' => $uid, 'user_type = ?' => UserContextInterface::USER_TYPE_ADMIN] + ); + } catch (LocalizedException $e) { + $connection->rollBack(); + + return false; } + $connection->commit(); $this->_afterDelete($user); + return true; } diff --git a/dev/tests/integration/testsuite/Magento/User/Model/ResourceModel/UserTest.php b/dev/tests/integration/testsuite/Magento/User/Model/ResourceModel/UserTest.php index d9f11b3d2f08e..0eabe3a214ec2 100644 --- a/dev/tests/integration/testsuite/Magento/User/Model/ResourceModel/UserTest.php +++ b/dev/tests/integration/testsuite/Magento/User/Model/ResourceModel/UserTest.php @@ -3,42 +3,60 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\User\Model\ResourceModel; use Magento\Authorization\Model\ResourceModel\Role\Collection as UserRoleCollection; +use Magento\Authorization\Model\ResourceModel\Role\CollectionFactory as UserRoleCollectionFactory; use Magento\Authorization\Model\UserContextInterface; use Magento\TestFramework\Helper\Bootstrap; use Magento\User\Model\ResourceModel\User as UserResourceModel; use Magento\User\Model\User; +use Magento\User\Model\UserFactory; /** * @magentoAppArea adminhtml */ class UserTest extends \PHPUnit\Framework\TestCase { - /** @var UserResourceModel */ + /** + * @var UserResourceModel + */ private $model; + /** + * @var UserRoleCollectionFactory + */ + private $userRoleCollectionFactory; + + /** + * @var UserFactory + */ + private $userFactory; + + /** + * @inheritdoc + */ protected function setUp() { - $this->model = Bootstrap::getObjectManager()->get( - UserResourceModel::class - ); + $this->model = Bootstrap::getObjectManager()->get(UserResourceModel::class); + $this->userRoleCollectionFactory = Bootstrap::getObjectManager()->get(UserRoleCollectionFactory::class); + $this->userFactory = Bootstrap::getObjectManager()->get(UserFactory::class); } /** * Tests if latest password is stored after user creating * when password lifetime config value is zero (disabled as fact) * + * @return void * @magentoConfigFixture current_store admin/security/password_lifetime 0 * @magentoDataFixture Magento/User/_files/dummy_user.php */ - public function testGetLatestPasswordWhenZeroPasswordLifetime() + public function testGetLatestPasswordWhenZeroPasswordLifetime(): void { /** @var User $user */ - $user = Bootstrap::getObjectManager()->create( - User::class - ); + $user = $this->userFactory->create(); $user->loadByUsername('dummy_username'); $latestPassword = $this->model->getLatestPassword($user->getId()); @@ -49,38 +67,48 @@ public function testGetLatestPasswordWhenZeroPasswordLifetime() } /** - * Test that user role is not deleted after deleting empty user + * Test that user role is not deleted after deleting empty user. + * + * @return void */ - public function testDelete() + public function testDelete(): void { $this->checkRoleCollectionSize(); /** @var User $user */ - $user = Bootstrap::getObjectManager()->create( - User::class - ); + $user = $this->userFactory->create(); $this->model->delete($user); $this->checkRoleCollectionSize(); } /** - * Ensure that role collection size is correct + * Ensure that role collection size is correct. + * + * @return void */ - private function checkRoleCollectionSize() + private function checkRoleCollectionSize(): void { /** @var UserRoleCollection $roleCollection */ - $roleCollection = Bootstrap::getObjectManager()->create( - UserRoleCollection::class - ); + $roleCollection = $this->userRoleCollectionFactory->create(); $roleCollection->setUserFilter(0, UserContextInterface::USER_TYPE_ADMIN); $this->assertEquals(1, $roleCollection->getSize()); } - public function testCountAll() + /** + * Check total user count. + * + * @return void + */ + public function testCountAll(): void { $this->assertSame(1, $this->model->countAll()); } - public function testGetValidationRulesBeforeSave() + /** + * Check validation rules has correct type. + * + * @return void + */ + public function testGetValidationRulesBeforeSave(): void { $rules = $this->model->getValidationRulesBeforeSave(); $this->assertInstanceOf('Zend_Validate_Interface', $rules); From 78a3b4d0aeac3ba4074bd04f3b9f717fca91b3f8 Mon Sep 17 00:00:00 2001 From: Soumya Unnikrishnan <sunnikri@adobe.com> Date: Thu, 9 Jan 2020 09:56:54 -0600 Subject: [PATCH 575/586] MQE-1920: [MTF-To-MFTF] Process PR 701 Added scroll to page content. --- .../Test/Mftf/ActionGroup/FillOutCMSPageContentActionGroup.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/FillOutCMSPageContentActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/FillOutCMSPageContentActionGroup.xml index a4ffff5c8760a..0ee195ae13a3c 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/FillOutCMSPageContentActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/FillOutCMSPageContentActionGroup.xml @@ -16,7 +16,7 @@ <fillField selector="{{CmsNewPagePageBasicFieldsSection.pageTitle}}" userInput="{{_duplicatedCMSPage.title}}" stepKey="fillFieldTitle"/> <click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickExpandContentTabForPage"/> <fillField selector="{{CmsNewPagePageContentSection.contentHeading}}" userInput="{{_duplicatedCMSPage.content_heading}}" stepKey="fillFieldContentHeading"/> - <wait time="5" stepKey="waitForTextAreaToAppear"/> + <scrollTo selector="{{CmsNewPagePageContentSection.content}}" stepKey="scrollToPageContent"/> <fillField selector="{{CmsNewPagePageContentSection.content}}" userInput="{{_duplicatedCMSPage.content}}" stepKey="fillFieldContent"/> <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_duplicatedCMSPage.identifier}}" stepKey="fillFieldUrlKey"/> From a07ddfe2d91723eec53acb418b9ab1019799f764 Mon Sep 17 00:00:00 2001 From: Soumya Unnikrishnan <sunnikri@adobe.com> Date: Thu, 9 Jan 2020 10:50:21 -0600 Subject: [PATCH 576/586] MQE-1920: [MTF-To-MFTF] Process PR 701 Moved CMS tests with FillOutCMSPageContent step to WYSIWYGDisabledSuite. --- .../Test/Mftf/Test/AdminCMSPageCreatePageForDefaultStoreTest.xml | 1 + .../Mftf/Test/AdminCMSPageCreatePageInSingleStoreModeTest.xml | 1 + .../Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageTest.xml | 1 + .../Cms/Test/Mftf/Test/AdminCMSPageCreatePageWithBlockTest.xml | 1 + 4 files changed, 4 insertions(+) diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageForDefaultStoreTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageForDefaultStoreTest.xml index b381ae429ed2b..a9f5fcd8b17e0 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageForDefaultStoreTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageForDefaultStoreTest.xml @@ -17,6 +17,7 @@ <group value="backend"/> <group value="Cms"/> <group value="mtf_migrated"/> + <group value="WYSIWYGDisabled"/> </annotations> <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageInSingleStoreModeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageInSingleStoreModeTest.xml index ef083ae61069d..1ec85f90f46ef 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageInSingleStoreModeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageInSingleStoreModeTest.xml @@ -17,6 +17,7 @@ <group value="backend"/> <group value="Cms"/> <group value="mtf_migrated"/> + <group value="WYSIWYGDisabled"/> </annotations> <before> <magentoCLI command="config:set {{StorefrontSingleStoreModeEnabledConfigData.path}} {{StorefrontSingleStoreModeEnabledConfigData.value}}" stepKey="enableSingleStoreMode" /> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageTest.xml index 536c7055c9932..947fa92f2c8ff 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageTest.xml @@ -17,6 +17,7 @@ <group value="backend"/> <group value="Cms"/> <group value="mtf_migrated"/> + <group value="WYSIWYGDisabled"/> </annotations> <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageWithBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageWithBlockTest.xml index 396507dddaca1..a6c67dc61dd97 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageWithBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageWithBlockTest.xml @@ -17,6 +17,7 @@ <group value="backend"/> <group value="Cms"/> <group value="mtf_migrated"/> + <group value="WYSIWYGDisabled"/> </annotations> <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> From 7a4b904b9af51c82cea74b53dc9392b305942803 Mon Sep 17 00:00:00 2001 From: Soumya Unnikrishnan <sunnikri@adobe.com> Date: Thu, 9 Jan 2020 11:35:44 -0600 Subject: [PATCH 577/586] MQE-1920: [MTF-To-MFTF] Process PR 701 Adding cache flush to fix B2B failure. --- .../Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml index d0502b41e2856..99b2b2e6782af 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml @@ -36,6 +36,8 @@ <updateData createDataKey="createGuestCart" entity="GuestOrderPaymentMethod" stepKey="sendGuestPaymentInformation"> <requiredEntity createDataKey="createGuestCart"/> </updateData> + <magentoCLI command="indexer:reindex" stepKey="reindex"/> + <magentoCLI command="cache:flush" stepKey="flushCache"/> <!--END Create order via API--> </before> <after> From 6c3a643d22d5e5c436b47e68c90acc87af7fdcb8 Mon Sep 17 00:00:00 2001 From: Soumya Unnikrishnan <sunnikri@adobe.com> Date: Thu, 9 Jan 2020 13:05:00 -0600 Subject: [PATCH 578/586] MQE-1920: [MTF-To-MFTF] Process PR 701 Adding cache flush to fix EE failure. --- .../AddressStateFieldShouldNotAcceptJustIntegerValuesTest.xml | 2 ++ .../Cms/Test/Mftf/Test/AdminCMSPageCreateDisabledPageTest.xml | 1 + 2 files changed, 3 insertions(+) diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/AddressStateFieldShouldNotAcceptJustIntegerValuesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/AddressStateFieldShouldNotAcceptJustIntegerValuesTest.xml index f3e31d23f715b..dd454d7aca10b 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/AddressStateFieldShouldNotAcceptJustIntegerValuesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/AddressStateFieldShouldNotAcceptJustIntegerValuesTest.xml @@ -23,6 +23,8 @@ <createData entity="ApiSimpleProduct" stepKey="createProduct"> <requiredEntity createDataKey="createCategory"/> </createData> + <magentoCLI command="indexer:reindex" stepKey="reindex"/> + <magentoCLI command="cache:flush" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreateDisabledPageTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreateDisabledPageTest.xml index b2def26279dc5..5b83807eca244 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreateDisabledPageTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreateDisabledPageTest.xml @@ -17,6 +17,7 @@ <group value="backend"/> <group value="Cms"/> <group value="mtf_migrated"/> + <group value="WYSIWYGDisabled"/> </annotations> <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> From 02727a8c14be4ae2ba5a3efe6ccd8ab1b34d25cf Mon Sep 17 00:00:00 2001 From: Soumya Unnikrishnan <sunnikri@adobe.com> Date: Fri, 10 Jan 2020 11:44:53 -0600 Subject: [PATCH 579/586] MQE-1931: [MTF-To-MFTF] Process PR 718 Added cache flush to resolve ee b2b jenkins errors --- .../Test/Mftf/Test/AdminCreateActiveHtmlTermEntityTest.xml | 2 ++ .../Test/Mftf/Test/AdminCreateActiveTextTermEntityTest.xml | 2 ++ .../Test/Mftf/Test/AdminCreateDisabledTextTermEntityTest.xml | 2 ++ .../AdminCreateEnabledTextTermOnMultishippingEntityTest.xml | 2 ++ 4 files changed, 8 insertions(+) diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveHtmlTermEntityTest.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveHtmlTermEntityTest.xml index 3b180576b557c..dc329ae63ba21 100644 --- a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveHtmlTermEntityTest.xml +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveHtmlTermEntityTest.xml @@ -23,6 +23,8 @@ <magentoCLI command="config:set checkout/options/enable_agreements 1" stepKey="setEnableTermsOnCheckout"/> <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin" /> <createData entity="SimpleTwo" stepKey="createdProduct"/> + <magentoCLI command="indexer:reindex" stepKey="reindex"/> + <magentoCLI command="cache:flush" stepKey="flushCache"/> </before> <after> <magentoCLI command="config:set checkout/options/enable_agreements 0" stepKey="setDisableTermsOnCheckout"/> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveTextTermEntityTest.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveTextTermEntityTest.xml index 9b2d3da9ece34..a7baa061750c5 100644 --- a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveTextTermEntityTest.xml +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveTextTermEntityTest.xml @@ -23,6 +23,8 @@ <magentoCLI command="config:set checkout/options/enable_agreements 1" stepKey="setEnableTermsOnCheckout"/> <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin" /> <createData entity="SimpleTwo" stepKey="createdProduct"/> + <magentoCLI command="indexer:reindex" stepKey="reindex"/> + <magentoCLI command="cache:flush" stepKey="flushCache"/> </before> <after> <magentoCLI command="config:set checkout/options/enable_agreements 0" stepKey="setDisableTermsOnCheckout"/> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateDisabledTextTermEntityTest.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateDisabledTextTermEntityTest.xml index 8a1efcdce85e1..d5f35fc79fbed 100644 --- a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateDisabledTextTermEntityTest.xml +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateDisabledTextTermEntityTest.xml @@ -23,6 +23,8 @@ <magentoCLI command="config:set checkout/options/enable_agreements 1" stepKey="setEnableTermsOnCheckout"/> <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin" /> <createData entity="SimpleTwo" stepKey="createdProduct"/> + <magentoCLI command="indexer:reindex" stepKey="reindex"/> + <magentoCLI command="cache:flush" stepKey="flushCache"/> </before> <after> <magentoCLI command="config:set checkout/options/enable_agreements 0" stepKey="setDisableTermsOnCheckout"/> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateEnabledTextTermOnMultishippingEntityTest.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateEnabledTextTermOnMultishippingEntityTest.xml index 93e8e6a01d543..462b13ae386c4 100644 --- a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateEnabledTextTermOnMultishippingEntityTest.xml +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateEnabledTextTermOnMultishippingEntityTest.xml @@ -25,6 +25,8 @@ <createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="createdCustomer"/> <createData entity="SimpleTwo" stepKey="createdProduct1"/> <createData entity="SimpleTwo" stepKey="createdProduct2"/> + <magentoCLI command="indexer:reindex" stepKey="reindex"/> + <magentoCLI command="cache:flush" stepKey="flushCache"/> </before> <after> <magentoCLI command="config:set checkout/options/enable_agreements 0" stepKey="setDisableTermsOnCheckout"/> From fa932951dffc557d0de2dd150edec16666be65e3 Mon Sep 17 00:00:00 2001 From: Soumya Unnikrishnan <sunnikri@adobe.com> Date: Fri, 10 Jan 2020 14:47:14 -0600 Subject: [PATCH 580/586] MQE-1931: [MTF-To-MFTF] Process PR 718 Added scroll to description for WebDriverException --- .../Test/AdminUpdateCategoryWithInactiveIncludeInMenuTest.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryWithInactiveIncludeInMenuTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryWithInactiveIncludeInMenuTest.xml index 3fea9c0eed7ca..0c705c180d073 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryWithInactiveIncludeInMenuTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryWithInactiveIncludeInMenuTest.xml @@ -39,6 +39,7 @@ <click selector="{{AdminCategoryBasicFieldSection.includeInMenuLabel}}" stepKey="disableIncludeInMenu"/> <scrollTo selector="{{AdminCategoryContentSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToContent"/> <click selector="{{AdminCategoryContentSection.sectionHeader}}" stepKey="selectContent"/> + <scrollTo selector="{{AdminCategoryContentSection.description}}" x="0" y="-80" stepKey="scrollToDescription"/> <fillField selector="{{AdminCategoryContentSection.description}}" userInput="Updated category Description Fields" stepKey="fillUpdatedDescription"/> <scrollTo selector="{{AdminCategorySEOSection.SectionHeader}}" x="0" y="-80" stepKey="scrollToSearchEngineOptimization"/> <click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="selectSearchEngineOptimization"/> From 73899c3df37f49128d81cd4ce37edc09b40df60d Mon Sep 17 00:00:00 2001 From: Soumya Unnikrishnan <sunnikri@adobe.com> Date: Sat, 11 Jan 2020 19:02:58 -0600 Subject: [PATCH 581/586] MQE-1931: [MTF-To-MFTF] Process PR 718 Added wait for page load to fix jenkins failure --- .../Test/Mftf/Test/AdminAdvancedReportingNavigateMenuTest.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Analytics/Test/Mftf/Test/AdminAdvancedReportingNavigateMenuTest.xml b/app/code/Magento/Analytics/Test/Mftf/Test/AdminAdvancedReportingNavigateMenuTest.xml index 67d6715285697..d400bcf5f22fc 100644 --- a/app/code/Magento/Analytics/Test/Mftf/Test/AdminAdvancedReportingNavigateMenuTest.xml +++ b/app/code/Magento/Analytics/Test/Mftf/Test/AdminAdvancedReportingNavigateMenuTest.xml @@ -30,6 +30,7 @@ <argument name="submenuUiId" value="{{AdminMenuReportsBusinessIntelligenceAdvancedReporting.dataUiId}}"/> </actionGroup> <switchToNextTab stepKey="switchToNewTab"/> + <waitForPageLoad stepKey="waitForAdvancedReportingPageLoad"/> <seeInCurrentUrl url="advancedreporting.rjmetrics.com/report" stepKey="seeAssertAdvancedReportingPageUrl"/> </test> </tests> From ede11880e0c3875dce7e53f27fa5b1bff123f77c Mon Sep 17 00:00:00 2001 From: Myroslav Dobra <dmaraptor@gmail.com> Date: Mon, 13 Jan 2020 13:18:32 +0200 Subject: [PATCH 582/586] MC-29023: Custom attribute values cannot be saved in Admin panel --- .../Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest.xml index 917a4ac58464f..861f379988031 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest.xml @@ -17,6 +17,9 @@ <severity value="CRITICAL"/> <testCaseId value="MC-5922"/> <group value="checkout"/> + <skip> + <issueId value="MC-30111"/> + </skip> </annotations> <before> <createData entity="SimpleSubCategory" stepKey="simplecategory"/> From cff53539219c749b7406c5ec0795e47ce71ff915 Mon Sep 17 00:00:00 2001 From: David Haecker <dhaecker@magento.com> Date: Mon, 13 Jan 2020 08:47:15 -0600 Subject: [PATCH 583/586] MC-23535: Fix Skipped MFTF Tests MC-28537 - Removing enable wysiwyg which breaks following test in suite - Unskipping AdminProductImageAssignmentForMultipleStoresTest --- .../Test/AdminCreateAndEditVirtualProductSettingsTest.xml | 4 ++-- .../Test/AdminProductImageAssignmentForMultipleStoresTest.xml | 3 --- .../Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGCMSTest.xml | 1 + 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditVirtualProductSettingsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditVirtualProductSettingsTest.xml index 34451aba78f21..70cbfe7259da0 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditVirtualProductSettingsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditVirtualProductSettingsTest.xml @@ -51,7 +51,7 @@ <actionGroup ref="logout" stepKey="adminLogout"/> </after> - <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> + <comment userInput="remove me" stepKey="disableWYSIWYG"/> <!-- Create new virtual product --> <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createVirtualProduct"> @@ -185,6 +185,6 @@ <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/> <dontSeeElement selector="{{StorefrontProductCartGiftOptionSection.giftOptions}}" stepKey="dontSeeGiftOptionBtn"/> - <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> + <comment userInput="remove me" stepKey="enableWYSIWYG"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductImageAssignmentForMultipleStoresTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductImageAssignmentForMultipleStoresTest.xml index 455e77666c3a2..59be8157d2f87 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductImageAssignmentForMultipleStoresTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductImageAssignmentForMultipleStoresTest.xml @@ -18,9 +18,6 @@ <testCaseId value="MAGETWO-58718"/> <group value="product"/> <group value="WYSIWYGDisabled"/> - <skip> - <issueId value="MC-13841"/> - </skip> </annotations> <before> <!-- Login Admin --> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGCMSTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGCMSTest.xml index dd45c6768e67f..201a84ecb3c65 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGCMSTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGCMSTest.xml @@ -55,6 +55,7 @@ <seeElement selector="{{StorefrontCMSPageSection.mediaDescription}}" stepKey="assertMediaDescription"/> <seeElementInDOM selector="{{StorefrontCMSPageSection.imageSource(ImageUpload3.fileName)}}" stepKey="assertMediaSource"/> <after> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYGFirst"/> <deleteData createDataKey="createCMSPage" stepKey="deletePreReqCMSPage" /> <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> From 974f72259a91a9054fd0c24f06b5b632db65fd60 Mon Sep 17 00:00:00 2001 From: Myroslav Dobra <dmaraptor@gmail.com> Date: Mon, 13 Jan 2020 17:57:42 +0200 Subject: [PATCH 584/586] MC-29023: Custom attribute values cannot be saved in Admin panel --- .../Test/Mftf/Test/StorefrontInactiveCatalogRuleTest.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/StorefrontInactiveCatalogRuleTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/StorefrontInactiveCatalogRuleTest.xml index a4fc6757ae6cb..3423baf7970eb 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/StorefrontInactiveCatalogRuleTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/StorefrontInactiveCatalogRuleTest.xml @@ -17,6 +17,9 @@ <severity value="CRITICAL"/> <testCaseId value="MC-79"/> <group value="CatalogRule"/> + <skip> + <issueId value="MC-30384"/> + </skip> </annotations> <before> <actionGroup ref="LoginAsAdmin" stepKey="login"/> From 55fd41846c0b33971f8112dacf7f9dddea532bf6 Mon Sep 17 00:00:00 2001 From: Raoul Rego <rrego@adobe.com> Date: Mon, 13 Jan 2020 12:42:13 -0600 Subject: [PATCH 585/586] MC-30288: Hidden PHP Notice and Warning in tests - Handle PHP warning as error during transaction in test run. - Update integration/phpunit.xml Magento TestListeners after AllureAdapter. --- .../TestFramework/Event/Transaction.php | 19 +++++++++++++++++-- dev/tests/integration/phpunit.xml.dist | 5 +++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/dev/tests/integration/framework/Magento/TestFramework/Event/Transaction.php b/dev/tests/integration/framework/Magento/TestFramework/Event/Transaction.php index 9ab6d67014129..2add2ed48fb98 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Event/Transaction.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Event/Transaction.php @@ -4,11 +4,11 @@ * See COPYING.txt for license details. */ +namespace Magento\TestFramework\Event; + /** * Database transaction events manager */ -namespace Magento\TestFramework\Event; - class Transaction { /** @@ -86,6 +86,7 @@ protected function _processTransactionRequests($eventName, \PHPUnit\Framework\Te * Start transaction and fire 'startTransaction' event * * @param \PHPUnit\Framework\TestCase $test + * @SuppressWarnings(PHPMD.UnusedLocalVariable) */ protected function _startTransaction(\PHPUnit\Framework\TestCase $test) { @@ -93,7 +94,21 @@ protected function _startTransaction(\PHPUnit\Framework\TestCase $test) $this->_getConnection()->beginTransparentTransaction(); $this->_isTransactionActive = true; try { + /** + * Add any warning during transaction execution as a failure. + */ + set_error_handler( + function ($errNo, $errStr, $errFile, $errLine) use ($test) { + $errMsg = sprintf("%s: %s in %s:%s.", "Warning", $errStr, $errFile, $errLine); + $test->getTestResultObject()->addError($test, new \PHPUnit\Framework\Warning($errMsg), 0); + + // Allow error to be handled by next error handler + return false; + }, + E_WARNING + ); $this->_eventManager->fireEvent('startTransaction', [$test]); + restore_error_handler(); } catch (\Exception $e) { $test->getTestResultObject()->addFailure( $test, diff --git a/dev/tests/integration/phpunit.xml.dist b/dev/tests/integration/phpunit.xml.dist index 858de7a9873e7..56812163ed5f2 100644 --- a/dev/tests/integration/phpunit.xml.dist +++ b/dev/tests/integration/phpunit.xml.dist @@ -78,8 +78,6 @@ </php> <!-- Test listeners --> <listeners> - <listener class="Magento\TestFramework\Event\PhpUnit"/> - <listener class="Magento\TestFramework\ErrorLog\Listener"/> <listener class="Yandex\Allure\Adapter\AllureAdapter"> <arguments> <string>var/allure-results</string> <!-- XML files output directory --> @@ -127,5 +125,8 @@ </array> </arguments> </listener> + <!-- Run after AllureAdapter to allow it to initialize properly --> + <listener class="Magento\TestFramework\Event\PhpUnit"/> + <listener class="Magento\TestFramework\ErrorLog\Listener"/> </listeners> </phpunit> From 5e9f1b35e666b5adec383d289c8e2a27a30fb190 Mon Sep 17 00:00:00 2001 From: Myroslav Dobra <dmaraptor@gmail.com> Date: Tue, 14 Jan 2020 12:30:28 +0200 Subject: [PATCH 586/586] MC-29023: Custom attribute values cannot be saved in Admin panel --- .../Catalog/Test/Mftf/Test/AdminCreateDuplicateProductTest.xml | 3 +++ .../Mftf/Test/AdminUrlRewritesForProductAfterImportTest.xml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDuplicateProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDuplicateProductTest.xml index 4507e1f880a86..b74efe18af708 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDuplicateProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDuplicateProductTest.xml @@ -15,6 +15,9 @@ <testCaseId value="MC-14714"/> <severity value="CRITICAL"/> <group value="mtf_migrated"/> + <skip> + <issueId value="MC-30409"/> + </skip> </annotations> <before> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductAfterImportTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductAfterImportTest.xml index a3d3b897ef75d..88c28230b8347 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductAfterImportTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductAfterImportTest.xml @@ -16,6 +16,9 @@ <severity value="MAJOR"/> <testCaseId value="MC-20229"/> <group value="urlRewrite"/> + <skip> + <issueId value="MC-30409"/> + </skip> </annotations> <before> <comment userInput="Set the configuration for Generate category/product URL Rewrites" stepKey="commentSetURLRewriteConfiguration" />